forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.5'
Conflicts: src/plugins/coreplugin/mainwindow.cpp Change-Id: I975a4208588d174ebb44054de56c5ac8d7c878fe
This commit is contained in:
@@ -402,11 +402,27 @@ void MenuActionContainer::removeMenu(QMenu *menu)
|
||||
m_menu->removeAction(menu->menuAction());
|
||||
}
|
||||
|
||||
static bool menuInMenuBar(const QMenu *menu)
|
||||
{
|
||||
foreach (const QWidget *widget, menu->menuAction()->associatedWidgets()) {
|
||||
if (qobject_cast<const QMenuBar *>(widget))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MenuActionContainer::updateInternal()
|
||||
{
|
||||
if (onAllDisabledBehavior() == Show)
|
||||
return true;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// work around QTBUG-25544 which makes menus in the menu bar stay at their enabled state at startup
|
||||
// (so menus that are disabled at startup would stay disabled)
|
||||
if (menuInMenuBar(m_menu))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
bool hasitems = false;
|
||||
QList<QAction *> actions = m_menu->actions();
|
||||
|
||||
|
||||
@@ -234,6 +234,13 @@ MainWindow::MainWindow() :
|
||||
#if defined(Q_OS_MAC)
|
||||
MacFullScreen::addFullScreen(this);
|
||||
#endif
|
||||
|
||||
m_autoSaveSessionTimer = new QTimer(this);
|
||||
m_autoSaveSessionTimer->setSingleShot(true);
|
||||
m_autoSaveSessionTimer->setInterval(10000);
|
||||
m_autoSaveSessionTimer->start();
|
||||
connect(m_autoSaveSessionTimer, SIGNAL(timeout()),
|
||||
m_coreImpl, SIGNAL(saveSettingsRequested()));
|
||||
}
|
||||
|
||||
void MainWindow::setSidebarVisible(bool visible)
|
||||
@@ -389,6 +396,7 @@ void MainWindow::extensionsInitialized()
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
m_autoSaveSessionTimer->stop();
|
||||
emit m_coreImpl->saveSettingsRequested();
|
||||
|
||||
// Save opened files
|
||||
|
||||
@@ -236,6 +236,7 @@ private:
|
||||
QColor m_overrideColor;
|
||||
|
||||
QStringList m_filesToOpenDelayed;
|
||||
QTimer *m_autoSaveSessionTimer;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user