deviceupdatesui/deviceupdates/src/dmadvancedview.cpp
author hgs
Thu, 19 Aug 2010 17:35:23 +0530
changeset 56 a9afc3a8dbfa
parent 49 c34c36d1c835
child 62 03849bd79877
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     1
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     2
/*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     3
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     4
* All rights reserved.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     5
* This component and the accompanying materials are made available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     6
* under the terms of "Eclipse Public License v1.0"
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     7
* which accompanies this distribution, and is available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     9
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    10
* Initial Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    11
* Nokia Corporation - initial contribution.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    12
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    13
* Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    14
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    15
* Description:  Methods for DmAdvancedView.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    16
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    17
*/
38
hgs
parents: 36
diff changeset
    18
#include <hbnamespace.h>
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    19
#include "dmadvancedview.h"
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    20
#include "dmfotaview.h"
36
hgs
parents: 33
diff changeset
    21
#include "serversettingsview.h"
56
hgs
parents: 49
diff changeset
    22
#include "customviewitem.h"
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    23
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    24
DmAdvancedView::DmAdvancedView(HbMainWindow *mainWindow,DMFotaView *mainView, DmInfo *info, QGraphicsItem *parent):HbView(parent),
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    25
    bluetooth(":/icons/qgn_prop_sml_bt.svg"),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    26
    internet(":/icons/qgn_prop_sml_http.svg"), 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    27
    defaultprofileicon(":/icons/qtg_large_avatar.svg")                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    28
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    29
    qDebug("omadm DeviceManagerUi::DmAdvancedView >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    30
    iMainWindow = mainWindow;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    31
    serverSetView = NULL;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    32
    iMainView = mainView;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    33
    if(info==NULL)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    34
        {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    35
        dminfo = new DmInfo(this);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    36
        }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    37
    else 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    38
        dminfo = info;
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    39
    currentdefaultprofile = -1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    40
    currentview = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    41
    connectionRequested = false;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    42
    backbehaviorset = false;
38
hgs
parents: 36
diff changeset
    43
    currentselecteditem = -1;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    44
    qDebug("omadm DeviceManagerUi::DmAdvancedView >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    45
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    46
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    47
DmAdvancedView::~DmAdvancedView()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    48
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    49
    qDebug("omadm DmAdvancedView::~DmAdvancedView");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    50
    if(docmlLoader)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    51
        delete docmlLoader;  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    52
    if(dminfo)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    53
        delete dminfo;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    54
    qDebug("omadm DmAdvancedView::~DmAdvancedView end"); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    55
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    56
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    57
void DmAdvancedView::handleLongPress(HbAbstractViewItem* item , QPointF coOrdinates)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    58
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    59
    qDebug("omadm DeviceManagerUi::handleLongPress >>");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    60
    if(connectionRequested)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    61
        return;
38
hgs
parents: 36
diff changeset
    62
    if (item)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    63
        {
38
hgs
parents: 36
diff changeset
    64
        modelItem = model->itemFromIndex(item->modelIndex());
hgs
parents: 36
diff changeset
    65
        currentselecteditem = modelItem->row();
56
hgs
parents: 49
diff changeset
    66
        if(currentselecteditem == dminfo->profilescount())//Button item pressed
hgs
parents: 49
diff changeset
    67
            return;
38
hgs
parents: 36
diff changeset
    68
        HbMenu *csmenu = new HbMenu();
hgs
parents: 36
diff changeset
    69
        csmenu->setAttribute( Qt::WA_DeleteOnClose);
hgs
parents: 36
diff changeset
    70
        HbAction *defaultprofileAction = 0;
hgs
parents: 36
diff changeset
    71
        HbAction *deleteaction = 0;
hgs
parents: 36
diff changeset
    72
        HbAction *connectaction = 0;
hgs
parents: 36
diff changeset
    73
        if (!dminfo->Isdefaultprofile(currentselecteditem))
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    74
            {
38
hgs
parents: 36
diff changeset
    75
            defaultprofileAction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    76
                    "txt_device_update_menu_set_as_default"));
hgs
parents: 36
diff changeset
    77
            connect(defaultprofileAction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    78
                    SLOT(defaultMenuItemSelected()));
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    79
            }
49
hgs
parents: 47
diff changeset
    80
        if (!dminfo->Isprofilelocked(currentselecteditem) && 
hgs
parents: 47
diff changeset
    81
                     dminfo->isProfileDeleteAllowed(currentselecteditem) )
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    82
            {
38
hgs
parents: 36
diff changeset
    83
            deleteaction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    84
                    "txt_device_update_menu_delete"));
hgs
parents: 36
diff changeset
    85
            connect(deleteaction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    86
                    SLOT(deleteMenuItemSelected()));
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    87
            }
38
hgs
parents: 36
diff changeset
    88
        connectaction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    89
                "txt_device_update_menu_connect"));
hgs
parents: 36
diff changeset
    90
        connect(connectaction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    91
                SLOT(connectMenuItemSelected()));
hgs
parents: 36
diff changeset
    92
        csmenu->setPreferredPos(coOrdinates);
