[kmobiletools] KDE/kdepim/kmobiletools/kmobiletools/engines

Marco Gulino marco at kmobiletools.org
Sat Jun 2 02:22:07 CEST 2007


SVN commit 670557 by gulino:

Adding the right strings to the devices found page.
some fixes in the testphonedevice job.
First implementations on the devices found page (at engine).
Showing the current device in scanprogresspage.


 M  +1 -0      at_engine/testphonedevice.cpp  
 M  +30 -0     at_engine/wizard/at_devicesfoundpage.cpp  
 M  +2 -0      at_engine/wizard/at_devicesfoundpage.h  
 M  +7 -0      at_engine/wizard/at_scanprogresspage.cpp  
 M  +1 -1      at_engine/wizard/at_scanprogresspage.h  
 M  +2 -2      libkmobiletoolsengineui/devicesfoundPage.ui  


--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/testphonedevice.cpp #670556:670557
@@ -40,6 +40,7 @@
     if(! QFile::exists(deviceName)) { return; }
     if(!p_device->open(this)) return;
     enginedata=new KMobileTools::EngineData(0);
+    enginedata->setProperty("devicePath", path() );
     QString buffer;
     const int probeTimeout=600;
     buffer=p_device->sendATCommand(this, "AT+CGSN\r", probeTimeout);
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/wizard/at_devicesfoundpage.cpp #670556:670557
@@ -21,6 +21,10 @@
    Boston, MA 02110-1301, USA.
  ***************************************************************************/
 #include "at_devicesfoundpage.h"
+#include "at_scanprogresspage.h"
+#include <QListWidget>
+#include <libkmobiletools/enginedata.h>
+#include <kdebug.h>
 
 AT_DevicesFoundPage::AT_DevicesFoundPage(QWidget *parent)
  : DevicesFoundPage(parent)
@@ -34,3 +38,29 @@
 
 #include "at_devicesfoundpage.moc"
 
+
+
+/*!
+    \fn AT_DevicesFoundPage::cleanupPage()
+ */
+void AT_DevicesFoundPage::cleanupPage()
+{
+    phonesListWidget()->clear();
+}
+
+
+/*!
+    \fn AT_DevicesFoundPage::initializePage()
+ */
+void AT_DevicesFoundPage::initializePage()
+{
+    kDebug() << "AT_DevicesFoundPage::initializePage()\n";
+    AT_ScanProgressPage *scanpage=(AT_ScanProgressPage *) wizard()->page(wizard()->property("scanprogress_id").toInt() );
+    kDebug() << "DevicesFound count: " << scanpage->foundDevices().count() << endl;
+    QListIterator<KMobileTools::EngineData*> it(scanpage->foundDevices());
+    KMobileTools::EngineData* curitem;
+    while(it.hasNext()) {
+        curitem=it.next();
+        new QListWidgetItem( curitem->property("devicePath").toString(), phonesListWidget() );
+    }
+}
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/wizard/at_devicesfoundpage.h #670556:670557
@@ -35,6 +35,8 @@
     AT_DevicesFoundPage(QWidget *parent = 0);
 
     ~AT_DevicesFoundPage();
+    void cleanupPage();
+    void initializePage();
 
 };
 
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/wizard/at_scanprogresspage.cpp #670556:670557
@@ -26,6 +26,7 @@
 #include <libkmobiletools/engineslist.h>
 #include <libkmobiletools/enginedata.h>
 #include "atengineconfig.h"
+#include <klocalizedstring.h>
 
 AT_ScanProgressPage::AT_ScanProgressPage(QWidget *parent)
  : ScanProgressPage(parent), totaljobs(0), donejobs(0)
@@ -70,6 +71,7 @@
  */
 void AT_ScanProgressPage::initializePage() {
     kDebug() << "AT_ScanProgressPage::initializePage()\n";
+    wizard()->setProperty("scanprogress_id", wizard()->currentId());
     engine=(AT_Engine*) KMobileTools::EnginesList::instance()->wizardEngine();
     connect(engine, SIGNAL(foundDeviceData(FindDeviceDataJob*)), this, SLOT(deviceProbed(FindDeviceDataJob*)) );
     cfg=(ATDevicesConfig*) DEVCFG(wizard()->objectName() );
@@ -87,6 +89,11 @@
     donejobs++;
     setProgress( (donejobs*100)/totaljobs);
     emit completeChanged();
+    if(donejobs && (donejobs==totaljobs) ) {
+        setStatusString( i18nc("Wizard - probe finished", "All devices were analyzed.") );
+        wizard()->next();
+    }
+        else setStatusString( i18nc("Wizard - probed device..", "%1 done.", job->path() ) );
 }
 
 
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/wizard/at_scanprogresspage.h #670556:670557
@@ -41,7 +41,7 @@
     void cleanupPage();
     void initializePage();
     void startScan();
-    QList<KMobileTools::EngineData*> foundDevices();
+    QList<KMobileTools::EngineData*> foundDevices() { return l_devices ; }
 
 public slots:
     void deviceProbed(FindDeviceDataJob*);
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/libkmobiletoolsengineui/devicesfoundPage.ui #670556:670557
@@ -16,7 +16,7 @@
    <item>
     <widget class="QLabel" name="label" >
      <property name="text" >
-      <string>TextLabel</string>
+      <string>KMobileTools successfully detected the following devices.&lt;br>Please select the one you want to configure.</string>
      </property>
      <property name="wordWrap" >
       <bool>true</bool>
@@ -33,7 +33,7 @@
    <item>
     <widget class="QGroupBox" name="groupBox" >
      <property name="title" >
-      <string>GroupBox</string>
+      <string>Details</string>
      </property>
     </widget>
    </item>


More information about the kmobiletools mailing list