Global Functions now integrated inside Companion - Fixes #502
This commit is contained in:
@@ -2,7 +2,7 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(generaledit_NAMES
|
||||
generaledit
|
||||
setup
|
||||
generalsetup
|
||||
trainer
|
||||
calibration
|
||||
)
|
||||
|
||||
@@ -5,20 +5,10 @@
|
||||
#include "ui_generaledit.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include "setup.h"
|
||||
#include "generalsetup.h"
|
||||
#include "trainer.h"
|
||||
#include "calibration.h"
|
||||
|
||||
GeneralPanel::GeneralPanel(QWidget * parent, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
GenericPanel(parent),
|
||||
generalSettings(generalSettings),
|
||||
firmware(firmware)
|
||||
{
|
||||
}
|
||||
|
||||
GeneralPanel::~GeneralPanel()
|
||||
{
|
||||
}
|
||||
#include "../modeledit/customfunctions.h"
|
||||
|
||||
GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, FirmwareInterface * firmware) :
|
||||
QDialog(parent),
|
||||
@@ -48,6 +38,9 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, FirmwareInterf
|
||||
}
|
||||
|
||||
addTab(new GeneralSetupPanel(this, generalSettings, firmware), tr("Setup"));
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
|
||||
}
|
||||
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
|
||||
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
|
||||
}
|
||||
@@ -57,7 +50,7 @@ GeneralEdit::~GeneralEdit()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GeneralEdit::addTab(GeneralPanel *panel, QString text)
|
||||
void GeneralEdit::addTab(GenericPanel *panel, QString text)
|
||||
{
|
||||
panels << panel;
|
||||
QWidget * widget = new QWidget(ui->tabWidget);
|
||||
@@ -75,6 +68,7 @@ void GeneralEdit::onTabModified()
|
||||
|
||||
void GeneralEdit::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
panels[index]->update();
|
||||
g.generalEditTab(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,15 +11,11 @@ namespace Ui {
|
||||
|
||||
class GeneralPanel : public GenericPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GeneralPanel(QWidget *parent, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~GeneralPanel();
|
||||
|
||||
protected:
|
||||
GeneralSettings & generalSettings;
|
||||
FirmwareInterface * firmware;
|
||||
GeneralPanel(QWidget *parent, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
GenericPanel(parent, NULL, generalSettings, firmware)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class GeneralEdit : public QDialog
|
||||
@@ -52,8 +48,8 @@ class GeneralEdit : public QDialog
|
||||
|
||||
private:
|
||||
FirmwareInterface * firmware;
|
||||
QVector<GeneralPanel *> panels;
|
||||
void addTab(GeneralPanel *panel, QString text);
|
||||
QVector<GenericPanel *> panels;
|
||||
void addTab(GenericPanel *panel, QString text);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "setup.h"
|
||||
#include "ui_setup.h"
|
||||
#include "generalsetup.h"
|
||||
#include "ui_generalsetup.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
ui(new Ui::Setup)
|
||||
ui(new Ui::GeneralSetup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef SETUP_H
|
||||
#define SETUP_H
|
||||
#ifndef GENERALSETUP_H
|
||||
#define GENERALSETUP_H
|
||||
|
||||
#include "generaledit.h"
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class Setup;
|
||||
class GeneralSetup;
|
||||
}
|
||||
|
||||
class GeneralSetupPanel : public GeneralPanel
|
||||
@@ -63,7 +63,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
|
||||
|
||||
private:
|
||||
Ui::Setup *ui;
|
||||
Ui::GeneralSetup *ui;
|
||||
|
||||
void setValues();
|
||||
void populateBacklightCB();
|
||||
@@ -72,4 +72,4 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void updateVarioPitchRange();
|
||||
};
|
||||
|
||||
#endif // SETUP_H
|
||||
#endif // GENERALSETUP_H
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Setup</class>
|
||||
<widget class="QWidget" name="Setup">
|
||||
<class>GeneralSetup</class>
|
||||
<widget class="QWidget" name="GeneralSetup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
Reference in New Issue
Block a user