diff --git a/stacer-core/Utils/file_util.h b/stacer-core/Utils/file_util.h index a2727dd..5c38ec6 100644 --- a/stacer-core/Utils/file_util.h +++ b/stacer-core/Utils/file_util.h @@ -18,7 +18,7 @@ public: static QString readStringFromFile(const QString &path, const QIODevice::OpenMode &mode = QIODevice::ReadOnly); static QStringList readListFromFile(const QString &path, const QIODevice::OpenMode &mode = QIODevice::ReadOnly); - static bool writeFile(const QString &path, const QString &content, const QIODevice::OpenMode &mode = QIODevice::ReadWrite); + static bool writeFile(const QString &path, const QString &content, const QIODevice::OpenMode &mode = QIODevice::WriteOnly | QIODevice::Truncate); static QStringList directoryList(const QString &path); static quint64 getFileSize(const QString &path); diff --git a/stacer/Pages/Settings/settings_page.cpp b/stacer/Pages/Settings/settings_page.cpp index 5f9d664..1df81c7 100644 --- a/stacer/Pages/Settings/settings_page.cpp +++ b/stacer/Pages/Settings/settings_page.cpp @@ -2,6 +2,8 @@ #include "ui_settings_page.h" #include "Managers/info_manager.h" #include "utilities.h" +#include +#include SettingsPage::~SettingsPage() { @@ -51,7 +53,7 @@ void SettingsPage::init() } QString dk = apm->getDiskName(); - ui->disksCmb->setCurrentText(dk); + ui->disksCmb->setCurrentIndex(ui->disksCmb->findData(dk)); // start on boot startupAppPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); @@ -70,6 +72,7 @@ void SettingsPage::init() Utilities::addDropShadow(ui->languagesCmb, 40); Utilities::addDropShadow(ui->themesCmb, 40); Utilities::addDropShadow(ui->disksCmb, 40); + Utilities::addDropShadow(ui->btnDonate, 40); connect(ui->languagesCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(languagesCmbChanged(int))); connect(ui->themesCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(themesCmbChanged(int))); @@ -121,3 +124,8 @@ void SettingsPage::on_checkAutostart_clicked(bool checked) QFile::remove(startupAppPath); } } + +void SettingsPage::on_btnDonate_clicked() +{ + QDesktopServices::openUrl(QUrl("https://www.patreon.com/oguzhaninan")); +} diff --git a/stacer/Pages/Settings/settings_page.h b/stacer/Pages/Settings/settings_page.h index 662e03d..0142d7d 100644 --- a/stacer/Pages/Settings/settings_page.h +++ b/stacer/Pages/Settings/settings_page.h @@ -25,6 +25,7 @@ private slots: void languagesCmbChanged(const int &index); void diskCmbChanged(const int &index); void on_checkAutostart_clicked(bool checked); + void on_btnDonate_clicked(); private: Ui::SettingsPage *ui; diff --git a/stacer/Pages/Settings/settings_page.ui b/stacer/Pages/Settings/settings_page.ui index 090687b..c36c306 100644 --- a/stacer/Pages/Settings/settings_page.ui +++ b/stacer/Pages/Settings/settings_page.ui @@ -140,22 +140,6 @@ - - - - <html><head/><body><p>Created by <a href="https://github.com/oguzhaninan"><span style=" text-decoration: underline; color:#007af4;">Oğuzhan İNAN</span></a></p></body></html> - - - Qt::RichText - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - @@ -236,8 +220,55 @@ + + + + + 0 + 0 + + + + PointingHandCursor + + + Qt::NoFocus + + + Donate + + + + :/static/themes/common/img/donate.png:/static/themes/common/img/donate.png + + + + 18 + 18 + + + + + + + + <html><head/><body><p>Created by <a href="https://github.com/oguzhaninan"><span style=" text-decoration: underline; color:#007af4;">Oğuzhan İNAN</span></a></p></body></html> + + + Qt::RichText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + - + + + diff --git a/stacer/Pages/StartupApps/startup_app.cpp b/stacer/Pages/StartupApps/startup_app.cpp index 9fbf449..7318b16 100644 --- a/stacer/Pages/StartupApps/startup_app.cpp +++ b/stacer/Pages/StartupApps/startup_app.cpp @@ -50,7 +50,7 @@ void StartupApp::on_startupCheck_clicked(bool status) lines.append(QString("Hidden=%1").arg(_status)); } - FileUtil::writeFile(filePath, lines.join('\n')); + FileUtil::writeFile(filePath, lines.join('\n').append('\n')); } void StartupApp::on_deleteAppBtn_clicked() diff --git a/stacer/main.cpp b/stacer/main.cpp index ef39f5e..fe684df 100644 --- a/stacer/main.cpp +++ b/stacer/main.cpp @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) app.processEvents(); -// QThread::sleep(10); + QThread::sleep(1); // qInstallMessageHandler(messageHandler); diff --git a/stacer/static.qrc b/stacer/static.qrc index ecf84ef..542f16b 100755 --- a/stacer/static.qrc +++ b/stacer/static.qrc @@ -68,5 +68,6 @@ static/themes/default/img/ppa-repository.png static/splashscreen.png static/loading.svg + static/themes/common/img/donate.png diff --git a/stacer/static/splashscreen.png b/stacer/static/splashscreen.png index a613214..02b0e5e 100644 Binary files a/stacer/static/splashscreen.png and b/stacer/static/splashscreen.png differ diff --git a/stacer/static/themes/common/img/donate.png b/stacer/static/themes/common/img/donate.png new file mode 100644 index 0000000..dc3f390 Binary files /dev/null and b/stacer/static/themes/common/img/donate.png differ diff --git a/stacer/static/themes/default/style/style.qss b/stacer/static/themes/default/style/style.qss index d106c2e..b123a6d 100755 --- a/stacer/static/themes/default/style/style.qss +++ b/stacer/static/themes/default/style/style.qss @@ -131,9 +131,10 @@ QCheckBox[accessibleName="circle"]::indicator:checked { QToolTip { color: @color05; - background-color: @color04; - border: 1px solid @color04; - border-radius: 2; + padding: 2; + background-color: @sidebar; + /*border: 1px solid @pageContent;*/ + border-radius: 3; } /************************** @@ -149,7 +150,6 @@ QToolTip { font-size: 13pt; } - QKeySequenceEdit { border-radius: 2; padding: 10; @@ -1105,3 +1105,16 @@ QRadioButton::indicator:checked { font-size: 9pt; color: @color06; } + +#btnDonate { + border-radius: 3; + padding: 5 10; + font-size: 11pt; + background-color: @color03; + color: @color07; +} + +#btnDonate:hover { + background-color: @color10; +} +