deviceupdatesui/deviceupdates/src/dmadvancedview.cpp
author hgs
Sat, 01 May 2010 10:55:27 +0530
changeset 38 2d078e09a2f4
parent 36 9eefb50e711a
child 43 88e14c3d4c4f
permissions -rw-r--r--
201017
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"
36
hgs
parents: 33
diff changeset
    20
#include "serversettingsview.h"
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    21
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    22
DmAdvancedView::DmAdvancedView(HbMainWindow *mainWindow, HbView *mainView, QGraphicsItem *parent):HbView(parent),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    23
    bluetooth(":/icons/qgn_prop_sml_bt.svg"),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    24
    internet(":/icons/qgn_prop_sml_http.svg"), 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    25
    defaultprofileicon(":/icons/qtg_large_avatar.svg")                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    26
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    27
    iMainWindow = mainWindow;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    28
    serverSetView = NULL;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    29
    iMainView = mainView;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    30
    dminfo = new DmInfo(this);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    31
    currentdefaultprofile = -1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    32
    currentview = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    33
    connectionRequested = false;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    34
    backbehaviorset = false;
38
hgs
parents: 36
diff changeset
    35
    currentselecteditem = -1;
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    36
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    37
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    38
DmAdvancedView::~DmAdvancedView()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    39
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    40
    qDebug("omadm DmAdvancedView::~DmAdvancedView");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    41
    if(docmlLoader)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    42
        delete docmlLoader;  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    43
    if(dminfo)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    44
        delete dminfo;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    45
    qDebug("omadm DmAdvancedView::~DmAdvancedView end"); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    46
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    47
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    48
void DmAdvancedView::handleLongPress(HbAbstractViewItem* item , QPointF coOrdinates)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    49
    {
38
hgs
parents: 36
diff changeset
    50
    if (connectionRequested)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    51
        return;
38
hgs
parents: 36
diff changeset
    52
    if (item)
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    53
        {
38
hgs
parents: 36
diff changeset
    54
        modelItem = model->itemFromIndex(item->modelIndex());
hgs
parents: 36
diff changeset
    55
        currentselecteditem = modelItem->row();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    56
38
hgs
parents: 36
diff changeset
    57
        HbMenu *csmenu = new HbMenu();
hgs
parents: 36
diff changeset
    58
        csmenu->setAttribute( Qt::WA_DeleteOnClose);
hgs
parents: 36
diff changeset
    59
        HbAction *defaultprofileAction = 0;
hgs
parents: 36
diff changeset
    60
        HbAction *deleteaction = 0;
hgs
parents: 36
diff changeset
    61
        HbAction *connectaction = 0;
hgs
parents: 36
diff changeset
    62
        if (!dminfo->Isdefaultprofile(currentselecteditem))
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    63
            {
38
hgs
parents: 36
diff changeset
    64
            defaultprofileAction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    65
                    "txt_device_update_menu_set_as_default"));
hgs
parents: 36
diff changeset
    66
            connect(defaultprofileAction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    67
                    SLOT(defaultMenuItemSelected()));
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    68
            }
38
hgs
parents: 36
diff changeset
    69
        if (!dminfo->Isprofilelocked(currentselecteditem))
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    70
            {
38
hgs
parents: 36
diff changeset
    71
            deleteaction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    72
                    "txt_device_update_menu_delete"));
hgs
parents: 36
diff changeset
    73
            connect(deleteaction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    74
                    SLOT(deleteMenuItemSelected()));
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    75
            }
38
hgs
parents: 36
diff changeset
    76
        connectaction = csmenu->addAction(hbTrId(
hgs
parents: 36
diff changeset
    77
                "txt_device_update_menu_connect"));
hgs
parents: 36
diff changeset
    78
        connect(connectaction, SIGNAL(triggered()), this,
hgs
parents: 36
diff changeset
    79
                SLOT(connectMenuItemSelected()));
hgs
parents: 36
diff changeset
    80
        csmenu->setPreferredPos(coOrdinates);
