mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
CThemes: inherit CColorSetupNotifier into CThemes
Avoids explicit init of CColorSetupNotifier objects.
This commit is contained in:
@@ -58,7 +58,7 @@ CThemes::CThemes()
|
|||||||
: themefile('\t')
|
: themefile('\t')
|
||||||
{
|
{
|
||||||
width = 40;
|
width = 40;
|
||||||
notifier = NULL;
|
|
||||||
hasThemeChanged = false;
|
hasThemeChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +83,7 @@ int CThemes::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
{
|
{
|
||||||
if(!applyDefaultTheme())
|
if(!applyDefaultTheme())
|
||||||
setupDefaultColors(); // fallback
|
setupDefaultColors(); // fallback
|
||||||
notifier = new CColorSetupNotifier();
|
changeNotify(NONEXISTANT_LOCALE, NULL);
|
||||||
notifier->changeNotify(NONEXISTANT_LOCALE, NULL);
|
|
||||||
delete notifier;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -211,10 +209,8 @@ void CThemes::rememberOldTheme(bool remember)
|
|||||||
} else {
|
} else {
|
||||||
t = oldTheme;
|
t = oldTheme;
|
||||||
|
|
||||||
notifier = new CColorSetupNotifier;
|
changeNotify(NONEXISTANT_LOCALE, NULL);
|
||||||
notifier->changeNotify(NONEXISTANT_LOCALE, NULL);
|
|
||||||
hasThemeChanged = false;
|
hasThemeChanged = false;
|
||||||
delete notifier;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,10 +220,8 @@ void CThemes::readFile(const char *themename)
|
|||||||
{
|
{
|
||||||
getTheme(themefile);
|
getTheme(themefile);
|
||||||
|
|
||||||
notifier = new CColorSetupNotifier;
|
changeNotify(NONEXISTANT_LOCALE, NULL);
|
||||||
notifier->changeNotify(NONEXISTANT_LOCALE, NULL);
|
|
||||||
hasThemeChanged = true;
|
hasThemeChanged = true;
|
||||||
delete notifier;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("[neutrino theme] %s not found\n", themename);
|
printf("[neutrino theme] %s not found\n", themename);
|
||||||
|
@@ -28,11 +28,10 @@
|
|||||||
#include <configfile.h>
|
#include <configfile.h>
|
||||||
#include <system/setting_helpers.h>
|
#include <system/setting_helpers.h>
|
||||||
|
|
||||||
class CThemes : public CMenuTarget, CChangeObserver
|
class CThemes : public CMenuTarget, CColorSetupNotifier
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CConfigFile themefile;
|
CConfigFile themefile;
|
||||||
CColorSetupNotifier *notifier;
|
|
||||||
|
|
||||||
int width;
|
int width;
|
||||||
SNeutrinoTheme oldTheme;
|
SNeutrinoTheme oldTheme;
|
||||||
|
Reference in New Issue
Block a user