diff options
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.cpp | 10 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index d054855..c10a481 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -440,6 +440,7 @@ void MainWindow::setupActions() #endif QMenu *menu = menuBar()->addMenu(tr("&File")); + connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowFileMenu())); OpenPagesManager * const openPages = OpenPagesManager::instance(); m_newTabAction @@ -1096,4 +1097,13 @@ void MainWindow::registerDocumentation(const QString &component, } } +void MainWindow::aboutToShowFileMenu() +{ + OpenPagesManager * const openPages = OpenPagesManager::instance(); + if (openPages->pageCount() > 1) + m_closeTabAction->setEnabled(true); + else + m_closeTabAction->setEnabled(false); +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 68b9c2a..bb40d92 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -136,6 +136,7 @@ private: private slots: void showBookmarksDockWidget(); void hideBookmarksDockWidget(); + void aboutToShowFileMenu(); private: QWidget *m_bookmarkWidget; |