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

List:       kde-commits
Subject:    branches/work/kdelirc
From:       Michael Zanetti <michael_zanetti () gmx ! net>
Date:       2010-02-28 17:41:18
Message-ID: 1267378878.566101.18228.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1097212 by mzanetti:

notifier item up and running


 M  +1 -1      CMakeLists.txt  
 M  +0 -1      TODO  
 M  +28 -18    kcmremotecontrol/configurationwidget.ui  
 M  +11 -0     kcmremotecontrol/kcmremotecontrol.cpp  
 M  +2 -4      kded/CMakeLists.txt  
 D             kded/icons (directory)  
 M  +7 -3      kded/kremotecontroldaemon.cpp  
 A             krcdnotifieritem (directory)  
 A             krcdnotifieritem/CMakeLists.txt  
 A             krcdnotifieritem/icons (directory)  
 A             krcdnotifieritem/icons/CMakeLists.txt   \
kded/icons/CMakeLists.txt#1096755  A             \
krcdnotifieritem/icons/hi22-app-krcd.png   kded/icons/hi22-app-krcd.png#1096755  A    \
krcdnotifieritem/icons/hisc-app-krcd.svgz   kded/icons/hisc-app-krcd.svgz#1096755  A  \
krcdnotifieritem/icons/ox22-action-krcd_flash.png   \
kded/icons/ox22-action-krcd.png#1096755  A             \
krcdnotifieritem/icons/ox22-action-krcd_off.png   \
kded/icons/ox22-action-krcd_off.png#1096755  A             \
krcdnotifieritem/icons/oxsc-action-krcd_flash.svgz   \
kded/icons/oxsc-action-krcd_flash.svgz#1096755  A             \
krcdnotifieritem/icons/oxsc-action-krcd_off.svgz   \
kded/icons/oxsc-action-krcd_off.svgz#1096755  A             \
krcdnotifieritem/krcdnotifieritem.cpp   [License: GPL (v2+)]  A             \
krcdnotifieritem/krcdnotifieritem.desktop    A             \
krcdnotifieritem/krcdnotifieritem.h   [License: GPL (v2+)]  A             \
krcdnotifieritem/main.cpp   [License: GPL (v2+) (+Qt exception)]  M  +1 -1      \
libkremotecontrol/dbusinterface.cpp    M  +1 -1      libkremotecontrol/remote.cpp  
 M  +1 -1      libkremotecontrol/remote.h  
 M  +5 -3      libkremotecontrol/remotelist.cpp  


--- branches/work/kdelirc/CMakeLists.txt #1097211:1097212
@@ -4,10 +4,10 @@
 add_subdirectory(kcmremotecontrol)
 add_subdirectory(profiles)
 add_subdirectory(kded)
+add_subdirectory(krcdnotifieritem)
 add_subdirectory(dataengine)
 add_subdirectory(applet)
 
 if(KDE4_BUILD_TESTS)
   add_subdirectory(tests)
 endif(KDE4_BUILD_TESTS)
-
--- branches/work/kdelirc/TODO #1097211:1097212
@@ -3,7 +3,6 @@
 * update docs (mzanetti)
 * move plasma stuff to playground (frasche)
 * Tooltips for Profiles in KCM (frasche)
-* finish NotifierItem (mzanetti)
 * Check/update all profiles (frasche)
 * rework nofications from Kded (mzanetti + frasche)
 * test/fix behaviour on newly attached or removed remotes during runtime (mzanetti)
--- branches/work/kdelirc/kcmremotecontrol/configurationwidget.ui #1097211:1097212
@@ -15,7 +15,7 @@
    <string>Linux Infrared Remote Control</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
-   <item row="0" column="0">
+   <item row="1" column="0">
     <widget class="QLabel" name="label_2">
      <property name="maximumSize">
       <size>
@@ -31,7 +31,7 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="2">
+   <item row="1" column="2">
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <property name="spacing">
       <number>0</number>
@@ -52,7 +52,7 @@
      </item>
     </layout>
    </item>
-   <item row="1" column="0" rowspan="8">
+   <item row="2" column="0" rowspan="8">
     <widget class="QTreeView" name="tvRemotes">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@@ -80,7 +80,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="2" rowspan="8">
+   <item row="2" column="2" rowspan="8">
     <widget class="QTreeView" name="tvActions">
      <property name="editTriggers">
       <set>QAbstractItemView::NoEditTriggers</set>
@@ -96,7 +96,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
+   <item row="2" column="1">
     <widget class="KPushButton" name="pbAddMode">
      <property name="enabled">
       <bool>false</bool>
@@ -118,7 +118,7 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="1">
+   <item row="3" column="1">
     <widget class="KPushButton" name="pbRemoveMode">
      <property name="enabled">
       <bool>false</bool>
@@ -140,7 +140,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="1">
+   <item row="4" column="1">
     <widget class="KPushButton" name="pbEditMode">
      <property name="enabled">
       <bool>false</bool>
@@ -162,7 +162,7 @@
      </property>
     </widget>
    </item>
-   <item row="4" column="1">
+   <item row="5" column="1">
     <widget class="KPushButton" name="pbMoveModeUp">
      <property name="enabled">
       <bool>false</bool>
@@ -184,7 +184,7 @@
      </property>
     </widget>
    </item>
-   <item row="6" column="1" rowspan="3">
+   <item row="7" column="1" rowspan="3">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -197,7 +197,7 @@
      </property>
     </spacer>
    </item>
-   <item row="1" column="3">
+   <item row="2" column="3">
     <widget class="KPushButton" name="pbAddAction">
      <property name="enabled">
       <bool>false</bool>
@@ -219,7 +219,7 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="3">
+   <item row="3" column="3">
     <widget class="KPushButton" name="pbRemoveAction">
      <property name="enabled">
       <bool>false</bool>
@@ -241,7 +241,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="3">
+   <item row="4" column="3">
     <widget class="KPushButton" name="pbEditAction">
      <property name="enabled">
       <bool>false</bool>
@@ -263,7 +263,7 @@
      </property>
     </widget>
    </item>
-   <item row="4" column="3">
+   <item row="5" column="3">
     <widget class="KPushButton" name="pbCopyAction">
      <property name="enabled">
       <bool>false</bool>
@@ -285,7 +285,7 @@
      </property>
     </widget>
    </item>
-   <item row="6" column="3">
+   <item row="7" column="3">
     <widget class="KPushButton" name="pbMoveActionUp">
      <property name="enabled">
       <bool>false</bool>
@@ -307,7 +307,7 @@
      </property>
     </widget>
    </item>
-   <item row="7" column="3">
+   <item row="8" column="3">
     <widget class="KPushButton" name="pbMoveActionDown">
      <property name="enabled">
       <bool>false</bool>
@@ -329,7 +329,7 @@
      </property>
     </widget>
    </item>
-   <item row="8" column="3">
+   <item row="9" column="3">
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -342,7 +342,7 @@
      </property>
     </spacer>
    </item>
-   <item row="5" column="3">
+   <item row="6" column="3">
     <widget class="KPushButton" name="pbAutoPopulate">
      <property name="minimumSize">
       <size>
@@ -361,7 +361,7 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="1">
+   <item row="6" column="1">
     <widget class="KPushButton" name="pbMoveModeDown">
      <property name="enabled">
       <bool>false</bool>
@@ -383,6 +383,16 @@
      </property>
     </widget>
    </item>
+   <item row="10" column="0">
+    <widget class="QCheckBox" name="cbTrayIcon">
+     <property name="text">
+      <string>Show tray icon</string>
+     </property>
+     <property name="checked">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
--- branches/work/kdelirc/kcmremotecontrol/kcmremotecontrol.cpp #1097211:1097212
@@ -113,6 +113,8 @@
     connect(ui.tvActions->selectionModel(), SIGNAL(currentChanged(const QModelIndex \
                &, const QModelIndex &)), SLOT(actionSelectionChanged(const \
                QModelIndex &)));
     connect(ui.tvActions, SIGNAL(doubleClicked(QModelIndex)), SLOT(editAction()));
     
+    // connect ShowTrayIcon checkbox
+    connect(ui.cbTrayIcon, SIGNAL(clicked(bool)), SLOT(changed()));
 }
 
 KCMRemoteControl::~KCMRemoteControl() {
@@ -369,6 +371,11 @@
             }
         }
     }
+
+    KConfig config("kremotecontrolrc");
+    KConfigGroup globalGroup = KConfigGroup(&config, "Global");
+    ui.cbTrayIcon->setChecked(globalGroup.readEntry("ShowTrayIcon", true));
+
 }
 
 void KCMRemoteControl::save() {
@@ -381,6 +388,10 @@
             DBusInterface::getInstance()->unloadKdedModule();
         }
     }
+    
+    KConfig config("kremotecontrolrc");
+    KConfigGroup globalGroup = KConfigGroup(&config, "Global");
+    globalGroup.writeEntry("ShowTrayIcon", ui.cbTrayIcon->isChecked());
 }
 
 void KCMRemoteControl::gotButton(QString remote, QString button) {
--- branches/work/kdelirc/kded/CMakeLists.txt #1097211:1097212
@@ -1,4 +1,3 @@
-add_subdirectory( icons )
 
 include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/../libkremotecontrol
@@ -8,7 +7,7 @@
    kremotecontroldaemon.cpp
    )
 
-set(krcd_xml  org.kde.krcd.xml)
+set(krcd_xml org.kde.krcd.xml)
 
 
 qt4_add_dbus_adaptor( kded_kremotecontrol_SRCS org.kde.krcd.xml  \
kremotecontroldaemon.h KRemoteControlDaemon) @@ -24,6 +23,5 @@
 )
 
 install(TARGETS kded_kremotecontrol DESTINATION ${PLUGIN_INSTALL_DIR})
