Corrected a number of smaller issuses in the GUI.
A new profile now keeps the values from the current profile. Removed the special handling of the Name field in profiles.
This commit is contained in:
+51
-27
@@ -280,35 +280,31 @@ void JStickData::flush()
|
|||||||
|
|
||||||
// ** Profile class********************
|
// ** Profile class********************
|
||||||
// Get declarations
|
// Get declarations
|
||||||
QString Profile::firmware() { return _firmware; }
|
QString Profile::firmware() const { return _firmware; }
|
||||||
QString Profile::name() { return _name; }
|
QString Profile::name() const { return _name; }
|
||||||
QString Profile::sdPath() { return _sdPath; }
|
QString Profile::sdPath() const { return _sdPath; }
|
||||||
QString Profile::splashFile() { return _splashFile; }
|
QString Profile::splashFile() const { return _splashFile; }
|
||||||
bool Profile::burnFirmware() { return _burnFirmware; }
|
bool Profile::burnFirmware() const { return _burnFirmware; }
|
||||||
bool Profile::renameFwFiles() { return _renameFwFiles; }
|
bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||||
bool Profile::patchImage() { return _patchImage; }
|
bool Profile::patchImage() const { return _patchImage; }
|
||||||
int Profile::channelOrder() { return _channelOrder; }
|
int Profile::channelOrder() const { return _channelOrder; }
|
||||||
int Profile::defaultMode() { return _defaultMode; }
|
int Profile::defaultMode() const { return _defaultMode; }
|
||||||
|
|
||||||
QString Profile::beeper() { return _beeper; }
|
QString Profile::beeper() const { return _beeper; }
|
||||||
QString Profile::countryCode() { return _countryCode; }
|
QString Profile::countryCode() const { return _countryCode; }
|
||||||
QString Profile::display() { return _display; }
|
QString Profile::display() const { return _display; }
|
||||||
QString Profile::haptic() { return _haptic; }
|
QString Profile::haptic() const { return _haptic; }
|
||||||
QString Profile::speaker() { return _speaker; }
|
QString Profile::speaker() const { return _speaker; }
|
||||||
QString Profile::stickPotCalib() { return _stickPotCalib; }
|
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||||
QString Profile::trainerCalib() { return _trainerCalib; }
|
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||||
int Profile::currentCalib() { return _currentCalib; }
|
int Profile::currentCalib() const { return _currentCalib; }
|
||||||
int Profile::gsStickMode() { return _gsStickMode; }
|
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||||
int Profile::ppmMultiplier() { return _ppmMultiplier; }
|
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||||
int Profile::vBatCalib() { return _vBatCalib; }
|
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||||
int Profile::vBatWarn() { return _vBatWarn; }
|
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||||
|
|
||||||
// Set declarations
|
// Set declarations
|
||||||
void Profile::name (const QString x) { if (x.isEmpty()) // Name may never be empty!
|
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
store("----", _name, "Name", "Profiles", QString("profile%1").arg(index));
|
|
||||||
else
|
|
||||||
store(x, _name, "Name", "Profiles", QString("profile%1").arg(index));}
|
|
||||||
|
|
||||||
void Profile::firmware (const QString x) { store(x, _firmware, "firmware" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::firmware (const QString x) { store(x, _firmware, "firmware" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
@@ -337,6 +333,34 @@ Profile::Profile()
|
|||||||
index = -1;
|
index = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The default copy operator can not be used since the index variable would be destroyed
|
||||||
|
Profile& Profile::operator=(const Profile& rhs)
|
||||||
|
{
|
||||||
|
_name = rhs.name();
|
||||||
|
_firmware = rhs.firmware();
|
||||||
|
_sdPath = rhs.sdPath();
|
||||||
|
_splashFile = rhs.splashFile();
|
||||||
|
_burnFirmware = rhs.burnFirmware();
|
||||||
|
_renameFwFiles = rhs.renameFwFiles();
|
||||||
|
_patchImage = rhs.patchImage();
|
||||||
|
_channelOrder = rhs.channelOrder();
|
||||||
|
_defaultMode = rhs.defaultMode();
|
||||||
|
_beeper = rhs.beeper();
|
||||||
|
_countryCode = rhs.countryCode();
|
||||||
|
_display = rhs.display();
|
||||||
|
_haptic = rhs.haptic();
|
||||||
|
_speaker = rhs.speaker();
|
||||||
|
_stickPotCalib = rhs.stickPotCalib();
|
||||||
|
_trainerCalib = rhs.trainerCalib();
|
||||||
|
_currentCalib = rhs.currentCalib();
|
||||||
|
_gsStickMode = rhs.gsStickMode();
|
||||||
|
_ppmMultiplier = rhs.ppmMultiplier();
|
||||||
|
_vBatCalib = rhs.vBatCalib();
|
||||||
|
_vBatWarn = rhs.vBatWarn();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void Profile::remove()
|
void Profile::remove()
|
||||||
{
|
{
|
||||||
// Remove all profile values from settings file
|
// Remove all profile values from settings file
|
||||||
@@ -400,7 +424,7 @@ void Profile::flush()
|
|||||||
{
|
{
|
||||||
// Load and store all variables. Use default values if setting values are missing
|
// Load and store all variables. Use default values if setting values are missing
|
||||||
getset( _firmware, "firmware" ,"" ,"Profiles", QString("profile%1").arg(index));
|
getset( _firmware, "firmware" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _name, "Name" ,"----" ,"Profiles", QString("profile%1").arg(index));
|
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||||
|
|||||||
+23
-22
@@ -1,4 +1,4 @@
|
|||||||
// Companion Application Data Class Definition.
|
// Companion Application Data Class Declaration.
|
||||||
// Author Kjell Kernen
|
// Author Kjell Kernen
|
||||||
|
|
||||||
// All temporary and permanent global variables are defined here to make
|
// All temporary and permanent global variables are defined here to make
|
||||||
@@ -118,28 +118,28 @@ class Profile: protected CompStoreObj
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// All the get definitions
|
// All the get definitions
|
||||||
QString firmware();
|
QString firmware() const;
|
||||||
QString name();
|
QString name() const;
|
||||||
QString sdPath();
|
QString sdPath() const;
|
||||||
QString splashFile();
|
QString splashFile() const;
|
||||||
bool burnFirmware();
|
bool burnFirmware() const;
|
||||||
bool renameFwFiles();
|
bool renameFwFiles() const;
|
||||||
bool patchImage();
|
bool patchImage() const;
|
||||||
int channelOrder();
|
int channelOrder() const;
|
||||||
int defaultMode();
|
int defaultMode() const;
|
||||||
|
|
||||||
QString beeper();
|
QString beeper() const;
|
||||||
QString countryCode();
|
QString countryCode() const;
|
||||||
QString display();
|
QString display() const;
|
||||||
QString haptic();
|
QString haptic() const;
|
||||||
QString speaker();
|
QString speaker() const;
|
||||||
QString stickPotCalib();
|
QString stickPotCalib() const;
|
||||||
QString trainerCalib();
|
QString trainerCalib() const;
|
||||||
int currentCalib();
|
int currentCalib() const;
|
||||||
int gsStickMode();
|
int gsStickMode() const;
|
||||||
int ppmMultiplier();
|
int ppmMultiplier() const;
|
||||||
int vBatCalib();
|
int vBatCalib() const;
|
||||||
int vBatWarn();
|
int vBatWarn() const;
|
||||||
|
|
||||||
// All the set definitions
|
// All the set definitions
|
||||||
void name (const QString);
|
void name (const QString);
|
||||||
@@ -166,6 +166,7 @@ class Profile: protected CompStoreObj
|
|||||||
void vBatWarn (const int);
|
void vBatWarn (const int);
|
||||||
|
|
||||||
Profile();
|
Profile();
|
||||||
|
Profile& operator=(const Profile&);
|
||||||
void remove();
|
void remove();
|
||||||
bool existsOnDisk();
|
bool existsOnDisk();
|
||||||
void init(int newIndex);
|
void init(int newIndex);
|
||||||
|
|||||||
@@ -26,12 +26,21 @@
|
|||||||
<string>Edit Settings</string>
|
<string>Edit Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -490,7 +499,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="profileTab">
|
<widget class="QWidget" name="profileTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Radio Settings</string>
|
<string>Radio Settings Profile</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="10" column="1" colspan="4">
|
<item row="10" column="1" colspan="4">
|
||||||
@@ -720,7 +729,7 @@ This is used by the templated to determine which channel goes to what number out
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Settings Profile</string>
|
<string>Profile Name</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ void burnDialog::on_FlashLoadButton_clicked()
|
|||||||
ui->EEbackupCB->hide();
|
ui->EEbackupCB->hide();
|
||||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||||
if (hexType==2) {
|
if (hexType==2) {
|
||||||
fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.flashDir(), FLASH_FILES_FILTER);
|
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||||
checkFw(fileName);
|
checkFw(fileName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
|
|||||||
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
|
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
|
||||||
void customizeSplashDialog::loadFirmware(Side side)
|
void customizeSplashDialog::loadFirmware(Side side)
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.flashDir(), FLASH_FILES_FILTER);
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
if (!side.displayImage( fileName, FW ))
|
if (!side.displayImage( fileName, FW ))
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load embedded FW image from %1.").arg(fileName));
|
QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName));
|
||||||
else
|
else
|
||||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ void MainWindow::openDocURL()
|
|||||||
|
|
||||||
void MainWindow::openFile()
|
void MainWindow::openFile()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.eepromDir(), tr(EEPROM_FILES_FILTER));
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), g.eepromDir(), tr(EEPROM_FILES_FILTER));
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
g.eepromDir(QFileInfo(fileName).dir().absolutePath());
|
g.eepromDir(QFileInfo(fileName).dir().absolutePath());
|
||||||
|
|
||||||
@@ -1586,17 +1586,17 @@ void MainWindow::createActions()
|
|||||||
}
|
}
|
||||||
updateProfilesActions();
|
updateProfilesActions();
|
||||||
|
|
||||||
newAct = addAct("new.png", tr("New"), tr("Create a new file"), QKeySequence::New, SLOT(newFile()));
|
newAct = addAct("new.png", tr("New Models+Settings"), tr("Create a new Models and Settings file"), QKeySequence::New, SLOT(newFile()));
|
||||||
openAct = addAct("open.png", tr("Open..."), tr("Open an existing file"), QKeySequence::Open, SLOT(openFile()));
|
openAct = addAct("open.png", tr("Open Models+Settings..."), tr("Open Models and Settings file"), QKeySequence::Open, SLOT(openFile()));
|
||||||
saveAct = addAct("save.png", tr("Save..."), tr("Save the document to disk"), QKeySequence::Save, SLOT(save()));
|
saveAct = addAct("save.png", tr("Save Models+Settings..."), tr("Save Models and Settings file"), QKeySequence::Save, SLOT(save()));
|
||||||
saveAsAct = addAct("saveas.png", tr("Save As..."), tr("Save the document to disk"), QKeySequence::SaveAs, SLOT(saveAs()));
|
saveAsAct = addAct("saveas.png", tr("Save Models+Settings as..."), tr("Save Models and Settings file"), QKeySequence::SaveAs, SLOT(saveAs()));
|
||||||
exitAct = addAct("exit.png", tr("Exit"), tr("Exit the application"), QKeySequence::Quit, SLOT(newFile()));
|
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()));
|
cutAct = addAct("cut.png", tr("Cut Model"), tr("Cut current model to the clipboard"), QKeySequence::Cut, SLOT(cut()));
|
||||||
copyAct = addAct("copy.png", tr("Copy..."), tr("Copy current selection to the clipboard"), QKeySequence::Copy, SLOT(copy()));
|
copyAct = addAct("copy.png", tr("Copy Model..."), tr("Copy current model to the clipboard"), QKeySequence::Copy, SLOT(copy()));
|
||||||
pasteAct = addAct("paste.png", tr("Paste..."), tr("Paste clipboard into current selection"), QKeySequence::Paste, SLOT(paste()));
|
pasteAct = addAct("paste.png", tr("Paste Model..."), tr("Paste model from clipboard"), QKeySequence::Paste, SLOT(paste()));
|
||||||
|
|
||||||
QActionGroup *themeAlignGroup = new QActionGroup(this);
|
QActionGroup *themeAlignGroup = new QActionGroup(this);
|
||||||
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classical Companion icon theme"), SLOT(setClassicTheme()));
|
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classic companion9x icon theme"), SLOT(setClassicTheme()));
|
||||||
yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme()));
|
yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme()));
|
||||||
monoThemeAct = addAct( themeAlignGroup, tr("Monochrome"), tr("A monochrome black icon theme"), SLOT(setMonochromeTheme()));
|
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()));
|
monoWhiteAct = addAct( themeAlignGroup, tr("MonoWhite"), tr("A monochrome white icon theme"), SLOT(setMonoWhiteTheme()));
|
||||||
@@ -1622,30 +1622,30 @@ void MainWindow::createActions()
|
|||||||
swedishLangAct = addAct( langAlignGroup, tr("Swedish"), tr("Use Swedish in menus"), SLOT(setSELanguage()));
|
swedishLangAct = addAct( langAlignGroup, tr("Swedish"), tr("Use Swedish in menus"), SLOT(setSELanguage()));
|
||||||
russianLangAct = addAct( langAlignGroup, tr("Russian"), tr("Use Russian in menus"), SLOT(setRULanguage()));
|
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()));
|
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()));
|
printAct = addAct("print.png", tr("Print..."), tr("Print current model"), SLOT(print()));
|
||||||
simulateAct = addAct("simulate.png", tr("Simulate"), tr("Simulate selected model"), SLOT(simulate()));
|
simulateAct = addAct("simulate.png", tr("Simulate..."), tr("Simulate current model"), SLOT(simulate()));
|
||||||
loadbackupAct = addAct("open.png", tr("loadBackup..."), tr("Load backup from file"), SLOT(loadBackup()));
|
loadbackupAct = addAct("open.png", tr("Load Backup..."), tr("Load backup from file"), SLOT(loadBackup()));
|
||||||
logsAct = addAct("logs.png", tr("Logs"), tr("Open log file"), SLOT(logFile()));
|
logsAct = addAct("logs.png", tr("View Log File..."), tr("Open and view log file"), SLOT(logFile()));
|
||||||
appPrefsAct = addAct("apppreferences.png",tr("Setting..."), tr("Edit Settings"), SLOT(appPrefs()));
|
appPrefsAct = addAct("apppreferences.png",tr("Settings..."), tr("Edit Settings"), SLOT(appPrefs()));
|
||||||
fwPrefsAct = addAct("fwpreferences.png", tr("Downloads..."), tr("Download firmware and voice files"), SLOT(fwPrefs()));
|
fwPrefsAct = addAct("fwpreferences.png", tr("Download..."), tr("Download firmware and voice files"), SLOT(fwPrefs()));
|
||||||
checkForUpdatesAct = addAct("update.png", tr("Check for updates..."), tr("Check OpenTX and Companion updates"), SLOT(doUpdates()));
|
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()));
|
changelogAct = addAct("changelog.png", tr("Companion Changes..."), tr("Show Companion change log"), SLOT(changelog()));
|
||||||
fwchangelogAct = addAct("changelog.png", tr("Firmware ChangeLog..."), tr("Show firmware changelog"), SLOT(fwchangelog()));
|
fwchangelogAct = addAct("changelog.png", tr("Firmware Changes..."), tr("Show firmware change log"), SLOT(fwchangelog()));
|
||||||
compareAct = addAct("compare.png", tr("Compare..."), tr("Compare models"), SLOT(compare()));
|
compareAct = addAct("compare.png", tr("Compare Models..."), tr("Compare models"), SLOT(compare()));
|
||||||
editSplashAct = addAct("paintbrush.png", tr("Edit Tx Splash Image..."),tr("edit the splash screen of your TX"), SLOT(customizeSplash()));
|
editSplashAct = addAct("paintbrush.png", tr("Edit Tx Splash Image..."), tr("Edit the splash image of your TX"), SLOT(customizeSplash()));
|
||||||
burnListAct = addAct("list.png", tr("List programmers"), tr("List available programmers"), SLOT(burnList()));
|
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()));
|
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()));
|
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()));
|
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()));
|
createProfileAct = addAct("", tr("Add Radio 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()));
|
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()));
|
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()));
|
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()));
|
burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with 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()));
|
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()));
|
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()));
|
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
|
||||||
|
|
||||||
compareAct->setEnabled(false);
|
compareAct->setEnabled(false);
|
||||||
simulateAct->setEnabled(false);
|
simulateAct->setEnabled(false);
|
||||||
@@ -1655,7 +1655,7 @@ void MainWindow::createActions()
|
|||||||
void MainWindow::createMenus()
|
void MainWindow::createMenus()
|
||||||
|
|
||||||
{
|
{
|
||||||
QMenu *recentFileMenu=new QMenu(tr("Recent Files"));
|
QMenu *recentFileMenu=new QMenu(tr("Recent Models+Settings"));
|
||||||
QMenu *languageMenu=new QMenu(tr("Set Menu Language"));
|
QMenu *languageMenu=new QMenu(tr("Set Menu Language"));
|
||||||
QMenu *themeMenu=new QMenu(tr("Set Icon Theme"));
|
QMenu *themeMenu=new QMenu(tr("Set Icon Theme"));
|
||||||
QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size"));
|
QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size"));
|
||||||
@@ -1671,13 +1671,12 @@ void MainWindow::createMenus()
|
|||||||
recentFileMenu->addAction(recentFileActs[i]);
|
recentFileMenu->addAction(recentFileActs[i]);
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(logsAct);
|
fileMenu->addAction(logsAct);
|
||||||
|
fileMenu->addAction(fwPrefsAct);
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(simulateAct);
|
fileMenu->addAction(simulateAct);
|
||||||
fileMenu->addAction(printAct);
|
fileMenu->addAction(printAct);
|
||||||
fileMenu->addAction(compareAct);
|
fileMenu->addAction(compareAct);
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(fwPrefsAct);
|
|
||||||
fileMenu->addMenu(createProfilesMenu());
|
|
||||||
fileMenu->addAction(exitAct);
|
fileMenu->addAction(exitAct);
|
||||||
|
|
||||||
editMenu = menuBar()->addMenu(tr("Edit"));
|
editMenu = menuBar()->addMenu(tr("Edit"));
|
||||||
@@ -1713,6 +1712,7 @@ void MainWindow::createMenus()
|
|||||||
iconThemeSizeMenu->addAction(hugeIconAct);
|
iconThemeSizeMenu->addAction(hugeIconAct);
|
||||||
settingsMenu->addSeparator();
|
settingsMenu->addSeparator();
|
||||||
settingsMenu->addAction(appPrefsAct);
|
settingsMenu->addAction(appPrefsAct);
|
||||||
|
settingsMenu->addMenu(createProfilesMenu());
|
||||||
settingsMenu->addAction(editSplashAct);
|
settingsMenu->addAction(editSplashAct);
|
||||||
settingsMenu->addAction(burnConfigAct);
|
settingsMenu->addAction(burnConfigAct);
|
||||||
|
|
||||||
@@ -1756,7 +1756,7 @@ QMenu *MainWindow::createRecentFileMenu()
|
|||||||
|
|
||||||
QMenu *MainWindow::createProfilesMenu()
|
QMenu *MainWindow::createProfilesMenu()
|
||||||
{
|
{
|
||||||
QMenu *profilesMenu=new QMenu(tr("Radio Settings Profiles"));
|
QMenu *profilesMenu=new QMenu(tr("Radio Settings Profile"));
|
||||||
int i;
|
int i;
|
||||||
for ( i = 0; i < MAX_PROFILES; ++i) {
|
for ( i = 0; i < MAX_PROFILES; ++i) {
|
||||||
profilesMenu->addAction(profileActs[i]);
|
profilesMenu->addAction(profileActs[i]);
|
||||||
@@ -1798,25 +1798,26 @@ void MainWindow::createToolBars()
|
|||||||
recentToolButton->setPopupMode(QToolButton::InstantPopup);
|
recentToolButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
recentToolButton->setMenu(createRecentFileMenu());
|
recentToolButton->setMenu(createRecentFileMenu());
|
||||||
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
|
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
|
||||||
recentToolButton->setToolTip(tr("Recent Files"));
|
recentToolButton->setToolTip(tr("Recent Models+Settings"));
|
||||||
recentToolButton->setStatusTip(tr("Show a selection list of recent documents"));
|
recentToolButton->setStatusTip(tr("Show recent Models+Settings documents"));
|
||||||
|
|
||||||
fileToolBar->addWidget(recentToolButton);
|
fileToolBar->addWidget(recentToolButton);
|
||||||
fileToolBar->addAction(saveAct);
|
fileToolBar->addAction(saveAct);
|
||||||
|
fileToolBar->addSeparator();
|
||||||
fileToolBar->addAction(logsAct);
|
fileToolBar->addAction(logsAct);
|
||||||
|
fileToolBar->addAction(fwPrefsAct);
|
||||||
fileToolBar->addSeparator();
|
fileToolBar->addSeparator();
|
||||||
fileToolBar->addAction(appPrefsAct);
|
fileToolBar->addAction(appPrefsAct);
|
||||||
fileToolBar->addAction(fwPrefsAct);
|
|
||||||
fileToolBar->addAction(editSplashAct);
|
|
||||||
|
|
||||||
QToolButton * profileButton = new QToolButton;
|
QToolButton * profileButton = new QToolButton;
|
||||||
profileButton->setPopupMode(QToolButton::InstantPopup);
|
profileButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
profileButton->setMenu(createProfilesMenu());
|
profileButton->setMenu(createProfilesMenu());
|
||||||
profileButton->setIcon(CompanionIcon("profiles.png"));
|
profileButton->setIcon(CompanionIcon("profiles.png"));
|
||||||
profileButton->setToolTip(tr("Radio Profiles"));
|
profileButton->setToolTip(tr("Radio Settings Profile"));
|
||||||
profileButton->setStatusTip(tr("Show a selection list of radio settings profiles"));
|
profileButton->setStatusTip(tr("Show a selection list of radio settings profiles"));
|
||||||
|
|
||||||
fileToolBar->addWidget(profileButton);
|
fileToolBar->addWidget(profileButton);
|
||||||
|
fileToolBar->addAction(editSplashAct);
|
||||||
fileToolBar->addSeparator();
|
fileToolBar->addSeparator();
|
||||||
fileToolBar->addAction(simulateAct);
|
fileToolBar->addAction(simulateAct);
|
||||||
fileToolBar->addAction(printAct);
|
fileToolBar->addAction(printAct);
|
||||||
@@ -1962,9 +1963,9 @@ void MainWindow::updateProfilesActions()
|
|||||||
{
|
{
|
||||||
for (int i=0; i<MAX_PROFILES; i++)
|
for (int i=0; i<MAX_PROFILES; i++)
|
||||||
{
|
{
|
||||||
if (!g.profile[i].name().isEmpty())
|
if (g.profile[i].existsOnDisk())
|
||||||
{
|
{
|
||||||
QString text = tr("&%1: %2").arg(i).arg(g.profile[i].name());
|
QString text = tr("%2").arg(g.profile[i].name());
|
||||||
profileActs[i]->setText(text);
|
profileActs[i]->setText(text);
|
||||||
profileActs[i]->setData(i);
|
profileActs[i]->setData(i);
|
||||||
profileActs[i]->setVisible(true);
|
profileActs[i]->setVisible(true);
|
||||||
@@ -1985,10 +1986,14 @@ void MainWindow::createProfile()
|
|||||||
if (i==MAX_PROFILES) //Failed to find free slot
|
if (i==MAX_PROFILES) //Failed to find free slot
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Create profile name and force a flush to file
|
// Create profile by forcing it to write to disk
|
||||||
g.profile[i].name( QString("profile%1").arg(i));
|
|
||||||
g.profile[i].flush();
|
g.profile[i].flush();
|
||||||
|
|
||||||
|
// Copy current profile to new and give it a new name
|
||||||
|
g.profile[i] = g.profile[g.id()];
|
||||||
|
g.profile[i].name( QString("New Radio"));
|
||||||
|
|
||||||
|
g.id(i);
|
||||||
updateMenus();
|
updateMenus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -649,7 +649,7 @@ void MdiChild::setEEpromAvail(int eavail)
|
|||||||
|
|
||||||
bool MdiChild::loadBackup()
|
bool MdiChild::loadBackup()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.eepromDir(),tr(EEPROM_FILES_FILTER));
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open backup Models and Settings file"), g.eepromDir(),tr(EEPROM_FILES_FILTER));
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 286 B |
Binary file not shown.
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 341 B |
Binary file not shown.
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 460 B |
Reference in New Issue
Block a user