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

All function names changed to a consistent standard.

Cleaned up indentation of appdata.h
This commit is contained in:
Kjell Kernen 2014-02-19 14:01:34 +01:00
parent 82910acffe
commit 80ef2b8d38
18 changed files with 521 additions and 523 deletions

View file

@ -1,4 +1,6 @@
// Companion Application Data Class.
// Author Kjell Kernen
// All temporary and permanent global variables are defined here to make
// initialization and storage safe and visible.
// Do not access variables in QSettings directly, it is not type safe!
@ -224,27 +226,27 @@ class JStickData:DataObj
private:
int index;
int _stick_axe;
int _stick_min;
int _stick_med;
int _stick_max;
int _stick_inv;
int _stickAxe;
int _stickMin;
int _stickMed;
int _stickMax;
int _stickInv;
public:
public:
// All the get declarations
int stick_axe() { return _stick_axe; }
int stick_min() { return _stick_min; }
int stick_med() { return _stick_med; }
int stick_max() { return _stick_max; }
int stick_inv() { return _stick_inv; }
int stick_axe() { return _stickAxe; }
int stick_min() { return _stickMin; }
int stick_med() { return _stickMed; }
int stick_max() { return _stickMax; }
int stick_inv() { return _stickInv; }
// All the set declarations
void stick_axe(const int it) { store( it, _stick_axe, QString("stick%1_axe").arg(index), "JsCalibration" );}
void stick_min(const int it) { store( it, _stick_min, QString("stick%1_min").arg(index), "JsCalibration" );}
void stick_med(const int it) { store( it, _stick_med, QString("stick%1_med").arg(index), "JsCalibration" );}
void stick_max(const int it) { store( it, _stick_max, QString("stick%1_max").arg(index), "JsCalibration" );}
void stick_inv(const int it) { store( it, _stick_inv, QString("stick%1_inv").arg(index), "JsCalibration" );}
void stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );}
void stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );}
void stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );}
void stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );}
void stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );}
// Constructor
JStickData()
@ -281,11 +283,11 @@ public:
void init(int newIndex)
{
index = newIndex;
_stick_axe = -1;
_stick_min = -32767;
_stick_med = 0;
_stick_max = 0;
_stick_inv = 0;
_stickAxe = -1;
_stickMin = -32767;
_stickMed = 0;
_stickMax = 0;
_stickInv = 0;
// Do not write empty joystick calibrations to disk.
if ( !existsOnDisk() )
@ -296,11 +298,11 @@ public:
void flush()
{
getset( _stick_axe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
getset( _stick_min, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
getset( _stick_med, QString("stick%1_med").arg(index), 0, "JsCalibration" );
getset( _stick_max, QString("stick%1_max").arg(index), 0, "JsCalibration" );
getset( _stick_inv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" );
getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" );
getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
}
};
@ -312,81 +314,81 @@ private:
// Application Variables
QString _firmware;
QString _Name;
QString _name;
QString _sdPath;
QString _SplashFileName;
QString _splashFile;
bool _burnFirmware;
bool _rename_firmware_files;
bool _renameFwFiles;
bool _patchImage;
int _default_channel_order;
int _default_mode;
int _channelOrder;
int _defaultMode;
// Firmware Variables
QString _Beeper;
QString _beeper;
QString _countryCode;
QString _Display;
QString _Haptic;
QString _Speaker;
QString _StickPotCalib;
QString _TrainerCalib;
QString _display;
QString _haptic;
QString _speaker;
QString _stickPotCalib;
QString _trainerCalib;
int _currentCalib;
int _GSStickMode;
int _PPM_Multiplier;
int _VbatCalib;
int _gsStickMode;
int _ppmMultiplier;
int _vBatCalib;
int _vBatWarn;
public:
// All the get declarations
QString firmware() { return _firmware; }
QString Name() { return _Name; }
QString name() { return _name; }
QString sdPath() { return _sdPath; }
QString SplashFileName() { return _SplashFileName; }
QString splashFile() { return _splashFile; }
bool burnFirmware() { return _burnFirmware; }
bool rename_firmware_files() { return _rename_firmware_files; }
bool renameFwFiles() { return _renameFwFiles; }
bool patchImage() { return _patchImage; }
int default_channel_order() { return _default_channel_order; }
int default_mode() { return _default_mode; }
int channelOrder() { return _channelOrder; }
int defaultMode() { return _defaultMode; }
QString Beeper() { return _Beeper; }
QString beeper() { return _beeper; }
QString countryCode() { return _countryCode; }
QString Display() { return _Display; }
QString Haptic() { return _Haptic; }
QString Speaker() { return _Speaker; }
QString StickPotCalib() { return _StickPotCalib; }
QString TrainerCalib() { return _TrainerCalib; }
QString display() { return _display; }
QString haptic() { return _haptic; }
QString speaker() { return _speaker; }
QString stickPotCalib() { return _stickPotCalib; }
QString trainerCalib() { return _trainerCalib; }
int currentCalib() { return _currentCalib; }
int GSStickMode() { return _GSStickMode; }
int PPM_Multiplier() { return _PPM_Multiplier; }
int VbatCalib() { return _VbatCalib; }
int gsStickMode() { return _gsStickMode; }
int ppmMultiplier() { return _ppmMultiplier; }
int vBatCalib() { return _vBatCalib; }
int vBatWarn() { return _vBatWarn; }
// All the set declarations
void Name (const QString str) { if (str.isEmpty()) // Name may never be empty!
store("----", _Name, "Name" ,"Profiles", QString("profile%1").arg(index));
void name (const QString x) { if (x.isEmpty()) // Name may never be empty!
store("----", _name, "Name" ,"Profiles", QString("profile%1").arg(index));
else
store(str, _Name, "Name" ,"Profiles", QString("profile%1").arg(index));}
store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
void firmware (const QString str) { store(str, _firmware, "firmware" ,"Profiles", QString("profile%1").arg(index));}
void sdPath (const QString str) { store(str, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
void SplashFileName (const QString str) { store(str, _SplashFileName, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void burnFirmware (const bool bl) { store(bl, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
void rename_firmware_files (const bool bl) { store(bl, _rename_firmware_files, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
void patchImage (const bool bl) { store(bl, _patchImage, "patchImage" ,"Profiles", QString("profile%1").arg(index));}
void default_channel_order (const int it) { store(it, _default_channel_order, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
void default_mode (const int it) { store(it, _default_mode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
void firmware (const QString x) { store(x, _firmware, "firmware" ,"Profiles", QString("profile%1").arg(index));}
void sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
void splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
void burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
void renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
void patchImage (const bool x) { store(x, _patchImage, "patchImage" ,"Profiles", QString("profile%1").arg(index));}
void channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
void defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
void Beeper (const QString str) { store(str, _Beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
void countryCode (const QString str) { store(str, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
void Display (const QString str) { store(str, _Display, "Display" ,"Profiles", QString("profile%1").arg(index));}
void Haptic (const QString str) { store(str, _Haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
void Speaker (const QString str) { store(str, _Speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
void StickPotCalib (const QString str) { store(str, _StickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void TrainerCalib (const QString str) { store(str, _TrainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void currentCalib (const int it) { store(it, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
void GSStickMode (const int it) { store(it, _GSStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void PPM_Multiplier (const int it) { store(it, _PPM_Multiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
void VbatCalib (const int it) { store(it, _VbatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
void vBatWarn (const int it) { store(it, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
void beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
void countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
void display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
void haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
void speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
void stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
void trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
void currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
void gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
void ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
void vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
void vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
// Constructor
Profile()
@ -423,32 +425,29 @@ public:
index = newIndex;
_firmware = "";
_Name = "";
_name = "";
_sdPath = "";
_SplashFileName = "";
_splashFile = "";
_burnFirmware = false;
_rename_firmware_files = false;
_renameFwFiles = false;
_patchImage = false;
_default_channel_order = 0;
_default_mode = 1;
_channelOrder = 0;
_defaultMode = 1;
_Beeper = "";
_beeper = "";
_countryCode = "";
_Display = "";
_Haptic = "";
_Speaker = "";
_StickPotCalib = "";
_TrainerCalib = "";
_display = "";
_haptic = "";
_speaker = "";
_stickPotCalib = "";
_trainerCalib = "";
_currentCalib = 0;
_GSStickMode = 0;
_PPM_Multiplier = 0;
_VbatCalib = 0;
_gsStickMode = 0;
_ppmMultiplier = 0;
_vBatCalib = 0;
_vBatWarn = 0;
QString pName;
retrieve( pName, "Name", "", "Profiles", QString("profile%1").arg(index));
// Do not write empty profiles to disk except the default (0) profile.
if ( index > 0 && !existsOnDisk())
return;
@ -460,26 +459,26 @@ public:
{
// Load and store all variables. Use default values if setting values are missing
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( _SplashFileName, "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( _rename_firmware_files, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _patchImage, "patchImage" ,false ,"Profiles", QString("profile%1").arg(index));
getset( _default_channel_order, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _default_mode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
getset( _Beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _Display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _Haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _Speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _StickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _TrainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _GSStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _PPM_Multiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _VbatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
}
};
@ -493,168 +492,168 @@ public:
FwRevision fwRev;
private:
QStringList _recentFileList;
QByteArray _mainWindowGeometry;
QByteArray _mainWindowState;
QByteArray _modelEditGeometry;
QStringList _recentFiles;
QByteArray _mainWinGeo;
QByteArray _mainWinState;
QByteArray _modelEditGeo;
QString _arm_mcu;
QString _avr_arguments;
QString _avr_port;
QString _avrdude_location;
QString _cpu_id;
QString _dfu_arguments;
QString _dfu_location;
QString _armMcu;
QString _avrArguments;
QString _avrPort;
QString _avrdudeLocation;
QString _cpuId;
QString _dfuArguments;
QString _dfuLocation;
QString _lastFw;
QString _locale;
QString _mcu;
QString _programmer;
QString _samba_location;
QString _samba_port;
QString _sambaLocation;
QString _sambaPort;
QString _backupPath;
QString _compilationServer;
QString _backupDir;
QString _compileServer;
QString _gePath;
QString _lastDir;
QString _lastFlashDir;
QString _lastImagesDir;
QString _lastLogDir;
QString _libraryPath;
QString _snapshotpath;
QString _flashDir;
QString _imagesDir;
QString _logDir;
QString _libDir;
QString _snapshotDir;
bool _backupEnable;
bool _enableBackup;
bool _backupOnFlash;
bool _maximized;
bool _js_support;
bool _rev4asupport;
bool _show_splash;
bool _snapshot_to_clipboard;
bool _startup_check_companion;
bool _startup_check_fw;
bool _jsSupport;
bool _rev4aSupport;
bool _showSplash;
bool _snapToClpbrd;
bool _autoCheckApp;
bool _autoCheckFw;
bool _simuSW;
bool _wizardEnable;
bool _enableWizard;
int _backLight;
int _embedded_splashes; // Shouldn't this be bool ??
int _fwserver;
int _embedSplashes;
int _fwServerFails;
int _generalEditTab;
int _icon_size;
int _js_ctrl;
int _history_size;
int _iconSize;
int _jsCtrl;
int _historySize;
int _modelEditTab;
int _profileId;
int _id;
int _theme;
int _warningId;
public:
// All the get declarations
QStringList recentFileList() { return _recentFileList; }
QByteArray mainWindowGeometry(){ return _mainWindowGeometry; }
QByteArray mainWindowState() { return _mainWindowState; }
QByteArray modelEditGeometry() { return _modelEditGeometry; }
QStringList recentFiles() { return _recentFiles; }
QByteArray mainWinGeo() { return _mainWinGeo; }
QByteArray mainWinState() { return _mainWinState; }
QByteArray modelEditGeo() { return _modelEditGeo; }
QString arm_mcu() { return _arm_mcu; }
QString avr_arguments() { return _avr_arguments; }
QString avr_port() { return _avr_port; }
QString avrdude_location() { return _avrdude_location; }
QString cpu_id() { return _cpu_id; }
QString dfu_arguments() { return _dfu_arguments; }
QString dfu_location() { return _dfu_location; }
QString armMcu() { return _armMcu; }
QString avrArguments() { return _avrArguments; }
QString avrPort() { return _avrPort; }
QString avrdudeLocation() { return _avrdudeLocation; }
QString cpuId() { return _cpuId; }
QString dfuArguments() { return _dfuArguments; }
QString dfuLocation() { return _dfuLocation; }
QString lastFw() { return _lastFw; }
QString locale() { return _locale; }
QString mcu() { return _mcu; }
QString programmer() { return _programmer; }
QString samba_location() { return _samba_location; }
QString samba_port() { return _samba_port; }
QString sambaLocation() { return _sambaLocation; }
QString sambaPort() { return _sambaPort; }
QString backupPath() { return _backupPath; }
QString compilationServer() { return _compilationServer; }
QString backupDir() { return _backupDir; }
QString compileServer() { return _compileServer; }
QString gePath() { return _gePath; }
QString lastDir() { return _lastDir; }
QString lastFlashDir() { return _lastFlashDir; }
QString lastImagesDir() { return _lastImagesDir; }
QString lastLogDir() { return _lastLogDir; }
QString libraryPath() { return _libraryPath; }
QString snapshotpath() { return _snapshotpath; }
QString flashDir() { return _flashDir; }
QString imagesDir() { return _imagesDir; }
QString logDir() { return _logDir; }
QString libDir() { return _libDir; }
QString snapshotDir() { return _snapshotDir; }
bool backupEnable() { return _backupEnable; }
bool enableBackup() { return _enableBackup; }
bool backupOnFlash() { return _backupOnFlash; }
bool js_support() { return _js_support; }
bool rev4asupport() { return _rev4asupport; }
bool jsSupport() { return _jsSupport; }
bool rev4aSupport() { return _rev4aSupport; }
bool maximized() { return _maximized; }
bool show_splash() { return _show_splash; }
bool snapshot_to_clipboard() { return _snapshot_to_clipboard; }
bool startup_check_companion() { return _startup_check_companion;}
bool startup_check_fw() { return _startup_check_fw; }
bool showSplash() { return _showSplash; }
bool snapToClpbrd() { return _snapToClpbrd; }
bool autoCheckApp() { return _autoCheckApp; }
bool autoCheckFw() { return _autoCheckFw; }
bool simuSW() { return _simuSW; }
bool wizardEnable() { return _wizardEnable; }
bool enableWizard() { return _enableWizard; }
int backLight() { return _backLight; }
int embedded_splashes() { return _embedded_splashes; }
int fwserver() { return _fwserver; }
int embedSplashes() { return _embedSplashes; }
int fwServerFails() { return _fwServerFails; }
int generalEditTab() { return _generalEditTab; }
int icon_size() { return _icon_size; }
int history_size() { return _history_size; }
int js_ctrl() { return _js_ctrl; }
int iconSize() { return _iconSize; }
int historySize() { return _historySize; }
int jsCtrl() { return _jsCtrl; }
int modelEditTab() { return _modelEditTab; }
int id() { return _profileId; }
int id() { return _id; }
int theme() { return _theme; }
int warningId() { return _warningId; }
// All the set declarations
void recentFileList (const QStringList l) { store(l, _recentFileList, "recentFileList" );}
void mainWindowGeometry (const QByteArray a) { store(a, _mainWindowGeometry, "mainWindowGeometry");}
void mainWindowState (const QByteArray a) { store(a, _mainWindowState, "mainWindowState" );}
void modelEditGeometry (const QByteArray a) { store(a, _modelEditGeometry, "modelEditGeometry" );}
void recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
void mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );}
void mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );}
void modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );}
void arm_mcu (const QString str) { store(str, _arm_mcu, "arm_mcu" );}
void avr_arguments (const QString str) { store(str, _avr_arguments, "avr_arguments" );}
void avr_port (const QString str) { store(str, _avr_port, "avr_port" );}
void avrdude_location (const QString str) { store(str, _avrdude_location, "avrdude_location" );}
void cpu_id (const QString str) { store(str, _cpu_id, "cpu_id" );}
void dfu_arguments (const QString str) { store(str, _dfu_arguments, "dfu_arguments" );}
void dfu_location (const QString str) { store(str, _dfu_location, "dfu_location" );}
void lastFw (const QString str) { store(str, _lastFw, "lastFw" );}
void locale (const QString str) { store(str, _locale, "locale" );}
void mcu (const QString str) { store(str, _mcu, "mcu" );}
void programmer (const QString str) { store(str, _programmer, "programmer" );}
void samba_location (const QString str) { store(str, _samba_location, "samba_location" );}
void samba_port (const QString str) { store(str, _samba_port, "samba_port" );}
void armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );}
void avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );}
void avrPort (const QString x) { store(x, _avrPort, "avr_port" );}
void avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );}
void cpuId (const QString x) { store(x, _cpuId, "cpu_id" );}
void dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );}
void dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );}
void lastFw (const QString x) { store(x, _lastFw, "lastFw" );}
void locale (const QString x) { store(x, _locale, "locale" );}
void mcu (const QString x) { store(x, _mcu, "mcu" );}
void programmer (const QString x) { store(x, _programmer, "programmer" );}
void sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
void sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
void backupPath (const QString str) { store(str, _backupPath, "backupPath" );}
void compilationServer (const QString str) { store(str, _compilationServer, "compilation-server");}
void gePath (const QString str) { store(str, _gePath, "gePath" );}
void lastDir (const QString str) { store(str, _lastDir, "lastDir" );}
void lastFlashDir (const QString str) { store(str, _lastFlashDir, "lastFlashDir" );}
void lastImagesDir (const QString str) { store(str, _lastImagesDir, "lastImagesDir" );}
void lastLogDir (const QString str) { store(str, _lastLogDir, "lastLogDir" );}
void libraryPath (const QString str) { store(str, _libraryPath, "libraryPath" );}
void snapshotpath (const QString str) { store(str, _snapshotpath, "snapshotpath" );}
void backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
void compileServer (const QString x) { store(x, _compileServer, "compilation-server" );}
void gePath (const QString x) { store(x, _gePath, "gePath" );}
void lastDir (const QString x) { store(x, _lastDir, "lastDir" );}
void flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );}
void imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );}
void logDir (const QString x) { store(x, _logDir, "lastLogDir" );}
void libDir (const QString x) { store(x, _libDir, "libraryPath" );}
void snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
void backupEnable (const bool bl) { store(bl, _backupEnable, "backupEnable" );}
void backupOnFlash (const bool bl) { store(bl, _backupOnFlash, "backupOnFlash" );}
void maximized (const bool bl) { store(bl, _maximized, "maximized" );}
void js_support (const bool bl) { store(bl, _js_support, "js_support" );}
void rev4asupport (const bool bl) { store(bl, _rev4asupport, "rev4asupport" );}
void show_splash (const bool bl) { store(bl, _show_splash, "show_splash" );}
void snapshot_to_clipboard (const bool bl) { store(bl, _snapshot_to_clipboard, "snapshot_to_clipboard" );}
void startup_check_companion (const bool bl) { store(bl, _startup_check_companion, "startup_check_companion" );}
void startup_check_fw (const bool bl) { store(bl, _startup_check_fw, "startup_check_fw" );}
void simuSW (const bool bl) { store(bl, _simuSW, "simuSW" );}
void wizardEnable (const bool bl) { store(bl, _wizardEnable, "wizardEnable" );}
void enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
void backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
void maximized (const bool x) { store(x, _maximized, "maximized" );}
void jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
void rev4aSupport (const bool x) { store(x, _rev4aSupport, "rev4asupport" );}
void showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
void snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );}
void autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
void autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
void simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
void enableWizard (const bool x) { store(x, _enableWizard, "wizardEnable" );}
void backLight (const int it) { store(it, _backLight, "backLight" );}
void embedded_splashes (const int it) { store(it, _embedded_splashes, "embedded_splashes" );}
void fwserver (const int it) { store(it, _fwserver, "fwserver" );}
void generalEditTab (const int it) { store(it, _generalEditTab, "generalEditTab" );}
void icon_size (const int it) { store(it, _icon_size, "icon_size" );}
void history_size (const int it) { store(it, _history_size, "history_size" );}
void js_ctrl (const int it) { store(it, _js_ctrl, "js_ctrl" );}
void modelEditTab (const int it) { store(it, _modelEditTab, "modelEditTab" );}
void id (const int it) { store(it, _profileId, "profileId" );}
void theme (const int it) { store(it, _theme, "theme" );}
void warningId (const int it) { store(it, _warningId, "warningId" );}
void backLight (const int x) { store(x, _backLight, "backLight" );}
void embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
void fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );}
void generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );}
void iconSize (const int x) { store(x, _iconSize, "icon_size" );}
void historySize (const int x) { store(x, _historySize, "history_size" );}
void jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
void modelEditTab (const int x) { store(x, _modelEditTab, "modelEditTab" );}
void id (const int x) { store(x, _id, "profileId" );}
void theme (const int x) { store(x, _theme, "theme" );}
void warningId (const int x) { store(x, _warningId, "warningId" );}
// Constructor
AppData()
@ -685,14 +684,14 @@ public:
// Move Companion9x settings to profile0, the new default profile
profile[0].firmware( firmware );
profile[0].Name(settings.value( "Name", "" ).toString());
profile[0].name( settings.value( "Name", "" ).toString());
profile[0].sdPath( settings.value( "sdPath", "" ).toString());
profile[0].SplashFileName(settings.value( "SplashFileName", "" ).toString());
profile[0].splashFile( settings.value( "SplashFileName", "" ).toString());
profile[0].burnFirmware( settings.value( "burnFirmware", false ).toBool());
profile[0].rename_firmware_files(settings.value("rename_firmware_files", false ).toBool());
profile[0].renameFwFiles( settings.value( "rename_firmware_files", false ).toBool());
profile[0].patchImage( settings.value( "patchImage", false ).toBool());
profile[0].default_channel_order(settings.value("default_channel_order", "0" ).toInt());
profile[0].default_mode(settings.value( "default_mode", "1" ).toInt());
profile[0].channelOrder( settings.value( "default_channel_order", "0" ).toInt());
profile[0].defaultMode( settings.value( "default_mode", "1" ).toInt());
// Delete unused settings
settings.remove("firmware");
@ -707,60 +706,58 @@ public:
}
// Load and store all variables. Use default values if setting values are missing
getset( _recentFiles, "recentFileList" ,"" );
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
getset( _mainWinState, "mainWindowState" ,"" );
getset( _modelEditGeo, "modelEditGeometry" ,"" );
getset( _recentFileList, "recentFileList" ,"" );
getset( _mainWindowGeometry, "mainWindowGeometry" ,"" );
getset( _mainWindowState, "mainWindowState" ,"" );
getset( _modelEditGeometry, "modelEditGeometry" ,"" );
getset( _arm_mcu, "arm_mcu" ,"at91sam3s4-9x" );
getset( _avr_arguments, "avr_arguments" ,"" );
getset( _avr_port, "avr_port" ,"" );
getset( _avrdude_location, "avrdude_location" ,"" );
getset( _cpu_id, "cpu_id" ,"" );
getset( _dfu_arguments, "dfu_arguments" ,"-a 0" );
getset( _dfu_location, "dfu_location" ,"" );
getset( _armMcu, "arm_mcu" ,"at91sam3s4-9x" );
getset( _avrArguments, "avr_arguments" ,"" );
getset( _avrPort, "avr_port" ,"" );
getset( _avrdudeLocation, "avrdudeLocation" ,"" );
getset( _cpuId, "cpu_id" ,"" );
getset( _dfuArguments, "dfu_arguments" ,"-a 0" );
getset( _dfuLocation, "dfu_location" ,"" );
getset( _lastFw, "lastFw" ,"" );
getset( _locale, "locale" ,"" );
getset( _mcu, "mcu" ,"m64" );
getset( _programmer, "programmer" ,"usbasp" );
getset( _samba_location, "samba_location" ,"" );
getset( _samba_port, "samba_port" ,"\\USBserial\\COM23" );
getset( _sambaLocation, "samba_location" ,"" );
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
getset( _backupPath, "backupPath" ,"" );
getset( _compilationServer, "compilation-server" ,"" );
getset( _backupDir, "backupPath" ,"" );
getset( _compileServer, "compilation-server" ,"" );
getset( _gePath, "gePath" ,"" );
getset( _lastDir, "lastDir" ,"" );
getset( _lastFlashDir, "lastFlashDir" ,"" );
getset( _lastImagesDir, "lastImagesDir" ,"" );
getset( _lastLogDir, "lastLogDir" ,"" );
getset( _libraryPath, "libraryPath" ,"" );
getset( _snapshotpath, "snapshotpath" ,"" );
getset( _flashDir, "lastFlashDir" ,"" );
getset( _imagesDir, "lastImagesDir" ,"" );
getset( _logDir, "lastLogDir" ,"" );
getset( _libDir, "libraryPath" ,"" );
getset( _snapshotDir, "snapshotpath" ,"" );
getset( _backupEnable, "backupEnable" ,false );
getset( _enableBackup, "backupEnable" ,false );
getset( _backupOnFlash, "backupOnFlash" ,true );
getset( _js_support, "js_support" ,false );
getset( _rev4asupport, "rev4asupport" ,false );
getset( _jsSupport, "js_support" ,false );
getset( _rev4aSupport, "rev4asupport" ,false );
getset( _maximized, "maximized" ,false );
getset( _show_splash, "show_splash" ,true );
getset( _snapshot_to_clipboard, "snapshot_to_clipboard" ,false );
getset( _startup_check_companion, "startup_check_companion" ,true );
getset( _startup_check_fw, "startup_check_fw" ,true );
getset( _showSplash, "show_splash" ,true );
getset( _snapToClpbrd, "snapshot_to_clipboard" ,false );
getset( _autoCheckApp, "startup_check_companion" ,true );
getset( _autoCheckFw, "startup_check_fw" ,true );
getset( _simuSW, "simuSW" ,false );
getset( _wizardEnable, "wizardEnable" ,true );
getset( _enableWizard, "wizardEnable" ,true );
getset( _backLight, "backLight" ,0 );
getset( _embedded_splashes, "embedded_splashes" ,0 );
getset( _fwserver, "fwserver" ,0 );
getset( _embedSplashes, "embedded_splashes" ,0 );
getset( _fwServerFails, "fwserver" ,0 );
getset( _generalEditTab, "generalEditTab" ,0 );
getset( _icon_size, "icon_size" ,2 );
getset( _js_ctrl, "js_ctrl" ,0 );
getset( _history_size, "history_size" ,10 );
getset( _iconSize, "icon_size" ,2 );
getset( _jsCtrl, "js_ctrl" ,0 );
getset( _historySize, "history_size" ,10 );
getset( _modelEditTab, "modelEditTab" ,0 );
getset( _profileId, "profileId" ,0 );
getset( _id, "profileId" ,0 );
getset( _theme, "theme" ,1 );
getset( _warningId, "warningId" ,0 );
}
};

View file

@ -36,36 +36,36 @@ appPreferencesDialog::~appPreferencesDialog()
void appPreferencesDialog::writeValues()
{
g.startup_check_companion(ui->startupCheck_companion9x->isChecked());
g.startup_check_fw(ui->startupCheck_fw->isChecked());
g.wizardEnable(ui->wizardEnable_ChkB->isChecked());
g.show_splash(ui->showSplash->isChecked());
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
g.autoCheckFw(ui->startupCheck_fw->isChecked());
g.enableWizard(ui->wizardEnable_ChkB->isChecked());
g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked());
g.history_size(ui->historySize->value());
g.historySize(ui->historySize->value());
g.backLight(ui->backLightColor->currentIndex());
g.libraryPath(ui->libraryPath->text());
g.libDir(ui->libraryPath->text());
g.gePath(ui->ge_lineedit->text());
g.embedded_splashes(ui->splashincludeCB->currentIndex());
g.backupEnable(ui->backupEnable->isChecked());
g.embedSplashes(ui->splashincludeCB->currentIndex());
g.enableBackup(ui->backupEnable->isChecked());
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
g.js_support(ui->joystickChkB ->isChecked());
g.js_ctrl(ui->joystickCB ->currentIndex());
g.jsSupport(ui->joystickChkB ->isChecked());
g.jsCtrl(ui->joystickCB ->currentIndex());
}
else {
g.js_support(false);
g.js_ctrl(0);
g.jsSupport(false);
g.jsCtrl(0);
}
g.id(ui->profileIndexLE->text().toInt());
g.profile[g.id()].default_channel_order(ui->channelorderCB->currentIndex());
g.profile[g.id()].default_mode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].rename_firmware_files(ui->renameFirmware->isChecked());
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
g.profile[g.id()].Name(ui->profileNameLE->text());
g.profile[g.id()].name(ui->profileNameLE->text());
g.profile[g.id()].sdPath(ui->sdPath->text());
g.profile[g.id()].SplashFileName(ui->SplashFileName->text());
g.profile[g.id()].splashFile(ui->SplashFileName->text());
g.profile[g.id()].firmware(ui->firmwareLE->text());
saveProfile();
@ -73,50 +73,50 @@ void appPreferencesDialog::writeValues()
void appPreferencesDialog::on_snapshotPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotpath());
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
if (!fileName.isEmpty()) {
g.snapshotpath(fileName);
g.snapshot_to_clipboard(false);
g.snapshotDir(fileName);
g.snapToClpbrd(false);
ui->snapshotPath->setText(fileName);
}
}
void appPreferencesDialog::initSettings()
{
ui->snapshotClipboardCKB->setChecked(g.snapshot_to_clipboard());
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
ui->snapshotPath->setText(g.snapshotpath());
ui->snapshotPath->setText(g.snapshotDir());
ui->snapshotPath->setReadOnly(true);
if (ui->snapshotClipboardCKB->isChecked())
{
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
}
ui->startupCheck_companion9x->setChecked(g.startup_check_companion());
ui->startupCheck_fw->setChecked(g.startup_check_fw());
ui->wizardEnable_ChkB->setChecked(g.wizardEnable());
ui->showSplash->setChecked(g.show_splash());
ui->historySize->setValue(g.history_size());
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
ui->startupCheck_fw->setChecked(g.autoCheckFw());
ui->wizardEnable_ChkB->setChecked(g.enableWizard());
ui->showSplash->setChecked(g.showSplash());
ui->historySize->setValue(g.historySize());
ui->backLightColor->setCurrentIndex(g.backLight());
ui->simuSW->setChecked(g.simuSW());
ui->libraryPath->setText(g.libraryPath());
ui->libraryPath->setText(g.libDir());
ui->ge_lineedit->setText(g.gePath());
if (!g.backupPath().isEmpty()) {
if (QDir(g.backupPath()).exists()) {
ui->backupPath->setText(g.backupPath());
if (!g.backupDir().isEmpty()) {
if (QDir(g.backupDir()).exists()) {
ui->backupPath->setText(g.backupDir());
ui->backupEnable->setEnabled(true);
ui->backupEnable->setChecked(g.backupEnable());
ui->backupEnable->setChecked(g.enableBackup());
} else {
ui->backupEnable->setDisabled(true);
}
} else {
ui->backupEnable->setDisabled(true);
}
ui->splashincludeCB->setCurrentIndex(g.embedded_splashes());
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
#ifdef JOYSTICKS
ui->joystickChkB->setChecked(g.js_support());
ui->joystickChkB->setChecked(g.jsSupport());
if (ui->joystickChkB->isChecked()) {
QStringList joystickNames;
joystickNames << tr("No joysticks found");
@ -134,7 +134,7 @@ void appPreferencesDialog::initSettings()
}
ui->joystickCB->clear();
ui->joystickCB->insertItems(0, joystickNames);
ui->joystickCB->setCurrentIndex(g.js_ctrl());
ui->joystickCB->setCurrentIndex(g.jsCtrl());
}
else {
ui->joystickCB->clear();
@ -143,22 +143,23 @@ void appPreferencesDialog::initSettings()
}
#endif
// Profile Tab Inits
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].default_channel_order());
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].default_mode());
ui->renameFirmware->setChecked(g.profile[g.id()].rename_firmware_files());
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
ui->sdPath->setText(g.profile[g.id()].sdPath());
ui->profileIndexLE->setText(QString("%1").arg(g.id()));
ui->profileNameLE->setText(g.profile[g.id()].Name());
ui->profileNameLE->setText(g.profile[g.id()].name());
ui->firmwareLE->setText(g.profile[g.id()].firmware());
ui->SplashFileName->setText(g.profile[g.id()].SplashFileName());
displayImage( g.profile[g.id()].SplashFileName() );
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
displayImage( g.profile[g.id()].splashFile() );
}
void appPreferencesDialog::on_libraryPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libraryPath());
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir());
if (!fileName.isEmpty()) {
g.libraryPath(fileName);
g.libDir(fileName);
ui->libraryPath->setText(fileName);
}
}
@ -168,20 +169,20 @@ void appPreferencesDialog::on_snapshotClipboardCKB_clicked()
if (ui->snapshotClipboardCKB->isChecked()) {
ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true);
g.snapshot_to_clipboard(true);
g.snapToClpbrd(true);
} else {
ui->snapshotPath->setEnabled(true);
ui->snapshotPath->setReadOnly(true);
ui->snapshotPathButton->setEnabled(true);
g.snapshot_to_clipboard(false);
g.snapToClpbrd(false);
}
}
void appPreferencesDialog::on_backupPathButton_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupPath());
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
if (!fileName.isEmpty()) {
g.backupPath(fileName);
g.backupDir(fileName);
ui->backupPath->setText(fileName);
}
ui->backupEnable->setEnabled(true);
@ -244,13 +245,13 @@ void appPreferencesDialog::saveProfile()
if (ui->profileNameLE->text().isEmpty())
ui->profileNameLE->setText("----");
g.profile[g.id()].Name( ui->profileNameLE->text() );
g.profile[g.id()].default_channel_order( ui->channelorderCB->currentIndex());
g.profile[g.id()].default_mode( ui->stickmodeCB->currentIndex());
g.profile[g.id()].name( ui->profileNameLE->text() );
g.profile[g.id()].channelOrder( ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode( ui->stickmodeCB->currentIndex());
g.profile[g.id()].burnFirmware( ui->burnFirmware->isChecked());
g.profile[g.id()].rename_firmware_files( ui->renameFirmware->isChecked());
g.profile[g.id()].renameFwFiles( ui->renameFirmware->isChecked());
g.profile[g.id()].sdPath( ui->sdPath->text());
g.profile[g.id()].SplashFileName( ui->SplashFileName->text());
g.profile[g.id()].splashFile( ui->SplashFileName->text());
g.profile[g.id()].firmware( ui->firmwareLE->text());
}
@ -313,10 +314,10 @@ void appPreferencesDialog::on_SplashSelect_clicked()
}
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open Image to load"), g.lastImagesDir(), tr("Images (%1)").arg(supportedImageFormats));
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()){
g.lastImagesDir(QFileInfo(fileName).dir().absolutePath());
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
displayImage(fileName);
ui->SplashFileName->setText(fileName);

View file

@ -84,9 +84,9 @@ burnConfigDialog::~burnConfigDialog()
void burnConfigDialog::getSettings()
{
avrLoc = g.avrdude_location();
sambaLoc = g.samba_location();
dfuLoc = g.dfu_location();
avrLoc = g.avrdudeLocation();
sambaLoc = g.sambaLocation();
dfuLoc = g.dfuLocation();
#if defined WIN32 || !defined __GNUC__
if ( avrLoc.isEmpty())
@ -112,13 +112,13 @@ void burnConfigDialog::getSettings()
#endif
dfuArgs = g.dfu_arguments().split(" ", QString::SkipEmptyParts);
avrArgs = g.avr_arguments().split(" ", QString::SkipEmptyParts);
dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts);
avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts);
avrProgrammer = g.programmer();
avrPort = g.avr_port();
avrPort = g.avrPort();
avrMCU = g.mcu();
armMCU = g.arm_mcu();
sambaPort = g.samba_port();
armMCU = g.armMcu();
sambaPort = g.sambaPort();
ui->avrdude_location->setText(getAVRDUDE());
ui->avrArgs->setText(getAVRArgs().join(" "));
@ -147,16 +147,16 @@ void burnConfigDialog::getSettings()
void burnConfigDialog::putSettings()
{
g.avrdude_location( avrLoc );
g.avrdudeLocation( avrLoc );
g.programmer( avrProgrammer);
g.mcu( avrMCU );
g.avr_port( avrPort );
g.avr_arguments( avrArgs.join(" ") );
g.samba_location( sambaLoc );
g.samba_port( sambaPort );
g.arm_mcu( armMCU );
g.dfu_location( dfuLoc );
g.dfu_arguments( dfuArgs.join(" ") );
g.avrPort( avrPort );
g.avrArguments( avrArgs.join(" ") );
g.sambaLocation( sambaLoc );
g.sambaPort( sambaPort );
g.armMcu( armMCU );
g.dfuLocation( dfuLoc );
g.dfuArguments( dfuArgs.join(" ") );
}
void burnConfigDialog::populateProgrammers()