-
 install( FILES kremotecontrol.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
-install( FILES krcd.notifyrc  DESTINATION  ${DATA_INSTALL_DIR}/krcd )
\ No newline at end of file
+install( FILES krcd.notifyrc  DESTINATION  ${DATA_INSTALL_DIR}/krcd )
--- branches/work/kdelirc/kded/kremotecontroldaemon.cpp #1097211:1097212
@@ -52,15 +52,12 @@
   private:
       RemoteList m_remoteList;    
       QStringList m_ignoreNextButtonList;
-      KStatusNotifierItem m_notifier;
 
   public:
     
       KComponentData applicationData;
 
       KRemoteControlDaemonPrivate() {
-          m_notifier.setIconByName("infrared-remote");
-          m_notifier.setCategory(KStatusNotifierItem::Hardware);
       };
  
       RemoteList remoteList(){
@@ -68,7 +65,14 @@
       };
     
       void reload(){
+          kDebug() << \
"******************************************************reloading";  \
m_remoteList.loadFromConfig("kremotecontrolrc"); +          KConfig \
config("kremotecontrolrc"); +          KConfigGroup globalGroup(&config, "Global");
+          if(globalGroup.readEntry("ShowTrayIcon", true)){
+              kDebug() << "starting notifier item" <<
+              KToolInvocation::kdeinitExec("krcdnotifieritem");
+          }
       };
     
       Remote* getRemote(const QString& remoteName) {          
--- branches/work/kdelirc/libkremotecontrol/dbusinterface.cpp #1097211:1097212
@@ -411,7 +411,7 @@
 
 void DBusInterface::changeMode(const QString& remoteName, const QString& modeName) { \
                
       QDBusMessage m = QDBusMessage::createMethodCall("org.kde.kded", \
                "/modules/kremotecontrol",
-                     "org.kde.krcd", "getConfiguredRemotes");    		      
+                     "org.kde.krcd", "changeMode");    		      
     m << remoteName;
     m << modeName;
     QDBusMessage response = QDBusConnection::sessionBus().call(m);
--- branches/work/kdelirc/libkremotecontrol/remote.cpp #1097211:1097212
@@ -359,7 +359,7 @@
 
 QStringList Remote::availableModeSwitchButtons(const Mode *mode) const {
     QStringList buttonList = m_modechangeHandler->availableModeSwitchButtons();
-    if(!mode->button().isEmpty() && !buttonList.contains(mode->button())){
+    if(mode && !mode->button().isEmpty() && !buttonList.contains(mode->button())){
         buttonList.append(mode->button());
     }
     return buttonList;
--- branches/work/kdelirc/libkremotecontrol/remote.h #1097211:1097212
@@ -83,7 +83,7 @@
         /**
           * Get buttons available for this mode (Free buttons + the current button \
                for this mode)
           */
-        QStringList availableModeSwitchButtons(const Mode *mode) const;
+        QStringList availableModeSwitchButtons(const Mode *mode = 0) const;
         /**
           * Get buttons available for switching to the next mode (Free buttons + the \
                current button nextMode)
           */
--- branches/work/kdelirc/libkremotecontrol/remotelist.cpp #1097211:1097212
@@ -40,10 +40,11 @@
 
 void RemoteList::saveToConfig(const QString& configName) {
     KConfig config(configName);
+    KConfigGroup remotesGroup(&config, "Remotes");
     for(QList<Remote*>::const_iterator i = constBegin(); i != constEnd(); ++i){
         // Clear out old entries for this remote
         config.deleteGroup((*i)->name());
-        KConfigGroup remoteGroup(&config, (*i)->name());
+        KConfigGroup remoteGroup(&remotesGroup, (*i)->name());
         // Save Remote properties here
         remoteGroup.writeEntry("DefaultMode", (*i)->defaultMode()->name());
         remoteGroup.writeEntry("ModeChangeMode", (*i)->modeChangeMode() == \
Remote::Group ? "Group" : "Cycle"); @@ -70,10 +71,11 @@
 void RemoteList::loadFromConfig(const QString& configName) {
     clear(); //Drop old entries
     KConfig config(configName, KConfig::NoGlobals);
+    KConfigGroup remotesGroup(&config, "Remotes");
 
-    foreach(const QString &remoteGroupName, config.groupList()){
+    foreach(const QString &remoteGroupName, remotesGroup.groupList()){
         Remote *remote = new Remote(remoteGroupName);
-        KConfigGroup remoteGroup(&config, remoteGroupName);
+        KConfigGroup remoteGroup(&remotesGroup, remoteGroupName);
         foreach(const QString &modeName, remoteGroup.groupList()){
             KConfigGroup modeGroup(&remoteGroup, modeName);
             Mode *mode;


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

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