QTfrontend/hwform.cpp
changeset 350 c3ccec3834e8
parent 347 6521e1b2cd40
child 352 4665bfe25470
equal deleted inserted replaced
349:5b37d6a39829 350:c3ccec3834e8
   178 	ui.Pages->setCurrentIndex(id);
   178 	ui.Pages->setCurrentIndex(id);
   179 }
   179 }
   180 
   180 
   181 void HWForm::GoBack()
   181 void HWForm::GoBack()
   182 {
   182 {
       
   183 	if (!PagesStack.isEmpty() && PagesStack.top() == ID_PAGE_NET) {
       
   184 	  NetDisconnect();
       
   185 	}
   183 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   186 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   184 	OnPageShown(id);
   187 	OnPageShown(id);
   185 	ui.Pages->setCurrentIndex(id);
   188 	ui.Pages->setCurrentIndex(id);
   186 }
   189 }
   187 
   190 
   278 }
   281 }
   279 
   282 
   280 void HWForm::NetDisconnect()
   283 void HWForm::NetDisconnect()
   281 {
   284 {
   282   hwnet->Disconnect();
   285   hwnet->Disconnect();
   283   GoBack();
       
   284   delete hwnet;
   286   delete hwnet;
   285   hwnet=0;
   287   hwnet=0;
   286   if(pnetserver) {
   288   if(pnetserver) {
   287     pnetserver->StopServer();
   289     pnetserver->StopServer();
   288     delete pnetserver;
   290     delete pnetserver;