add theme setup wizard
Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
parent
61144f7a21
commit
1b80ae0fca
18 changed files with 982 additions and 288 deletions
|
@ -66,6 +66,7 @@
|
|||
#include "ui/setupwizard/LanguageWizardPage.h"
|
||||
#include "ui/setupwizard/JavaWizardPage.h"
|
||||
#include "ui/setupwizard/PasteWizardPage.h"
|
||||
#include "ui/setupwizard/ThemeWizardPage.h"
|
||||
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
|
||||
|
@ -846,10 +847,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||
});
|
||||
|
||||
{
|
||||
setIconTheme(settings()->get("IconTheme").toString());
|
||||
qDebug() << "<> Icon theme set.";
|
||||
setApplicationTheme(settings()->get("ApplicationTheme").toString(), true);
|
||||
qDebug() << "<> Application theme set.";
|
||||
applyCurrentlySelectedTheme();
|
||||
}
|
||||
|
||||
updateCapabilities();
|
||||
|
@ -892,6 +890,7 @@ bool Application::createSetupWizard()
|
|||
return false;
|
||||
}();
|
||||
bool pasteInterventionRequired = settings()->get("PastebinURL") != "";
|
||||
bool themeInterventionRequired = settings()->get("ApplicationTheme") != "";
|
||||
bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired;
|
||||
|
||||
if(wizardRequired)
|
||||
|
@ -911,6 +910,11 @@ bool Application::createSetupWizard()
|
|||
{
|
||||
m_setupWizard->addPage(new PasteWizardPage(m_setupWizard));
|
||||
}
|
||||
|
||||
if (themeInterventionRequired)
|
||||
{
|
||||
m_setupWizard->addPage(new ThemeWizardPage(m_setupWizard));
|
||||
}
|
||||
connect(m_setupWizard, &QDialog::finished, this, &Application::setupWizardFinished);
|
||||
m_setupWizard->show();
|
||||
return true;
|
||||
|
@ -1118,9 +1122,14 @@ QList<ITheme*> Application::getValidApplicationThemes()
|
|||
return m_themeManager->getValidApplicationThemes();
|
||||
}
|
||||
|
||||
void Application::setApplicationTheme(const QString& name, bool initial)
|
||||
void Application::applyCurrentlySelectedTheme()
|
||||
{
|
||||
m_themeManager->setApplicationTheme(name, initial);
|
||||
m_themeManager->applyCurrentlySelectedTheme();
|
||||
}
|
||||
|
||||
void Application::setApplicationTheme(const QString& name)
|
||||
{
|
||||
m_themeManager->setApplicationTheme(name);
|
||||
}
|
||||
|
||||
void Application::setIconTheme(const QString& name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue