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

Small code cleanup

This commit is contained in:
Romolo Manfredini 2014-01-20 12:26:50 +01:00
parent fad6211789
commit 97de97c84e
17 changed files with 322 additions and 321 deletions

View file

@ -279,9 +279,8 @@ void burnConfigDialog::listProgrammers()
QStringList arguments; QStringList arguments;
arguments << "-c?"; arguments << "-c?";
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE); avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
QString Theme=getTheme();
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"list.png"); populate_icon(&Icon,"list.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
} }
@ -299,9 +298,8 @@ void burnConfigDialog::on_pushButton_4_clicked()
arguments << "-?"; arguments << "-?";
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE); avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
QString Theme=getTheme();
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"configure.png"); populate_icon(&Icon,"configure.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
} }
@ -319,9 +317,8 @@ void burnConfigDialog::readFuses()
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str; arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE); avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
QString Theme=getTheme();
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"fuses.png"); populate_icon(&Icon,"fuses.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
} }
@ -334,8 +331,6 @@ void burnConfigDialog::restFuses(bool eeProtect)
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m //avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
QMessageBox::StandardButton ret = QMessageBox::No; QMessageBox::StandardButton ret = QMessageBox::No;
QString Theme=getTheme();
ret = QMessageBox::warning(this, tr("Companion"), ret = QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU), tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
@ -358,7 +353,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ; argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE); avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"fuses.png"); populate_icon(&Icon,"fuses.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->exec(); ad->exec();
QFile file(tempFile); QFile file(tempFile);
@ -389,7 +384,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
} }
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE); avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"fuses.png"); populate_icon(&Icon,"fuses.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
} }

View file

@ -16,9 +16,8 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
hexType(Type) hexType(Type)
{ {
ui->setupUi(this); ui->setupUi(this);
QString Theme=getTheme();
QIcon LibraryIcon; QIcon LibraryIcon;
populate_icon(&LibraryIcon,Theme,"library.png"); populate_icon(&LibraryIcon,"library.png");
ui->libraryButton->setIcon(LibraryIcon); ui->libraryButton->setIcon(LibraryIcon);
ui->SplashFrame->hide(); ui->SplashFrame->hide();
ui->FramFWInfo->hide(); ui->FramFWInfo->hide();

View file

@ -11,9 +11,8 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::customizeSplashDialog) { ui(new Ui::customizeSplashDialog) {
ui->setupUi(this); ui->setupUi(this);
QString Theme=getTheme();
QIcon LibraryIcon; QIcon LibraryIcon;
populate_icon(&LibraryIcon,Theme,"library.png"); populate_icon(&LibraryIcon,"library.png");
ui->libraryButton->setIcon(LibraryIcon); ui->libraryButton->setIcon(LibraryIcon);
ui->HowToLabel->clear(); ui->HowToLabel->clear();
ui->HowToLabel->append("<center>" + tr("Select an original firmware file") + "</center>"); ui->HowToLabel->append("<center>" + tr("Select an original firmware file") + "</center>");

View file

@ -1485,8 +1485,9 @@ QString getCenterBeep(ModelData * g_model)
return strl.join(", "); return strl.join(", ");
} }
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage) void populate_icon(QIcon *Icon, QString baseimage)
{ {
static QString usedtheme=getTheme();
Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16)); Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16));
Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24)); Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24));
Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32)); Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32));

View file

@ -28,7 +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); void populate_icon(QIcon *Icon, QString baseimage);
QString getTheme(); QString getTheme();
class GVarGroup : public QObject { class GVarGroup : public QObject {

View file

@ -96,7 +96,6 @@ downloadDialog_forWait(NULL)
this, SLOT(setActiveSubWindow(QWidget*))); this, SLOT(setActiveSubWindow(QWidget*)));
MaxRecentFiles=MAX_RECENT; MaxRecentFiles=MAX_RECENT;
Theme=getTheme();
QSettings settings("companion", "companion"); QSettings settings("companion", "companion");
int icon_size=settings.value("icon_size", 1).toInt(); int icon_size=settings.value("icon_size", 1).toInt();
switch (icon_size) { switch (icon_size) {
@ -1082,7 +1081,7 @@ void MainWindow::burnFrom()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
res = ad->exec(); res = ad->exec();
sleep(1); sleep(1);
@ -1091,7 +1090,7 @@ void MainWindow::burnFrom()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
res = ad->exec(); res = ad->exec();
} }
@ -1143,7 +1142,7 @@ void MainWindow::burnExtenalToEEPROM()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1152,7 +1151,7 @@ void MainWindow::burnExtenalToEEPROM()
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"));
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1164,7 +1163,7 @@ void MainWindow::burnExtenalToEEPROM()
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");
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_flash.png"); populate_icon(&icon,"read_flash.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1199,7 +1198,7 @@ void MainWindow::burnExtenalToEEPROM()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1208,7 +1207,7 @@ void MainWindow::burnExtenalToEEPROM()
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"));
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1225,7 +1224,7 @@ void MainWindow::burnExtenalToEEPROM()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1234,7 +1233,7 @@ void MainWindow::burnExtenalToEEPROM()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"write_eeprom.png"); populate_icon(&icon,"write_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
@ -1401,7 +1400,7 @@ 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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
int res = ad->exec(); int res = ad->exec();
if (QFileInfo(backupFile).exists() && res) { if (QFileInfo(backupFile).exists() && res) {
@ -1409,7 +1408,7 @@ void MainWindow::burnToFlash(QString fileToFlash)
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);
QIcon iconw; QIcon iconw;
populate_icon(&iconw,Theme,"write_eeprom.png"); populate_icon(&iconw,"write_eeprom.png");
ad->setWindowIcon(iconw); ad->setWindowIcon(iconw);
int res = ad->exec(); int res = ad->exec();
if (res) { if (res) {
@ -1447,7 +1446,7 @@ 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")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1456,7 +1455,7 @@ void MainWindow::burnToFlash(QString fileToFlash)
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);
QIcon iconw; QIcon iconw;
populate_icon(&iconw,Theme,"read_eeprom.png"); populate_icon(&iconw,"write_flash.png");
ad->setWindowIcon(iconw); ad->setWindowIcon(iconw);
ad->exec(); ad->exec();
} }
@ -1479,7 +1478,7 @@ void MainWindow::burnExtenalFromEEPROM()
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);
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
@ -1488,7 +1487,7 @@ void MainWindow::burnExtenalFromEEPROM()
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"));
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_eeprom.png"); populate_icon(&icon,"read_eeprom.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
@ -1508,7 +1507,7 @@ void MainWindow::burnFromFlash()
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");
QIcon icon; QIcon icon;
populate_icon(&icon,Theme,"read_flash.png"); populate_icon(&icon,"read_flash.png");
ad->setWindowIcon(icon); ad->setWindowIcon(icon);
ad->exec(); ad->exec();
} }
@ -1650,7 +1649,7 @@ MdiChild *MainWindow::createMdiChild()
void MainWindow::createActions() void MainWindow::createActions()
{ {
QIcon newActIcon; QIcon newActIcon;
populate_icon(&newActIcon,Theme,"new.png"); populate_icon(&newActIcon,"new.png");
newAct = new QAction(newActIcon, tr("&New"), this); newAct = new QAction(newActIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New); newAct->setShortcuts(QKeySequence::New);
@ -1658,7 +1657,7 @@ void MainWindow::createActions()
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
QIcon openActIcon; QIcon openActIcon;
populate_icon(&openActIcon,Theme,"open.png"); populate_icon(&openActIcon,"open.png");
openAct = new QAction(openActIcon, tr("&Open..."), this); 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"));
@ -1669,65 +1668,65 @@ void MainWindow::createActions()
connect(loadbackupAct, SIGNAL(triggered()), this, SLOT(loadBackup())); connect(loadbackupAct, SIGNAL(triggered()), this, SLOT(loadBackup()));
QIcon saveActIcon; QIcon saveActIcon;
populate_icon(&saveActIcon,Theme,"save.png"); populate_icon(&saveActIcon,"save.png");
saveAct = new QAction(saveActIcon, tr("&Save"), this); 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()));
QIcon saveAsActIcon; QIcon saveAsActIcon;
populate_icon(&saveAsActIcon,Theme,"saveas.png"); populate_icon(&saveAsActIcon,"saveas.png");
saveAsAct = new QAction(saveAsActIcon, tr("Save &As..."), this); 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()));
QIcon logsActIcon; QIcon logsActIcon;
populate_icon(&logsActIcon,Theme,"logs.png"); populate_icon(&logsActIcon,"logs.png");
logsAct = new QAction(logsActIcon, tr("Lo&gs"), this); 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()));
QIcon preferencesActIcon; QIcon preferencesActIcon;
populate_icon(&preferencesActIcon,Theme,"preferences.png"); populate_icon(&preferencesActIcon,"preferences.png");
preferencesAct = new QAction(preferencesActIcon, tr("&Preferences..."), this); 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()));
QIcon checkForUpdatesActIcon; QIcon checkForUpdatesActIcon;
populate_icon(&checkForUpdatesActIcon,Theme,"update.png"); populate_icon(&checkForUpdatesActIcon,"update.png");
checkForUpdatesAct = new QAction(checkForUpdatesActIcon, tr("&Check for updates..."), this); 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()));
QIcon contributorsActIcon; QIcon contributorsActIcon;
populate_icon(&contributorsActIcon,Theme,"contributors.png"); populate_icon(&contributorsActIcon,"contributors.png");
contributorsAct = new QAction(contributorsActIcon, tr("Contributors &List..."), this); 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()));
QIcon changelogActIcon; QIcon changelogActIcon;
populate_icon(&changelogActIcon,Theme,"changelog.png"); populate_icon(&changelogActIcon,"changelog.png");
changelogAct = new QAction(changelogActIcon, tr("ChangeLog..."), this); 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()));
QIcon fwchangelogActIcon; QIcon fwchangelogActIcon;
populate_icon(&fwchangelogActIcon,Theme,"changelog.png"); populate_icon(&fwchangelogActIcon,"changelog.png");
fwchangelogAct = new QAction(fwchangelogActIcon, tr("Firmware ChangeLog..."), this); 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()));
QIcon compareActIcon; QIcon compareActIcon;
populate_icon(&compareActIcon,Theme,"compare.png"); populate_icon(&compareActIcon,"compare.png");
compareAct = new QAction(compareActIcon, tr("Compare..."), this); 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()));
QIcon customizeSplashActIcon; QIcon customizeSplashActIcon;
populate_icon(&customizeSplashActIcon,Theme,"customize.png"); populate_icon(&customizeSplashActIcon,"customize.png");
customizeSplashAct = new QAction(customizeSplashActIcon, tr("Customize your &TX..."), this); 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()));
@ -1735,7 +1734,7 @@ void MainWindow::createActions()
//! [0] //! [0]
QIcon exitActIcon; QIcon exitActIcon;
populate_icon(&exitActIcon,Theme,"exit.png"); populate_icon(&exitActIcon,"exit.png");
exitAct = new QAction(exitActIcon, tr("E&xit"), this); 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"));
@ -1743,7 +1742,7 @@ void MainWindow::createActions()
//! [0] //! [0]
QIcon cutActIcon; QIcon cutActIcon;
populate_icon(&cutActIcon,Theme,"cut.png"); populate_icon(&cutActIcon,"cut.png");
cutAct = new QAction(cutActIcon, tr("Cu&t"), this); 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 "
@ -1751,7 +1750,7 @@ void MainWindow::createActions()
connect(cutAct, SIGNAL(triggered()), this, SLOT(cut())); connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
QIcon copyActIcon; QIcon copyActIcon;
populate_icon(&copyActIcon,Theme,"copy.png"); populate_icon(&copyActIcon,"copy.png");
copyAct = new QAction(copyActIcon, tr("&Copy"), this); 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 "
@ -1759,7 +1758,7 @@ void MainWindow::createActions()
connect(copyAct, SIGNAL(triggered()), this, SLOT(copy())); connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
QIcon pasteActIcon; QIcon pasteActIcon;
populate_icon(&pasteActIcon,Theme,"paste.png"); populate_icon(&pasteActIcon,"paste.png");
pasteAct = new QAction(pasteActIcon, tr("&Paste"), this); 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 "
@ -1767,64 +1766,64 @@ void MainWindow::createActions()
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste())); connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
QIcon burnToActIcon; QIcon burnToActIcon;
populate_icon(&burnToActIcon,Theme,"write_eeprom.png"); populate_icon(&burnToActIcon,"write_eeprom.png");
burnToAct = new QAction(burnToActIcon, tr("&Write Models and Settings To Tx"), this); 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()));
QIcon burnFromActIcon; QIcon burnFromActIcon;
populate_icon(&burnFromActIcon,Theme,"read_eeprom.png"); populate_icon(&burnFromActIcon,"read_eeprom.png");
burnFromAct = new QAction(burnFromActIcon, tr("&Read Models and Settings From Tx"), this); 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()));
QIcon burnToFlashActIcon; QIcon burnToFlashActIcon;
populate_icon(&burnToFlashActIcon,Theme,"write_flash.png"); populate_icon(&burnToFlashActIcon,"write_flash.png");
burnToFlashAct = new QAction(burnToFlashActIcon, tr("Write Firmware"), this); 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()));
QIcon burnExtenalToEEPROMActIcon; QIcon burnExtenalToEEPROMActIcon;
populate_icon(&burnExtenalToEEPROMActIcon,Theme,"write_eeprom_file.png"); populate_icon(&burnExtenalToEEPROMActIcon,"write_eeprom_file.png");
burnExtenalToEEPROMAct = new QAction(burnExtenalToEEPROMActIcon, tr("Write Models and Settings from file to Tx"), this); 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()));
QIcon burnExtenalFromEEPROMActIcon; QIcon burnExtenalFromEEPROMActIcon;
populate_icon(&burnExtenalFromEEPROMActIcon,Theme,"read_eeprom_file.png"); populate_icon(&burnExtenalFromEEPROMActIcon,"read_eeprom_file.png");
burnExtenalFromEEPROMAct = new QAction(burnExtenalFromEEPROMActIcon, tr("Save transmitter Models and Settings to file"), this); 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()));
QIcon burnFromFlashActIcon; QIcon burnFromFlashActIcon;
populate_icon(&burnFromFlashActIcon,Theme,"read_flash.png"); populate_icon(&burnFromFlashActIcon,"read_flash.png");
burnFromFlashAct = new QAction(burnFromFlashActIcon, tr("Read Firmware"), this); 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()));
QIcon burnConfigActIcon; QIcon burnConfigActIcon;
populate_icon(&burnConfigActIcon,Theme,"configure.png"); populate_icon(&burnConfigActIcon,"configure.png");
burnConfigAct = new QAction(burnConfigActIcon, tr("&Configure..."), this); 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())) {
QIcon burnListActIcon; QIcon burnListActIcon;
populate_icon(&burnListActIcon,Theme,"list.png"); populate_icon(&burnListActIcon,"list.png");
burnListAct = new QAction(burnListActIcon, tr("&List programmers"), this); 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()));
QIcon burnFusesActIcon; QIcon burnFusesActIcon;
populate_icon(&burnFusesActIcon,Theme,"fuses.png"); populate_icon(&burnFusesActIcon,"fuses.png");
burnFusesAct = new QAction(burnFusesActIcon, tr("&Fuses..."), this); 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()));
} }
QIcon simulateActIcon; QIcon simulateActIcon;
populate_icon(&simulateActIcon,Theme,"simulate.png"); populate_icon(&simulateActIcon,"simulate.png");
simulateAct = new QAction(simulateActIcon, tr("&Simulate"), this); 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."));
@ -1832,7 +1831,7 @@ void MainWindow::createActions()
connect(simulateAct,SIGNAL(triggered()),this,SLOT(simulate())); connect(simulateAct,SIGNAL(triggered()),this,SLOT(simulate()));
QIcon printActIcon; QIcon printActIcon;
populate_icon(&printActIcon,Theme,"print.png"); populate_icon(&printActIcon,"print.png");
printAct = new QAction(printActIcon, tr("&Print"), this); 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."));
@ -1874,13 +1873,13 @@ void MainWindow::createActions()
separatorAct->setSeparator(true); separatorAct->setSeparator(true);
QIcon aboutActIcon; QIcon aboutActIcon;
populate_icon(&aboutActIcon,Theme,"information.png"); populate_icon(&aboutActIcon,"information.png");
aboutAct = new QAction(aboutActIcon, tr("&About"), this); 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()));
QIcon switchLayoutDirectionActIcon; QIcon switchLayoutDirectionActIcon;
populate_icon(&switchLayoutDirectionActIcon,Theme,"switch_dir.png"); populate_icon(&switchLayoutDirectionActIcon,"switch_dir.png");
switchLayoutDirectionAct = new QAction(switchLayoutDirectionActIcon, tr("Switch layout direction"), this); 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()));
@ -1912,7 +1911,7 @@ void MainWindow::createMenus()
fileMenu->addAction(saveAsAct); fileMenu->addAction(saveAsAct);
fileMenu->addMenu(recentFileMenu); fileMenu->addMenu(recentFileMenu);
QIcon recentFileMenuIcon; QIcon recentFileMenuIcon;
populate_icon(&recentFileMenuIcon,Theme,"recentdocument.png"); populate_icon(&recentFileMenuIcon,"recentdocument.png");
recentFileMenu->setIcon(recentFileMenuIcon); 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]);
@ -1927,7 +1926,7 @@ void MainWindow::createMenus()
fileMenu->addMenu(profilesMenu); fileMenu->addMenu(profilesMenu);
QIcon profilesMenuIcon; QIcon profilesMenuIcon;
populate_icon(&profilesMenuIcon,Theme,"profiles.png"); populate_icon(&profilesMenuIcon,"profiles.png");
profilesMenu->setIcon(profilesMenuIcon); 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]);
@ -1994,7 +1993,7 @@ QMenu *MainWindow::createProfilesMenu()
void MainWindow::createToolBars() void MainWindow::createToolBars()
{ {
QSettings settings("companion", "companion"); QSettings settings("companion", "companion");
int icon_size=settings.value("icon_size",1 ).toInt(); int icon_size=settings.value("icon_size",2 ).toInt();
QSize size; QSize size;
switch(icon_size) { switch(icon_size) {
case 0: case 0:
@ -2019,7 +2018,7 @@ void MainWindow::createToolBars()
recentToolButton->setPopupMode(QToolButton::InstantPopup); recentToolButton->setPopupMode(QToolButton::InstantPopup);
recentToolButton->setMenu(createRecentFileMenu()); recentToolButton->setMenu(createRecentFileMenu());
QIcon recentToolButtonIcon; QIcon recentToolButtonIcon;
populate_icon(&recentToolButtonIcon,Theme,"recentdocument.png"); populate_icon(&recentToolButtonIcon,"recentdocument.png");
recentToolButton->setIcon(recentToolButtonIcon); recentToolButton->setIcon(recentToolButtonIcon);
recentToolButton->setToolTip(tr("Recent Files")); recentToolButton->setToolTip(tr("Recent Files"));
fileToolBar->addWidget(recentToolButton); fileToolBar->addWidget(recentToolButton);
@ -2031,7 +2030,7 @@ void MainWindow::createToolBars()
profileButton->setPopupMode(QToolButton::InstantPopup); profileButton->setPopupMode(QToolButton::InstantPopup);
profileButton->setMenu(createProfilesMenu()); profileButton->setMenu(createProfilesMenu());
QIcon profileButtonIcon; QIcon profileButtonIcon;
populate_icon(&profileButtonIcon,Theme,"profiles.png"); populate_icon(&profileButtonIcon,"profiles.png");
profileButton->setIcon(profileButtonIcon); profileButton->setIcon(profileButtonIcon);
profileButton->setToolTip(tr("Firmware Profiles")); profileButton->setToolTip(tr("Firmware Profiles"));
fileToolBar->addWidget(profileButton); fileToolBar->addWidget(profileButton);

View file

@ -68,9 +68,8 @@ MdiChild::MdiChild():
isUntitled(true), isUntitled(true),
fileChanged(false) fileChanged(false)
{ {
QString Theme=getTheme();
QIcon SimulateIcon; QIcon SimulateIcon;
populate_icon(&SimulateIcon,Theme,"simulate.png"); populate_icon(&SimulateIcon,"simulate.png");
ui->setupUi(this); ui->setupUi(this);
ui->SimulateTxButton->setIcon(SimulateIcon); ui->SimulateTxButton->setIcon(SimulateIcon);
@ -512,7 +511,6 @@ QString MdiChild::strippedName(const QString &fullFileName)
void MdiChild::burnTo() // write to Tx void MdiChild::burnTo() // write to Tx
{ {
QString Theme=getTheme();
QSettings settings("companion", "companion"); QSettings settings("companion", "companion");
bool backupEnable=settings.value("backupEnable", true).toBool(); bool backupEnable=settings.value("backupEnable", true).toBool();
QString backupPath=settings.value("backupPath", "").toString(); QString backupPath=settings.value("backupPath", "").toString();
@ -559,7 +557,7 @@ void MdiChild::burnTo() // write to Tx
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN);
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"read_eeprom.png"); populate_icon(&Icon,"read_eeprom.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -568,7 +566,7 @@ void MdiChild::burnTo() // write to Tx
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 EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx"));
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"read_eeprom.png"); populate_icon(&Icon,"read_eeprom.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -579,7 +577,7 @@ void MdiChild::burnTo() // write to Tx
QStringList str = ((MainWindow *)this->parent())->GetReceiveFlashCommand(tempFlash); QStringList str = ((MainWindow *)this->parent())->GetReceiveFlashCommand(tempFlash);
avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Read Flash From Tx"); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Read Flash From Tx");
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"read_flash.png"); populate_icon(&Icon,"read_flash.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -617,7 +615,7 @@ void MdiChild::burnTo() // write to Tx
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 EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx"));
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"read_eeprom.png"); populate_icon(&Icon,"read_eeprom.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -634,7 +632,7 @@ void MdiChild::burnTo() // write to Tx
str << tempFile << path; str << tempFile << path;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN);
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"read_eeprom.png"); populate_icon(&Icon,"read_eeprom.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
sleep(1); sleep(1);
@ -643,7 +641,7 @@ void MdiChild::burnTo() // write to Tx
QStringList str = ((MainWindow *)this->parent())->GetSendEEpromCommand(tempFile); 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); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE);
QIcon Icon; QIcon Icon;
populate_icon(&Icon,Theme,"write_eeprom.png"); populate_icon(&Icon,"write_eeprom.png");
ad->setWindowIcon(Icon); ad->setWindowIcon(Icon);
ad->show(); ad->show();
} }

View file

@ -84,9 +84,8 @@ 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);
QString Theme=getTheme();
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"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;

View file

@ -123,9 +123,8 @@ 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
QString Theme=getTheme();
QIcon PlayIcon; QIcon PlayIcon;
populate_icon(&PlayIcon,Theme,"play.png"); populate_icon(&PlayIcon,"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(PlayIcon); playBT[i]->setIcon(PlayIcon);
@ -163,9 +162,8 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
{ {
if (phononLock) if (phononLock)
return; return;
QString Theme=getTheme();
QIcon PlayIcon; QIcon PlayIcon;
populate_icon(&PlayIcon,Theme,"play.png"); populate_icon(&PlayIcon,"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) {
@ -196,12 +194,11 @@ void CustomFunctionsPanel::playMusic()
QPushButton *playButton = qobject_cast<QPushButton*>(sender()); QPushButton *playButton = qobject_cast<QPushButton*>(sender());
int index=playButton->objectName().mid(5,2).toInt(); int index=playButton->objectName().mid(5,2).toInt();
QString function=playButton->objectName().left(4); QString function=playButton->objectName().left(4);
QString Theme=getTheme();
QSettings settings("companion", "companion"); QSettings settings("companion", "companion");
QIcon PlayIcon; QIcon PlayIcon;
populate_icon(&PlayIcon,Theme,"play.png"); populate_icon(&PlayIcon,"play.png");
QIcon StopIcon; QIcon StopIcon;
populate_icon(&StopIcon,Theme,"stop.png"); populate_icon(&StopIcon,"stop.png");
QString path=settings.value("sdPath", ".").toString(); QString path=settings.value("sdPath", ".").toString();
QDir qd(path); QDir qd(path);
@ -470,15 +467,14 @@ void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
{ {
QLabel *label = (QLabel *)sender(); QLabel *label = (QLabel *)sender();
selectedFunction = label->property("index").toInt(); selectedFunction = label->property("index").toInt();
QString Theme=getTheme();
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"clear.png");
QIcon CopyIcon; QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png"); populate_icon(&CopyIcon,"copy.png");
QIcon CutIcon; QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png"); populate_icon(&CutIcon,"cut.png");
QIcon PasteIcon; QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png"); populate_icon(&PasteIcon,"paste.png");
QPoint globalPos = label->mapToGlobal(pos); QPoint globalPos = label->mapToGlobal(pos);

View file

@ -382,15 +382,14 @@ void CustomSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
{ {
QLabel *label = (QLabel *)sender(); QLabel *label = (QLabel *)sender();
selectedSwitch = label->property("index").toInt(); selectedSwitch = label->property("index").toInt();
QString Theme=getTheme();
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"clear.png");
QIcon CopyIcon; QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png"); populate_icon(&CopyIcon,"copy.png");
QIcon CutIcon; QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png"); populate_icon(&CutIcon,"cut.png");
QIcon PasteIcon; QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png"); populate_icon(&PasteIcon,"paste.png");
QPoint globalPos = label->mapToGlobal(pos); QPoint globalPos = label->mapToGlobal(pos);

View file

@ -17,17 +17,17 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
QPushButton * qbDown = new QPushButton(this); QPushButton * qbDown = new QPushButton(this);
QPushButton * qbClear = new QPushButton(this); QPushButton * qbClear = new QPushButton(this);
QIcon qbUpIcon; QIcon qbUpIcon;
populate_icon(&qbUpIcon,Theme,"moveup.png"); populate_icon(&qbUpIcon,"moveup.png");
qbUp->setText(tr("Move Up")); qbUp->setText(tr("Move Up"));
qbUp->setIcon(qbUpIcon); qbUp->setIcon(qbUpIcon);
qbUp->setShortcut(QKeySequence(tr("Ctrl+Up"))); qbUp->setShortcut(QKeySequence(tr("Ctrl+Up")));
QIcon qbDownIcon; QIcon qbDownIcon;
populate_icon(&qbDownIcon,Theme,"movedown.png"); populate_icon(&qbDownIcon,"movedown.png");
qbDown->setText(tr("Move Down")); qbDown->setText(tr("Move Down"));
qbDown->setIcon(qbDownIcon); qbDown->setIcon(qbDownIcon);
qbDown->setShortcut(QKeySequence(tr("Ctrl+Down"))); qbDown->setShortcut(QKeySequence(tr("Ctrl+Down")));
QIcon qbClearIcon; QIcon qbClearIcon;
populate_icon(&qbClearIcon,Theme,"clear.png"); populate_icon(&qbClearIcon,"clear.png");
qbClear->setText(tr("Clear Expo Settings")); qbClear->setText(tr("Clear Expo Settings"));
qbClear->setIcon(qbClearIcon); qbClear->setIcon(qbClearIcon);
@ -348,25 +348,24 @@ void InputsPanel::expoAdd()
void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos) void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
{ {
QString Theme=getTheme();
QIcon AddIcon; QIcon AddIcon;
populate_icon(&AddIcon,Theme,"add.png"); populate_icon(&AddIcon,"add.png");
QIcon EditIcon; QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png"); populate_icon(&EditIcon,"edit.png");
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"clear.png");
QIcon CopyIcon; QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png"); populate_icon(&CopyIcon,"copy.png");
QIcon CutIcon; QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png"); populate_icon(&CutIcon,"cut.png");
QIcon PasteIcon; QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png"); populate_icon(&PasteIcon,"paste.png");
QIcon DuplicateIcon; QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png"); populate_icon(&DuplicateIcon,"duplicate.png");
QIcon MoveUpIcon; QIcon MoveUpIcon;
populate_icon(&MoveUpIcon,Theme,"moveup.png"); populate_icon(&MoveUpIcon,"moveup.png");
QIcon MoveDownIcon; QIcon MoveDownIcon;
populate_icon(&MoveDownIcon,Theme,"movedown.png"); populate_icon(&MoveDownIcon,"movedown.png");
QPoint globalPos = ExposlistWidget->mapToGlobal(pos); QPoint globalPos = ExposlistWidget->mapToGlobal(pos);
const QClipboard *clipboard = QApplication::clipboard(); const QClipboard *clipboard = QApplication::clipboard();

View file

@ -14,20 +14,18 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
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);
QString Theme=getTheme();
QIcon qbUpIcon; QIcon qbUpIcon;
populate_icon(&qbUpIcon,Theme,"moveup.png"); populate_icon(&qbUpIcon,"moveup.png");
qbUp->setText(tr("Move Up")); qbUp->setText(tr("Move Up"));
qbUp->setIcon(qbUpIcon); qbUp->setIcon(qbUpIcon);
qbUp->setShortcut(QKeySequence(tr("Ctrl+Up"))); qbUp->setShortcut(QKeySequence(tr("Ctrl+Up")));
QIcon qbDownIcon; QIcon qbDownIcon;
populate_icon(&qbDownIcon,Theme,"movedown.png"); populate_icon(&qbDownIcon,"movedown.png");
qbDown->setText(tr("Move Down")); qbDown->setText(tr("Move Down"));
qbDown->setIcon(qbDownIcon); qbDown->setIcon(qbDownIcon);
qbDown->setShortcut(QKeySequence(tr("Ctrl+Down"))); qbDown->setShortcut(QKeySequence(tr("Ctrl+Down")));
QIcon qbClearIcon; QIcon qbClearIcon;
populate_icon(&qbClearIcon,Theme,"clear.png"); populate_icon(&qbClearIcon,"clear.png");
qbClear->setText(tr("Clear Mixes")); qbClear->setText(tr("Clear Mixes"));
qbClear->setIcon(qbClearIcon); qbClear->setIcon(qbClearIcon);
@ -413,25 +411,24 @@ void MixesPanel::mixerAdd()
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos) void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
{ {
QString Theme=getTheme();
QIcon AddIcon; QIcon AddIcon;
populate_icon(&AddIcon,Theme,"add.png"); populate_icon(&AddIcon,"add.png");
QIcon EditIcon; QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png"); populate_icon(&EditIcon,"edit.png");
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"clear.png");
QIcon CopyIcon; QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png"); populate_icon(&CopyIcon,"copy.png");
QIcon CutIcon; QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png"); populate_icon(&CutIcon,"cut.png");
QIcon PasteIcon; QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png"); populate_icon(&PasteIcon,"paste.png");
QIcon DuplicateIcon; QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png"); populate_icon(&DuplicateIcon,"duplicate.png");
QIcon MoveUpIcon; QIcon MoveUpIcon;
populate_icon(&MoveUpIcon,Theme,"moveup.png"); populate_icon(&MoveUpIcon,"moveup.png");
QIcon MoveDownIcon; QIcon MoveDownIcon;
populate_icon(&MoveDownIcon,Theme,"movedown.png"); populate_icon(&MoveDownIcon,"movedown.png");
QPoint globalPos = MixerlistWidget->mapToGlobal(pos); QPoint globalPos = MixerlistWidget->mapToGlobal(pos);
const QClipboard *clipboard = QApplication::clipboard(); const QClipboard *clipboard = QApplication::clipboard();

View file

@ -21,11 +21,10 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
generalSettings(generalSettings) generalSettings(generalSettings)
{ {
ui->setupUi(this); ui->setupUi(this);
QString Theme=getTheme();
QSettings settings("companion", "companion"); QSettings settings("companion", "companion");
restoreGeometry(settings.value("modelEditGeometry").toByteArray()); restoreGeometry(settings.value("modelEditGeometry").toByteArray());
QIcon SimulateIcon; QIcon SimulateIcon;
populate_icon(&SimulateIcon,Theme,"simulate.png"); populate_icon(&SimulateIcon,"simulate.png");
ui->pushButton->setIcon(SimulateIcon); 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"));

View file

@ -83,31 +83,30 @@ 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");
QString Theme=getTheme();
QIcon AddIcon; QIcon AddIcon;
populate_icon(&AddIcon,Theme,"add.png"); populate_icon(&AddIcon,"add.png");
QIcon EditIcon; QIcon EditIcon;
populate_icon(&EditIcon,Theme,"edit.png"); populate_icon(&EditIcon,"edit.png");
QIcon OpenIcon; QIcon OpenIcon;
populate_icon(&OpenIcon,Theme,"open.png"); populate_icon(&OpenIcon,"open.png");
QIcon WizardIcon; QIcon WizardIcon;
populate_icon(&WizardIcon,Theme,"wizard.png"); populate_icon(&WizardIcon,"wizard.png");
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon,Theme,"clear.png"); populate_icon(&ClearIcon,"clear.png");
QIcon CopyIcon; QIcon CopyIcon;
populate_icon(&CopyIcon,Theme,"copy.png"); populate_icon(&CopyIcon,"copy.png");
QIcon CutIcon; QIcon CutIcon;
populate_icon(&CutIcon,Theme,"cut.png"); populate_icon(&CutIcon,"cut.png");
QIcon PasteIcon; QIcon PasteIcon;
populate_icon(&PasteIcon,Theme,"paste.png"); populate_icon(&PasteIcon,"paste.png");
QIcon DuplicateIcon; QIcon DuplicateIcon;
populate_icon(&DuplicateIcon,Theme,"duplicate.png"); populate_icon(&DuplicateIcon,"duplicate.png");
QIcon CurrentModelIcon; QIcon CurrentModelIcon;
populate_icon(&CurrentModelIcon,Theme,"currentmodel.png"); populate_icon(&CurrentModelIcon,"currentmodel.png");
QIcon PrintIcon; QIcon PrintIcon;
populate_icon(&PrintIcon,Theme,"print.png"); populate_icon(&PrintIcon,"print.png");
QIcon SimulateIcon; QIcon SimulateIcon;
populate_icon(&SimulateIcon,Theme,"simulate.png"); populate_icon(&SimulateIcon,"simulate.png");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(EditIcon, tr("&Edit"),this,SLOT(OpenEditWindow())); contextMenu.addAction(EditIcon, tr("&Edit"),this,SLOT(OpenEditWindow()));

View file

@ -17,15 +17,14 @@ preferencesDialog::preferencesDialog(QWidget *parent) :
updateLock(false) updateLock(false)
{ {
ui->setupUi(this); ui->setupUi(this);
QString Theme=getTheme();
QIcon Icon; QIcon Icon;
populate_icon(&Icon, Theme, "preferences.png"); populate_icon(&Icon,"preferences.png");
this->setWindowIcon(Icon); this->setWindowIcon(Icon);
QIcon LibraryIcon; QIcon LibraryIcon;
populate_icon(&LibraryIcon, Theme, "library.png"); populate_icon(&LibraryIcon,"library.png");
ui->splashLibraryButton->setIcon(LibraryIcon); ui->splashLibraryButton->setIcon(LibraryIcon);
QIcon ClearIcon; QIcon ClearIcon;
populate_icon(&ClearIcon, Theme, "clear.png"); populate_icon(&ClearIcon,"clear.png");
ui->clearImageButton->setIcon(ClearIcon); ui->clearImageButton->setIcon(ClearIcon);
QCheckBox * OptionCheckBox[]= { QCheckBox * OptionCheckBox[]= {

View file

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>685</width> <width>685</width>
<height>766</height> <height>764</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -35,6 +35,79 @@
<property name="margin"> <property name="margin">
<number>4</number> <number>4</number>
</property> </property>
<item row="3" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLineEdit" name="backupPath">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>auto backup before write</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Show Splash At Start</string>
</property>
</widget>
</item>
<item row="16" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4"> <item row="2" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
@ -78,14 +151,14 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0" colspan="5"> <item row="6" column="0" colspan="5">
<widget class="Line" name="line"> <widget class="Line" name="line">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0"> <item row="15" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -101,31 +174,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3" colspan="2"> <item row="7" column="4" rowspan="7">
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0">
<item>
<widget class="QCheckBox" name="startupCheck_companion9x">
<property name="text">
<string>Check for updates on startup</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="startupCheck_fw">
<property name="text">
<string>Check for selected Fw updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="4" rowspan="7">
<layout class="QGridLayout" name="gridLayout_3" columnstretch="0,0"> <layout class="QGridLayout" name="gridLayout_3" columnstretch="0,0">
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QLabel" name="imageLabel"> <widget class="QLabel" name="imageLabel">
@ -180,17 +229,14 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="1" colspan="2"> <item row="15" column="2" colspan="2">
<widget class="QComboBox" name="locale_QB"/>
</item>
<item row="13" column="2" colspan="2">
<widget class="QCheckBox" name="simuSW"> <widget class="QCheckBox" name="simuSW">
<property name="text"> <property name="text">
<string>Remember switches in simulator</string> <string>Remember switches in simulator</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="1"> <item row="15" column="1">
<widget class="QComboBox" name="backLightColor"> <widget class="QComboBox" name="backLightColor">
<item> <item>
<property name="text"> <property name="text">
@ -219,7 +265,7 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="5" column="1" colspan="3"> <item row="7" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@ -256,7 +302,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="14" column="0"> <item row="17" column="0">
<widget class="QLabel" name="label_19"> <widget class="QLabel" name="label_19">
<property name="text"> <property name="text">
<string>Simulator capture folder</string> <string>Simulator capture folder</string>
@ -276,7 +322,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="29" column="4"> <item row="32" column="4">
<widget class="QComboBox" name="channelorderCB"> <widget class="QComboBox" name="channelorderCB">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -420,7 +466,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -433,35 +479,7 @@ This is used by the templated to determine which channel goes to what number out
</property> </property>
</widget> </widget>
</item> </item>
<item row="33" column="1" colspan="4"> <item row="13" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="1" colspan="3">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>1</number> <number>1</number>
@ -485,7 +503,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="22" column="1" colspan="4"> <item row="25" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QLabel" name="FwInfo"> <widget class="QLabel" name="FwInfo">
@ -509,7 +527,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="11" column="0"> <item row="13" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -522,7 +540,7 @@ This is used by the templated to determine which channel goes to what number out
</property> </property>
</widget> </widget>
</item> </item>
<item row="35" column="0" colspan="5"> <item row="38" column="0" colspan="5">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_3">
@ -565,7 +583,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="24" column="1" colspan="4"> <item row="27" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,0"> <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,0">
<item> <item>
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
@ -592,7 +610,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="30" column="1" colspan="4"> <item row="33" column="1" colspan="4">
<layout class="QGridLayout" name="gridLayout_6" columnstretch="0,0,1,0,0"> <layout class="QGridLayout" name="gridLayout_6" columnstretch="0,0,1,0,0">
<item row="1" column="4"> <item row="1" column="4">
<widget class="QPushButton" name="export_PB"> <widget class="QPushButton" name="export_PB">
@ -640,7 +658,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="14" column="1" colspan="4"> <item row="17" column="1" colspan="4">
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>1</number> <number>1</number>
@ -671,7 +689,7 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</item> </item>
<item row="29" column="0"> <item row="32" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -684,7 +702,7 @@ This is used by the templated to determine which channel goes to what number out
</property> </property>
</widget> </widget>
</item> </item>
<item row="29" column="3"> <item row="32" column="3">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
@ -700,7 +718,7 @@ This is used by the templated to determine which channel goes to what number out
</property> </property>
</widget> </widget>
</item> </item>
<item row="29" column="1" colspan="2"> <item row="32" column="1" colspan="2">
<widget class="QComboBox" name="stickmodeCB"> <widget class="QComboBox" name="stickmodeCB">
<property name="whatsThis"> <property name="whatsThis">
<string>Mode selection: <string>Mode selection:
@ -749,58 +767,13 @@ Mode 4:
</widget> </widget>
</item> </item>
<item row="33" column="0"> <item row="33" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Joystick</string>
</property>
</widget>
</item>
<item row="30" column="0">
<widget class="QLabel" name="label_15"> <widget class="QLabel" name="label_15">
<property name="text"> <property name="text">
<string>Profile slot</string> <string>Profile slot</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="17" column="0"> <item row="28" column="1" colspan="4">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="17" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLineEdit" name="backupPath">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>auto backup before write</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="25" column="1" colspan="4">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -816,7 +789,7 @@ Mode 4:
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="23" column="1" colspan="4"> <item row="26" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,0"> <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,0">
<item> <item>
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_18">
@ -843,7 +816,7 @@ Mode 4:
</item> </item>
</layout> </layout>
</item> </item>
<item row="19" column="1" colspan="4"> <item row="22" column="1" colspan="4">
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,0,0,0,0"> <layout class="QGridLayout" name="gridLayout_5" columnstretch="1,0,0,0,0">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum> <enum>QLayout::SetMaximumSize</enum>
@ -934,7 +907,7 @@ May be different from firmware language</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="19" column="0"> <item row="22" column="0">
<layout class="QGridLayout" name="gridLayout_7"> <layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
@ -987,14 +960,14 @@ May be different from firmware language</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="15" column="0" colspan="5"> <item row="18" column="0" colspan="5">
<widget class="Line" name="line_2"> <widget class="Line" name="line_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="21" column="1" colspan="4"> <item row="24" column="1" colspan="4">
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0,0"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0,0">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum> <enum>QLayout::SetMaximumSize</enum>
@ -1547,45 +1520,7 @@ May be different from firmware language</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="18" column="1" colspan="4"> <item row="10" column="0">
<layout class="QHBoxLayout" name="ge_layout">
<item>
<widget class="QLineEdit" name="ge_lineedit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Find Executable</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="18" column="0">
<widget class="QLabel" name="ge_label">
<property name="text">
<string>Google Earth Executable</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Show Splash At Start</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -1598,7 +1533,7 @@ May be different from firmware language</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1" colspan="3"> <item row="10" column="1" colspan="3">
<widget class="QComboBox" name="splashincludeCB"> <widget class="QComboBox" name="splashincludeCB">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1618,17 +1553,10 @@ May be different from firmware language</string>
</item> </item>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="4"> <item row="0" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QCheckBox" name="showSplash"> <widget class="QComboBox" name="locale_QB"/>
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
@ -1645,6 +1573,9 @@ May be different from firmware language</string>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="toolTip">
<string/>
</property>
<property name="text"> <property name="text">
<string>Theme</string> <string>Theme</string>
</property> </property>
@ -1652,6 +1583,9 @@ May be different from firmware language</string>
</item> </item>
<item> <item>
<widget class="QComboBox" name="theme_CB"> <widget class="QComboBox" name="theme_CB">
<property name="toolTip">
<string>Requires restart</string>
</property>
<item> <item>
<property name="text"> <property name="text">
<string>Classic</string> <string>Classic</string>
@ -1682,6 +1616,9 @@ May be different from firmware language</string>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="toolTip">
<string/>
</property>
<property name="text"> <property name="text">
<string>Icon size</string> <string>Icon size</string>
</property> </property>
@ -1689,6 +1626,9 @@ May be different from firmware language</string>
</item> </item>
<item> <item>
<widget class="QComboBox" name="iconSize_CB"> <widget class="QComboBox" name="iconSize_CB">
<property name="toolTip">
<string>Requires restart</string>
</property>
<item> <item>
<property name="text"> <property name="text">
<string>Small</string> <string>Small</string>
@ -1713,10 +1653,94 @@ May be different from firmware language</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="1" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0,0,0">
<item>
<widget class="QCheckBox" name="showSplash">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="startupCheck_companion9x">
<property name="text">
<string>Check for updates on startup</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="startupCheck_fw">
<property name="text">
<string>Check for selected Fw updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="16" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Joystick</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="ge_label">
<property name="text">
<string>Google Earth Executable</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="4">
<layout class="QHBoxLayout" name="ge_layout">
<item>
<widget class="QLineEdit" name="ge_lineedit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Find Executable</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>locale_QB</tabstop>
<tabstop>InvertPixels</tabstop> <tabstop>InvertPixels</tabstop>
<tabstop>clearImageButton</tabstop> <tabstop>clearImageButton</tabstop>
<tabstop>SplashFileName</tabstop> <tabstop>SplashFileName</tabstop>

View file

@ -9,11 +9,10 @@
splashLibrary::splashLibrary(QWidget *parent, QString * fileName) : QDialog(parent), ui(new Ui::splashLibrary) { splashLibrary::splashLibrary(QWidget *parent, QString * fileName) : QDialog(parent), ui(new Ui::splashLibrary) {
splashFileName = fileName; splashFileName = fileName;
ui->setupUi(this); ui->setupUi(this);
QString Theme=getTheme();
QIcon NextIcon; QIcon NextIcon;
populate_icon(&NextIcon,Theme,"arrow-right.png"); populate_icon(&NextIcon,"arrow-right.png");
QIcon PrevIcon; QIcon PrevIcon;
populate_icon(&PrevIcon,Theme,"arrow-left.png"); populate_icon(&PrevIcon,"arrow-left.png");
ui->nextPage->setIcon(NextIcon); ui->nextPage->setIcon(NextIcon);
ui->prevPage->setIcon(PrevIcon); ui->prevPage->setIcon(PrevIcon);
page = 0; page = 0;