Merge branch 'next'

Conflicts:
	companion/src/customizesplashdialog.cpp
	companion/src/mainwindow.cpp
	companion/src/translations/companion_pl.ts
This commit is contained in:
openfsguruh
2014-02-17 20:56:50 +01:00
127 changed files with 46890 additions and 1083 deletions
+10 -5
View File
@@ -80,7 +80,15 @@ IF( Subversion_FOUND )
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} C9X )
ENDIF( )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../../radio/src/fonts/std )
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${RADIO_SRC_DIRECTORY}/../..
${RADIO_SRC_DIRECTORY}
${RADIO_SRC_DIRECTORY}/fonts/std
${RADIO_SRC_DIRECTORY}/lua/src
)
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
add_custom_command(
@@ -109,8 +117,6 @@ add_custom_command(
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
COMMAND make lbm
@@ -298,8 +304,7 @@ ENDIF( )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
SET( LANGUAGES he pl pt ru de fr it sv cs )
SET( LANGUAGES he pl pt ru de fr it sv cs fi)
FOREACH( language ${LANGUAGES} )
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
ENDFOREACH( language )
+2 -2
View File
@@ -212,8 +212,8 @@ void burnDialog::checkFw(QString fileName)
ui->SplashFrame->show();
ui->ImageLoadButton->setEnabled(true);
ui->libraryButton->setEnabled(true);
ui->FwImage->setFixedSize(flash.getSplashWidth(),flash.getSplashHeight());
ui->imageLabel->setFixedSize(flash.getSplashWidth(),flash.getSplashHeight());
ui->FwImage->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
ui->FwImage->show();
ui->FwImage->setPixmap(QPixmap::fromImage(flash.getSplash()));
QString ImageStr = settings.value("SplashImage", "").toString();
+1 -1
View File
@@ -37,7 +37,7 @@ bool Side::displayImage( QString fileName, Source pictSource )
return false;
else
image = flash.getSplash();
*format = flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X;
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
}
else {
image.load(fileName);
+5 -5
View File
@@ -57,8 +57,8 @@ RawSourceRange RawSource::getRange(bool singleprec)
break;
case TELEMETRY_SOURCE_TIMER1:
case TELEMETRY_SOURCE_TIMER2:
result.step = singleprec ? 3 : 1;
result.max = singleprec ? 765 : 7200;
result.step = singleprec ? 5 : 1;
result.max = singleprec ? 255*5 : 7200;
break;
case TELEMETRY_SOURCE_RSSI_TX:
case TELEMETRY_SOURCE_RSSI_RX:
@@ -175,9 +175,9 @@ QString RawSource::toString()
static const QString telemetry[] = { QObject::tr("Batt"), QObject::tr("Timer1"), QObject::tr("Timer2"),
(IS_TARANIS(GetEepromInterface()->getBoard()) ? QObject::tr("SWR") : QObject::tr("Tx")), (IS_TARANIS(GetEepromInterface()->getBoard()) ? QObject::tr("RSSI") : QObject::tr("Rx")), QObject::tr("A1"), QObject::tr("A2"), QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"),
QObject::tr("T2"), QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"), QObject::tr("Cell"), QObject::tr("Cels"), QObject::tr("Vfas"), QObject::tr("Curr"),
QObject::tr("Cnsp"), QObject::tr("Powr"), QObject::tr("AccX"), QObject::tr("AccY"), QObject::tr("AccZ"), QObject::tr("HDG "), QObject::tr("VSpd"), QObject::tr("A1-"),
QObject::tr("A2-"), QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Spd+"), QObject::tr("Dst+"),
QObject::tr("Cur+"), QObject::tr("Pwr+"), QObject::tr("ACC "), QObject::tr("Time"),
QObject::tr("Cnsp"), QObject::tr("Powr"), QObject::tr("AccX"), QObject::tr("AccY"), QObject::tr("AccZ"), QObject::tr("HDG "), QObject::tr("VSpd"), QObject::tr("ASpd"), QObject::tr("dTE"),
QObject::tr("A1-"), QObject::tr("A2-"), QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Spd+"), QObject::tr("Dst+"), QObject::tr("Cel-"), QObject::tr("Vfs-"), QObject::tr("Cur+"), QObject::tr("Pwr+"),
QObject::tr("ACC "), QObject::tr("Time"),
};
static const QString virtualSwitches[] = { QObject::tr("LS1"), QObject::tr("LS2"), QObject::tr("LS3"), QObject::tr("LS4"), QObject::tr("LS5"), QObject::tr("LS6"), QObject::tr("LS7"), QObject::tr("LS8"), QObject::tr("LS9"), QObject::tr("LSA"),
+17 -1
View File
@@ -198,6 +198,8 @@ enum TelemetrySource {
TELEMETRY_SOURCE_ACCZ,
TELEMETRY_SOURCE_HDG,
TELEMETRY_SOURCE_VERTICAL_SPEED,
TELEMETRY_SOURCE_ASPD,
TELEMETRY_SOURCE_DTE,
TELEMETRY_SOURCE_A1_MIN,
TELEMETRY_SOURCE_A2_MIN,
TELEMETRY_SOURCE_ALT_MIN,
@@ -207,7 +209,8 @@ enum TelemetrySource {
TELEMETRY_SOURCE_T2_MAX,
TELEMETRY_SOURCE_SPEED_MAX,
TELEMETRY_SOURCE_DIST_MAX,
TELEMETRY_SOURCE_CURRENT_MAX,
TELEMETRY_SOURCE_CELL_MIN,
TELEMETRY_SOURCE_VFAS_MIN,
TELEMETRY_SOURCE_POWER_MAX,
TELEMETRY_SOURCE_ACC,
TELEMETRY_SOURCE_GPS_TIME,
@@ -853,6 +856,17 @@ class ModuleData {
void clear() { memset(this, 0, sizeof(ModuleData)); }
};
#define C9X_MAX_SCRIPTS 3
#define C9X_MAX_SCRIPT_INPUTS 10
class ScriptData {
public:
ScriptData() { clear(); }
char filename[10+1];
char name[10+1];
int inputs[C9X_MAX_SCRIPT_INPUTS];
void clear() { memset(this, 0, sizeof(ScriptData)); }
};
class ModelData {
public:
ModelData();
@@ -907,6 +921,8 @@ class ModelData {
ModuleData moduleData[C9X_NUM_MODULES+1/*trainer*/];
ScriptData scriptData[C9X_MAX_SCRIPTS];
void clear();
bool isempty();
void setDefault(uint8_t id);
@@ -49,7 +49,8 @@
#define PPM_CENTER_ADJUSTABLE
#define PPM_LIMITS_SYMETRICAL
#define FAI_CHOICE
#define LUA
#define LUA_MODEL_SCRIPTS
#define EEPROM_VARIANT 3
#undef min
@@ -115,6 +116,36 @@ inline int geteepromsize() {
#include "radio/src/translations/tts_pt.cpp"
#include "radio/src/translations/tts_sk.cpp"
#include "radio/src/translations/tts_pl.cpp"
#include "radio/src/lua.cpp"
#include "radio/src/lua/src/lapi.c"
#include "radio/src/lua/src/lcode.c"
#include "radio/src/lua/src/lctype.c"
#include "radio/src/lua/src/ldebug.c"
#include "radio/src/lua/src/ldo.c"
#include "radio/src/lua/src/ldump.c"
#include "radio/src/lua/src/lfunc.c"
#include "radio/src/lua/src/lgc.c"
#include "radio/src/lua/src/llex.c"
#include "radio/src/lua/src/lmem.c"
#include "radio/src/lua/src/lobject.c"
#include "radio/src/lua/src/lopcodes.c"
#include "radio/src/lua/src/lparser.c"
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
#include "radio/src/lua/src/lzio.c"
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
#include "radio/src/lua/src/lcorolib.c"
int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS];
@@ -235,8 +235,13 @@ class SourcesConversionTable: public ConversionTable {
if (afterrelease21March2013)
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, 0), val++);
for (int i=1; i<TELEMETRY_SOURCE_ACC; i++)
for (int i=1; i<TELEMETRY_SOURCE_ACC; i++) {
if (version < 216) {
if (i==TELEMETRY_SOURCE_ASPD-1 || i==TELEMETRY_SOURCE_DTE-1 || i==TELEMETRY_SOURCE_CELL_MIN-1 || i==TELEMETRY_SOURCE_VFAS_MIN-1)
continue;
}
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
}
}
}
@@ -2198,14 +2203,21 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
}
if (IS_TARANIS(board) && version >= 216) {
// TODO ScriptData scriptsData[MAX_SCRIPTS];
internalField.Append(new SpareBitsField<720>());
for (int i=0; i<32; i++)
for (int i=0; i<3; i++) {
ScriptData & script = modelData.scriptData[i];
internalField.Append(new ZCharField<10>(script.filename));
internalField.Append(new ZCharField<10>(script.name));
for (int j=0; j<10; j++) {
internalField.Append(new SignedField<8>(script.inputs[j]));
}
}
for (int i=0; i<32; i++) {
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
}
internalField.Append(new UnsignedField<8>(modelData.nPotsToWarn));
for (int i=0; i < GetEepromInterface()->getCapability(Pots); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
}
}
}
}
+1 -1
View File
@@ -413,7 +413,7 @@ bool FlashInterface::setSplash(const QImage & newsplash)
}
}
uint FlashInterface::getSplashWidth()
int FlashInterface::getSplashWidth()
{
return splash_width;
}
+1 -1
View File
@@ -59,7 +59,7 @@ public:
QImage getSplash();
bool setSplash(const QImage & newsplash);
bool hasSplash();
uint getSplashWidth();
int getSplashWidth();
uint getSplashHeight();
uint getSplashColors();
QImage::Format getSplashFormat();
+1 -1
View File
@@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
<string>Downloads and Profiles</string>
<string>Downloads</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
+2 -2
View File
@@ -48,8 +48,8 @@ void populateGvSourceCB(QComboBox *b, int value)
void populateVoiceLangCB(QComboBox *b, QString language)
{
QString strings[] = { QObject::tr("English"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
QString langcode[] = { "en", "fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
b->clear();
for (int i=0; strings[i]!=NULL; i++) {
+249 -335
View File
@@ -98,32 +98,16 @@ MainWindow::MainWindow():
MaxRecentFiles=MAX_RECENT;
QSettings settings;
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());
createActions();
createMenus();
createToolBars();
createStatusBar();
updateMenus();
readSettings();
setUnifiedTitleAndToolBarOnMac(true);
this->setWindowIcon(QIcon(":/icon.png"));
this->setIconSize(QSize(32,32));
@@ -161,7 +145,7 @@ MainWindow::MainWindow():
int fileType = getFileType(str);
if(fileType==FILE_TYPE_HEX) {
burnToFlash(str);
writeFlash(str);
}
if(fileType==FILE_TYPE_EEPE || fileType==FILE_TYPE_EEPM || fileType==FILE_TYPE_BIN) {
@@ -235,7 +219,7 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId)
}
}
if (checkCompanion9x || ignoreSettings) {
if (checkCompanion || ignoreSettings) {
check2done = false;
manager2 = new QNetworkAccessManager(this);
connect(manager2, SIGNAL(finished(QNetworkReply*)),this, SLOT(checkForUpdateFinished(QNetworkReply*)));
@@ -351,8 +335,6 @@ void MainWindow::reply1Accepted()
{
QString errormsg;
QSettings settings;
bool autoflash=settings.value("burnFirmware", true).toBool();
bool addversion=settings.value("rename_firmware_files", false).toBool();
settings.beginGroup("FwRevisions");
if (downloadedFWFilename.isEmpty()) {
if (!(downloadedFW.isEmpty())) {
@@ -437,7 +419,7 @@ void MainWindow::reply1Accepted()
int pos=rev.lastIndexOf("-r");
if (pos>0) {
currentFWrev=rev.mid(pos+2).toInt();
if (addversion && needRename) {
if (settings.value("rename_firmware_files", false).toBool() && needRename) {
QFileInfo fi(downloadedFWFilename);
QString path=fi.path()+QDir::separator ();
path.append(fi.completeBaseName());
@@ -450,10 +432,10 @@ void MainWindow::reply1Accepted()
downloadedFWFilename=path;
}
settings.setValue(downloadedFW, currentFWrev);
if (autoflash) {
if (settings.value("burnFirmware", true).toBool()) {
int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
burnToFlash(downloadedFWFilename);
writeFlash(downloadedFWFilename);
}
}
}
@@ -681,7 +663,7 @@ void MainWindow::newFile()
child->show();
}
void MainWindow::openDocumentURL()
void MainWindow::openDocURL()
{
QString link = "http://www.open-tx.org/documents.html";
QDesktopServices::openUrl(QUrl(link));
@@ -788,14 +770,14 @@ void MainWindow::loadProfile()
}
}
void MainWindow::appPreferences()
void MainWindow::appPrefs()
{
appPreferencesDialog *pd = new appPreferencesDialog(this);
pd->exec();
updateMenus();
}
void MainWindow::fwPreferences()
void MainWindow::fwPrefs()
{
fwPreferencesDialog *pd = new fwPreferencesDialog(this);
pd->exec();
@@ -858,10 +840,10 @@ void MainWindow::paste()
activeMdiChild()->paste();
}
void MainWindow::burnTo()
void MainWindow::writeEeprom()
{
if (activeMdiChild())
activeMdiChild()->burnTo();
activeMdiChild()->writeEeprom();
}
void MainWindow::simulate()
@@ -1082,7 +1064,7 @@ QString MainWindow::FindTaranisPath()
}
void MainWindow::burnFrom()
void MainWindow::readEeprom()
{
QString tempDir = QDir::tempPath();
QString tempFile;
@@ -1123,7 +1105,7 @@ void MainWindow::burnFrom()
}
}
void MainWindow::burnExtenalToEEPROM()
void MainWindow::writeFileToEeprom()
{
QSettings settings;
QString fileName;
@@ -1377,7 +1359,7 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
return true;
}
void MainWindow::burnToFlash(QString fileToFlash)
void MainWindow::writeFlash(QString fileToFlash)
{
QSettings settings;
QString fileName;
@@ -1476,7 +1458,7 @@ void MainWindow::burnToFlash(QString fileToFlash)
}
}
void MainWindow::burnExtenalFromEEPROM()
void MainWindow::readEepromToFile()
{
QSettings settings;
QString fileName = QFileDialog::getSaveFileName(this, tr("Save transmitter Models and Settings to File"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER));
@@ -1508,7 +1490,7 @@ void MainWindow::burnExtenalFromEEPROM()
}
}
void MainWindow::burnFromFlash()
void MainWindow::readFlash()
{
QSettings settings;
QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), settings.value("lastFlashDir").toString(),tr(FLASH_FILES_FILTER));
@@ -1580,11 +1562,10 @@ void MainWindow::updateMenus()
saveAct->setEnabled(hasMdiChild);
saveAsAct->setEnabled(hasMdiChild);
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
burnToAct->setEnabled(hasMdiChild);
writeEepromAct->setEnabled(hasMdiChild);
separatorAct->setVisible(hasMdiChild);
bool hasSelection = (activeMdiChild() &&
activeMdiChild()->hasSelection());
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
cutAct->setEnabled(hasSelection);
copyAct->setEnabled(hasSelection);
simulateAct->setEnabled(hasSelection);
@@ -1593,6 +1574,9 @@ void MainWindow::updateMenus()
compareAct->setEnabled(activeMdiChild());
updateRecentFileActions();
updateProfilesActions();
updateLanguageActions();
updateIconSizeActions();
updateIconThemeActions();
QSettings settings;
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg(settings.value("profileId").toString()));
@@ -1613,152 +1597,39 @@ MdiChild *MainWindow::createMdiChild()
return child;
}
QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySequence::StandardKey shortcut, const char *slot)
{
QAction * newAction = new QAction( this );
if (!icon.isEmpty())
newAction->setIcon(CompanionIcon(icon));
if (!sName.isEmpty())
newAction->setText(sName);
if (!lName.isEmpty())
newAction->setStatusTip(lName);
if (shortcut != 0)
newAction->setShortcuts(shortcut);
connect(newAction, SIGNAL(triggered()), this, slot);
return newAction;
}
QAction * MainWindow::addAct(QString icon, QString sName, QString lName, const char *slot)
{
return addAct(icon, sName, lName, QKeySequence::UnknownKey, slot);
}
QAction * MainWindow::addAct(QActionGroup *aGroup, QString sName, QString lName, const char *slot)
{
QAction *action = addAct("", sName, lName, QKeySequence::UnknownKey, slot);
action->setCheckable(true);
aGroup->addAction(action);
return action;
}
void MainWindow::createActions()
{
newAct = new QAction(CompanionIcon("new.png"), tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
openAct = new QAction(CompanionIcon("open.png"), tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));
loadbackupAct = new QAction(CompanionIcon("open.png"), tr("&loadBackup..."), this);
loadbackupAct->setStatusTip(tr("Load backup from file"));
connect(loadbackupAct, SIGNAL(triggered()), this, SLOT(loadBackup()));
saveAct = new QAction(CompanionIcon("save.png"), tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
saveAsAct = new QAction(CompanionIcon("saveas.png"), tr("Save &As..."), this);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
logsAct = new QAction(CompanionIcon("logs.png"), tr("Lo&gs"), this);
logsAct->setShortcut(tr("Ctrl+G"));
logsAct->setStatusTip(tr("Open log file"));
connect(logsAct, SIGNAL(triggered()), this, SLOT(logFile()));
appPreferencesAct = new QAction(CompanionIcon("apppreferences.png"), tr("&Setting..."), this);
appPreferencesAct->setStatusTip(tr("Edit Settings"));
connect(appPreferencesAct, SIGNAL(triggered()), this, SLOT(appPreferences()));
fwPreferencesAct = new QAction(CompanionIcon("fwpreferences.png"), tr("&Downloads..."), this);
fwPreferencesAct->setStatusTip(tr("Download firmware and voice files"));
connect(fwPreferencesAct, SIGNAL(triggered()), this, SLOT(fwPreferences()));
checkForUpdatesAct = new QAction(CompanionIcon("update.png"), tr("&Check for updates..."), this);
checkForUpdatesAct->setStatusTip(tr("Check for new version of Companion"));
connect(checkForUpdatesAct, SIGNAL(triggered()), this, SLOT(doUpdates()));
contributorsAct = new QAction(CompanionIcon("contributors.png"), tr("Contributors &List..."), this);
contributorsAct->setStatusTip(tr("Show Companion contributors list"));
connect(contributorsAct, SIGNAL(triggered()), this, SLOT(contributors()));
changelogAct = new QAction(CompanionIcon("changelog.png"), tr("ChangeLog..."), this);
changelogAct->setStatusTip(tr("Show Companion changelog"));
connect(changelogAct, SIGNAL(triggered()), this, SLOT(changelog()));
fwchangelogAct = new QAction(CompanionIcon("changelog.png"), tr("Firmware ChangeLog..."), this);
fwchangelogAct->setStatusTip(tr("Show firmware changelog"));
connect(fwchangelogAct, SIGNAL(triggered()), this, SLOT(fwchangelog()));
compareAct = new QAction(CompanionIcon("compare.png"), tr("Compare..."), this);
compareAct->setStatusTip(tr("Compare models"));
compareAct->setEnabled(false);
connect(compareAct, SIGNAL(triggered()), this, SLOT(compare()));
customizeSplashAct = new QAction(CompanionIcon("paintbrush.png"), tr("Configure transmitter start screen..."), this);
customizeSplashAct->setStatusTip(tr("Customize the splash screen of your TX"));
connect(customizeSplashAct, SIGNAL(triggered()), this, SLOT(customizeSplash()));
exitAct = new QAction(CompanionIcon("exit.png"), tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
cutAct = new QAction(CompanionIcon("cut.png"), tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
copyAct = new QAction(CompanionIcon("copy.png"), tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
pasteAct = new QAction(CompanionIcon("paste.png"), tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
burnToAct = new QAction(CompanionIcon("write_eeprom.png"), tr("&Write Models and Settings To Tx"), this);
burnToAct->setShortcut(tr("Ctrl+Alt+W"));
burnToAct->setStatusTip(tr("Write Models and Settings to transmitter"));
connect(burnToAct,SIGNAL(triggered()),this,SLOT(burnTo()));
burnFromAct = new QAction(CompanionIcon("read_eeprom.png"), tr("&Read Models and Settings From Tx"), this);
burnFromAct->setShortcut(tr("Ctrl+Alt+R"));
burnFromAct->setStatusTip(tr("Read Models and Settings from transmitter"));
connect(burnFromAct,SIGNAL(triggered()),this,SLOT(burnFrom()));
burnToFlashAct = new QAction(CompanionIcon("write_flash.png"), tr("Write Firmware"), this);
burnToFlashAct->setStatusTip(tr("Write firmware to transmitter"));
connect(burnToFlashAct,SIGNAL(triggered()),this,SLOT(burnToFlash()));
burnExtenalToEEPROMAct = new QAction(CompanionIcon("write_eeprom_file.png"), tr("Write Models and Settings from file to Tx"), this);
burnExtenalToEEPROMAct->setStatusTip(tr("Write Models and Settings from file to transmitter"));
connect(burnExtenalToEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalToEEPROM()));
burnExtenalFromEEPROMAct = new QAction(CompanionIcon("read_eeprom_file.png"), tr("Save transmitter Models and Settings to file"), this);
burnExtenalFromEEPROMAct->setStatusTip(tr("Save the Models and Settings from the transmitter to a file"));
connect(burnExtenalFromEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalFromEEPROM()));
burnFromFlashAct = new QAction(CompanionIcon("read_flash.png"), tr("Read Firmware"), this);
burnFromFlashAct->setStatusTip(tr("Read firmware from transmitter"));
connect(burnFromFlashAct,SIGNAL(triggered()),this,SLOT(burnFromFlash()));
burnConfigAct = new QAction(CompanionIcon("configure.png"), tr("&Configure connection software..."), this);
burnConfigAct->setStatusTip(tr("Configure software for reading from and writing to the transmitter"));
connect(burnConfigAct,SIGNAL(triggered()),this,SLOT(burnConfig()));
EEPROMInterface *eepromInterface = GetEepromInterface();
if (!IS_ARM(eepromInterface->getBoard())) {
burnListAct = new QAction(CompanionIcon("list.png"), tr("&List programmers"), this);
burnListAct->setStatusTip(tr("List available programmers"));
connect(burnListAct,SIGNAL(triggered()),this,SLOT(burnList()));
burnFusesAct = new QAction(CompanionIcon("fuses.png"), tr("&Fuses..."), this);
burnFusesAct->setStatusTip(tr("Show fuses dialog"));
connect(burnFusesAct,SIGNAL(triggered()),this,SLOT(burnFuses()));
}
simulateAct = new QAction(CompanionIcon("simulate.png"), tr("&Simulate"), this);
simulateAct->setShortcut(tr("Alt+S"));
simulateAct->setStatusTip(tr("Simulate selected model."));
simulateAct->setEnabled(false);
connect(simulateAct,SIGNAL(triggered()),this,SLOT(simulate()));
printAct = new QAction(CompanionIcon("print.png"), tr("&Print"), this);
printAct->setShortcut(tr("Ctrl+P"));
printAct->setStatusTip(tr("Print current model."));
printAct->setEnabled(false);
connect(printAct,SIGNAL(triggered()),this,SLOT(print()));
separatorAct = new QAction(this);
separatorAct->setSeparator(true);
aboutAct = new QAction(CompanionIcon("information.png"), tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
for (int i = 0; i < MaxRecentFiles; ++i) {
recentFileActs[i] = new QAction(this);
recentFileActs[i]->setVisible(false);
@@ -1766,96 +1637,80 @@ void MainWindow::createActions()
}
updateRecentFileActions();
QActionGroup *profilesAlignmentGroup = new QActionGroup(this);
for (int i=0; i<MAX_PROFILES; i++) {
profileActs[i] = new QAction(this);
profileActs[i]->setVisible(false);
profileActs[i]->setCheckable(true);
profilesAlignmentGroup->addAction(profileActs[i]);
connect(profileActs[i], SIGNAL(triggered()), this, SLOT(loadProfile()));
}
updateProfilesActions();
createProfileAct = new QAction(tr("New Profile"), this);
createProfileAct->setStatusTip(tr("Create a new Radio Setting Profile"));
connect(createProfileAct, SIGNAL(triggered()), this, SLOT(createProfile()));
classicThemeAct = new QAction(tr("Classical"), this);
classicThemeAct->setStatusTip(tr("The classical Companion icon theme"));
connect(classicThemeAct, SIGNAL(triggered()), this, SLOT(setClassicTheme()));
newThemeAct = new QAction(tr("New"), this);
newThemeAct->setStatusTip(tr("The Companion 2.0 colored icon theme"));
connect(newThemeAct, SIGNAL(triggered()), this, SLOT(setNewTheme()));
monoThemeAct = new QAction("Monochrome",this);
monoThemeAct->setStatusTip(tr("A monochrome black icon theme"));
connect(monoThemeAct, SIGNAL(triggered()), this, SLOT(setMonochromeTheme()));
monoWhiteThemeAct = new QAction("MonoWhite",this);
monoWhiteThemeAct->setStatusTip(tr("A monochrome white icon theme"));
connect(monoWhiteThemeAct, SIGNAL(triggered()), this, SLOT(setMonoWhiteTheme()));
monoBlueThemeAct = new QAction("MonoBlue",this);
monoBlueThemeAct->setStatusTip(tr("A monochrome blue icon theme"));
connect(monoBlueThemeAct, SIGNAL(triggered()), this, SLOT(setMonoBlueTheme()));
newAct = addAct("new.png", tr("New"), tr("Create a new file"), QKeySequence::New, SLOT(newFile()));
openAct = addAct("open.png", tr("Open..."), tr("Open an existing file"), QKeySequence::Open, SLOT(openFile()));
saveAct = addAct("save.png", tr("Save..."), tr("Save the document to disk"), QKeySequence::Save, SLOT(save()));
saveAsAct = addAct("saveas.png", tr("Save As..."), tr("Save the document to disk"), QKeySequence::SaveAs, SLOT(saveAs()));
exitAct = addAct("exit.png", tr("Exit"), tr("Exit the application"), QKeySequence::Quit, SLOT(newFile()));
cutAct = addAct("cut.png", tr("Cut"), tr("Cut current selection to the clipboard"), QKeySequence::Cut, SLOT(cut()));
copyAct = addAct("copy.png", tr("Copy..."), tr("Copy current selection to the clipboard"), QKeySequence::Copy, SLOT(copy()));
pasteAct = addAct("paste.png", tr("Paste..."), tr("Paste clipboard into current selection"), QKeySequence::Paste, SLOT(paste()));
QActionGroup *themeAlignGroup = new QActionGroup(this);
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classical Companion icon theme"), SLOT(setClassicTheme()));
newThemeAct = addAct( themeAlignGroup, tr("New"), tr("The new Companion 2 icon theme"), SLOT(setNewTheme()));
monoThemeAct = addAct( themeAlignGroup, tr("Monochrome"), tr("A monochrome black icon theme"), SLOT(setMonochromeTheme()));
monoWhiteAct = addAct( themeAlignGroup, tr("MonoWhite"), tr("A monochrome white icon theme"), SLOT(setMonoWhiteTheme()));
monoBlueAct = addAct( themeAlignGroup, tr("MonoBlue"), tr("A monochrome blue icon theme"), SLOT(setMonoBlueTheme()));
smallIconAct = new QAction(tr("Small"),this);
smallIconAct->setStatusTip(tr("Use small toolbar icons"));
connect(smallIconAct, SIGNAL(triggered()), this, SLOT(setSmallIconThemeSize()));
normalIconAct = new QAction(this);
normalIconAct->setStatusTip(tr("Use normal size toolbar icons"));
normalIconAct->setText(tr("Normal"));
connect(normalIconAct, SIGNAL(triggered()), this, SLOT(setNormalIconThemeSize()));
bigIconAct = new QAction(this);
bigIconAct->setStatusTip(tr("Use big toolbar icons"));
bigIconAct->setText(tr("Big"));
connect(bigIconAct, SIGNAL(triggered()), this, SLOT(setBigIconThemeSize()));
hugeIconAct = new QAction(this);
hugeIconAct->setStatusTip(tr("Use huge toolbar icons"));
hugeIconAct->setText(tr("Huge"));
connect(hugeIconAct, SIGNAL(triggered()), this, SLOT(setHugeIconThemeSize()));
QActionGroup *iconAlignGroup = new QActionGroup(this);
smallIconAct = addAct( iconAlignGroup, tr("Small"), tr("Use small toolbar icons"), SLOT(setSmallIconThemeSize()));
normalIconAct = addAct( iconAlignGroup, tr("Normal"), tr("Use normal size toolbar icons"), SLOT(setNormalIconThemeSize()));
bigIconAct = addAct( iconAlignGroup, tr("Big"), tr("Use big toolbar icons"), SLOT(setBigIconThemeSize()));
hugeIconAct = addAct( iconAlignGroup, tr("Huge"), tr("Use huge toolbar icons"), SLOT(setHugeIconThemeSize()));
defaultLanguageAct = new QAction(tr("System default language"),this);
defaultLanguageAct->setStatusTip(tr("Use system default language in menus"));
connect(defaultLanguageAct, SIGNAL(triggered()), this, SLOT(setDefaultLanguage()));
czechLanguageAct = new QAction(tr("Czech"),this);
czechLanguageAct->setStatusTip(tr("Use Czech in menus"));
connect(czechLanguageAct, SIGNAL(triggered()), this, SLOT(setCZLanguage()));
germanLanguageAct = new QAction(tr("German"),this);
germanLanguageAct->setStatusTip(tr("Use German in menus"));
connect(germanLanguageAct, SIGNAL(triggered()), this, SLOT(setDELanguage()));
englishLanguageAct = new QAction(tr("English"),this);
englishLanguageAct->setStatusTip(tr("Use English in menus"));
connect(englishLanguageAct, SIGNAL(triggered()), this, SLOT(setENLanguage()));
frenchLanguageAct = new QAction(tr("French"),this);
frenchLanguageAct->setStatusTip(tr("Use French in menus"));
connect(frenchLanguageAct, SIGNAL(triggered()), this, SLOT(setFRLanguage()));
italianLanguageAct = new QAction(tr("Italian"),this);
italianLanguageAct->setStatusTip(tr("Use Italian in menus"));
connect(italianLanguageAct, SIGNAL(triggered()), this, SLOT(setITLanguage()));
hebrewLanguageAct = new QAction(tr("Hebrew"),this);
hebrewLanguageAct->setStatusTip(tr("Use Hebrew in menus"));
connect(hebrewLanguageAct, SIGNAL(triggered()), this, SLOT(setHELanguage()));
polishLanguageAct = new QAction(tr("Polish"),this);
polishLanguageAct->setStatusTip(tr("Use Polish in menus"));
connect(polishLanguageAct, SIGNAL(triggered()), this, SLOT(setPLLanguage()));
portugueseLanguageAct = new QAction(tr("Portuguese"),this);
portugueseLanguageAct->setStatusTip(tr("Use Portuguese in menus"));
connect(portugueseLanguageAct, SIGNAL(triggered()), this, SLOT(setPTLanguage()));
swedishLanguageAct = new QAction(tr("Swedish"),this);
swedishLanguageAct->setStatusTip(tr("Use Swedish in menus"));
connect(swedishLanguageAct, SIGNAL(triggered()), this, SLOT(setSELanguage()));
russianLanguageAct = new QAction(tr("Russian"),this);
russianLanguageAct->setStatusTip(tr("Use Russian in menus"));
connect(russianLanguageAct, SIGNAL(triggered()), this, SLOT(setRULanguage()));
openDocumentURLAct = new QAction(tr("Manuals and other Documents"),this);
openDocumentURLAct->setStatusTip(tr("Open the OpenTX document page in a web browser"));
connect(openDocumentURLAct, SIGNAL(triggered()), this, SLOT(openDocumentURL()));
QActionGroup *langAlignGroup = new QActionGroup(this);
sysLangAct = addAct( langAlignGroup, tr("System language"), tr("Use system language in menus"), SLOT(setSysLanguage()));
czechLangAct = addAct( langAlignGroup, tr("Czech"), tr("Use Czech in menus"), SLOT(setCZLanguage()));
germanLangAct = addAct( langAlignGroup, tr("German"), tr("Use German in menus"), SLOT(setDELanguage()));
englishLangAct = addAct( langAlignGroup, tr("English"), tr("Use English in menus"), SLOT(setENLanguage()));
finnishLangAct = addAct( langAlignGroup, tr("Finnish"), tr("Use Finnish in menus"), SLOT(setFILanguage()));
frenchLangAct = addAct( langAlignGroup, tr("French"), tr("Use French in menus"), SLOT(setFRLanguage()));
italianLangAct = addAct( langAlignGroup, tr("Italian"), tr("Use Italian in menus"), SLOT(setITLanguage()));
hebrewLangAct = addAct( langAlignGroup, tr("Hebrew"), tr("Use Hebrew in menus"), SLOT(setHELanguage()));
polishLangAct = addAct( langAlignGroup, tr("Polish"), tr("Use Polish in menus"), SLOT(setPLLanguage()));
portugueseLangAct = addAct( langAlignGroup, tr("Portuguese"), tr("Use Portuguese in menus"), SLOT(setPTLanguage()));
swedishLangAct = addAct( langAlignGroup, tr("Swedish"), tr("Use Swedish in menus"), SLOT(setSELanguage()));
russianLangAct = addAct( langAlignGroup, tr("Russian"), tr("Use Russian in menus"), SLOT(setRULanguage()));
aboutAct = addAct("information.png", tr("About"), tr("Show the application's About box"), SLOT(about()));
printAct = addAct("print.png", tr("Print"), tr("Print current model"), SLOT(print()));
simulateAct = addAct("simulate.png", tr("Simulate"), tr("Simulate selected model"), SLOT(simulate()));
loadbackupAct = addAct("open.png", tr("loadBackup..."), tr("Load backup from file"), SLOT(loadBackup()));
logsAct = addAct("logs.png", tr("Logs"), tr("Open log file"), SLOT(logFile()));
appPrefsAct = addAct("apppreferences.png",tr("Setting..."), tr("Edit Settings"), SLOT(appPrefs()));
fwPrefsAct = addAct("fwpreferences.png", tr("Downloads..."), tr("Download firmware and voice files"), SLOT(fwPrefs()));
checkForUpdatesAct = addAct("update.png", tr("Check for updates..."), tr("Check OpenTX and Companion updates"), SLOT(doUpdates()));
changelogAct = addAct("changelog.png", tr("ChangeLog..."), tr("Show Companion changelog"), SLOT(changelog()));
fwchangelogAct = addAct("changelog.png", tr("Firmware ChangeLog..."), tr("Show firmware changelog"), SLOT(fwchangelog()));
compareAct = addAct("compare.png", tr("Compare..."), tr("Compare models"), SLOT(compare()));
editSplashAct = addAct("paintbrush.png", tr("Edit Tx Splash Image..."),tr("edit the splash screen of your TX"), SLOT(customizeSplash()));
burnListAct = addAct("list.png", tr("List programmers"), tr("List available programmers"), SLOT(burnList()));
burnFusesAct = addAct("fuses.png", tr("Fuses..."), tr("Show fuses dialog"), SLOT(burnFuses()));
readFlashAct = addAct("read_flash.png", tr("Read Firmware"), tr("Read firmware from transmitter"), SLOT(readFlash()));
writeFlashAct = addAct("write_flash.png", tr("Write Firmware"), tr("Write firmware to transmitter"), SLOT(writeFlash()));
createProfileAct = addAct("", tr("New Profile"), tr("Create a new Radio Setting Profile"), SLOT(createProfile()));
openDocURLAct = addAct("", tr("Manuals and other Documents"), tr("Open the OpenTX document page in a web browser"), SLOT(openDocURL()));
writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Tx"), tr("Write Models and Settings to transmitter"), SLOT(writeEeprom()));
readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Tx"), tr("Read Models and Settings from transmitter"), SLOT(readEeprom()));
burnConfigAct = addAct("configure.png", tr("Configure connection software..."), tr("Configure software for reading from and writing to the transmitter"), SLOT(burnConfig()));
writeFileToEepromAct = addAct("write_eeprom_file.png", tr("Write Models and Settings from file to Tx"), tr("Write Models and Settings from file to transmitter"), SLOT(writeFileToEeprom()));
readEepromToFileAct = addAct("read_eeprom_file.png", tr("Save Tx Models and Settings to file"), tr("Save the Models and Settings from the transmitter to a file"), SLOT(readEepromToFile()));
contributorsAct = addAct("contributors.png", tr("Contributors"), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
compareAct->setEnabled(false);
simulateAct->setEnabled(false);
printAct->setEnabled(false);
}
void MainWindow::createMenus()
@@ -1865,8 +1720,8 @@ void MainWindow::createMenus()
QMenu *languageMenu=new QMenu(tr("Set Menu Language"));
QMenu *themeMenu=new QMenu(tr("Set Icon Theme"));
QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size"));
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu = menuBar()->addMenu(tr("File"));
fileMenu->addAction(newAct);
fileMenu->addAction(openAct);
fileMenu->addAction(saveAct);
@@ -1882,53 +1737,55 @@ void MainWindow::createMenus()
fileMenu->addAction(printAct);
fileMenu->addAction(compareAct);
fileMenu->addSeparator();
fileMenu->addAction(fwPreferencesAct);
fileMenu->addAction(fwPrefsAct);
fileMenu->addMenu(createProfilesMenu());
fileMenu->addAction(exitAct);
editMenu = menuBar()->addMenu(tr("&Edit"));
editMenu = menuBar()->addMenu(tr("Edit"));
editMenu->addAction(cutAct);
editMenu->addAction(copyAct);
editMenu->addAction(pasteAct);
settingsMenu = menuBar()->addMenu(tr("&Settings"));
settingsMenu = menuBar()->addMenu(tr("Settings"));
settingsMenu->addMenu(languageMenu);
languageMenu->addAction(defaultLanguageAct);
languageMenu->addAction(englishLanguageAct);
languageMenu->addAction(czechLanguageAct);
languageMenu->addAction(germanLanguageAct);
languageMenu->addAction(frenchLanguageAct);
languageMenu->addAction(hebrewLanguageAct);
languageMenu->addAction(italianLanguageAct);
languageMenu->addAction(polishLanguageAct);
languageMenu->addAction(portugueseLanguageAct);
languageMenu->addAction(swedishLanguageAct);
languageMenu->addAction(russianLanguageAct);
languageMenu->addAction(sysLangAct);
languageMenu->addAction(englishLangAct);
languageMenu->addAction(czechLangAct);
languageMenu->addAction(germanLangAct);
languageMenu->addAction(finnishLangAct);
languageMenu->addAction(frenchLangAct);
languageMenu->addAction(hebrewLangAct);
languageMenu->addAction(italianLangAct);
languageMenu->addAction(polishLangAct);
languageMenu->addAction(portugueseLangAct);
languageMenu->addAction(swedishLangAct);
languageMenu->addAction(russianLangAct);
settingsMenu->addMenu(themeMenu);
themeMenu->addAction(classicThemeAct);
themeMenu->addAction(newThemeAct);
themeMenu->addAction(monoThemeAct);
themeMenu->addAction(monoBlueThemeAct);
themeMenu->addAction(monoWhiteThemeAct);
themeMenu->addAction(monoBlueAct);
themeMenu->addAction(monoWhiteAct);
settingsMenu->addMenu(iconThemeSizeMenu);
iconThemeSizeMenu->addAction(smallIconAct);
iconThemeSizeMenu->addAction(normalIconAct);
iconThemeSizeMenu->addAction(bigIconAct);
iconThemeSizeMenu->addAction(hugeIconAct);
settingsMenu->addSeparator();
settingsMenu->addAction(appPreferencesAct);
settingsMenu->addAction(customizeSplashAct);
settingsMenu->addAction(appPrefsAct);
settingsMenu->addAction(editSplashAct);
settingsMenu->addAction(burnConfigAct);
burnMenu = menuBar()->addMenu(tr("&Read/Write"));
burnMenu->addAction(burnToAct);
burnMenu->addAction(burnFromAct);
burnMenu = menuBar()->addMenu(tr("Read/Write"));
burnMenu->addAction(writeEepromAct);
burnMenu->addAction(readEepromAct);
burnMenu->addSeparator();
burnMenu->addAction(burnExtenalToEEPROMAct);
burnMenu->addAction(burnExtenalFromEEPROMAct);
burnMenu->addAction(writeFileToEepromAct);
burnMenu->addAction(readEepromToFileAct);
burnMenu->addSeparator();
burnMenu->addAction(burnToFlashAct);
burnMenu->addAction(burnFromFlashAct);
burnMenu->addAction(writeFlashAct);
burnMenu->addAction(readFlashAct);
burnMenu->addSeparator();
burnMenu->addSeparator();
EEPROMInterface *eepromInterface = GetEepromInterface();
@@ -1937,13 +1794,12 @@ void MainWindow::createMenus()
burnMenu->addAction(burnListAct);
}
menuBar()->addSeparator();
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu = menuBar()->addMenu(tr("Help"));
helpMenu->addSeparator();
helpMenu->addAction(checkForUpdatesAct);
helpMenu->addSeparator();
helpMenu->addAction(aboutAct);
helpMenu->addAction(openDocumentURLAct);
helpMenu->addAction(openDocURLAct);
helpMenu->addSeparator();
helpMenu->addAction(changelogAct);
helpMenu->addAction(fwchangelogAct);
@@ -2000,23 +1856,29 @@ void MainWindow::createToolBars()
fileToolBar->setObjectName("File");
fileToolBar->addAction(newAct);
fileToolBar->addAction(openAct);
QToolButton * recentToolButton = new QToolButton;
recentToolButton->setPopupMode(QToolButton::InstantPopup);
recentToolButton->setMenu(createRecentFileMenu());
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
recentToolButton->setToolTip(tr("Recent Files"));
QToolButton * recentToolButton = new QToolButton;
recentToolButton->setPopupMode(QToolButton::InstantPopup);
recentToolButton->setMenu(createRecentFileMenu());
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
recentToolButton->setToolTip(tr("Recent Files"));
recentToolButton->setStatusTip(tr("Show a selection list of recent documents"));
fileToolBar->addWidget(recentToolButton);
fileToolBar->addAction(saveAct);
fileToolBar->addAction(logsAct);
fileToolBar->addSeparator();
fileToolBar->addAction(appPreferencesAct);
fileToolBar->addAction(fwPreferencesAct);
fileToolBar->addAction(customizeSplashAct);
profileButton = new QToolButton;
profileButton->setPopupMode(QToolButton::InstantPopup);
profileButton->setMenu(createProfilesMenu());
profileButton->setIcon(CompanionIcon("profiles.png"));
profileButton->setToolTip(tr("Firmware Profiles"));
fileToolBar->addAction(appPrefsAct);
fileToolBar->addAction(fwPrefsAct);
fileToolBar->addAction(editSplashAct);
QToolButton * profileButton = new QToolButton;
profileButton->setPopupMode(QToolButton::InstantPopup);
profileButton->setMenu(createProfilesMenu());
profileButton->setIcon(CompanionIcon("profiles.png"));
profileButton->setToolTip(tr("Radio Profiles"));
profileButton->setStatusTip(tr("Show a selection list of radio settings profiles"));
fileToolBar->addWidget(profileButton);
fileToolBar->addSeparator();
fileToolBar->addAction(simulateAct);
@@ -2034,14 +1896,14 @@ void MainWindow::createToolBars()
addToolBar( Qt::LeftToolBarArea, burnToolBar );
burnToolBar->setIconSize(size);
burnToolBar->setObjectName("Write");
burnToolBar->addAction(burnToAct);
burnToolBar->addAction(burnFromAct);
burnToolBar->addAction(writeEepromAct);
burnToolBar->addAction(readEepromAct);
burnToolBar->addSeparator();
burnToolBar->addAction(burnExtenalToEEPROMAct);
burnToolBar->addAction(burnExtenalFromEEPROMAct);
burnToolBar->addAction(writeFileToEepromAct);
burnToolBar->addAction(readEepromToFileAct);
burnToolBar->addSeparator();
burnToolBar->addAction(burnToFlashAct);
burnToolBar->addAction(burnFromFlashAct);
burnToolBar->addAction(writeFlashAct);
burnToolBar->addAction(readFlashAct);
burnToolBar->addSeparator();
burnToolBar->addAction(burnConfigAct);
@@ -2061,7 +1923,7 @@ void MainWindow::readSettings()
{
QSettings settings;
restoreState(settings.value("mainWindowState").toByteArray());
checkCompanion9x = settings.value("startup_check_companion", true).toBool();
checkCompanion = settings.value("startup_check_companion", true).toBool();
checkFW = settings.value("startup_check_fw", true).toBool();
MaxRecentFiles =settings.value("history_size",10).toInt();
if (settings.value("profileId",0).toInt() == 0)
@@ -2113,36 +1975,88 @@ void MainWindow::updateRecentFileActions()
}
for ( j = numRecentFiles; j < MaxRecentFiles; ++j)
recentFileActs[j]->setVisible(false);
// separatorAct->setVisible(numRecentFiles > 0);
}
void MainWindow::updateIconSizeActions()
{
QSettings settings;
int size = settings.value("icon_size","0").toInt();
switch (size){
case 0: smallIconAct->setChecked(true); break;
case 1: normalIconAct->setChecked(true); break;
case 2: bigIconAct->setChecked(true); break;
case 3: hugeIconAct->setChecked(true); break;
}
}
void MainWindow::updateLanguageActions()
{
QSettings settings;
QString langId = settings.value("locale","").toString();
if (langId=="")
sysLangAct->setChecked(true);
else if (langId=="cs_CZ")
czechLangAct->setChecked(true);
else if (langId=="de_DE")
germanLangAct->setChecked(true);
else if (langId=="en")
englishLangAct->setChecked(true);
else if (langId=="fi_FI")
finnishLangAct->setChecked(true);
else if (langId=="fr_FR")
frenchLangAct->setChecked(true);
else if (langId=="it_IT")
italianLangAct->setChecked(true);
else if (langId=="he_IL")
hebrewLangAct->setChecked(true);
else if (langId=="pl_PL")
polishLangAct->setChecked(true);
else if (langId=="pt_PT")
portugueseLangAct->setChecked(true);
else if (langId=="ru_RU")
russianLangAct->setChecked(true);
else if (langId=="sv_SE")
swedishLangAct->setChecked(true);
}
void MainWindow::updateIconThemeActions()
{
QSettings settings;
int size = settings.value("theme","1").toInt();
switch (size){
case 0: classicThemeAct->setChecked(true); break;
case 1: newThemeAct->setChecked(true); break;
case 2: monoWhiteAct->setChecked(true); break;
case 3: monoThemeAct->setChecked(true); break;
case 4: monoBlueAct->setChecked(true); break;
}
}
void MainWindow::updateProfilesActions()
{
int i;
QSettings settings;
int activeProfile = settings.value("profileId").toInt();
{
int i;
QSettings settings;
int activeProfile = settings.value("profileId").toInt();
settings.beginGroup("Profiles");
for (i=0; i<MAX_PROFILES; i++) {
QString profile=QString("profile%1").arg(i+1);
settings.beginGroup(profile);
QString name=settings.value("Name","").toString();
if (!name.isEmpty()) {
QString text = tr("&%1 %2").arg(i + 1).arg(name);
profileActs[i]->setText(text);
profileActs[i]->setData(i+1);
profileActs[i]->setVisible(true);
if ((i+1) == activeProfile)
profileActs[i]->setIcon(CompanionIcon("arrow-right.png"));
else
profileActs[i]->setIcon(CompanionIcon(""));
} else {
profileActs[i]->setVisible(false);
}
settings.endGroup();
settings.beginGroup("Profiles");
for (i=0; i<MAX_PROFILES; i++) {
QString profile=QString("profile%1").arg(i+1);
settings.beginGroup(profile);
QString name=settings.value("Name","").toString();
if (!name.isEmpty()) {
QString text = tr("&%1 %2").arg(i + 1).arg(name);
profileActs[i]->setText(text);
profileActs[i]->setData(i+1);
profileActs[i]->setVisible(true);
if ((i+1) == activeProfile)
profileActs[i]->setChecked(true);
}
else {
profileActs[i]->setVisible(false);
}
settings.endGroup();
}
}
void MainWindow::createProfile()
+44 -36
View File
@@ -81,13 +81,14 @@ public slots:
void downloadLatestFW(FirmwareInfo *firmware, const QString & firmwareId);
private slots:
void openDocumentURL();
void openDocURL();
void setLanguage(QString langString);
void setDefaultLanguage() {setLanguage("");};
void setSysLanguage() {setLanguage("");};
void setCZLanguage() {setLanguage("cs_CZ");};
void setDELanguage() {setLanguage("de_DE");};
void setENLanguage() {setLanguage("en");};
void setFILanguage() {setLanguage("fi_FI");};
void setFRLanguage() {setLanguage("fr_FR");};
void setITLanguage() {setLanguage("it_IT");};
void setHELanguage() {setLanguage("he_IL");};
@@ -127,12 +128,12 @@ private slots:
void logFile();
void copy();
void paste();
void burnTo();
void burnFrom();
void burnToFlash(QString fileToFlash="");
void burnFromFlash();
void burnExtenalToEEPROM();
void burnExtenalFromEEPROM();
void writeEeprom();
void readEeprom();
void writeFlash(QString fileToFlash="");
void readFlash();
void writeFileToEeprom();
void readEepromToFile();
void burnConfig();
void burnList();
void burnFuses();
@@ -145,8 +146,8 @@ private slots:
void compare();
void print();
void loadBackup();
void appPreferences();
void fwPreferences();
void appPrefs();
void fwPrefs();
void updateMenus();
void createProfile();
MdiChild *createMdiChild();
@@ -157,12 +158,20 @@ private slots:
private:
void createActions();
QAction * addAct(QString, QString, QString, QKeySequence::StandardKey, const char *);
QAction * addAct(QActionGroup *, QString, QString, const char *);
QAction * addAct(QString, QString, QString, const char *);
void createMenus();
void createToolBars();
void createStatusBar();
void readSettings();
void updateRecentFileActions();
void updateProfilesActions();
void updateIconSizeActions();
void updateLanguageActions();
void updateIconThemeActions();
int getFileType(const QString &fullFileName);
QString FindTaranisPath();
QString Theme;
@@ -192,12 +201,11 @@ private:
QString downloadedFWFilename;
downloadDialog * downloadDialog_forWait;
bool checkCompanion9x;
bool checkCompanion;
bool checkFW;
bool needRename;
bool showcheckForUpdatesResult;
int MaxRecentFiles;
// int ActiveProfile;
int currentFWrev;
int currentFWrev_temp;
int NewFwRev;
@@ -222,26 +230,26 @@ private:
QAction *saveAct;
QAction *saveAsAct;
QAction *exitAct;
QAction *appPreferencesAct;
QAction *fwPreferencesAct;
QAction *appPrefsAct;
QAction *fwPrefsAct;
QAction *checkForUpdatesAct;
QAction *contributorsAct;
QAction *changelogAct;
QAction *fwchangelogAct;
QAction *compareAct;
QAction *customizeSplashAct;
QAction *editSplashAct;
QAction *cutAct;
QAction *copyAct;
QAction *pasteAct;
QAction *burnToAct;
QAction *burnFromAct;
QAction *writeEepromAct;
QAction *readEepromAct;
QAction *burnConfigAct;
QAction *burnListAct;
QAction *burnFusesAct;
QAction *burnToFlashAct;
QAction *burnFromFlashAct;
QAction *burnExtenalToEEPROMAct;
QAction *burnExtenalFromEEPROMAct;
QAction *writeFlashAct;
QAction *readFlashAct;
QAction *writeFileToEepromAct;
QAction *readEepromToFileAct;
QAction *simulateAct;
QAction *separatorAct;
QAction *aboutAct;
@@ -254,26 +262,26 @@ private:
QAction *classicThemeAct;
QAction *newThemeAct;
QAction *monoThemeAct;
QAction *monoBlueThemeAct;
QAction *monoWhiteThemeAct;
QAction *monoBlueAct;
QAction *monoWhiteAct;
QAction *smallIconAct;
QAction *normalIconAct;
QAction *bigIconAct;
QAction *hugeIconAct;
QAction *defaultLanguageAct;
QAction *englishLanguageAct;
QAction *czechLanguageAct;
QAction *germanLanguageAct;
QAction *frenchLanguageAct;
QAction *italianLanguageAct;
QAction *hebrewLanguageAct;
QAction *polishLanguageAct;
QAction *portugueseLanguageAct;
QAction *swedishLanguageAct;
QAction *russianLanguageAct;
QAction *openDocumentURLAct;
QAction *sysLangAct;
QAction *englishLangAct;
QAction *czechLangAct;
QAction *germanLangAct;
QAction *frenchLangAct;
QAction *finnishLangAct;
QAction *italianLangAct;
QAction *hebrewLangAct;
QAction *polishLangAct;
QAction *portugueseLangAct;
QAction *swedishLangAct;
QAction *russianLangAct;
QAction *openDocURLAct;
QString fwToUpdate;
QToolButton * profileButton;
};
#endif
+1 -1
View File
@@ -506,7 +506,7 @@ QString MdiChild::strippedName(const QString &fullFileName)
return QFileInfo(fullFileName).fileName();
}
void MdiChild::burnTo() // write to Tx
void MdiChild::writeEeprom() // write to Tx
{
QSettings settings;
bool backupEnable=settings.value("backupEnable", true).toBool();
+1 -1
View File
@@ -94,7 +94,7 @@ public slots:
void cut();
void copy();
void paste();
void burnTo();
void writeEeprom();
void simulate();
void print(int model=-1, QString filename="");
void setModified();
+4 -3
View File
@@ -1,13 +1,14 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>companion_fr.qm</file>
<file>companion_cs.qm</file>
<file>companion_de.qm</file>
<file>companion_fi.qm</file>
<file>companion_fr.qm</file>
<file>companion_he.qm</file>
<file>companion_it.qm</file>
<file>companion_pl.qm</file>
<file>companion_pt.qm</file>
<file>companion_ru.qm</file>
<file>companion_sv.qm</file>
<file>companion_cs.qm</file>
<file>companion_ru.qm</file>
</qresource>
</RCC>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff