From b5f0e0c52fa7fd6a2094ff4b3391e3883dfc2a9c Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Mon, 23 May 2011 16:22:53 +0200 Subject: [PATCH] Fixed issue Sankore-24 --- src/document/UBDocumentController.cpp | 2 ++ src/document/UBDocumentController.h | 1 + src/gui/UBMainWindow.cpp | 14 ++++++++++++++ src/gui/UBMainWindow.h | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 86ad5d6a..dafacb87 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -55,6 +55,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) { setupViews(); setupToolbar(); + connect(this, SIGNAL(exportDone()), mMainWindow, SLOT(onExportDone())); } @@ -818,6 +819,7 @@ void UBDocumentController::exportDocument() if (proxy) { selectedExportAdaptor->persist(proxy); + emit exportDone(); } else { diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index 6734d540..1dc0a27c 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -37,6 +37,7 @@ class UBDocumentController : public QObject signals: void refreshThumbnails(); + void exportDone(); public slots: void createNewDocument(); diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index ae27682a..09f503e1 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -102,3 +102,17 @@ void UBMainWindow::keyPressEvent(QKeyEvent *event) } */ } + +void UBMainWindow::onExportDone() +{ + // HACK : When opening the file save dialog during the document exportation, + // some buttons of the toolbar become disabled without any reason. We + // re-enable them here. + actionExport->setEnabled(true); + actionNewDocument->setEnabled(true); + actionRename->setEnabled(true); + actionDuplicate->setEnabled(true); + actionDelete->setEnabled(true); + actionOpen->setEnabled(true); + actionDocumentAdd->setEnabled(true); +} diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index a783263f..796c074f 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.h @@ -12,6 +12,7 @@ class QStackedLayout; class UBMainWindow : public QMainWindow, public Ui::MainWindow { + Q_OBJECT public: UBMainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0); @@ -26,6 +27,9 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow void addDocumentsWidget(QWidget *pWidget); void switchToDocumentsWidget(); + public slots: + void onExportDone(); + protected: virtual void keyPressEvent(QKeyEvent *event);