# # # patch "guitone/src/Guitone.cpp" # from [2db81e5ef26c4f72a4cde8ce650f0b4a7235fbbf] # to [df2c6d9a3e2178dc9d17c9b15f608d0d15188c13] # # patch "guitone/src/Guitone.h" # from [56327e1a0da85c66b3d4554aba2d5df01ada618c] # to [308ccb6cf259369f26927dd454feccb954918d25] # # patch "guitone/src/view/MainWindow.cpp" # from [afa591155fdb43a496e9712bd5fa6248770b96e7] # to [13a2b8934f4761e361cccf1963f85076c47ec448] # # patch "guitone/src/view/MainWindow.h" # from [161c433de5dd6d0417412c2da2a39401a85f3550] # to [9fc77547a3eb9bebfeecd21f3efcff99d77fa71b] # ============================================================ --- guitone/src/Guitone.cpp 2db81e5ef26c4f72a4cde8ce650f0b4a7235fbbf +++ guitone/src/Guitone.cpp df2c6d9a3e2178dc9d17c9b15f608d0d15188c13 @@ -62,17 +62,6 @@ Guitone::~Guitone() Q_ASSERT(monotoneInstances.size() == 0); } -void Guitone::criticalMtnError(const QString & msg) -{ - // restore the normal cursor - restoreOverrideCursor(); - - QMessageBox::critical(NULL, tr("Critical Monotone Error"), - msg, QMessageBox::Ok, 0, 0); - - // TODO: shall we remove the errornous window? -} - void Guitone::loadWorkspace(const QString & path) { MainWindow * wnd = addWindow(); @@ -265,7 +254,7 @@ bool Guitone::addMonotoneInstance(MainWi // catch critical errors from the Monotone class connect( mtn, SIGNAL(criticalError(const QString &)), - this, SLOT(criticalMtnError(const QString &)) + wnd, SLOT(criticalMtnError(const QString &)) ); // check the current monotone version and prompt the user @@ -308,7 +297,7 @@ bool Guitone::removeMonotoneInstance(Mai disconnect( mtn, SIGNAL(criticalError(const QString &)), - this, SLOT(criticalMtnError(const QString &)) + wnd, SLOT(criticalMtnError(const QString &)) ); delete mtn; ============================================================ --- guitone/src/Guitone.h 56327e1a0da85c66b3d4554aba2d5df01ada618c +++ guitone/src/Guitone.h 308ccb6cf259369f26927dd454feccb954918d25 @@ -69,7 +69,6 @@ private slots: void windowListChanged(); private slots: - void criticalMtnError(const QString &); void loadWorkspace(const QString &); void loadDatabase(const QString &); void windowClosed(MainWindow *); ============================================================ --- guitone/src/view/MainWindow.cpp afa591155fdb43a496e9712bd5fa6248770b96e7 +++ guitone/src/view/MainWindow.cpp 13a2b8934f4761e361cccf1963f85076c47ec448 @@ -57,7 +57,7 @@ MainWindow::MainWindow() QShortcut::tr("Meta"); setupUi(this); - + // create the main models invModel = new Inventory(this); attrModel = new Attributes(this); @@ -157,6 +157,17 @@ MainWindow::~MainWindow() delete proxyModelFileList; } +void MainWindow::criticalMtnError(const QString & msg) +{ + // restore the normal cursor + APP->restoreOverrideCursor(); + + QMessageBox::critical(this, tr("Critical Monotone Error"), + msg, QMessageBox::Ok, 0, 0); + + close(); +} + // try to load the most recent workspace or database, if there are any // if everything fails, load nothing and hide the appropriate menus void MainWindow::loadRecent() ============================================================ --- guitone/src/view/MainWindow.h 161c433de5dd6d0417412c2da2a39401a85f3550 +++ guitone/src/view/MainWindow.h 9fc77547a3eb9bebfeecd21f3efcff99d77fa71b @@ -48,7 +48,8 @@ public slots: public slots: void doUpdatePreviousWorkspacesMenu(); void doUpdatePreviousDatabasesMenu(); - + void criticalMtnError(const QString &); + signals: void modeChanged(Mode); void windowClosed(MainWindow *);