aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2014-01-15 22:35:14 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 09:12:56 +0700
commit88f3df5c790c0b2f70d4ba452c41fb85cfcd020d (patch)
tree34d2c3ec5fae0615517259d682e1c8566125c3e2
parentd2c95ddf7522e9e453fa4ed0726fbb4223137aec (diff)
downloadsubsurface-88f3df5c790c0b2f70d4ba452c41fb85cfcd020d.tar.gz
Extend tags model to Buddy field
This doesn't change storage format. Instead it parses buddy strings and converts them to string list which is supplied to tags widget. This feature was requested in ticket #311 Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp3
-rw-r--r--qt-ui/maintab.h2
-rw-r--r--qt-ui/maintab.ui2
3 files changed, 4 insertions, 3 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 9fa94c8d6..81e820a71 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -834,8 +834,9 @@ void markChangedWidget(QWidget *w){
w->setPalette(p);
}
-void MainTab::on_buddy_textChanged(const QString& text)
+void MainTab::on_buddy_textChanged()
{
+ QString text = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts).join(", ");
EDIT_SELECTED_DIVES( EDIT_TEXT(mydive->buddy, text) );
markChangedWidget(ui.buddy);
}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index ec2140b1e..313149f0e 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -69,7 +69,7 @@ public slots:
void on_location_textChanged(const QString& text);
void on_coordinates_textChanged(const QString& text);
void on_divemaster_textChanged(const QString& text);
- void on_buddy_textChanged(const QString& text);
+ void on_buddy_textChanged();
void on_suit_textChanged(const QString& text);
void on_notes_textChanged();
void on_airtemp_textChanged(const QString& text);
diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui
index 846fb4f12..b2ab316bf 100644
--- a/qt-ui/maintab.ui
+++ b/qt-ui/maintab.ui
@@ -157,7 +157,7 @@
</widget>
</item>
<item row="8" column="1">
- <widget class="QLineEdit" name="buddy">
+ <widget class="TagWidget" name="buddy">
<property name="readOnly">
<bool>false</bool>
</property>