deviceupdatesui/deviceupdates/src/serversettingsview.cpp
changeset 67 fdbfe0a95492
parent 49 c34c36d1c835
equal deleted inserted replaced
62:03849bd79877 67:fdbfe0a95492
   145             sessionmode->contentWidgetData(QString("text")).toString();
   145             sessionmode->contentWidgetData(QString("text")).toString();
   146     bool netauthval = false;
   146     bool netauthval = false;
   147     if (netauthdata.compare(hbTrId("txt_deviceupdate_setlabel_network_auth_val_yes")))
   147     if (netauthdata.compare(hbTrId("txt_deviceupdate_setlabel_network_auth_val_yes")))
   148         netauthval = true;
   148         netauthval = true;
   149     //check server name , server id, host addr & usrname        
   149     //check server name , server id, host addr & usrname        
       
   150     itemlist[0]=itemlist[0].simplified();
       
   151     itemlist[1]=itemlist[1].simplified();
       
   152     itemlist[3]=itemlist[3].simplified();
       
   153     itemlist[4]=itemlist[4].simplified();
   150     if ((itemlist[0].length() > 0) && (itemlist[1].length() > 0)
   154     if ((itemlist[0].length() > 0) && (itemlist[1].length() > 0)
   151             && (itemlist[3].length() > 0) && (itemlist[4].length() > 0))
   155             && (itemlist[3].length() > 0) && (itemlist[4].length() > 0))
   152         {
   156         {
   153         serversView->saveProfile(itemlist, sessmode, curriap, iPort,
   157         serversView->saveProfile(itemlist, sessmode, curriap, iPort,
   154                 netauthval);        
   158                 netauthval);        
   172                 valSet=1;
   176                 valSet=1;
   173                 break;
   177                 break;
   174                 }
   178                 }
   175             }
   179             }
   176         if(valSet==1)
   180         if(valSet==1)
   177             {
   181             {                
   178         HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   182         HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
       
   183         note->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No);
       
   184         note->setAttribute( Qt::WA_DeleteOnClose); 
   179         note->setText(hbTrId(
   185         note->setText(hbTrId(
   180                 "txt_device_update_dialog_enter_mandatory_field_values"));
   186                   "txt_device_update_info_mandatory_fields_not_filled"));       
   181         note->setAttribute( Qt::WA_DeleteOnClose);         
   187         note->setTimeout(HbMessageBox::NoTimeout);
   182         note->setTimeout(HbPopup::NoTimeout);
   188         note->open(this,SLOT(onDialogClosed(int)));
   183         note->open();
       
   184             }
   189             }
   185         else
   190         else
   186             {
   191             {
   187             form->removeConnection(accesspoint,SIGNAL(currentIndexChanged (int ) ), this,SLOT(accessPointItemChanged(int)));
   192             form->removeConnection(accesspoint,SIGNAL(currentIndexChanged (int ) ), this,SLOT(accessPointItemChanged(int)));
   188             iMainWindow->setCurrentView(serversView);
   193             iMainWindow->setCurrentView(serversView);
   191             dataformmodel->clear();   
   196             dataformmodel->clear();   
   192             }
   197             }
   193         
   198         
   194         }        
   199         }        
   195     }
   200     }
       
   201 void ServerSettingsView::onDialogClosed(int action)
       
   202 {
       
   203     if (action == HbMessageBox::Yes)
       
   204     {
       
   205        iMainWindow->setCurrentView(serversView);
       
   206     } 
       
   207 }
   196 
   208 
   197 void ServerSettingsView::checkServerIdvalue()
   209 void ServerSettingsView::checkServerIdvalue()
   198     {
   210     {
   199     QString srvid = serverid->contentWidgetData(QString("text")).toString();
   211     QString srvid = serverid->contentWidgetData(QString("text")).toString();
       
   212     if(srvid != NULL)
       
   213     {
   200     if(serversView->checkServerId(srvid))
   214     if(serversView->checkServerId(srvid))
   201         {
   215         {
   202     serverid->setContentWidgetData(QString("text"), QString("")); 
   216     serverid->setContentWidgetData(QString("text"), QString("")); 
   203     HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
   217     HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
   204            note->setText(hbTrId("txt_device_update_dialog_invalid_server_id")); 
   218            note->setText(hbTrId("txt_device_update_title_duplicate_server_id"));
   205            note->setAttribute( Qt::WA_DeleteOnClose);                   
   219            note->setAttribute( Qt::WA_DeleteOnClose);                   
   206            note->setTimeout(HbPopup::NoTimeout);
   220            note->setTimeout(HbPopup::NoTimeout);
   207            note->open();         
   221            note->open();         
       
   222         }
   208         }          
   223         }          
   209     }
   224     }
   210 
   225 
   211 void ServerSettingsView::setBackButtonBehavior()
   226 void ServerSettingsView::setBackButtonBehavior()
   212     {    
   227     {