deviceupdatesui/deviceupdates/src/serversettingsview.cpp
author hgs
Tue, 13 Jul 2010 04:01:20 +0530
changeset 47 d316aecb87fd
parent 38 2d078e09a2f4
child 49 c34c36d1c835
permissions -rw-r--r--
201025_02
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
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     3
* All rights reserved.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     8
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     9
* Initial Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    11
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    12
* Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    13
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    14
* Description:  Methods for ServerSettingsView
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    15
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    16
*/
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    17
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    18
#include <hblineedit.h>
36
hgs
parents: 33
diff changeset
    19
#include <hbmessagebox.h>
38
hgs
parents: 37
diff changeset
    20
#include <hbnamespace.h>
36
hgs
parents: 33
diff changeset
    21
#include "serversettingsview.h"
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    22
#include "dmadvancedview.h"
36
hgs
parents: 33
diff changeset
    23
#include "settingsdataformcustomitem.h"
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    24
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    25
ServerSettingsView::ServerSettingsView(HbMainWindow* mainWindow, DmAdvancedView* serversview, QString& header, QGraphicsItem* parent): HbView(parent), iMainWindow(mainWindow),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    26
 form(NULL),dataformmodel(NULL),serversView(serversview),backbehaviorset(false)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    27
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    28
    constructview(header);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    29
    viewspecificmenu = new HbMenu();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    30
    help = viewspecificmenu->addAction(hbTrId("txt_common_menu_help"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    31
    exit = viewspecificmenu->addAction(hbTrId("txt_common_menu_exit"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    32
    connect(exit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()));    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    33
    setMenu(viewspecificmenu);
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
    34
    iPort = 0;
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    35
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    36
ServerSettingsView::~ServerSettingsView()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    37
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    38
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    39
    }  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    40
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    41
void ServerSettingsView::constructview(QString& header)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    42
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    43
    if(!form)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    44
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    45
        //custom prototype    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    46
        form = new HbDataForm();
37
hgs
parents: 36
diff changeset
    47
        QList <HbAbstractViewItem*> protos = form->itemPrototypes();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    48
        customPrototype = new SettingsDataFormCustomItem(form);
37
hgs
parents: 36
diff changeset
    49
        protos.append(customPrototype);
hgs
parents: 36
diff changeset
    50
        form->setItemPrototypes(protos);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    51
        dataformmodel =  new HbDataFormModel();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    52
        makeviewItemsVisible(header);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    53
        form->setModel(dataformmodel); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    54
        setWidget(form);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    55
        iMainWindow->addView(this);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    56
        }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    57
    else //form already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    58
        {   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    59
        }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    60
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    61
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    62
int ServerSettingsView::setProfileValues(QStringList& settingdatalist,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    63
				bool& sessiontype, QStringList& apdata, int& currentap
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    64
        					   ,  int& portnum, bool& networkauthval)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    65
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    66
    Q_UNUSED(sessiontype);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    67
    Q_UNUSED(networkauthval);	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    68
    int count =  settingdatalist.count();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    69
    apnameslist = apdata;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    70
    if(count > 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    71
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    72
        servername->setContentWidgetData(QString("text"), settingdatalist.first());
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    73
        serverid->setContentWidgetData(QString("text"), settingdatalist[1]);         
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    74
        serverpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    75
        serverpwd->setContentWidgetData(QString("text"), settingdatalist[2]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    76
        QStringList sList;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    77
        sList <<hbTrId("txt_device_update_button_internet");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    78
        sList<<hbTrId("txt_device_update_button_bluetooth");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    79
        sessionmode->setContentWidgetData(QString("text"), sList[0]);//Internet selected
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    80
        sessionmode->setContentWidgetData(QString("additionalText"), sList[1]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    81
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    82
        apdata.append(hbTrId("txt_device_update_setlabel_access_point_val_defaul"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    83
        accesspoint->setContentWidgetData(QString("items"), apdata);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    84
        currentiapindex = currentap;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    85
        if(currentap >= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    86
        accesspoint->setContentWidgetData(QString("currentIndex"), currentap); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    87
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    88
            accesspoint->setContentWidgetData(QString("currentIndex"), apdata.count()-1); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    89
        form->addConnection(accesspoint, SIGNAL(currentIndexChanged  (int  ) ),this, SLOT(accessPointItemChanged(int)));                
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
    90
        hostaddress->setContentWidgetData(QString("text"),settingdatalist[3]);  
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
    91
        iPort = portnum;
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
    92
        port->setContentWidgetData(QString("text"),iPort);//Integer only setting needs to be done    
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
    93
        form->addConnection(port, SIGNAL(textChanged  (QString) ),this, SLOT(portItemChanged(QString)));
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    94
        username->setContentWidgetData(QString("text"),settingdatalist[4]);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    95
        userpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    96
        userpwd->setContentWidgetData(QString("text"),settingdatalist[5]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    97
        QStringList yesnoList;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    98
        yesnoList <<hbTrId("txt_device_update_button_yes");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    99
        yesnoList<<hbTrId("txt_device_update_button_no");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   100
        networkauth->setContentWidgetData(QString("text"), yesnoList[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   101
        networkauth->setContentWidgetData(QString("additionalText"), yesnoList[1]);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   102
        networkusername->setContentWidgetData(QString("text"),settingdatalist[6]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   103
        networkpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   104
        networkpwd->setContentWidgetData(QString("text"),settingdatalist[7]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   105
        return 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   106
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   107
    else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   108
        return -1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   109
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   110
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   111
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   112
void ServerSettingsView::backButtonClicked()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   113
    {   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   114
    qDebug("OMADM server settings back button clicked");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   115
    //Trigger main view
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   116
    //Send data back to servers view and save the profile
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   117
    QStringList itemlist;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   118
    itemlist << servername->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   119
    itemlist << serverid->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   120
    itemlist << serverpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   121
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   122
    itemlist << hostaddress->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   123
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   124
    itemlist << username->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   125
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   126
    itemlist << userpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   127
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   128
    itemlist
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   129
            << networkusername->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   130
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   131
    itemlist << networkpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   132
    QString sesstype =
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   133
            sessionmode->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   134
    bool sessmode = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   135
    if (sesstype.compare("Internet"))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   136
        sessmode = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   137
    //Map this current iap with iap array
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   138
    QString curriap;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   139
    if (currentiapindex >= 0 && currentiapindex < apnameslist.count())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   140
        curriap = apnameslist[currentiapindex];//accesspoint->contentWidgetData(QString("currentText")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   141
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   142
        curriap.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   143
    unsigned int portval = port->contentWidgetData(QString("text")).toInt();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   144
    QString netauthdata =
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   145
            sessionmode->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   146
    bool netauthval = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   147
    if (netauthdata.compare("yes"))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   148
        netauthval = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   149
    //check server name , server id, host addr & usrname        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   150
    if ((itemlist[0].length() > 0) && (itemlist[1].length() > 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   151
            && (itemlist[3].length() > 0) && (itemlist[4].length() > 0))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   152
        {
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   153
        serversView->saveProfile(itemlist, sessmode, curriap, iPort,
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   154
                netauthval);        
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   155
        form->removeConnection(accesspoint,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   156
                SIGNAL(currentIndexChanged (int ) ), this,
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   157
                SLOT(accessPointItemChanged(int)));        
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   158
        iMainWindow->setCurrentView(serversView);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   159
        //Form wk08 soft key owned by view
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   160
        //iMainWindow->removeSoftKeyAction(Hb::SecondarySoftKey,backaction);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   161
        dataformmodel->clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   162
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   163
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   164
        {
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   165
        TInt x = itemlist.count();
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   166
        TInt valSet=0;
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   167
        int i=0;
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   168
        for(i=0;i<x;i++)
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   169
            {
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   170
            if(itemlist[i].length()>0)
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   171
                {
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   172
                valSet=1;
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   173
                break;
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   174
                }
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   175
            }
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   176
        if(valSet==1)
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   177
            {
38
hgs
parents: 37
diff changeset
   178
        HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents: 37
diff changeset
   179
        note->setText(hbTrId(
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   180
                "txt_device_update_dialog_enter_mandatory_field_values"));
38
hgs
parents: 37
diff changeset
   181
        note->setAttribute( Qt::WA_DeleteOnClose);         
hgs
parents: 37
diff changeset
   182
        note->setTimeout(HbPopup::NoTimeout);
hgs
parents: 37
diff changeset
   183
        note->open();
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   184
            }
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   185
        else
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   186
            {
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   187
            form->removeConnection(accesspoint,SIGNAL(currentIndexChanged (int ) ), this,SLOT(accessPointItemChanged(int)));
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   188
            iMainWindow->setCurrentView(serversView);
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   189
        //Form wk08 soft key owned by view
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   190
        //iMainWindow->removeSoftKeyAction(Hb::SecondarySoftKey,backaction);
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   191
            dataformmodel->clear();   
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   192
            }
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   193
        
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   194
        }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   195
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   196
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   197
void ServerSettingsView::checkServerIdvalue()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   198
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   199
    QString srvid = serverid->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   200
    if(serversView->checkServerId(srvid))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   201
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   202
    serverid->setContentWidgetData(QString("text"), QString("")); 
38
hgs
parents: 37
diff changeset
   203
    HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents: 37
diff changeset
   204
           note->setText(hbTrId("txt_device_update_dialog_invalid_server_id")); 
hgs
parents: 37
diff changeset
   205
           note->setAttribute( Qt::WA_DeleteOnClose);                   
hgs
parents: 37
diff changeset
   206
           note->setTimeout(HbPopup::NoTimeout);
hgs
parents: 37
diff changeset
   207
           note->open();         
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   208
        }          
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   209
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   210
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   211
void ServerSettingsView::setBackButtonBehavior()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   212
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   213
    if (!backbehaviorset)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   214
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   215
        qDebug("OMADM server settings view back behavior setting");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   216
        backaction = new HbAction(Hb::BackNaviAction, this);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   217
        connect(backaction, SIGNAL(triggered()), this,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   218
                SLOT(backButtonClicked()));                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   219
        setNavigationAction(backaction);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   220
        backbehaviorset = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   221
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   222
    qDebug("OMADM server settings view back behavior setting done");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   223
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   224
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   225
void ServerSettingsView::makeviewItemsVisible(QString& formtitle)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   226
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   227
    setBackButtonBehavior();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   228
    form->setHeading(hbTrId("txt_device_update_subhead_advanced_device_updates"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   229
    form->setDescription(formtitle);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   230
    if(dataformmodel->rowCount() <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   231
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   232
        QString itemname(hbTrId("txt_device_update_formlabel_server_name"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   233
        servername = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   234
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   235
        itemname = hbTrId("txt_device_update_formlabel_server_id");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   236
        serverid = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   237
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   238
        form->addConnection(serverid, SIGNAL(editingFinished ()), 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   239
                this, SLOT(checkServerIdvalue()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   240
        itemname = hbTrId("txt_device_update_formlabel_server_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   241
        serverpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   242
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   243
        itemname = hbTrId("txt_device_update_setlabel_session_mode");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   244
        sessionmode = dataformmodel->appendDataFormItem(HbDataFormModelItem::ToggleValueItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   245
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   246
        itemname = hbTrId("txt_device_update_setlabel_access_point");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   247
        accesspoint = dataformmodel->appendDataFormItem(HbDataFormModelItem::ComboBoxItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   248
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   249
        itemname = hbTrId("txt_device_update_formlabel_host_address");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   250
        hostaddress = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   251
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   252
        itemname = hbTrId("txt_device_update_formlabel_port");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   253
        port = dataformmodel->appendDataFormItem(HbDataFormModelItem::CustomItemBase, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   254
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   255
        itemname = hbTrId("txt_device_update_formlabel_user_name");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   256
        username = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   257
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   258
        itemname = hbTrId("txt_device_update_formlabel_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   259
        userpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   260
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   261
        itemname = hbTrId("txt_device_update_setlabel_network_authentication");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   262
        networkauth = dataformmodel->appendDataFormItem(HbDataFormModelItem::ToggleValueItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   263
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   264
        itemname = hbTrId("txt_device_update_formlabel_network_user_name");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   265
        networkusername = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   266
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   267
        itemname = hbTrId("txt_device_update_formlabel_network_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   268
        networkpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   269
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   270
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   271
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   272
void ServerSettingsView::accessPointItemChanged(int apindex)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   273
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   274
    currentiapindex = apindex;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   275
    qDebug("omadm iap changed");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   276
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   277
47
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   278
void ServerSettingsView::portItemChanged(QString port)
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   279
    {    
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   280
    iPort = port.toInt();
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   281
    qDebug("omadm new port value is %d ",iPort);
d316aecb87fd 201025_02
hgs
parents: 38
diff changeset
   282
    }