# # # patch "guitone/src/view/MainWindow.cpp" # from [7944c79baf014a6211e5b04ed9f2380806eb0047] # to [8f852643915950636c4f0bd63e9dfd98577b3fd5] # ============================================================ --- guitone/src/view/MainWindow.cpp 7944c79baf014a6211e5b04ed9f2380806eb0047 +++ guitone/src/view/MainWindow.cpp 8f852643915950636c4f0bd63e9dfd98577b3fd5 @@ -44,15 +44,13 @@ MainWindow::MainWindow() : QMainWindow() { gotError = false; - mode = Workspace; + mode = None; } bool MainWindow::init() { setupUi(this); - switchMode(mode); - Monotone * mtn = Monotone::singleton(this); // catch critical errors from the Monotone class @@ -145,14 +143,21 @@ bool MainWindow::init() restoreGeometry(Settings::getWindowGeometry("MainWindow")); - // load the most recent previous workspace, if there is any - QStringList list = Settings::getItemList("RecentWorkspaceList"); - if (list.size() > 0) + // try to load the most recent workspace or database, if there are any + QStringList workspaces = Settings::getItemList("RecentWorkspaceList"); + QStringList databases = Settings::getItemList("RecentDatabaseList"); + + if (workspaces.size() > 0) { - loadWorkspace(list[0]); + loadWorkspace(workspaces[0]); } + else if (databases.size() > 0) + { + loadDatabase(databases[0]); + } else { + // if nothing can be loaded, explicitely disable the view switchMode(None); }