1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 08:45:24 +03:00

Another code reduction. Settings are now stored in "OpenTX/Companion",

instead of "companion/companion"
This commit is contained in:
Bertrand Songis 2014-01-20 16:50:06 +01:00
parent 0d394ca7c6
commit 439cabe83c
35 changed files with 465 additions and 650 deletions

View file

@ -1485,19 +1485,10 @@ QString getCenterBeep(ModelData * g_model)
return strl.join(", ");
}
void populate_icon(QIcon *Icon, QString baseimage)
{
static QString usedtheme=getTheme();
Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16));
Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24));
Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32));
Icon->addFile(":/themes/"+usedtheme+"/48/"+baseimage,QSize(48,48));
}
QString getTheme()
{
QSettings settings("companion", "companion");
int theme_set=settings.value("theme", 1).toInt();
QSettings settings;
int theme_set = settings.value("theme", 1).toInt();
QString Theme;
switch(theme_set) {
case 0:
@ -1508,4 +1499,14 @@ QString getTheme()
break;
}
return Theme;
}
}
CompanionIcon::CompanionIcon(QString baseimage)
{
static QString theme = getTheme();
addFile(":/themes/"+theme+"/16/"+baseimage, QSize(16,16));
addFile(":/themes/"+theme+"/24/"+baseimage, QSize(24,24));
addFile(":/themes/"+theme+"/32/"+baseimage, QSize(32,32));
addFile(":/themes/"+theme+"/48/"+baseimage, QSize(48,48));
}