163 pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_INFO); |
163 pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_INFO); |
164 |
164 |
165 connect(ui.pageMain->BtnDataDownload, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
165 connect(ui.pageMain->BtnDataDownload, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
166 pageSwitchMapper->setMapping(ui.pageMain->BtnDataDownload, ID_PAGE_DATADOWNLOAD); |
166 pageSwitchMapper->setMapping(ui.pageMain->BtnDataDownload, ID_PAGE_DATADOWNLOAD); |
167 |
167 |
168 connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed())); |
168 //connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed())); |
169 connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked())); |
169 //connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked())); |
170 |
170 |
171 connect(ui.pageEditTeam, SIGNAL(teamEdited()), this, SLOT(AfterTeamEdit())); |
171 connect(ui.pageEditTeam, SIGNAL(teamEdited()), this, SLOT(AfterTeamEdit())); |
172 |
172 |
173 connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame())); |
173 connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame())); |
174 connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)), |
174 connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)), |
184 connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo())); |
184 connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo())); |
185 |
185 |
186 connect(ui.pageOptions, SIGNAL(newTeamRequested()), this, SLOT(NewTeam())); |
186 connect(ui.pageOptions, SIGNAL(newTeamRequested()), this, SLOT(NewTeam())); |
187 connect(ui.pageOptions, SIGNAL(editTeamRequested(const QString&)), this, SLOT(EditTeam(const QString&))); |
187 connect(ui.pageOptions, SIGNAL(editTeamRequested(const QString&)), this, SLOT(EditTeam(const QString&))); |
188 connect(ui.pageOptions, SIGNAL(deleteTeamRequested(const QString&)), this, SLOT(DeleteTeam(const QString&))); |
188 connect(ui.pageOptions, SIGNAL(deleteTeamRequested(const QString&)), this, SLOT(DeleteTeam(const QString&))); |
189 connect(ui.pageOptions->BtnSaveOptions, SIGNAL(clicked()), config, SLOT(SaveOptions())); |
189 connect(ui.pageOptions->btnSave, SIGNAL(clicked()), config, SLOT(SaveOptions())); |
190 connect(ui.pageOptions->BtnSaveOptions, SIGNAL(clicked()), this, SLOT(GoBack())); |
190 connect(ui.pageOptions->btnSave, SIGNAL(clicked()), this, SLOT(GoBack())); |
191 connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles())); |
191 connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles())); |
192 |
192 |
193 connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon())); |
193 connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon())); |
194 connect(ui.pageOptions->WeaponNew, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
194 connect(ui.pageOptions->WeaponNew, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
195 connect(ui.pageOptions->WeaponDelete, SIGNAL(clicked()), this, SLOT(DeleteWeaponSet())); |
195 connect(ui.pageOptions->WeaponDelete, SIGNAL(clicked()), this, SLOT(DeleteWeaponSet())); |
531 ui.Pages->setCurrentIndex(id); |
531 ui.Pages->setCurrentIndex(id); |
532 } |
532 } |
533 |
533 |
534 void HWForm::GoBack() |
534 void HWForm::GoBack() |
535 { |
535 { |
|
536 int curid = ui.Pages->currentIndex(); |
|
537 if (curid == ID_PAGE_MAIN) |
|
538 exit(); |
|
539 |
536 int id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop(); |
540 int id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop(); |
537 int curid = ui.Pages->currentIndex(); |
|
538 ui.Pages->setCurrentIndex(id); |
541 ui.Pages->setCurrentIndex(id); |
539 OnPageShown(id, curid); |
542 OnPageShown(id, curid); |
540 |
543 |
541 if (id == ID_PAGE_CONNECTING) |
544 if (id == ID_PAGE_CONNECTING) |
542 GoBack(); |
545 GoBack(); |
567 void HWForm::btnExitPressed() |
570 void HWForm::btnExitPressed() |
568 { |
571 { |
569 eggTimer.start(); |
572 eggTimer.start(); |
570 } |
573 } |
571 |
574 |
572 void HWForm::btnExitClicked() |
575 void HWForm::exit() |
573 { |
576 { |
574 if (eggTimer.elapsed() < 3000){ |
577 // if (eggTimer.elapsed() < 3000){ |
575 #ifdef __APPLE__ |
578 #ifdef __APPLE__ |
576 panel->showInstallController(); |
579 panel->showInstallController(); |
577 #endif |
580 #endif |
578 close(); |
581 close(); |
579 } |
582 // TODO reactivate egg |
|
583 /* } |
580 else |
584 else |
581 { |
585 { |
582 QPushButton * btn = findChild<QPushButton *>("imageButt"); |
586 QPushButton * btn = findChild<QPushButton *>("imageButt"); |
583 if (btn) |
587 if (btn) |
584 { |
588 { |
585 btn->setIcon(QIcon(":/res/bonus.png")); |
589 btn->setIcon(QIcon(":/res/bonus.png")); |
586 } |
590 } |
587 } |
591 } */ |
588 } |
592 } |
589 |
593 |
590 void HWForm::IntermediateSetup() |
594 void HWForm::IntermediateSetup() |
591 { |
595 { |
592 quint8 id=ui.Pages->currentIndex(); |
596 quint8 id=ui.Pages->currentIndex(); |