hgs
parents: 36
diff changeset
    93
        csmenu->open();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    94
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
    95
    qDebug("omadm DeviceManagerUi::handleLongPress >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    96
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    97
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    98
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    99
void DmAdvancedView::handleClicked(QModelIndex index)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   100
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   101
    qDebug("omadm DeviceManagerUi::handleClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   102
    if(connectionRequested)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   103
        return;
56
hgs
parents: 49
diff changeset
   104
	int itemnum = 0;
38
hgs
parents: 36
diff changeset
   105
    QStandardItem *selectedItem = model->itemFromIndex(index);
56
hgs
parents: 49
diff changeset
   106
    itemnum = selectedItem->row();	        
hgs
parents: 49
diff changeset
   107
     if(itemnum == dminfo->profilescount())//Button item pressed
hgs
parents: 49
diff changeset
   108
        {
hgs
parents: 49
diff changeset
   109
    qDebug("omadm create new server profile button clicked");
hgs
parents: 49
diff changeset
   110
        return;
hgs
parents: 49
diff changeset
   111
        }
hgs
parents: 49
diff changeset
   112
  //Stop listening DB events for profile addition
hgs
parents: 49
diff changeset
   113
    dminfo->DisableDbNotifications(true);                
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   114
    if(itemnum >= 0 && !dminfo->Isprofilelocked(itemnum))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   115
        {        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   116
        //read profile items
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   117
        QStringList itemdata;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   118
        bool sessmode = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   119
        QStringList iaplist;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   120
        int curriap = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   121
        int portnum = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   122
        bool nwauth = false ;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   123
        dminfo->getProfiledata(itemnum, itemdata, sessmode,iaplist,curriap,portnum, nwauth);	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   124
        QString editserverprof(itemdata[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   125
        if(!serverSetView)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   126
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   127
            serverSetView = new ServerSettingsView(iMainWindow, this , editserverprof);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   128
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   129
        else // view already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   130
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   131
            //Just update the setting items as per this profile            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   132
            serverSetView->makeviewItemsVisible(editserverprof);		  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   133
            }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   134
        serverSetView->setProfileValues(itemdata,sessmode,iaplist,curriap,portnum,nwauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   135
        iMainWindow->setCurrentView(serverSetView);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   136
  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   137
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   138
    qDebug("omadm DeviceManagerUi::handleClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   139
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   140
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   141
bool DmAdvancedView::displayItems()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   142
    {    	
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   143
    qDebug("omadm DeviceManagerUi::displayItems >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   144
    docmlLoader = new HbDocumentLoader;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   145
    bool ok ;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   146
    docmlLoader->load( DOCML_FILE_NAME,  &ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   147
    if(ok)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   148
    	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   149
        if(iMainWindow->orientation() == Qt::Vertical)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   150
            docmlLoader->load( DOCML_FILE_NAME,  PORTRAIT,&ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   151
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   152
            docmlLoader->load( DOCML_FILE_NAME, LANDSCAPE,&ok  );            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   153
    	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   154
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   155
    	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   156
    	 qDebug("omadm docml loading failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   157
    	 return ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   158
    	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   159
    if(ok)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   160
        {        	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   161
        connect(iMainWindow, SIGNAL(orientationChanged(Qt::Orientation)),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   162
                this,  SLOT(reLayout(Qt::Orientation)));    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   163
        viewwidget = qobject_cast<HbView *>(docmlLoader->findWidget( VIEW_NAME ) );    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   164
        Q_ASSERT_X(viewwidget != 0, "OMADM View not found","Not found");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   165
        viewspecificmenu = new HbMenu();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   166
        help = viewspecificmenu->addAction(hbTrId("txt_common_menu_help")); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   167
        exit = viewspecificmenu->addAction(hbTrId("txt_common_menu_exit"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   168
        connect(exit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   169
        setMenu(viewspecificmenu);            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   170
        serversListGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( GROUP ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   171
        serversListGroup->setHeading(hbTrId("txt_device_update_setlabel_device_update_services"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   172
        serversListGroup->setCollapsable( true );        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   173
        connect(serversListGroup, SIGNAL(toggled(bool)), this, SLOT(serversListGroupClicked(bool)));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   174
        otherDetailsGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( OTHERDETAILSGROUP ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   175
        connect(otherDetailsGroup, SIGNAL(toggled(bool)), this, SLOT(otherDetailsGroupClicked(bool)));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   176
        otherDetailsGroup->setHeading(hbTrId("txt_device_update_setlabel_other_details"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   177
        otherDetailsGroup->setCollapsable( true );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   178
        otherDetailsGroup->setCollapsed( true );                            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   179
        list = qobject_cast<HbListView *>(docmlLoader->findWidget( LIST_NAME ) );
56
hgs
parents: 49
diff changeset
   180
hgs
parents: 49
diff changeset
   181
        list->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon);
hgs
parents: 49
diff changeset
   182
        list->listItemPrototype()->setSecondaryTextRowCount(1,2);
hgs
parents: 49
diff changeset
   183
        list->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
hgs
parents: 49
diff changeset
   184
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   185
        dminfo->refreshProfileList();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   186
        int IndicatorCount =dminfo->profilescount();
56
hgs
parents: 49
diff changeset
   187
        model = new QStandardItemModel();   
hgs
parents: 49
diff changeset
   188
        QList<HbAbstractViewItem *> prototypes ;
hgs
parents: 49
diff changeset
   189
        prototypes.append(list->listItemPrototype());
hgs
parents: 49
diff changeset
   190
        CustomViewItem *prototype2 = new CustomViewItem(this,list);
hgs
parents: 49
diff changeset
   191
        prototypes.append(prototype2);
hgs
parents: 49
diff changeset
   192
        list->setItemPrototypes(prototypes);
hgs
parents: 49
diff changeset
   193
        list->setModel(model);
hgs
parents: 49
diff changeset
   194
        int i;
hgs
parents: 49
diff changeset
   195
        for (i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {        
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   196
        QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   197
        bool lock = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   198
        int icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   199
        int ret = dminfo->profileinfo(i,liststr,icon, lock);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   200
        if(ret <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   201
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   202
            break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   203
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   204
        QStandardItem* item ;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   205
        item = new QStandardItem();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   206
        HbIcon icon1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   207
        icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   208
        HbIcon icon2;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   209
        icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   210
        HbIcon icon3;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   211
        icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   212
        HbIcon defaultprofile;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   213
        defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   214
        QList<QVariant> Iconl;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   215
        if(icon == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   216
            Iconl.insert(0,icon1);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   217
        else if(icon == 1)//Bluetooth
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   218
            Iconl.insert(0,icon2); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   219
        else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   220
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   221
            Iconl.insert(0,defaultprofile);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   222
            currentdefaultprofile = i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   223
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   224
        icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   225
        if(lock)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   226
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   227
            Iconl.insert(1,icon3);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   228
            lock = false; 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   229
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   230
        QVariant iconlist(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   231
        iconlist.setValue(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   232
        item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   233
        item->setData(iconlist , Qt::DecorationRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   234
        model->setItem(i, item);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   235
        }        
56
hgs
parents: 49
diff changeset
   236
        list->setItemRecycling(false);
hgs
parents: 49
diff changeset
   237
        QStandardItem* customitem = new QStandardItem();
hgs
parents: 49
diff changeset
   238
        customitem->setData(Hb::ItemType_Last + 1001,Hb::ItemTypeRole);
hgs
parents: 49
diff changeset
   239
        model->setItem(i, customitem);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   240
        connect(list, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   241
                this,  SLOT(handleLongPress(HbAbstractViewItem*,QPointF)));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   242
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   243
        connect(list, SIGNAL(activated(QModelIndex)), this, SLOT(handleClicked(QModelIndex)));            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   244
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   245
        qDebug("omadm launching other details list");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   246
        otherdetailslist = qobject_cast<HbListView *>(docmlLoader->findWidget( LISTOTHERDETAILS ) );    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   247
        otherdetailslist->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   248
		otherdetailslist->setLongPressEnabled(EFalse);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   249
        qDebug("omadm launching other details list done");    
56
hgs
parents: 49
diff changeset
   250
        mainCalltoUpdateView();                             
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   251
        label = qobject_cast<HbLabel *>(docmlLoader->findWidget(LABEL));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   252
        label->setPlainText(hbTrId("txt_device_update_subhead_advanced_device_updates"));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   253
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   254
        setWidget(viewwidget);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   255
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   256
    else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   257
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   258
        qDebug("omadm docml section loading failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   259
        }    
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   260
    qDebug("omadm DeviceManagerUi::displayItems >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   261
    return ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   262
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   263
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   264
void DmAdvancedView::updateEarlierdefaultProfileIcon()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   265
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   266
    qDebug("omadm DeviceManagerUi::updateEarlierdefaultProfileIcon >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   267
    if(currentdefaultprofile >= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   268
        {
38
hgs
parents: 36
diff changeset
   269
        QStandardItem *earlierDefaultProfile = model->item(currentdefaultprofile);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   270
        //Find the transport type & set the icon
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   271
        int transporttype = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   272
        dminfo->profileTransport(currentdefaultprofile,transporttype);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   273
        if(transporttype == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   274
            {
38
hgs
parents: 36
diff changeset
   275
            earlierDefaultProfile->setIcon(internet);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   276
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   277
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   278
            {
38
hgs
parents: 36
diff changeset
   279
            earlierDefaultProfile->setIcon(bluetooth);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   280
            }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   281
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   282
    qDebug("omadm DeviceManagerUi::updateEarlierdefaultProfileIcon >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   283
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   284
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   285
void DmAdvancedView::createNewProfile()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   286
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   287
    qDebug("omadm DeviceManagerUi::createNewProfile >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   288
    if(dminfo->createNewprofile())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   289
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   290
        //Open server settings view    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   291
        QString newserverprof(hbTrId("txt_device_update_setlabel_new_server_profile"));    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   292
        if(!serverSetView)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   293
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   294
            serverSetView = new ServerSettingsView(iMainWindow, this, newserverprof);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   295
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   296
        else // view already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   297
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   298
            //Just update the setting items as per this profile                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   299
            serverSetView->makeviewItemsVisible(newserverprof);       
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   300
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   301
        QStringList serveritems;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   302
        serveritems<< "" <<"" <<"" <<"" <<""<<""<<""<<"";
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   303
        bool sessmode = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   304
        bool nauth = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   305
        QStringList apdata;        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   306
        int currap =-1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   307
        int destap = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   308
        dminfo->getIaplist(apdata,currap,destap);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   309
        int portnum = 8080;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   310
        serverSetView->setProfileValues(serveritems,sessmode,apdata,currap,portnum,nauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   311
        iMainWindow->setCurrentView(serverSetView);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   312
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   313
    else // profile not getting created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   314
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   315
        qDebug("OMADM New server profile creation failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   316
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   317
    qDebug("omadm DeviceManagerUi::createNewProfile >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   318
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   319
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   320
void DmAdvancedView::saveProfile(QStringList& itemdata, bool& sessmode, QString& currap,unsigned int& portnum, bool& nauth )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   321
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   322
    qDebug("omadm DeviceManagerUi::saveProfile >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   323
    dminfo->DisableDbNotifications(true);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   324
    dminfo->saveProfile(itemdata,sessmode,currap,portnum,nauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   325
    updateListview();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   326
    dminfo->DisableDbNotifications(false);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   327
    qDebug("omadm DeviceManagerUi::saveProfile >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   328
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   329
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   330
void DmAdvancedView::updateListview()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   331
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   332
    qDebug("omadm DeviceManagerUi::updateListview >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   333
    model->clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   334
    int IndicatorCount =dminfo->profilescount();    
56
hgs
parents: 49
diff changeset
   335
    int i;
hgs
parents: 49
diff changeset
   336
    for ( i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {    
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   337
    QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   338
    bool lock = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   339
    int icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   340
    int ret = dminfo->profileinfo(i,liststr,icon, lock);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   341
    if(ret <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   342
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   343
        break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   344
        }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   345
    QStandardItem* item ;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   346
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   347
    HbIcon icon1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   348
    icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   349
    HbIcon icon2;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   350
    icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   351
    HbIcon icon3;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   352
    icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   353
    HbIcon defaultprofile;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   354
    defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   355
    QList<QVariant> Iconl;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   356
    if(icon == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   357
        Iconl.insert(0,icon1);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   358
    else if(icon == 1)//Bluetooth
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   359
        Iconl.insert(0,icon2); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   360
    else //Default profile
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   361
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   362
        Iconl.insert(0,defaultprofile);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   363
        currentdefaultprofile = i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   364
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   365
    icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   366
    if(lock)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   367
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   368
        Iconl.insert(1,icon3);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   369
        lock = false; 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   370
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   371
    QVariant iconlist(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   372
    iconlist.setValue(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   373
    item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   374
    item->setData(iconlist , Qt::DecorationRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   375
    model->setItem(i, item);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   376
    }    
56
hgs
parents: 49
diff changeset
   377
    QStandardItem* item = new QStandardItem();
hgs
parents: 49
diff changeset
   378
    item->setData(Hb::ItemType_Last + 1001,Hb::ItemTypeRole);
hgs
parents: 49
diff changeset
   379
    model->setItem(i, item);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   380
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   381
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   382
void DmAdvancedView::serversListGroupClicked(bool state)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   383
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   384
    qDebug("omadm DeviceManagerUi::serversListGroupClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   385
    Q_UNUSED(state);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   386
    if(serversListGroup->isCollapsed())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   387
        otherDetailsGroup->setCollapsed(false);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   388
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   389
        otherDetailsGroup->setCollapsed(true);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   390
    qDebug("omadm DeviceManagerUi::serversListGroupClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   391
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   392
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   393
void DmAdvancedView::otherDetailsGroupClicked(bool state)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   394
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   395
    qDebug("omadm DeviceManagerUi::otherDetailsGroupClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   396
    Q_UNUSED(state);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   397
    if(otherDetailsGroup->isCollapsed())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   398
        serversListGroup->setCollapsed(false);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   399
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   400
        serversListGroup->setCollapsed(true);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   401
    qDebug("omadm DeviceManagerUi::otherDetailsGroupClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   402
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   403
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   404
bool DmAdvancedView::checkServerId(QString& serverid)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   405
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   406
    qDebug("omadm DeviceManagerUi::CheckforUpdate >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   407
    return dminfo->checksrvid(serverid);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   408
    qDebug("omadm DeviceManagerUi::CheckforUpdate >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   409
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   410
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   411
void DmAdvancedView::reLayout(Qt::Orientation orientation)
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   412
    {   
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   413
    qDebug("OMADM servers view DmAdvancedView::reLayout <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   414
    if(orientation == Qt::Horizontal)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   415
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   416
        qDebug("OMADM servers view landscape");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   417
        docmlLoader->load(DOCML_FILE_NAME,LANDSCAPE); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   418
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   419
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   420
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   421
        qDebug("OMADM servers view portrait");	        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   422
        bool ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   423
        docmlLoader->load( DOCML_FILE_NAME,  PORTRAIT, &ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   424
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   425
    qDebug("OMADM servers view DmAdvancedView::reLayout >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   426
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   427
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   428
void DmAdvancedView::setBackBehavior()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   429
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   430
    qDebug("OMADM servers view DmAdvancedView::setBackBehavior <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   431
    if (!backbehaviorset)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   432
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   433
        qDebug("OMADM servers view back behavior setting");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   434
        backaction = new HbAction(Hb::BackNaviAction, this);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   435
        connect(backaction, SIGNAL(triggered()), this,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   436
                SLOT(backButtonClicked()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   437
        setNavigationAction(backaction);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   438
        backbehaviorset = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   439
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   440
    qDebug("OMADM servers view back behavior setting done setBackBehavior >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   441
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   442
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   443
void DmAdvancedView::backButtonClicked()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   444
    {    
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   445
    qDebug("OMADM servers view DmAdvancedView::backButtonClicked <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   446
    QList <HbView*> views = iMainWindow->views();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   447
    if(iMainWindow->orientation()==Qt::Vertical)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   448
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   449
            iMainWindow->setCurrentView(views[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   450
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   451
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   452
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   453
            iMainWindow->setCurrentView(views[1]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   454
            }    
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   455
    qDebug("OMADM servers view DmAdvancedView::backButtonClicked >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   456
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   457
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   458
void DmAdvancedView::addVersionInfo()
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   459
    {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   460
    qDebug("OMADM servers view DmAdvancedView::addVersionInfo <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   461
    QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   462
    QStandardItem* item;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   463
    QString val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   464
    QString str;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   465
    TInt runtimesupport(0);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   466
        CRepository* cenrep = NULL;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   467
        TRAPD( error, cenrep = CRepository::NewL( KCRUidNSmlDMSyncApp ) );  
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   468
        if(error)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   469
           {     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   470
           FLOG( "[OMADM] CNSmlDMFotaContainer::FormatListboxL() cenrep problem" );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   471
           }    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   472
        if ( cenrep )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   473
           {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   474
           cenrep->Get( KNsmlDmRuntimeVerSupport, runtimesupport );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   475
           delete cenrep; cenrep = NULL;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   476
           }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   477
        //Browser version
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   478
        Swi::RSisRegistrySession sisses ;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   479
        TInt r( sisses.Connect() );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   480
        CleanupClosePushL( sisses );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   481
        if (r== KErrNone && runtimesupport)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   482
            {           
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   483
             Swi::RSisRegistryEntry sientry;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   484
             TInt oerr = sientry.Open(sisses, browseruid);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   485
             TVersion bversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   486
             TBuf <255> browserversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   487
             if(oerr == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   488
                 {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   489
                 TRAPD(err2,bversion= sientry.VersionL());     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   490
                 if (err2 == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   491
                     {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   492
                     browserversion.AppendNum(bversion.iMajor);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   493
                     browserversion.Append(_L("."));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   494
                     browserversion.AppendNum(bversion.iMinor);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   495
                     if( browserversion.Length()>0 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   496
                         {                                
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   497
                         str = QString::fromUtf16(browserversion.Ptr(), browserversion.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   498
                         item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   499
                         val = hbTrId("txt_device_update_dblist_browser_version");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   500
                         liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   501
                         liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   502
                         liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   503
                         item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   504
                         //m_otherdetailsmodel->setItem(i++, item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   505
                         m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   506
                         }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   507
                     }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   508
                 }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   509
            }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   510
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   511
        //flash version
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   512
        if (r== KErrNone&& runtimesupport)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   513
            {           
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   514
              Swi::RSisRegistryEntry sientry;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   515
              TInt oerr = sientry.Open(sisses, flashuid);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   516
              TVersion fversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   517
              TBuf <255> flashversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   518
              if(oerr == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   519
                  {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   520
                  TRAPD(err2,fversion= sientry.VersionL());         
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   521
                  if (err2 == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   522
                      {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   523
                      flashversion.AppendNum(fversion.iMajor);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   524
                      flashversion.Append(_L("."));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   525
                      flashversion.AppendNum(fversion.iMinor); 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   526
                      if( flashversion.Length()>0 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   527
                          {                               
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   528
                          str = QString::fromUtf16(flashversion.Ptr(), flashversion.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   529
                          item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   530
                          val = hbTrId("txt_device_update_dblist_flash_version");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   531
                          liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   532
                          liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   533
                          liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   534
                          item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   535
                          //m_otherdetailsmodel->setItem(i++, item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   536
                          m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   537
                          }                                   
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   538
                      }      
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   539
                  }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   540
            }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   541
               
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   542
         if (r== KErrNone&& runtimesupport)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   543
             {            
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   544
              Swi::RSisRegistryEntry sientry;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   545
              TInt oerr = sientry.Open(sisses, javauid);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   546
              TVersion jversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   547
              TBuf <255> javaversion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   548
              if(oerr == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   549
                  {       
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   550
                  TRAPD(err2,jversion= sientry.VersionL());     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   551
                  if (err2 == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   552
                      {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   553
                      javaversion.AppendNum(jversion.iMajor);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   554
                      javaversion.Append(_L("."));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   555
                      javaversion.AppendNum(jversion.iMinor);  
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   556
                      if( javaversion.Length()>0 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   557
                          { 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   558
                          str = QString::fromUtf16(javaversion.Ptr(), javaversion.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   559
                          item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   560
                          val = hbTrId("txt_device_update_dblist_java_version");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   561
                          liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   562
                          liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   563
                          liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   564
                          item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   565
                          m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   566
                          } 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   567
                      }            
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   568
                  }            
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   569
             } 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   570
        CleanupStack::PopAndDestroy(1);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   571
        qDebug("OMADM servers view DmAdvancedView::addVersionInfo >>");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   572
    }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   573
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   574
void DmAdvancedView::addOtherDetails()
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   575
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   576
        qDebug("OMADM servers view DmAdvancedView::addOtherDetails >>");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   577
        TRequestStatus status;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   578
        QStringList liststr;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   579
        QStandardItem* item;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   580
        QString val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   581
        QString str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   582
        TInt error(iServer.Connect());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   583
        if ( error != KErrNone )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   584
        	return;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   585
        iServer.GetPhoneInfo(0, info);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   586
        error = imobPhone.Open(iServer, info.iName);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   587
        if ( error != KErrNone )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   588
        {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   589
        	iServer.Close();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   590
        	return;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   591
        }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   592
        //Bands supported
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   593
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   594
        RMobilePhone::TMobilePhoneNetworkInfoV1 nwInfov1;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   595
        RMobilePhone::TMobilePhoneNetworkInfoV1Pckg nwInfov1Pckg(nwInfov1);                     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   596
        imobPhone.GetCurrentNetwork(status, nwInfov1Pckg);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   597
        User::WaitForRequest( status );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   598
        status = KRequestPending;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   599
        nwInfov1 = nwInfov1Pckg();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   600
        NetworkBand(nwInfov1.iBandInfo, str);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   601
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   602
        val = hbTrId("txt_device_update_dblist_gsm_bands");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   603
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   604
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   605
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   606
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   607
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   608
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   609
        //Packet Service
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   610
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   611
        TInt packetsrvc =0;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   612
        RMobilePhone::TMobilePhoneNetworkInfoV5 nwInfov5;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   613
        RMobilePhone::TMobilePhoneNetworkInfoV5Pckg nwInfov5Pckg(nwInfov5);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   614
        imobPhone.GetCurrentNetwork( status, nwInfov5Pckg );
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   615
        User::WaitForRequest( status );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   616
        status = KRequestPending;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   617
        nwInfov5 = nwInfov5Pckg();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   618
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   619
        if(nwInfov5.iHsdpaAvailableIndicator) packetsrvc =1;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   620
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   621
        if(nwInfov5.iEgprsAvailableIndicator) packetsrvc =2;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   622
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   623
        if(!packetsrvc)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   624
        {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   625
            RMobilePhone::TMobilePhoneNetworkInfoV8 nwInfov8;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   626
            RMobilePhone::TMobilePhoneNetworkInfoV8Pckg nwInfov8Pckg(nwInfov8);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   627
            imobPhone.GetCurrentNetwork( status, nwInfov8Pckg );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   628
            User::WaitForRequest( status );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   629
            status = KRequestPending;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   630
            nwInfov8 = nwInfov8Pckg();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   631
            if(nwInfov8.iHsupaAvailableIndicator) packetsrvc =3;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   632
        }     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   633
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   634
        val = hbTrId("txt_device_update_dblist_wcdma_uldl_data_rates");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   635
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   636
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   637
        PacketService(packetsrvc, str);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   638
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   639
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   640
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   641
                    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   642
        // Ciphering
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   643
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   644
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   645
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   646
        val = hbTrId("txt_device_update_dblist_gsm_cipherings");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   647
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   648
        imobPhone.GetNetworkSecurityLevel(status,idispSecurity);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   649
        User::WaitForRequest( status );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   650
        NetworkCiphering(idispSecurity, str);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   651
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   652
        item->setData(liststr, Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   653
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   654
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   655
        // WLAN MAC
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   656
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   657
        TUint KPhoneWlanSeparator (':');
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   658
        _LIT( KWLanMACDataFormat, "%02x");  
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   659
        // Fetch WLAN MAC address
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   660
        TBuf<KWlanMacAddrLength> address;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   661
        RProperty::Get( KPSUidWlan, KPSWlanMacAddress, address );   
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   662
        // Format fetched address
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   663
        TBuf<KWlanMacAddrLength> wlanMACAddress;        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   664
        for ( TInt i( 0 ); i < address.Length(); i++ )
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   665
            {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   666
            // Set separator
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   667
            if( i > 0 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   668
                {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   669
                wlanMACAddress.Append( KPhoneWlanSeparator );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   670
                }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   671
            // Set data
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   672
            TBuf<50> tmp;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   673
            tmp.Format( KWLanMACDataFormat, address[i] );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   674
            wlanMACAddress.Append( tmp );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   675
            } 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   676
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   677
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   678
        val = hbTrId("txt_device_update_dblist_wlan_mac_address");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   679
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   680
        str = QString::fromUtf16(wlanMACAddress.Ptr(), wlanMACAddress.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   681
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   682
        item->setData(liststr, Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   683
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   684
          
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   685
        // BT MAC
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   686
          
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   687
        TBuf<KBTAddrLength> addressBuffer;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   688
        // Fetch from Cenrep
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   689
        CRepository* repository = NULL;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   690
        TRAPD( err, repository = CRepository::NewL( KCRUidBluetoothLocalDeviceAddress ) );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   691
        if ( err == KErrNone )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   692
            {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   693
            qDebug("KCRUidBluetoothLocalDeviceAddress errnone");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   694
            err = repository->Get( KBTLocalDeviceAddress, addressBuffer );
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   695
            
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   696
            if (err == KErrNone)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   697
                qDebug("KBTLocalDeviceAddress errnone");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   698
            else
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   699
                qDebug("KBTLocalDeviceAddress Error");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   700
                
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   701
            delete repository;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   702
            }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   703
        else
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   704
            {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   705
                qDebug("KCRUidBluetoothLocalDeviceAddress Error openin cenrep");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   706
            }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   707
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   708
        val = hbTrId("txt_device_update_dblist_bt_mac_address");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   709
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   710
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   711
        str = QString::fromUtf16(addressBuffer.Ptr(), addressBuffer.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   712
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   713
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   714
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   715
        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   716
        imobPhone.Close();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   717
        iServer.Close();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   718
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   719
    }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   720
void DmAdvancedView::mainCalltoUpdateView()
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   721
{   
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   722
    qDebug("OMADM servers view DmAdvancedView::mainCalltoUpdateView >>");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   723
    m_otherdetailsmodel = new QStandardItemModel();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   724
    TInt i=0;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   725
    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   726
    QStringList liststr;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   727
    QStandardItem* item;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   728
    QString val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   729
    QString str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   730
    //1. Device Updated
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   731
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   732
    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   733
    addVersionInfo();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   734
    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   735
    addOtherDetails();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   736
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   737
    //sw version date
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   738
    TBuf< KSysUtilVersionTextLength > swversiondate;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   739
    TBuf< KSysUtilVersionTextLength > version;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   740
    version.Zero();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   741
    swversiondate.Zero();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   742
    if( SysUtil::GetSWVersion(version)==KErrNone)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   743
        {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   744
        TInt len= version.Length();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   745
        TInt pos1 = version.Find(KSmlEOL);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   746
             if( pos1 != KErrNotFound && len > pos1 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   747
                {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   748
                 TBuf<KSysUtilVersionTextLength> version1;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   749
                 version1.Zero();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   750
                 version1.Append( version.Right( len-pos1-1 ));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   751
                 len= version1.Length();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   752
                 pos1 = version1.Find(KSmlEOL);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   753
                 if( pos1 != KErrNotFound  && len > pos1 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   754
                     {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   755
                     swversiondate.Append(version1.Left( pos1 ));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   756
                     }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   757
                }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   758
            val = hbTrId("txt_device_update_dblist_sw_version_date");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   759
            item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   760
            str = QString::fromUtf16(swversiondate.Ptr(), swversiondate.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   761
            liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   762
            liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   763
            liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   764
            item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   765
            m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   766
            }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   767
            
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   768
    //Custom version and date
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   769
    //SysVersionInfo::TVersionInfoType x = SysVersionInfo::EOPVersion;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   770
    TBuf< KNSmlMaxTextLength64 >  customsw;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   771
    TBuf< KNSmlMaxTextLength64 >  customswdate;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   772
    version.Zero();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   773
    if( SysVersionInfo::GetVersionInfo(SysVersionInfo::EOPVersion,version) == KErrNone )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   774
      {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   775
         TInt len= version.Length();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   776
         TInt pos1 = version.Find(KSmlEOL);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   777
         if( pos1 != KErrNotFound  && len > pos1 )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   778
          {        
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   779
          customsw.Append( version.Left(pos1));
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   780
          customswdate.Append( version.Right( len-pos1-1 ));         
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   781
          }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   782
      } 
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   783
    
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   784
    if(customsw.Length()>0)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   785
        {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   786
        str = QString::fromUtf16(customsw.Ptr(), customsw.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   787
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   788
        val = hbTrId("txt_device_update_dblist_custom_version");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   789
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   790
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   791
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   792
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   793
        m_otherdetailsmodel->appendRow(item);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   794
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   795
    if(customswdate.Length()>0)
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   796
        {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   797
        str = QString::fromUtf16(customswdate.Ptr(), customswdate.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   798
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   799
        val = hbTrId("txt_device_update_dblist_custom_version_date");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   800
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   801
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   802
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   803
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   804
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   805
        }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   806
    
43
hgs
parents: 38
diff changeset
   807
    TBuf<KSysUtilVersionTextLength> Langversion; 
hgs
parents: 38
diff changeset
   808
    TBuf<KSysUtilVersionTextLength> lversion;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   809
    if( SysUtil::GetLangVersion(Langversion ) == KErrNone )
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   810
      {
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   811
        str = QString::fromUtf16(Langversion.Ptr(), Langversion.Length());
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   812
        item = new QStandardItem();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   813
        val = hbTrId("txt_device_update_dblist_language_set");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   814
        liststr.clear();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   815
        liststr << val;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   816
        liststr << str;
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   817
        item->setData(liststr , Qt::DisplayRole);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   818
        m_otherdetailsmodel->appendRow(item);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   819
      }
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   820
    
43
hgs
parents: 38
diff changeset
   821
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   822
    //lang variant version
43
hgs
parents: 38
diff changeset
   823
    Langversion.Zero();
hgs
parents: 38
diff changeset
   824
    if( SysUtil::GetLangSWVersion(Langversion ) == KErrNone )
hgs
parents: 38
diff changeset
   825
        {
hgs
parents: 38
diff changeset
   826
        int len = Langversion.Length();
hgs
parents: 38
diff changeset
   827
        TInt pos1 = Langversion.Find( KSmlEOL );
hgs
parents: 38
diff changeset
   828
        if( pos1 != KErrNotFound && len > pos1 )
hgs
parents: 38
diff changeset
   829
            {
hgs
parents: 38
diff changeset
   830
            lversion.Zero();
hgs
parents: 38
diff changeset
   831
            lversion.Append( Langversion.Left( pos1 ) );
hgs
parents: 38
diff changeset
   832
            }
hgs
parents: 38
diff changeset
   833
         str = QString::fromUtf16(lversion.Ptr(), lversion.Length());
hgs
parents: 38
diff changeset
   834
         item = new QStandardItem();
hgs
parents: 38
diff changeset
   835
         val = hbTrId("txt_device_update_dblist_language_variant_version");
hgs
parents: 38
diff changeset
   836
         liststr.clear();
hgs
parents: 38
diff changeset
   837
         liststr << val;
hgs
parents: 38
diff changeset
   838
         liststr << str;
hgs
parents: 38
diff changeset
   839
         item->setData(liststr , Qt::DisplayRole);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   840
         m_otherdetailsmodel->appendRow(item);
43
hgs
parents: 38
diff changeset
   841
        }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   842
     
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   843
    otherdetailslist->setModel(m_otherdetailsmodel);
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   844
    qDebug("OMADM servers view DmAdvancedView::mainCalltoUpdateView <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   845
		
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   846
}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   847
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   848
void DmAdvancedView::PacketService(TInt val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   849
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   850
    qDebug("OMADM servers view DmAdvancedView::PacketService >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   851
     switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   852
         {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   853
         case (0):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   854
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   855
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   856
         case (1):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   857
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   858
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   859
         case (2):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   860
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   861
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   862
         case (3):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   863
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   864
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   865
         case (4):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   866
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   867
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   868
         case (5):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   869
         default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   870
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l5");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   871
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   872
         }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   873
     qDebug("OMADM servers view DmAdvancedView::PacketService <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   874
     }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   875
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   876
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   877
void DmAdvancedView::NetworkCiphering(RMobilePhone::TMobilePhoneNetworkSecurity val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   878
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   879
    qDebug("OMADM servers view DmAdvancedView::NetworkCiphering >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   880
     switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   881
         {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   882
         case (RMobilePhone::ECipheringGSM):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   883
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   884
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   885
         case (RMobilePhone::ECipheringWCDMA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   886
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   887
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   888
         case (RMobilePhone::ECipheringCDMA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   889
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   890
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   891
         case (RMobilePhone::ECipheringOff):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   892
         default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   893
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   894
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   895
         }
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   896
     qDebug("OMADM servers view DmAdvancedView::NetworkCiphering <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   897
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   898
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   899
void DmAdvancedView::NetworkBand(RMobilePhone::TMobilePhoneNetworkBandInfo val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   900
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   901
    qDebug("OMADM servers view DmAdvancedView::NetworkBand >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   902
    switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   903
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   904
        case (RMobilePhone::E800BandA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   905
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   906
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   907
        case (RMobilePhone::E800BandB):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   908
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   909
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   910
        case (RMobilePhone::E800BandC):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   911
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   912
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   913
        case (RMobilePhone::E1900BandA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   914
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l5");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   915
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   916
        case (RMobilePhone::E1900BandB):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   917
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l6");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   918
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   919
        case (RMobilePhone::E1900BandC):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   920
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l7");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   921
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   922
        case (RMobilePhone::E1900BandD):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   923
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l8");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   924
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   925
        case (RMobilePhone::E1900BandE):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   926
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l9");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   927
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   928
        case (RMobilePhone::E1900BandF):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   929
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l10");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   930
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   931
        case (RMobilePhone::EBandUnknown):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   932
        default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   933
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   934
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   935
        }   
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   936
    qDebug("OMADM servers view DmAdvancedView::NetworkBand <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   937
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   938
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   939
void DmAdvancedView::syncCompleted(int jobstatus)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   940
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   941
    qDebug("OMADM servers view DmAdvancedView::syncCompleted >>");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   942
    Q_UNUSED(jobstatus);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   943
    connectionRequested = false;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   944
    updateListview();
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   945
    iMainView->enableButtons();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   946
    qDebug("OMADM servers view DmAdvancedView::syncCompleted <<");
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   947
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   948
	
38
hgs
parents: 36
diff changeset
   949
void DmAdvancedView::defaultMenuItemSelected()
hgs
parents: 36
diff changeset
   950
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   951
    qDebug("OMADM servers view DmAdvancedView::defaultMenuItemSelected >>");
38
hgs
parents: 36
diff changeset
   952
    dminfo->setDefaultProfile(currentselecteditem);
hgs
parents: 36
diff changeset
   953
    updateEarlierdefaultProfileIcon();
hgs
parents: 36
diff changeset
   954
    modelItem->setIcon(defaultprofileicon);
hgs
parents: 36
diff changeset
   955
    currentdefaultprofile = currentselecteditem;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   956
    qDebug("OMADM servers view DmAdvancedView::defaultMenuItemSelected <<");
38
hgs
parents: 36
diff changeset
   957
    }
hgs
parents: 36
diff changeset
   958
hgs
parents: 36
diff changeset
   959
void DmAdvancedView::deleteMenuItemSelected()
hgs
parents: 36
diff changeset
   960
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   961
    qDebug("OMADM servers view DmAdvancedView::deleteMenuItemSelected >>");
38
hgs
parents: 36
diff changeset
   962
    dminfo->DisableDbNotifications(true);
hgs
parents: 36
diff changeset
   963
    //check currentdefaultprofile is current item
hgs
parents: 36
diff changeset
   964
    if(currentselecteditem == currentdefaultprofile) // deleting default profile
hgs
parents: 36
diff changeset
   965
        currentdefaultprofile = -1;
hgs
parents: 36
diff changeset
   966
    if(dminfo->DeleteProfile(currentselecteditem) >=0 )
hgs
parents: 36
diff changeset
   967
        {
hgs
parents: 36
diff changeset
   968
    //Update the profile list
hgs
parents: 36
diff changeset
   969
    model->removeRow(currentselecteditem);
hgs
parents: 36
diff changeset
   970
        }
hgs
parents: 36
diff changeset
   971
    dminfo->DisableDbNotifications(false);
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   972
    qDebug("OMADM servers view DmAdvancedView::deleteMenuItemSelected <<");
38
hgs
parents: 36
diff changeset
   973
    }
hgs
parents: 36
diff changeset
   974
hgs
parents: 36
diff changeset
   975
void DmAdvancedView::connectMenuItemSelected()
hgs
parents: 36
diff changeset
   976
    {
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   977
    qDebug("OMADM servers view DmAdvancedView::connectMenuItemSelected >>");
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   978
    iMainView->displayNoteAndDisableButtons();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   979
    backButtonClicked();
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   980
    dminfo->synchronize(currentselecteditem);    
38
hgs
parents: 36
diff changeset
   981
    connectionRequested = true;
47
d316aecb87fd 201025_02
hgs
parents: 43
diff changeset
   982
    qDebug("OMADM servers view DmAdvancedView::connectMenuItemSelected <<");
38
hgs
parents: 36
diff changeset
   983
    }
hgs
parents: 36
diff changeset
   984