201017
authorhgs
Sat, 01 May 2010 10:55:27 +0530
changeset 38 2d078e09a2f4
parent 37 1cab1a4490f8
child 43 88e14c3d4c4f
201017
deviceupdatesui/deviceupdates/deviceupdates.pro
deviceupdatesui/deviceupdates/inc/dmadvancedview.h
deviceupdatesui/deviceupdates/src/dmadvancedview.cpp
deviceupdatesui/deviceupdates/src/dmfotaview.cpp
deviceupdatesui/deviceupdates/src/serversettingsview.cpp
deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp
--- a/deviceupdatesui/deviceupdates/deviceupdates.pro	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/deviceupdates.pro	Sat May 01 10:55:27 2010 +0530
@@ -21,6 +21,7 @@
     :BLD_INF_RULES.prj_exports += "./rom/deviceupdates.iby CORE_APP_LAYER_IBY_EXPORT_PATH(deviceupdates.iby)"
     :BLD_INF_RULES.prj_exports += "./rom/deviceupdates_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(deviceupdates_resources.iby)"
     :BLD_INF_RULES.prj_exports += "./conf/101F6DE5.txt /epoc32/data/z/private/10202be9/101F6DE5.txt"    
+    :BLD_INF_RULES.prj_exports += "./conf/101F6DE5.txt /epoc32/winscw/c/private/10202be9/101F6DE5.txt"  
 TARGET.UID2 = 0x100039CE
 TARGET.UID3 = 0x101F6DE5
 TARGET.CAPABILITY = CAP_APPLICATION 
@@ -38,7 +39,8 @@
         -lsysversioninfo\
         -letel3rdparty\
 		-letelpckt\
-		-lcmmanager
+		-lcmmanager\
+		-lsisregistryclient
 	}
 TEMPLATE = app
 TARGET = deviceupdates
--- a/deviceupdatesui/deviceupdates/inc/dmadvancedview.h	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/inc/dmadvancedview.h	Sat May 01 10:55:27 2010 +0530
@@ -91,6 +91,9 @@
     void serversListGroupClicked(bool state);
     void reLayout(Qt::Orientation layoutType);
     void backButtonClicked();
+    void defaultMenuItemSelected();
+    void deleteMenuItemSelected();
+    void connectMenuItemSelected();
     
 private:        
     HbGroupBox *serversListGroup;
@@ -98,7 +101,6 @@
     HbListView* list;
     HbListView* otherdetailslist;
     HbLabel *label; 
-    HbMenu* csmenu;
     HbMenu* viewspecificmenu;
     HbAction* help;
     HbAction* exit;
@@ -126,6 +128,10 @@
     RTelServer iServer;
     RTelServer::TPhoneInfo info;	
 	RMobilePhone::TMobilePhoneNetworkSecurity idispSecurity;
+	int currentselecteditem;
+	//This item should not be deleted,it just refer an item and deletion
+	//will be taken care by List view
+	QStandardItem *modelItem;
 };
 
 #endif // DMADVANCEDVIEW_H
--- a/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp	Sat May 01 10:55:27 2010 +0530
@@ -15,7 +15,7 @@
 * Description:  Methods for DmAdvancedView.
 *
 */
-
+#include <hbnamespace.h>
 #include "dmadvancedview.h"
 #include "serversettingsview.h"
 
@@ -32,6 +32,7 @@
     currentview = 0;
     connectionRequested = false;    
     backbehaviorset = false;
+    currentselecteditem = -1;
     }
 
 DmAdvancedView::~DmAdvancedView()
