Esempio n. 1
0
static state_t menuResetConfig(button_t button)
{
  if (button == BUTTON_ENTER)
  {
    lcd.clear();
    lcd.print(F("Reset Config?"));
    editInt = 0;
  }
  else if (isEditing && button == BUTTON_CENTER)
  {
    if (editInt)
      configReset();
    return ST_HOME_SMART;
  }

  return menuBooleanEdit(button, NULL, PSTR(" No  "), PSTR(" Yes "));
}
Esempio n. 2
0
static void _hFactoryReset()
{
	if (KEYINIT)
	{
		lcdSetPos(3, 18);
		lcdWriteString_P(strAreYouSure);
	}
	else if (KEY4)	// Yes
	{
		configReset();
		configSave();
		
		// force reset by enabling watchdog and enter endless loop
		cli();
		wdt_enable(WDTO_15MS);
		for(;;);
	}
}
Esempio n. 3
0
void Patcher::initMenu()
{
    //Fichier
    QMenu* menuFichier  = menuBar()->addMenu("&Fichier");
    ///Quitter

    ADD_ACTION(menuFichier,actionRun,("Lancer" + Config::softname).c_str());
    connect(actionRun, SIGNAL(triggered()),this, SLOT(runSoft()));
    actionRun->setShortcut(QKeySequence("Ctrl+Enter"));

    ADD_ACTION(menuFichier,actionQuitter,"&Quitter");
    connect(actionQuitter, SIGNAL(triggered()),this, SLOT(quit()));
    actionQuitter->setShortcut(QKeySequence("Ctrl+Q"));
    //actionQuitter->setIcon(QIcon("quitter.png"));

    //Edition
    QMenu* menuEdition  = menuBar()->addMenu("&Edition");
    //actionGras->setCheckable(true);

    ADD_MENU(menuEdition,menuConfiguration,"&Configuration");

    ADD_ACTION(menuConfiguration,actionConfigurationUrl,"Definir l'url du site");
    connect(actionConfigurationUrl,SIGNAL(triggered()),this,SLOT(configSetUrl()));

    ADD_ACTION(menuConfiguration,actionConfigurationMaj,"Lancer une Maj");
    connect(actionConfigurationMaj,SIGNAL(triggered()),this,SLOT(configMaj()));
    actionConfigurationMaj->setShortcut(QKeySequence("F5"));

    ADD_ACTION(menuConfiguration,actionConfigurationReset,"Reset");
    connect(actionConfigurationReset,SIGNAL(triggered()),this,SLOT(configReset()));
    actionConfigurationReset->setShortcut(QKeySequence("Ctrl+L"));

    //Aide
    QMenu* menuAide     = menuBar()->addMenu("&Aide");
    ///Version
    ADD_ACTION(menuAide,actionVersion,"&Version")
    connect(actionVersion, SIGNAL(triggered()),this, SLOT(showVersion()));
}