|
From: <tiz...@us...> - 2012-09-06 08:40:35
|
Revision: 328
http://sepiola.svn.sourceforge.net/sepiola/?rev=328&view=rev
Author: tizianomueller
Date: 2012-09-06 08:40:26 +0000 (Thu, 06 Sep 2012)
Log Message:
-----------
Add checkbox to enable debug output
- add checkbox
- move logDebugMessage setting from application to user settings to make it
configureable
Modified Paths:
--------------
trunk/src/gui/settings_form.cc
trunk/src/gui/settings_form.hh
trunk/src/gui/settings_form.ui
trunk/src/settings/settings.cc
trunk/src/settings/settings.hh
Modified: trunk/src/gui/settings_form.cc
===================================================================
--- trunk/src/gui/settings_form.cc 2012-09-04 15:17:00 UTC (rev 327)
+++ trunk/src/gui/settings_form.cc 2012-09-06 08:40:26 UTC (rev 328)
@@ -19,6 +19,7 @@
#include <QDebug>
#include "gui/settings_form.hh"
+#include "model/main_model.hh"
SettingsForm::SettingsForm( QWidget *parent, MainModel *model ) : QWidget( parent )
{
@@ -74,6 +75,7 @@
this->spinBoxNOfShownLastBackups->setValue( settings->getNOfLastBackups() );
this->checkBoxShowHiddenFiles->setChecked( settings->getShowHiddenFilesAndFolders() );
this->checkBoxKeepDeletedFiles->setChecked( !settings->getDeleteExtraneousItems() );
+ this->checkBoxVerboseLogging->setChecked( settings->getLogDebugMessages() );
this->comboBoxLanguage->clear();
for ( auto language: settings->getAvailableLanguages() )
@@ -94,6 +96,7 @@
settings->saveNOfLastBackups( this->spinBoxNOfShownLastBackups->value() );
settings->saveShowHiddenFilesAndFolders( this->checkBoxShowHiddenFiles->isChecked() );
settings->saveDeleteExtraneousItems( !this->checkBoxKeepDeletedFiles->isChecked() );
+ settings->saveLogDebugMessages( this->checkBoxVerboseLogging->isChecked() );
QMessageBox::information( this, tr( "Settings saved" ), tr( "Settings have been saved." ) );
emit updateOverviewFormLastBackupsInfo();
@@ -171,10 +174,17 @@
formChanged = true;
}
-void SettingsForm::on_checkBoxShowHiddenFiles_stateChanged( int state ) {
+void SettingsForm::on_checkBoxShowHiddenFiles_stateChanged( int state )
+{
formChanged = ((state==Qt::Checked) != Settings::getInstance()->getShowHiddenFilesAndFolders());
}
-void SettingsForm::on_checkBoxKeepDeletedFiles_stateChanged( int state ) {
+void SettingsForm::on_checkBoxKeepDeletedFiles_stateChanged( int state )
+{
formChanged = ((state==Qt::Checked) != (!Settings::getInstance()->getDeleteExtraneousItems()));
}
+
+void SettingsForm::on_checkBoxVerboseLogging_stateChanged( int state )
+{
+ formChanged = ((state==Qt::Checked) != (Settings::getInstance()->getLogDebugMessages()));
+}
Modified: trunk/src/gui/settings_form.hh
===================================================================
--- trunk/src/gui/settings_form.hh 2012-09-04 15:17:00 UTC (rev 327)
+++ trunk/src/gui/settings_form.hh 2012-09-06 08:40:26 UTC (rev 328)
@@ -25,7 +25,8 @@
#include "ui_settings_form.h"
-#include "model/main_model.hh"
+// forward declarations
+class MainModel;
/**
* The SettingsForm class is the form displaying the settings
@@ -68,6 +69,7 @@
void on_spinBoxNOfShownLastBackups_valueChanged( int i );
void on_checkBoxShowHiddenFiles_stateChanged( int state );
void on_checkBoxKeepDeletedFiles_stateChanged( int state );
+ void on_checkBoxVerboseLogging_stateChanged( int state );
};
#endif
Modified: trunk/src/gui/settings_form.ui
===================================================================
--- trunk/src/gui/settings_form.ui 2012-09-04 15:17:00 UTC (rev 327)
+++ trunk/src/gui/settings_form.ui 2012-09-06 08:40:26 UTC (rev 328)
@@ -461,6 +461,13 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxVerboseLogging">
+ <property name="text">
+ <string>Verbose logging</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
Modified: trunk/src/settings/settings.cc
===================================================================
--- trunk/src/settings/settings.cc 2012-09-04 15:17:00 UTC (rev 327)
+++ trunk/src/settings/settings.cc 2012-09-06 08:40:26 UTC (rev 328)
@@ -139,7 +139,7 @@
resellerSettings(0),
userSettings(0),
appData(0),
- logDebugMessage(true),
+ logDebugMessage(false),
effectiveUserId(0)
{
//TODO: load language name translations after setting the current langauge
@@ -223,7 +223,6 @@
privateOpenSshKeyFileName = applicationSettings->value( SETTINGS_PRIVATE_OPEN_SSH_KEY_FILE_NAME ).toString();
lockFileName = applicationSettings->value( SETTINGS_LOCK_FILE_NAME ).toString();
logFileName = applicationSettings->value( SETTINGS_LOG_FILE_NAME ).toString();
- logDebugMessage = applicationSettings->value( SETTINGS_LOG_DEBUG_MESSAGE ).toBool();
ignoreReinstall = applicationSettings->value( SETTINGS_IGNORE_REINSTALL ).toBool();
maxLogLines = applicationSettings->value( SETTINGS_MAX_LOG_LINES ).toInt();
includePatternFileName = applicationSettings->value( SETTINGS_INCLUDE_PATTERN_FILE_NAME ).toString();
@@ -304,6 +303,7 @@
showHiddenFilesAndFolders = userSettings->value( SETTINGS_SHOW_HIDDEN_FILES_AND_FOLDERS, false ).toBool();
windowSize = userSettings->value( SETTINGS_WINDOW_SIZE ).toSize();
windowPosition = userSettings->value( SETTINGS_WINDOW_POSITION, QPoint( 200, 200 ) ).toPoint();
+ logDebugMessage = userSettings->value( SETTINGS_LOG_DEBUG_MESSAGE ).toBool();
// [AppData]
appData->beginGroup( SETTINGS_GROUP_APPDATA );
@@ -962,4 +962,16 @@
return lastBackupRules;
}
+void Settings::saveLogDebugMessages(bool logDebugMessage)
+{
+ if (this->logDebugMessage != logDebugMessage)
+ {
+ this->logDebugMessage = logDebugMessage;
+ userSettings->setValue(SETTINGS_LOG_DEBUG_MESSAGE, logDebugMessage);
+ }
+}
+bool Settings::getLogDebugMessages() const
+{
+ return logDebugMessage;
+}
Modified: trunk/src/settings/settings.hh
===================================================================
--- trunk/src/settings/settings.hh 2012-09-04 15:17:00 UTC (rev 327)
+++ trunk/src/settings/settings.hh 2012-09-06 08:40:26 UTC (rev 328)
@@ -262,6 +262,9 @@
const BackupSelectionHash& getLastBackupSelectionRules() const;
void saveBackupSelectionRules( const BackupSelectionHash& selectionRules );
+ void saveLogDebugMessages(bool logDebugMessage);
+ bool getLogDebugMessages() const;
+
static const QString VERSION;
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|