summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
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
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')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp17
-rw-r--r--desktop-widgets/tab-widgets/maintab.ui1117
-rw-r--r--desktop-widgets/tableview.cpp2
3 files changed, 545 insertions, 591 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();
}
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,525 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainTab</class>
- <widget class="QTabWidget" name="MainTab">
+ <widget class="QWidget" name="MainTab">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>463</width>
- <height>815</height>
+ <width>555</width>
+ <height>848</height>
</rect>
</property>
- <property name="currentIndex">
- <number>1</number>
+ <property name="windowTitle">
+ <string>Form</string>
</property>
- <widget class="QWidget" name="notesTab">
- <attribute name="title">
- <string>Notes</string>
- </attribute>
- <attribute name="toolTip">
- <string>General notes about the current selection</string>
- </attribute>
- <layout class="QGridLayout" name="diveNotesLayout">
- <property name="leftMargin">
- <number>5</number>
- </property>
- <property name="topMargin">
- <number>5</number>
- </property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <property name="bottomMargin">
- <number>5</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <item row="2" column="1">
- <widget class="KMessageWidget" name="diveNotesMessage"/>
- </item>
- <item row="3" column="1">
- <widget class="QScrollArea" name="scrollArea">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>445</width>
- <height>726</height>
- </rect>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <property name="leftMargin">
- <number>5</number>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <widget class="KMessageWidget" name="diveNotesMessage"/>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="notesTab">
+ <attribute name="title">
+ <string>Notes</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>523</width>
+ <height>739</height>
+ </rect>
</property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <property name="horizontalSpacing">
- <number>8</number>
- </property>
- <property name="verticalSpacing">
- <number>0</number>
- </property>
- <item row="2" column="3">
- <widget class="QLabel" name="durationLabel">
- <property name="text">
- <string>Duration</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Date</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Time</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="airTempLabel">
- <property name="text">
- <string>Air temp.</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QLabel" name="waterTempLabel">
- <property name="text">
- <string>Water temp.</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QDateEdit" name="dateEdit">
- <property name="calendarPopup">
- <bool>true</bool>
- </property>
- <property name="timeSpec">
- <enum>Qt::UTC</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QTimeEdit" name="timeEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="timeSpec">
- <enum>Qt::UTC</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="airtemp">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QLineEdit" name="watertemp">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="depthLabel">
- <property name="text">
- <string>Depth</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QLineEdit" name="depth"/>
- </item>
- <item row="3" column="3">
- <widget class="QLineEdit" name="duration"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="leftMargin">
- <number>5</number>
- </property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <item>
- <layout class="QHBoxLayout" name="LocationLayout" stretch="0,1">
- <item>
- <widget class="QLabel" name="LocationLabel">
- <property name="text">
- <string>Location</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="locationTags">
- <property name="text">
- <string/>
- </property>
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="spacing">
- <number>2</number>
- </property>
- <item>
- <widget class="DiveLocationLineEdit" name="location"/>
- </item>
- <item>
- <widget class="QToolButton" name="editDiveSiteButton">
- <property name="toolTip">
- <string>Edit dive site</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../../subsurface.qrc">
- <normaloff>:/geocode</normaloff>:/geocode</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QtWaitingSpinner" name="waitingSpinner" native="true"/>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLineEdit" name="diveTripLocation"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_4">
- <property name="leftMargin">
- <number>5</number>
- </property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <property name="horizontalSpacing">
- <number>5</number>
- </property>
- <property name="verticalSpacing">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="DivemasterLabel">
- <property name="text">
- <string>Divemaster</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="BuddyLabel">
- <property name="text">
- <string>Buddy</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="TagWidget" name="divemaster">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="TagWidget" name="buddy">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_3" columnstretch="0,0,1">
- <property name="leftMargin">
- <number>5</number>
- </property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <property name="horizontalSpacing">
- <number>5</number>
- </property>
- <property name="verticalSpacing">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="RatingLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Rating</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="visibilityLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Visibility</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="SuitLabel">
- <property name="text">
- <string>Suit</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" alignment="Qt::AlignVCenter">
- <widget class="StarWidget" name="rating" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="1" alignment="Qt::AlignVCenter">
- <widget class="StarWidget" name="visibility" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="suit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_2">
- <property name="horizontalSpacing">
- <number>5</number>
- </property>
- <property name="verticalSpacing">
- <number>0</number>
- </property>
- <item row="1" column="1">
- <widget class="QComboBox" name="DiveType"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="TagLabel">
- <property name="text">
- <string>Tags</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="TypeLabel">
- <property name="text">
- <string>Dive mode</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="TagWidget" name="tagWidget">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="verticalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- <property name="horizontalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- <property name="lineWrapMode">
- <enum>QPlainTextEdit::NoWrap</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <property name="spacing">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="NotesLabel">
- <property name="text">
- <string>Notes</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="notesAndSocialNetworksLayout">
- <property name="spacing">
- <number>0</number>
- </property>
- <item>
- <widget class="QTextEdit" name="notes">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QWidget" name="socialNetworks" native="true">
- <layout class="QVBoxLayout" name="socialNetworksLayout">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_6">
+ <property name="leftMargin">
+ <number>5</number>
+ </property>
+ <property name="rightMargin">
+ <number>5</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>8</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="2" column="3">
+ <widget class="QLabel" name="durationLabel">
+ <property name="text">
+ <string>Duration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Date</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Time</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="airTempLabel">
+ <property name="text">
+ <string>Air temp.</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QLabel" name="waterTempLabel">
+ <property name="text">
+ <string>Water temp.</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QDateEdit" name="dateEdit">
+ <property name="calendarPopup">
+ <bool>true</bool>
+ </property>
+ <property name="timeSpec">
+ <enum>Qt::UTC</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QTimeEdit" name="timeEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="timeSpec">
+ <enum>Qt::UTC</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLineEdit" name="airtemp">
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLineEdit" name="watertemp">
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="depthLabel">
+ <property name="text">
+ <string>Depth</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLineEdit" name="depth"/>
+ </item>
+ <item row="3" column="3">
+ <widget class="QLineEdit" name="duration"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>5</number>
+ </property>
+ <property name="rightMargin">
+ <number>5</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="LocationLayout" stretch="0,1">
+ <item>
+ <widget class="QLabel" name="LocationLabel">
+ <property name="text">
+ <string>Location</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="locationTags">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
- <number>0</number>
+ <number>2</number>
</property>
- <property name="leftMargin">
- <number>0</number>
+ <item>
+ <widget class="DiveLocationLineEdit" name="location"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="editDiveSiteButton">
+ <property name="toolTip">
+ <string>Edit dive site</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../../subsurface.qrc">
+ <normaloff>:/geocode</normaloff>:/geocode</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QtWaitingSpinner" name="waitingSpinner" native="true"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="diveTripLocation"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_7">
+ <property name="leftMargin">
+ <number>5</number>
+ </property>
+ <property name="rightMargin">
+ <number>5</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>5</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="DivemasterLabel">
+ <property name="text">
+ <string>Divemaster</string>
</property>
- <property name="topMargin">
- <number>0</number>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
- <property name="rightMargin">
- <number>0</number>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="BuddyLabel">
+ <property name="text">
+ <string>Buddy</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="TagWidget" name="divemaster">
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="TagWidget" name="buddy">
+ <property name="readOnly">
+ <bool>false</bool>
</property>
- <property name="bottomMargin">
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_8" columnstretch="0,0,1">
+ <property name="leftMargin">
+ <number>5</number>
+ </property>
+ <property name="rightMargin">
+ <number>5</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>5</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="RatingLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Rating</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="visibilityLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Visibility</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="SuitLabel">
+ <property name="text">
+ <string>Suit</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" alignment="Qt::AlignVCenter">
+ <widget class="StarWidget" name="rating" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" alignment="Qt::AlignVCenter">
+ <widget class="StarWidget" name="visibility" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLineEdit" name="suit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_9">
+ <property name="horizontalSpacing">
+ <number>5</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="DiveType"/>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="TagLabel">
+ <property name="text">
+ <string>Tags</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="TypeLabel">
+ <property name="text">
+ <string>Dive mode</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="TagWidget" name="tagWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="verticalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="NotesLabel">
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="notesAndSocialNetworksLayout">
+ <property name="spacing">
<number>0</number>
</property>
+ <item>
+ <widget class="QTextEdit" name="notes">
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" name="socialNetworks" native="true">
+ <layout class="QVBoxLayout" name="socialNetworksLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ </layout>
+ </widget>
+ </item>
</layout>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="equipmentTab">
- <attribute name="title">
- <string>Equipment</string>
- </attribute>
- <attribute name="toolTip">
- <string>Used equipment in the current selection</string>
- </attribute>
- <layout class="QGridLayout" name="equiptmentTabLayout">
- <property name="leftMargin">
- <number>5</number>
- </property>
- <property name="topMargin">
- <number>5</number>
- </property>
- <property name="rightMargin">
- <number>5</number>
- </property>
- <property name="bottomMargin">
- <number>5</number>
- </property>
- <item row="0" column="0">
- <widget class="KMessageWidget" name="diveEquipmentMessage"/>
- </item>
- <item row="1" column="0">
- <widget class="QScrollArea" name="scrollArea_2">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents_2">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>445</width>
- <height>720</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="equipmentTabScrollAreaLayout">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>2</number>
- </property>
- <item row="1" column="0">
- <widget class="QWidget" name="widget" native="true">
- <layout class="QVBoxLayout" name="cylinderWeightsLayout">
- <property name="spacing">
- <number>0</number>
- </property>
+ <widget class="QWidget" name="equipmentTab">
+ <attribute name="title">
+ <string>Equipment</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <widget class="QScrollArea" name="scrollArea_2">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>523</width>
+ <height>739</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="equipmentTabScrollAreaLayout">
<property name="leftMargin">
<number>0</number>
</property>
@@ -583,24 +532,48 @@
<property name="bottomMargin">
<number>0</number>
</property>
- <item>
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <widget class="TableView" name="cylinders" native="true"/>
- <widget class="TableView" name="weights" native="true"/>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="1" column="0">
+ <widget class="QWidget" name="widget" native="true">
+ <layout class="QVBoxLayout" name="cylinderWeightsLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="TableView" name="cylinders" native="true"/>
+ <widget class="TableView" name="weights" native="true"/>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
</widget>
- </item>
- </layout>
- </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
- </item>
- </layout>
- </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
<customwidgets>
<customwidget>
@@ -638,18 +611,6 @@
<header>desktop-widgets/locationinformation.h</header>
</customwidget>
</customwidgets>
- <tabstops>
- <tabstop>dateEdit</tabstop>
- <tabstop>timeEdit</tabstop>
- <tabstop>airtemp</tabstop>
- <tabstop>watertemp</tabstop>
- <tabstop>divemaster</tabstop>
- <tabstop>buddy</tabstop>
- <tabstop>rating</tabstop>
- <tabstop>visibility</tabstop>
- <tabstop>suit</tabstop>
- <tabstop>notes</tabstop>
- </tabstops>
<resources>
<include location="../../subsurface.qrc"/>
</resources>
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));