@@ -46,61 +47,38 @@
 
 void DmAdvancedView::handleLongPress(HbAbstractViewItem* item , QPointF coOrdinates)
     {
-    if(connectionRequested)
+    if (connectionRequested)
         return;
-    int itemnum = 0;
-    if (item) 
+    if (item)
         {
-    QStandardItem *modelItem = model->itemFromIndex(item->modelIndex());
-    itemnum = modelItem->row();
-
+        modelItem = model->itemFromIndex(item->modelIndex());
+        currentselecteditem = modelItem->row();
 
-    csmenu = new HbMenu();
-    HbAction *defaultprofileAction = 0;
-    HbAction *deleteaction= 0;
-    HbAction *connectaction= 0;
-    if(!dminfo->Isdefaultprofile(itemnum))
-        {
-        defaultprofileAction = csmenu->addAction(hbTrId("txt_device_update_menu_set_as_default"));
-        }
-    if(!dminfo->Isprofilelocked(itemnum))
-        {
-        deleteaction = csmenu->addAction(hbTrId("txt_device_update_menu_delete"));
-        }
-    connectaction = csmenu->addAction(hbTrId("txt_device_update_menu_connect"));
-    HbAction *selectedAction = csmenu->exec(coOrdinates);
-    if(selectedAction)
-        {
-        if(selectedAction == defaultprofileAction )
+        HbMenu *csmenu = new HbMenu();
+        csmenu->setAttribute( Qt::WA_DeleteOnClose);
+        HbAction *defaultprofileAction = 0;
+        HbAction *deleteaction = 0;
+        HbAction *connectaction = 0;
+        if (!dminfo->Isdefaultprofile(currentselecteditem))
             {
-            dminfo->setDefaultProfile(itemnum);
-            updateEarlierdefaultProfileIcon();
-            modelItem->setIcon(defaultprofileicon);
-            currentdefaultprofile = itemnum;        
+            defaultprofileAction = csmenu->addAction(hbTrId(
+                    "txt_device_update_menu_set_as_default"));
+            connect(defaultprofileAction, SIGNAL(triggered()), this,
+                    SLOT(defaultMenuItemSelected()));
             }
-        else if (selectedAction == deleteaction )
+        if (!dminfo->Isprofilelocked(currentselecteditem))
             {
-            dminfo->DisableDbNotifications(true);
-            //check currentdefaultprofile is current item
-            if(itemnum == currentdefaultprofile) // deleting default profile
-                currentdefaultprofile = -1;
-            if(dminfo->DeleteProfile(itemnum) >=0 )
-                {
-                //Update the profile list
-                model->removeRow(itemnum);
-                }
-            dminfo->DisableDbNotifications(false);
+            deleteaction = csmenu->addAction(hbTrId(
+                    "txt_device_update_menu_delete"));
+            connect(deleteaction, SIGNAL(triggered()), this,
+                    SLOT(deleteMenuItemSelected()));
             }
-        else if( selectedAction == connectaction )
-            {
-            dminfo->synchronize(itemnum);
-            connectionRequested = true;
-            }
-        else
-            {    
-            }
-        }
-    delete csmenu;
+        connectaction = csmenu->addAction(hbTrId(
+                "txt_device_update_menu_connect"));
+        connect(connectaction, SIGNAL(triggered()), this,
+                SLOT(connectMenuItemSelected()));
+        csmenu->setPreferredPos(coOrdinates);
+        csmenu->open();
         }
     }
 
@@ -113,8 +91,8 @@
     dminfo->DisableDbNotifications(true);
     //If profile is not locked then take to edit server view
     int itemnum = 0;
-    QStandardItem *modelItem = model->itemFromIndex(index);
-    itemnum = modelItem->row();                  
+    QStandardItem *selectedItem = model->itemFromIndex(index);
+    itemnum = selectedItem->row();                  
     if(itemnum >= 0 && !dminfo->Isprofilelocked(itemnum))
         {        
         //read profile items
@@ -262,17 +240,17 @@
     {
     if(currentdefaultprofile >= 0)
         {
-        QStandardItem *modelItem = model->item(currentdefaultprofile);
+        QStandardItem *earlierDefaultProfile = model->item(currentdefaultprofile);
         //Find the transport type & set the icon
         int transporttype = 0;
         dminfo->profileTransport(currentdefaultprofile,transporttype);
         if(transporttype == 0)//Internet
             {
-            modelItem->setIcon(internet);
+            earlierDefaultProfile->setIcon(internet);
             }
         else
             {
-            modelItem->setIcon(bluetooth);
+            earlierDefaultProfile->setIcon(bluetooth);
             }        
         }
     }
@@ -668,3 +646,31 @@
     updateListview();
     }
 	
