Files
oak-editor/app/window/mainwindow/mainwindowlayoutinfo.h
T
itsmattkc 0280ade20d project: improved main window layout loading
There were a lot of issues that arose from trying to make GUI changes
from another thread (even though we ran those functions in the right
thread). Now we store layout information until the end of the load and
make the changes then. This works much better from both a business logic
and user experience perspective.

Also prevents multiple sequences from taking focus during load and
starting a render job.
2020-06-19 02:23:06 +10:00

53 lines
939 B
C++

#ifndef MAINWINDOWLAYOUTINFO_H
#define MAINWINDOWLAYOUTINFO_H
#include "project/item/folder/folder.h"
#include "project/item/sequence/sequence.h"
OLIVE_NAMESPACE_ENTER
class MainWindowLayoutInfo
{
public:
MainWindowLayoutInfo() = default;
void toXml(QXmlStreamWriter* writer) const;
static MainWindowLayoutInfo fromXml(QXmlStreamReader* reader, XMLNodeData &xml_data);
void add_folder(Folder* f);
void add_sequence(Sequence* s);
void set_state(const QByteArray& layout);
const QList<Folder*>& open_folders() const
{
return open_folders_;
}
const QList<Sequence*>& open_sequences() const
{
return open_sequences_;
}
const QByteArray& state() const
{
return state_;
}
private:
QByteArray state_;
QList<Folder*> open_folders_;
QList<Sequence*> open_sequences_;
};
OLIVE_NAMESPACE_EXIT
Q_DECLARE_METATYPE(OLIVE_NAMESPACE::MainWindowLayoutInfo)
#endif // MAINWINDOWLAYOUTINFO_H