[debian-edu-commits] debian-edu/ 32/183: Kommander GUI now allows adding new profiles, use script objects instead of hidden buttons

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit c48bef99af0d8d85ba90efe0dca228fda473095b
Author: Bart Cornelis <cobaco at linux.be>
Date:   Sun Dec 12 15:39:20 2004 +0000

    Kommander GUI now allows adding new profiles,
    use script objects instead of hidden buttons
---
 TODO                 |  15 +-
 profile-manager.kmdr | 933 ++++++++++++++++++++++++++++++---------------------
 2 files changed, 550 insertions(+), 398 deletions(-)

diff --git a/TODO b/TODO
index 820bdc6..4fcc4b9 100644
--- a/TODO
+++ b/TODO
@@ -5,22 +5,17 @@
     Talk to gconf maintainers after package enters archives, about replacing current
     system-wide gconf path file with the one from this package
     
-  - is rox default right? 
-    -> waiting for reaction of rox-maintainer
-    
   - add kiosktool to Suggests when it becomes available in Debian (can i suggest
     something not yet in the archive?)
     
 - Are there any docs on the kiosk system of XFCE 4.2 available anywhere we can
   point to?
 
-- Create Tools to :
-      - add/change/remove requirement (activate/deactivate)
-      - change precedence
-      - change description (if only one/ location the same)
-      - rename profile
-  move-profile 
-  -> location & kind are fixed
+- Finish kommander gui:
+  - delete new profile
+  - option to actually move profile, when changing location
+  - fill in tooltips & whatsthis help
+  - ...
 
 - Tools to build (cross-desktop) profiles? (if at all possible)
   - background
diff --git a/profile-manager.kmdr b/profile-manager.kmdr
index d29e72e..512e069 100644
--- a/profile-manager.kmdr
+++ b/profile-manager.kmdr
@@ -34,30 +34,6 @@
             <string></string>
         </stringlist>
     </property>
-    <widget class="ListBox">
-        <property name="name">
-            <cstring>profilesAll</cstring>
-        </property>
-        <property name="geometry">
-            <rect>
-                <x>630</x>
-                <y>170</y>
-                <width>140</width>
-                <height>64</height>
-            </rect>
-        </property>
-        <property name="focusPolicy">
-            <enum>NoFocus</enum>
-        </property>
-        <property name="populationText">
-            <string>@null</string>
-        </property>
-        <property name="associations" stdset="0">
-            <stringlist>
-                <string>@profilesAll.selection()</string>
-            </stringlist>
-        </property>
-    </widget>
     <widget class="ButtonGroup">
         <property name="name">
             <cstring>filters</cstring>
@@ -163,82 +139,165 @@
                 </stringlist>
             </property>
         </widget>
-        <widget class="CheckBox">
+        <widget class="ComboBox">
+            <item>
+                <property name="text">
+                    <string>></string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>>=</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string><</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string><=</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string><></string>
+                </property>
+            </item>
             <property name="name">
-                <cstring>nameFilter</cstring>
+                <cstring>test</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>400</x>
-                    <y>20</y>
-                    <width>150</width>
-                    <height>20</height>
+                    <x>110</x>
+                    <y>80</y>
+                    <width>50</width>
+                    <height>22</height>
                 </rect>
             </property>
-            <property name="focusPolicy">
-                <enum>NoFocus</enum>
+            <property name="currentItem">
+                <number>0</number>
             </property>
-            <property name="text">
-                <string>name matches</string>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>@widgetText</string>
+                </stringlist>
+            </property>
+        </widget>
+        <widget class="ComboBox">
+            <item>
+                <property name="text">
+                    <string>description</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>kind</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>location</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>name</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>precedence</string>
+                </property>
+            </item>
+            <item>
+                <property name="text">
+                    <string>requirements</string>
+                </property>
+            </item>
+            <property name="name">
+                <cstring>sortField</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>550</x>
+                    <y>110</y>
+                    <width>210</width>
+                    <height>22</height>
+                </rect>
+            </property>
+            <property name="currentItem">
+                <number>4</number>
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@null</string>
-                    <string></string>
-                    <string>@execBegin
-
-if(@String.isEmpty(@nameRegexp)); then
-  echo "@null";
-else
-  echo "--name '@nameRegexp'";
-fi
-
- at execEnd</string>
+                    <string>@widgetText</string>
                 </stringlist>
             </property>
         </widget>
-        <widget class="CheckBox">
+        <widget class="LineEdit">
             <property name="name">
-                <cstring>descriptionFilter</cstring>
+                <cstring>locationRegexp</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>400</x>
+                    <x>550</x>
+                    <y>80</y>
+                    <width>210</width>
+                    <height>22</height>
+                </rect>
+            </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>@widgetText</string>
+                </stringlist>
+            </property>
+        </widget>
+        <widget class="LineEdit">
+            <property name="name">
+                <cstring>descriptionRegexp</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>550</x>
                     <y>50</y>
-                    <width>150</width>
-                    <height>20</height>
+                    <width>210</width>
+                    <height>22</height>
                 </rect>
             </property>
-            <property name="focusPolicy">
-                <enum>NoFocus</enum>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>@widgetText</string>
+                </stringlist>
             </property>
-            <property name="text">
-                <string>description matches</string>
+        </widget>
+        <widget class="LineEdit">
+            <property name="name">
+                <cstring>nameRegexp</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>550</x>
+                    <y>20</y>
+                    <width>210</width>
+                    <height>22</height>
+                </rect>
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@null</string>
-                    <string></string>
-                    <string>@execBegin
-
-if(@String.isEmpty(@descriptionRegexp)); then
-  echo @null;
-else
-  echo "--description '@descriptionRegexp'";
-fi
-
- at execEnd</string>
+                    <string>@widgetText</string>
                 </stringlist>
             </property>
         </widget>
-        <widget class="CheckBox">
+        <widget class="Label">
             <property name="name">
-                <cstring>locationFilter</cstring>
+                <cstring>sortFilter</cstring>
             </property>
             <property name="geometry">
                 <rect>
                     <x>400</x>
-                    <y>80</y>
+                    <y>110</y>
                     <width>150</width>
                     <height>20</height>
                 </rect>
@@ -247,21 +306,11 @@ fi
                 <enum>NoFocus</enum>
             </property>
             <property name="text">
-                <string>location matches</string>
+                <string>Sort profile list on</string>
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@null</string>
-                    <string></string>
-                    <string>@execBegin
-
-if(@String.isEmpty(@locationRegexp)); then
-  echo "@null";
-else
-  echo "--location '@locationRegexp'";
-fi
-
- at execEnd</string>
+                    <string>--sort-key @sortField</string>
                 </stringlist>
             </property>
         </widget>
@@ -278,7 +327,7 @@ fi
                 </rect>
             </property>
             <property name="focusPolicy">
-                <enum>NoFocus</enum>
+                <enum>TabFocus</enum>
             </property>
             <property name="text">
                 <string>kind matches</string>
@@ -315,7 +364,7 @@ fi
                 </rect>
             </property>
             <property name="focusPolicy">
-                <enum>NoFocus</enum>
+                <enum>TabFocus</enum>
             </property>
             <property name="text">
                 <string>requirement matches</string>
@@ -336,52 +385,6 @@ fi
                 </stringlist>
             </property>
         </widget>
-        <widget class="ComboBox">
-            <item>
-                <property name="text">
-                    <string>></string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>>=</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string><</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string><=</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string><></string>
-                </property>
-            </item>
-            <property name="name">
-                <cstring>test</cstring>
-            </property>
-            <property name="geometry">
-                <rect>
-                    <x>110</x>
-                    <y>80</y>
-                    <width>50</width>
-                    <height>22</height>
-                </rect>
-            </property>
-            <property name="currentItem">
-                <number>0</number>
-            </property>
-            <property name="associations" stdset="0">
-                <stringlist>
-                    <string>@widgetText</string>
-                </stringlist>
-            </property>
-        </widget>
         <widget class="CheckBox">
             <property name="name">
                 <cstring>precedenceFilter</cstring>
@@ -395,7 +398,7 @@ fi
                 </rect>
             </property>
             <property name="focusPolicy">
-                <enum>NoFocus</enum>
+                <enum>TabFocus</enum>
             </property>
             <property name="text">
                 <string>precedence</string>
@@ -442,7 +445,7 @@ fi
                 </rect>
             </property>
             <property name="focusPolicy">
-                <enum>NoFocus</enum>
+                <enum>TabFocus</enum>
             </property>
             <property name="text">
                 <string>requirements are met for</string>
@@ -463,132 +466,126 @@ fi
                 </stringlist>
             </property>
         </widget>
-        <widget class="ComboBox">
-            <item>
-                <property name="text">
-                    <string>description</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>kind</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>location</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>name</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>precedence</string>
-                </property>
-            </item>
-            <item>
-                <property name="text">
-                    <string>requirements</string>
-                </property>
-            </item>
+        <widget class="CheckBox">
             <property name="name">
-                <cstring>sortField</cstring>
+                <cstring>nameFilter</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>550</x>
-                    <y>110</y>
-                    <width>210</width>
-                    <height>22</height>
+                    <x>400</x>
+                    <y>20</y>
+                    <width>150</width>
+                    <height>20</height>
                 </rect>
             </property>
-            <property name="currentItem">
-                <number>4</number>
-            </property>
-            <property name="associations" stdset="0">
-                <stringlist>
-                    <string>@widgetText</string>
-                </stringlist>
-            </property>
-        </widget>
-        <widget class="LineEdit">
-            <property name="name">
-                <cstring>locationRegexp</cstring>
+            <property name="focusPolicy">
+                <enum>TabFocus</enum>
             </property>
-            <property name="geometry">
-                <rect>
-                    <x>550</x>
-                    <y>80</y>
-                    <width>210</width>
-                    <height>22</height>
-                </rect>
+            <property name="text">
+                <string>name matches</string>
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@widgetText</string>
+                    <string>@null</string>
+                    <string></string>
+                    <string>@execBegin
+
+if(@String.isEmpty(@nameRegexp)); then
+  echo "@null";
+else
+  echo "--name '@nameRegexp'";
+fi
+
+ at execEnd</string>
                 </stringlist>
             </property>
         </widget>
-        <widget class="LineEdit">
+        <widget class="CheckBox">
             <property name="name">
-                <cstring>descriptionRegexp</cstring>
+                <cstring>descriptionFilter</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>550</x>
+                    <x>400</x>
                     <y>50</y>
-                    <width>210</width>
-                    <height>22</height>
+                    <width>150</width>
+                    <height>20</height>
                 </rect>
             </property>
+            <property name="text">
+                <string>description matches</string>
+            </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@widgetText</string>
+                    <string>@null</string>
+                    <string></string>
+                    <string>@execBegin
+
+if(@String.isEmpty(@descriptionRegexp)); then
+  echo @null;
+else
+  echo "--description '@descriptionRegexp'";
+fi
+
+ at execEnd</string>
                 </stringlist>
             </property>
         </widget>
-        <widget class="LineEdit">
+        <widget class="CheckBox">
             <property name="name">
-                <cstring>nameRegexp</cstring>
+                <cstring>locationFilter</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>550</x>
-                    <y>20</y>
-                    <width>210</width>
-                    <height>22</height>
+                    <x>400</x>
+                    <y>80</y>
+                    <width>150</width>
+                    <height>20</height>
                 </rect>
             </property>
+            <property name="focusPolicy">
+                <enum>TabFocus</enum>
+            </property>
+            <property name="text">
+                <string>location matches</string>
+            </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>@widgetText</string>
+                    <string>@null</string>
+                    <string></string>
+                    <string>@execBegin
+
+if(@String.isEmpty(@locationRegexp)); then
+  echo "@null";
+else
+  echo "--location '@locationRegexp'";
+fi
+
+ at execEnd</string>
                 </stringlist>
             </property>
         </widget>
-        <widget class="Label">
+        <widget class="ScriptObject">
             <property name="name">
-                <cstring>sortFilter</cstring>
+                <cstring>refreshList</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>400</x>
+                    <x>530</x>
                     <y>110</y>
-                    <width>150</width>
-                    <height>20</height>
+                    <width>16</width>
+                    <height>16</height>
                 </rect>
             </property>
-            <property name="focusPolicy">
-                <enum>NoFocus</enum>
-            </property>
-            <property name="text">
-                <string>Sort profile list on</string>
-            </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>--sort-key @sortField</string>
+                    <string>@setGlobal(tmp, at exec(tempfile))
+ at exec(list-desktop-profiles --entry-format '$FILE\;$NAME\;$LOCATION\;$PRECEDENCE\;$REQUIREMENTS\;$KIND\;$DESCRIPTION' @filters > @global(tmp))
+
+ at profilesAll.setText(@exec(cat @global(tmp)))
+ at profiles.setText(@exec("cat @global(tmp) | cut --fields 2,7 --delimiter ';' | sed 's/;/  -  /' "));
+
+ at exec(rm @global(tmp))</string>
                 </stringlist>
             </property>
         </widget>
@@ -691,22 +688,11 @@ fi
                 <property name="title">
                     <string>New activation requirement:</string>
                 </property>
-                <widget class="Label">
-                    <property name="name">
-                        <cstring>Label14</cstring>
-                    </property>
-                    <property name="geometry">
-                        <rect>
-                            <x>10</x>
-                            <y>50</y>
-                            <width>40</width>
-                            <height>20</height>
-                        </rect>
-                    </property>
-                    <property name="text">
-                        <string>When</string>
-                    </property>
-                </widget>
+                <property name="associations" stdset="0">
+                    <stringlist>
+                        <string></string>
+                    </stringlist>
+                </property>
                 <widget class="ComboBox">
                     <property name="name">
                         <cstring>groupList</cstring>
@@ -764,82 +750,88 @@ fi;
                         </stringlist>
                     </property>
                 </widget>
-                <widget class="Label">
+                <widget class="ExecButton">
                     <property name="name">
-                        <cstring>Label13</cstring>
+                        <cstring>deactivate</cstring>
+                    </property>
+                    <property name="enabled">
+                        <bool>true</bool>
                     </property>
                     <property name="geometry">
                         <rect>
                             <x>10</x>
-                            <y>20</y>
-                            <width>120</width>
-                            <height>20</height>
+                            <y>80</y>
+                            <width>200</width>
+                            <height>24</height>
                         </rect>
                     </property>
                     <property name="text">
-                        <string>When the user is</string>
+                        <string>Deactivate profile completely</string>
+                    </property>
+                    <property name="associations" stdset="0">
+                        <stringlist>
+                            <string>true
+
+ at requirementsCurrent.addUniqueItem(!)</string>
+                        </stringlist>
                     </property>
                 </widget>
-                <widget class="ExecButton">
+                <widget class="Label">
                     <property name="name">
-                        <cstring>addGroupReq</cstring>
+                        <cstring>addCommandReqLabel1</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
-                            <x>460</x>
-                            <y>20</y>
+                            <x>10</x>
+                            <y>50</y>
                             <width>40</width>
-                            <height>24</height>
+                            <height>20</height>
                         </rect>
                     </property>
                     <property name="text">
-                        <string>Add</string>
+                        <string>When</string>
                     </property>
                     <property name="associations" stdset="0">
                         <stringlist>
-                            <string>true
-
- at requirementsCurrent.addUniqueItem(@isMember at groupList)</string>
+                            <string></string>
                         </stringlist>
                     </property>
                 </widget>
-                <widget class="ExecButton">
+                <widget class="Label">
                     <property name="name">
-                        <cstring>addCommandReq</cstring>
+                        <cstring>addCommandReqLabel2</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
-                            <x>460</x>
+                            <x>320</x>
                             <y>50</y>
-                            <width>40</width>
-                            <height>24</height>
+                            <width>131</width>
+                            <height>20</height>
                         </rect>
                     </property>
                     <property name="text">
-                        <string>Add</string>
+                        <string>executes succesfully</string>
                     </property>
                     <property name="associations" stdset="0">
                         <stringlist>
-                            <string>true
-
- at requirementsCurrent.addUniqueItem($(@command))</string>
+                            <string></string>
                         </stringlist>
                     </property>
                 </widget>
                 <widget class="Label">
                     <property name="name">
-                        <cstring>Label12</cstring>
+                        <cstring>addGroupReqLabel1</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
-                            <x>320</x>
-                            <y>50</y>
-                            <width>131</width>
+                            <x>10</x>
+                            <y>20</y>
+                            <width>120</width>
                             <height>20</height>
                         </rect>
                     </property>
                     <property name="text">
-                        <string>executes succesfully</string>
+                        <string>When the user is</string>
                     </property>
                     <property name="associations" stdset="0">
                         <stringlist>
@@ -849,7 +841,7 @@ fi;
                 </widget>
                 <widget class="LineEdit">
                     <property name="name">
-                        <cstring>command</cstring>
+                        <cstring>commandReq</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
@@ -867,27 +859,47 @@ fi;
                 </widget>
                 <widget class="ExecButton">
                     <property name="name">
-                        <cstring>deactivate</cstring>
+                        <cstring>addGroupReq</cstring>
                     </property>
-                    <property name="enabled">
-                        <bool>true</bool>
+                    <property name="geometry">
+                        <rect>
+                            <x>460</x>
+                            <y>20</y>
+                            <width>40</width>
+                            <height>24</height>
+                        </rect>
+                    </property>
+                    <property name="text">
+                        <string>Add</string>
+                    </property>
+                    <property name="associations" stdset="0">
+                        <stringlist>
+                            <string>true
+
+ at requirementsCurrent.addUniqueItem(@isMember at groupList)</string>
+                        </stringlist>
+                    </property>
+                </widget>
+                <widget class="ExecButton">
+                    <property name="name">
+                        <cstring>addCommandReq</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
-                            <x>10</x>
-                            <y>80</y>
-                            <width>200</width>
+                            <x>460</x>
+                            <y>50</y>
+                            <width>40</width>
                             <height>24</height>
                         </rect>
                     </property>
                     <property name="text">
-                        <string>Deactivate profile completely</string>
+                        <string>Add</string>
                     </property>
                     <property name="associations" stdset="0">
                         <stringlist>
                             <string>true
 
- at requirementsCurrent.addUniqueItem(!)</string>
+ at requirementsCurrent.addUniqueItem($(@commandReq))</string>
                         </stringlist>
                     </property>
                 </widget>
@@ -911,7 +923,7 @@ fi;
                     <string>@execBegin
 . /usr/share/desktop-profiles/listingmodule
 
-REQS=$(echo '@profilesAll' | cut --fields 5 --delimiter ';')
+REQS="$(echo '@profilesAll.selection()' | cut --fields 5 --delimiter ';')"
 for_each_requirement "$REQS" 'echo'
 
 @execEnd
@@ -932,22 +944,6 @@ done
         </widget>
         <widget class="Label">
             <property name="name">
-                <cstring>nameLabel</cstring>
-            </property>
-            <property name="geometry">
-                <rect>
-                    <x>11</x>
-                    <y>21</y>
-                    <width>81</width>
-                    <height>22</height>
-                </rect>
-            </property>
-            <property name="text">
-                <string>Name:</string>
-            </property>
-        </widget>
-        <widget class="Label">
-            <property name="name">
                 <cstring>descriptionLabel</cstring>
             </property>
             <property name="geometry">
@@ -961,6 +957,11 @@ done
             <property name="text">
                 <string>Description:</string>
             </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string></string>
+                </stringlist>
+            </property>
         </widget>
         <widget class="Label">
             <property name="name">
@@ -978,38 +979,6 @@ done
                 <string>Kind:</string>
             </property>
         </widget>
-        <widget class="ExecButton">
-            <property name="name">
-                <cstring>cancelChangeSelected</cstring>
-            </property>
-            <property name="geometry">
-                <rect>
-                    <x>629</x>
-                    <y>217</y>
-                    <width>132</width>
-                    <height>24</height>
-                </rect>
-            </property>
-            <property name="text">
-                <string>Cancel Changes</string>
-            </property>
-            <property name="associations" stdset="0">
-                <stringlist>
-                    <string>true
-
- at profilesAll.setCurrentItem(@profiles.findItem(@profiles.selection()))
-
- at nameCurrent.setText(@exec(echo '@profilesAll' | cut --fields 2 --delimiter ';'))
- at locationCurrent.setText(@exec(echo '@profilesAll' | cut --fields 3 --delimiter ';'))
- at precedenceCurrent.setText(@exec(echo '@profilesAll' | cut --fields 4 --delimiter ';'))
- at kindCurrent.setSelection(@exec(echo '@profilesAll' | cut --fields 6 --delimiter ';'))
- at descriptionCurrent.setText(@exec(echo '@profilesAll' | cut --fields 7 --delimiter ';'))
-
- at command.clear()
-</string>
-                </stringlist>
-            </property>
-        </widget>
         <widget class="Label">
             <property name="name">
                 <cstring>locationLabel</cstring>
@@ -1142,6 +1111,38 @@ done
                 </stringlist>
             </property>
         </widget>
+        <widget class="Label">
+            <property name="name">
+                <cstring>nameLabel</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>11</x>
+                    <y>21</y>
+                    <width>81</width>
+                    <height>22</height>
+                </rect>
+            </property>
+            <property name="text">
+                <string>Name:</string>
+            </property>
+        </widget>
+        <widget class="Label">
+            <property name="name">
+                <cstring>listFileLabel</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>10</x>
+                    <y>220</y>
+                    <width>61</width>
+                    <height>20</height>
+                </rect>
+            </property>
+            <property name="text">
+                <string>Listed in</string>
+            </property>
+        </widget>
         <widget class="LineEdit">
             <property name="name">
                 <cstring>nameCurrent</cstring>
@@ -1163,6 +1164,100 @@ done
                 </stringlist>
             </property>
         </widget>
+        <widget class="ScriptObject">
+            <property name="name">
+                <cstring>isNewScript</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>380</x>
+                    <y>230</y>
+                    <width>16</width>
+                    <height>16</height>
+                </rect>
+            </property>
+            <property name="text">
+                <string>@if(isEmpty())
+ at listFileCurrent.setEnabled()
+ at listFileCurrent.setText(/etc/desktop-profiles/custom.listing)</string>
+            </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>@#being togled -> still false
+ at if(@String.compare(false, @isNew))
+  @listFileCurrent.setEnabled(true)
+  @listFileCurrent.setText(/etc/desktop-profiles/custom.listing)
+  @commitChanges.setText(Add new profile)
+ at endif
+
+@#being togled -> still true
+ at if(@String.compare(true, @isNew))
+  @listFileCurrent.setEnabled(false)
+  @listFileCurrent.setText(@exec(echo '@profilesAll.item(@profilesAll.currentItem)' | cut --fields 1 --delimiter ';'))
+  @commitChanges.setText(Save Changes)
+ at endif</string>
+                </stringlist>
+            </property>
+        </widget>
+        <widget class="FileSelector">
+            <property name="name">
+                <cstring>listFileCurrent</cstring>
+            </property>
+            <property name="enabled">
+                <bool>true</bool>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>70</x>
+                    <y>220</y>
+                    <width>300</width>
+                    <height>24</height>
+                </rect>
+            </property>
+            <property name="focusPolicy">
+                <enum>TabFocus</enum>
+            </property>
+            <property name="populationText">
+                <string>/etc/desktop-profiles/custom.listing</string>
+            </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>@widgetText</string>
+                </stringlist>
+            </property>
+            <property name="selectionFilter">
+                <string>*.listing</string>
+            </property>
+        </widget>
+        <widget class="CheckBox">
+            <property name="name">
+                <cstring>isNew</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>380</x>
+                    <y>220</y>
+                    <width>90</width>
+                    <height>20</height>
+                </rect>
+            </property>
+            <property name="text">
+                <string>Is new</string>
+            </property>
+            <property name="checked">
+                <bool>true</bool>
+            </property>
+            <property name="populationText">
+                <string>false</string>
+            </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>false</string>
+                    <string></string>
+                    <string>true</string>
+                </stringlist>
+            </property>
+        </widget>
         <widget class="ExecButton">
             <property name="name">
                 <cstring>commitChanges</cstring>
@@ -1179,63 +1274,97 @@ done
                 </rect>
             </property>
             <property name="text">
-                <string>Save Changes</string>
+                <string>Add new profile</string>
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>true
+                    <string>IS_NEW="@isNew";
 
- at execBegin
+FILE="@listFileCurrent";
+NAME="@nameCurrent";
+LOCATION="@locationCurrent";
+PRECEDENCE="@precedenceCurrent";
+REQS="@requirementsCurrent";
+KIND="@kindCurrent";
+DESC="@descriptionCurrent";
 
+NEW="$NAME;$LOCATION;$PRECEDENCE;$REQS;$KIND;$DESC"
 
-FILE="$(echo '@profilesAll.item(@profilesAll.currentItem)' | cut --fields 1 --delimiter ';')"
-OLD="$(echo '@profilesAll.item(@profilesAll.currentItem)' | cut --fields 2 --delimiter ';')"
-NEW='@nameCurrent;@locationCurrent;@precedenceCurrent;@requirementsCurrent;@kindCurrent;@descriptionCurrent'
-
-if test -w $FILE; then
-  echo "sed -i \"s|^$OLD|$NEW|\" $FILE" > ~/debug
-  sed -i "s%^$OLD.*%$NEW%" $FILE;
+# changing existing profile
+if (test "$IS_NEW" = "false"); then
+  OLD="$(echo '@profilesAll.item(@profilesAll.currentItem)' | cut --fields 2 --delimiter ';')";
+  
+  if test -w "$FILE"; then
+    sed -i "s%^$OLD.*%$NEW%" "$FILE";
+  else
+    kdialog  --error "It appears you don't have permission to write $FILE";
+  fi;
+# adding new profile
 else
-  kdialog  --error "It appears you don't have permission to write $FILE";
-fi;
+  if (test -w "$FILE") || \
+     ( (! test -e "$FILE") && (test -w "$(dirname $FILE)") ); then
+    echo "$NEW" >> "$FILE";
+  else
+    kdialog  --error "It appears you don't have permission to write $FILE";
+  fi;
+fi;</string>
+                </stringlist>
+            </property>
+        </widget>
+        <widget class="ExecButton">
+            <property name="name">
+                <cstring>cancelChangeSelected</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>629</x>
+                    <y>217</y>
+                    <width>132</width>
+                    <height>24</height>
+                </rect>
+            </property>
+            <property name="text">
+                <string>Cancel Changes</string>
+            </property>
+            <property name="associations" stdset="0">
+                <stringlist>
+                    <string>true
+ at profilesAll.setCurrentItem(@profiles.findItem(@profiles.selection))
 
-#echo "$FILE" > ~/debug
-#echo "$OLD" >> ~/debug
-#echo "$NEW" >> ~/debug
+ at nameCurrent.setText(@exec(echo '@profilesAll.selection' | cut --fields 2 --delimiter ';'))
+ at locationCurrent.setText(@exec(echo '@profilesAll.selection' | cut --fields 3 --delimiter ';'))
+ at precedenceCurrent.setText(@exec(echo '@profilesAll.selection' | cut --fields 4 --delimiter ';')) 
+ at kindCurrent.setSelection(@exec(echo '@profilesAll.selection' | cut --fields 6 --delimiter ';'))
+ at descriptionCurrent.setText(@exec(echo '@profilesAll.selection' | cut --fields 7 --delimiter ';'))
 
- at execEnd
+ at isNew.setChecked(false)
+ at commandReq.clear()  
 </string>
                 </stringlist>
             </property>
         </widget>
     </widget>
-    <widget class="ExecButton">
+    <widget class="ListBox">
         <property name="name">
-            <cstring>refreshList</cstring>
+            <cstring>profilesAll</cstring>
         </property>
         <property name="geometry">
             <rect>
-                <x>640</x>
-                <y>240</y>
-                <width>130</width>
-                <height>24</height>
+                <x>630</x>
+                <y>170</y>
+                <width>140</width>
+                <height>64</height>
             </rect>
         </property>
         <property name="focusPolicy">
             <enum>NoFocus</enum>
         </property>
-        <property name="text">
-            <string>Update profile list</string>
+        <property name="populationText">
+            <string>@null</string>
         </property>
         <property name="associations" stdset="0">
             <stringlist>
-                <string>@setGlobal(tmp, at exec(tempfile))
- at exec(list-desktop-profiles --entry-format '$FILE\;$NAME\;$LOCATION\;$PRECEDENCE\;$REQUIREMENTS\;$KIND\;$DESCRIPTION' @filters > @global(tmp))
-
- at profilesAll.setText(@exec(cat @global(tmp)))
- at profiles.setText(@exec("cat @global(tmp) | cut --fields 2,7 --delimiter ';' | sed 's/;/  -  /' "));
-
- at exec(rm @global(tmp))</string>
+                <string></string>
             </stringlist>
         </property>
     </widget>
@@ -1251,6 +1380,14 @@ fi;
                 <height>300</height>
             </rect>
         </property>
+        <property name="sizePolicy">
+            <sizepolicy>
+                <hsizetype>7</hsizetype>
+                <vsizetype>7</vsizetype>
+                <horstretch>1</horstretch>
+                <verstretch>1</verstretch>
+            </sizepolicy>
+        </property>
         <property name="resizePolicy">
             <enum>AutoOneFit</enum>
         </property>
@@ -1258,7 +1395,7 @@ fi;
             <enum>Single</enum>
         </property>
         <property name="columnMode">
-            <enum>FixedNumber</enum>
+            <enum>FitToWidth</enum>
         </property>
         <property name="populationText">
             <string></string>
@@ -1278,12 +1415,6 @@ fi;
         <slot>populate()</slot>
     </connection>
     <connection>
-        <sender>listDesktopProfilesGUI</sender>
-        <signal>widgetOpened()</signal>
-        <receiver>profiles</receiver>
-        <slot>populate()</slot>
-    </connection>
-    <connection>
         <sender>profiles</sender>
         <signal>selected(int)</signal>
         <receiver>precedenceCurrent</receiver>
@@ -1302,130 +1433,124 @@ fi;
         <slot>populate()</slot>
     </connection>
     <connection>
-        <sender>listDesktopProfilesGUI</sender>
-        <signal>widgetOpened()</signal>
-        <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
-    </connection>
-    <connection>
         <sender>sortField</sender>
         <signal>widgetTextChanged(const QString&)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>userList</sender>
         <signal>widgetTextChanged(const QString&)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>test</sender>
         <signal>widgetTextChanged(const QString&)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>precedenceRegexp</sender>
         <signal>returnPressed()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>precedenceRegexp</sender>
         <signal>lostFocus()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>kindRegexp</sender>
         <signal>returnPressed()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>kindRegexp</sender>
         <signal>lostFocus()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>requirementRegexp</sender>
         <signal>returnPressed()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>requirementRegexp</sender>
         <signal>lostFocus()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>nameRegexp</sender>
         <signal>lostFocus()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>nameRegexp</sender>
         <signal>returnPressed()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>descriptionRegexp</sender>
         <signal>lostFocus()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>descriptionRegexp</sender>
         <signal>returnPressed()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>userFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>locationFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>descriptionFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>nameFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>precedenceFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>kindFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>requirementFilter</sender>
         <signal>toggled(bool)</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
     </connection>
     <connection>
         <sender>cancelChangeSelected</sender>
@@ -1449,18 +1574,55 @@ fi;
         <sender>commitChanges</sender>
         <signal>clicked()</signal>
         <receiver>refreshList</receiver>
-        <slot>startProcess()</slot>
+        <slot>execute()</slot>
+    </connection>
+    <connection>
+        <sender>isNew</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>isNewScript</receiver>
+        <slot>execute()</slot>
+    </connection>
+    <connection>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetOpened()</signal>
+        <receiver>listFileCurrent</receiver>
+        <slot>populate()</slot>
+    </connection>
+    <connection>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetOpened()</signal>
+        <receiver>refreshList</receiver>
+        <slot>execute()</slot>
+    </connection>
+    <connection>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetOpened()</signal>
+        <receiver>refreshList</receiver>
+        <slot>execute()</slot>
+    </connection>
+    <connection>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetOpened()</signal>
+        <receiver>profiles</receiver>
+        <slot>setFocus()</slot>
     </connection>
 </connections>
 <tabstops>
+    <tabstop>kindFilter</tabstop>
     <tabstop>kindRegexp</tabstop>
+    <tabstop>requirementFilter</tabstop>
     <tabstop>requirementRegexp</tabstop>
+    <tabstop>precedenceFilter</tabstop>
     <tabstop>test</tabstop>
     <tabstop>precedenceRegexp</tabstop>
+    <tabstop>userFilter</tabstop>
+    <tabstop>userList</tabstop>
+    <tabstop>nameFilter</tabstop>
     <tabstop>nameRegexp</tabstop>
+    <tabstop>descriptionFilter</tabstop>
     <tabstop>descriptionRegexp</tabstop>
+    <tabstop>locationFilter</tabstop>
     <tabstop>locationRegexp</tabstop>
-    <tabstop>userList</tabstop>
     <tabstop>sortField</tabstop>
     <tabstop>profiles</tabstop>
     <tabstop>nameCurrent</tabstop>
@@ -1473,18 +1635,13 @@ fi;
     <tabstop>isMember</tabstop>
     <tabstop>groupList</tabstop>
     <tabstop>addGroupReq</tabstop>
-    <tabstop>command</tabstop>
+    <tabstop>commandReq</tabstop>
     <tabstop>addCommandReq</tabstop>
     <tabstop>deactivate</tabstop>
+    <tabstop>listFileCurrent</tabstop>
+    <tabstop>isNew</tabstop>
     <tabstop>commitChanges</tabstop>
     <tabstop>cancelChangeSelected</tabstop>
-    <tabstop>kindFilter</tabstop>
-    <tabstop>requirementFilter</tabstop>
-    <tabstop>precedenceFilter</tabstop>
-    <tabstop>nameFilter</tabstop>
-    <tabstop>descriptionFilter</tabstop>
-    <tabstop>locationFilter</tabstop>
-    <tabstop>userFilter</tabstop>
     <tabstop>profilesAll</tabstop>
     <tabstop>refreshList</tabstop>
 </tabstops>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list