+void DmAdvancedView::defaultMenuItemSelected()
+    {
+    dminfo->setDefaultProfile(currentselecteditem);
+    updateEarlierdefaultProfileIcon();
+    modelItem->setIcon(defaultprofileicon);
+    currentdefaultprofile = currentselecteditem;
+    }
+
+void DmAdvancedView::deleteMenuItemSelected()
+    {
+    dminfo->DisableDbNotifications(true);
+    //check currentdefaultprofile is current item
+    if(currentselecteditem == currentdefaultprofile) // deleting default profile
+        currentdefaultprofile = -1;
+    if(dminfo->DeleteProfile(currentselecteditem) >=0 )
+        {
+    //Update the profile list
+    model->removeRow(currentselecteditem);
+        }
+    dminfo->DisableDbNotifications(false);
+    }
+
+void DmAdvancedView::connectMenuItemSelected()
+    {
+    dminfo->synchronize(currentselecteditem);
+    connectionRequested = true;
+    }
+	
--- a/deviceupdatesui/deviceupdates/src/dmfotaview.cpp	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/dmfotaview.cpp	Sat May 01 10:55:27 2010 +0530
@@ -24,6 +24,7 @@
 #include <etel.h>
 #include <featmgr.h>
 #include <etelmm.h>
+#include <hbnotificationdialog.h>
 #include <centralrepository.h>
 #include <sysversioninfo.h>
 #include "nsmldmsyncprivatecrkeys.h"
@@ -92,7 +93,7 @@
     exit->setText(QString("txt_common_menu_exit"));
     QObject::connect(exit, SIGNAL(triggered()), this, SLOT(OnExit()));
     
-    mSoftKeyBackAction = new HbAction(Hb::BackAction ,this);
+    mSoftKeyBackAction = new HbAction(Hb::BackNaviAction ,this);
     mSoftKeyBackAction->setText("Back");
     connect(mSoftKeyBackAction, SIGNAL(triggered()), this, SLOT(backtoMainWindow()));
         
@@ -122,7 +123,7 @@
 
 
     //Product Release
