void SettingsDialog::saveSettings() {
  QSettings settings(QSettings::IniFormat, QSettings::UserScope,
                     Organization, ProjectName);

  on_pb_check_clicked();

  settings.setValue("OCR/program", ln_prog->text());
  settings.setValue("OCR/version", lbl_VERSION->text());
  settings.setValue("OCR/prefix", ln_prefix->text());
  settings.setValue("OCR/sys_prefix", cb_prefix->isChecked());

  emit configuration_changed();
  emit accept();
}
/**
	\class MainWindows
	\brief Main Window for QtSmbstatus Client et Light
	\date 2008-11-16
	\version 2.1
	\author Daniel Rocher
 */
MainWindows::MainWindows(QWidget *parent) : QMainWindow(parent)
{
	debugQt("MainWindows::MainWindows()");
	setupUi(this);
	if (check_new_release) checkForUpdateOfQtSmbstatus();

	msgError=new QErrorMessage(this); // an error message display dialog

	trayicon =new QSystemTrayIcon(QIcon (":/icons/qtsmbstatus.png"),this);
	menuApp=new QMenu( this );
	viewlog_action=menuApp->addAction ( tr("Show CIFS/SMB activities") );
	connect(viewlog_action,SIGNAL( triggered ()),this , SLOT(on_action_View_log_triggered()));
	configure_action= menuApp->addAction ( QIcon (":/icons/configure.png"),tr("Configure") );
	connect(configure_action,SIGNAL( triggered ()),this , SLOT(on_configureAction_triggered()));
	menuApp->addSeparator ();
	restore_action=menuApp->addAction (tr("Minimize") );
	connect(restore_action,SIGNAL( triggered ()),this , SLOT(restore_minimize()));
	QAction * exit_action=menuApp->addAction (  QIcon (":/icons/exit.png"),tr("Quit") );
	connect(exit_action,SIGNAL( triggered ()),this , SLOT(beforeQuit () ));
	connect(action_Quit,SIGNAL( triggered ()),this , SLOT(beforeQuit () ));

	trayicon->setContextMenu ( menuApp );
	connect(trayicon,SIGNAL(activated ( QSystemTrayIcon::ActivationReason ) ),this,SLOT(trayicon_activated(QSystemTrayIcon::ActivationReason)));
	restoreWindowSize();

	// create statusBar
	statusBar()->showMessage (""); //status bar

	smbstatus_rq_started=false;

	// treeWidget
	treeWidget->setSortingEnabled ( true );
	treeWidget->setRootIsDecorated ( false );
	treeWidget->setHeaderLabel ( "");
	treeWidget->setContextMenuPolicy (Qt::CustomContextMenu );
	// create popup menu
	menuPopup = new QMenu( treeWidget );
	connect(treeWidget, SIGNAL( customContextMenuRequested ( const QPoint & ) ), this, SLOT( slotPopupMenu( const QPoint & ) ) );

		// first time
	configuration_changed();

	// form view CIFS/SMB activities
	logform = new LogForm(this);
	connect(this ,SIGNAL(refreshviewlog(const type_message &)), logform,SLOT(append(const type_message &)));

	connect(&timerinfoSmb, SIGNAL(timeout()), this, SLOT(InfoSMB()));
	connect(&timerSmbRequest, SIGNAL(timeout()), this, SLOT(slot_timer()));
}
void MainWindow::on_actionConfiguration_triggered() {
  runSettingsDialog = new SettingsDialog(this);
  connect(runSettingsDialog,
        SIGNAL(configuration_changed()), this, SLOT(feature_limits()));
  runSettingsDialog->exec();
}