mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Profile2: provide means to disable the tool buttons
Once the poster is displayed when there are no dives in the list, we may also want to disable the QToolButtons (PO2, SAC, etc..), until a new dive is loaded and the profile is redrawn. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b382228b7d
commit
466f160c01
3 changed files with 20 additions and 0 deletions
|
@ -166,6 +166,23 @@ void MainWindow::cleanUpEmpty()
|
|||
setTitle(MWTF_DEFAULT);
|
||||
}
|
||||
|
||||
void MainWindow::setToolButtonsEnabled(bool enabled)
|
||||
{
|
||||
ui.profPO2->setEnabled(enabled);
|
||||
ui.profPn2->setEnabled(enabled);
|
||||
ui.profPhe->setEnabled(enabled);
|
||||
ui.profDcCeiling->setEnabled(enabled);
|
||||
ui.profCalcCeiling->setEnabled(enabled);
|
||||
ui.profCalcAllTissues->setEnabled(enabled);
|
||||
ui.profIncrement3m->setEnabled(enabled);
|
||||
ui.profMod->setEnabled(enabled);
|
||||
ui.profEad->setEnabled(enabled);
|
||||
ui.profNdl_tts->setEnabled(enabled);
|
||||
ui.profSAC->setEnabled(enabled);
|
||||
ui.profRuler->setEnabled(enabled);
|
||||
ui.profScaled->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionClose_triggered()
|
||||
{
|
||||
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
void loadFiles(const QStringList files);
|
||||
void importFiles(const QStringList importFiles);
|
||||
void cleanUpEmpty();
|
||||
void setToolButtonsEnabled(bool enabled);
|
||||
ProfileWidget2 *graphics() const;
|
||||
private
|
||||
slots:
|
||||
|
|
|
@ -544,6 +544,7 @@ void ProfileWidget2::setEmptyState()
|
|||
|
||||
dataModel->clear();
|
||||
currentState = EMPTY;
|
||||
MainWindow::instance()->setToolButtonsEnabled(false);
|
||||
|
||||
backgroundFile = QString(":poster");
|
||||
fixBackgroundPos();
|
||||
|
@ -577,6 +578,7 @@ void ProfileWidget2::setProfileState()
|
|||
return;
|
||||
|
||||
currentState = PROFILE;
|
||||
MainWindow::instance()->setToolButtonsEnabled(true);
|
||||
toolTipItem->readPos();
|
||||
setBackgroundBrush(getColor(::BACKGROUND));
|
||||
|
||||
|
|
Loading…
Reference in a new issue