diff options
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r-- | scripts/kconfig/qconf.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 8d60d99bd9f1..0b2fcc417f59 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -38,6 +38,8 @@ | |||
38 | static QApplication *configApp; | 38 | static QApplication *configApp; |
39 | static ConfigSettings *configSettings; | 39 | static ConfigSettings *configSettings; |
40 | 40 | ||
41 | QAction *ConfigMainWindow::saveAction; | ||
42 | |||
41 | static inline QString qgettext(const char* str) | 43 | static inline QString qgettext(const char* str) |
42 | { | 44 | { |
43 | return QString::fromLocal8Bit(gettext(str)); | 45 | return QString::fromLocal8Bit(gettext(str)); |
@@ -1306,8 +1308,11 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1306 | connect(quitAction, SIGNAL(activated()), SLOT(close())); | 1308 | connect(quitAction, SIGNAL(activated()), SLOT(close())); |
1307 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); | 1309 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); |
1308 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); | 1310 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); |
1309 | QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); | 1311 | saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); |
1310 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); | 1312 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); |
1313 | conf_set_changed_callback(conf_changed); | ||
1314 | // Set saveAction's initial state | ||
1315 | conf_changed(); | ||
1311 | QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); | 1316 | QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); |
1312 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); | 1317 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); |
1313 | QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); | 1318 | QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); |
@@ -1658,6 +1663,12 @@ void ConfigMainWindow::saveSettings(void) | |||
1658 | configSettings->writeSizes("/split2", split2->sizes()); | 1663 | configSettings->writeSizes("/split2", split2->sizes()); |
1659 | } | 1664 | } |
1660 | 1665 | ||
1666 | void ConfigMainWindow::conf_changed(void) | ||
1667 | { | ||
1668 | if (saveAction) | ||
1669 | saveAction->setEnabled(conf_get_changed()); | ||
1670 | } | ||
1671 | |||
1661 | void fixup_rootmenu(struct menu *menu) | 1672 | void fixup_rootmenu(struct menu *menu) |
1662 | { | 1673 | { |
1663 | struct menu *child; | 1674 | struct menu *child; |