1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 00:05:17 +03:00

Further work in themes for the ui and some further bug fix.

This commit is contained in:
Romolo Manfredini 2014-01-19 22:49:26 +01:00
parent 540ca146b8
commit a3a698181e
38 changed files with 849 additions and 222 deletions

View file

@ -292,91 +292,349 @@
<file>images/library/30002.png</file> <file>images/library/30002.png</file>
<file>images/library/30003.png</file> <file>images/library/30003.png</file>
<file>images/library/30004.png</file> <file>images/library/30004.png</file>
<file>themes/monochrome/open.png</file> <file>themes/monochrome/16/open.png</file>
<file>themes/monochrome/edit.png</file> <file>themes/monochrome/16/edit.png</file>
<file>themes/monochrome/information.png</file> <file>themes/monochrome/16/information.png</file>
<file>themes/monochrome/configure.png</file> <file>themes/monochrome/16/configure.png</file>
<file>themes/monochrome/switch_dir.png</file> <file>themes/monochrome/16/switch_dir.png</file>
<file>themes/monochrome/list.png</file> <file>themes/monochrome/16/list.png</file>
<file>themes/monochrome/wizard.png</file> <file>themes/monochrome/16/wizard.png</file>
<file>themes/monochrome/logs.png</file> <file>themes/monochrome/16/logs.png</file>
<file>themes/monochrome/new.png</file> <file>themes/monochrome/16/new.png</file>
<file>themes/monochrome/save.png</file> <file>themes/monochrome/16/save.png</file>
<file>themes/monochrome/recentdocument.png</file> <file>themes/monochrome/16/recentdocument.png</file>
<file>themes/monochrome/simulate.png</file> <file>themes/monochrome/16/simulate.png</file>
<file>themes/monochrome/changelog.png</file> <file>themes/monochrome/16/changelog.png</file>
<file>themes/monochrome/copy.png</file> <file>themes/monochrome/16/copy.png</file>
<file>themes/monochrome/write_flash.png</file> <file>themes/monochrome/16/write_flash.png</file>
<file>themes/monochrome/read_eeprom_file.png</file> <file>themes/monochrome/16/read_eeprom_file.png</file>
<file>themes/monochrome/clear.png</file> <file>themes/monochrome/16/clear.png</file>
<file>themes/monochrome/play.png</file> <file>themes/monochrome/16/play.png</file>
<file>themes/monochrome/fuses.png</file> <file>themes/monochrome/16/fuses.png</file>
<file>themes/monochrome/arrow-right.png</file> <file>themes/monochrome/16/arrow-right.png</file>
<file>themes/monochrome/exit.png</file> <file>themes/monochrome/16/exit.png</file>
<file>themes/monochrome/moveup.png</file> <file>themes/monochrome/16/moveup.png</file>
<file>themes/monochrome/read_eeprom.png</file> <file>themes/monochrome/16/read_eeprom.png</file>
<file>themes/monochrome/cut.png</file> <file>themes/monochrome/16/cut.png</file>
<file>themes/monochrome/arrow-left.png</file> <file>themes/monochrome/16/arrow-left.png</file>
<file>themes/monochrome/write_eeprom_file.png</file> <file>themes/monochrome/16/write_eeprom_file.png</file>
<file>themes/monochrome/library.png</file> <file>themes/monochrome/16/library.png</file>
<file>themes/monochrome/profiles.png</file> <file>themes/monochrome/16/profiles.png</file>
<file>themes/monochrome/paste.png</file> <file>themes/monochrome/16/paste.png</file>
<file>themes/monochrome/print.png</file> <file>themes/monochrome/16/print.png</file>
<file>themes/monochrome/compare.png</file> <file>themes/monochrome/16/compare.png</file>
<file>themes/monochrome/customize.png</file> <file>themes/monochrome/16/customize.png</file>
<file>themes/monochrome/saveas.png</file> <file>themes/monochrome/16/saveas.png</file>
<file>themes/monochrome/preferences.png</file> <file>themes/monochrome/16/preferences.png</file>
<file>themes/monochrome/movedown.png</file> <file>themes/monochrome/16/movedown.png</file>
<file>themes/monochrome/currentmodel.png</file> <file>themes/monochrome/16/currentmodel.png</file>
<file>themes/monochrome/read_flash.png</file> <file>themes/monochrome/16/read_flash.png</file>
<file>themes/monochrome/duplicate.png</file> <file>themes/monochrome/16/duplicate.png</file>
<file>themes/monochrome/add.png</file> <file>themes/monochrome/16/add.png</file>
<file>themes/monochrome/update.png</file> <file>themes/monochrome/16/update.png</file>
<file>themes/monochrome/contributors.png</file> <file>themes/monochrome/16/contributors.png</file>
<file>themes/monochrome/stop.png</file> <file>themes/monochrome/16/stop.png</file>
<file>themes/monochrome/write_eeprom.png</file> <file>themes/monochrome/16/write_eeprom.png</file>
<file>themes/classic/open.png</file> <file>themes/monochrome/24/open.png</file>
<file>themes/classic/edit.png</file> <file>themes/monochrome/24/edit.png</file>
<file>themes/classic/information.png</file> <file>themes/monochrome/24/information.png</file>
<file>themes/classic/configure.png</file> <file>themes/monochrome/24/configure.png</file>
<file>themes/classic/switch_dir.png</file> <file>themes/monochrome/24/switch_dir.png</file>
<file>themes/classic/list.png</file> <file>themes/monochrome/24/list.png</file>
<file>themes/classic/wizard.png</file> <file>themes/monochrome/24/wizard.png</file>
<file>themes/classic/logs.png</file> <file>themes/monochrome/24/logs.png</file>
<file>themes/classic/new.png</file> <file>themes/monochrome/24/new.png</file>
<file>themes/classic/save.png</file> <file>themes/monochrome/24/save.png</file>
<file>themes/classic/recentdocument.png</file> <file>themes/monochrome/24/recentdocument.png</file>
<file>themes/classic/simulate.png</file> <file>themes/monochrome/24/simulate.png</file>
<file>themes/classic/changelog.png</file> <file>themes/monochrome/24/changelog.png</file>
<file>themes/classic/copy.png</file> <file>themes/monochrome/24/copy.png</file>
<file>themes/classic/write_flash.png</file> <file>themes/monochrome/24/write_flash.png</file>
<file>themes/classic/read_eeprom_file.png</file> <file>themes/monochrome/24/read_eeprom_file.png</file>
<file>themes/classic/clear.png</file> <file>themes/monochrome/24/clear.png</file>
<file>themes/classic/play.png</file> <file>themes/monochrome/24/play.png</file>
<file>themes/classic/fuses.png</file> <file>themes/monochrome/24/fuses.png</file>
<file>themes/classic/arrow-right.png</file> <file>themes/monochrome/24/arrow-right.png</file>
<file>themes/classic/exit.png</file> <file>themes/monochrome/24/exit.png</file>
<file>themes/classic/moveup.png</file> <file>themes/monochrome/24/moveup.png</file>
<file>themes/classic/read_eeprom.png</file> <file>themes/monochrome/24/read_eeprom.png</file>
<file>themes/classic/cut.png</file> <file>themes/monochrome/24/cut.png</file>
<file>themes/classic/arrow-left.png</file> <file>themes/monochrome/24/arrow-left.png</file>
<file>themes/classic/write_eeprom_file.png</file> <file>themes/monochrome/24/write_eeprom_file.png</file>
<file>themes/classic/library.png</file> <file>themes/monochrome/24/library.png</file>
<file>themes/classic/profiles.png</file> <file>themes/monochrome/24/profiles.png</file>
<file>themes/classic/paste.png</file> <file>themes/monochrome/24/paste.png</file>
<file>themes/classic/print.png</file> <file>themes/monochrome/24/print.png</file>
<file>themes/classic/compare.png</file> <file>themes/monochrome/24/compare.png</file>
<file>themes/classic/customize.png</file> <file>themes/monochrome/24/customize.png</file>
<file>themes/classic/saveas.png</file> <file>themes/monochrome/24/saveas.png</file>
<file>themes/classic/preferences.png</file> <file>themes/monochrome/24/preferences.png</file>
<file>themes/classic/movedown.png</file> <file>themes/monochrome/24/movedown.png</file>
<file>themes/classic/currentmodel.png</file> <file>themes/monochrome/24/currentmodel.png</file>
<file>themes/classic/read_flash.png</file> <file>themes/monochrome/24/read_flash.png</file>
<file>themes/classic/duplicate.png</file> <file>themes/monochrome/24/duplicate.png</file>
<file>themes/classic/add.png</file> <file>themes/monochrome/24/add.png</file>
<file>themes/classic/update.png</file> <file>themes/monochrome/24/update.png</file>
<file>themes/classic/contributors.png</file> <file>themes/monochrome/24/contributors.png</file>
<file>themes/classic/stop.png</file> <file>themes/monochrome/24/stop.png</file>
<file>themes/classic/write_eeprom.png</file> <file>themes/monochrome/24/write_eeprom.png</file>
<file>themes/monochrome/32/open.png</file>
<file>themes/monochrome/32/edit.png</file>
<file>themes/monochrome/32/information.png</file>
<file>themes/monochrome/32/configure.png</file>
<file>themes/monochrome/32/switch_dir.png</file>
<file>themes/monochrome/32/list.png</file>
<file>themes/monochrome/32/wizard.png</file>
<file>themes/monochrome/32/logs.png</file>
<file>themes/monochrome/32/new.png</file>
<file>themes/monochrome/32/save.png</file>
<file>themes/monochrome/32/recentdocument.png</file>
<file>themes/monochrome/32/simulate.png</file>
<file>themes/monochrome/32/changelog.png</file>
<file>themes/monochrome/32/copy.png</file>
<file>themes/monochrome/32/write_flash.png</file>
<file>themes/monochrome/32/read_eeprom_file.png</file>
<file>themes/monochrome/32/clear.png</file>
<file>themes/monochrome/32/play.png</file>
<file>themes/monochrome/32/fuses.png</file>
<file>themes/monochrome/32/arrow-right.png</file>
<file>themes/monochrome/32/exit.png</file>
<file>themes/monochrome/32/moveup.png</file>
<file>themes/monochrome/32/read_eeprom.png</file>
<file>themes/monochrome/32/cut.png</file>
<file>themes/monochrome/32/arrow-left.png</file>
<file>themes/monochrome/32/write_eeprom_file.png</file>
<file>themes/monochrome/32/library.png</file>
<file>themes/monochrome/32/profiles.png</file>
<file>themes/monochrome/32/paste.png</file>
<file>themes/monochrome/32/print.png</file>
<file>themes/monochrome/32/compare.png</file>
<file>themes/monochrome/32/customize.png</file>
<file>themes/monochrome/32/saveas.png</file>
<file>themes/monochrome/32/preferences.png</file>
<file>themes/monochrome/32/movedown.png</file>
<file>themes/monochrome/32/currentmodel.png</file>
<file>themes/monochrome/32/read_flash.png</file>
<file>themes/monochrome/32/duplicate.png</file>
<file>themes/monochrome/32/add.png</file>
<file>themes/monochrome/32/update.png</file>
<file>themes/monochrome/32/contributors.png</file>
<file>themes/monochrome/32/stop.png</file>
<file>themes/monochrome/32/write_eeprom.png</file>
<file>themes/monochrome/48/open.png</file>
<file>themes/monochrome/48/edit.png</file>
<file>themes/monochrome/48/information.png</file>
<file>themes/monochrome/48/configure.png</file>
<file>themes/monochrome/48/switch_dir.png</file>
<file>themes/monochrome/48/list.png</file>
<file>themes/monochrome/48/wizard.png</file>
<file>themes/monochrome/48/logs.png</file>
<file>themes/monochrome/48/new.png</file>
<file>themes/monochrome/48/save.png</file>
<file>themes/monochrome/48/recentdocument.png</file>
<file>themes/monochrome/48/simulate.png</file>
<file>themes/monochrome/48/changelog.png</file>
<file>themes/monochrome/48/copy.png</file>
<file>themes/monochrome/48/write_flash.png</file>
<file>themes/monochrome/48/read_eeprom_file.png</file>
<file>themes/monochrome/48/clear.png</file>
<file>themes/monochrome/48/play.png</file>
<file>themes/monochrome/48/fuses.png</file>
<file>themes/monochrome/48/arrow-right.png</file>
<file>themes/monochrome/48/exit.png</file>
<file>themes/monochrome/48/moveup.png</file>
<file>themes/monochrome/48/read_eeprom.png</file>
<file>themes/monochrome/48/cut.png</file>
<file>themes/monochrome/48/arrow-left.png</file>
<file>themes/monochrome/48/write_eeprom_file.png</file>
<file>themes/monochrome/48/library.png</file>
<file>themes/monochrome/48/profiles.png</file>
<file>themes/monochrome/48/paste.png</file>
<file>themes/monochrome/48/print.png</file>
<file>themes/monochrome/48/compare.png</file>
<file>themes/monochrome/48/customize.png</file>
<file>themes/monochrome/48/saveas.png</file>
<file>themes/monochrome/48/preferences.png</file>
<file>themes/monochrome/48/movedown.png</file>
<file>themes/monochrome/48/currentmodel.png</file>
<file>themes/monochrome/48/read_flash.png</file>
<file>themes/monochrome/48/duplicate.png</file>
<file>themes/monochrome/48/add.png</file>
<file>themes/monochrome/48/update.png</file>
<file>themes/monochrome/48/contributors.png</file>
<file>themes/monochrome/48/stop.png</file>
<file>themes/monochrome/48/write_eeprom.png</file>
<file>themes/classic/16/open.png</file>
<file>themes/classic/16/edit.png</file>
<file>themes/classic/16/information.png</file>
<file>themes/classic/16/configure.png</file>
<file>themes/classic/16/switch_dir.png</file>
<file>themes/classic/16/list.png</file>
<file>themes/classic/16/wizard.png</file>
<file>themes/classic/16/logs.png</file>
<file>themes/classic/16/new.png</file>
<file>themes/classic/16/save.png</file>
<file>themes/classic/16/recentdocument.png</file>
<file>themes/classic/16/simulate.png</file>
<file>themes/classic/16/changelog.png</file>
<file>themes/classic/16/copy.png</file>
<file>themes/classic/16/write_flash.png</file>
<file>themes/classic/16/read_eeprom_file.png</file>
<file>themes/classic/16/clear.png</file>
<file>themes/classic/16/play.png</file>
<file>themes/classic/16/fuses.png</file>
<file>themes/classic/16/arrow-right.png</file>
<file>themes/classic/16/exit.png</file>
<file>themes/classic/16/moveup.png</file>
<file>themes/classic/16/read_eeprom.png</file>
<file>themes/classic/16/cut.png</file>
<file>themes/classic/16/arrow-left.png</file>
<file>themes/classic/16/write_eeprom_file.png</file>
<file>themes/classic/16/library.png</file>
<file>themes/classic/16/profiles.png</file>
<file>themes/classic/16/paste.png</file>
<file>themes/classic/16/print.png</file>
<file>themes/classic/16/compare.png</file>
<file>themes/classic/16/customize.png</file>
<file>themes/classic/16/saveas.png</file>
<file>themes/classic/16/preferences.png</file>
<file>themes/classic/16/movedown.png</file>
<file>themes/classic/16/currentmodel.png</file>
<file>themes/classic/16/read_flash.png</file>
<file>themes/classic/16/duplicate.png</file>
<file>themes/classic/16/add.png</file>
<file>themes/classic/16/update.png</file>
<file>themes/classic/16/contributors.png</file>
<file>themes/classic/16/stop.png</file>
<file>themes/classic/16/write_eeprom.png</file>
<file>themes/classic/24/open.png</file>
<file>themes/classic/24/edit.png</file>
<file>themes/classic/24/information.png</file>
<file>themes/classic/24/configure.png</file>
<file>themes/classic/24/switch_dir.png</file>
<file>themes/classic/24/list.png</file>
<file>themes/classic/24/wizard.png</file>
<file>themes/classic/24/logs.png</file>
<file>themes/classic/24/new.png</file>
<file>themes/classic/24/save.png</file>
<file>themes/classic/24/recentdocument.png</file>
<file>themes/classic/24/simulate.png</file>
<file>themes/classic/24/changelog.png</file>
<file>themes/classic/24/copy.png</file>
<file>themes/classic/24/write_flash.png</file>
<file>themes/classic/24/read_eeprom_file.png</file>
<file>themes/classic/24/clear.png</file>
<file>themes/classic/24/play.png</file>
<file>themes/classic/24/fuses.png</file>
<file>themes/classic/24/arrow-right.png</file>
<file>themes/classic/24/exit.png</file>
<file>themes/classic/24/moveup.png</file>
<file>themes/classic/24/read_eeprom.png</file>
<file>themes/classic/24/cut.png</file>
<file>themes/classic/24/arrow-left.png</file>
<file>themes/classic/24/write_eeprom_file.png</file>
<file>themes/classic/24/library.png</file>
<file>themes/classic/24/profiles.png</file>
<file>themes/classic/24/paste.png</file>
<file>themes/classic/24/print.png</file>
<file>themes/classic/24/compare.png</file>
<file>themes/classic/24/customize.png</file>
<file>themes/classic/24/saveas.png</file>
<file>themes/classic/24/preferences.png</file>
<file>themes/classic/24/movedown.png</file>
<file>themes/classic/24/currentmodel.png</file>
<file>themes/classic/24/read_flash.png</file>
<file>themes/classic/24/duplicate.png</file>
<file>themes/classic/24/add.png</file>
<file>themes/classic/24/update.png</file>
<file>themes/classic/24/contributors.png</file>
<file>themes/classic/24/stop.png</file>
<file>themes/classic/24/write_eeprom.png</file>
<file>themes/classic/32/open.png</file>
<file>themes/classic/32/edit.png</file>
<file>themes/classic/32/information.png</file>
<file>themes/classic/32/configure.png</file>
<file>themes/classic/32/switch_dir.png</file>
<file>themes/classic/32/list.png</file>
<file>themes/classic/32/wizard.png</file>
<file>themes/classic/32/logs.png</file>
<file>themes/classic/32/new.png</file>
<file>themes/classic/32/save.png</file>
<file>themes/classic/32/recentdocument.png</file>
<file>themes/classic/32/simulate.png</file>
<file>themes/classic/32/changelog.png</file>
<file>themes/classic/32/copy.png</file>
<file>themes/classic/32/write_flash.png</file>
<file>themes/classic/32/read_eeprom_file.png</file>
<file>themes/classic/32/clear.png</file>
<file>themes/classic/32/play.png</file>
<file>themes/classic/32/fuses.png</file>
<file>themes/classic/32/arrow-right.png</file>
<file>themes/classic/32/exit.png</file>
<file>themes/classic/32/moveup.png</file>
<file>themes/classic/32/read_eeprom.png</file>
<file>themes/classic/32/cut.png</file>
<file>themes/classic/32/arrow-left.png</file>
<file>themes/classic/32/write_eeprom_file.png</file>
<file>themes/classic/32/library.png</file>
<file>themes/classic/32/profiles.png</file>
<file>themes/classic/32/paste.png</file>
<file>themes/classic/32/print.png</file>
<file>themes/classic/32/compare.png</file>
<file>themes/classic/32/customize.png</file>
<file>themes/classic/32/saveas.png</file>
<file>themes/classic/32/preferences.png</file>
<file>themes/classic/32/movedown.png</file>
<file>themes/classic/32/currentmodel.png</file>
<file>themes/classic/32/read_flash.png</file>
<file>themes/classic/32/duplicate.png</file>
<file>themes/classic/32/add.png</file>
<file>themes/classic/32/update.png</file>
<file>themes/classic/32/contributors.png</file>
<file>themes/classic/32/stop.png</file>
<file>themes/classic/32/write_eeprom.png</file>
<file>themes/classic/48/open.png</file>
<file>themes/classic/48/edit.png</file>
<file>themes/classic/48/information.png</file>
<file>themes/classic/48/configure.png</file>
<file>themes/classic/48/switch_dir.png</file>
<file>themes/classic/48/list.png</file>
<file>themes/classic/48/wizard.png</file>
<file>themes/classic/48/logs.png</file>
<file>themes/classic/48/new.png</file>
<file>themes/classic/48/save.png</file>
<file>themes/classic/48/recentdocument.png</file>
<file>themes/classic/48/simulate.png</file>
<file>themes/classic/48/changelog.png</file>
<file>themes/classic/48/copy.png</file>
<file>themes/classic/48/write_flash.png</file>
<file>themes/classic/48/read_eeprom_file.png</file>
<file>themes/classic/48/clear.png</file>
<file>themes/classic/48/play.png</file>
<file>themes/classic/48/fuses.png</file>
<file>themes/classic/48/arrow-right.png</file>
<file>themes/classic/48/exit.png</file>
<file>themes/classic/48/moveup.png</file>
<file>themes/classic/48/read_eeprom.png</file>
<file>themes/classic/48/cut.png</file>
<file>themes/classic/48/arrow-left.png</file>
<file>themes/classic/48/write_eeprom_file.png</file>
<file>themes/classic/48/library.png</file>
<file>themes/classic/48/profiles.png</file>
<file>themes/classic/48/paste.png</file>
<file>themes/classic/48/print.png</file>
<file>themes/classic/48/compare.png</file>
<file>themes/classic/48/customize.png</file>
<file>themes/classic/48/saveas.png</file>
<file>themes/classic/48/preferences.png</file>
<file>themes/classic/48/movedown.png</file>
<file>themes/classic/48/currentmodel.png</file>
<file>themes/classic/48/read_flash.png</file>
<file>themes/classic/48/duplicate.png</file>
<file>themes/classic/48/add.png</file>
<file>themes/classic/48/update.png</file>
<file>themes/classic/48/contributors.png</file>
<file>themes/classic/48/stop.png</file>
<file>themes/classic/48/write_eeprom.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -30,7 +30,7 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="companion.qrc"> <iconset resource="companion.qrc">
<normaloff>:/images/print.png</normaloff>:/images/print.png</iconset> <normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">

View file

@ -44,7 +44,7 @@ const char * Er9xInterface::getName()
const int Er9xInterface::getEEpromSize() const int Er9xInterface::getEEpromSize()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString avrMCU = settings.value("mcu", QString("m64")).toString(); QString avrMCU = settings.value("mcu", QString("m64")).toString();
if (avrMCU==QString("m128")) { if (avrMCU==QString("m128")) {
return 2*EESIZE_STOCK; return 2*EESIZE_STOCK;

View file

@ -47,7 +47,7 @@ const char * Gruvin9xInterface::getName()
const int Gruvin9xInterface::getEEpromSize() const int Gruvin9xInterface::getEEpromSize()
{ {
if (board == BOARD_STOCK) { if (board == BOARD_STOCK) {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString avrMCU = settings.value("mcu", QString("m64")).toString(); QString avrMCU = settings.value("mcu", QString("m64")).toString();
if (avrMCU==QString("m128")) { if (avrMCU==QString("m128")) {
return EESIZE_STOCK*2; return EESIZE_STOCK*2;

View file

@ -135,7 +135,7 @@ using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator(Open9xInterface * open9xInterface): Open9xSky9xSimulator::Open9xSky9xSimulator(Open9xInterface * open9xInterface):
open9xInterface(open9xInterface) open9xInterface(open9xInterface)
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString path=settings.value("sdPath", ".").toString()+"/"; QString path=settings.value("sdPath", ".").toString()+"/";
int i=0; int i=0;
for (i=0; i< std::min(path.length(),1022); i++) { for (i=0; i< std::min(path.length(),1022); i++) {

View file

@ -145,7 +145,7 @@ OpentxTaranisSimulator::OpentxTaranisSimulator(Open9xInterface * open9xInterface
open9xInterface(open9xInterface) open9xInterface(open9xInterface)
{ {
taranisSimulatorBoard = GetEepromInterface()->getBoard(); taranisSimulatorBoard = GetEepromInterface()->getBoard();
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString path=settings.value("sdPath", ".").toString()+"/"; QString path=settings.value("sdPath", ".").toString()+"/";
int i=0; int i=0;
for (i=0; i< std::min(path.length(),1022); i++) { for (i=0; i< std::min(path.length(),1022); i++) {

View file

@ -44,7 +44,7 @@ const char * Th9xInterface::getName()
const int Th9xInterface::getEEpromSize() const int Th9xInterface::getEEpromSize()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString avrMCU = settings.value("mcu", QString("m64")).toString(); QString avrMCU = settings.value("mcu", QString("m64")).toString();
if (avrMCU==QString("m128")) { if (avrMCU==QString("m128")) {
return 2*EESIZE_STOCK; return 2*EESIZE_STOCK;

View file

@ -1484,3 +1484,10 @@ QString getCenterBeep(ModelData * g_model)
if(g_model->beepANACenter & 0x80) strl << "LS"; if(g_model->beepANACenter & 0x80) strl << "LS";
return strl.join(", "); return strl.join(", ");
} }
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage) {
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));
}

View file

@ -28,6 +28,7 @@ void populateVoiceLangCB(QComboBox *b, QString language);
void populateTTraceCB(QComboBox *b, int value); 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);
class GVarGroup : public QObject { class GVarGroup : public QObject {

View file

@ -59,6 +59,7 @@
#include "burndialog.h" #include "burndialog.h"
#include "hexinterface.h" #include "hexinterface.h"
#include "warnings.h" #include "warnings.h"
#include "helpers.h"
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include #include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2" #define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
@ -80,6 +81,7 @@
#include "mountlist.h" #include "mountlist.h"
#endif #endif
MainWindow::MainWindow(): MainWindow::MainWindow():
downloadDialog_forWait(NULL) downloadDialog_forWait(NULL)
{ {
@ -104,6 +106,24 @@ downloadDialog_forWait(NULL)
Theme="monochrome"; Theme="monochrome";
break; break;
} }
int icon_size=settings.value("icon_size", 1).toInt();
switch (icon_size) {
case 0:
ISize="16";
break;
case 1:
ISize="24";
break;
case 2:
ISize="32";
break;
case 3:
ISize="48";
break;
default:
ISize="24";
break;
}
restoreGeometry(settings.value("mainWindowGeometry").toByteArray()); restoreGeometry(settings.value("mainWindowGeometry").toByteArray());
createActions(); createActions();
createMenus(); createMenus();
@ -1069,14 +1089,18 @@ void MainWindow::burnFrom()
QStringList str; QStringList str;
str << path << tempFile; str << path << tempFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
res = ad->exec(); res = ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetReceiveEEpromCommand(tempFile); QStringList str = GetReceiveEEpromCommand(tempFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
res = ad->exec(); res = ad->exec();
} }
if(QFileInfo(tempFile).exists() && res) { if(QFileInfo(tempFile).exists() && res) {
@ -1126,14 +1150,18 @@ void MainWindow::burnExtenalToEEPROM()
QStringList str; QStringList str;
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
@ -1143,7 +1171,9 @@ void MainWindow::burnExtenalToEEPROM()
QString tempFlash = tempDir + "/flash.bin"; QString tempFlash = tempDir + "/flash.bin";
QStringList str = GetReceiveFlashCommand(tempFlash); QStringList str = GetReceiveFlashCommand(tempFlash);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx"); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx");
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_flash.png")); QIcon icon;
populate_icon(&icon,Theme,"read_flash.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
QString restoreFile = tempDir + "/compat.bin"; QString restoreFile = tempDir + "/compat.bin";
@ -1176,14 +1206,18 @@ void MainWindow::burnExtenalToEEPROM()
QStringList str; QStringList str;
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile); QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
@ -1198,14 +1232,18 @@ void MainWindow::burnExtenalToEEPROM()
QStringList str; QStringList str;
str << fileName << path; str << fileName << path;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write Models and Settings To Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write Models and Settings To Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetSendEEpromCommand(fileName); QStringList str = GetSendEEpromCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Models and Settings To Tx", AVR_DIALOG_SHOW_DONE); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Models and Settings To Tx", AVR_DIALOG_SHOW_DONE);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/write_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"write_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
} }
@ -1370,13 +1408,17 @@ void MainWindow::burnToFlash(QString fileToFlash)
} }
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
int res = ad->exec(); int res = ad->exec();
if (QFileInfo(backupFile).exists() && res) { if (QFileInfo(backupFile).exists() && res) {
sleep(1); sleep(1);
QStringList str = GetSendFlashCommand(fileName); QStringList str = GetSendFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/write_flash.png")); QIcon iconw;
populate_icon(&iconw,Theme,"write_eeprom.png");
ad->setWindowIcon(iconw);
int res = ad->exec(); int res = ad->exec();
if (res) { if (res) {
QString restoreFile = tempDir + "/restore.bin"; QString restoreFile = tempDir + "/restore.bin";
@ -1387,7 +1429,7 @@ void MainWindow::burnToFlash(QString fileToFlash)
sleep(1); sleep(1);
QStringList str = GetSendEEpromCommand(restoreFile); QStringList str = GetSendEEpromCommand(restoreFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Restore Models and Settings To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Restore Models and Settings To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/write_eeprom.png")); ad->setWindowIcon(iconw);
res=ad->exec(); res=ad->exec();
if (!res) { if (!res) {
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to TX. The models and settings data file can be found at: %1").arg(backupFile)); QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to TX. The models and settings data file can be found at: %1").arg(backupFile));
@ -1412,14 +1454,18 @@ void MainWindow::burnToFlash(QString fileToFlash)
QString backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin"; QString backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
QStringList str = GetSendFlashCommand(fileName); QStringList str = GetSendFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_SHOW_DONE); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_SHOW_DONE);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/write_flash.png")); QIcon iconw;
populate_icon(&iconw,Theme,"read_eeprom.png");
ad->setWindowIcon(iconw);
ad->exec(); ad->exec();
} }
} }
@ -1440,14 +1486,18 @@ void MainWindow::burnExtenalFromEEPROM()
QStringList str; QStringList str;
str << path << fileName; str << path << fileName;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
} else { } else {
settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
QStringList str = GetReceiveEEpromCommand(fileName); QStringList str = GetReceiveEEpromCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_eeprom.png")); QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
} }
@ -1465,7 +1515,9 @@ void MainWindow::burnFromFlash()
settings.setValue("lastFlashDir",QFileInfo(fileName).dir().absolutePath()); settings.setValue("lastFlashDir",QFileInfo(fileName).dir().absolutePath());
QStringList str = GetReceiveFlashCommand(fileName); QStringList str = GetReceiveFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx"); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx");
ad->setWindowIcon(QIcon(":/themes/"+Theme+"/read_flash.png")); QIcon icon;
populate_icon(&icon,Theme,"read_flash.png");
ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
@ -1605,137 +1657,191 @@ MdiChild *MainWindow::createMdiChild()
void MainWindow::createActions() void MainWindow::createActions()
{ {
newAct = new QAction(QIcon(":/themes/"+Theme+"/new.png"), tr("&New"), this); QIcon newActIcon;
populate_icon(&newActIcon,Theme,"new.png");
newAct = new QAction(newActIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New); newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file")); newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
openAct = new QAction(QIcon(":/themes/"+Theme+"/open.png"), tr("&Open..."), this); QIcon openActIcon;
populate_icon(&openActIcon,Theme,"open.png");
openAct = new QAction(openActIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open); openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file")); openAct->setStatusTip(tr("Open an existing file"));
connect(openAct, SIGNAL(triggered()), this, SLOT(openFile())); connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));
loadbackupAct = new QAction(QIcon(":/themes/"+Theme+"/open.png"), tr("&loadBackup..."), this); loadbackupAct = new QAction(openActIcon, tr("&loadBackup..."), this);
loadbackupAct->setStatusTip(tr("Load backup from file")); loadbackupAct->setStatusTip(tr("Load backup from file"));
connect(loadbackupAct, SIGNAL(triggered()), this, SLOT(loadBackup())); connect(loadbackupAct, SIGNAL(triggered()), this, SLOT(loadBackup()));
saveAct = new QAction(QIcon(":/themes/"+Theme+"/save.png"), tr("&Save"), this); QIcon saveActIcon;
populate_icon(&saveActIcon,Theme,"save.png");
saveAct = new QAction(saveActIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save); saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk")); saveAct->setStatusTip(tr("Save the document to disk"));
connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
saveAsAct = new QAction(QIcon(":/themes/"+Theme+"/saveas.png"), tr("Save &As..."), this); QIcon saveAsActIcon;
populate_icon(&saveAsActIcon,Theme,"saveas.png");
saveAsAct = new QAction(saveAsActIcon, tr("Save &As..."), this);
saveAsAct->setShortcuts(QKeySequence::SaveAs); saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name")); saveAsAct->setStatusTip(tr("Save the document under a new name"));
connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
logsAct = new QAction(QIcon(":/themes/"+Theme+"/logs.png"), tr("Lo&gs"), this); QIcon logsActIcon;
populate_icon(&logsActIcon,Theme,"logs.png");
logsAct = new QAction(logsActIcon, tr("Lo&gs"), this);
logsAct->setShortcut(tr("Ctrl+G")); logsAct->setShortcut(tr("Ctrl+G"));
logsAct->setStatusTip(tr("Open log file")); logsAct->setStatusTip(tr("Open log file"));
connect(logsAct, SIGNAL(triggered()), this, SLOT(logFile())); connect(logsAct, SIGNAL(triggered()), this, SLOT(logFile()));
preferencesAct = new QAction(QIcon(":/themes/"+Theme+"/preferences.png"), tr("&Preferences..."), this); QIcon preferencesActIcon;
populate_icon(&preferencesActIcon,Theme,"preferences.png");
preferencesAct = new QAction(preferencesActIcon, tr("&Preferences..."), this);
preferencesAct->setStatusTip(tr("Edit general preferences")); preferencesAct->setStatusTip(tr("Edit general preferences"));
connect(preferencesAct, SIGNAL(triggered()), this, SLOT(preferences())); connect(preferencesAct, SIGNAL(triggered()), this, SLOT(preferences()));
checkForUpdatesAct = new QAction(QIcon(":/themes/"+Theme+"/update.png"), tr("&Check for updates..."), this); QIcon checkForUpdatesActIcon;
populate_icon(&checkForUpdatesActIcon,Theme,"update.png");
checkForUpdatesAct = new QAction(checkForUpdatesActIcon, tr("&Check for updates..."), this);
checkForUpdatesAct->setStatusTip(tr("Check for new version of Companion")); checkForUpdatesAct->setStatusTip(tr("Check for new version of Companion"));
connect(checkForUpdatesAct, SIGNAL(triggered()), this, SLOT(doUpdates())); connect(checkForUpdatesAct, SIGNAL(triggered()), this, SLOT(doUpdates()));
contributorsAct = new QAction(QIcon(":/themes/"+Theme+"/contributors.png"), tr("Contributors &List..."), this); QIcon contributorsActIcon;
populate_icon(&contributorsActIcon,Theme,"contributors.png");
contributorsAct = new QAction(contributorsActIcon, tr("Contributors &List..."), this);
contributorsAct->setStatusTip(tr("Show Companion contributors list")); contributorsAct->setStatusTip(tr("Show Companion contributors list"));
connect(contributorsAct, SIGNAL(triggered()), this, SLOT(contributors())); connect(contributorsAct, SIGNAL(triggered()), this, SLOT(contributors()));
changelogAct = new QAction(QIcon(":/themes/"+Theme+"/changelog.png"), tr("ChangeLog..."), this); QIcon changelogActIcon;
populate_icon(&changelogActIcon,Theme,"changelog.png");
changelogAct = new QAction(changelogActIcon, tr("ChangeLog..."), this);
changelogAct->setStatusTip(tr("Show Companion changelog")); changelogAct->setStatusTip(tr("Show Companion changelog"));
connect(changelogAct, SIGNAL(triggered()), this, SLOT(changelog())); connect(changelogAct, SIGNAL(triggered()), this, SLOT(changelog()));
fwchangelogAct = new QAction(QIcon(":/themes/"+Theme+"/changelog.png"), tr("Firmware ChangeLog..."), this); QIcon fwchangelogActIcon;
populate_icon(&fwchangelogActIcon,Theme,"changelog.png");
fwchangelogAct = new QAction(fwchangelogActIcon, tr("Firmware ChangeLog..."), this);
fwchangelogAct->setStatusTip(tr("Show firmware changelog")); fwchangelogAct->setStatusTip(tr("Show firmware changelog"));
connect(fwchangelogAct, SIGNAL(triggered()), this, SLOT(fwchangelog())); connect(fwchangelogAct, SIGNAL(triggered()), this, SLOT(fwchangelog()));
compareAct = new QAction(QIcon(":/themes/"+Theme+"/compare.png"), tr("Compare..."), this); QIcon compareActIcon;
populate_icon(&compareActIcon,Theme,"compare.png");
compareAct = new QAction(compareActIcon, tr("Compare..."), this);
compareAct->setStatusTip(tr("Compare models")); compareAct->setStatusTip(tr("Compare models"));
compareAct->setEnabled(false); compareAct->setEnabled(false);
connect(compareAct, SIGNAL(triggered()), this, SLOT(compare())); connect(compareAct, SIGNAL(triggered()), this, SLOT(compare()));
customizeSplashAct = new QAction(QIcon(":/themes/"+Theme+"/customize.png"), tr("Customize your &TX..."), this); QIcon customizeSplashActIcon;
populate_icon(&customizeSplashActIcon,Theme,"customize.png");
customizeSplashAct = new QAction(customizeSplashActIcon, tr("Customize your &TX..."), this);
customizeSplashAct->setStatusTip(tr("Customize the splash screen of your TX")); customizeSplashAct->setStatusTip(tr("Customize the splash screen of your TX"));
connect(customizeSplashAct, SIGNAL(triggered()), this, SLOT(customizeSplash())); connect(customizeSplashAct, SIGNAL(triggered()), this, SLOT(customizeSplash()));
//! [0] //! [0]
exitAct = new QAction(QIcon(":/themes/"+Theme+"/exit.png"), tr("E&xit"), this); QIcon exitActIcon;
populate_icon(&exitActIcon,Theme,"exit.png");
exitAct = new QAction(exitActIcon, tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit); exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application")); exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
//! [0] //! [0]
cutAct = new QAction(QIcon(":/themes/"+Theme+"/cut.png"), tr("Cu&t"), this); QIcon cutActIcon;
populate_icon(&cutActIcon,Theme,"cut.png");
cutAct = new QAction(cutActIcon, tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut); cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the " cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard")); "clipboard"));
connect(cutAct, SIGNAL(triggered()), this, SLOT(cut())); connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
copyAct = new QAction(QIcon(":/themes/"+Theme+"/copy.png"), tr("&Copy"), this); QIcon copyActIcon;
populate_icon(&copyActIcon,Theme,"copy.png");
copyAct = new QAction(copyActIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy); copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the " copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard")); "clipboard"));
connect(copyAct, SIGNAL(triggered()), this, SLOT(copy())); connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
pasteAct = new QAction(QIcon(":/themes/"+Theme+"/paste.png"), tr("&Paste"), this); QIcon pasteActIcon;
populate_icon(&pasteActIcon,Theme,"paste.png");
pasteAct = new QAction(pasteActIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste); pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current " pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection")); "selection"));
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste())); connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
QIcon burnToActIcon;
burnToAct = new QAction(QIcon(":/themes/"+Theme+"/write_eeprom.png"), tr("&Write Models and Settings To Tx"), this); populate_icon(&burnToActIcon,Theme,"write_eeprom.png");
burnToAct = new QAction(burnToActIcon, tr("&Write Models and Settings To Tx"), this);
burnToAct->setShortcut(tr("Ctrl+Alt+W")); burnToAct->setShortcut(tr("Ctrl+Alt+W"));
burnToAct->setStatusTip(tr("Write Models and Settings to transmitter")); burnToAct->setStatusTip(tr("Write Models and Settings to transmitter"));
connect(burnToAct,SIGNAL(triggered()),this,SLOT(burnTo())); connect(burnToAct,SIGNAL(triggered()),this,SLOT(burnTo()));
burnFromAct = new QAction(QIcon(":/themes/"+Theme+"/read_eeprom.png"), tr("&Read Models and Settings From Tx"), this); QIcon burnFromActIcon;
populate_icon(&burnFromActIcon,Theme,"read_eeprom.png");
burnFromAct = new QAction(burnFromActIcon, tr("&Read Models and Settings From Tx"), this);
burnFromAct->setShortcut(tr("Ctrl+Alt+R")); burnFromAct->setShortcut(tr("Ctrl+Alt+R"));
burnFromAct->setStatusTip(tr("Read Models and Settings from transmitter")); burnFromAct->setStatusTip(tr("Read Models and Settings from transmitter"));
connect(burnFromAct,SIGNAL(triggered()),this,SLOT(burnFrom())); connect(burnFromAct,SIGNAL(triggered()),this,SLOT(burnFrom()));
burnToFlashAct = new QAction(QIcon(":/themes/"+Theme+"/write_flash.png"), tr("Write Firmware"), this); QIcon burnToFlashActIcon;
populate_icon(&burnToFlashActIcon,Theme,"write_flash.png");
burnToFlashAct = new QAction(burnToFlashActIcon, tr("Write Firmware"), this);
burnToFlashAct->setStatusTip(tr("Write firmware to transmitter")); burnToFlashAct->setStatusTip(tr("Write firmware to transmitter"));
connect(burnToFlashAct,SIGNAL(triggered()),this,SLOT(burnToFlash())); connect(burnToFlashAct,SIGNAL(triggered()),this,SLOT(burnToFlash()));
burnExtenalToEEPROMAct = new QAction(QIcon(":/themes/"+Theme+"/write_eeprom_file.png"), tr("Write Models and Settings from file to Tx"), this); QIcon burnExtenalToEEPROMActIcon;
populate_icon(&burnExtenalToEEPROMActIcon,Theme,"write_eeprom_file.png");
burnExtenalToEEPROMAct = new QAction(burnExtenalToEEPROMActIcon, tr("Write Models and Settings from file to Tx"), this);
burnExtenalToEEPROMAct->setStatusTip(tr("Write Models and Settings from file to transmitter")); burnExtenalToEEPROMAct->setStatusTip(tr("Write Models and Settings from file to transmitter"));
connect(burnExtenalToEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalToEEPROM())); connect(burnExtenalToEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalToEEPROM()));
burnExtenalFromEEPROMAct = new QAction(QIcon(":/themes/"+Theme+"/read_eeprom_file.png"), tr("Save transmitter Models and Settings to file"), this); QIcon burnExtenalFromEEPROMActIcon;
populate_icon(&burnExtenalFromEEPROMActIcon,Theme,"read_eeprom_file.png");
burnExtenalFromEEPROMAct = new QAction(burnExtenalFromEEPROMActIcon, tr("Save transmitter Models and Settings to file"), this);
burnExtenalFromEEPROMAct->setStatusTip(tr("Save the Models and Settings from the transmitter to a file")); burnExtenalFromEEPROMAct->setStatusTip(tr("Save the Models and Settings from the transmitter to a file"));
connect(burnExtenalFromEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalFromEEPROM())); connect(burnExtenalFromEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalFromEEPROM()));
burnFromFlashAct = new QAction(QIcon(":/themes/"+Theme+"/read_flash.png"), tr("Read Firmware"), this); QIcon burnFromFlashActIcon;
populate_icon(&burnFromFlashActIcon,Theme,"read_flash.png");
burnFromFlashAct = new QAction(burnFromFlashActIcon, tr("Read Firmware"), this);
burnFromFlashAct->setStatusTip(tr("Read firmware from transmitter")); burnFromFlashAct->setStatusTip(tr("Read firmware from transmitter"));
connect(burnFromFlashAct,SIGNAL(triggered()),this,SLOT(burnFromFlash())); connect(burnFromFlashAct,SIGNAL(triggered()),this,SLOT(burnFromFlash()));
burnConfigAct = new QAction(QIcon(":/themes/"+Theme+"/configure.png"), tr("&Configure..."), this); QIcon burnConfigActIcon;
populate_icon(&burnConfigActIcon,Theme,"configure.png");
burnConfigAct = new QAction(burnConfigActIcon, tr("&Configure..."), this);
burnConfigAct->setStatusTip(tr("Configure software for reading from and writing to the transmitter")); burnConfigAct->setStatusTip(tr("Configure software for reading from and writing to the transmitter"));
connect(burnConfigAct,SIGNAL(triggered()),this,SLOT(burnConfig())); connect(burnConfigAct,SIGNAL(triggered()),this,SLOT(burnConfig()));
EEPROMInterface *eepromInterface = GetEepromInterface(); EEPROMInterface *eepromInterface = GetEepromInterface();
if (!IS_ARM(eepromInterface->getBoard())) { if (!IS_ARM(eepromInterface->getBoard())) {
burnListAct = new QAction(QIcon(":/themes/"+Theme+"/list.png"), tr("&List programmers"), this); QIcon burnListActIcon;
populate_icon(&burnListActIcon,Theme,"list.png");
burnListAct = new QAction(burnListActIcon, tr("&List programmers"), this);
burnListAct->setStatusTip(tr("List available programmers")); burnListAct->setStatusTip(tr("List available programmers"));
connect(burnListAct,SIGNAL(triggered()),this,SLOT(burnList())); connect(burnListAct,SIGNAL(triggered()),this,SLOT(burnList()));
burnFusesAct = new QAction(QIcon(":/themes/"+Theme+"/fuses.png"), tr("&Fuses..."), this); QIcon burnFusesActIcon;
populate_icon(&burnFusesActIcon,Theme,"fuses.png");
burnFusesAct = new QAction(burnFusesActIcon, tr("&Fuses..."), this);
burnFusesAct->setStatusTip(tr("Show fuses dialog")); burnFusesAct->setStatusTip(tr("Show fuses dialog"));
connect(burnFusesAct,SIGNAL(triggered()),this,SLOT(burnFuses())); connect(burnFusesAct,SIGNAL(triggered()),this,SLOT(burnFuses()));
} }
simulateAct = new QAction(QIcon(":/themes/"+Theme+"/simulate.png"), tr("&Simulate"), this); QIcon simulateActIcon;
populate_icon(&simulateActIcon,Theme,"simulate.png");
simulateAct = new QAction(simulateActIcon, tr("&Simulate"), this);
simulateAct->setShortcut(tr("Alt+S")); simulateAct->setShortcut(tr("Alt+S"));
simulateAct->setStatusTip(tr("Simulate selected model.")); simulateAct->setStatusTip(tr("Simulate selected model."));
simulateAct->setEnabled(false); simulateAct->setEnabled(false);
connect(simulateAct,SIGNAL(triggered()),this,SLOT(simulate())); connect(simulateAct,SIGNAL(triggered()),this,SLOT(simulate()));
printAct = new QAction(QIcon(":/themes/"+Theme+"/print.png"), tr("&Print"), this); QIcon printActIcon;
populate_icon(&printActIcon,Theme,"print.png");
printAct = new QAction(printActIcon, tr("&Print"), this);
printAct->setShortcut(tr("Ctrl+P")); printAct->setShortcut(tr("Ctrl+P"));
printAct->setStatusTip(tr("Print current model.")); printAct->setStatusTip(tr("Print current model."));
printAct->setEnabled(false); printAct->setEnabled(false);
@ -1775,11 +1881,15 @@ void MainWindow::createActions()
separatorAct = new QAction(this); separatorAct = new QAction(this);
separatorAct->setSeparator(true); separatorAct->setSeparator(true);
aboutAct = new QAction(QIcon(":/themes/"+Theme+"/information.png"), tr("&About"), this); QIcon aboutActIcon;
populate_icon(&aboutActIcon,Theme,"information.png");
aboutAct = new QAction(aboutActIcon, tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box")); aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
switchLayoutDirectionAct = new QAction(QIcon(":/themes/"+Theme+"/switch_dir.png"), tr("Switch layout direction"), this); QIcon switchLayoutDirectionActIcon;
populate_icon(&switchLayoutDirectionActIcon,Theme,"switch_dir.png");
switchLayoutDirectionAct = new QAction(switchLayoutDirectionActIcon, tr("Switch layout direction"), this);
switchLayoutDirectionAct->setStatusTip(tr("Switch layout Left/Right")); switchLayoutDirectionAct->setStatusTip(tr("Switch layout Left/Right"));
connect(switchLayoutDirectionAct, SIGNAL(triggered()), this, SLOT(switchLayoutDirection())); connect(switchLayoutDirectionAct, SIGNAL(triggered()), this, SLOT(switchLayoutDirection()));
for (int i = 0; i < MaxRecentFiles; ++i) { for (int i = 0; i < MaxRecentFiles; ++i) {
@ -1809,7 +1919,9 @@ void MainWindow::createMenus()
fileMenu->addAction(saveAct); fileMenu->addAction(saveAct);
fileMenu->addAction(saveAsAct); fileMenu->addAction(saveAsAct);
fileMenu->addMenu(recentFileMenu); fileMenu->addMenu(recentFileMenu);
recentFileMenu->setIcon(QIcon(":/themes/"+Theme+"/recentdocument.png")); QIcon recentFileMenuIcon;
populate_icon(&recentFileMenuIcon,Theme,"recentdocument.png");
recentFileMenu->setIcon(recentFileMenuIcon);
for ( int i = 0; i < MaxRecentFiles; ++i) for ( int i = 0; i < MaxRecentFiles; ++i)
recentFileMenu->addAction(recentFileActs[i]); recentFileMenu->addAction(recentFileActs[i]);
fileMenu->addSeparator(); fileMenu->addSeparator();
@ -1822,7 +1934,9 @@ void MainWindow::createMenus()
fileMenu->addAction(preferencesAct); fileMenu->addAction(preferencesAct);
fileMenu->addMenu(profilesMenu); fileMenu->addMenu(profilesMenu);
profilesMenu->setIcon(QIcon(":/themes/"+Theme+"/profiles.png")); QIcon profilesMenuIcon;
populate_icon(&profilesMenuIcon,Theme,"profiles.png");
profilesMenu->setIcon(profilesMenuIcon);
for ( int i = 0; i < MAX_PROFILES; ++i) for ( int i = 0; i < MAX_PROFILES; ++i)
profilesMenu->addAction(profileActs[i]); profilesMenu->addAction(profileActs[i]);
fileMenu->addAction(switchLayoutDirectionAct); fileMenu->addAction(switchLayoutDirectionAct);
@ -1912,7 +2026,9 @@ void MainWindow::createToolBars()
QToolButton * recentToolButton = new QToolButton; QToolButton * recentToolButton = new QToolButton;
recentToolButton->setPopupMode(QToolButton::InstantPopup); recentToolButton->setPopupMode(QToolButton::InstantPopup);
recentToolButton->setMenu(createRecentFileMenu()); recentToolButton->setMenu(createRecentFileMenu());
recentToolButton->setIcon(QIcon(":/themes/"+Theme+"/recentdocument.png")); QIcon recentToolButtonIcon;
populate_icon(&recentToolButtonIcon,Theme,"recentdocument.png");
recentToolButton->setIcon(recentToolButtonIcon);
recentToolButton->setToolTip(tr("Recent Files")); recentToolButton->setToolTip(tr("Recent Files"));
fileToolBar->addWidget(recentToolButton); fileToolBar->addWidget(recentToolButton);
fileToolBar->addAction(saveAct); fileToolBar->addAction(saveAct);
@ -1922,7 +2038,9 @@ void MainWindow::createToolBars()
profileButton = new QToolButton; profileButton = new QToolButton;
profileButton->setPopupMode(QToolButton::InstantPopup); profileButton->setPopupMode(QToolButton::InstantPopup);
profileButton->setMenu(createProfilesMenu()); profileButton->setMenu(createProfilesMenu());
profileButton->setIcon(QIcon(":/themes/"+Theme+"/profiles.png")); QIcon profileButtonIcon;
populate_icon(&profileButtonIcon,Theme,"profiles.png");
profileButton->setIcon(profileButtonIcon);
profileButton->setToolTip(tr("Firmware Profiles")); profileButton->setToolTip(tr("Firmware Profiles"));
fileToolBar->addWidget(profileButton); fileToolBar->addWidget(profileButton);
bool notfound=true; bool notfound=true;

View file

@ -139,6 +139,7 @@ private:
int getFileType(const QString &fullFileName); int getFileType(const QString &fullFileName);
QString FindTaranisPath(); QString FindTaranisPath();
QString Theme; QString Theme;
QString ISize;
QString strippedName(const QString &fullFileName); QString strippedName(const QString &fullFileName);
MdiChild *activeMdiChild(); MdiChild *activeMdiChild();

View file

@ -68,8 +68,22 @@ MdiChild::MdiChild():
isUntitled(true), isUntitled(true),
fileChanged(false) fileChanged(false)
{ {
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 SimulateIcon;
populate_icon(&SimulateIcon,Theme,"simulate.png");
ui->setupUi(this);
ui->SimulateTxButton->setIcon(SimulateIcon);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
eepromInterfaceChanged(); eepromInterfaceChanged();

View file

@ -13,6 +13,10 @@
<property name="windowTitle"> <property name="windowTitle">
<string/> <string/>
</property> </property>
<property name="windowIcon">
<iconset resource="companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="ModelsListWidget" name="modelsList"/> <widget class="ModelsListWidget" name="modelsList"/>
@ -22,10 +26,6 @@
<property name="text"> <property name="text">
<string>Simulate Tx</string> <string>Simulate Tx</string>
</property> </property>
<property name="icon">
<iconset resource="companion.qrc">
<normaloff>:/images/simulate.png</normaloff>:/images/simulate.png</iconset>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -2,6 +2,7 @@
#include "ui_curves.h" #include "ui_curves.h"
#include "node.h" #include "node.h"
#include "edge.h" #include "edge.h"
#include "helpers.h"
#include <QSpinBox> #include <QSpinBox>
#include <QCheckBox> #include <QCheckBox>
#include <QPushButton> #include <QPushButton>
@ -83,9 +84,20 @@ 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");
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;
clearIcon.addFile(":/images/clear.png", QSize(), QIcon::Normal, QIcon::Off); populate_icon(&ClearIcon,Theme,"clear.png");
for (int i=0; i<GetEepromInterface()->getCapability(NumCurves); i++) { for (int i=0; i<GetEepromInterface()->getCapability(NumCurves); i++) {
visibleCurves[i] = false; visibleCurves[i] = false;
@ -94,7 +106,7 @@ Curves::Curves(QWidget * parent, ModelData & model):
QPushButton * reset = new QPushButton(this); QPushButton * reset = new QPushButton(this);
reset->setProperty("index", i); reset->setProperty("index", i);
reset->setMinimumSize(QSize(0, 0)); reset->setMinimumSize(QSize(0, 0));
reset->setIcon(clearIcon); reset->setIcon(ClearIcon);
reset->setIconSize(QSize(14, 14)); reset->setIconSize(QSize(14, 14));
connect(reset, SIGNAL(clicked()), this, SLOT(resetCurve())); connect(reset, SIGNAL(clicked()), this, SLOT(resetCurve()));
ui->curvesLayout->addWidget(reset, i, 0, 1, 1); ui->curvesLayout->addWidget(reset, i, 0, 1, 1);

View file

@ -36,7 +36,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
} }
} }
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString path = settings.value("sdPath", ".").toString(); QString path = settings.value("sdPath", ".").toString();
path.append("/SOUNDS/"); path.append("/SOUNDS/");
QString lang = generalSettings.ttsLanguage; QString lang = generalSettings.ttsLanguage;
@ -123,9 +123,22 @@ 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");
int theme_set=settings.value("theme", 1).toInt();
QString Theme;
switch(theme_set) {
case 0:
Theme="classic";
break;
default:
Theme="monochrome";
break;
}
QIcon PlayIcon;
populate_icon(&PlayIcon,Theme,"play.png");
playBT[i] = new QPushButton(this); playBT[i] = new QPushButton(this);
playBT[i]->setObjectName(QString("play_%1").arg(i)); playBT[i]->setObjectName(QString("play_%1").arg(i));
playBT[i]->setIcon(QIcon(":/images/play.png")); playBT[i]->setIcon(PlayIcon);
paramLayout->addWidget(playBT[i]); paramLayout->addWidget(playBT[i]);
connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic())); connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic()));
#endif #endif
@ -160,6 +173,20 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
{ {
if (phononLock) if (phononLock)
return; return;
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;
populate_icon(&PlayIcon,Theme,"play.png");
phononLock=true; phononLock=true;
if ((newState==Phonon::StoppedState || newState==Phonon::PausedState) && oldState==Phonon::PlayingState) { if ((newState==Phonon::StoppedState || newState==Phonon::PausedState) && oldState==Phonon::PlayingState) {
clickObject->stop(); clickObject->stop();
@ -167,7 +194,7 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
clickObject->clear(); clickObject->clear();
for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) { for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) {
playBT[i]->setObjectName(QString("play_%1").arg(i)); playBT[i]->setObjectName(QString("play_%1").arg(i));
playBT[i]->setIcon(QIcon(":/images/play.png")); playBT[i]->setIcon(PlayIcon);
} }
} }
if (newState==Phonon::ErrorState) { if (newState==Phonon::ErrorState) {
@ -176,7 +203,7 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
clickObject->clear(); clickObject->clear();
for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) { for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) {
playBT[i]->setObjectName(QString("play_%1").arg(i)); playBT[i]->setObjectName(QString("play_%1").arg(i));
playBT[i]->setIcon(QIcon(":/images/play.png")); playBT[i]->setIcon(PlayIcon);
} }
} }
@ -189,7 +216,22 @@ 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);
QSettings settings("companion9x", "companion9x"); 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;
populate_icon(&PlayIcon,Theme,"play.png");
QIcon StopIcon;
populate_icon(&StopIcon,Theme,"stop.png");
QString path=settings.value("sdPath", ".").toString(); QString path=settings.value("sdPath", ".").toString();
QDir qd(path); QDir qd(path);
QString track; QString track;
@ -217,12 +259,12 @@ void CustomFunctionsPanel::playMusic()
clickObject->setCurrentSource(Phonon::MediaSource(track)); clickObject->setCurrentSource(Phonon::MediaSource(track));
clickObject->play(); clickObject->play();
playBT[index]->setObjectName(QString("stop_%1").arg(index)); playBT[index]->setObjectName(QString("stop_%1").arg(index));
playBT[index]->setIcon(QIcon(":/images/stop.png")); playBT[index]->setIcon(StopIcon);
} else { } else {
clickObject->stop(); clickObject->stop();
clickObject->clear(); clickObject->clear();
playBT[index]->setObjectName(QString("play_%1").arg(index)); playBT[index]->setObjectName(QString("play_%1").arg(index));
playBT[index]->setIcon(QIcon(":/images/play.png")); playBT[index]->setIcon(PlayIcon);
} }
#endif #endif
} }
@ -457,6 +499,25 @@ 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");
int theme_set=settings.value("theme", 1).toInt();
QString Theme;
switch(theme_set) {
case 0:
Theme="classic";
break;
default:
Theme="monochrome";
break;
}
QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png");
QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png");
QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png");
QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png");
QPoint globalPos = label->mapToGlobal(pos); QPoint globalPos = label->mapToGlobal(pos);
@ -465,10 +526,10 @@ void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
bool hasData = mimeData->hasFormat("application/x-companion9x-fsw"); bool hasData = mimeData->hasFormat("application/x-companion9x-fsw");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(QIcon(":/images/clear.png"), tr("&Delete"),this,SLOT(fswDelete()),tr("Delete")); contextMenu.addAction(ClearIcon, tr("&Delete"),this,SLOT(fswDelete()),tr("Delete"));
contextMenu.addAction(QIcon(":/images/copy.png"), tr("&Copy"),this,SLOT(fswCopy()),tr("Ctrl+C")); contextMenu.addAction(CopyIcon, tr("&Copy"),this,SLOT(fswCopy()),tr("Ctrl+C"));
contextMenu.addAction(QIcon(":/images/cut.png"), tr("&Cut"),this,SLOT(fswCut()),tr("Ctrl+X")); contextMenu.addAction(CutIcon, tr("&Cut"),this,SLOT(fswCut()),tr("Ctrl+X"));
contextMenu.addAction(QIcon(":/images/paste.png"), tr("&Paste"),this,SLOT(fswPaste()),tr("Ctrl+V"))->setEnabled(hasData); contextMenu.addAction(PasteIcon, tr("&Paste"),this,SLOT(fswPaste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }

View file

@ -382,6 +382,25 @@ 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");
int theme_set=settings.value("theme", 1).toInt();
QString Theme;
switch(theme_set) {
case 0:
Theme="classic";
break;
default:
Theme="monochrome";
break;
}
QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png");
QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png");
QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png");
QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png");
QPoint globalPos = label->mapToGlobal(pos); QPoint globalPos = label->mapToGlobal(pos);
@ -390,10 +409,10 @@ void CustomSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
bool hasData = mimeData->hasFormat("application/x-companion9x-csw"); bool hasData = mimeData->hasFormat("application/x-companion9x-csw");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(QIcon(":/images/clear.png"), tr("&Delete"),this,SLOT(cswDelete()),tr("Delete")); contextMenu.addAction(ClearIcon, tr("&Delete"),this,SLOT(cswDelete()),tr("Delete"));
contextMenu.addAction(QIcon(":/images/copy.png"), tr("&Copy"),this,SLOT(cswCopy()),tr("Ctrl+C")); contextMenu.addAction(CopyIcon, tr("&Copy"),this,SLOT(cswCopy()),tr("Ctrl+C"));
contextMenu.addAction(QIcon(":/images/cut.png"), tr("&Cut"),this,SLOT(cswCut()),tr("Ctrl+X")); contextMenu.addAction(CutIcon, tr("&Cut"),this,SLOT(cswCut()),tr("Ctrl+X"));
contextMenu.addAction(QIcon(":/images/paste.png"), tr("&Paste"),this,SLOT(cswPaste()),tr("Ctrl+V"))->setEnabled(hasData); contextMenu.addAction(PasteIcon, tr("&Paste"),this,SLOT(cswPaste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }

View file

@ -8,21 +8,38 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
generalSettings(generalSettings), generalSettings(generalSettings),
expoInserted(false) expoInserted(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 * exposLayout = new QGridLayout(this); QGridLayout * exposLayout = new QGridLayout(this);
ExposlistWidget = new MixersList(this, true); ExposlistWidget = new MixersList(this, true);
QPushButton * qbUp = new QPushButton(this); QPushButton * qbUp = new QPushButton(this);
QPushButton * qbDown = new QPushButton(this); QPushButton * qbDown = new QPushButton(this);
QPushButton * qbClear = new QPushButton(this); QPushButton * qbClear = new QPushButton(this);
QIcon qbUpIcon;
populate_icon(&qbUpIcon,Theme,"moveup.png");
qbUp->setText(tr("Move Up")); qbUp->setText(tr("Move Up"));
qbUp->setIcon(QIcon(":/images/moveup.png")); qbUp->setIcon(qbUpIcon);
qbUp->setShortcut(QKeySequence(tr("Ctrl+Up"))); qbUp->setShortcut(QKeySequence(tr("Ctrl+Up")));
QIcon qbDownIcon;
populate_icon(&qbDownIcon,Theme,"movedown.png");
qbDown->setText(tr("Move Down")); qbDown->setText(tr("Move Down"));
qbDown->setIcon(QIcon(":/images/movedown.png")); qbDown->setIcon(qbDownIcon);
qbDown->setShortcut(QKeySequence(tr("Ctrl+Down"))); qbDown->setShortcut(QKeySequence(tr("Ctrl+Down")));
QIcon qbClearIcon;
populate_icon(&qbClearIcon,Theme,"clear.png");
qbClear->setText(tr("Clear Expo Settings")); qbClear->setText(tr("Clear Expo Settings"));
qbClear->setIcon(QIcon(":/images/clear.png")); qbClear->setIcon(qbClearIcon);
exposLayout->addWidget(ExposlistWidget,1,1,1,3); exposLayout->addWidget(ExposlistWidget,1,1,1,3);
exposLayout->addWidget(qbUp,2,1); exposLayout->addWidget(qbUp,2,1);
@ -341,6 +358,35 @@ void InputsPanel::expoAdd()
void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos) void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
{ {
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 AddIcon;
populate_icon(&AddIcon,Theme,"add.png");
QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png");
QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png");
QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png");
QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png");
QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png");
QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png");
QIcon MoveUpIcon;
populate_icon(&MoveUpIcon,Theme,"moveup.png");
QIcon MoveDownIcon;
populate_icon(&MoveDownIcon,Theme,"movedown.png");
QPoint globalPos = ExposlistWidget->mapToGlobal(pos); QPoint globalPos = ExposlistWidget->mapToGlobal(pos);
const QClipboard *clipboard = QApplication::clipboard(); const QClipboard *clipboard = QApplication::clipboard();
@ -348,17 +394,17 @@ void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
bool hasData = mimeData->hasFormat("application/x-companion9x-expo"); bool hasData = mimeData->hasFormat("application/x-companion9x-expo");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(QIcon(":/images/add.png"), tr("&Add"),this,SLOT(expoAdd()),tr("Ctrl+A")); contextMenu.addAction(AddIcon, tr("&Add"),this,SLOT(expoAdd()),tr("Ctrl+A"));
contextMenu.addAction(QIcon(":/images/edit.png"), tr("&Edit"),this,SLOT(expoOpen()),tr("Enter")); contextMenu.addAction(EditIcon, tr("&Edit"),this,SLOT(expoOpen()),tr("Enter"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/clear.png"), tr("&Delete"),this,SLOT(exposDelete()),tr("Delete")); contextMenu.addAction(ClearIcon, tr("&Delete"),this,SLOT(exposDelete()),tr("Delete"));
contextMenu.addAction(QIcon(":/images/copy.png"), tr("&Copy"),this,SLOT(exposCopy()),tr("Ctrl+C")); contextMenu.addAction(CopyIcon, tr("&Copy"),this,SLOT(exposCopy()),tr("Ctrl+C"));
contextMenu.addAction(QIcon(":/images/cut.png"), tr("&Cut"),this,SLOT(exposCut()),tr("Ctrl+X")); contextMenu.addAction(CutIcon, tr("&Cut"),this,SLOT(exposCut()),tr("Ctrl+X"));
contextMenu.addAction(QIcon(":/images/paste.png"), tr("&Paste"),this,SLOT(exposPaste()),tr("Ctrl+V"))->setEnabled(hasData); contextMenu.addAction(PasteIcon, tr("&Paste"),this,SLOT(exposPaste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.addAction(QIcon(":/images/duplicate.png"), tr("Du&plicate"),this,SLOT(exposDuplicate()),tr("Ctrl+U")); contextMenu.addAction(DuplicateIcon, tr("Du&plicate"),this,SLOT(exposDuplicate()),tr("Ctrl+U"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/moveup.png"), tr("Move Up"),this,SLOT(moveExpoUp()),tr("Ctrl+Up")); contextMenu.addAction(MoveUpIcon, tr("Move Up"),this,SLOT(moveExpoUp()),tr("Ctrl+Up"));
contextMenu.addAction(QIcon(":/images/movedown.png"), tr("Move Down"),this,SLOT(moveExpoDown()),tr("Ctrl+Down")); contextMenu.addAction(MoveDownIcon, tr("Move Down"),this,SLOT(moveExpoDown()),tr("Ctrl+Down"));
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }

View file

@ -8,6 +8,17 @@ 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
@ -15,14 +26,20 @@ 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);
QIcon qbUpIcon;
populate_icon(&qbUpIcon,Theme,"moveup.png");
qbUp->setText(tr("Move Up")); qbUp->setText(tr("Move Up"));
qbUp->setIcon(QIcon(":/images/moveup.png")); qbUp->setIcon(qbUpIcon);
qbUp->setShortcut(QKeySequence(tr("Ctrl+Up"))); qbUp->setShortcut(QKeySequence(tr("Ctrl+Up")));
QIcon qbDownIcon;
populate_icon(&qbDownIcon,Theme,"movedown.png");
qbDown->setText(tr("Move Down")); qbDown->setText(tr("Move Down"));
qbDown->setIcon(QIcon(":/images/movedown.png")); qbDown->setIcon(qbDownIcon);
qbDown->setShortcut(QKeySequence(tr("Ctrl+Down"))); qbDown->setShortcut(QKeySequence(tr("Ctrl+Down")));
QIcon qbClearIcon;
populate_icon(&qbClearIcon,Theme,"clear.png");
qbClear->setText(tr("Clear Mixes")); qbClear->setText(tr("Clear Mixes"));
qbClear->setIcon(QIcon(":/images/clear.png")); qbClear->setIcon(qbClearIcon);
mixesLayout->addWidget(MixerlistWidget,1,1,1,3); mixesLayout->addWidget(MixerlistWidget,1,1,1,3);
mixesLayout->addWidget(qbUp,2,1); mixesLayout->addWidget(qbUp,2,1);
@ -406,6 +423,35 @@ void MixesPanel::mixerAdd()
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos) void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
{ {
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 AddIcon;
populate_icon(&AddIcon,Theme,"add.png");
QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png");
QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png");
QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png");
QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png");
QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png");
QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png");
QIcon MoveUpIcon;
populate_icon(&MoveUpIcon,Theme,"moveup.png");
QIcon MoveDownIcon;
populate_icon(&MoveDownIcon,Theme,"movedown.png");
QPoint globalPos = MixerlistWidget->mapToGlobal(pos); QPoint globalPos = MixerlistWidget->mapToGlobal(pos);
const QClipboard *clipboard = QApplication::clipboard(); const QClipboard *clipboard = QApplication::clipboard();
@ -413,17 +459,17 @@ void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
bool hasData = mimeData->hasFormat("application/x-companion9x-mix"); bool hasData = mimeData->hasFormat("application/x-companion9x-mix");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(QIcon(":/images/add.png"), tr("&Add"),this,SLOT(mixerAdd()),tr("Ctrl+A")); contextMenu.addAction(AddIcon, tr("&Add"),this,SLOT(mixerAdd()),tr("Ctrl+A"));
contextMenu.addAction(QIcon(":/images/edit.png"), tr("&Edit"),this,SLOT(mixerOpen()),tr("Enter")); contextMenu.addAction(EditIcon, tr("&Edit"),this,SLOT(mixerOpen()),tr("Enter"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/clear.png"), tr("&Delete"),this,SLOT(mixersDelete()),tr("Delete")); contextMenu.addAction(ClearIcon, tr("&Delete"),this,SLOT(mixersDelete()),tr("Delete"));
contextMenu.addAction(QIcon(":/images/copy.png"), tr("&Copy"),this,SLOT(mixersCopy()),tr("Ctrl+C")); contextMenu.addAction(CopyIcon, tr("&Copy"),this,SLOT(mixersCopy()),tr("Ctrl+C"));
contextMenu.addAction(QIcon(":/images/cut.png"), tr("&Cut"),this,SLOT(mixersCut()),tr("Ctrl+X")); contextMenu.addAction(CutIcon, tr("&Cut"),this,SLOT(mixersCut()),tr("Ctrl+X"));
contextMenu.addAction(QIcon(":/images/paste.png"), tr("&Paste"),this,SLOT(mixersPaste()),tr("Ctrl+V"))->setEnabled(hasData); contextMenu.addAction(PasteIcon, tr("&Paste"),this,SLOT(mixersPaste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.addAction(QIcon(":/images/duplicate.png"), tr("Du&plicate"),this,SLOT(mixersDuplicate()),tr("Ctrl+U")); contextMenu.addAction(DuplicateIcon, tr("Du&plicate"),this,SLOT(mixersDuplicate()),tr("Ctrl+U"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/moveup.png"), tr("Move Up"),this,SLOT(moveMixUp()),tr("Ctrl+Up")); contextMenu.addAction(MoveUpIcon, tr("Move Up"),this,SLOT(moveMixUp()),tr("Ctrl+Up"));
contextMenu.addAction(QIcon(":/images/movedown.png"), tr("Move Down"),this,SLOT(moveMixDown()),tr("Ctrl+Down")); contextMenu.addAction(MoveDownIcon, tr("Move Down"),this,SLOT(moveMixDown()),tr("Ctrl+Down"));
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }

View file

@ -7,6 +7,7 @@
#include "mixes.h" #include "mixes.h"
#include "channels.h" #include "channels.h"
#include "curves.h" #include "curves.h"
#include "../helpers.h"
#include "customswitches.h" #include "customswitches.h"
#include "customfunctions.h" #include "customfunctions.h"
#include "telemetry.h" #include "telemetry.h"
@ -22,6 +23,19 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
ui->setupUi(this); ui->setupUi(this);
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;
populate_icon(&SimulateIcon,Theme,"simulate.png");
ui->pushButton->setIcon(SimulateIcon);
addTab(new Setup(this, model), tr("Setup")); addTab(new Setup(this, model), tr("Setup"));
addTab(new HeliPanel(this, model), tr("Heli")); addTab(new HeliPanel(this, model), tr("Heli"));
addTab(new FlightModes(this, model, radioData.generalSettings), tr("Flight Modes")); addTab(new FlightModes(this, model, radioData.generalSettings), tr("Flight Modes"));

View file

@ -20,7 +20,7 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../companion9x.qrc"> <iconset resource="../companion.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset> <normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property> </property>
<property name="sizeGripEnabled"> <property name="sizeGripEnabled">
@ -50,10 +50,6 @@
<property name="text"> <property name="text">
<string>Simulate</string> <string>Simulate</string>
</property> </property>
<property name="icon">
<iconset resource="../companion9x.qrc">
<normaloff>:/images/simulate.png</normaloff>:/images/simulate.png</iconset>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -61,7 +57,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../companion9x.qrc"/> <include location="../companion.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -353,7 +353,7 @@ Setup::Setup(QWidget *parent, ModelData & model):
if (GetEepromInterface()->getCapability(ModelImage)) { if (GetEepromInterface()->getCapability(ModelImage)) {
QStringList items; QStringList items;
items.append(""); items.append("");
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString path = settings.value("sdPath", ".").toString(); QString path = settings.value("sdPath", ".").toString();
path.append("/BMP/"); path.append("/BMP/");
QDir qd(path); QDir qd(path);
@ -497,7 +497,7 @@ void Setup::on_image_currentIndexChanged(int index)
{ {
if (!lock) { if (!lock) {
strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength)); strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength));
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString path=settings.value("sdPath", ".").toString(); QString path=settings.value("sdPath", ".").toString();
path.append("/BMP/"); path.append("/BMP/");
QDir qd(path); QDir qd(path);

View file

@ -342,7 +342,7 @@ TelemetryPanel::~TelemetryPanel()
void TelemetryPanel::setup() void TelemetryPanel::setup()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion", "companion");
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString(); QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
lock=true; lock=true;

View file

@ -41,6 +41,7 @@
#include "modelslist.h" #include "modelslist.h"
#include "mdichild.h" #include "mdichild.h"
#include "helpers.h"
class DragDropHeader { class DragDropHeader {
public: public:
@ -82,23 +83,58 @@ 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");
int theme_set=settings.value("theme", 1).toInt();
QString Theme;
switch(theme_set) {
case 0:
Theme="classic";
break;
default:
Theme="monochrome";
break;
}
QIcon AddIcon;
populate_icon(&AddIcon,Theme,"add.png");
QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png");
QIcon OpenIcon;
populate_icon(&OpenIcon,Theme,"open.png");
QIcon WizardIcon;
populate_icon(&WizardIcon,Theme,"wizard.png");
QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png");
QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png");
QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png");
QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png");
QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png");
QIcon CurrentModelIcon;
populate_icon(&CurrentModelIcon,Theme,"currentmodel.png");
QIcon PrintIcon;
populate_icon(&PrintIcon,Theme,"print.png");
QIcon SimulateIcon;
populate_icon(&SimulateIcon,Theme,"simulate.png");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(QIcon(":/images/edit.png"), tr("&Edit"),this,SLOT(OpenEditWindow())); contextMenu.addAction(EditIcon, tr("&Edit"),this,SLOT(OpenEditWindow()));
contextMenu.addAction(QIcon(":/images/open.png"), tr("&Restore from backup"),this,SLOT(LoadBackup())); contextMenu.addAction(OpenIcon, tr("&Restore from backup"),this,SLOT(LoadBackup()));
contextMenu.addAction(QIcon(":/images/wizard.png"), tr("&Model Wizard"),this,SLOT(OpenWizard())); contextMenu.addAction(WizardIcon, tr("&Model Wizard"),this,SLOT(OpenWizard()));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/clear.png"), tr("&Delete"),this,SLOT(confirmDelete()),tr("Delete")); contextMenu.addAction(ClearIcon, tr("&Delete"),this,SLOT(confirmDelete()),tr("Delete"));
contextMenu.addAction(QIcon(":/images/copy.png"), tr("&Copy"),this,SLOT(copy()),tr("Ctrl+C")); contextMenu.addAction(CopyIcon, tr("&Copy"),this,SLOT(copy()),tr("Ctrl+C"));
contextMenu.addAction(QIcon(":/images/cut.png"), tr("&Cut"),this,SLOT(cut()),tr("Ctrl+X")); contextMenu.addAction(CutIcon, tr("&Cut"),this,SLOT(cut()),tr("Ctrl+X"));
contextMenu.addAction(QIcon(":/images/paste.png"), tr("&Paste"),this,SLOT(paste()),tr("Ctrl+V"))->setEnabled(hasData); contextMenu.addAction(PasteIcon, tr("&Paste"),this,SLOT(paste()),tr("Ctrl+V"))->setEnabled(hasData);
contextMenu.addAction(QIcon(":/images/duplicate.png"), tr("D&uplicate"),this,SLOT(duplicate()),tr("Ctrl+U")); contextMenu.addAction(DuplicateIcon, tr("D&uplicate"),this,SLOT(duplicate()),tr("Ctrl+U"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/currentmodel.png"), tr("&Use as default"),this,SLOT(setdefault())); contextMenu.addAction(CurrentModelIcon, tr("&Use as default"),this,SLOT(setdefault()));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/print.png"), tr("P&rint model"),this, SLOT(print()),tr("Alt+R")); contextMenu.addAction(PrintIcon, tr("P&rint model"),this, SLOT(print()),tr("Alt+R"));
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(QIcon(":/images/simulate.png"), tr("&Simulate model"),this, SLOT(simulate()),tr("Alt+S")); contextMenu.addAction(SimulateIcon, tr("&Simulate model"),this, SLOT(simulate()),tr("Alt+S"));
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }

View file

@ -30,8 +30,14 @@ preferencesDialog::preferencesDialog(QWidget *parent) :
Theme="monochrome"; Theme="monochrome";
break; break;
} }
Icon.addPixmap(":/themes/"+Theme+"/preferences.png"); populate_icon(&Icon, Theme, "preferences.png");
this->setWindowIcon(Icon); this->setWindowIcon(Icon);
QIcon LibraryIcon;
populate_icon(&LibraryIcon, Theme, "library.png");
ui->splashLibraryButton->setIcon(LibraryIcon);
QIcon ClearIcon;
populate_icon(&ClearIcon, Theme, "clear.png");
ui->clearImageButton->setIcon(ClearIcon);
QCheckBox * OptionCheckBox[]= { QCheckBox * OptionCheckBox[]= {
ui->optionCheckBox_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7, ui->optionCheckBox_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7,

View file

@ -176,10 +176,6 @@
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
<property name="icon">
<iconset>
<normaloff>:/images/clear.png</normaloff>:/images/clear.png</iconset>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -243,10 +239,6 @@
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
<property name="icon">
<iconset>
<normaloff>:/images/library.png</normaloff>:/images/library.png</iconset>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View file

@ -27,7 +27,7 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="companion.qrc"> <iconset resource="companion.qrc">
<normaloff>:/images/print.png</normaloff>:/images/print.png</iconset> <normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B