diff --git a/rssguard.pro b/rssguard.pro index 5c6717305..bcbcd3d35 100755 --- a/rssguard.pro +++ b/rssguard.pro @@ -266,7 +266,9 @@ HEADERS += src/core/feeddownloader.h \ src/network-web/webpage.h \ src/gui/locationlineedit.h \ src/network-web/googlesuggest.h \ - src/gui/discoverfeedsbutton.h + src/gui/discoverfeedsbutton.h \ + src/gui/settings/settingspanel.h \ + src/gui/settings/settingsgeneral.h SOURCES += src/core/feeddownloader.cpp \ src/core/feedsmodel.cpp \ @@ -377,7 +379,9 @@ SOURCES += src/core/feeddownloader.cpp \ src/network-web/webpage.cpp \ src/gui/locationlineedit.cpp \ src/network-web/googlesuggest.cpp \ - src/gui/discoverfeedsbutton.cpp + src/gui/discoverfeedsbutton.cpp \ + src/gui/settings/settingspanel.cpp \ + src/gui/settings/settingsgeneral.cpp FORMS += \ src/gui/toolbareditor.ui \ @@ -395,7 +399,8 @@ FORMS += \ src/services/owncloud/gui/formeditowncloudaccount.ui \ src/services/standard/gui/formstandardcategorydetails.ui \ src/services/standard/gui/formstandardimportexport.ui \ - src/services/tt-rss/gui/formeditaccount.ui + src/services/tt-rss/gui/formeditaccount.ui \ + src/gui/settings/settingsgeneral.ui TRANSLATIONS += localization/qtbase-cs.ts \ localization/qtbase-da.ts \ diff --git a/src/gui/dialogs/formsettings.ui b/src/gui/dialogs/formsettings.ui index caa07de36..018f987c2 100755 --- a/src/gui/dialogs/formsettings.ui +++ b/src/gui/dialogs/formsettings.ui @@ -88,7 +88,7 @@ - 3 + 0 @@ -417,8 +417,8 @@ Authors of this application are NOT responsible for lost data. 0 0 - 100 - 30 + 742 + 451 @@ -495,8 +495,8 @@ Authors of this application are NOT responsible for lost data. 0 0 - 742 - 426 + 736 + 425 diff --git a/src/gui/settings/settingsgeneral.cpp b/src/gui/settings/settingsgeneral.cpp new file mode 100755 index 000000000..d2f68c0cd --- /dev/null +++ b/src/gui/settings/settingsgeneral.cpp @@ -0,0 +1,12 @@ +#include "gui/settings/settingsgeneral.h" + + +SettingsGeneral::SettingsGeneral(Settings *settings, QWidget *parent) + : SettingsPanel(settings, parent), m_ui(new Ui::SettingsGeneral) { + m_ui->setupUi(this); + m_ui->m_checkAutostart->setText(m_ui->m_checkAutostart->text().arg(APP_NAME)); +} + +SettingsGeneral::~SettingsGeneral() { + delete m_ui; +} diff --git a/src/gui/settings/settingsgeneral.h b/src/gui/settings/settingsgeneral.h new file mode 100755 index 000000000..ed2a61474 --- /dev/null +++ b/src/gui/settings/settingsgeneral.h @@ -0,0 +1,20 @@ +#ifndef SETTINGSGENERAL_H +#define SETTINGSGENERAL_H + +#include "gui/settings/settingspanel.h" + +#include "ui_settingsgeneral.h" + + +class SettingsGeneral : public SettingsPanel { + Q_OBJECT + + public: + explicit SettingsGeneral(Settings *settings, QWidget *parent = 0); + virtual ~SettingsGeneral(); + + private: + Ui::SettingsGeneral *m_ui; +}; + +#endif // SETTINGSGENERAL_H diff --git a/src/gui/settings/settingsgeneral.ui b/src/gui/settings/settingsgeneral.ui new file mode 100755 index 000000000..fbd75953a --- /dev/null +++ b/src/gui/settings/settingsgeneral.ui @@ -0,0 +1,54 @@ + + + SettingsGeneral + + + + 0 + 0 + 552 + 148 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Launch %1 on operating system startup + + + + + + + Check for updates on application startup + + + + + + + Remove junk Trolltech registry key (HKCU\Software\Trolltech) when application quits (Use at your own risk!) + + + + + + + + diff --git a/src/gui/settings/settingspanel.cpp b/src/gui/settings/settingspanel.cpp new file mode 100755 index 000000000..03db0802c --- /dev/null +++ b/src/gui/settings/settingspanel.cpp @@ -0,0 +1,46 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2016 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + + +#include "gui/settings/settingspanel.h" + +#include "miscellaneous/settings.h" + + +SettingsPanel::SettingsPanel(Settings *settings, QWidget *parent) : QWidget(parent) { +} + +void SettingsPanel::loadSettings() { + setIsDirty(false); +} + +void SettingsPanel::saveSettings() { + setIsDirty(false); +} + +void SettingsPanel::dirtifySettings() { + setIsDirty(true); + emit settingsChanged(); +} + +bool SettingsPanel::isDirty() const { + return m_isDirty; +} + +void SettingsPanel::setIsDirty(bool is_dirty) { + m_isDirty = is_dirty; +} diff --git a/src/gui/settings/settingspanel.h b/src/gui/settings/settingspanel.h new file mode 100755 index 000000000..519c57212 --- /dev/null +++ b/src/gui/settings/settingspanel.h @@ -0,0 +1,51 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2016 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + + +#ifndef SETTINGSPANEL_H +#define SETTINGSPANEL_H + +#include + + +class Settings; + +class SettingsPanel : public QWidget { + Q_OBJECT + + public: + explicit SettingsPanel(Settings *settings, QWidget *parent = 0); + + virtual void loadSettings(); + virtual void saveSettings(); + + protected: + // Sets this settings panel as dirty (some settings are changed) and emits the signal. + void dirtifySettings(); + + // These methods should not be probably called by subclasses. + bool isDirty() const; + void setIsDirty(bool is_dirty); + + signals: + void settingsChanged(); + + private: + bool m_isDirty; +}; + +#endif // SETTINGSPANEL_H