[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/konqueror/sidebar
From:       Joseph Wenninger <kde () jowenn ! at>
Date:       2003-03-02 18:41:33
[Download RAW message or body]

CVS commit by jowenn: 

Don't crash if the configure button is removed from it's own menu


  M +16 -9     sidebar_widget.cpp   1.87


--- kdebase/konqueror/sidebar/sidebar_widget.cpp  #1.86:1.87
@@ -455,5 +455,6 @@ void Sidebar_Widget::activatedMenu(int i
                         if(showExtraButtons)
                         {
-                                ButtonBar->appendButton(SmallIcon("configure"), -1, \
Menu, i18n("Configure Sidebar")); +                                \
ButtonBar->getButton(-1)->show(); +//                              \
ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); \
//JW - TEST                             \
ButtonBar->insertButton(SmallIcon("remove"),-2);  //JW - TEST                         \
connect(ButtonBar->getButton(-2),SIGNAL(clicked(int)),partParent,SLOT(deleteLater()));
 @@ -464,6 +465,6 @@ void Sidebar_Widget::activatedMenu(int i
                                 i18n("You have hidden the navigation panel \
configuration button. To make it visible again, click the right mouse button on any \
of the navigation panel buttons and select \"Show Configuration Button\"."));  
-
-                                ButtonBar->removeButton(-1);
+                                ButtonBar->getButton(-1)->hide();
+//                              ButtonBar->removeButton(-1);
 //JW -TEST                              ButtonBar->removeButton(-2);
                         }
@@ -569,13 +570,19 @@ void Sidebar_Widget::createButtons()
         readConfig();
 
+        if (!ButtonBar->getButton(-1)) \
ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); \
+  if(showExtraButtons)
-        {
-                if (!ButtonBar->getButton(-1))
-                {
-                        ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, \
i18n("Configure Sidebar")); +                ButtonBar->getButton(-1)->show();
+        else
+                ButtonBar->getButton(-1)->hide();
+
+//      {
+//              if (!ButtonBar->getButton(-1))
+//              {
+//                      ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, \
i18n("Configure Sidebar"));  //JW - TEST                     \
ButtonBar->insertButton(SmallIcon("remove"),-2);  //JW - TEST                     \
connect(ButtonBar->getButton(-2),SIGNAL(clicked(int)),partParent,SLOT(deleteLater()));
                
-                }
-        }
+//              }
+//      }
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic