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

List:       kde-commits
Subject:    extragear/sysadmin/kiosktool
From:       Ian Reinhart Geiser <geiseri () kde ! org>
Date:       2009-03-01 23:26:49
Message-ID: 1235950009.826200.18200.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 933934 by geiseri:

Ported a few more groups from the old data.xml file.
Fixed a spelling error in the file name...
Started adding the ability to edit default config values.



 M  +1 -1      CMakeLists.txt  
 M  +21 -0     componentPage.cpp  
 M  +1 -0      componentPage.h  
 M  +166 -123  componentPage_ui.ui  
 M  +12 -32    componentSelectionPage_ui.ui  
 AM            data/general.kiosk   data/general.kisok#933756
 D             data/general.kisok  
 A             data/themes.kiosk  
 M  +3 -1      kioskdata.cpp  
 M  +1 -3      kioskdata.h  
 M  +13 -8     pageWidget.cpp  


--- trunk/extragear/sysadmin/kiosktool/CMakeLists.txt #933933:933934
@@ -61,7 +61,7 @@
 FILE(GLOB captionfiles caption*.png)
 install( FILES ${captionfiles} DESTINATION ${DATA_INSTALL_DIR}/kiosktool )
 
-install( FILES data/general.kisok DESTINATION ${DATA_INSTALL_DIR}/kiosktool )
+install( FILES data/general.kiosk data/themes.kiosk DESTINATION \
${DATA_INSTALL_DIR}/kiosktool )  
 kde4_install_icons( ${ICON_INSTALL_DIR} )
 
--- trunk/extragear/sysadmin/kiosktool/componentPage.cpp #933933:933934
@@ -48,6 +48,7 @@
   m_process = 0;
   connect(pbSetup, SIGNAL(clicked()), this, SLOT(slotSetup()));
   connect(pbPreview, SIGNAL(clicked()), this, SLOT(slotPreview()));
+  connect(defaultValue, SIGNAL(editingFinished()), this, SLOT(slotUpdateValue()));
 
   pbSetup->setText(i18n("&Setup %1",m_data->caption));
   pbPreview->setText(i18n("&Preview %1",m_data->caption));
@@ -321,8 +322,28 @@
    {
       description = "<h2>" + actionItem->action()->caption +"</h2>";
       description += actionItem->action()->description;
+      if( actionItem->action()->type == ComponentAction::ActConfig )
+      {
+	    defaultValueGroup->show();
+	    defaultValue->setText( actionItem->action()->defaultValue );
+      }
+      else
+	    defaultValueGroup->hide();
    }
    componentDescription->setText(description);
 }
 
+void ComponentPage::slotUpdateValue(  )
+{
+    ComponentActionItem *actionItem = dynamic_cast<ComponentActionItem*>( \
listComponentConfig->currentItem() ); +    if( actionItem )
+    {
+	actionItem->action()->defaultValue = defaultValue->text();
+	if( !defaultValue->text().isEmpty() )
+            actionItem->setCheckState(Qt::Checked);
+        else
+            actionItem->setCheckState(Qt::Unchecked);
+    }
+}
+
 #include "componentPage.moc"
--- trunk/extragear/sysadmin/kiosktool/componentPage.h #933933:933934
@@ -53,6 +53,7 @@
   void slotShowAction(QListWidgetItem *item);
   void slotSetupAppRegistered( const QByteArray &appid);
   void slotPreviewAppRegistered( const QByteArray &appid);
+  void slotUpdateValue( );
 
 protected:
   void prepareMutableFiles();
--- trunk/extragear/sysadmin/kiosktool/componentPage_ui.ui #933933:933934
@@ -1,167 +1,210 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
+<ui version="4.0" >
  <class>ComponentPageUI</class>
- <widget class="QWidget" name="ComponentPageUI">
-  <property name="geometry">
+ <widget class="QWidget" name="ComponentPageUI" >
+  <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>559</width>
-    <height>372</height>
+    <width>438</width>
+    <height>409</height>
    </rect>
   </property>
-  <layout class="QGridLayout">
-   <item row="3" column="0" colspan="4">
-    <widget class="QLabel" name="componentDescription">
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>140</height>
-      </size>
+  <layout class="QVBoxLayout" name="verticalLayout_2" >
+   <item>
+    <widget class="QLabel" name="textLabel1" >
+     <property name="text" >
+      <string>Enable &amp;restrictions:</string>
      </property>
