patch for addenvvardlg

DUCLOS Andre shirka at wanadoo.fr
Tue May 13 02:16:14 UTC 2003


Hi,

(My english is very poor...)

This is a patch for addenvvardlg for :
	- delete the selected item
	- edit a item

Test please.

Bye

Index: lib/project/addenvvardlg.h
===================================================================
RCS file: /home/kde/kdevelop/lib/project/addenvvardlg.h,v
retrieving revision 1.1
diff -u -r1.1 addenvvardlg.h
--- lib/project/addenvvardlg.h	16 Apr 2002 17:45:57 -0000	1.1
+++ lib/project/addenvvardlg.h	11 May 2003 11:28:24 -0000
@@ -28,7 +28,11 @@
         { return varname_edit->text(); }
     QString value() const
         { return value_edit->text(); }
-
+    void setvarname(const QString name) const
+        { varname_edit->setText(name); }
+    void setvalue(const QString value) const
+        { value_edit->setText(value); }
+
 private:
     QLineEdit *varname_edit;
     QLineEdit *value_edit;
Index: lib/project/environmentvariableswidget.cpp
===================================================================
RCS file: /home/kde/kdevelop/lib/project/environmentvariableswidget.cpp,v
retrieving revision 1.2
diff -u -r1.2 environmentvariableswidget.cpp
--- lib/project/environmentvariableswidget.cpp	2 Apr 2003 16:38:28 -0000	1.2
+++ lib/project/environmentvariableswidget.cpp	11 May 2003 11:28:24 -0000
@@ -24,6 +24,11 @@
 void EnvironmentVariablesWidget::addVarClicked()
 {
     AddEnvvarDialog dlg;
+    if (QListViewItem *Item = listview->selectedItem())
+    {
+    	dlg.setvarname(Item->text(0));
+	dlg.setvalue(Item->text(1));
+    }
     if (!dlg.exec())
         return;

@@ -33,7 +38,7 @@

 void EnvironmentVariablesWidget::removeVarClicked()
 {
-    delete listview->currentItem();
+    delete listview->selectedItem();
 }


Index: lib/project/environmentvariableswidgetbase.ui
===================================================================
RCS file: /home/kde/kdevelop/lib/project/environmentvariableswidgetbase.ui,v
retrieving revision 1.1
diff -u -r1.1 environmentvariableswidgetbase.ui
--- lib/project/environmentvariableswidgetbase.ui	17 Mar 2003 01:28:48 -0000	1.1
+++ lib/project/environmentvariableswidgetbase.ui	11 May 2003 11:28:24 -0000
@@ -8,7 +8,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>661</width>
+            <width>747</width>
             <height>307</height>
         </rect>
     </property>
@@ -52,7 +52,7 @@
                 </sizepolicy>
             </property>
             <property name="text">
-                <string>Add...</string>
+                <string>Add / Edit...</string>
             </property>
         </widget>
         <widget class="QPushButton" row="1" column="1">






-- 
DUCLOS Andre <duclos at shirka.dyndns.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20030513/142825b7/attachment.sig>


More information about the KDevelop-devel mailing list