# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274953533 -10800 # Node ID 516a867811c3d178c3272decd6c8dba67aa1312a # Parent 408f75ba5bc2e2b9fafabdedab0c127ae5b57f2c Revision: 201019 Kit: 2010121 diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/cpqtsp/cpqtsp.pro --- a/deviceupdatesui/cpqtsp/cpqtsp.pro Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/cpqtsp/cpqtsp.pro Thu May 27 12:45:33 2010 +0300 @@ -33,7 +33,7 @@ LIBS+=-lxqservice -lxqserviceutil -lflogger MMP_RULES += "LIBRARY msgs.lib centralrepository.lib provisioningengine.lib featmgr.lib" -#TRANSLATIONS += deviceupdates.ts +TRANSLATIONS += deviceupdates.ts SERVICE.FILE = resources/service_conf.xml SERVICE.OPTIONS = embeddable diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierplugin.cpp --- a/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierplugin.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierplugin.cpp Thu May 27 12:45:33 2010 +0300 @@ -79,7 +79,11 @@ const QVariantMap ¶meters, DeviceDialogInfo *info) const { - + info->group = GenericDeviceDialogGroup; + +info->flags = NoDeviceDialogFlags; + +info->priority = DefaultPriority; return true; } diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifiersplugin.pro --- a/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifiersplugin.pro Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifiersplugin.pro Thu May 27 12:45:33 2010 +0300 @@ -19,7 +19,7 @@ HEADERS += devicemanagementnotifierutils.h HEADERS += syncmlnotifierprivate.h RESOURCES = devicemanagementnotifierdevman.qrc -#TRANSLATIONS += deviceupdates.ts +TRANSLATIONS += deviceupdates.ts symbian: { TARGET.EPOCALLOWDLLDATA = 1 diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierutils.cpp --- a/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierutils.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/devicemanagementnotifiersplugin/devicemanagementnotifierutils.cpp Thu May 27 12:45:33 2010 +0300 @@ -186,11 +186,11 @@ contentbody->setPlainText(serverinitmessage); //set softkeys - HbAction *primaryAction = dialog->primaryAction(); + HbAction *primaryAction = (HbAction *) dialog->actions().first(); QString softkeyok = hbTrId("txt_common_button_ok"); primaryAction->setText(softkeyok); - HbAction *secondaryAction = dialog->secondaryAction(); + HbAction *secondaryAction = (HbAction *) dialog->actions().at(1); QString softkeyCancel = hbTrId("txt_common_button_cancel"); secondaryAction->setText(softkeyCancel); @@ -313,11 +313,11 @@ contentbody->setPlainText(string); //set softkeys - HbAction *primaryAction = dialog->primaryAction(); + HbAction *primaryAction = (HbAction *) dialog->actions().first(); QString softkeyok = hbTrId("txt_common_button_yes"); primaryAction->setText(softkeyok); - HbAction *secondaryAction = dialog->secondaryAction(); + HbAction *secondaryAction = (HbAction *) dialog->actions().at(1); QString softkeyCancel = hbTrId("txt_common_button_no"); secondaryAction->setText(softkeyCancel); diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdates/deviceupdates.pro --- a/deviceupdatesui/deviceupdates/deviceupdates.pro Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdates/deviceupdates.pro Thu May 27 12:45:33 2010 +0300 @@ -82,6 +82,6 @@ RESOURCES += ./resources/deviceupdates.qrc CONFIG += hb -#TRANSLATIONS += deviceupdates.ts +TRANSLATIONS += deviceupdates.ts diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdates/inc/dmadvancedview.h --- a/deviceupdatesui/deviceupdates/inc/dmadvancedview.h Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdates/inc/dmadvancedview.h Thu May 27 12:45:33 2010 +0300 @@ -45,6 +45,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include "nsmldmsyncprivatecrkeys.h" #include "serversettingsview.h" #include "dminforetrieval.h" #define DOCML_FILE_NAME ":xml/serversview.docml" diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdates/src/dmadvancedview.cpp --- a/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp Thu May 27 12:45:33 2010 +0300 @@ -416,7 +416,7 @@ void DmAdvancedView::mainCalltoUpdateView() { int IndicatorCount =6; - otherdetailsmodel = new QStandardItemModel(IndicatorCount,0); + otherdetailsmodel = new QStandardItemModel(); TInt i=0; TRequestStatus status; QStringList liststr; @@ -549,6 +549,31 @@ liststr << str; item->setData(liststr , Qt::DisplayRole); otherdetailsmodel->setItem(i++, item); + + + TBuf Langversion; + TBuf lversion; + + //lang variant version + Langversion.Zero(); + if( SysUtil::GetLangSWVersion(Langversion ) == KErrNone ) + { + int len = Langversion.Length(); + TInt pos1 = Langversion.Find( KSmlEOL ); + if( pos1 != KErrNotFound && len > pos1 ) + { + lversion.Zero(); + lversion.Append( Langversion.Left( pos1 ) ); + } + str = QString::fromUtf16(lversion.Ptr(), lversion.Length()); + item = new QStandardItem(); + val = hbTrId("txt_device_update_dblist_language_variant_version"); + liststr.clear(); + liststr << val; + liststr << str; + item->setData(liststr , Qt::DisplayRole); + otherdetailsmodel->appendRow(item); + } otherdetailslist->setModel(otherdetailsmodel); diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdates/src/dmfotaview.cpp --- a/deviceupdatesui/deviceupdates/src/dmfotaview.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdates/src/dmfotaview.cpp Thu May 27 12:45:33 2010 +0300 @@ -173,6 +173,20 @@ } //Model + TBuf<100> phoneName; + TInt error = SysVersionInfo::GetVersionInfo(SysVersionInfo::EModelVersion, phoneName); + if (error==KErrNone) + { + + //phoneName.Copy( telid.iModel ); + //imei.Copy(telid.iSerialNumber); + if( phoneName.Length()>0 ) + { + val = hbTrId("txt_device_update_dblist_model"); + str = QString::fromUtf16(phoneName.Ptr(), phoneName.Length()); + FormatList(val,str); + } + } RTelServer telServer; User::LeaveIfError( telServer.Connect() ); RTelServer::TPhoneInfo teleinfo; @@ -189,17 +203,10 @@ TBuf <50> imei; if (status==KErrNone) { - TBuf<100> phoneName; - phoneName.Copy( telid.iModel ); imei.Copy(telid.iSerialNumber); - if( phoneName.Length()>0 ) - { - val = hbTrId("txt_device_update_dblist_model"); - str = QString::fromUtf16(phoneName.Ptr(), phoneName.Length()); - FormatList(val,str); - } } phone.Close(); + telServer.Close(); //type @@ -227,7 +234,7 @@ { */ TBuf productcode; productcode.Zero(); - TInt error = SysVersionInfo::GetVersionInfo(SysVersionInfo::EProductCode, productcode); + error = SysVersionInfo::GetVersionInfo(SysVersionInfo::EProductCode, productcode); if(error ==KErrNone ) { if( productcode.Length()>0 ) diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdates/src/main.cpp --- a/deviceupdatesui/deviceupdates/src/main.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdates/src/main.cpp Thu May 27 12:45:33 2010 +0300 @@ -23,53 +23,43 @@ int main(int argc, char *argv[]) { + HbApplication app(argc, argv); + //HbView* newview= new HbView(); - HbApplication app(argc, argv); - //HbView* newview= new HbView(); - - QTranslator *translator = new QTranslator(); + QTranslator *translator = new QTranslator(); QString lang = QLocale::system().name(); qDebug("OMADM Loading qm file"); qDebug()<load("deviceupdates_" + lang, path);/*finally required once localisation available*/ - bool fine = translator->load("deviceupdates_en.qm", path); - if(fine) - qApp->installTranslator(translator); - else - qDebug("omadm translator loading failed"); - QTranslator *commontranslator = new QTranslator(); + bool fine = translator->load("deviceupdates_" + lang, path);/*finally required once localisation available*/ + //bool fine = translator->load("deviceupdates_en.qm", path); + if(fine) + qApp->installTranslator(translator); + else + qDebug("omadm translator loading failed"); - fine = commontranslator->load("common_" + lang + ".qm", path);/*finally required once localisation available*/ - //fine = commontranslator->load("common_en" , path); - if(fine) - qApp->installTranslator(translator); - else - qDebug("omadm common translator loading failed"); + QTranslator *commontranslator = new QTranslator(); - app.setApplicationName(hbTrId("txt_device_update_subhead_device_updates")); - - CRepository *cenrep = CRepository::NewL(KUidSmlSyncApp); - TInt val(0); - if(cenrep) - { - cenrep->Get(KNsmlDmUILaunch, val); - { - if(val==1) - { - QTranslator *tempTranslator = new QTranslator(); - QString lang = QLocale::system().name(); - tempTranslator->load("control_panel_" + lang, path); - qApp->installTranslator(tempTranslator); - app.setApplicationName(hbTrId("txt_applib_list_control_panel")); - val=0; - cenrep->Set(KNsmlDmUILaunch, val); - delete cenrep; - cenrep = NULL; - } - } - } + fine = commontranslator->load("common_" + lang + ".qm", path);/*finally required once localisation available*/ + //fine = commontranslator->load("common_en" , path); + if(fine) + qApp->installTranslator(translator); + else + qDebug("omadm common translator loading failed"); + + if( argc == 2) // Launch via Control Panel + { + QTranslator *cptranslator = new QTranslator(); + cptranslator->load("control_panel_" + lang, path); + qApp->installTranslator(cptranslator); + app.setApplicationName(hbTrId("txt_applib_list_control_panel")); + } + else + { + app.setApplicationName(hbTrId("txt_device_update_subhead_device_updates")); + } + HbMainWindow window; DMFotaView* view = new DMFotaView(&window); diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro --- a/deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro Thu May 27 12:45:33 2010 +0300 @@ -28,7 +28,9 @@ CONFIG += hb plugin LIBS += -lcpframework \ - -lcentralrepository + -lcentralrepository \ + -lws32 \ + -lapparc # Input HEADERS += deviceupdatesplugin.h \ @@ -66,5 +68,6 @@ plugin.sources = deviceupdatesplugin.dll plugin.path = \resource\qt\plugins\controlpanel DEPLOYMENT += plugin +RESOURCES += ./resources/deviceupdatesplugin.qrc # End of file --Don't remove this. \ No newline at end of file diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h --- a/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h Thu May 27 12:45:33 2010 +0300 @@ -18,6 +18,7 @@ #ifndef DEVICEUPDATESDATA_H_ #define DEVICEUPDATESDATA_H_ +#include #include _LIT( KDMUIProcess, "\\deviceupdates.exe" ); @@ -37,13 +38,16 @@ const QString &description = QString(), const HbIcon &icon = HbIcon(), const HbDataFormModelItem *parent = 0); - void OpenDmAppL(); - void CloseDmUi(); + void LaunchDeviceUpdatesUi(); + void CloseDeviceUpdatesUi(); virtual ~DeviceUpdateData(); public slots: void onLaunchView(); private: virtual CpBaseSettingView *createSettingView() const; + +private: + QProcess *mproc; }; #endif// DEVICEUPDATESVIEW_H_ diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesplugin.h --- a/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesplugin.h Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesplugin.h Thu May 27 12:45:33 2010 +0300 @@ -19,24 +19,22 @@ #ifndef DEVICEUPDATESPLUGIN_H_ #define DEVICEUPDATESPLUGIN_H_ -#include +#include #include class CpItemDataHelper; -class DeviceUpdatesPlugin : public QObject, public CpPluginPlatInterface +class DeviceUpdatesPlugin : public QObject, public CpPluginInterface { Q_OBJECT - Q_INTERFACES(CpPluginPlatInterface) + Q_INTERFACES(CpPluginInterface) public: DeviceUpdatesPlugin(); virtual ~DeviceUpdatesPlugin(); - - virtual int uid() const; - virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; }; #endif /* DEVICEUPDATESPLUGIN_H_ */ diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/resources/deviceupdatesplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deviceupdatesui/deviceupdatesplugin/resources/deviceupdatesplugin.qrc Thu May 27 12:45:33 2010 +0300 @@ -0,0 +1,6 @@ + + + + qtg_large_device_update.svg + + diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/resources/qtg_large_device_update.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deviceupdatesui/deviceupdatesplugin/resources/qtg_large_device_update.svg Thu May 27 12:45:33 2010 +0300 @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp --- a/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp Thu May 27 12:45:33 2010 +0300 @@ -15,9 +15,11 @@ * */ - +#include +#include +#include #include -#include +#include #include "deviceupdatesdata.h" @@ -32,72 +34,72 @@ icon, parent) { + mproc = NULL; } DeviceUpdateData::~DeviceUpdateData() { - CloseDmUi(); + CloseDeviceUpdatesUi(); + if (mproc) + { + delete mproc; + mproc = NULL; + } } // ----------------------------------------------------------------------------- // DeviceUpdateData::OpenDmAppL() // ----------------------------------------------------------------------------- // -void DeviceUpdateData::OpenDmAppL() +void DeviceUpdateData::LaunchDeviceUpdatesUi() { - // Create DM UI Process - RProcess rp; - TInt cpLaunch(1); - CRepository *cenrep = CRepository::NewL(KUidSmlSyncApp); - if(cenrep) - { - cenrep->Set( KNsmlDmUILaunch, cpLaunch); - delete cenrep; - cenrep = NULL; - } - TInt err = rp.Create(KDMUIProcess,KNullDesC); - - User::LeaveIfError(err); - - - rp.Resume(); // logon OK - start the server - - + RWsSession ws; + User::LeaveIfError( ws.Connect() ); + CleanupClosePushL( ws ); + // Find the task with uid + TApaTaskList taskList(ws); + TApaTask task = taskList.FindApp( KUidSmlSyncApp ); + if ( task.Exists() ) + { + task.BringToForeground(); + } + else + { + // Create DM UI Process + if(!mproc) + mproc = new QProcess(); + if(mproc->state() != QProcess::Running) + { + QString app = QLatin1String("deviceupdates"); + QStringList args; + args<< QLatin1String("-cp"); + mproc->start(app, args); + mproc->waitForStarted(); + } + } + CleanupStack::PopAndDestroy(); // ws } // --------------------------------------------------------------------------------------------- // DeviceUpdateData::CloseDmUi // closes DM Ui // --------------------------------------------------------------------------------------------- -void DeviceUpdateData:: CloseDmUi() +void DeviceUpdateData:: CloseDeviceUpdatesUi() { - // Create DM UI Process - - TFullName processName; - TFindProcess process; - while ( process.Next( processName ) != KErrNotFound ) - { - if ( ( processName.Find( KDMUIName ) != KErrNotFound ) ) - { - RProcess rprocess; - if (rprocess.Open(process, EOwnerProcess) == KErrNone) - { - rprocess.Terminate(KErrNone); - rprocess.Close(); - } - } - } + if(( mproc )&&(mproc->state() == QProcess::Running)) + { + mproc->close(); + } + } void DeviceUpdateData::onLaunchView() { - TRAP_IGNORE( OpenDmAppL() ); + LaunchDeviceUpdatesUi(); } CpBaseSettingView *DeviceUpdateData::createSettingView() const { - return 0; + return 0; } - - diff -r 408f75ba5bc2 -r 516a867811c3 deviceupdatesui/deviceupdatesplugin/src/deviceupdatesplugin.cpp --- a/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesplugin.cpp Fri May 14 15:42:35 2010 +0300 +++ b/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesplugin.cpp Thu May 27 12:45:33 2010 +0300 @@ -15,7 +15,6 @@ * */ -//#include #include #include "deviceupdatesplugin.h" @@ -33,19 +32,12 @@ } -int DeviceUpdatesPlugin::uid() const -{ - // get a uid and replace it. - return 0X2002DD04; -} - -CpSettingFormItemData *DeviceUpdatesPlugin::createSettingFormItemData(CpItemDataHelper& itemDataHelper) const +QList DeviceUpdatesPlugin::createSettingFormItemData(CpItemDataHelper& itemDataHelper) const { - CpSettingFormItemData *entryItem = new DeviceUpdateData(itemDataHelper, QString("Device updates"), - QString()); - - return entryItem; + return QList() + << new DeviceUpdateData(itemDataHelper, QString("Device updates"), + QString("Device updates plugin"), HbIcon(":/resources/qtg_large_device_update.svg")); } Q_EXPORT_PLUGIN2( deviceupdatesplugin, DeviceUpdatesPlugin)