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>
This commit is contained in:
Sergey Starosek 2014-01-15 22:35:14 +02:00 committed by Dirk Hohndel
parent d2c95ddf75
commit 88f3df5c79
3 changed files with 4 additions and 3 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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>