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

List:       kde-commits
Subject:    branches/kmobiletools/kmobiletools-0.5
From:       Marco Gulino <marco () kmobiletools ! org>
Date:       2007-05-30 22:38:48
Message-ID: 1180564728.954690.26531.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 669978 by gulino:

Adding a clear button to the phone emulator.
Adding a "configure notifications" menu entry.
GUI: adding a new notification event for new incoming SMS.
fixing threadweaver to show running jobs number.


 M  +9 -0      kmobiletools/deviceparts/kmobiletools_devicepart.cpp  
 M  +1 -0      kmobiletools/deviceparts/kmobiletools_devicepart.h  
 M  +2 -0      kmobiletools/libkmobiletools/weaver.cpp  
 M  +1 -0      kmobiletools/libkmobiletools/weaver.h  
 M  +8 -0      kmobiletools/mainpart/eventsrc  
 M  +11 -0     kmobiletools/mainpart/kmobiletools_mainpart.cpp  
 M  +1 -0      kmobiletools/mainpart/kmobiletools_mainpart.h  
 M  +1 -0      kmobiletools/mainpart/kmobiletools_mainpart.rc  
 M  +4 -1      tests/kserialdeviceemulator/kserialdeviceemulatorwidget.cpp  
 M  +1 -0      tests/kserialdeviceemulator/kserialdeviceemulatorwidget.h  
 M  +18 -21    tests/kserialdeviceemulator/kserialdeviceemulatorwidgetbase.ui  


--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/deviceparts/kmobiletools_devicepart.cpp \
#669977:669978 @@ -140,6 +140,7 @@
     statusBarExtension=0;
     memslotSelected=0;
     smsTypeSelected=0;
+    smsnotifynum=0;
     networkLabel=0;
     batteryProgress=0;
     devNameLabel=0;
@@ -481,6 +482,13 @@
 void kmobiletoolsDevicePart::jobDone(kmobiletoolsJob::JobType jobtype)
 {
     if(jobtype==kmobiletoolsJob::fetchAddressBook) emit phonebookUpdated();
+    int newsmscnt=engine->smsList()->count(SMS::Unread, SMS::SIM | SMS::Phone );
+
+    if(newsmscnt && engine->ThreadWeaver()->activeJobs()==0 && \
newsmscnt!=smsnotifynum) { +        smsnotifynum=newsmscnt;
+        QString eventString(i18n("<qt>%1 New Messages.<br>Mobile Phone: \
%2</qt>").arg(newsmscnt).arg(DeviceConfigInstance(name() )->devicename() ) ); +       \
KNotifyClient::event( \
KMobileTools::KMobiletoolsHelper::instance()->systray()->winId(), "kmobiletools_sms", \
eventString ); +    }
 }
 
 
@@ -914,6 +922,7 @@
 {
     if(!engine) return;
     engine->smsList()->calcSMSNumber();
+
     QListViewItemIterator it( m_widget->SMSFolderView );
     SMSFolderListViewItem *tempItem;
     while ( it.current() ) {
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/deviceparts/kmobiletools_devicepart.h \
#669977:669978 @@ -162,6 +162,7 @@
     KParts::StatusBarExtension *statusBarExtension;
     QPtrList<KAction> l_actionList;
     int memslotSelected, smsTypeSelected;
+    int smsnotifynum;
     KParts::ReadOnlyPart *korgpart;
     kmobiletoolsMainPart *p_mainPart;
 #ifdef HAVE_KCAL
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/libkmobiletools/weaver.cpp \
#669977:669978 @@ -519,6 +519,8 @@
         return  m_assignments.count()==0;
     }
 
+    int Weaver::activeJobs() { return m_active; }
+
     Job* Weaver::applyForWork(Thread *th, Job* previous)
     {
         Job *next = 0;
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/libkmobiletools/weaver.h \
#669977:669978 @@ -454,6 +454,7 @@
 	    inventory need to lock the weaver's mutex to synchronize
 	    the job management. */
 	void lock ();
+    int activeJobs();
 	/** Unlock. See lock(). */
 	void unlock ();
 	/** Post an event that is handled by this object, but in the main
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/eventsrc \
#669977:669978 @@ -2,6 +2,14 @@
  IconName=kmobiletools
  Comment=KMobileTools
 
+[kmobiletools_sms]
+Name=New SMS Messages
+Comment=New incoming SMS were found
+Name[it]=Nuovi Messaggi SMS
+Comment[it]=Trovati nuovi SMS in arrivo
+default_sound=KDE_Beep_Double.ogg
+default_presentation=17
+
 [kmobiletools_ring]
 Name=Incoming Call
 Name[bg]=Входящо повикване
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/kmobiletools_mainpart.cpp \
#669977:669978 @@ -46,6 +46,7 @@
 #include <kinputdialog.h>
 #include <kplugininfo.h>
 #include <qsqlpropertymap.h>
+#include <knotifydialog.h>
 
 #include "kmobiletools_cfg.h"
 #include "kmobiletools_devices.h"
@@ -120,6 +121,7 @@
     KStdAction::prior(this, SLOT(prevPart() ), actionCollection(),"prev");
     KStdAction::preferences(this, SLOT(showPreference()), actionCollection());
     KStdAction::quit( this , SLOT(slotQuit() ), actionCollection() );
+    KStdAction::configureNotifications(this, SLOT(slotConfNotifications()), \
actionCollection(), "cfgnotify");  
 
 //     partManager=new KParts::PartManager(m_widget, this);
@@ -618,3 +620,12 @@
         curPart->updateAllContacts();
     }
 }
+
+
+/*!
+    \fn kmobiletoolsMainPart::slotConfNotifications()
+ */
+void kmobiletoolsMainPart::slotConfNotifications()
+{
+    KNotifyDialog::configure(m_widget, 0);
+}
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/kmobiletools_mainpart.h \
#669977:669978 @@ -108,6 +108,7 @@
     void newSMS();
     QStringList loadedEngines(bool friendly=false);
     void phonebookUpdated();
+    void slotConfNotifications();
 
     private:
         QWidgetStack *m_widget;
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/kmobiletools_mainpart.rc \
#669977:669978 @@ -12,6 +12,7 @@
         <Menu name="settings"><text>&amp;Settings</text>
             <Separator/>
             <Action name="device_manager"/>
+            <Action name="cfgnotify"/>
             <Merge/>
         </Menu>
     </MenuBar>
--- branches/kmobiletools/kmobiletools-0.5/tests/kserialdeviceemulator/kserialdeviceemulatorwidget.cpp \
#669977:669978 @@ -43,6 +43,7 @@
     connect(eventBox, SIGNAL(returnPressed(const QString &)), \
                SLOT(slotSendEvent(const QString &)));
     connect(eventBox, SIGNAL(activated(int)), this, SLOT(eventSelected(int)));
     connect(b_event, SIGNAL(clicked()), this, SLOT(slotSendEvent()));
+    connect(b_clearlog, SIGNAL(clicked()), this, SLOT(clearLog() ));
     b_remove->setEnabled(false);
 }
 
@@ -53,8 +54,10 @@
 
 #include "kserialdeviceemulatorwidget.moc"
 
+void KSerialDeviceEmulatorWidget::clearLog() {
+    tb_rawlog->clear();
+}
 
-
 /*!
     \fn KSerialDeviceEmulatorWidget::addToLog(const QString &text, const QString \
                &color)
  */
--- branches/kmobiletools/kmobiletools-0.5/tests/kserialdeviceemulator/kserialdeviceemulatorwidget.h \
#669977:669978 @@ -54,6 +54,7 @@
     void resetEvent();
     void slotSendEvent();
     void eventSelected(int);
+    void clearLog();
 protected:
     /*$PROTECTED_FUNCTIONS$*/
 
--- branches/kmobiletools/kmobiletools-0.5/tests/kserialdeviceemulator/kserialdeviceemulatorwidgetbase.ui \
#669977:669978 @@ -68,13 +68,6 @@
         </widget>
         <widget class="QSplitter" row="1" column="0">
             <property name="name">
-                <cstring>splitter5</cstring>
-            </property>
-            <property name="orientation">
-                <enum>Vertical</enum>
-            </property>
-            <widget class="QSplitter">
-                <property name="name">
                     <cstring>splitter3</cstring>
                 </property>
                 <property name="orientation">
@@ -194,17 +187,14 @@
                     </grid>
                 </widget>
             </widget>
-            <widget class="QLayoutWidget">
-                <property name="name">
-                    <cstring>layout5</cstring>
-                </property>
-                <vbox>
+        <widget class="QTextBrowser" row="3" column="0">
                     <property name="name">
-                        <cstring>unnamed</cstring>
+                <cstring>tb_rawlog</cstring>
                     </property>
-                    <widget class="QLayoutWidget">
+        </widget>
+        <widget class="QLayoutWidget" row="2" column="0">
                         <property name="name">
-                            <cstring>layout4</cstring>
+                <cstring>layout5</cstring>
                         </property>
                         <hbox>
                             <property name="name">
@@ -252,16 +242,22 @@
                                 <property name="text">
                                     <string>&amp;Send Event</string>
                                 </property>
+                    <property name="accel">
+                        <string>Alt+S</string>
+                    </property>
                             </widget>
-                        </hbox>
-                    </widget>
-                    <widget class="QTextBrowser">
+                <widget class="KPushButton">
                         <property name="name">
-                            <cstring>tb_rawlog</cstring>
+                        <cstring>b_clearlog</cstring>
+                    </property>
+                    <property name="text">
+                        <string>&amp;Clear Log</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+C</string>
                         </property>
                     </widget>
-                </vbox>
-            </widget>
+            </hbox>
         </widget>
     </grid>
 </widget>
@@ -280,5 +276,6 @@
     <includehint>kcombobox.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kpushbutton.h</includehint>
+    <includehint>kpushbutton.h</includehint>
 </includehints>
 </UI>


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

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