mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Remove duplicated code
This commit is contained in:
parent
034130555e
commit
fad6211789
16 changed files with 42 additions and 262 deletions
|
@ -279,17 +279,7 @@ void burnConfigDialog::listProgrammers()
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << "-c?";
|
arguments << "-c?";
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
|
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
populate_icon(&Icon,Theme,"list.png");
|
populate_icon(&Icon,Theme,"list.png");
|
||||||
ad->setWindowIcon(Icon);
|
ad->setWindowIcon(Icon);
|
||||||
|
@ -309,17 +299,7 @@ void burnConfigDialog::on_pushButton_4_clicked()
|
||||||
arguments << "-?";
|
arguments << "-?";
|
||||||
|
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
|
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
populate_icon(&Icon,Theme,"configure.png");
|
populate_icon(&Icon,Theme,"configure.png");
|
||||||
ad->setWindowIcon(Icon);
|
ad->setWindowIcon(Icon);
|
||||||
|
@ -339,17 +319,7 @@ void burnConfigDialog::readFuses()
|
||||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
|
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
|
||||||
|
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
populate_icon(&Icon,Theme,"fuses.png");
|
populate_icon(&Icon,Theme,"fuses.png");
|
||||||
ad->setWindowIcon(Icon);
|
ad->setWindowIcon(Icon);
|
||||||
|
@ -364,6 +334,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||||
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
||||||
|
|
||||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||||
|
QString Theme=getTheme();
|
||||||
|
|
||||||
ret = QMessageBox::warning(this, tr("Companion"),
|
ret = QMessageBox::warning(this, tr("Companion"),
|
||||||
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
|
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
|
||||||
|
@ -386,17 +357,6 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||||
QStringList argread;
|
QStringList argread;
|
||||||
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
|
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
|
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
|
||||||
QSettings settings("companion", "companion");
|
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
populate_icon(&Icon,Theme,"fuses.png");
|
populate_icon(&Icon,Theme,"fuses.png");
|
||||||
ad->setWindowIcon(Icon);
|
ad->setWindowIcon(Icon);
|
||||||
|
@ -428,17 +388,6 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
|
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
|
||||||
}
|
}
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||||
QSettings settings("companion", "companion");
|
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
populate_icon(&Icon,Theme,"fuses.png");
|
populate_icon(&Icon,Theme,"fuses.png");
|
||||||
ad->setWindowIcon(Icon);
|
ad->setWindowIcon(Icon);
|
||||||
|
|
|
@ -16,17 +16,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||||
hexType(Type)
|
hexType(Type)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon LibraryIcon;
|
QIcon LibraryIcon;
|
||||||
populate_icon(&LibraryIcon,Theme,"library.png");
|
populate_icon(&LibraryIcon,Theme,"library.png");
|
||||||
ui->libraryButton->setIcon(LibraryIcon);
|
ui->libraryButton->setIcon(LibraryIcon);
|
||||||
|
|
|
@ -11,17 +11,7 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::customizeSplashDialog) {
|
ui(new Ui::customizeSplashDialog) {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon LibraryIcon;
|
QIcon LibraryIcon;
|
||||||
populate_icon(&LibraryIcon,Theme,"library.png");
|
populate_icon(&LibraryIcon,Theme,"library.png");
|
||||||
ui->libraryButton->setIcon(LibraryIcon);
|
ui->libraryButton->setIcon(LibraryIcon);
|
||||||
|
|
|
@ -1485,9 +1485,26 @@ QString getCenterBeep(ModelData * g_model)
|
||||||
return strl.join(", ");
|
return strl.join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage) {
|
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage)
|
||||||
|
{
|
||||||
Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16));
|
Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16));
|
||||||
Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24));
|
Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24));
|
||||||
Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32));
|
Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32));
|
||||||
Icon->addFile(":/themes/"+usedtheme+"/48/"+baseimage,QSize(48,48));
|
Icon->addFile(":/themes/"+usedtheme+"/48/"+baseimage,QSize(48,48));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getTheme()
|
||||||
|
{
|
||||||
|
QSettings settings("companion", "companion");
|
||||||
|
int theme_set=settings.value("theme", 1).toInt();
|
||||||
|
QString Theme;
|
||||||
|
switch(theme_set) {
|
||||||
|
case 0:
|
||||||
|
Theme="classic";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Theme="monochrome";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return Theme;
|
||||||
|
}
|
|
@ -29,6 +29,7 @@ void populateTTraceCB(QComboBox *b, int value);
|
||||||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||||
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
||||||
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage);
|
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage);
|
||||||
|
QString getTheme();
|
||||||
|
|
||||||
class GVarGroup : public QObject {
|
class GVarGroup : public QObject {
|
||||||
|
|
||||||
|
|
|
@ -96,16 +96,8 @@ downloadDialog_forWait(NULL)
|
||||||
this, SLOT(setActiveSubWindow(QWidget*)));
|
this, SLOT(setActiveSubWindow(QWidget*)));
|
||||||
|
|
||||||
MaxRecentFiles=MAX_RECENT;
|
MaxRecentFiles=MAX_RECENT;
|
||||||
|
Theme=getTheme();
|
||||||
QSettings settings("companion", "companion");
|
QSettings settings("companion", "companion");
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
int icon_size=settings.value("icon_size", 1).toInt();
|
int icon_size=settings.value("icon_size", 1).toInt();
|
||||||
switch (icon_size) {
|
switch (icon_size) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -68,17 +68,7 @@ MdiChild::MdiChild():
|
||||||
isUntitled(true),
|
isUntitled(true),
|
||||||
fileChanged(false)
|
fileChanged(false)
|
||||||
{
|
{
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon SimulateIcon;
|
QIcon SimulateIcon;
|
||||||
populate_icon(&SimulateIcon,Theme,"simulate.png");
|
populate_icon(&SimulateIcon,Theme,"simulate.png");
|
||||||
|
|
||||||
|
@ -522,17 +512,8 @@ QString MdiChild::strippedName(const QString &fullFileName)
|
||||||
|
|
||||||
void MdiChild::burnTo() // write to Tx
|
void MdiChild::burnTo() // write to Tx
|
||||||
{
|
{
|
||||||
|
QString Theme=getTheme();
|
||||||
QSettings settings("companion", "companion");
|
QSettings settings("companion", "companion");
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
bool backupEnable=settings.value("backupEnable", true).toBool();
|
bool backupEnable=settings.value("backupEnable", true).toBool();
|
||||||
QString backupPath=settings.value("backupPath", "").toString();
|
QString backupPath=settings.value("backupPath", "").toString();
|
||||||
if (!backupPath.isEmpty()) {
|
if (!backupPath.isEmpty()) {
|
||||||
|
|
|
@ -84,18 +84,7 @@ Curves::Curves(QWidget * parent, ModelData & model):
|
||||||
QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview);
|
QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview);
|
||||||
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
||||||
ui->curvePreview->setScene(scene);
|
ui->curvePreview->setScene(scene);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon ClearIcon;
|
QIcon ClearIcon;
|
||||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||||
|
|
||||||
|
|
|
@ -123,17 +123,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||||
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
|
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
|
||||||
|
|
||||||
#ifdef PHONON
|
#ifdef PHONON
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon PlayIcon;
|
QIcon PlayIcon;
|
||||||
populate_icon(&PlayIcon,Theme,"play.png");
|
populate_icon(&PlayIcon,Theme,"play.png");
|
||||||
playBT[i] = new QPushButton(this);
|
playBT[i] = new QPushButton(this);
|
||||||
|
@ -173,17 +163,7 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
|
||||||
{
|
{
|
||||||
if (phononLock)
|
if (phononLock)
|
||||||
return;
|
return;
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon PlayIcon;
|
QIcon PlayIcon;
|
||||||
populate_icon(&PlayIcon,Theme,"play.png");
|
populate_icon(&PlayIcon,Theme,"play.png");
|
||||||
|
|
||||||
|
@ -216,17 +196,8 @@ void CustomFunctionsPanel::playMusic()
|
||||||
QPushButton *playButton = qobject_cast<QPushButton*>(sender());
|
QPushButton *playButton = qobject_cast<QPushButton*>(sender());
|
||||||
int index=playButton->objectName().mid(5,2).toInt();
|
int index=playButton->objectName().mid(5,2).toInt();
|
||||||
QString function=playButton->objectName().left(4);
|
QString function=playButton->objectName().left(4);
|
||||||
|
QString Theme=getTheme();
|
||||||
QSettings settings("companion", "companion");
|
QSettings settings("companion", "companion");
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon PlayIcon;
|
QIcon PlayIcon;
|
||||||
populate_icon(&PlayIcon,Theme,"play.png");
|
populate_icon(&PlayIcon,Theme,"play.png");
|
||||||
QIcon StopIcon;
|
QIcon StopIcon;
|
||||||
|
@ -499,17 +470,7 @@ void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QLabel *label = (QLabel *)sender();
|
QLabel *label = (QLabel *)sender();
|
||||||
selectedFunction = label->property("index").toInt();
|
selectedFunction = label->property("index").toInt();
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon ClearIcon;
|
QIcon ClearIcon;
|
||||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||||
QIcon CopyIcon;
|
QIcon CopyIcon;
|
||||||
|
|
|
@ -382,17 +382,7 @@ void CustomSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QLabel *label = (QLabel *)sender();
|
QLabel *label = (QLabel *)sender();
|
||||||
selectedSwitch = label->property("index").toInt();
|
selectedSwitch = label->property("index").toInt();
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon ClearIcon;
|
QIcon ClearIcon;
|
||||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||||
QIcon CopyIcon;
|
QIcon CopyIcon;
|
||||||
|
|
|
@ -8,17 +8,7 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
|
||||||
generalSettings(generalSettings),
|
generalSettings(generalSettings),
|
||||||
expoInserted(false)
|
expoInserted(false)
|
||||||
{
|
{
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
QGridLayout * exposLayout = new QGridLayout(this);
|
QGridLayout * exposLayout = new QGridLayout(this);
|
||||||
|
|
||||||
|
@ -358,17 +348,7 @@ void InputsPanel::expoAdd()
|
||||||
|
|
||||||
void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
|
void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon AddIcon;
|
QIcon AddIcon;
|
||||||
populate_icon(&AddIcon,Theme,"add.png");
|
populate_icon(&AddIcon,Theme,"add.png");
|
||||||
QIcon EditIcon;
|
QIcon EditIcon;
|
||||||
|
|
|
@ -8,17 +8,6 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||||
generalSettings(generalSettings),
|
generalSettings(generalSettings),
|
||||||
mixInserted(false)
|
mixInserted(false)
|
||||||
{
|
{
|
||||||
QSettings settings("companion", "companion");
|
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QGridLayout * mixesLayout = new QGridLayout(this);
|
QGridLayout * mixesLayout = new QGridLayout(this);
|
||||||
|
|
||||||
MixerlistWidget = new MixersList(this, false); // TODO enum
|
MixerlistWidget = new MixersList(this, false); // TODO enum
|
||||||
|
@ -26,6 +15,7 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||||
QPushButton * qbDown = new QPushButton(this);
|
QPushButton * qbDown = new QPushButton(this);
|
||||||
QPushButton * qbClear = new QPushButton(this);
|
QPushButton * qbClear = new QPushButton(this);
|
||||||
|
|
||||||
|
QString Theme=getTheme();
|
||||||
QIcon qbUpIcon;
|
QIcon qbUpIcon;
|
||||||
populate_icon(&qbUpIcon,Theme,"moveup.png");
|
populate_icon(&qbUpIcon,Theme,"moveup.png");
|
||||||
qbUp->setText(tr("Move Up"));
|
qbUp->setText(tr("Move Up"));
|
||||||
|
@ -423,17 +413,7 @@ void MixesPanel::mixerAdd()
|
||||||
|
|
||||||
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
|
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon AddIcon;
|
QIcon AddIcon;
|
||||||
populate_icon(&AddIcon,Theme,"add.png");
|
populate_icon(&AddIcon,Theme,"add.png");
|
||||||
QIcon EditIcon;
|
QIcon EditIcon;
|
||||||
|
|
|
@ -21,18 +21,9 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
|
||||||
generalSettings(generalSettings)
|
generalSettings(generalSettings)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
QString Theme=getTheme();
|
||||||
QSettings settings("companion", "companion");
|
QSettings settings("companion", "companion");
|
||||||
restoreGeometry(settings.value("modelEditGeometry").toByteArray());
|
restoreGeometry(settings.value("modelEditGeometry").toByteArray());
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon SimulateIcon;
|
QIcon SimulateIcon;
|
||||||
populate_icon(&SimulateIcon,Theme,"simulate.png");
|
populate_icon(&SimulateIcon,Theme,"simulate.png");
|
||||||
ui->pushButton->setIcon(SimulateIcon);
|
ui->pushButton->setIcon(SimulateIcon);
|
||||||
|
|
|
@ -83,17 +83,7 @@ void ModelsListWidget::ShowContextMenu(const QPoint& pos)
|
||||||
const QClipboard *clipboard = QApplication::clipboard();
|
const QClipboard *clipboard = QApplication::clipboard();
|
||||||
const QMimeData *mimeData = clipboard->mimeData();
|
const QMimeData *mimeData = clipboard->mimeData();
|
||||||
bool hasData = mimeData->hasFormat("application/x-companion9x");
|
bool hasData = mimeData->hasFormat("application/x-companion9x");
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon AddIcon;
|
QIcon AddIcon;
|
||||||
populate_icon(&AddIcon,Theme,"add.png");
|
populate_icon(&AddIcon,Theme,"add.png");
|
||||||
QIcon EditIcon;
|
QIcon EditIcon;
|
||||||
|
|
|
@ -17,19 +17,8 @@ preferencesDialog::preferencesDialog(QWidget *parent) :
|
||||||
updateLock(false)
|
updateLock(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QIcon Icon;
|
QIcon Icon;
|
||||||
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
populate_icon(&Icon, Theme, "preferences.png");
|
populate_icon(&Icon, Theme, "preferences.png");
|
||||||
this->setWindowIcon(Icon);
|
this->setWindowIcon(Icon);
|
||||||
QIcon LibraryIcon;
|
QIcon LibraryIcon;
|
||||||
|
|
|
@ -9,17 +9,7 @@
|
||||||
splashLibrary::splashLibrary(QWidget *parent, QString * fileName) : QDialog(parent), ui(new Ui::splashLibrary) {
|
splashLibrary::splashLibrary(QWidget *parent, QString * fileName) : QDialog(parent), ui(new Ui::splashLibrary) {
|
||||||
splashFileName = fileName;
|
splashFileName = fileName;
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QSettings settings("companion", "companion");
|
QString Theme=getTheme();
|
||||||
int theme_set=settings.value("theme", 1).toInt();
|
|
||||||
QString Theme;
|
|
||||||
switch(theme_set) {
|
|
||||||
case 0:
|
|
||||||
Theme="classic";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Theme="monochrome";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
QIcon NextIcon;
|
QIcon NextIcon;
|
||||||
populate_icon(&NextIcon,Theme,"arrow-right.png");
|
populate_icon(&NextIcon,Theme,"arrow-right.png");
|
||||||
QIcon PrevIcon;
|
QIcon PrevIcon;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue