[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-03-01 0:10:43
Message-ID: 1267402243.528145.17916.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1097354 by mzanetti:

editdialogs in kcm can now select buttons with remote


 M  +0 -3      TODO  
 M  +19 -2     kcmremotecontrol/editactioncontainer.cpp  
 M  +2 -0      kcmremotecontrol/editactioncontainer.h  
 M  +15 -0     kcmremotecontrol/modedialog.cpp  
 M  +2 -1      kcmremotecontrol/modedialog.h  
 M  +3 -3      libkremotecontrol/profileserver.cpp  


--- branches/work/kdelirc/TODO #1097353:1097354
@@ -1,13 +1,10 @@
 TODOs before move to kdereview
 -------------------------------
 * update docs (mzanetti)
-* move plasma stuff to playground (frasche)
-* Tooltips for Profiles in KCM (frasche)
 * Check/update all profiles (frasche)
 * rework nofications from Kded (mzanetti + frasche)
 * test/fix behaviour on newly attached or removed remotes during runtime (mzanetti)
 * rework icons
-* button selection via buttonpress in kcm
 * remove compiler warnings
 * check why profile stringlist default values are not reaaded from xml
 * knewstuff
--- branches/work/kdelirc/kcmremotecontrol/editactioncontainer.cpp #1097353:1097354
@@ -20,12 +20,14 @@
 #include "editactioncontainer.h"
 #include "editdbusaction.h"
 #include "editprofileaction.h"
+#include "dbusinterface.h"
+#include "executionengine.h"
 
 #include <kdebug.h>
-#include <executionengine.h>
 
 EditActionContainer::EditActionContainer(Action *action, const QString &remote, \
QWidget* parent, Qt::WFlags flags): KDialog(parent, flags) {  m_action = action;
+    m_remote = remote;
     
     QWidget *widget = new QWidget(this);
     ui.setupUi(widget);
@@ -69,6 +71,11 @@
         connect(m_innerWidget, SIGNAL(formComplete(bool)), \
SLOT(checkForComplete()));  }
     checkForComplete();
+    
+    // Pause remote to make use of button presses here
+    DBusInterface::getInstance()->ignoreButtonEvents(remote);
+    connect(new Solid::Control::RemoteControl(remote), SIGNAL(buttonPressed(const \
Solid::Control::RemoteControlButton &)), SLOT(buttonPressed(const \
Solid::Control::RemoteControlButton &))); +    
 }
 
 void EditActionContainer::checkForComplete() {
@@ -137,7 +144,17 @@
             default:
               kDebug() << "Invalid action type! Not executing!";
         }
-      
+        // return here because try button should not unpause remote
+        return;
     }
+    DBusInterface::getInstance()->considerButtonEvents(m_remote);
     KDialog::slotButtonClicked(button);
 }
+
+void EditActionContainer::buttonPressed(const Solid::Control::RemoteControlButton& \
button) { +    kDebug() << "button event received";
+    if(button.remoteName() == m_remote) {
+        ui.cbButton->setCurrentIndex(ui.cbButton->findText(button.name()));
+    }
+}
+
--- branches/work/kdelirc/kcmremotecontrol/editactioncontainer.h #1097353:1097354
@@ -35,10 +35,12 @@
         Ui::ActionContainer ui;
         Action *m_action;
         QWidget *m_innerWidget;
+        QString m_remote;
         
     protected Q_SLOTS:
         void checkForComplete();
         virtual void slotButtonClicked(int button);
+        void buttonPressed(const Solid::Control::RemoteControlButton &button);
 };
 
 #endif // ACTIONCONTAINER_H
--- branches/work/kdelirc/kcmremotecontrol/modedialog.cpp #1097353:1097354
@@ -26,6 +26,7 @@
 
 #include "modedialog.h"
 #include "mode.h"
+#include "dbusinterface.h"
 
 #include <kdebug.h>
 #include <kmessagebox.h>
@@ -82,6 +83,10 @@
     connect(ui.cbButtonForward, SIGNAL(currentIndexChanged(int)), this, \
                SLOT(forwardButtonChanged(int)));
     connect(ui.cbButtonBackward, SIGNAL(currentIndexChanged(int)), this, \
SLOT(backwardButtonChanged(int)));  checkForComplete();
+
+    // Pause remote to make use of button presses here
+    DBusInterface::getInstance()->ignoreButtonEvents(remote->name());
+    connect(new Solid::Control::RemoteControl(remote->name()), \
SIGNAL(buttonPressed(const Solid::Control::RemoteControlButton &)), \
SLOT(buttonPressed(const Solid::Control::RemoteControlButton &)));  }
 
 ModeDialog::~ModeDialog() {
@@ -135,6 +140,7 @@
             m_remote->setPreviousModeButton(ui.cbButtonBackward->itemData(ui.cbButtonBackward->currentIndex()).toString());
  }
     }
+    DBusInterface::getInstance()->considerButtonEvents(m_remote->name());
     KDialog::slotButtonClicked(button);
 }
 
@@ -164,4 +170,13 @@
     connect(ui.cbButtonForward, SIGNAL(currentIndexChanged(int)), this, \
SLOT(forwardButtonChanged(int)));  }
 
+void ModeDialog::buttonPressed(const Solid::Control::RemoteControlButton& button) {
+    kDebug() << "button event received";
+    if(button.remoteName() == m_remote->name()) {
+        if(m_mode != m_remote->masterMode()){
+            ui.cbButtons->setCurrentIndex(ui.cbButtons->findText(button.name()));    \
 +        }
+    }
+}
+
 #include "modedialog.moc"
--- branches/work/kdelirc/kcmremotecontrol/modedialog.h #1097353:1097354
@@ -20,7 +20,7 @@
 
 
 /**
-  * @author Gav Wood, Michael Zanetti
+  * @author Michael Zanetti
   */
 
 
@@ -54,6 +54,7 @@
     void slotButtonClicked(int button);
     void forwardButtonChanged(int index);
     void backwardButtonChanged(int index);
+    void buttonPressed(const Solid::Control::RemoteControlButton &button);
 };
 
 #endif /* NEWMODEDIALOG_H */
--- branches/work/kdelirc/libkremotecontrol/profileserver.cpp #1097353:1097354
@@ -280,8 +280,8 @@
                 argValue.convert(QVariant::nameToType(typeString.toLocal8Bit()));
             }
             arguments.append(Argument(argValue, description));
-            kDebug()<< "		" << "description" << description;
-            kDebug()<< "		" << "value" << argValue;
+/*            kDebug()<< "		" << "description" << description;
+            kDebug()<< "		" << "value" << argValue;*/
         }
     }
 
@@ -293,7 +293,7 @@
 //     kDebug()<< "	" << "autostart" << autostart;
 //     kDebug()<< "	" << "repeat" << repeat;
 //     kDebug()<< "	" << "ifmulti" << actionType;
-     kDebug()<< "	" << "serviceName" << serviceName;
+//     kDebug()<< "	" << "serviceName" << serviceName;
 //     kDebug()<< "	" << "ifmulti" << nodeName;
 //     kDebug()<< "	" << "ifmulti" << function.name();
 //     kDebug()<< "    " << "args" << function.args().count();


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

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