View file

@ -59,7 +59,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
else {
setWindowTitle(tr("Write Models and Settings in %1 to TX").arg(DocName));
}
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].Name());
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
}
if (!hexfileName->isEmpty()) {
ui->FWFileName->setText(*hexfileName);
@ -69,13 +69,13 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
else {
burnraw=false;
if (checkeEprom(*hexfileName)) {
QString Name = g.profile[g.id()].Name();
QString calib = g.profile[g.id()].StickPotCalib();
QString trainercalib = g.profile[g.id()].TrainerCalib();
QString DisplaySet = g.profile[g.id()].Display();
QString BeeperSet = g.profile[g.id()].Beeper();
QString HapticSet = g.profile[g.id()].Haptic();
QString SpeakerSet = g.profile[g.id()].Speaker();
QString Name = g.profile[g.id()].name();
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
QString DisplaySet = g.profile[g.id()].display();
QString BeeperSet = g.profile[g.id()].beeper();
QString HapticSet = g.profile[g.id()].haptic();
QString SpeakerSet = g.profile[g.id()].speaker();
if (!Name.isEmpty()) {
ui->profile_label->show();
ui->patchcalib_CB->show();
@ -140,7 +140,7 @@ void burnDialog::on_FlashLoadButton_clicked()
ui->EEbackupCB->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
if (hexType==2) {
fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.lastFlashDir(), FLASH_FILES_FILTER);
fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.flashDir(), FLASH_FILES_FILTER);
checkFw(fileName);
}
else {
@ -200,7 +200,7 @@ void burnDialog::checkFw(QString fileName)
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
ui->FwImage->show();
ui->FwImage->setPixmap(QPixmap::fromImage(flash.getSplash()));
QString ImageStr = g.profile[g.id()].SplashFileName();
QString ImageStr = g.profile[g.id()].splashFile();
bool PatchFwCB = g.profile[g.id()].patchImage();
if (!ImageStr.isEmpty()) {
QImage Image = qstring2image(ImageStr);
@ -244,7 +244,7 @@ void burnDialog::checkFw(QString fileName)
ui->BurnFlashButton->setEnabled(true);
}
QTimer::singleShot(0, this, SLOT(shrink()));
g.lastFlashDir( QFileInfo(fileName).dir().absolutePath() );
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
bool burnDialog::checkeEprom(QString fileName)
@ -345,10 +345,10 @@ void burnDialog::on_ImageLoadButton_clicked()
}
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open Image to load"), g.lastImagesDir(), tr("Images (%1)").arg(supportedImageFormats));
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()) {
g.lastImagesDir( QFileInfo(fileName).dir().absolutePath() );
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
QImage image(fileName);
if (image.isNull()) {
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
@ -425,7 +425,7 @@ void burnDialog::on_BurnFlashButton_clicked()
if (hexType==2) {
QString fileName=ui->FWFileName->text();
if (!fileName.isEmpty()) {
g.lastFlashDir( QFileInfo(fileName).dir().absolutePath() );
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
g.lastFw( fileName );
if (ui->PatchFWCB->isChecked()) {
g.profile[g.id()].patchImage( true );
@ -461,19 +461,19 @@ void burnDialog::on_BurnFlashButton_clicked()
}
}
if (hexType==1) {
QString calib = g.profile[g.id()].StickPotCalib();
QString trainercalib = g.profile[g.id()].TrainerCalib();
QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetEepromInterface()->getCapability(Pots);
int8_t vBatCalib=(int8_t) g.profile[g.id()].VbatCalib();
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].PPM_Multiplier();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].GSStickMode();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
QString DisplaySet= g.profile[g.id()].Display();
QString BeeperSet= g.profile[g.id()].Beeper();
QString HapticSet= g.profile[g.id()].Haptic();
QString SpeakerSet= g.profile[g.id()].Speaker();
QString DisplaySet= g.profile[g.id()].display();
QString BeeperSet= g.profile[g.id()].beeper();
QString HapticSet= g.profile[g.id()].haptic();
QString SpeakerSet= g.profile[g.id()].speaker();
bool patch=false;
if (ui->patchcalib_CB->isChecked()) {
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
@ -631,7 +631,7 @@ void burnDialog::on_PreferredImageCB_toggled(bool checked)
{
QString tmpFileName;
if (checked) {
QString ImageStr = g.profile[g.id()].SplashFileName();
QString ImageStr = g.profile[g.id()].splashFile();
if (!ImageStr.isEmpty()) {
QImage Image = qstring2image(ImageStr);
if (ui->imageLabel->width()!=128) {

View file

@ -115,7 +115,7 @@ bool Side::saveImage()
}
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
g.lastFlashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
}
else {
return false;
@ -124,7 +124,7 @@ bool Side::saveImage()
else if (*source == PICT) {
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
if (image.save(*saveToFileName)) {
g.lastImagesDir( QFileInfo(*saveToFileName).dir().absolutePath() );
g.imagesDir( QFileInfo(*saveToFileName).dir().absolutePath() );
}
else {
return false;
@ -181,12 +181,12 @@ void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
void customizeSplashDialog::loadFirmware(Side side)
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.lastFlashDir(), FLASH_FILES_FILTER);
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, FW ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load embedded FW image from %1.").arg(fileName));
else
g.lastFlashDir( QFileInfo(fileName).dir().absolutePath() );
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
}
@ -199,13 +199,13 @@ void customizeSplashDialog::loadPicture(Side side)
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
}
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open Image to load"), g.lastImagesDir(), tr("Images (%1)").arg(supportedImageFormats));
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PICT ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
else
g.lastImagesDir( QFileInfo(fileName).dir().absolutePath() );
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
}
}
@ -213,7 +213,7 @@ void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
void customizeSplashDialog::loadProfile(Side side)
{
QString fileName=g.profile[g.id()].SplashFileName();
QString fileName=g.profile[g.id()].splashFile();
if (!fileName.isEmpty()) {
if (!side.displayImage( fileName, PROFILE ))

View file

@ -731,24 +731,24 @@ GeneralSettings::GeneralSettings()
calibSpanNeg[i] = 0x180;
calibSpanPos[i] = 0x180;
}
templateSetup = g.profile[g.id()].default_channel_order();
stickMode = g.profile[g.id()].default_mode();
templateSetup = g.profile[g.id()].channelOrder();
stickMode = g.profile[g.id()].defaultMode();
QString t_calib=g.profile[g.id()].StickPotCalib();
QString t_calib=g.profile[g.id()].stickPotCalib();
int potsnum=GetEepromInterface()->getCapability(Pots);
if (t_calib.isEmpty()) {
return;
} else {
QString t_trainercalib=g.profile[g.id()].TrainerCalib();
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].VbatCalib();
QString t_trainercalib=g.profile[g.id()].trainerCalib();
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib();
int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].PPM_Multiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].GSStickMode();
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
QString t_DisplaySet=g.profile[g.id()].Display();
QString t_BeeperSet=g.profile[g.id()].Beeper();
QString t_HapticSet=g.profile[g.id()].Haptic();
QString t_SpeakerSet=g.profile[g.id()].Speaker();
QString t_DisplaySet=g.profile[g.id()].display();
QString t_BeeperSet=g.profile[g.id()].beeper();
QString t_HapticSet=g.profile[g.id()].haptic();
QString t_SpeakerSet=g.profile[g.id()].speaker();
QString t_CountrySet=g.profile[g.id()].countryCode();
if ((t_calib.length()==(NUM_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) {
@ -986,7 +986,7 @@ void RegisterEepromInterfaces()
eepromInterfaces.push_back(new Open9xInterface(BOARD_GRUVIN9X));
eepromInterfaces.push_back(new Open9xInterface(BOARD_SKY9X));
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS));
if (g.rev4asupport())
if (g.rev4aSupport())
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS_REV4a));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));

View file

@ -934,10 +934,10 @@ bool Open9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esiz
QString geturl( int board)
{
QString url = g.compilationServer();
QString url = g.compileServer();
if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS;
g.compilationServer(url);
g.compileServer(url);
}
switch(board) {
case BOARD_STOCK:
@ -959,10 +959,10 @@ QString geturl( int board)
QString getstamp( int board)
{
QString url = g.compilationServer();
QString url = g.compileServer();
if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS;
g.compilationServer(url);
g.compileServer(url);
}
url.append("/stamp-opentx-");
switch(board) {
@ -991,10 +991,10 @@ QString getstamp( int board)
QString getrnurl( int board)
{
QString url = g.compilationServer();
QString url = g.compileServer();
if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS;
g.compilationServer(url);
g.compileServer(url);
}
url.append("/releasenotes-");
switch(board) {
@ -1221,7 +1221,7 @@ void RegisterOpen9xFirmwares()
open9x->addOptions(fai_options);
firmwares.push_back(open9x);
if (g.rev4asupport()) {
if (g.rev4aSupport()) {
open9x = new Open9xFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), new Open9xInterface(BOARD_TARANIS_REV4a), geturl(BOARD_TARANIS_REV4a), getstamp(BOARD_TARANIS_REV4a),getrnurl(BOARD_TARANIS), true);
open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu"));

View file

@ -211,7 +211,7 @@ void fwPreferencesDialog::firmwareChanged()
void fwPreferencesDialog::writeValues()
{
g.cpu_id( ui->CPU_ID_LE->text() );
g.cpuId( ui->CPU_ID_LE->text() );
current_firmware_variant = getFirmwareVariant();
g.profile[g.id()].firmware( current_firmware_variant.id );
}
@ -271,7 +271,7 @@ void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
void fwPreferencesDialog::initSettings()
{
ui->CPU_ID_LE->setText(g.cpu_id());
ui->CPU_ID_LE->setText(g.cpuId());
FirmwareInfo * current_firmware = GetCurrentFirmware();
foreach(FirmwareInfo * firmware, firmwares) {

View file

@ -22,7 +22,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
QString firmware_id = g.profile[g.id()].firmware();
ui->tabWidget->setCurrentIndex( g.generalEditTab() );
QString name=g.profile[g.id()].Name();
QString name=g.profile[g.id()].name();
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
}
@ -70,7 +70,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
}
ui->profile_CB->clear();
for ( int i = 0; i < MAX_PROFILES; ++i) {
QString name=g.profile[i].Name();
QString name=g.profile[i].name();
if (!name.isEmpty()) {
ui->profile_CB->addItem(name, i);
if (i==g.id()) {
@ -1209,21 +1209,21 @@ void GeneralEdit::on_swGEAChkB_stateChanged(int )
void GeneralEdit::on_calretrieve_PB_clicked()
{
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString calib=g.profile[profile_id].StickPotCalib();
QString calib=g.profile[profile_id].stickPotCalib();
int potsnum=GetEepromInterface()->getCapability(Pots);
if (calib.isEmpty()) {
return;
} else {
QString trainercalib = g.profile[profile_id].TrainerCalib();
int8_t vBatCalib = (int8_t)g.profile[profile_id].VbatCalib();
QString trainercalib = g.profile[profile_id].trainerCalib();
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].PPM_Multiplier();
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].GSStickMode();
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
QString DisplaySet = g.profile[profile_id].Display();
QString BeeperSet = g.profile[profile_id].Beeper();
QString HapticSet = g.profile[profile_id].Haptic();
QString SpeakerSet = g.profile[profile_id].Speaker();
QString DisplaySet = g.profile[profile_id].display();
QString BeeperSet = g.profile[profile_id].beeper();
QString HapticSet = g.profile[profile_id].haptic();
QString SpeakerSet = g.profile[profile_id].speaker();
QString CountrySet = g.profile[profile_id].countryCode();
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
@ -1319,13 +1319,13 @@ void GeneralEdit::on_calstore_PB_clicked()
{
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString name=g.profile[profile_id].Name();
QString name=g.profile[profile_id].name();
int potsnum=GetEepromInterface()->getCapability(Pots);
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
return;
} else {
QString calib=g.profile[profile_id].StickPotCalib();
QString calib=g.profile[profile_id].stickPotCalib();
if (!(calib.isEmpty())) {
int ret = QMessageBox::question(this, "Companion",
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
@ -1340,21 +1340,21 @@ void GeneralEdit::on_calstore_PB_clicked()
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanNeg[i], 4, 16, QChar('0')));
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanPos[i], 4, 16, QChar('0')));
}
g.profile[profile_id].StickPotCalib( calib );
g.profile[profile_id].stickPotCalib( calib );
calib.clear();
for (int i=0; i< 4; i++) {
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.trainer.calib[i], 4, 16, QChar('0')));
}
g.profile[profile_id].TrainerCalib( calib );
g.profile[profile_id].VbatCalib( g_eeGeneral.vBatCalib );
g.profile[profile_id].trainerCalib( calib );
g.profile[profile_id].vBatCalib( g_eeGeneral.vBatCalib );
g.profile[profile_id].currentCalib( g_eeGeneral.currentCalib );
g.profile[profile_id].vBatWarn( g_eeGeneral.vBatWarn );
g.profile[profile_id].PPM_Multiplier( g_eeGeneral.PPM_Multiplier );
g.profile[profile_id].GSStickMode( g_eeGeneral.stickMode );
g.profile[profile_id].Display( QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0')) );
g.profile[profile_id].Beeper( QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0')));
g.profile[profile_id].Haptic( QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0')));
g.profile[profile_id].Speaker( QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0')));
g.profile[profile_id].ppmMultiplier( g_eeGeneral.PPM_Multiplier );
g.profile[profile_id].gsStickMode( g_eeGeneral.stickMode );
g.profile[profile_id].display( QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0')) );
g.profile[profile_id].beeper( QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0')));
g.profile[profile_id].haptic( QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0')));
g.profile[profile_id].speaker( QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0')));
g.profile[profile_id].countryCode( QString("%1%2%3").arg((uint8_t)g_eeGeneral.countryCode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.imperial, 2, 16, QChar('0')).arg(g_eeGeneral.ttsLanguage));
QMessageBox::information(this, "Companion", tr("Calibration and HW parameters saved."));
}

View file

@ -59,10 +59,10 @@ class lcdWidget : public QWidget {
QPixmap buffer(2*lcdWidth, 2*lcdHeight);
QPainter p(&buffer);
doPaint(p);
bool toclipboard=g.snapshot_to_clipboard();
bool toclipboard=g.snapToClpbrd();
QApplication::clipboard()->setPixmap( buffer );
if (!toclipboard) {
QString Path=g.snapshotpath();
QString Path=g.snapshotDir();
if (Path.isEmpty() || !QDir(Path).exists()) {
Path=".";
}

View file

@ -584,9 +584,9 @@ void logsDialog::moveLegend()
void logsDialog::on_fileOpen_BT_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.lastLogDir());
QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.logDir());
if (!fileName.isEmpty()) {
g.lastLogDir( fileName );
g.logDir( fileName );
ui->FileName_LE->setText(fileName);
if (cvsFileParse()) {
ui->FieldsTW->clear();

View file

@ -109,7 +109,7 @@ int main(int argc, char *argv[])
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].firmware());
MainWindow *mainWin = new MainWindow();
if (g.show_splash()) {
if (g.showSplash()) {
splash->show();
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));

View file

@ -100,7 +100,7 @@ MainWindow::MainWindow():
createStatusBar();
updateMenus();
restoreState(g.mainWindowState());
restoreState(g.mainWinState());
setUnifiedTitleAndToolBarOnMac(true);
this->setWindowIcon(QIcon(":/icon.png"));
@ -110,7 +110,7 @@ MainWindow::MainWindow():
// give time to the splash to disappear and main window to open before starting updates
int updateDelay = 1000;
bool showSplash = g.show_splash();
bool showSplash = g.showSplash();
if (showSplash) {
updateDelay += (SPLASH_TIME*1000);
}
@ -200,7 +200,7 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId)
QString stamp = GetFirmware(fwToUpdate)->stamp;
if (!stamp.isEmpty()) {
if (g.startup_check_fw() || ignoreSettings) {
if (g.autoCheckFw() || ignoreSettings) {
check1done=false;
manager1 = new QNetworkAccessManager(this);
connect(manager1, SIGNAL(finished(QNetworkReply*)), this, SLOT(reply1Finished(QNetworkReply*)));
@ -211,7 +211,7 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId)
}
}
if (g.startup_check_companion() || ignoreSettings) {
if (g.autoCheckApp() || ignoreSettings) {
check2done = false;
manager2 = new QNetworkAccessManager(this);
connect(manager2, SIGNAL(finished(QNetworkReply*)),this, SLOT(checkForUpdateFinished(QNetworkReply*)));
@ -302,9 +302,9 @@ void MainWindow::downloadLatestFW(FirmwareInfo * firmware, const QString & firmw
{
QString url, ext, cpuid;
url = firmware->getUrl(firmwareId);
cpuid=g.cpu_id();
cpuid=g.cpuId();
ext = url.mid(url.lastIndexOf("."));
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.lastFlashDir() + "/" + firmwareId + ext);
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + firmwareId + ext);
if (!fileName.isEmpty()) {
downloadedFW = firmwareId;
needRename=true;
@ -313,7 +313,7 @@ void MainWindow::downloadLatestFW(FirmwareInfo * firmware, const QString & firmw
url.append("&cpuid=");
url.append(cpuid);
}
g.lastFlashDir(QFileInfo(fileName).dir().absolutePath());
g.flashDir(QFileInfo(fileName).dir().absolutePath());
downloadDialog * dd = new downloadDialog(this, url, fileName);
connect(dd, SIGNAL(accepted()), this, SLOT(reply1Accepted()));
dd->exec();
@ -404,7 +404,7 @@ void MainWindow::reply1Accepted()
int pos=rev.lastIndexOf("-r");
if (pos>0) {
currentFWrev=rev.mid(pos+2).toInt();
if (g.profile[g.id()].rename_firmware_files() && needRename) {
if (g.profile[g.id()].renameFwFiles() && needRename) {
QFileInfo fi(downloadedFWFilename);
QString path=fi.path()+QDir::separator ();
path.append(fi.completeBaseName());
@ -440,7 +440,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
// TODO delete downloadDialog_forWait?
}
cpuid=g.cpu_id();
cpuid=g.cpuId();
QByteArray qba = reply->readAll();
int i = qba.indexOf("SVN_VERS");
int warning = qba.indexOf("WARNING");
@ -454,7 +454,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
if(!cres) {
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
g.fwserver(g.fwserver()+1);
g.fwServerFails(g.fwServerFails()+1);
return;
}
@ -548,12 +548,12 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
QString url = GetFirmware(fwToUpdate)->getUrl(fwToUpdate);
QString ext = url.mid(url.lastIndexOf("."));
needRename=false;
bool addversion=g.profile[g.id()].rename_firmware_files();
bool addversion=g.profile[g.id()].renameFwFiles();
QString fileName;
if (addversion) {
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.lastFlashDir() + "/" + fwToUpdate + newrev + ext);
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + fwToUpdate + newrev + ext);
} else {
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.lastFlashDir() + "/" + fwToUpdate + ext);
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + fwToUpdate + ext);
}
if (!fileName.isEmpty()) {
if (!cpuid.isEmpty()) {
@ -561,7 +561,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
url.append(cpuid);
}
downloadedFWFilename = fileName;
g.lastFlashDir(QFileInfo(fileName).dir().absolutePath());
g.flashDir(QFileInfo(fileName).dir().absolutePath());
downloadDialog * dd = new downloadDialog(this, url, fileName);
currentFWrev_temp = NewFwRev;
connect(dd, SIGNAL(accepted()), this, SLOT(reply1Accepted()));
@ -575,7 +575,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
} else {
if(check1done && check2done) {
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
g.fwserver(g.fwserver()+1);
g.fwServerFails(g.fwServerFails()+1);
return;
}
}
@ -583,8 +583,8 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
void MainWindow::closeEvent(QCloseEvent *event)
{
g.mainWindowGeometry(saveGeometry());
g.mainWindowState(saveState());
g.mainWinGeo(saveGeometry());
g.mainWinState(saveState());
mdiArea->closeAllSubWindows();
if (mdiArea->currentSubWindow()) {
event->ignore();
@ -618,7 +618,7 @@ void MainWindow::setTheme(int index)
void MainWindow::setIconThemeSize(int index)
{
g.icon_size( index );
g.iconSize( index );
QMessageBox msgBox;
msgBox.setText(tr("The icon size will be used the next time you start Companion."));
@ -1061,8 +1061,8 @@ void MainWindow::writeFileToEeprom()
if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
bool backupEnable = g.backupEnable();
QString backupPath = g.backupPath();
bool backupEnable = g.enableBackup();
QString backupPath = g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
@ -1316,8 +1316,8 @@ void MainWindow::writeFlash(QString fileToFlash)
if (backup) {
QString tempDir = QDir::tempPath();
QString backupFile = tempDir + "/backup.bin";
bool backupEnable=g.backupEnable();
QString backupPath=g.backupPath();
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
@ -1371,8 +1371,8 @@ void MainWindow::writeFlash(QString fileToFlash)
}
}
else {
bool backupEnable=g.backupEnable();
QString backupPath=g.backupPath();
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!QDir(backupPath).exists()) {
if (backupEnable) {
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
@ -1432,13 +1432,13 @@ void MainWindow::readEepromToFile()
void MainWindow::readFlash()
{
QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), g.lastFlashDir(),tr(FLASH_FILES_FILTER));
QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), g.flashDir(),tr(FLASH_FILES_FILTER));
if (!fileName.isEmpty()) {
QFile file(fileName);
if (file.exists()) {
file.remove();
}
g.lastFlashDir(QFileInfo(fileName).dir().absolutePath());
g.flashDir(QFileInfo(fileName).dir().absolutePath());
QStringList str = GetReceiveFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx");
ad->setWindowIcon(CompanionIcon("read_flash.png"));
@ -1517,7 +1517,7 @@ void MainWindow::updateMenus()
updateIconSizeActions();
updateIconThemeActions();
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg( g.profile[g.id()].Name() ));
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg( g.profile[g.id()].name() ));
}
MdiChild *MainWindow::createMdiChild()
@ -1770,7 +1770,7 @@ QMenu *MainWindow::createProfilesMenu()
void MainWindow::createToolBars()
{
QSize size;
switch(g.icon_size()) {
switch(g.iconSize()) {
case 0:
size=QSize(16,16);
break;
@ -1886,12 +1886,12 @@ void MainWindow::updateRecentFileActions()
int i, numRecentFiles;
// Hide all document slots
for ( i=0 ; i < g.history_size(); i++)
for ( i=0 ; i < g.historySize(); i++)
recentFileActs[i]->setVisible(false);
// Fill slots with content and unhide them
QStringList files = g.recentFileList();
numRecentFiles = qMin(files.size(), g.history_size());
QStringList files = g.recentFiles();
numRecentFiles = qMin(files.size(), g.historySize());
for ( i = 0; i < numRecentFiles; i++) {
QString text = strippedName(files[i]);
@ -1906,7 +1906,7 @@ void MainWindow::updateRecentFileActions()
void MainWindow::updateIconSizeActions()
{
switch (g.icon_size())
switch (g.iconSize())
{
case 0: smallIconAct->setChecked(true); break;
case 1: normalIconAct->setChecked(true); break;
@ -1961,9 +1961,9 @@ void MainWindow::updateProfilesActions()
{
for (int i=0; i<MAX_PROFILES; i++)
{
if (!g.profile[i].Name().isEmpty())
if (!g.profile[i].name().isEmpty())
{
QString text = tr("&%1: %2").arg(i).arg(g.profile[i].Name());
QString text = tr("&%1: %2").arg(i).arg(g.profile[i].name());
profileActs[i]->setText(text);
profileActs[i]->setData(i);
profileActs[i]->setVisible(true);
@ -1979,13 +1979,13 @@ void MainWindow::updateProfilesActions()
void MainWindow::createProfile()
{ int i;
for (i=0; i<MAX_PROFILES && !g.profile[i].Name().isEmpty(); i++)
for (i=0; i<MAX_PROFILES && !g.profile[i].name().isEmpty(); i++)
;
if (i==MAX_PROFILES) //Failed to find free slot
return;
// Create profile name and force a flush to file
g.profile[i].Name( QString("profile%1").arg(i));
g.profile[i].name( QString("profile%1").arg(i));
g.profile[i].flush();
updateMenus();

View file

@ -180,7 +180,7 @@ void MdiChild::OpenEditWindow(bool wizard=false)
}
if (isNew && !wizard) {
int ret;
bool wizardEnable=g.wizardEnable();
bool wizardEnable=g.enableWizard();
if (wizardEnable) {
ret = QMessageBox::question(this, tr("Companion"), tr("Do you want to use model wizard? "), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
@ -189,7 +189,7 @@ void MdiChild::OpenEditWindow(bool wizard=false)
qSleep(500);
ret = QMessageBox::question(this, tr("Companion"), tr("Ask this question again ? "), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No) {
g.wizardEnable( false );
g.enableWizard( false );
}
}
}
@ -367,10 +367,10 @@ bool MdiChild::saveAs(bool isNew)
if (fileName.isEmpty())
return false;
if (fileName.contains("rev4a")) {
g.rev4asupport( true );
g.rev4aSupport( true );
}
if (fileName.contains("norev4a")) {
g.rev4asupport( false );
g.rev4aSupport( false );
}
g.lastDir( QFileInfo(fileName).dir().absolutePath() );
if (isNew)
@ -489,14 +489,14 @@ void MdiChild::setCurrentFile(const QString &fileName)
fileChanged = false;
setWindowModified(false);
updateTitle();
int MaxRecentFiles = g.history_size();
QStringList files = g.recentFileList();
int MaxRecentFiles = g.historySize();
QStringList files = g.recentFiles();
files.removeAll(fileName);
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
g.recentFileList( files );
g.recentFiles( files );
}
QString MdiChild::strippedName(const QString &fullFileName)
@ -506,8 +506,8 @@ QString MdiChild::strippedName(const QString &fullFileName)
void MdiChild::writeEeprom() // write to Tx
{
bool backupEnable=g.backupEnable();
QString backupPath=g.backupPath();
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty()) {
if (!QDir(backupPath).exists()) {
if (backupEnable) {
@ -518,7 +518,7 @@ void MdiChild::writeEeprom() // write to Tx
} else {
backupEnable=false;
}
QString stickCal=g.profile[g.id()].StickPotCalib();
QString stickCal=g.profile[g.id()].stickPotCalib();
burnConfigDialog bcd;
QString tempDir = QDir::tempPath();
QString tempFile = tempDir + "/temp.bin";

View file

@ -22,7 +22,7 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
generalSettings(radioData.generalSettings)
{
ui->setupUi(this);
restoreGeometry(g.modelEditGeometry());
restoreGeometry(g.modelEditGeo());
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
addTab(new Setup(this, model), tr("Setup"));
addTab(new HeliPanel(this, model), tr("Heli"));
@ -45,7 +45,7 @@ ModelEdit::~ModelEdit()
void ModelEdit::closeEvent(QCloseEvent *event)
{
g.modelEditGeometry( saveGeometry() );
g.modelEditGeo( saveGeometry() );
}
class VerticalScrollArea : public QScrollArea

View file

@ -75,8 +75,8 @@ simulatorDialog::simulatorDialog(QWidget *parent) :
}
#ifdef JOYSTICKS
bool js_enable=g.js_support();
int js_ctrl=g.js_ctrl();
bool js_enable=g.jsSupport();
int js_ctrl=g.jsCtrl();
if (js_enable) {
int count=0;
for (int j=0; j<8;j++){
@ -209,7 +209,7 @@ void simulatorDialog::setupTimer()
void simulatorDialog::onButtonPressed(int value)
{
if (value==Qt::Key_Print) {
bool toclipboard=g.snapshot_to_clipboard();
bool toclipboard=g.snapToClpbrd();
QString fileName ="";
if (!toclipboard) {
fileName = QString("screenshot-%1.png").arg(++screenshotIdx);

View file

@ -62,7 +62,7 @@ void splashLibrary::setupPage(int page) {
void splashLibrary::getFileList() {
imageList.clear();
if (g.embedded_splashes() == 0) {
if (g.embedSplashes()) {
QDir myRes(":/images/library");
QStringList tmp = myRes.entryList();
for (int i = 0; i < tmp.size(); i++) {
@ -70,7 +70,7 @@ void splashLibrary::getFileList() {
imageList.append(":/images/library/" + fileInfo.fileName());
}
}
QString libraryPath = g.libraryPath();
QString libraryPath = g.libDir();
if (!libraryPath.isEmpty()) {
if (QDir(libraryPath).exists()) {
QStringList supportedImageFormats;

View file

@ -37,9 +37,9 @@ xsimulatorDialog::xsimulatorDialog(QWidget *parent) :
this->setFixedSize(this->width(), this->height());
bool simuSW = g.simuSW();
#ifdef JOYSTICKS
int js_ctrl = g.js_ctrl();
int js_ctrl = g.jsCtrl();
if (g.js_support()) {
if (g.jsSupport()) {
int count=0;
for (int j=0; j<8;j++){
int axe=g.joystick[j].stick_axe();
@ -177,7 +177,7 @@ void xsimulatorDialog::setupTimer()
void xsimulatorDialog::onButtonPressed(int value)
{
if (value==Qt::Key_Print) {
bool toclipboard=g.snapshot_to_clipboard();
bool toclipboard=g.snapToClpbrd();
QString fileName ="";
if (!toclipboard) {
fileName = QString("screenshot-%1.png").arg(++screenshotIdx);