hgs
parents: 36
diff changeset
    81
        csmenu->open();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    82
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    83
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    84
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    85
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    86
void DmAdvancedView::handleClicked(QModelIndex index)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    87
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    88
    if(connectionRequested)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    89
        return;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    90
    //Stop listening DB events for profile addition
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    91
    dminfo->DisableDbNotifications(true);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    92
    //If profile is not locked then take to edit server view
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    93
    int itemnum = 0;
38
hgs
parents: 36
diff changeset
    94
    QStandardItem *selectedItem = model->itemFromIndex(index);
hgs
parents: 36
diff changeset
    95
    itemnum = selectedItem->row();                  
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    96
    if(itemnum >= 0 && !dminfo->Isprofilelocked(itemnum))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    97
        {        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    98
        //read profile items
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    99
        QStringList itemdata;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   100
        bool sessmode = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   101
        QStringList iaplist;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   102
        int curriap = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   103
        int portnum = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   104
        bool nwauth = false ;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   105
        dminfo->getProfiledata(itemnum, itemdata, sessmode,iaplist,curriap,portnum, nwauth);	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   106
        QString editserverprof(itemdata[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   107
        if(!serverSetView)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   108
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   109
            serverSetView = new ServerSettingsView(iMainWindow, this , editserverprof);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   110
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   111
        else // view already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   112
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   113
            //Just update the setting items as per this profile            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   114
            serverSetView->makeviewItemsVisible(editserverprof);		  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   115
            }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   116
        serverSetView->setProfileValues(itemdata,sessmode,iaplist,curriap,portnum,nwauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   117
        iMainWindow->setCurrentView(serverSetView);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   118
  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   119
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   120
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   121
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   122
bool DmAdvancedView::displayItems()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   123
    {    	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   124
    docmlLoader = new HbDocumentLoader;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   125
    bool ok ;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   126
    docmlLoader->load( DOCML_FILE_NAME,  &ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   127
    if(ok)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   128
    	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   129
        if(iMainWindow->orientation() == Qt::Vertical)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   130
            docmlLoader->load( DOCML_FILE_NAME,  PORTRAIT,&ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   131
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   132
            docmlLoader->load( DOCML_FILE_NAME, LANDSCAPE,&ok  );            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   133
    	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   134
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   135
    	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   136
    	 qDebug("omadm docml loading failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   137
    	 return ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   138
    	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   139
    if(ok)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   140
        {        	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   141
        connect(iMainWindow, SIGNAL(orientationChanged(Qt::Orientation)),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   142
                this,  SLOT(reLayout(Qt::Orientation)));    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   143
        viewwidget = qobject_cast<HbView *>(docmlLoader->findWidget( VIEW_NAME ) );    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   144
        Q_ASSERT_X(viewwidget != 0, "OMADM View not found","Not found");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   145
        viewspecificmenu = new HbMenu();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   146
        help = viewspecificmenu->addAction(hbTrId("txt_common_menu_help")); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   147
        exit = viewspecificmenu->addAction(hbTrId("txt_common_menu_exit"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   148
        connect(exit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   149
        setMenu(viewspecificmenu);            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   150
        serversListGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( GROUP ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   151
        serversListGroup->setHeading(hbTrId("txt_device_update_setlabel_device_update_services"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   152
        serversListGroup->setCollapsable( true );        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   153
        connect(serversListGroup, SIGNAL(toggled(bool)), this, SLOT(serversListGroupClicked(bool)));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   154
        otherDetailsGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( OTHERDETAILSGROUP ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   155
        connect(otherDetailsGroup, SIGNAL(toggled(bool)), this, SLOT(otherDetailsGroupClicked(bool)));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   156
        otherDetailsGroup->setHeading(hbTrId("txt_device_update_setlabel_other_details"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   157
        otherDetailsGroup->setCollapsable( true );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   158
        otherDetailsGroup->setCollapsed( true );                            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   159
        list = qobject_cast<HbListView *>(docmlLoader->findWidget( LIST_NAME ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   160
        HbListViewItem *prototype = list->listItemPrototype();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   161
        prototype->setGraphicsSize(HbListViewItem::LargeIcon);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   162
        prototype->setSecondaryTextRowCount(1,2);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   163
        prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   164
        dminfo->refreshProfileList();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   165
        int IndicatorCount =dminfo->profilescount();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   166
        model = new QStandardItemModel();            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   167
        for (int i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   168
        QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   169
        bool lock = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   170
        int icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   171
        int ret = dminfo->profileinfo(i,liststr,icon, lock);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   172
        if(ret <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   173
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   174
            break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   175
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   176
        QStandardItem* item ;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   177
        item = new QStandardItem();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   178
        HbIcon icon1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   179
        icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   180
        HbIcon icon2;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   181
        icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   182
        HbIcon icon3;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   183
        icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   184
        HbIcon defaultprofile;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   185
        defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   186
        QList<QVariant> Iconl;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   187
        if(icon == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   188
            Iconl.insert(0,icon1);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   189
        else if(icon == 1)//Bluetooth
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   190
            Iconl.insert(0,icon2); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   191
        else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   192
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   193
            Iconl.insert(0,defaultprofile);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   194
            currentdefaultprofile = i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   195
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   196
        icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   197
        if(lock)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   198
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   199
            Iconl.insert(1,icon3);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   200
            lock = false; 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   201
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   202
        QVariant iconlist(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   203
        iconlist.setValue(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   204
        item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   205
        item->setData(iconlist , Qt::DecorationRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   206
        model->setItem(i, item);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   207
        }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   208
        list->setModel(model,prototype);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   209
        list->setItemRecycling(false);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   210
        connect(list, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   211
                this,  SLOT(handleLongPress(HbAbstractViewItem*,QPointF)));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   212
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   213
        connect(list, SIGNAL(activated(QModelIndex)), this, SLOT(handleClicked(QModelIndex)));            
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   214
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   215
        qDebug("omadm launching other details list");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   216
        otherdetailslist = qobject_cast<HbListView *>(docmlLoader->findWidget( LISTOTHERDETAILS ) );    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   217
        otherdetailslist->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   218
		otherdetailslist->setLongPressEnabled(EFalse);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   219
        qDebug("omadm launching other details list done");    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   220
        mainCalltoUpdateView();           
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   221
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   222
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   223
        newserverprofile = qobject_cast<HbPushButton *>(docmlLoader->findWidget(NEWSERVERBUTTON));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   224
        newserverprofile->setText(hbTrId("txt_device_update_button_new_server_profile"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   225
        connect(newserverprofile, SIGNAL(clicked()),this, SLOT(createNewProfile()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   226
              
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   227
        label = qobject_cast<HbLabel *>(docmlLoader->findWidget(LABEL));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   228
        label->setPlainText(hbTrId("txt_device_update_subhead_advanced_device_updates"));        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   229
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   230
        setWidget(viewwidget);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   231
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   232
    else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   233
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   234
        qDebug("omadm docml section loading failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   235
        }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   236
    return ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   237
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   238
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   239
void DmAdvancedView::updateEarlierdefaultProfileIcon()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   240
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   241
    if(currentdefaultprofile >= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   242
        {
38
hgs
parents: 36
diff changeset
   243
        QStandardItem *earlierDefaultProfile = model->item(currentdefaultprofile);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   244
        //Find the transport type & set the icon
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   245
        int transporttype = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   246
        dminfo->profileTransport(currentdefaultprofile,transporttype);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   247
        if(transporttype == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   248
            {
38
hgs
parents: 36
diff changeset
   249
            earlierDefaultProfile->setIcon(internet);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   250
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   251
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   252
            {
38
hgs
parents: 36
diff changeset
   253
            earlierDefaultProfile->setIcon(bluetooth);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   254
            }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   255
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   256
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   257
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   258
void DmAdvancedView::createNewProfile()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   259
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   260
    if(dminfo->createNewprofile())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   261
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   262
        //Open server settings view    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   263
        QString newserverprof(hbTrId("txt_device_update_setlabel_new_server_profile"));    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   264
        if(!serverSetView)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   265
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   266
            serverSetView = new ServerSettingsView(iMainWindow, this, newserverprof);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   267
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   268
        else // view already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   269
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   270
            //Just update the setting items as per this profile                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   271
            serverSetView->makeviewItemsVisible(newserverprof);       
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   272
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   273
        QStringList serveritems;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   274
        serveritems<< "" <<"" <<"" <<"" <<""<<""<<""<<"";
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   275
        bool sessmode = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   276
        bool nauth = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   277
        QStringList apdata;        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   278
        int currap =-1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   279
        int destap = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   280
        dminfo->getIaplist(apdata,currap,destap);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   281
        int portnum = 8080;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   282
        serverSetView->setProfileValues(serveritems,sessmode,apdata,currap,portnum,nauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   283
        iMainWindow->setCurrentView(serverSetView);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   284
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   285
    else // profile not getting created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   286
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   287
        qDebug("OMADM New server profile creation failed");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   288
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   289
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   290
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   291
void DmAdvancedView::saveProfile(QStringList& itemdata, bool& sessmode, QString& currap,unsigned int& portnum, bool& nauth )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   292
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   293
    dminfo->DisableDbNotifications(true);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   294
    dminfo->saveProfile(itemdata,sessmode,currap,portnum,nauth);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   295
    updateListview();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   296
    dminfo->DisableDbNotifications(false);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   297
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   298
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   299
void DmAdvancedView::updateListview()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   300
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   301
    model->clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   302
    int IndicatorCount =dminfo->profilescount();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   303
    for (int i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   304
    QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   305
    bool lock = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   306
    int icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   307
    int ret = dminfo->profileinfo(i,liststr,icon, lock);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   308
    if(ret <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   309
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   310
        break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   311
        }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   312
    QStandardItem* item ;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   313
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   314
    HbIcon icon1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   315
    icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   316
    HbIcon icon2;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   317
    icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   318
    HbIcon icon3;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   319
    icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   320
    HbIcon defaultprofile;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   321
    defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   322
    QList<QVariant> Iconl;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   323
    if(icon == 0)//Internet
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   324
        Iconl.insert(0,icon1);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   325
    else if(icon == 1)//Bluetooth
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   326
        Iconl.insert(0,icon2); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   327
    else //Default profile
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   328
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   329
        Iconl.insert(0,defaultprofile);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   330
        currentdefaultprofile = i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   331
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   332
    icon = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   333
    if(lock)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   334
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   335
        Iconl.insert(1,icon3);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   336
        lock = false; 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   337
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   338
    QVariant iconlist(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   339
    iconlist.setValue(Iconl);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   340
    item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   341
    item->setData(iconlist , Qt::DecorationRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   342
    model->setItem(i, item);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   343
    }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   344
    model->sort(0);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   345
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   346
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   347
void DmAdvancedView::serversListGroupClicked(bool state)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   348
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   349
    Q_UNUSED(state);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   350
    if(serversListGroup->isCollapsed())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   351
        otherDetailsGroup->setCollapsed(false);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   352
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   353
        otherDetailsGroup->setCollapsed(true);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   354
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   355
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   356
void DmAdvancedView::otherDetailsGroupClicked(bool state)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   357
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   358
    Q_UNUSED(state);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   359
    if(otherDetailsGroup->isCollapsed())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   360
        serversListGroup->setCollapsed(false);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   361
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   362
        serversListGroup->setCollapsed(true);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   363
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   364
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   365
bool DmAdvancedView::checkServerId(QString& serverid)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   366
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   367
    return dminfo->checksrvid(serverid);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   368
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   369
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   370
void DmAdvancedView::reLayout(Qt::Orientation orientation)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   371
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   372
    qDebug("OMADM servers view DmAdvancedView::reLayout");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   373
    if(orientation == Qt::Horizontal)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   374
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   375
        qDebug("OMADM servers view landscape");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   376
        docmlLoader->load(DOCML_FILE_NAME,LANDSCAPE); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   377
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   378
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   379
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   380
        qDebug("OMADM servers view portrait");	        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   381
        bool ok;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   382
        docmlLoader->load( DOCML_FILE_NAME,  PORTRAIT, &ok  );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   383
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   384
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   385
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   386
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   387
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   388
void DmAdvancedView::setBackBehavior()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   389
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   390
    if (!backbehaviorset)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   391
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   392
        qDebug("OMADM servers view back behavior setting");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   393
        backaction = new HbAction(Hb::BackNaviAction, this);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   394
        connect(backaction, SIGNAL(triggered()), this,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   395
                SLOT(backButtonClicked()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   396
        setNavigationAction(backaction);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   397
        backbehaviorset = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   398
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   399
    qDebug("OMADM servers view back behavior setting done");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   400
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   401
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   402
void DmAdvancedView::backButtonClicked()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   403
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   404
    QList <HbView*> views = iMainWindow->views();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   405
    if(iMainWindow->orientation()==Qt::Vertical)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   406
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   407
            iMainWindow->setCurrentView(views[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   408
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   409
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   410
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   411
            iMainWindow->setCurrentView(views[1]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   412
            }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   413
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   414
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   415
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   416
void DmAdvancedView::mainCalltoUpdateView()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   417
{   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   418
    int IndicatorCount =6;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   419
    otherdetailsmodel = new QStandardItemModel(IndicatorCount,0);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   420
    TInt i=0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   421
    TRequestStatus status;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   422
    QStringList liststr;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   423
    QStandardItem* item;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   424
    QString val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   425
    QString str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   426
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   427
    iServer.Connect();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   428
    iServer.GetPhoneInfo(0, info);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   429
    imobPhone.Open(iServer, info.iName);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   430
    //Bands supported
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   431
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   432
    RMobilePhone::TMobilePhoneNetworkInfoV1 nwInfov1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   433
    RMobilePhone::TMobilePhoneNetworkInfoV1Pckg nwInfov1Pckg(nwInfov1);						
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   434
    imobPhone.GetCurrentNetwork(status, nwInfov1Pckg);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   435
    User::WaitForRequest( status );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   436
    status = KRequestPending;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   437
    nwInfov1 = nwInfov1Pckg();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   438
    NetworkBand(nwInfov1.iBandInfo, str);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   439
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   440
    val = hbTrId("txt_device_update_dblist_gsm_bands");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   441
    liststr << val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   442
    liststr << str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   443
    item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   444
    otherdetailsmodel->setItem(i++, item);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   445
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   446
    //Packet Service
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   447
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   448
    TInt packetsrvc =0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   449
    RMobilePhone::TMobilePhoneNetworkInfoV5 nwInfov5;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   450
    RMobilePhone::TMobilePhoneNetworkInfoV5Pckg nwInfov5Pckg(nwInfov5);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   451
    imobPhone.GetCurrentNetwork( status, nwInfov5Pckg );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   452
    User::WaitForRequest( status );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   453
    status = KRequestPending;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   454
    nwInfov5 = nwInfov5Pckg();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   455
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   456
    if(nwInfov5.iHsdpaAvailableIndicator) packetsrvc =1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   457
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   458
    if(nwInfov5.iEgprsAvailableIndicator) packetsrvc =2;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   459
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   460
    if(!packetsrvc)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   461
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   462
        RMobilePhone::TMobilePhoneNetworkInfoV8 nwInfov8;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   463
        RMobilePhone::TMobilePhoneNetworkInfoV8Pckg nwInfov8Pckg(nwInfov8);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   464
        imobPhone.GetCurrentNetwork( status, nwInfov8Pckg );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   465
        User::WaitForRequest( status );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   466
        status = KRequestPending;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   467
        nwInfov8 = nwInfov8Pckg();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   468
        if(nwInfov8.iHsupaAvailableIndicator) packetsrvc =3;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   469
    }	  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   470
    liststr.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   471
    val = hbTrId("txt_device_update_dblist_wcdma_uldl_data_rates");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   472
    liststr << val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   473
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   474
    PacketService(packetsrvc, str);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   475
    liststr << str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   476
    item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   477
    otherdetailsmodel->setItem(i++, item);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   478
				
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   479
    // Ciphering
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   480
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   481
    liststr.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   482
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   483
    val = hbTrId("txt_device_update_dblist_gsm_cipherings");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   484
    liststr << val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   485
    imobPhone.GetNetworkSecurityLevel(status,idispSecurity);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   486
    User::WaitForRequest( status );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   487
    NetworkCiphering(idispSecurity, str);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   488
    liststr << str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   489
    item->setData(liststr, Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   490
    otherdetailsmodel->setItem(i++, item);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   491
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   492
    // WLAN MAC
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   493
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   494
    TUint KPhoneWlanSeparator (':');
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   495
    _LIT( KWLanMACDataFormat, "%02x");  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   496
    // Fetch WLAN MAC address
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   497
    TBuf<KWlanMacAddrLength> address;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   498
    RProperty::Get( KPSUidWlan, KPSWlanMacAddress, address );   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   499
    // Format fetched address
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   500
    TBuf<KWlanMacAddrLength> wlanMACAddress;        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   501
    for ( TInt i( 0 ); i < address.Length(); i++ )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   502
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   503
        // Set separator
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   504
        if( i > 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   505
            {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   506
            wlanMACAddress.Append( KPhoneWlanSeparator );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   507
            }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   508
        // Set data
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   509
        TBuf<50> tmp;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   510
        tmp.Format( KWLanMACDataFormat, address[i] );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   511
        wlanMACAddress.Append( tmp );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   512
        } 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   513
    liststr.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   514
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   515
    val = hbTrId("txt_device_update_dblist_wlan_mac_address");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   516
    liststr << val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   517
    str = QString::fromUtf16(wlanMACAddress.Ptr(), wlanMACAddress.Length());
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   518
    liststr << str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   519
    item->setData(liststr, Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   520
    otherdetailsmodel->setItem(i++, item);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   521
      
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   522
    // BT MAC
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   523
      
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   524
    TBuf<KBTAddrLength> addressBuffer;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   525
    // Fetch from Cenrep
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   526
    CRepository* repository = NULL;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   527
    TRAPD( err, repository = CRepository::NewL( KCRUidBluetoothLocalDeviceAddress ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   528
    if ( err == KErrNone )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   529
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   530
        qDebug("KCRUidBluetoothLocalDeviceAddress errnone");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   531
        err = repository->Get( KBTLocalDeviceAddress, addressBuffer );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   532
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   533
        if (err == KErrNone)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   534
        	qDebug("KBTLocalDeviceAddress errnone");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   535
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   536
        	qDebug("KBTLocalDeviceAddress Error");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   537
        	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   538
        delete repository;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   539
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   540
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   541
    	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   542
    		qDebug("KCRUidBluetoothLocalDeviceAddress Error openin cenrep");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   543
    	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   544
    liststr.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   545
    val = hbTrId("txt_device_update_dblist_bt_mac_address");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   546
    liststr << val;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   547
    item = new QStandardItem();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   548
    str = QString::fromUtf16(addressBuffer.Ptr(), addressBuffer.Length());
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   549
    liststr << str;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   550
    item->setData(liststr , Qt::DisplayRole);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   551
    otherdetailsmodel->setItem(i++, item);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   552
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   553
    otherdetailslist->setModel(otherdetailsmodel);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   554
		
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   555
}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   556
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   557
void DmAdvancedView::PacketService(TInt val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   558
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   559
     switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   560
         {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   561
         case (0):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   562
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   563
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   564
         case (1):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   565
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   566
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   567
         case (2):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   568
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   569
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   570
         case (3):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   571
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   572
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   573
         case (4):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   574
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   575
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   576
         case (5):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   577
         default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   578
                 string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l5");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   579
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   580
         }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   581
     }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   582
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   583
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   584
void DmAdvancedView::NetworkCiphering(RMobilePhone::TMobilePhoneNetworkSecurity val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   585
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   586
     switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   587
         {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   588
         case (RMobilePhone::ECipheringGSM):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   589
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   590
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   591
         case (RMobilePhone::ECipheringWCDMA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   592
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   593
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   594
         case (RMobilePhone::ECipheringCDMA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   595
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   596
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   597
         case (RMobilePhone::ECipheringOff):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   598
         default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   599
                 string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   600
                 break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   601
         }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   602
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   603
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   604
void DmAdvancedView::NetworkBand(RMobilePhone::TMobilePhoneNetworkBandInfo val, QString& string)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   605
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   606
    switch (val)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   607
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   608
        case (RMobilePhone::E800BandA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   609
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l2");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   610
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   611
        case (RMobilePhone::E800BandB):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   612
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l3");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   613
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   614
        case (RMobilePhone::E800BandC):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   615
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l4");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   616
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   617
        case (RMobilePhone::E1900BandA):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   618
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l5");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   619
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   620
        case (RMobilePhone::E1900BandB):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   621
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l6");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   622
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   623
        case (RMobilePhone::E1900BandC):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   624
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l7");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   625
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   626
        case (RMobilePhone::E1900BandD):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   627
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l8");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   628
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   629
        case (RMobilePhone::E1900BandE):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   630
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l9");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   631
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   632
        case (RMobilePhone::E1900BandF):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   633
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l10");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   634
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   635
        case (RMobilePhone::EBandUnknown):
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   636
        default :
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   637
                string = hbTrId("txt_device_update_dblist_gsm_bands_val_l1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   638
                break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   639
        }   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   640
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   641
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   642
void DmAdvancedView::syncCompleted(int jobstatus)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   643
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   644
    Q_UNUSED(jobstatus);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   645
    connectionRequested = false;    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   646
    updateListview();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   647
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   648
	
38
hgs
parents: 36
diff changeset
   649
void DmAdvancedView::defaultMenuItemSelected()
hgs
parents: 36
diff changeset
   650
    {
hgs
parents: 36
diff changeset
   651
    dminfo->setDefaultProfile(currentselecteditem);
hgs
parents: 36
diff changeset
   652
    updateEarlierdefaultProfileIcon();
hgs
parents: 36
diff changeset
   653
    modelItem->setIcon(defaultprofileicon);
hgs
parents: 36
diff changeset
   654
    currentdefaultprofile = currentselecteditem;
hgs
parents: 36
diff changeset
   655
    }
hgs
parents: 36
diff changeset
   656
hgs
parents: 36
diff changeset
   657
void DmAdvancedView::deleteMenuItemSelected()
hgs
parents: 36
diff changeset
   658
    {
hgs
parents: 36
diff changeset
   659
    dminfo->DisableDbNotifications(true);
hgs
parents: 36
diff changeset
   660
    //check currentdefaultprofile is current item
hgs
parents: 36
diff changeset
   661
    if(currentselecteditem == currentdefaultprofile) // deleting default profile
hgs
parents: 36
diff changeset
   662
        currentdefaultprofile = -1;
hgs
parents: 36
diff changeset
   663
    if(dminfo->DeleteProfile(currentselecteditem) >=0 )
hgs
parents: 36
diff changeset
   664
        {
hgs
parents: 36
diff changeset
   665
    //Update the profile list
hgs
parents: 36
diff changeset
   666
    model->removeRow(currentselecteditem);
hgs
parents: 36
diff changeset
   667
        }
hgs
parents: 36
diff changeset
   668
    dminfo->DisableDbNotifications(false);
hgs
parents: 36
diff changeset
   669
    }
hgs
parents: 36
diff changeset
   670
hgs
parents: 36
diff changeset
   671
void DmAdvancedView::connectMenuItemSelected()
hgs
parents: 36
diff changeset
   672
    {
hgs
parents: 36
diff changeset
   673
    dminfo->synchronize(currentselecteditem);
hgs
parents: 36
diff changeset
   674
    connectionRequested = true;
hgs
parents: 36
diff changeset
   675
    }
hgs
parents: 36
diff changeset
   676