deviceupdatesui/deviceupdates/src/dmfotaview.cpp
changeset 38 2d078e09a2f4
parent 36 9eefb50e711a
child 43 88e14c3d4c4f
equal deleted inserted replaced
37:1cab1a4490f8 38:2d078e09a2f4
    22 #include <sysutil.h>
    22 #include <sysutil.h>
    23 #include <hbscrollarea.h>
    23 #include <hbscrollarea.h>
    24 #include <etel.h>
    24 #include <etel.h>
    25 #include <featmgr.h>
    25 #include <featmgr.h>
    26 #include <etelmm.h>
    26 #include <etelmm.h>
       
    27 #include <hbnotificationdialog.h>
    27 #include <centralrepository.h>
    28 #include <centralrepository.h>
    28 #include <sysversioninfo.h>
    29 #include <sysversioninfo.h>
    29 #include "nsmldmsyncprivatecrkeys.h"
    30 #include "nsmldmsyncprivatecrkeys.h"
    30 #include "dmadvancedview.h"
    31 #include "dmadvancedview.h"
    31 #include "dmfotaview.h"
    32 #include "dmfotaview.h"
    90     QObject::connect(help, SIGNAL(triggered()), this, SLOT(OnHelp()));
    91     QObject::connect(help, SIGNAL(triggered()), this, SLOT(OnHelp()));
    91     exit = qobject_cast<HbAction*>( loader2.findObject("exit"));
    92     exit = qobject_cast<HbAction*>( loader2.findObject("exit"));
    92     exit->setText(QString("txt_common_menu_exit"));
    93     exit->setText(QString("txt_common_menu_exit"));
    93     QObject::connect(exit, SIGNAL(triggered()), this, SLOT(OnExit()));
    94     QObject::connect(exit, SIGNAL(triggered()), this, SLOT(OnExit()));
    94     
    95     
    95     mSoftKeyBackAction = new HbAction(Hb::BackAction ,this);
    96     mSoftKeyBackAction = new HbAction(Hb::BackNaviAction ,this);
    96     mSoftKeyBackAction->setText("Back");
    97     mSoftKeyBackAction->setText("Back");
    97     connect(mSoftKeyBackAction, SIGNAL(triggered()), this, SLOT(backtoMainWindow()));
    98     connect(mSoftKeyBackAction, SIGNAL(triggered()), this, SLOT(backtoMainWindow()));
    98         
    99         
    99     
   100     
   100     i=0;
   101     i=0;
   120     list1 << "label" << "label_1" << "label_2" << "label_3" << "label_4" << "label_5" << "label_6"<<"label_7"<<"label_8"<<"label_9"<<"label_10"<<"label_11";
   121     list1 << "label" << "label_1" << "label_2" << "label_3" << "label_4" << "label_5" << "label_6"<<"label_7"<<"label_8"<<"label_9"<<"label_10"<<"label_11";
   121     list2 << "label_13" << "label_14" << "label_15" << "label_16" << "label_17" << "label_18" << "label_19"<<"label_20"<<"label_21"<<"label_22"<<"label_23"<<"label_24";
   122     list2 << "label_13" << "label_14" << "label_15" << "label_16" << "label_17" << "label_18" << "label_19"<<"label_20"<<"label_21"<<"label_22"<<"label_23"<<"label_24";
   122 
   123 
   123 
   124 
   124     //Product Release
   125     //Product Release
   125     TBuf< 1024 > prodrelease;
   126     TBuf< KSysUtilVersionTextLength > prodrelease;
   126     prodrelease.Zero();
   127     prodrelease.Zero();
   127     if(SysUtil::GetPRInformation(prodrelease)==KErrNone)
   128     if(SysUtil::GetPRInformation(prodrelease)==KErrNone)
   128         {
   129         {
   129         val = hbTrId("txt_device_update_dblist_product_release");
   130         val = hbTrId("txt_device_update_dblist_product_release");
   130         str = QString::fromUtf16(prodrelease.Ptr(), prodrelease.Length());
   131         str = QString::fromUtf16(prodrelease.Ptr(), prodrelease.Length());
   278 // Checks for updates from the default server
   279 // Checks for updates from the default server
   279 // -----------------------------------------------------------------------------
   280 // -----------------------------------------------------------------------------
   280 //
   281 //
   281 void DMFotaView::CheckforUpdate()
   282 void DMFotaView::CheckforUpdate()
   282  {
   283  {
   283     // if(no default profile defined)
   284     /*TInt profileId=NULL;
   284     HbDocumentLoader loader;
   285     if(mainDmInfo==0)
   285     bool ok = false;
   286         {
   286     loader.load(":/xml/updatedialog.docml", &ok);
   287         if(!profilesView)
   287     QString val;
   288             {
   288     // Exit if the file format is invalid
   289             mainDmInfo = new DmInfo();
   289     Q_ASSERT_X(ok, "Device Manager", "Invalid docml file");
   290             mainDmInfo->refreshProfileList();
   290     HbDialog* dialog = qobject_cast<HbDialog*>(loader.findWidget("UpdateDialog"));
   291             }
   291     
   292         else 
   292     label=qobject_cast<HbLabel*>(loader.findWidget("DialogText"));
   293             {
   293     val = hbTrId("txt_device_update_info_no_server_configured_to_get");
   294             mainDmInfo = profilesView->dminfo;
   294     label->setPlainText(val);
   295             }
   295     dialog->setDismissPolicy(HbPopup::TapAnywhere);
   296         }
   296     dialog->setTimeout(HbPopup::StandardTimeout);
   297     if((profileId = mainDmInfo->DefaultFotaProfileIdL())==KErrNotFound)
   297     dialog->setAttribute(Qt::WA_DeleteOnClose, true);
   298         {*/
   298     dialog->exec();
   299 
   299     //Else connect
   300         HbNotificationDialog* note = new HbNotificationDialog();
   300     /*TInt iProfileId= 1000000;
   301         QString val = hbTrId("txt_device_update_info_no_server_configured_to_get");
   301     iSession.OpenL();
   302         note->setTitle(val);
   302     profile.OpenL(iSession,iProfileId);
   303         note->setTitleTextWrapping(Hb::TextWordWrap);
   303     //openconnection
   304         note->setDismissPolicy(HbPopup::TapAnywhere);
   304     iSyncJob.CreateL( iSession, iProfileId );*/
   305         note->setTimeout(HbPopup::StandardTimeout);
       
   306         note->setAttribute(Qt::WA_DeleteOnClose, true);
       
   307         note->open();
       
   308        /* }
       
   309     else
       
   310         {
       
   311         mainDmInfo->sync(profileId);
       
   312         }*/
   305  }
   313  }
   306 
   314 
   307 // -----------------------------------------------------------------------------
   315 // -----------------------------------------------------------------------------
   308 // DMFotaView::AdvancedDeviceManager
   316 // DMFotaView::AdvancedDeviceManager
   309 // Displays the Profiles view
   317 // Displays the Profiles view
   313  {
   321  {
   314     
   322     
   315     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager");
   323     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager");
   316     if(!profilesView)
   324     if(!profilesView)
   317         {
   325         {
   318     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 1");
   326         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 1");
   319     profilesView = new DmAdvancedView(mMainWindow,this);
   327         profilesView = new DmAdvancedView(mMainWindow,this);
   320     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 2");
   328         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 2");
   321         bool loadingok = profilesView->displayItems();
   329         bool loadingok = profilesView->displayItems();
   322         if(loadingok)
   330         if(loadingok)
   323             {qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 3");
   331             {
   324         mMainWindow->addView(profilesView);
   332             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 3");
   325         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 4");
   333             mMainWindow->addView(profilesView);
   326         profilesView->setBackBehavior();  
   334             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 4");
   327         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 5");
   335             profilesView->setBackBehavior();  
   328         mMainWindow->setCurrentView(profilesView);
   336             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 5");
   329         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 6");
   337             mMainWindow->setCurrentView(profilesView);
       
   338             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 6");
   330             }
   339             }
   331         else
   340         else
   332             {
   341             {
   333         qFatal("omadm Unable to read groupbox.docml");
   342             qFatal("omadm Unable to read groupbox.docml");
   334         
   343         
   335             }
   344             }
   336         }
   345         }
   337     else
   346     else
   338         {
   347         {