-    TBuf< 1024 > prodrelease;
+    TBuf< KSysUtilVersionTextLength > prodrelease;
     prodrelease.Zero();
     if(SysUtil::GetPRInformation(prodrelease)==KErrNone)
         {
@@ -280,28 +281,35 @@
 //
 void DMFotaView::CheckforUpdate()
  {
-    // if(no default profile defined)
-    HbDocumentLoader loader;
-    bool ok = false;
-    loader.load(":/xml/updatedialog.docml", &ok);
-    QString val;
-    // Exit if the file format is invalid
-    Q_ASSERT_X(ok, "Device Manager", "Invalid docml file");
-    HbDialog* dialog = qobject_cast<HbDialog*>(loader.findWidget("UpdateDialog"));
-    
-    label=qobject_cast<HbLabel*>(loader.findWidget("DialogText"));
-    val = hbTrId("txt_device_update_info_no_server_configured_to_get");
-    label->setPlainText(val);
-    dialog->setDismissPolicy(HbPopup::TapAnywhere);
-    dialog->setTimeout(HbPopup::StandardTimeout);
-    dialog->setAttribute(Qt::WA_DeleteOnClose, true);
-    dialog->exec();
-    //Else connect
-    /*TInt iProfileId= 1000000;
-    iSession.OpenL();
-    profile.OpenL(iSession,iProfileId);
-    //openconnection
-    iSyncJob.CreateL( iSession, iProfileId );*/
+    /*TInt profileId=NULL;
+    if(mainDmInfo==0)
+        {
+        if(!profilesView)
+            {
+            mainDmInfo = new DmInfo();
+            mainDmInfo->refreshProfileList();
+            }
+        else 
+            {
+            mainDmInfo = profilesView->dminfo;
+            }
+        }
+    if((profileId = mainDmInfo->DefaultFotaProfileIdL())==KErrNotFound)
+        {*/
+
+        HbNotificationDialog* note = new HbNotificationDialog();
+        QString val = hbTrId("txt_device_update_info_no_server_configured_to_get");
+        note->setTitle(val);
+        note->setTitleTextWrapping(Hb::TextWordWrap);
+        note->setDismissPolicy(HbPopup::TapAnywhere);
+        note->setTimeout(HbPopup::StandardTimeout);
+        note->setAttribute(Qt::WA_DeleteOnClose, true);
+        note->open();
+       /* }
+    else
+        {
+        mainDmInfo->sync(profileId);
+        }*/
  }
 
 // -----------------------------------------------------------------------------
@@ -315,22 +323,23 @@
     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager");
     if(!profilesView)
         {
-    qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 1");
-    profilesView = new DmAdvancedView(mMainWindow,this);
-    qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 2");
+        qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 1");
+        profilesView = new DmAdvancedView(mMainWindow,this);
+        qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 2");
         bool loadingok = profilesView->displayItems();
         if(loadingok)
-            {qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 3");
-        mMainWindow->addView(profilesView);
-        qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 4");
-        profilesView->setBackBehavior();  
-        qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 5");
-        mMainWindow->setCurrentView(profilesView);
-        qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 6");
+            {
+            qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 3");
+            mMainWindow->addView(profilesView);
+            qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 4");
+            profilesView->setBackBehavior();  
+            qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 5");
+            mMainWindow->setCurrentView(profilesView);
+            qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 6");
             }
         else
             {
-        qFatal("omadm Unable to read groupbox.docml");
+            qFatal("omadm Unable to read groupbox.docml");
         
             }
         }
--- a/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Sat May 01 10:55:27 2010 +0530
@@ -17,6 +17,7 @@
 
 #include <hblineedit.h>
 #include <hbmessagebox.h>
+#include <hbnamespace.h>
 #include "serversettingsview.h"
 #include "dmadvancedview.h"
 #include "settingsdataformcustomitem.h"
@@ -160,12 +161,12 @@
         }
     else
         {
-        HbMessageBox note(HbMessageBox::MessageTypeInformation);
-        note.setText(hbTrId(
+        HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+        note->setText(hbTrId(
                 "txt_device_update_dialog_enter_mandatory_field_values"));
-        note.setPrimaryAction(new HbAction("OK"));
-        note.setTimeout(HbPopup::NoTimeout);
-        note.exec();
+        note->setAttribute( Qt::WA_DeleteOnClose);         
+        note->setTimeout(HbPopup::NoTimeout);
+        note->open();
         }        
     }
 
@@ -175,10 +176,11 @@
     if(serversView->checkServerId(srvid))
         {
     serverid->setContentWidgetData(QString("text"), QString("")); 
-    HbMessageBox note(HbMessageBox::MessageTypeInformation);
-           note.setText(hbTrId("txt_device_update_dialog_invalid_server_id"));           
-           note.setTimeout(HbPopup::NoTimeout);
-           note.exec();         
+    HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
+           note->setText(hbTrId("txt_device_update_dialog_invalid_server_id")); 
+           note->setAttribute( Qt::WA_DeleteOnClose);                   
+           note->setTimeout(HbPopup::NoTimeout);
+           note->open();         
         }          
     }
 
--- a/deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp	Sun Apr 18 12:10:52 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp	Sat May 01 10:55:27 2010 +0530
@@ -49,8 +49,8 @@
             HbLineEdit* mLineEdit = new HbLineEdit();
             mLineEdit->setText(QString("8080"));
             HbEditorInterface editorInterface(mLineEdit);
-            editorInterface.setInputMode(HbInputModeNumeric); 
-            editorInterface.setConstraints(HbEditorConstraintFixedInputMode);            
+            editorInterface.setMode(HbInputModeNumeric); 
+            editorInterface.setInputConstraints(HbEditorConstraintFixedInputMode);            
             return mLineEdit;            
             }                
         default: