Merge remote-tracking branch 'origin/2.5'

Conflicts:
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: I975a4208588d174ebb44054de56c5ac8d7c878fe
This commit is contained in:
Eike Ziller
2012-05-02 13:53:46 +02:00
6 changed files with 32 additions and 9 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -236,6 +236,7 @@ private:
QColor m_overrideColor;
QStringList m_filesToOpenDelayed;
QTimer *m_autoSaveSessionTimer;
};
} // namespace Internal