# # # patch "src/view/dialogs/Dialog.cpp" # from [4a9329c127de291fc2e8c236ee2ae3f97344bdfa] # to [23ad75a7241adc3bc0ffdbe0601a75c678eb5c62] # # patch "src/view/dialogs/Dialog.h" # from [8e41006355f2b99dd3dc6a50d520b8e5782e6d14] # to [0432741e08d4766aa9466215d3fd62fc38b0974d] # ============================================================ --- src/view/dialogs/Dialog.cpp 4a9329c127de291fc2e8c236ee2ae3f97344bdfa +++ src/view/dialogs/Dialog.cpp 23ad75a7241adc3bc0ffdbe0601a75c678eb5c62 @@ -26,24 +26,22 @@ #include -Dialog::Dialog(QWidget * parent) : QDialog(parent) -{ -} +Dialog::Dialog(QWidget * parent) : QDialog(parent) {} -Dialog::Dialog(QWidget * parent, QString objName) +Dialog::Dialog(QWidget * parent, const QString & objName) : QDialog(parent) { - setObjectName(objName); + setObjectName(objName); } -Dialog::~Dialog() +Dialog::~Dialog() { - saveState(); + saveState(); } void Dialog::init() { - restoreState(); + restoreState(); } void Dialog::restoreState(void) @@ -69,18 +67,18 @@ int Dialog::execDocumentModal() I(parent && parent->inherits("QMainWindow")); MainWindow * wnd = qobject_cast(parent); I(wnd); - + // disable the close button's functionality in the MainWindow wnd->disableClosing(); - - QMap enableState; - + + QMap enableState; + // disable all menu actions (for some reason disabling the menuBar itself // does not result in the desired effect under OSX) - QList list = wnd->menuBar()->actions(); + QList list = wnd->menuBar()->actions(); foreach(QAction * act, list) { - QList innerList = act->menu()->actions(); + QList innerList = act->menu()->actions(); foreach(QAction * innerAct, innerList) { // skip actions which are later placed into the application menu @@ -93,20 +91,20 @@ int Dialog::execDocumentModal() innerAct->setEnabled(false); } } - + show(); SignalWaiter waiter(this, SIGNAL(finished(int))); waiter.wait(); - + // restore the enable state for all items foreach(QAction * act, enableState.keys()) { act->setEnabled(enableState.value(act)); } - + // enable the close button's functionality in the MainWindow again wnd->enableClosing(); - + return result(); } ============================================================ --- src/view/dialogs/Dialog.h 8e41006355f2b99dd3dc6a50d520b8e5782e6d14 +++ src/view/dialogs/Dialog.h 0432741e08d4766aa9466215d3fd62fc38b0974d @@ -25,18 +25,17 @@ class Dialog : public QDialog class Dialog : public QDialog { - Q_OBJECT - + Q_OBJECT public: Dialog(QWidget *); - Dialog(QWidget *, QString); - ~Dialog(); + Dialog(QWidget *, const QString &); + ~Dialog(); void init(); void setStayOnTop(); int execDocumentModal(); private: - void restoreState(void); + void restoreState(void); void saveState(void); };