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

List:       kde-panel-devel
Subject:    Re: roadmap of the chime feature in the analog clock
From:       sunny sharma <sunnysharmagts () gmail ! com>
Date:       2011-04-03 15:20:54
Message-ID: AANLkTi=tyasT=FL_tyaTvWL=KFpbBuyndzyCxss0oReR () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello everybody,

After i had uploaded my first review to the reviewboard
http://reviewboard.kde.org/r/6108/ , I am
having some trouble in uploading the second review to the reviewboard since
the first .diff file was
from svn while this one is from git.

Here are some points have been  implemented :-

1. I have added 3 radio buttons namely none, chime and speak.
2. The present textField which is for the SPEAK operation will be disabled
if you choose none or chime and
    gets enabled if you select speak button.

The part that had been implemented earlier in the clock.cpp in (*
kde-workspace/plasma/generic/applet/*)
has been removed and will be implemented in the clockapplet part.

Please provide me with the feedback.

thanks
sunny_slls

[Attachment #5 (text/html)]

Hello everybody,<br><br>After i had uploaded my first review to the reviewboard <a \
href="http://reviewboard.kde.org/r/6108/">http://reviewboard.kde.org/r/6108/</a> , I \
am<br>having some trouble in uploading the second review to the reviewboard since the \
first .diff file was<br> from svn while this one is from git.<br><br>Here are some \
points have been  implemented :-<br><br>1. I have added 3 radio buttons namely none, \
chime and speak.<br>2. The present textField which is for the SPEAK operation will be \
disabled if you choose none or chime and<br>  gets enabled if you select speak \
button.<br><br>The part that had been implemented earlier in the clock.cpp in \
(<b>kde-workspace/plasma/generic/applet/</b>) <br>has been removed and will be \
implemented in the clockapplet part.<br> <br>Please provide me with the \
feedback.<br><br>thanks<br>sunny_slls<br>

--90e6ba6e8c0485825d04a0050555--


["c.diff" (text/x-patch)]

diff --git a/libs/plasmaclock/CMakeLists.txt b/libs/plasmaclock/CMakeLists.txt
index 667df3c..0b36898 100644
--- a/libs/plasmaclock/CMakeLists.txt
+++ b/libs/plasmaclock/CMakeLists.txt
@@ -1,3 +1,17 @@
+# Project Needs a name ofcourse
+project(plasma-tutorial1)
+
+# Find the required Libaries
+find_package(KDE4 REQUIRED)
+include(KDE4Defaults)
+
+add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+include_directories(
+   ${CMAKE_SOURCE_DIR}
+   ${CMAKE_BINARY_DIR}
+   ${KDE4_INCLUDES}
+   )
+
 macro_optional_find_package(KdepimLibs 4.5.60)
 macro_log_feature(KDEPIMLIBS_FOUND "kdepimlibs" "KDE PIM libraries" \
"http://www.kde.org" FALSE "" "Needed for building plasma calendar holidays")  \
                macro_bool_to_01(KDEPIMLIBS_FOUND HAVE_KDEPIMLIBS)
diff --git a/libs/plasmaclock/clockapplet.cpp b/libs/plasmaclock/clockapplet.cpp
index b806792..dd62756 100644
--- a/libs/plasmaclock/clockapplet.cpp
+++ b/libs/plasmaclock/clockapplet.cpp
@@ -24,6 +24,7 @@
 
 #include <math.h>
 
+#include<QRadioButton>
 #include <QtGui/QPainter>
 #include <QtGui/QStyleOptionGraphicsItem>
 #include <QtGui/QSpinBox>
@@ -117,7 +118,7 @@ public:
     }
 
     void createCalendarExtender()
-    {
+    {   
         if (!q->extender()->hasItem("calendar")) {
             Plasma::ExtenderItem *eItem = new Plasma::ExtenderItem(q->extender());
             eItem->setName("calendar");
@@ -178,8 +179,17 @@ ClockApplet::~ClockApplet()
     delete d;
 }
 
+void ClockApplet::none(){
+    return;
+}
+void ClockApplet::chimeTime()
+{
+    kDebug() << "I am inside the chimeTime() function";
+}
+
 void ClockApplet::speakTime(const QTime &time)
 {
+    kDebug() << "I am inside the speakTime() function";
     if (!d->announceInterval) {
         return;
     }
@@ -249,7 +259,7 @@ void ClockApplet::toolTipAboutToShow()
 }
 
 void ClockApplet::toolTipHidden()
-{
+{	
     Plasma::ToolTipManager::self()->clearContent(this);
 }
 
@@ -328,13 +338,13 @@ void ClockApplet::updateClockApplet(const \
Plasma::DataEngine::Data &data)  
     const QTime t = d->lastTimeSeen;
     d->lastTimeSeen = data["Time"].toTime();
-    if (d->lastTimeSeen.minute() != t.minute() || d->lastTimeSeen.hour() != \
t.hour()) { +    if (d->lastTimeSeen.minute() != t.minute() || d->lastTimeSeen.hour() \
!= t.hour()){  speakTime(d->lastTimeSeen);
     }
 }
 
 QTime ClockApplet::lastTimeSeen() const
-{
+{  
     return d->lastTimeSeen;
 }
 
@@ -356,6 +366,9 @@ void ClockApplet::createConfigurationInterface(KConfigDialog \
*parent)  d->generalUi.setupUi(generalWidget);
     parent->addPage(generalWidget, i18nc("General configuration page", "General"), \
Applet::icon());  d->generalUi.interval->setValue(d->announceInterval);
+    //d->generalUi.none->setChecked(s_none);
+    //d->generalUi.none->setChecked(s_chime);
+    //d->generalUi.none->setChecked(s_speak); 
 
     d->calendarWidget->createConfigurationInterface(parent);
 
@@ -387,15 +400,30 @@ void \
ClockApplet::createClockConfigurationInterface(KConfigDialog *parent)  
 void ClockApplet::clockConfigChanged()
 {
+    s_none = d->generalUi.none->isChecked();
+    s_chime = d->generalUi.chime->isChecked();
+    s_speak = d->generalUi.speak->isChecked();
 
+    if(s_none)
+       none();
+
+    else if(s_speak)
+    {
+        updateClockApplet();
+    }
+
+    else if(s_chime)
+    {
+        chimeTime();          
+    }
 }
 
 void ClockApplet::configChanged()
 {
-    if (isUserConfiguring()) {
+    if (isUserConfiguring()){
         configAccepted();
     }
-
+    	
     KConfigGroup cg = config();
     d->selectedTimezones = cg.readEntry("timeZones", QStringList());
     d->timezone = cg.readEntry("timezone", d->timezone);
@@ -446,6 +474,18 @@ void ClockApplet::configAccepted()
     d->calendarWidget->configAccepted(cg);
 
     cg.writeEntry("announceInterval", d->generalUi.interval->value());
+    s_none = d->generalUi.none->isChecked();
+    s_chime = d->generalUi.chime->isChecked();
+    s_speak = d->generalUi.speak->isChecked();
+    if(s_none){
+        return;
+    }
+    else if(s_chime){
+        chimeTime();
+    }           
+    else if(s_speak){
+    
+    }	
 
     clockConfigAccepted();
 
@@ -577,7 +617,7 @@ void ClockApplet::initExtenderItem(Plasma::ExtenderItem *item)
     }
 }
 
-void ClockApplet::init()
+void ClockApplet::init()    //The second function to be called
 {
     Plasma::ToolTipManager::self()->registerWidget(this);
 
diff --git a/libs/plasmaclock/clockapplet.h b/libs/plasmaclock/clockapplet.h
index b75f286..1d31b77 100644
--- a/libs/plasmaclock/clockapplet.h
+++ b/libs/plasmaclock/clockapplet.h
@@ -24,6 +24,7 @@
 
 #include <QtCore/QTime>
 #include <QtCore/QDate>
+#include <QRadioButton>
 
 #include <KDE/Plasma/DataEngine>
 #include <KDE/Plasma/Dialog>
@@ -87,7 +88,9 @@ class PLASMACLOCK_EXPORT ClockApplet : public Plasma::PopupApplet
         void setCurrentTimezone(const QString &tz);
         void configAccepted();
         void updateClockDefaultsTo();
+        void none();
         void speakTime(const QTime &);
+        void chimeTime();
         void launchTimeControlPanel();
 
     private Q_SLOTS:
@@ -98,6 +101,8 @@ class PLASMACLOCK_EXPORT ClockApplet : public Plasma::PopupApplet
         class Private;
         Private * const d;
 
+	bool s_none;
+	bool s_chime, s_speak;
         Q_PRIVATE_SLOT(d, void createCalendarExtender())
         Q_PRIVATE_SLOT(d, void createToday())
 };
diff --git a/libs/plasmaclock/generalConfig.ui b/libs/plasmaclock/generalConfig.ui
index aae25c0..4622861 100644
--- a/libs/plasmaclock/generalConfig.ui
+++ b/libs/plasmaclock/generalConfig.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>270</width>
-    <height>62</height>
+    <width>349</width>
+    <height>131</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
@@ -42,6 +42,9 @@
    </item>
    <item row="1" column="1">
     <widget class="QLabel" name="label_5">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
      <property name="text">
       <string>Speak time:</string>
      </property>
@@ -86,7 +89,14 @@
      </item>
     </layout>
    </item>
-   <item row="2" column="2">
+   <item row="2" column="1">
+    <widget class="QRadioButton" name="none">
+     <property name="text">
+      <string>None</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="2">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -99,6 +109,23 @@
      </property>
     </spacer>
    </item>
+   <item row="3" column="1">
+    <widget class="QRadioButton" name="chime">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>Chime</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QRadioButton" name="speak">
+     <property name="text">
+      <string>Speak</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
@@ -109,5 +136,54 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>speak</sender>
+   <signal>clicked()</signal>
+   <receiver>interval</receiver>
+   <slot>show()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>54</x>
+     <y>112</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>158</x>
+     <y>35</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>chime</sender>
+   <signal>clicked()</signal>
+   <receiver>interval</receiver>
+   <slot>hide()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>54</x>
+     <y>87</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>158</x>
+     <y>35</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>none</sender>
+   <signal>clicked()</signal>
+   <receiver>interval</receiver>
+   <slot>hide()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>54</x>
+     <y>62</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>158</x>
+     <y>35</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>
diff --git a/plasma/generic/applets/analog-clock/clock.cpp \
b/plasma/generic/applets/analog-clock/clock.cpp index 68d0725..3423d7a 100644
--- a/plasma/generic/applets/analog-clock/clock.cpp
+++ b/plasma/generic/applets/analog-clock/clock.cpp
@@ -183,7 +183,6 @@ void Clock::createClockConfigurationInterface(KConfigDialog \
*parent)  QWidget *widget = new QWidget();
     ui.setupUi(widget);
     parent->addPage(widget, i18n("Appearance"), "view-media-visualization");
-
     ui.showSecondHandCheckBox->setChecked(m_showSecondHand);
     ui.showTimezoneStringCheckBox->setChecked(m_showTimezoneString);
 }
@@ -195,7 +194,7 @@ void Clock::clockConfigAccepted()
     m_showingTimezone = m_showTimezoneString || shouldDisplayTimezone();
     m_showSecondHand = ui.showSecondHandCheckBox->isChecked();
 
-    if (m_showSecondHand) {
+    if (m_showSecondHand){
         //We don't need to cache the applet if it update every seconds
         setCacheMode(QGraphicsItem::NoCache);
     } else {



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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