deviceupdatesui/deviceupdates/src/serversettingsview.cpp
author hgs
Tue, 13 Jul 2010 03:42:03 +0530
changeset 43 88e14c3d4c4f
parent 38 2d078e09a2f4
child 47 d316aecb87fd
permissions -rw-r--r--
201019
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);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    34
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    35
ServerSettingsView::~ServerSettingsView()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    36
    {
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
void ServerSettingsView::constructview(QString& header)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    41
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    42
    if(!form)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    43
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    44
        //custom prototype    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    45
        form = new HbDataForm();
37
hgs
parents: 36
diff changeset
    46
        QList <HbAbstractViewItem*> protos = form->itemPrototypes();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    47
        customPrototype = new SettingsDataFormCustomItem(form);
37
hgs
parents: 36
diff changeset
    48
        protos.append(customPrototype);
hgs
parents: 36
diff changeset
    49
        form->setItemPrototypes(protos);
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    50
        dataformmodel =  new HbDataFormModel();    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    51
        makeviewItemsVisible(header);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    52
        form->setModel(dataformmodel); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    53
        setWidget(form);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    54
        iMainWindow->addView(this);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    55
        }    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    56
    else //form already created
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    57
        {   
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
int ServerSettingsView::setProfileValues(QStringList& settingdatalist,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    62
				bool& sessiontype, QStringList& apdata, int& currentap
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    63
        					   ,  int& portnum, bool& networkauthval)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    64
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    65
    Q_UNUSED(sessiontype);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    66
    Q_UNUSED(networkauthval);	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    67
    int count =  settingdatalist.count();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    68
    apnameslist = apdata;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    69
    if(count > 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    70
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    71
        servername->setContentWidgetData(QString("text"), settingdatalist.first());
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    72
        serverid->setContentWidgetData(QString("text"), settingdatalist[1]);         
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    73
        serverpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    74
        serverpwd->setContentWidgetData(QString("text"), settingdatalist[2]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    75
        QStringList sList;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    76
        sList <<hbTrId("txt_device_update_button_internet");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    77
        sList<<hbTrId("txt_device_update_button_bluetooth");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    78
        sessionmode->setContentWidgetData(QString("text"), sList[0]);//Internet selected
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    79
        sessionmode->setContentWidgetData(QString("additionalText"), sList[1]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    80
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    81
        apdata.append(hbTrId("txt_device_update_setlabel_access_point_val_defaul"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    82
        accesspoint->setContentWidgetData(QString("items"), apdata);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    83
        currentiapindex = currentap;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    84
        if(currentap >= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    85
        accesspoint->setContentWidgetData(QString("currentIndex"), currentap); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    86
        else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    87
            accesspoint->setContentWidgetData(QString("currentIndex"), apdata.count()-1); 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    88
        form->addConnection(accesspoint, SIGNAL(currentIndexChanged  (int  ) ),this, SLOT(accessPointItemChanged(int)));                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    89
        hostaddress->setContentWidgetData(QString("text"),settingdatalist[3]);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    90
        port->setContentWidgetData(QString("text"),portnum);//Integer only setting needs to be done                   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    91
        username->setContentWidgetData(QString("text"),settingdatalist[4]);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    92
        userpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    93
        userpwd->setContentWidgetData(QString("text"),settingdatalist[5]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    94
        QStringList yesnoList;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    95
        yesnoList <<hbTrId("txt_device_update_button_yes");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    96
        yesnoList<<hbTrId("txt_device_update_button_no");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    97
        networkauth->setContentWidgetData(QString("text"), yesnoList[0]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    98
        networkauth->setContentWidgetData(QString("additionalText"), yesnoList[1]);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    99
        networkusername->setContentWidgetData(QString("text"),settingdatalist[6]);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   100
        networkpwd->setContentWidgetData(QString("echoMode"),HbLineEdit::Password );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   101
        networkpwd->setContentWidgetData(QString("text"),settingdatalist[7]);                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   102
        return 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   103
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   104
    else 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   105
        return -1;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   106
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   107
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   108
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   109
void ServerSettingsView::backButtonClicked()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   110
    {   
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   111
    qDebug("OMADM server settings back button clicked");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   112
    //Trigger main view
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   113
    //Send data back to servers view and save the profile
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   114
    QStringList itemlist;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   115
    itemlist << servername->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   116
    itemlist << serverid->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   117
    itemlist << serverpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   118
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   119
    itemlist << hostaddress->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   120
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   121
    itemlist << username->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   122
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   123
    itemlist << userpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   124
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   125
    itemlist
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   126
            << networkusername->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   127
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   128
    itemlist << networkpwd->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   129
    QString sesstype =
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   130
            sessionmode->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   131
    bool sessmode = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   132
    if (sesstype.compare("Internet"))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   133
        sessmode = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   134
    //Map this current iap with iap array
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   135
    QString curriap;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   136
    if (currentiapindex >= 0 && currentiapindex < apnameslist.count())
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   137
        curriap = apnameslist[currentiapindex];//accesspoint->contentWidgetData(QString("currentText")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   138
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   139
        curriap.clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   140
    unsigned int portval = port->contentWidgetData(QString("text")).toInt();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   141
    QString netauthdata =
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   142
            sessionmode->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   143
    bool netauthval = false;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   144
    if (netauthdata.compare("yes"))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   145
        netauthval = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   146
    //check server name , server id, host addr & usrname        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   147
    if ((itemlist[0].length() > 0) && (itemlist[1].length() > 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   148
            && (itemlist[3].length() > 0) && (itemlist[4].length() > 0))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   149
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   150
        serversView->saveProfile(itemlist, sessmode, curriap, portval,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   151
                netauthval);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   152
        qDebug("omadm before crash");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   153
        form->removeConnection(accesspoint,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   154
                SIGNAL(currentIndexChanged (int ) ), this,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   155
                SLOT(accessPointItemChanged(int)));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   156
        qDebug("omadm after crash");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   157
        iMainWindow->setCurrentView(serversView);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   158
        //Form wk08 soft key owned by view
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   159
        //iMainWindow->removeSoftKeyAction(Hb::SecondarySoftKey,backaction);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   160
        dataformmodel->clear();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   161
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   162
    else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   163
        {
38
hgs
parents: 37
diff changeset
   164
        HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents: 37
diff changeset
   165
        note->setText(hbTrId(
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   166
                "txt_device_update_dialog_enter_mandatory_field_values"));
38
hgs
parents: 37
diff changeset
   167
        note->setAttribute( Qt::WA_DeleteOnClose);         
hgs
parents: 37
diff changeset
   168
        note->setTimeout(HbPopup::NoTimeout);
hgs
parents: 37
diff changeset
   169
        note->open();
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   170
        }        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   171
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   172
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   173
void ServerSettingsView::checkServerIdvalue()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   174
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   175
    QString srvid = serverid->contentWidgetData(QString("text")).toString();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   176
    if(serversView->checkServerId(srvid))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   177
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   178
    serverid->setContentWidgetData(QString("text"), QString("")); 
38
hgs
parents: 37
diff changeset
   179
    HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents: 37
diff changeset
   180
           note->setText(hbTrId("txt_device_update_dialog_invalid_server_id")); 
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();         
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   184
        }          
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   185
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   186
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   187
void ServerSettingsView::setBackButtonBehavior()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   188
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   189
    if (!backbehaviorset)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   190
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   191
        qDebug("OMADM server settings view back behavior setting");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   192
        backaction = new HbAction(Hb::BackNaviAction, this);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   193
        connect(backaction, SIGNAL(triggered()), this,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   194
                SLOT(backButtonClicked()));                
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   195
        setNavigationAction(backaction);        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   196
        backbehaviorset = true;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   197
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   198
    qDebug("OMADM server settings view back behavior setting done");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   199
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   200
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   201
void ServerSettingsView::makeviewItemsVisible(QString& formtitle)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   202
    {    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   203
    setBackButtonBehavior();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   204
    form->setHeading(hbTrId("txt_device_update_subhead_advanced_device_updates"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   205
    form->setDescription(formtitle);    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   206
    if(dataformmodel->rowCount() <= 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   207
        {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   208
        QString itemname(hbTrId("txt_device_update_formlabel_server_name"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   209
        servername = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   210
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   211
        itemname = hbTrId("txt_device_update_formlabel_server_id");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   212
        serverid = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   213
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   214
        form->addConnection(serverid, SIGNAL(editingFinished ()), 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   215
                this, SLOT(checkServerIdvalue()));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   216
        itemname = hbTrId("txt_device_update_formlabel_server_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   217
        serverpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   218
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   219
        itemname = hbTrId("txt_device_update_setlabel_session_mode");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   220
        sessionmode = dataformmodel->appendDataFormItem(HbDataFormModelItem::ToggleValueItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   221
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   222
        itemname = hbTrId("txt_device_update_setlabel_access_point");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   223
        accesspoint = dataformmodel->appendDataFormItem(HbDataFormModelItem::ComboBoxItem , itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   224
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   225
        itemname = hbTrId("txt_device_update_formlabel_host_address");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   226
        hostaddress = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   227
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   228
        itemname = hbTrId("txt_device_update_formlabel_port");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   229
        port = dataformmodel->appendDataFormItem(HbDataFormModelItem::CustomItemBase, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   230
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   231
        itemname = hbTrId("txt_device_update_formlabel_user_name");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   232
        username = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   233
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   234
        itemname = hbTrId("txt_device_update_formlabel_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   235
        userpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   236
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   237
        itemname = hbTrId("txt_device_update_setlabel_network_authentication");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   238
        networkauth = dataformmodel->appendDataFormItem(HbDataFormModelItem::ToggleValueItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   239
        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   240
        itemname = hbTrId("txt_device_update_formlabel_network_user_name");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   241
        networkusername = 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_formlabel_network_password");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   244
        networkpwd = dataformmodel->appendDataFormItem(HbDataFormModelItem::TextItem, itemname);
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   245
        }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   246
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   247
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   248
void ServerSettingsView::accessPointItemChanged(int apindex)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   249
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   250
    currentiapindex = apindex;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   251
    qDebug("omadm iap changed");        
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   252
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   253