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

List:       kde-commits
Subject:    playground/base/plasma/applets/plasmaboard
From:       Björn Ruberg <bjoern () ruberg-wegener ! de>
Date:       2009-08-02 15:48:39
Message-ID: 1249228119.089632.18068.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005926 by ruberg:

Fixed bug concerning the new tooltip
Beautified code
Added comments



 M  +0 -5      AlphaNumKey.cpp  
 M  +12 -3     AlphaNumKey.h  
 M  +2 -5      PanelIcon.cpp  
 M  +1 -2      PanelIcon.h  
 M  +2 -6      widget.cpp  
 M  +22 -3     widget.h  


--- trunk/playground/base/plasma/applets/plasmaboard/AlphaNumKey.cpp #1005925:1005926
@@ -21,7 +21,6 @@
 //#include "AlphaNumKey.h"
 #include <kpushbutton.h>
 #include "AlphaNumKey.h"
-#include "widget.h"
 
 
 AlphaNumKey::AlphaNumKey(PlasmaboardWidget *parent):
@@ -39,10 +38,6 @@
 	setLabel(0);
 }
 
-void AlphaNumKey::setText(const QString &text){
-        BoardKey::setText(text);
-}
-
 void AlphaNumKey::setLabel(int level){
 	setText(QChar(Helpers::mapToUnicode(Helpers::keycodeToKeysym(getKeycode(),level))));
 }
--- trunk/playground/base/plasma/applets/plasmaboard/AlphaNumKey.h #1005925:1005926
@@ -36,18 +36,27 @@
 	virtual ~AlphaNumKey();
 
 	void switchKey(bool isLevel2, bool isAlternative, bool isLocked);
+        /*
+          defines the keycode this button must send
+          */
 	void setKeycode(unsigned int keysym);
-        void setText(const QString &text);
+        /*
+          * Sets button text regarding the key level
+          */
 	void setLabel(int level);
 
 public Q_SLOTS:
+        /*
+          * called when button is pressed
+          */
 	virtual void sendKeycodePress();
+        /*
+          * called when button is released
+          */
 	virtual void sendKeycodeRelease();
 
 signals:
         void keySend ( QString text );
-
-
 };
 
 #endif /* ALPHANUMKEY_H_ */
--- trunk/playground/base/plasma/applets/plasmaboard/PanelIcon.cpp #1005925:1005926
@@ -38,14 +38,11 @@
 
 
 PanelIcon::~PanelIcon() {
-
+        delete contextExtended;
+        delete contextBasic;
 }
 
-void PanelIcon::init(){
 
-}
-
-
 QGraphicsWidget *PanelIcon::graphicsWidget()
 {
     if (!m_plasmaboard) {
--- trunk/playground/base/plasma/applets/plasmaboard/PanelIcon.h #1005925:1005926
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org>          *
+ *   Copyright (C) 2009 by Björn Ruberg <bjoern@ruberg-wegener.de          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -30,7 +30,6 @@
 public:
 	PanelIcon(QObject *parent, const QVariantList &args);
 	virtual ~PanelIcon();
-	void init();
 	QGraphicsWidget *graphicsWidget();
 
 	/*
--- trunk/playground/base/plasma/applets/plasmaboard/widget.cpp #1005925:1005926
@@ -32,11 +32,6 @@
 #include "ArrowLeftKey.h"
 #include "ArrowRightKey.h"
 #include <QPainter>
-#include <QGraphicsScene>
-#include <QGraphicsItem>
-#include <QGraphicsWidget>
-#include <QGraphicsLayoutItem>
-#include <QGraphicsLayout>
 #include <QGraphicsGridLayout>
 #include <KConfigGroup>
 #include <plasma/tooltipmanager.h>
@@ -91,7 +86,7 @@
 
 
 PlasmaboardWidget::~PlasmaboardWidget(){
-
+    delete tooltipTimer;
 }
 
 void PlasmaboardWidget::resetKeyboard(){
@@ -530,5 +525,6 @@
 
 void PlasmaboardWidget::clearTooltip(){
     Plasma::ToolTipManager::self()->hide(this);
+    tooltip.setMainText("");
     Plasma::ToolTipManager::self()->clearContent(this);
 }
--- trunk/playground/base/plasma/applets/plasmaboard/widget.h #1005925:1005926
@@ -24,7 +24,6 @@
 
 #include "BoardKey.h"
 #include <plasma/containment.h>
-#include <plasma/corona.h>
 #include <plasma/tooltipcontent.h>
 #include <QTimer>
 #include "Helpers.h"
@@ -32,13 +31,14 @@
 #define XK_TECHNICAL
 #define XK_PUBLISHING
 #define XK_LATIN1
+
 #include <X11/keysym.h>
 
 class AlphaNumKey;
 class FuncKey;
 class QGraphicsGridLayout;
 
-// Define our plasma Applet
+
 class PlasmaboardWidget : public Plasma::Containment
 {
     Q_OBJECT
@@ -75,11 +75,30 @@
 
 
     public Q_SLOTS:
+        /*
+          * Switch key level between lower and upper
+          */
         void switchLevel();
+        /*
+          * Switch between the alternative lvel
+          */
         void switchAlternative();
+        /*
+          * Switch caps key on and off
+          */
         void switchCaps();
+        /*
+          Unsets all pressed keys despite of caps
+          */
         void clear();
+
+        /*
+          Sets tooltip to a new text
+          */
         void setTooltip(QString text);
+        /*
+          * Removes tooltip
+          */
         void clearTooltip();
 
 	private:
@@ -91,7 +110,7 @@
                 bool isLocked; // is lock activddated
                 bool basicKeys; // are basic keys displayed
                 bool extendedKeys; // are extended keys displayed
-                QGraphicsGridLayout *m_layout;
+                QGraphicsGridLayout *m_layout; // layout the keys are positioned in
                 Plasma::ToolTipContent tooltip;
                 QTimer *tooltipTimer;
 };
[prev in list] [next in list] [prev in thread] [next in thread] 

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