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

List:       kde-commits
Subject:    kdenetwork/ksirc/KSPrefs
From:       Andrew Stanley-Jones <asj () cban ! com>
Date:       2003-11-02 3:03:45
[Download RAW message or body]

CVS commit by asj: 

Fix the page so it works now


  M +27 -10    page_rmbmenu.cpp   1.6
  M +3 -0      page_rmbmenu.h   1.6


--- kdenetwork/ksirc/KSPrefs/page_rmbmenu.cpp  #1.5:1.6
@@ -40,4 +40,6 @@ PageRMBMenu::PageRMBMenu( QWidget *paren
     }
 
+    changeItemPB->hide();
+
     connect(commandLB, SIGNAL(highlighted( int )),
             this, SLOT(highlighted( int )));
@@ -50,7 +52,10 @@ PageRMBMenu::PageRMBMenu( QWidget *paren
             this, SLOT(insSeperator()));
 
-    connect(insertCommandPB, SIGNAL(clicked()),
+    connect(insertItemPB, SIGNAL(clicked()),
             this, SLOT(insCommand()));
 
+    connect(deleteItemPB, SIGNAL(clicked()),
+            this, SLOT(delCommand()));
+
 }
 
@@ -61,4 +66,5 @@ PageRMBMenu::~PageRMBMenu()
 void PageRMBMenu::saveConfig()
 {
+    UserControlMenu::writeKConfig();
 }
 
@@ -127,4 +133,5 @@ void PageRMBMenu::moveUp()
 
     highlighted(item-1);
+    emit modified();
 }
 
@@ -143,4 +150,5 @@ void PageRMBMenu::moveDown()
 
     highlighted(item+1);
+    emit modified();
 }
 
@@ -157,33 +165,42 @@ void PageRMBMenu::insSeperator()
 
     highlighted(item);
+    emit modified();
 }
 
-void PageRMBMenu::insSeperator()
+void PageRMBMenu::insCommand()
 {
     int item = commandLB->currentItem();
 
-    QString txt = commandLB->text(item);
+    QString te = entryLE->text();
+    QString ce = commandLE->text();
 
-    commandLB->insertItem("--------------", item);
+    commandLB->insertItem(te, item);
     commandLB->setCurrentItem(item);
 
-    UserControlMenu::UserMenu.insert(item,new UserControlMenu); // Defaults to a separator
+    UserControlMenu::UserMenu.insert(item,
+                                     new UserControlMenu(
+                                                         te,
+                                                         ce,
+                                                         0x0,
+                                                         UserControlMenu::Text
+                                                        )); // Defaults to a separator
 
     highlighted(item);
+    emit modified();
 }
 
-void PageRMBMenu::insCommand()
+void PageRMBMenu::delCommand()
 {
     int item = commandLB->currentItem();
 
     QString txt = commandLB->text(item);
+    commandLB->removeItem(item);
 
-    commandLB->insertItem("--------------", item);
-    commandLB->setCurrentItem(item);
-
-    UserControlMenu::UserMenu.insert(item,new UserControlMenu); // Defaults to a separator
+    UserControlMenu::UserMenu.remove(item);
 
     highlighted(item);
+    emit modified();
 }
+
 
 #include "page_rmbmenu.moc"

--- kdenetwork/ksirc/KSPrefs/page_rmbmenu.h  #1.5:1.6
@@ -31,4 +31,7 @@ protected slots:
   void insSeperator();
   void insCommand();
+  void delCommand();
+signals:
+  void modified();
 };
 


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

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