add message box on save
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
#include "itemsettingsdialog.h"
|
#include "itemsettingsdialog.h"
|
||||||
#include "itemcreationdialog.h"
|
#include "itemcreationdialog.h"
|
||||||
#include "../mainobject.h"
|
#include "../mainobject.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
MainWindow::MainWindow(MainObject * const mainObject, QWidget *parent) :
|
MainWindow::MainWindow(MainObject * const mainObject, QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
@ -15,9 +16,14 @@ MainWindow::MainWindow(MainObject * const mainObject, QWidget *parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
if(!mainObject->master)
|
if(!mainObject->master)
|
||||||
|
{
|
||||||
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigBrodcast);
|
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigBrodcast);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigSave);
|
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigSave);
|
||||||
|
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::saved);
|
||||||
|
}
|
||||||
|
|
||||||
connect(ui->pushButton_power, SIGNAL(clicked()), this, SLOT(showPowerItemDialog()));
|
connect(ui->pushButton_power, SIGNAL(clicked()), this, SLOT(showPowerItemDialog()));
|
||||||
|
|
||||||
@ -42,7 +48,7 @@ MainWindow::MainWindow(MainObject * const mainObject, QWidget *parent) :
|
|||||||
connect(&globalSensors, &SensorStore::stateChenged, ui->sensorListView, &SensorListWidget::sensorsChanged);
|
connect(&globalSensors, &SensorStore::stateChenged, ui->sensorListView, &SensorListWidget::sensorsChanged);
|
||||||
|
|
||||||
//RGB Leds
|
//RGB Leds
|
||||||
connect(&colorChooser, SIGNAL(colorSelected(const QColor)), this, SLOT(slotChangedRgb(const QColor)));
|
connect(&colorChooser, SIGNAL(colorSelected(QColor)), this, SLOT(slotChangedRgb(QColor)));
|
||||||
connect(ui->button_quit, SIGNAL(clicked()), this, SLOT(close()));
|
connect(ui->button_quit, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
connect(ui->button_color, SIGNAL(clicked()), &colorChooser, SLOT(show()));
|
connect(ui->button_color, SIGNAL(clicked()), &colorChooser, SLOT(show()));
|
||||||
|
|
||||||
@ -62,6 +68,11 @@ void MainWindow::showPowerItemDialog()
|
|||||||
diag.exec();
|
diag.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::saved()
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, "Saved", "Settings where saved");
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::slotChangedRgb(const QColor color)
|
void MainWindow::slotChangedRgb(const QColor color)
|
||||||
{
|
{
|
||||||
_micro->changeRgbColor(color);
|
_micro->changeRgbColor(color);
|
||||||
|
@ -50,6 +50,7 @@ private slots:
|
|||||||
void slotChangedRgb(const QColor color);
|
void slotChangedRgb(const QColor color);
|
||||||
void showPowerItemDialog();
|
void showPowerItemDialog();
|
||||||
void showItemCreationDialog();
|
void showItemCreationDialog();
|
||||||
|
void saved();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user