settings = new Settings;
settings->hide();
+ //load preset dialog
+ loadPresetDialog = new LoadPreset;
+ loadPresetDialog->hide();
+
init();
//applies the settings from the settings dialog
connect(ui->sr_box, SIGNAL(clicked()), this, SLOT(setSmartReflex()));
connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(save()));
- connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(loadPreset()));
+ connect(ui->actionLoad, SIGNAL(triggered()), loadPresetDialog, SLOT(show()));
connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
connect(settings, SIGNAL(settingsChanged()), this, SLOT(applySettings()));
+ connect(loadPresetDialog, SIGNAL(load(QString)), this, SLOT(loadPreset(QString)));
}
MainWindow::~MainWindow()
{
+ delete loadPresetDialog;
delete settings;
delete ui;
}
* - starving
* - custom -> any preset named "custom"
*/
-void MainWindow::loadPreset()
+void MainWindow::loadPreset(QString presetName)
{
- return;
+ callHelper("loadpreset", presetName);
+ #if defined(Q_WS_MAEMO_5)
+ QMaemo5InformationBox::information(this, tr( "The preset was loaded." ), QMaemo5InformationBox::DefaultTimeout);
+ #endif
}
{
#if defined(Q_WS_MAEMO_5)
setAttribute(Qt::WA_Maemo5AutoOrientation, settings->useAutoRotate());
+ loadPresetDialog->setAttribute(Qt::WA_Maemo5AutoOrientation, settings->useAutoRotate());
settings->setAttribute(Qt::WA_Maemo5AutoOrientation, settings->useAutoRotate());
#endif
}