summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2017-04-04 19:50:46 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-06 18:25:15 -0700
commit2f86cbdc3690aa0e5ef8e321f4d5dbb10bf640cc (patch)
tree2ce63eedcbb24566f248e8a4f01a63b316fa01fd /desktop-widgets/tab-widgets/maintab.cpp
parent1fc4fba69fed8607d9b961086a88bcf362a482a5 (diff)
downloadsubsurface-2f86cbdc3690aa0e5ef8e321f4d5dbb10bf640cc.tar.gz
Clean up some widgets
Simplify logic of handling the Message that this dive is being modified. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.cpp')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 0b712c8fb..28e17e66e 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -46,13 +46,13 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.setupUi(this);
extraWidgets << new TabDiveExtraInfo(this);
- addTab(extraWidgets.last(), "Extra Info");
+ ui.tabWidget->addTab(extraWidgets.last(), "Extra Info");
extraWidgets << new TabDiveInformation(this);
- addTab(extraWidgets.last(), "Information");
+ ui.tabWidget->addTab(extraWidgets.last(), "Information");
extraWidgets << new TabDiveStatistics(this);
- addTab(extraWidgets.last(), "Statistics");
+ ui.tabWidget->addTab(extraWidgets.last(), "Statistics");
extraWidgets << new TabDivePhotos(this);
- addTab(extraWidgets.last(), "Photos");
+ ui.tabWidget->addTab(extraWidgets.last(), "Photos");
ui.dateEdit->setDisplayFormat(prefs.date_format);
@@ -121,7 +121,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.suit->setCompleter(completers.suit);
ui.tagWidget->setCompleter(completers.tags);
ui.diveNotesMessage->hide();
- ui.diveEquipmentMessage->hide();
ui.depth->hide();
ui.depthLabel->hide();
ui.duration->hide();
@@ -261,14 +260,12 @@ void MainTab::addDiveStarted()
void MainTab::addMessageAction(QAction *action)
{
- ui.diveEquipmentMessage->addAction(action);
ui.diveNotesMessage->addAction(action);
}
void MainTab::hideMessage()
{
ui.diveNotesMessage->animatedHide();
- ui.diveEquipmentMessage->animatedHide();
updateTextLabels(false);
}
@@ -276,17 +273,13 @@ void MainTab::closeMessage()
{
hideMessage();
ui.diveNotesMessage->setCloseButtonVisible(false);
- ui.diveEquipmentMessage->setCloseButtonVisible(false);
-}
+ }
void MainTab::displayMessage(QString str)
{
ui.diveNotesMessage->setCloseButtonVisible(false);
- ui.diveEquipmentMessage->setCloseButtonVisible(false);
ui.diveNotesMessage->setText(str);
ui.diveNotesMessage->animatedShow();
- ui.diveEquipmentMessage->setText(str);
- ui.diveEquipmentMessage->animatedShow();
updateTextLabels();
}