Implement Suggestions from flow & Scrumplex
Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include "Application.h"
|
||||
#include "ui/themes/ITheme.h"
|
||||
#include "ui/themes/ThemeManager.h"
|
||||
#include "ui/widgets/ThemeCustomizationWidget.h"
|
||||
#include "ui_ThemeCustomizationWidget.h"
|
||||
|
||||
@ -27,8 +28,8 @@ ThemeWizardPage::ThemeWizardPage(QWidget* parent) : BaseWizardPage(parent), ui(n
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->themeCustomizationWidget, QOverload<int>::of(&ThemeCustomizationWidget::currentIconThemeChanged), this, &ThemeWizardPage::updateIcons);
|
||||
connect(ui->themeCustomizationWidget, QOverload<int>::of(&ThemeCustomizationWidget::currentCatChanged), this, &ThemeWizardPage::updateCat);
|
||||
connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentIconThemeChanged, this, &ThemeWizardPage::updateIcons);
|
||||
connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentCatChanged, this, &ThemeWizardPage::updateCat);
|
||||
|
||||
updateIcons();
|
||||
updateCat();
|
||||
@ -39,13 +40,6 @@ ThemeWizardPage::~ThemeWizardPage()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ThemeWizardPage::initializePage() {}
|
||||
|
||||
bool ThemeWizardPage::validatePage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ThemeWizardPage::updateIcons()
|
||||
{
|
||||
qDebug() << "Setting Icons";
|
||||
@ -67,20 +61,7 @@ void ThemeWizardPage::updateIcons()
|
||||
void ThemeWizardPage::updateCat()
|
||||
{
|
||||
qDebug() << "Setting Cat";
|
||||
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0));
|
||||
QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
|
||||
QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0));
|
||||
QString cat = APPLICATION->settings()->get("BackgroundCat").toString();
|
||||
if (std::abs(now.daysTo(xmas)) <= 4) {
|
||||
cat += "-xmas";
|
||||
} else if (std::abs(now.daysTo(halloween)) <= 4) {
|
||||
cat += "-spooky";
|
||||
} else if (std::abs(now.daysTo(birthday)) <= 12) {
|
||||
cat += "-bday";
|
||||
}
|
||||
ui->catImagePreviewButton->setIcon(QIcon(QString(R"(:/backgrounds/%1)").arg(cat)));
|
||||
ui->catImagePreviewButton->setIcon(QIcon(QString(R"(:/backgrounds/%1)").arg(ThemeManager::getCatImage())));
|
||||
}
|
||||
|
||||
void ThemeWizardPage::retranslate()
|
||||
|
@ -24,22 +24,20 @@ namespace Ui {
|
||||
class ThemeWizardPage;
|
||||
}
|
||||
|
||||
class ThemeWizardPage : public BaseWizardPage
|
||||
{
|
||||
class ThemeWizardPage : public BaseWizardPage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ThemeWizardPage(QWidget *parent = nullptr);
|
||||
public:
|
||||
explicit ThemeWizardPage(QWidget* parent = nullptr);
|
||||
~ThemeWizardPage();
|
||||
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
bool validatePage() override { return true; };
|
||||
void retranslate() override;
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void updateIcons();
|
||||
void updateCat();
|
||||
|
||||
private:
|
||||
Ui::ThemeWizardPage *ui;
|
||||
private:
|
||||
Ui::ThemeWizardPage* ui;
|
||||
};
|
||||
|
Reference in New Issue
Block a user