@@ -1455,18 +1455,22 @@ ConfigMainWindow::ConfigMainWindow(void)
1455
1455
addToolBar (toolBar);
1456
1456
1457
1457
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
+
1460
1460
QAction *quitAction = new QAction (" &Quit" , this );
1461
1461
quitAction->setShortcut (Qt::CTRL + Qt::Key_Q);
1462
- connect (quitAction, SIGNAL (triggered (bool )), SLOT (close ()));
1462
+ connect (quitAction, SIGNAL (triggered (bool )), SLOT (close ()));
1463
+
1463
1464
QAction *loadAction = new QAction (QPixmap (xpm_load), " &Load" , this );
1464
1465
loadAction->setShortcut (Qt::CTRL + Qt::Key_L);
1465
- connect (loadAction, SIGNAL (triggered (bool )), SLOT (loadConfig ()));
1466
+ connect (loadAction, SIGNAL (triggered (bool )), SLOT (loadConfig ()));
1467
+
1466
1468
saveAction = new QAction (QPixmap (xpm_save), " &Save" , this );
1467
1469
saveAction->setShortcut (Qt::CTRL + Qt::Key_S);
1468
- connect (saveAction, SIGNAL (triggered (bool )), SLOT (saveConfig ()));
1470
+ connect (saveAction, SIGNAL (triggered (bool )), SLOT (saveConfig ()));
1471
+
1469
1472
conf_set_changed_callback (conf_changed);
1473
+
1470
1474
// Set saveAction's initial state
1471
1475
conf_changed ();
1472
1476
configname = xstrdup (conf_get_configname ());
@@ -1667,21 +1671,11 @@ void ConfigMainWindow::searchConfig(void)
1667
1671
void ConfigMainWindow::changeItens (struct menu *menu)
1668
1672
{
1669
1673
configList->setRootMenu (menu);
1670
-
1671
- if (configList->rootEntry ->parent == &rootmenu)
1672
- backAction->setEnabled (false );
1673
- else
1674
- backAction->setEnabled (true );
1675
1674
}
1676
1675
1677
1676
void ConfigMainWindow::changeMenu (struct menu *menu)
1678
1677
{
1679
1678
menuList->setRootMenu (menu);
1680
-
1681
- if (menuList->rootEntry ->parent == &rootmenu)
1682
- backAction->setEnabled (false );
1683
- else
1684
- backAction->setEnabled (true );
1685
1679
}
1686
1680
1687
1681
void ConfigMainWindow::setMenuLink (struct menu *menu)
@@ -1748,25 +1742,11 @@ void ConfigMainWindow::listFocusChanged(void)
1748
1742
1749
1743
void ConfigMainWindow::goBack (void )
1750
1744
{
1751
- ConfigItem* item, *oldSelection;
1752
-
1753
- configList->setParentMenu ();
1745
+ qInfo () << __FUNCTION__;
1754
1746
if (configList->rootEntry == &rootmenu)
1755
- backAction->setEnabled (false );
1756
-
1757
- if (menuList->selectedItems ().count () == 0 )
1758
1747
return ;
1759
1748
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 ();
1770
1750
}
1771
1751
1772
1752
void ConfigMainWindow::showSingleView (void )
@@ -1778,6 +1758,8 @@ void ConfigMainWindow::showSingleView(void)
1778
1758
fullViewAction->setEnabled (true );
1779
1759
fullViewAction->setChecked (false );
1780
1760
1761
+ backAction->setEnabled (true );
1762
+
1781
1763
menuView->hide ();
1782
1764
menuList->setRootMenu (0 );
1783
1765
configList->mode = singleMode;
@@ -1797,6 +1779,8 @@ void ConfigMainWindow::showSplitView(void)
1797
1779
fullViewAction->setEnabled (true );
1798
1780
fullViewAction->setChecked (false );
1799
1781
1782
+ backAction->setEnabled (false );
1783
+
1800
1784
configList->mode = menuMode;
1801
1785
if (configList->rootEntry == &rootmenu)
1802
1786
configList->updateListAll ();
@@ -1820,6 +1804,8 @@ void ConfigMainWindow::showFullView(void)
1820
1804
fullViewAction->setEnabled (false );
1821
1805
fullViewAction->setChecked (true );
1822
1806
1807
+ backAction->setEnabled (false );
1808
+
1823
1809
menuView->hide ();
1824
1810
menuList->setRootMenu (0 );
1825
1811
configList->mode = fullMode;
0 commit comments