# # # patch "guitone/res/forms/main_window.ui" # from [09435419a1a50121c1dc99c17cf040aca87979e6] # to [20c5b181ac6cb09b31cc40f75db6f47a96e729f0] # # patch "guitone/src/Guitone.cpp" # from [3d2fc357d784342f3a39c31ca04bdc8380904c25] # to [5a5e1d7691fe0761c3d97d465597519baa29e769] # # patch "guitone/src/view/MainWindow.cpp" # from [783f6c86b19c247880f2c0c4d4dcf6fb73ba71c8] # to [b95cf564f73f23a921217084ae86f59b240f0340] # # patch "guitone/src/view/MainWindow.h" # from [828be9d558d41e9593b3d6e764a5987f3b99ad67] # to [45fbbfbc9007550fe3779bc57541663a413a4196] # ============================================================ --- guitone/res/forms/main_window.ui 09435419a1a50121c1dc99c17cf040aca87979e6 +++ guitone/res/forms/main_window.ui 20c5b181ac6cb09b31cc40f75db6f47a96e729f0 @@ -5,8 +5,8 @@ 0 0 - 862 - 703 + 734 + 526 @@ -24,99 +24,90 @@ 6 - - + + 0 - - 6 - - - - - - 0 - - - 0 - - - + + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + QAbstractItemView::ExtendedSelection + + + - Qt::Horizontal + Qt::Vertical - + QAbstractItemView::ExtendedSelection - - - Qt::Vertical - - - - QAbstractItemView::ExtendedSelection - - - - + - - - - - - - - - 9 - - - 6 - - - - - Loaded database: %1 - - - Qt::PlainText - - - Qt::AlignCenter - - - - - - - - - - - 9 - - - 6 - - - - - Currently there is no workspace or database loaded. + + + + + + + + 0 + + + 0 + + + + + Loaded database: %1 + + + Qt::PlainText + + + Qt::AlignCenter + + + + + + + + + 0 + + + 0 + + + + + Currently there is no workspace or database loaded. To open a workspace, go to File > Open workspace or File > Open Database for a database respectively. - - - Qt::AlignCenter - - - - - - - + + + Qt::AlignCenter + + + + + + @@ -125,7 +116,7 @@ or File > Open Database for a database r 0 0 - 862 + 734 22 @@ -455,11 +446,6 @@ or File > Open Database for a database r - InventoryView - QTreeView -
../InventoryView.h
-
- Splitter QSplitter
../Splitter.h
@@ -469,6 +455,11 @@ or File > Open Database for a database r QTreeView
../AttributesView.h
+ + InventoryView + QTreeView +
../InventoryView.h
+
============================================================ --- guitone/src/Guitone.cpp 3d2fc357d784342f3a39c31ca04bdc8380904c25 +++ guitone/src/Guitone.cpp 5a5e1d7691fe0761c3d97d465597519baa29e769 @@ -269,15 +269,22 @@ void Guitone::quit() void Guitone::quit() { - Settings::sync(); - - // close all open windows - foreach (MainWindow * wnd, openWindows) + // do we need to close any windows? + if (openWindows.size() > 0) { - removeMonotoneInstance(wnd); - removeWindow(wnd); + // let all open windows close themselves to allow them cleaning up + // stuff and saving settings + // note that if the last window is closed, quit() is called again, + // so we return here after closing all windows to avoid recursion + // problems + foreach (MainWindow * wnd, openWindows) + { + wnd->close(); + } + return; } + Settings::sync(); QApplication::quit(); } ============================================================ --- guitone/src/view/MainWindow.cpp 783f6c86b19c247880f2c0c4d4dcf6fb73ba71c8 +++ guitone/src/view/MainWindow.cpp b95cf564f73f23a921217084ae86f59b240f0340 @@ -145,8 +145,6 @@ MainWindow::MainWindow() // after laying out everything, restore the splitter views mainSplitter->init(); listSplitter->init(); - - restoreGeometry(Settings::getWindowGeometry("MainWindow")); } MainWindow::~MainWindow() {} @@ -229,7 +227,7 @@ void MainWindow::closeEvent(QCloseEvent void MainWindow::closeEvent(QCloseEvent *event) { // the last closed window sets the geometry for the next one which is opened - Settings::setWindowGeometry(saveGeometry(), "MainWindow"); + Settings::setWindowGeometry(saveGeometry(), "MainWindow_mode" + mode); event->accept(); emit windowClosed(this); } @@ -282,11 +280,12 @@ void MainWindow::switchMode(Mode m) // title - we should find an easy way to tell all other windows about // that so a user can still recognize the entry properly mode = m; + windowMode->setCurrentIndex(mode); + restoreGeometry(Settings::getWindowGeometry("MainWindow_mode" + mode)); + updateGeometry(); + if (mode == Database) { - databaseModeWidget->setVisible(true); - workspaceModeWidget->setVisible(false); - noneModeWidget->setVisible(false); menuView->menuAction()->setVisible(false); menuWorkspace->menuAction()->setVisible(false); menuDatabase->menuAction()->setVisible(true); @@ -305,9 +304,6 @@ void MainWindow::switchMode(Mode m) else if (mode == Workspace) { - databaseModeWidget->setVisible(false); - workspaceModeWidget->setVisible(true); - noneModeWidget->setVisible(false); menuView->menuAction()->setVisible(true); menuWorkspace->menuAction()->setVisible(true); menuDatabase->menuAction()->setVisible(true); @@ -319,9 +315,6 @@ void MainWindow::switchMode(Mode m) } else { - databaseModeWidget->setVisible(false); - workspaceModeWidget->setVisible(false); - noneModeWidget->setVisible(true); menuView->menuAction()->setVisible(false); menuWorkspace->menuAction()->setVisible(false); menuDatabase->menuAction()->setVisible(false); ============================================================ --- guitone/src/view/MainWindow.h 828be9d558d41e9593b3d6e764a5987f3b99ad67 +++ guitone/src/view/MainWindow.h 45fbbfbc9007550fe3779bc57541663a413a4196 @@ -36,7 +36,7 @@ public: Q_OBJECT public: - enum Mode { Database, Workspace, None }; + enum Mode { Workspace = 0, Database, None }; MainWindow(); ~MainWindow(); void loadRecent();