diff --git a/companion/src/burnconfigdialog.cpp b/companion/src/burnconfigdialog.cpp index 9e08d860f..61c0df423 100644 --- a/companion/src/burnconfigdialog.cpp +++ b/companion/src/burnconfigdialog.cpp @@ -2,6 +2,7 @@ #include "ui_burnconfigdialog.h" #include "avroutputdialog.h" #include "eeprominterface.h" +#include "helpers.h" #include #if !defined WIN32 && defined __GNUC__ @@ -278,7 +279,20 @@ void burnConfigDialog::listProgrammers() QStringList arguments; arguments << "-c?"; avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE); - ad->setWindowIcon(QIcon(":/images/list.png")); + 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; + populate_icon(&Icon,Theme,"list.png"); + ad->setWindowIcon(Icon); ad->show(); } @@ -295,7 +309,20 @@ void burnConfigDialog::on_pushButton_4_clicked() arguments << "-?"; avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE); - ad->setWindowIcon(QIcon(":/images/configure.png")); + 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; + populate_icon(&Icon,Theme,"configure.png"); + ad->setWindowIcon(Icon); ad->show(); } @@ -312,7 +339,20 @@ void burnConfigDialog::readFuses() arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str; avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE); - ad->setWindowIcon(QIcon(":/images/fuses.png")); + 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; + populate_icon(&Icon,Theme,"fuses.png"); + ad->setWindowIcon(Icon); ad->show(); } @@ -346,7 +386,20 @@ void burnConfigDialog::restFuses(bool eeProtect) QStringList argread; 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); - ad->setWindowIcon(QIcon(":/images/fuses.png")); + 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; + populate_icon(&Icon,Theme,"fuses.png"); + ad->setWindowIcon(Icon); ad->exec(); QFile file(tempFile); if (file.exists() && file.size()==1) { @@ -375,7 +428,20 @@ void burnConfigDialog::restFuses(bool eeProtect) arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str; } avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE); - ad->setWindowIcon(QIcon(":/images/fuses.png")); + 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; + populate_icon(&Icon,Theme,"fuses.png"); + ad->setWindowIcon(Icon); ad->show(); } diff --git a/companion/src/burnconfigdialog.ui b/companion/src/burnconfigdialog.ui index bb85de6f5..b5419d37f 100644 --- a/companion/src/burnconfigdialog.ui +++ b/companion/src/burnconfigdialog.ui @@ -27,7 +27,7 @@ - :/images/configure.png:/images/configure.png + :/icon.png:/icon.png diff --git a/companion/src/burndialog.cpp b/companion/src/burndialog.cpp index 1851310d6..df87455e9 100644 --- a/companion/src/burndialog.cpp +++ b/companion/src/burndialog.cpp @@ -16,6 +16,20 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac hexType(Type) { ui->setupUi(this); + 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 LibraryIcon; + populate_icon(&LibraryIcon,Theme,"library.png"); + ui->libraryButton->setIcon(LibraryIcon); ui->SplashFrame->hide(); ui->FramFWInfo->hide(); ui->EEbackupCB->hide(); diff --git a/companion/src/burndialog.ui b/companion/src/burndialog.ui index a15ae25a1..e86634e9a 100644 --- a/companion/src/burndialog.ui +++ b/companion/src/burndialog.ui @@ -26,8 +26,8 @@ Customize Splash - - :/images/c_home.png:/images/c_home.png + + :/icon.png:/icon.png @@ -455,10 +455,6 @@ ... - - - :/images/library.png:/images/library.png - 16 diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index 5212a3809..5a86ebc50 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -1,5 +1,6 @@ + images/customize.png icon.png ../../CREDITS.txt ../../DONATIONS.txt diff --git a/companion/src/customizesplashdialog.cpp b/companion/src/customizesplashdialog.cpp index 7912b3ec5..88c338859 100644 --- a/companion/src/customizesplashdialog.cpp +++ b/companion/src/customizesplashdialog.cpp @@ -11,6 +11,20 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) : QDialog(parent), ui(new Ui::customizeSplashDialog) { ui->setupUi(this); + 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 LibraryIcon; + populate_icon(&LibraryIcon,Theme,"library.png"); + ui->libraryButton->setIcon(LibraryIcon); ui->HowToLabel->clear(); ui->HowToLabel->append("
" + tr("Select an original firmware file") + "
"); } diff --git a/companion/src/customizesplashdialog.ui b/companion/src/customizesplashdialog.ui index b7d0285aa..15a803656 100644 --- a/companion/src/customizesplashdialog.ui +++ b/companion/src/customizesplashdialog.ui @@ -20,8 +20,8 @@ Customize Splash
- - :/images/c_home.png:/images/c_home.png + + :/icon.png:/icon.png @@ -211,10 +211,6 @@ p, li { white-space: pre-wrap; } ... - - - :/images/library.png:/images/library.png - 16 diff --git a/companion/src/fusesdialog.ui b/companion/src/fusesdialog.ui index e7e6bbe9d..1a32ff96c 100644 --- a/companion/src/fusesdialog.ui +++ b/companion/src/fusesdialog.ui @@ -15,7 +15,7 @@ - :/images/fuses.png:/images/fuses.png + :/icon.png:/icon.png diff --git a/companion/src/themes/monochrome/customize.png b/companion/src/images/customize.png similarity index 100% rename from companion/src/themes/monochrome/customize.png rename to companion/src/images/customize.png diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index ed908c9b0..e17594540 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -523,6 +523,16 @@ QString MdiChild::strippedName(const QString &fullFileName) void MdiChild::burnTo() // write to Tx { 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(); QString backupPath=settings.value("backupPath", "").toString(); if (!backupPath.isEmpty()) { @@ -567,14 +577,18 @@ void MdiChild::burnTo() // write to Tx QStringList str; str << path << backupFile; avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); - ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"read_eeprom.png"); + ad->setWindowIcon(Icon); ad->exec(); sleep(1); } } else { QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx")); - ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"read_eeprom.png"); + ad->setWindowIcon(Icon); ad->exec(); sleep(1); } @@ -583,7 +597,9 @@ void MdiChild::burnTo() // write to Tx QString tempFlash=tempDir + "/flash.bin"; QStringList str = ((MainWindow *)this->parent())->GetReceiveFlashCommand(tempFlash); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Read Flash From Tx"); - ad->setWindowIcon(QIcon(":/images/read_flash.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"read_flash.png"); + ad->setWindowIcon(Icon); ad->exec(); sleep(1); QString restoreFile = tempDir + "/compat.bin"; @@ -619,7 +635,9 @@ void MdiChild::burnTo() // write to Tx } else { QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx")); - ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"read_eeprom.png"); + ad->setWindowIcon(Icon); ad->exec(); sleep(1); } @@ -634,14 +652,18 @@ void MdiChild::burnTo() // write to Tx QStringList str; str << tempFile << path; avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN); - ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"read_eeprom.png"); + ad->setWindowIcon(Icon); ad->show(); sleep(1); } } else { QStringList str = ((MainWindow *)this->parent())->GetSendEEpromCommand(tempFile); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE); - ad->setWindowIcon(QIcon(":/images/write_eeprom.png")); + QIcon Icon; + populate_icon(&Icon,Theme,"write_eeprom.png"); + ad->setWindowIcon(Icon); ad->show(); } } diff --git a/companion/src/modelconfigdialog.ui b/companion/src/modelconfigdialog.ui index ea119cabc..f9c7abba6 100644 --- a/companion/src/modelconfigdialog.ui +++ b/companion/src/modelconfigdialog.ui @@ -27,7 +27,7 @@ - :/images/configure.png:/images/configure.png + :/icon.png:/icon.png diff --git a/companion/src/simulatordialog.ui b/companion/src/simulatordialog.ui index a739492ac..de9a3a43a 100644 --- a/companion/src/simulatordialog.ui +++ b/companion/src/simulatordialog.ui @@ -27,7 +27,7 @@ - :/images/simulate.png:/images/simulate.png + :/icon.png:/icon.png @@ -1092,8 +1092,6 @@ QPushButton:checked { - - @@ -1812,8 +1810,6 @@ QPushButton:checked { QFrame::Raised - - 2 @@ -2298,7 +2294,6 @@ border-radius: 4px; - 0 diff --git a/companion/src/splashlibrary.cpp b/companion/src/splashlibrary.cpp index 9e5a7cc82..8749f7587 100644 --- a/companion/src/splashlibrary.cpp +++ b/companion/src/splashlibrary.cpp @@ -9,6 +9,23 @@ splashLibrary::splashLibrary(QWidget *parent, QString * fileName) : QDialog(parent), ui(new Ui::splashLibrary) { splashFileName = fileName; ui->setupUi(this); + 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 NextIcon; + populate_icon(&NextIcon,Theme,"arrow-right.png"); + QIcon PrevIcon; + populate_icon(&PrevIcon,Theme,"arrow-left.png"); + ui->nextPage->setIcon(NextIcon); + ui->prevPage->setIcon(PrevIcon); page = 0; getFileList(); if (imageList.size() > 20) { diff --git a/companion/src/splashlibrary.ui b/companion/src/splashlibrary.ui index 8c5bcaf1d..9507a2d08 100644 --- a/companion/src/splashlibrary.ui +++ b/companion/src/splashlibrary.ui @@ -25,6 +25,10 @@ + + + :/icon.png:/icon.png + @@ -46,10 +50,6 @@ ... - - - :/images/arrow-left.png:/images/arrow-left.png - 50 @@ -945,10 +945,6 @@ ... - - - :/images/arrow-right.png:/images/arrow-right.png - 50 diff --git a/companion/src/themes/classic/customize.png b/companion/src/themes/classic/customize.png deleted file mode 100644 index 96259b922..000000000 Binary files a/companion/src/themes/classic/customize.png and /dev/null differ diff --git a/companion/src/xsimulatordialog.ui b/companion/src/xsimulatordialog.ui index d8f7d3f6f..4a5454c5d 100644 --- a/companion/src/xsimulatordialog.ui +++ b/companion/src/xsimulatordialog.ui @@ -27,7 +27,7 @@ - :/images/simulate.png:/images/simulate.png + :/icon.png:/icon.png @@ -2053,8 +2053,6 @@ border-radius: 4px; 16777215 18 - - QSlider::sub-page:horizontal:disabled {