@@ -1455,18 +1455,22 @@ ConfigMainWindow::ConfigMainWindow(void)
14551455 addToolBar (toolBar);
14561456
14571457 backAction = new QAction (QPixmap (xpm_back), " Back" , this );
1458- connect (backAction, SIGNAL (triggered (bool )), SLOT (goBack ()));
1459- backAction-> setEnabled ( false );
1458+ connect (backAction, SIGNAL (triggered (bool )), SLOT (goBack ()));
1459+
14601460 QAction *quitAction = new QAction (" &Quit" , this );
14611461 quitAction->setShortcut (Qt::CTRL + Qt::Key_Q);
1462- connect (quitAction, SIGNAL (triggered (bool )), SLOT (close ()));
1462+ connect (quitAction, SIGNAL (triggered (bool )), SLOT (close ()));
1463+
14631464 QAction *loadAction = new QAction (QPixmap (xpm_load), " &Load" , this );
14641465 loadAction->setShortcut (Qt::CTRL + Qt::Key_L);
1465- connect (loadAction, SIGNAL (triggered (bool )), SLOT (loadConfig ()));
1466+ connect (loadAction, SIGNAL (triggered (bool )), SLOT (loadConfig ()));
1467+
14661468 saveAction = new QAction (QPixmap (xpm_save), " &Save" , this );
14671469 saveAction->setShortcut (Qt::CTRL + Qt::Key_S);
1468- connect (saveAction, SIGNAL (triggered (bool )), SLOT (saveConfig ()));
1470+ connect (saveAction, SIGNAL (triggered (bool )), SLOT (saveConfig ()));
1471+
14691472 conf_set_changed_callback (conf_changed);
1473+
14701474 // Set saveAction's initial state
14711475 conf_changed ();
14721476 configname = xstrdup (conf_get_configname ());
@@ -1667,21 +1671,11 @@ void ConfigMainWindow::searchConfig(void)
16671671void ConfigMainWindow::changeItens (struct menu *menu)
16681672{
16691673 configList->setRootMenu (menu);
1670-
1671- if (configList->rootEntry ->parent == &rootmenu)
1672- backAction->setEnabled (false );
1673- else
1674- backAction->setEnabled (true );
16751674}
16761675
16771676void ConfigMainWindow::changeMenu (struct menu *menu)
16781677{
16791678 menuList->setRootMenu (menu);
1680-
1681- if (menuList->rootEntry ->parent == &rootmenu)
1682- backAction->setEnabled (false );
1683- else
1684- backAction->setEnabled (true );
16851679}
16861680
16871681void ConfigMainWindow::setMenuLink (struct menu *menu)
@@ -1748,25 +1742,11 @@ void ConfigMainWindow::listFocusChanged(void)
17481742
17491743void ConfigMainWindow::goBack (void )
17501744{
1751- ConfigItem* item, *oldSelection;
1752-
1753- configList->setParentMenu ();
1745+ qInfo () << __FUNCTION__;
17541746 if (configList->rootEntry == &rootmenu)
1755- backAction->setEnabled (false );
1756-
1757- if (menuList->selectedItems ().count () == 0 )
17581747 return ;
17591748
1760- item = (ConfigItem*)menuList->selectedItems ().first ();
1761- oldSelection = item;
1762- while (item) {
1763- if (item->menu == configList->rootEntry ) {
1764- oldSelection->setSelected (false );
1765- item->setSelected (true );
1766- break ;
1767- }
1768- item = (ConfigItem*)item->parent ();
1769- }
1749+ configList->setParentMenu ();
17701750}
17711751
17721752void ConfigMainWindow::showSingleView (void )
@@ -1778,6 +1758,8 @@ void ConfigMainWindow::showSingleView(void)
17781758 fullViewAction->setEnabled (true );
17791759 fullViewAction->setChecked (false );
17801760
1761+ backAction->setEnabled (true );
1762+
17811763 menuView->hide ();
17821764 menuList->setRootMenu (0 );
17831765 configList->mode = singleMode;
@@ -1797,6 +1779,8 @@ void ConfigMainWindow::showSplitView(void)
17971779 fullViewAction->setEnabled (true );
17981780 fullViewAction->setChecked (false );
17991781
1782+ backAction->setEnabled (false );
1783+
18001784 configList->mode = menuMode;
18011785 if (configList->rootEntry == &rootmenu)
18021786 configList->updateListAll ();
@@ -1820,6 +1804,8 @@ void ConfigMainWindow::showFullView(void)
18201804 fullViewAction->setEnabled (false );
18211805 fullViewAction->setChecked (true );
18221806
1807+ backAction->setEnabled (false );
1808+
18231809 menuView->hide ();
18241810 menuList->setRootMenu (0 );
18251811 configList->mode = fullMode;
0 commit comments