-     <property name="maximumSize">
-      <size>
-       <width>32767</width>
-       <height>140</height>
-      </size>
+     <property name="wordWrap" >
+      <bool>false</bool>
      </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
+     <property name="buddy" >
+      <cstring>listComponentConfig</cstring>
      </property>
-     <property name="frameShadow">
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignTop</set>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
     </widget>
    </item>
-   <item row="2" column="1">
-    <spacer name="spacer8">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>16</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="3">
-    <layout class="QVBoxLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3" >
      <item>
-      <widget class="QPushButton" name="pbSetup">
-       <property name="text">
-        <string>&amp;Setup XXX</string>
+      <widget class="KListWidget" name="listComponentConfig" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+         <horstretch>1</horstretch>
+         <verstretch>1</verstretch>
+        </sizepolicy>
        </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="spacer8_2">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Fixed</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
+       <property name="minimumSize" >
         <size>
-         <width>20</width>
-         <height>16</height>
+         <width>300</width>
+         <height>150</height>
         </size>
        </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pbPreview">
-       <property name="text">
-        <string>&amp;Preview XXX</string>
+       <property name="editTriggers" >
+        <set>QAbstractItemView::NoEditTriggers</set>
        </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="spacer8_3">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
+       <property name="dragDropMode" >
+        <enum>QAbstractItemView::NoDragDrop</enum>
        </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
+       <property name="selectionBehavior" >
+        <enum>QAbstractItemView::SelectRows</enum>
        </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>21</width>
-         <height>171</height>
-        </size>
+       <property name="uniformItemSizes" >
+        <bool>true</bool>
        </property>
-      </spacer>
+       <property name="fullWidth" stdset="0" >
+        <bool>true</bool>
+       </property>
+      </widget>
      </item>
+     <item>
+      <layout class="QVBoxLayout" >
+       <item>
+        <widget class="KPushButton" name="pbSetup" >
+         <property name="text" >
+          <string>&amp;Setup XXX</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="KPushButton" name="pbPreview" >
+         <property name="text" >
+          <string>&amp;Preview XXX</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="spacer8_3" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType" >
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>21</width>
+           <height>171</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
     </layout>
    </item>
-   <item row="1" column="2">
-    <spacer name="spacer7">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
+   <item>
+    <widget class="QGroupBox" name="defaultValueGroup" >
+     <property name="title" >
+      <string>Default Value:</string>
      </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>16</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
+     <layout class="QHBoxLayout" name="horizontalLayout_2" >
+      <property name="spacing" >
+       <number>3</number>
+      </property>
+      <property name="leftMargin" >
+       <number>3</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>3</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout" >
+        <item>
+         <widget class="QLabel" name="label" >
+          <property name="text" >
+           <string>Value:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="KLineEdit" name="defaultValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+            <horstretch>1</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="imutable" >
+        <property name="text" >
+         <string>Imutable</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="shellExpansion" >
+        <property name="text" >
+         <string>Use Shell Expansion</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
    </item>
-   <item row="1" column="0" colspan="2">
-    <widget class="KListWidget" name="listComponentConfig">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+   <item>
+    <widget class="QLabel" name="componentDescription" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
        <horstretch>1</horstretch>
        <verstretch>1</verstretch>
       </sizepolicy>
      </property>
-     <property name="minimumSize">
+     <property name="minimumSize" >
       <size>
-       <width>300</width>
-       <height>150</height>
+       <width>0</width>
+       <height>140</height>
       </size>
      </property>
-     <property name="viewMode">
-      <enum>QListView::IconMode</enum>
+     <property name="maximumSize" >
+      <size>
+       <width>32767</width>
+       <height>140</height>
+      </size>
      </property>
-     <property name="uniformItemSizes">
-      <bool>true</bool>
+     <property name="frameShape" >
+      <enum>QFrame::StyledPanel</enum>
      </property>
-     <property name="fullWidth" stdset="0">
-      <bool>true</bool>
+     <property name="frameShadow" >
+      <enum>QFrame::Sunken</enum>
      </property>
-    </widget>
-   </item>
-   <item row="0" column="0">
-    <widget class="QLabel" name="textLabel1">
-     <property name="text">
-      <string>Enable &amp;restrictions:</string>
+     <property name="alignment" >
+      <set>Qt::AlignTop</set>
      </property>
-     <property name="wordWrap">
-      <bool>false</bool>
+     <property name="wordWrap" >
+      <bool>true</bool>
      </property>
-     <property name="buddy">
-      <cstring>listComponentConfig</cstring>
-     </property>
     </widget>
    </item>
   </layout>
  </widget>
- <layoutdefault spacing="6" margin="11"/>
+ <layoutdefault spacing="6" margin="11" />
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KListWidget</class>
+   <extends>QListWidget</extends>
+   <header>klistwidget.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KPushButton</class>
+   <extends>QPushButton</extends>
+   <header>kpushbutton.h</header>
+  </customwidget>
+ </customwidgets>
  <resources/>
  <connections/>
 </ui>
--- trunk/extragear/sysadmin/kiosktool/componentSelectionPage_ui.ui #933933:933934
@@ -11,38 +11,6 @@
   </property>
   <layout class="QGridLayout" >
    <item row="1" column="2" >
-    <spacer name="spacer2_2" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="1" >
-    <spacer name="spacer5" >
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="3" >
     <layout class="QVBoxLayout" >
      <item>
       <widget class="QPushButton" name="pbSetup" >
@@ -83,9 +51,21 @@
        <height>200</height>
       </size>
      </property>
+     <property name="movement" >
+      <enum>QListView::Snap</enum>
+     </property>
+     <property name="gridSize" >
+      <size>
+       <width>64</width>
+       <height>64</height>
+      </size>
+     </property>
      <property name="viewMode" >
       <enum>QListView::IconMode</enum>
      </property>
+     <property name="uniformItemSizes" >
+      <bool>true</bool>
+     </property>
      <property name="wordWrap" >
       <bool>true</bool>
      </property>
** trunk/extragear/sysadmin/kiosktool/data/general.kiosk #property svn:mergeinfo
   + 
--- trunk/extragear/sysadmin/kiosktool/kioskdata.cpp #933933:933934
@@ -210,8 +210,10 @@
 
 bool KioskData::load()
 {
-  foreach( QString groupFile, KGlobal::dirs()->findAllResources("data", \
"kiosktool/*.kisok", KStandardDirs::NoDuplicates) ) +  foreach( QString groupFile, \
KGlobal::dirs()->findAllResources("data", "kiosktool/*.kiosk", \
KStandardDirs::NoDuplicates) )  {   
+    kDebug() << "Loading:" << groupFile;
+    
     KConfig groupConfigFile(groupFile, KConfig::SimpleConfig);
     ComponentData *componentData = new ComponentData;
     if (componentData->load(&groupConfigFile))
--- trunk/extragear/sysadmin/kiosktool/kioskdata.h #933933:933934
@@ -46,10 +46,8 @@
    QString group;
    QString key;
    QList<ComponentAction*> subActions;
-   bool defaultValue;
+   QString defaultValue;
    QString version;
-
-
 };
 class ComponentExecData
 {
--- trunk/extragear/sysadmin/kiosktool/pageWidget.cpp #933933:933934
@@ -59,6 +59,7 @@
   int index = 0;
   foreach( ComponentAction *action, componentData->actions )
   {
+     //TODO: Check KDE version here vs the component action version
      ComponentActionItem *item = new ComponentActionItem(listView, action, index++);
      if (index == 1)
         item->setSelected(true);
@@ -126,10 +127,13 @@
            file = "kdeglobals";
         KConfig *cfg = KioskRun::self()->configFile(file);
         KConfigGroup grp = cfg->group(action->group);
-        bool checked = grp.readEntry(action->key, action->defaultValue);
+        bool checked = !grp.readEntry(action->key, QString() ).isEmpty();
         if( checked )
-            item->setCheckState(Qt::Checked);
-        else
+        {
+	    item->setCheckState(Qt::Checked);
+	    action->defaultValue = grp.readEntry(action->key, QString() );
+        }
+	else
             item->setCheckState(Qt::Unchecked);
      }
   }
@@ -202,11 +206,12 @@
      KConfig *cfg = KioskRun::self()->configFile(file);
      KConfigGroup grp = cfg->group(action->group);
         
-     if (grp.readEntry(action->key, action->defaultValue) != b)
-     {
-        grp.writeEntry(action->key, b);
-        KioskRun::self()->scheduleSycocaUpdate();
-     }
+     if( action->defaultValue.isEmpty() )
+	grp.deleteEntry( action->key );
+     else
+	grp.writeEntry(action->key, action->defaultValue);
+     KioskRun::self()->scheduleSycocaUpdate();
+
   }
   
   foreach( ComponentAction *subAction,  action->subActions )


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

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