QTfrontend/hwform.cpp
changeset 8434 4821897a0f10
parent 8424 225ede46e3dc
child 8436 b89aacebb9db
equal deleted inserted replaced
8432:f2d57e987ba9 8434:4821897a0f10
   590 void HWForm::OnPageShown(quint8 id, quint8 lastid)
   590 void HWForm::OnPageShown(quint8 id, quint8 lastid)
   591 {
   591 {
   592 #ifdef USE_XFIRE
   592 #ifdef USE_XFIRE
   593     updateXfire();
   593     updateXfire();
   594 #endif
   594 #endif
   595     
   595 
   596     qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id)));
   596     qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id)));
   597 
   597 
   598     // pageEnter and pageLeave events
   598     // pageEnter and pageLeave events
   599     ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave();    
   599     ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave();
   600     ((AbstractPage*)ui.Pages->widget(id))->triggerPageEnter();
   600     ((AbstractPage*)ui.Pages->widget(id))->triggerPageEnter();
   601 
   601 
   602     if (id == ID_PAGE_DATADOWNLOAD)
   602     if (id == ID_PAGE_DATADOWNLOAD)
   603     {
   603     {
   604         ui.pageDataDownload->fetchList();
   604         ui.pageDataDownload->fetchList();
  1094     QString newNick = QInputDialog::getText(this, tr("Nickname"), tr("Someone already uses your nickname %1 on the server.\nPlease pick another nickname:").arg(nick), QLineEdit::Normal, nick, &ok);
  1094     QString newNick = QInputDialog::getText(this, tr("Nickname"), tr("Someone already uses your nickname %1 on the server.\nPlease pick another nickname:").arg(nick), QLineEdit::Normal, nick, &ok);
  1095 
  1095 
  1096     if (!ok || newNick.isEmpty())
  1096     if (!ok || newNick.isEmpty())
  1097     {
  1097     {
  1098         //ForcedDisconnect(tr("No nickname supplied."));
  1098         //ForcedDisconnect(tr("No nickname supplied."));
  1099 	bool retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied."));
  1099     bool retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied."));
  1100 	GoBack();
  1100     GoBack();
  1101         if (retry) {
  1101         if (retry) {
  1102        	   NetConnectOfficialServer();
  1102             NetConnectOfficialServer();
  1103         }
  1103         }
  1104         return;
  1104         return;
  1105     }
  1105     }
  1106 
  1106 
  1107     hwnet->NewNick(newNick);
  1107     hwnet->NewNick(newNick);
  1488         if (retry) {
  1488         if (retry) {
  1489             NetConnectOfficialServer();
  1489             NetConnectOfficialServer();
  1490         }
  1490         }
  1491         else {
  1491         else {
  1492             while (ui.Pages->currentIndex() != ID_PAGE_NET
  1492             while (ui.Pages->currentIndex() != ID_PAGE_NET
  1493                 && ui.Pages->currentIndex() != ID_PAGE_MAIN) 
  1493                 && ui.Pages->currentIndex() != ID_PAGE_MAIN)
  1494             {
  1494             {
  1495                 GoBack();
  1495                 GoBack();
  1496             }
  1496             }
  1497         }
  1497         }
  1498         return;
  1498         return;
  1925     }
  1925     }
  1926     else
  1926     else
  1927         MessageDialog::ShowErrorMessage(QMessageBox::tr("File association failed."), this);
  1927         MessageDialog::ShowErrorMessage(QMessageBox::tr("File association failed."), this);
  1928 }
  1928 }
  1929 
  1929 
  1930 void HWForm::openRegistrationPage() 
  1930 void HWForm::openRegistrationPage()
  1931 {
  1931 {
  1932     QDesktopServices::openUrl(QUrl("http://www.hedgewars.org/user/register"));
  1932     QDesktopServices::openUrl(QUrl("http://www.hedgewars.org/user/register"));
  1933 }    
  1933 }
  1934 
  1934 
  1935 void HWForm::saveDemoWithCustomName()
  1935 void HWForm::saveDemoWithCustomName()
  1936 {
  1936 {
  1937     if(!m_lastDemo.isEmpty())
  1937     if(!m_lastDemo.isEmpty())
  1938     {
  1938     {