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

List:       kde-commits
Subject:    extragear/plasma/applets/fuzzy-clock
From:       Davide Bettio <davbet () aliceposta ! it>
Date:       2008-04-28 19:29:32
Message-ID: 1209410972.930938.26856.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 802192 by bettio:

showConfigurationInterface() -> createConfigurationInterface()


 M  +8 -14     fuzzyClock.cpp  
 M  +1 -2      fuzzyClock.h  


--- trunk/extragear/plasma/applets/fuzzy-clock/fuzzyClock.cpp #802191:802192
@@ -33,7 +33,7 @@
 #include <KDebug>
 #include <KLocale>
 #include <KSharedConfig>
-#include <KDialog>
+#include <KConfigDialog>
 
 #include <KSystemTimeZones>
 
@@ -49,7 +49,6 @@
       m_showYear(false),
       m_showDay(false),
       m_showTimezone(false),
-      m_dialog(0),
       m_calendar(0),
       m_layout(0),
       m_oldContentSize(QSizeF (0,0))
@@ -218,18 +217,14 @@
     }
 }
 
-void Clock::showConfigurationInterface()
+void Clock::createConfigurationInterface(KConfigDialog *parent)
 {
-    if (m_dialog == 0) {
-        m_dialog = new KDialog;
-        m_dialog->setCaption( i18n("Configure Fuzzy-Clock") );
-        QWidget *widget = new QWidget;
-        ui.setupUi(widget);
-        m_dialog->setMainWidget(widget);
-        m_dialog->setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply );
-        connect( m_dialog, SIGNAL(applyClicked()), this, SLOT(configAccepted()) );
-        connect( m_dialog, SIGNAL(okClicked()), this, SLOT(configAccepted()) );
-    }
+    QWidget *widget = new QWidget();
+    ui.setupUi(widget);
+    parent->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
+    connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
+    connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
+    parent->addPage(widget, parent->windowTitle(), icon());
 
     ui.useLocalTimeZone->setChecked( m_useLocalTimezone );
     //FIXME: There are several bugs in KTimeZones. 1. Even though the correct zone \
is selected debug-output states "no such zon: 'nameofZone'" @@ -251,7 +246,6 @@
 
      //Set focus to this widget, oxygen's colour for selected items in a non-focused \
widgets are not readable.  ui.timeZones->setFocus( Qt::OtherFocusReason );
-    m_dialog->show();
 }
 
 void Clock::configAccepted()
--- trunk/extragear/plasma/applets/fuzzy-clock/fuzzyClock.h #802191:802192
@@ -50,7 +50,6 @@
 
     public slots:
         void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
-        void showConfigurationInterface();
 
     protected slots:
 //         void acceptedTimeStringState(bool);
@@ -59,6 +58,7 @@
 
     protected:
         void constraintsEvent(Plasma::Constraints constraints);
+        void createConfigurationInterface(KConfigDialog *parent);
 
     private:
         void calculateTimeString();
@@ -106,7 +106,6 @@
         bool m_showDay;
         QTime m_time;
         QDate m_date;
-        KDialog *m_dialog; //should we move this into another class?
         Plasma::Dialog *m_calendar;
         KLocale *m_locale;
         QVBoxLayout *m_layout;


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

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