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(); } diff --git a/desktop-widgets/tab-widgets/maintab.ui b/desktop-widgets/tab-widgets/maintab.ui index e1e29d052..ab77740f0 100644 --- a/desktop-widgets/tab-widgets/maintab.ui +++ b/desktop-widgets/tab-widgets/maintab.ui @@ -1,576 +1,53 @@ MainTab - + 0 0 - 463 - 815 + 555 + 848 - - 1 + + Form - - - Notes - - - General notes about the current selection - - - - 5 - - - 5 - - - 5 - - - 5 - - - 0 - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 445 - 726 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 5 + + + + + + + + 0 + + + + Notes + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 523 + 739 + - - 5 - - - 8 - - - 0 - - - - - Duration - - - - - - - Date - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Time - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Air temp. - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Water temp. - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - true - - - Qt::UTC - - - - - - - - 0 - 0 - - - - Qt::UTC - - - - - - - false - - - - - - - false - - - - - - - Depth - - - - - - - - - - - - - - - 0 - - - 5 - - - 5 - - - - - - - Location - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - - - - Qt::RichText - - - - - - - - - 2 - - - - - - - - Edit dive site - - - ... - - - - :/geocode:/geocode - - - - - - - - - - - - - - - - - 5 - - - 5 - - - 5 - - - 0 - - - - - Divemaster - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Buddy - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - false - - - - - - - false - - - - - - - - - 5 - - - 5 - - - 5 - - - 0 - - - - - - 0 - 0 - - - - Rating - - - - - - - - 0 - 0 - - - - Visibility - - - - - - - Suit - - - - - - - - 0 - 0 - - - - Qt::StrongFocus - - - - - - - - 0 - 0 - - - - Qt::StrongFocus - - - - - - - - 0 - 0 - - - - false - - - - - - - - - 5 - - - 0 - - - - - - - - Tags - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Dive mode - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QPlainTextEdit::NoWrap - - - - - - - - - 0 - - - - - Notes - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - 0 - - - - - false - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - Equipment - - - Used equipment in the current selection - - - - 5 - - - 5 - - - 5 - - - 5 - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 445 - 720 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 2 - - - - - - 0 - + 0 @@ -584,23 +61,519 @@ 0 - - - Qt::Vertical + + + 5 - - + + 5 + + + 8 + + + 0 + + + + + Duration + + + + + + + Date + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Time + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Air temp. + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Water temp. + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + true + + + Qt::UTC + + + + + + + + 0 + 0 + + + + Qt::UTC + + + + + + + false + + + + + + + false + + + + + + + Depth + + + + + + + + + + + + + + + 0 + + + 5 + + + 5 + + + + + + + Location + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + + + + Qt::RichText + + + + + + + + + 2 + + + + + + + + Edit dive site + + + ... + + + + :/geocode:/geocode + + + + + + + + + + + + + + + + + 5 + + + 5 + + + 5 + + + 0 + + + + + Divemaster + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Buddy + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + false + + + + + + + false + + + + + + + + + 5 + + + 5 + + + 5 + + + 0 + + + + + + 0 + 0 + + + + Rating + + + + + + + + 0 + 0 + + + + Visibility + + + + + + + Suit + + + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + + + 0 + 0 + + + + false + + + + + + + + + 5 + + + 0 + + + + + + + + Tags + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Dive mode + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QPlainTextEdit::NoWrap + + + + + + + + + 0 + + + + + Notes + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 0 + + + + + false + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + Equipment + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 523 + 739 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Vertical + + + + + + - - - + + + - - - + + + @@ -638,18 +611,6 @@
desktop-widgets/locationinformation.h
- - dateEdit - timeEdit - airtemp - watertemp - divemaster - buddy - rating - visibility - suit - notes - diff --git a/desktop-widgets/tableview.cpp b/desktop-widgets/tableview.cpp index 3e9bb129e..0bb5bb198 100644 --- a/desktop-widgets/tableview.cpp +++ b/desktop-widgets/tableview.cpp @@ -73,7 +73,7 @@ TableView::~TableView() } if (oldDefault) { s.remove(""); - } else { + } else if (ui.tableView->model()) { for (int i = 0; i < ui.tableView->model()->columnCount(); i++) { if (ui.tableView->columnWidth(i) == defaultColumnWidth(i)) s.remove(QString("colwidth%1").arg(i));