diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-04-13 17:43:45 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-15 10:30:04 +1200 |
commit | fe61f6b69e03d4700e28724e6977e9b365541724 (patch) | |
tree | 56626b89e24253f9df678b4d6a735d299696be33 /desktop-widgets/tab-widgets/TabDiveEquipment.h | |
parent | 4bb002d1370a9eb4ebe5a1210b969edc5cdba893 (diff) | |
download | subsurface-fe61f6b69e03d4700e28724e6977e9b365541724.tar.gz |
Cleanup: Move dive-equipment tab into own translation units
Most tabs in the dive-information widget have there own translation
units and ui-files. Only the equipment tab was married with the
main tab. Move it out to get more reasonably sized translation units
and some isolation.
Currently, this needs ugly hacks when entering / checking for edit
mode: Access to MainTab is via the MainWindow. And vice/versa, when
accessing the DiveEquipmentTab from the MainTab, the former is
hardcoded as the first item of an array.
These hacks will soon be removed though, when making equipment
editing undoable. The tabs will then be independent.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveEquipment.h')
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveEquipment.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.h b/desktop-widgets/tab-widgets/TabDiveEquipment.h new file mode 100644 index 000000000..44c67cb27 --- /dev/null +++ b/desktop-widgets/tab-widgets/TabDiveEquipment.h @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef TAB_DIVE_EQUIPMENT_H +#define TAB_DIVE_EQUIPMENT_H + +#include "TabBase.h" +#include "ui_TabDiveEquipment.h" + +namespace Ui { + class TabDiveEquipment; +}; + +class WeightModel; +class CylindersModel; + +class TabDiveEquipment : public TabBase { + Q_OBJECT +public: + TabDiveEquipment(QWidget *parent = 0); + ~TabDiveEquipment(); + void updateData() override; + void clear() override; + void acceptChanges(); + void rejectChanges(); +private slots: + void addCylinder_clicked(); + void addWeight_clicked(); + void toggleTriggeredColumn(); + void editCylinderWidget(const QModelIndex &index); + void editWeightWidget(const QModelIndex &index); +private: + Ui::TabDiveEquipment ui; + + CylindersModel *cylindersModel; + WeightModel *weightModel; +}; + +#endif // TAB_DIVE_EQUIPMENT_H |