summaryrefslogtreecommitdiff
path: root/muse2/muse/cobject.h
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-08-16 16:27:54 +0000
committerFlorian Jung <flo@windfisch.org>2011-08-16 16:27:54 +0000
commit6b5e69ff5def2c8469657e33413bec84d815df9d (patch)
tree71bf8eb1a0ae14c20529dc35b91b14e0b43a560a /muse2/muse/cobject.h
parent23f3026199641b6e2a2af69e10353cbe304e5649 (diff)
this is only a backup commit
toolbar states are now saved also for shared toolbars toolbar and window state saving is now handled in TopWin TODO: finish list, cliplist, masterlist, marker, arranger
Diffstat (limited to 'muse2/muse/cobject.h')
-rw-r--r--muse2/muse/cobject.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h
index a106702a..ba731d1e 100644
--- a/muse2/muse/cobject.h
+++ b/muse2/muse/cobject.h
@@ -13,6 +13,7 @@
#include <QMainWindow>
#include <list>
+#include <QByteArray>
class QMdiSubWindow;
class QFocusEvent;
@@ -29,12 +30,12 @@ class TopWin : public QMainWindow
Q_OBJECT
public:
- enum ToplevelType { PIANO_ROLL, LISTE, DRUM, MASTER, WAVE,
- LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER,
+ enum ToplevelType { PIANO_ROLL=0, LISTE, DRUM, MASTER, WAVE, //there shall be no
+ LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER, //gaps in the enum!
#ifdef PATCHBAY
M_PATCHBAY,
#endif /* PATCHBAY */
- LAST_ENTRY
+ TOPLEVELTYPE_LAST_ENTRY //this has to be always the last entry
};
ToplevelType type() const { return _type; }
@@ -42,6 +43,10 @@ class TopWin : public QMainWindow
virtual void readStatus(Xml&);
virtual void writeStatus(int, Xml&) const;
+
+ static void readConfiguration(ToplevelType, Xml&);
+ static void writeConfiguration(ToplevelType, int, Xml&);
+
bool isMdiWin();
@@ -55,8 +60,6 @@ class TopWin : public QMainWindow
QToolBar* addToolBar(const QString& title);
private:
- ToplevelType _type;
-
QMdiSubWindow* mdisubwin;
bool _sharesToolsAndMenu;
std::list<QToolBar*> _toolbars;
@@ -68,15 +71,30 @@ class TopWin : public QMainWindow
void addToolBar(Qt::ToolBarArea, QToolBar*);
virtual QMdiSubWindow* createMdiWrapper();
+
protected:
QAction* subwinAction;
+
+ ToplevelType _type;
+
+ static int _widthInit[TOPLEVELTYPE_LAST_ENTRY];
+ static int _heightInit[TOPLEVELTYPE_LAST_ENTRY];
+ static QByteArray _toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY];
+ static QByteArray _toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY];
+ static bool initInited;
+
+ void initTopwinState();
+
+ bool initalizing; //if true, no state is saved
public slots:
virtual void hide();
virtual void show();
virtual void setVisible(bool);
void setIsMdiWin(bool);
+ void restoreMainwinState();
+ void storeInitialState();
signals:
void toolsAndMenuSharingChanged(bool);