Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 9e8230873ca69f393e5304ceb1afeac2 > files > 9

kdebase4-workspace-4.2.4-0.6mdv2009.0.src.rpm

--- libs/plasmaclock/clockapplet.cpp	2009-01-21 08:24:44.000000000 -0200
+++ libs/plasmaclock/clockapplet.cpp.new	2009-02-20 14:44:37.000000000 -0300
@@ -31,6 +31,7 @@
 #include <QtGui/QGraphicsView>
 #include <QtCore/QDate>
 #include <QtCore/QTimer>
+#include <QtCore/QProcess>
 
 #include <KColorScheme>
 #include <KConfigDialog>
@@ -359,8 +360,24 @@
 
     extender();
     QTimer::singleShot(0, this, SLOT(createCalendar()));
+
+    drakClockAction = new QAction(KIcon("configure"), i18n("Manage date and time"), this);
+    m_Actions.append( drakClockAction );
+    connect(drakClockAction, SIGNAL(triggered(bool)), this, SLOT(callDrakClock()));
+}
+
+void ClockApplet::callDrakClock()
+{
+    QProcess *proc = new QProcess(this);
+    proc->start("drakclock");
 }
 
+QList<QAction*> ClockApplet::contextualActions()
+{
+    return m_Actions;
+}
+
+
 void ClockApplet::popupEvent(bool show)
 {
     if (!show) {
--- libs/plasmaclock/clockapplet.h	2009-01-21 08:24:44.000000000 -0200
+++ libs/plasmaclock/clockapplet.h.new	2009-02-20 14:44:49.000000000 -0300
@@ -57,6 +57,8 @@
         static QString localTimezone();
         static QString localTimezoneUntranslated();
 
+        virtual QList<QAction*> contextualActions();
+
     public Q_SLOTS:
         void toolTipAboutToShow();
         void toolTipHidden();
@@ -76,11 +78,15 @@
         void setCurrentTimezone(const QString &tz);
         void configAccepted();
         void updateClockDefaultsTo();
+        void callDrakClock();
 
     private:
         class Private;
         Private * const d;
 
+        QList<QAction*> m_Actions;
+        QAction *drakClockAction;
+
         Q_PRIVATE_SLOT(d, void createCalendar())
 };