summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/cobject.cpp29
-rw-r--r--muse2/muse/cobject.h6
2 files changed, 20 insertions, 15 deletions
diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp
index 398f8be7..2c60a90c 100644
--- a/muse2/muse/cobject.cpp
+++ b/muse2/muse/cobject.cpp
@@ -77,15 +77,20 @@ void TopWin::readStatus(Xml& xml)
QString tag = xml.s1();
switch (token) {
case Xml::TagStart:
- if (tag == "geometry") {
- QRect r(readGeometry(xml, tag));
- resize(r.size());
- move(r.topLeft());
+ if (tag == "geometry_state") {
+ if (!restoreGeometry(QByteArray::fromHex(xml.parse1().toAscii())))
+ fprintf(stderr,"ERROR: couldn't restore geometry. however, this is probably not really a problem.\n");
}
else if (tag == "toolbars") {
if (!restoreState(QByteArray::fromHex(xml.parse1().toAscii())))
fprintf(stderr,"ERROR: couldn't restore toolbars. however, this is not really a problem.\n");
}
+ else if (tag == "shares_menu") {
+ shareToolsAndMenu(xml.parseInt());
+ }
+ else if (tag == "is_subwin") {
+ setIsMdiWin(xml.parseInt());
+ }
else
xml.unknown("TopWin");
break;
@@ -105,13 +110,13 @@ void TopWin::readStatus(Xml& xml)
void TopWin::writeStatus(int level, Xml& xml) const
{
xml.tag(level++, "topwin");
- xml.tag(level++, "geometry x=\"%d\" y=\"%d\" w=\"%d\" h=\"%d\"",
- geometry().x(),
- geometry().y(),
- geometry().width(),
- geometry().height());
- xml.tag(level--, "/geometry");
+ // the order of these tags has a certain sense
+ // changing it won't break muse, but it may break proper
+ // restoring of the positions
+ xml.intTag(level, "is_subwin", isMdiWin());
+ xml.strTag(level, "geometry_state", saveGeometry().toHex().data());
+ xml.intTag(level, "shares_menu", sharesToolsAndMenu());
xml.strTag(level, "toolbars", saveState().toHex().data());
xml.tag(level, "/topwin");
@@ -204,7 +209,7 @@ void TopWin::setIsMdiWin(bool val)
}
}
-bool TopWin::isMdiWin()
+bool TopWin::isMdiWin() const
{
return (mdisubwin!=NULL);
}
@@ -270,7 +275,7 @@ void TopWin::shareToolsAndMenu(bool val)
// storeInitialState
//---------------------------------------------------------
-void TopWin::storeInitialState()
+void TopWin::storeInitialState() const
{
if (initalizing)
printf("THIS SHOULD NEVER HAPPEN: STORE INIT STATE CALLED WHILE INITING! please IMMEDIATELY report that to flo!\n");
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h
index 6b982747..e934aff0 100644
--- a/muse2/muse/cobject.h
+++ b/muse2/muse/cobject.h
@@ -50,11 +50,11 @@ class TopWin : public QMainWindow
static void writeConfiguration(ToplevelType, int, Xml&);
- bool isMdiWin();
+ bool isMdiWin() const;
TopWin(ToplevelType t, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window);
- bool sharesToolsAndMenu() { return _sharesToolsAndMenu; }
+ bool sharesToolsAndMenu() const { return _sharesToolsAndMenu; }
const std::list<QToolBar*>& toolbars() { return _toolbars; }
void addToolBar(QToolBar* toolbar);
@@ -103,7 +103,7 @@ class TopWin : public QMainWindow
void setIsMdiWin(bool);
void shareToolsAndMenu(bool);
void restoreMainwinState();
- void storeInitialState();
+ void storeInitialState() const;
};