Added a settings dialog that allows for persistent settings to be stored. It operates but nothing else uses the settings just yet. Updated version num.

This commit is contained in:
Collin Kidder
2015-06-28 17:31:44 -04:00
parent 88b586383c
commit 821e681dcd
8 changed files with 266 additions and 12 deletions
+20
View File
@@ -38,6 +38,11 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
//These things are used by QSettings to set up setting storage
QCoreApplication::setOrganizationName("EVTV");
QCoreApplication::setOrganizationDomain("evtv.me");
QCoreApplication::setApplicationName("SavvyCAN");
selfRef = this;
this->setWindowTitle("Savvy CAN V" + QString::number(VERSION));
@@ -102,6 +107,7 @@ MainWindow::MainWindow(QWidget *parent) :
frameSenderWindow = NULL;
dbcMainEditor = NULL;
comparatorWindow = NULL;
settingsDialog = NULL;
dbcHandler = new DBCHandler;
bDirty = false;
@@ -131,6 +137,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionSingle_Multi_State, SIGNAL(triggered(bool)), this, SLOT(showSingleMultiWindow()));
connect(ui->actionFile_Comparison, SIGNAL(triggered(bool)), this, SLOT(showComparisonWindow()));
connect(ui->btnNormalize, SIGNAL(clicked(bool)), this, SLOT(normalizeTiming()));
connect(ui->actionPreferences, SIGNAL(triggered(bool)), this, SLOT(showSettingsDialog()));
lbStatusConnected.setText(tr("Not connected"));
updateFileStatus();
@@ -159,6 +166,7 @@ MainWindow::~MainWindow()
{
serialWorkerThread.quit();
serialWorkerThread.wait();
//delete worker;
if (graphingWindow)
{
@@ -202,6 +210,12 @@ MainWindow::~MainWindow()
delete dbcMainEditor;
}
if (settingsDialog)
{
settingsDialog->close();
delete settingsDialog;
}
delete ui;
delete dbcHandler;
model->clearFrames();
@@ -587,6 +601,12 @@ void MainWindow::gotDeviceInfo(int build, int swCAN)
lbStatusConnected.setText(str);
}
void MainWindow::showSettingsDialog()
{
if (!settingsDialog) settingsDialog = new MainSettingsDialog();
settingsDialog->show();
}
void MainWindow::showGraphingWindow()
{
if (!graphingWindow) graphingWindow = new GraphingWindow(model->getListReference());