Fix bug that prevented aquireing new items

Add save button to master that saves json file
Remove autosave on quit
This commit is contained in:
2021-10-02 14:12:58 +02:00
parent 5fb9ca7cc0
commit 954eec754c
14 changed files with 61 additions and 18 deletions

View File

@ -89,6 +89,8 @@ void ActorSettingsDialog::init()
if(actor_->getTriggerValue() == 0) ui->comboBox_action->setCurrentIndex(0);
else if(actor_->getTriggerValue() == 1) ui->comboBox_action->setCurrentIndex(1);
else ui->comboBox_action->setCurrentIndex(2);
ui->label_Exausted->setText(actor_->isExausted() ? "True" : "False");
}
ActorSettingsDialog::~ActorSettingsDialog()
@ -107,7 +109,7 @@ void ActorSettingsDialog::valueChanged(int value)
actor_->setTriggerValue(value);
}
void ActorSettingsDialog::hideCancle(const bool hide)
void ActorSettingsDialog::hideCancle([[maybe_unused]] const bool hide)
{
}

View File

@ -63,6 +63,30 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Exausted:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Exausted">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>False</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="pushButton_editItem">
<property name="text">

View File

@ -24,6 +24,7 @@ AlarmWidget::AlarmWidget(std::shared_ptr<AlarmTime> alarm, QWidget *parent) :
}
else
{
ui->checkBox->setChecked(true);
ui->radioButton->setEnabled(true);
ui->radioButton_2->setEnabled(true);
ui->radioButton_3->setEnabled(true);

View File

@ -14,8 +14,10 @@ MainWindow::MainWindow(MainObject * const mainObject, QWidget *parent) :
{
ui->setupUi(this);
if(!mainObject->master) connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigBrodcast);
else ui->pushButton_broadcast->hide();
if(!mainObject->master)
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigBrodcast);
else
connect(ui->pushButton_broadcast, &QPushButton::clicked, this, &MainWindow::sigSave);
connect(ui->pushButton_power, SIGNAL(clicked()), this, SLOT(showPowerItemDialog()));

View File

@ -41,6 +41,7 @@ private:
signals:
void sigBrodcast();
void sigSave();
void createdItem(std::shared_ptr<Item> item);
private slots: