diff options
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r-- | scripts/kconfig/qconf.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index f5628c57640b..c0ae0a7ddb42 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -38,6 +38,8 @@ static QApplication *configApp; static ConfigSettings *configSettings; +QAction *ConfigMainWindow::saveAction; + static inline QString qgettext(const char* str) { return QString::fromLocal8Bit(gettext(str)); @@ -915,7 +917,7 @@ void ConfigView::updateListAll(void) } ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) - : Parent(parent, name), menu(0) + : Parent(parent, name), menu(0), sym(0) { if (name) { configSettings->beginGroup(name); @@ -951,6 +953,7 @@ void ConfigInfoView::setInfo(struct menu *m) if (menu == m) return; menu = m; + sym = NULL; if (!menu) clear(); else @@ -1306,8 +1309,11 @@ ConfigMainWindow::ConfigMainWindow(void) connect(quitAction, SIGNAL(activated()), SLOT(close())); QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); - QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); + saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); + conf_set_changed_callback(conf_changed); + // Set saveAction's initial state + conf_changed(); QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); @@ -1585,7 +1591,7 @@ void ConfigMainWindow::showFullView(void) */ void ConfigMainWindow::closeEvent(QCloseEvent* e) { - if (!sym_change_count) { + if (!conf_get_changed()) { e->accept(); return; } @@ -1658,6 +1664,12 @@ void ConfigMainWindow::saveSettings(void) configSettings->writeSizes("/split2", split2->sizes()); } +void ConfigMainWindow::conf_changed(void) +{ + if (saveAction) + saveAction->setEnabled(conf_get_changed()); +} + void fixup_rootmenu(struct menu *menu) { struct menu *child; |