Esempio n. 1
0
void settings_frame::handleExit() {
  if (settingsChangedAbstract())
  {
    int action = customMessageBox(SS_MAIN_ICON,_("Save Spring settings before exiting?"), _("Confirmation needed"),wxYES_NO|wxCANCEL|wxICON_QUESTION );
    switch (action) {
      case wxYES:
        if (saveSettingsAbstract())
               (abstract_panel::settingsChanged) = false;
        if (simpleTab!=0)
            simpleTab->saveCbxChoices();
      case wxNO:
        doQuit();
        return;

      case wxCANCEL:
      default:
        return;
    }
  }
  else
  {
    doQuit();
    return;
  }
}
Esempio n. 2
0
void settings_frame::handleExternExit()
{
	if ( !alreadyCalled){
		alreadyCalled = true;
		if (settingsChangedAbstract())
		{
			int choice = customMessageBox(SS_MAIN_ICON,_("Save Spring settings before exiting?"), _("Confirmation needed"), wxYES|wxNO |wxICON_QUESTION);
			if ( choice == wxYES)
			{
				saveSettingsAbstract();
				if (simpleTab!=0)
					simpleTab->saveCbxChoices();
			}
		}
	}

	sett().SaveSettings();
}
Esempio n. 3
0
void settings_frame::OnMenuChoice(wxCommandEvent& event)
{
	switch (event.GetId()) {
		case ID_MENUITEM_SAVE:
			if (saveSettingsAbstract())
				(abstract_panel::settingsChanged) = false;
			if (simpleTab != 0)
				simpleTab->saveCbxChoices();
			break;

		case ID_MENUITEM_QUIT:
			handleExit();
			break;

		case ID_MENUITEM_RESET:
			if ((customMessageBox(SS_MAIN_ICON, _("Reset ALL settings to default values?"), _("Confirmation needed"), wxYES_NO | wxCANCEL)) == wxYES) {
				resetSettings();
			}
			break;

		case ID_MENUITEM_SIMPLE:
			if (sett().getMode() == SET_MODE_EXPERT) {
				sett().setMode(SET_MODE_SIMPLE);

				simpleTab = new tab_simple(this, notebook, ID_SIMPLE);
				notebook->InsertPage(0, simpleTab, simpleTabCap);
				simpleTab->updateControls(UPDATE_ALL);

				//if not on ui page goto simple
				if (notebook->GetSelection() != 1) {
					notebook->SetSelection(0);
				}
				for (int i = notebook->GetPageCount() - 1; i > 1; i--) { //delete all pages expect page 0 + 1
					notebook->DeletePage(i);
				}
				qualityTab = 0;
				detailTab = 0;
				audioTab = 0;
				//				hotkeyTab = 0;
				SetTitle(TowxString(getSpringlobbyName()) + _("(simple mode)"));
				if (!sett().getDisableWarning()) {
					customMessageBox(SS_MAIN_ICON, expertModeWarning, _("Hint"), wxOK);
				}
			}
			break;

		case ID_MENUITEM_EXPERT:
			if (sett().getMode() == SET_MODE_SIMPLE) {
				switchToExpertMode();
			}
			break;
		case ID_MENUITEM_DISABLE_WARN:
			sett().setDisableWarning(menuFile->IsChecked(ID_MENUITEM_DISABLE_WARN));
			break;

		case ID_MENUITEM_ABOUT:
			aboutbox().Show();
			break;
		case ID_MENUITEM_CONTACT:
			aboutbox().openContactPage();
			break;
		case ID_MENUITEM_BUGREPORT:
			aboutbox().openNewTicket();
			break;
	}
}