mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:13:23 +00:00
Desktop: buddies in the dive list
As proposed in RFC #1587, now also alllow buddies to be shown in the divelist. Fixes: #1587 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
77577f717f
commit
12789a3f9f
3 changed files with 21 additions and 0 deletions
|
@ -98,6 +98,9 @@ void DiveListView::calculateInitialColumnWidth(int col)
|
||||||
case DiveTripModel::PHOTOS:
|
case DiveTripModel::PHOTOS:
|
||||||
sw = 5*em;
|
sw = 5*em;
|
||||||
break;
|
break;
|
||||||
|
case DiveTripModel::BUDDIES:
|
||||||
|
sw = 50*em;
|
||||||
|
break;
|
||||||
case DiveTripModel::LOCATION:
|
case DiveTripModel::LOCATION:
|
||||||
sw = 50*em;
|
sw = 50*em;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,6 +39,7 @@ static QVariant dive_table_alignment(int column)
|
||||||
case DiveTripModel::TAGS:
|
case DiveTripModel::TAGS:
|
||||||
case DiveTripModel::PHOTOS:
|
case DiveTripModel::PHOTOS:
|
||||||
case DiveTripModel::COUNTRY:
|
case DiveTripModel::COUNTRY:
|
||||||
|
case DiveTripModel::BUDDIES:
|
||||||
case DiveTripModel::LOCATION:
|
case DiveTripModel::LOCATION:
|
||||||
retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
|
retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
break;
|
break;
|
||||||
|
@ -151,6 +152,9 @@ QVariant DiveItem::data(int column, int role) const
|
||||||
case COUNTRY:
|
case COUNTRY:
|
||||||
retVal = QString(get_dive_country(dive));
|
retVal = QString(get_dive_country(dive));
|
||||||
break;
|
break;
|
||||||
|
case BUDDIES:
|
||||||
|
retVal = QString(dive->buddy);
|
||||||
|
break;
|
||||||
case LOCATION:
|
case LOCATION:
|
||||||
retVal = QString(get_dive_location(dive));
|
retVal = QString(get_dive_location(dive));
|
||||||
break;
|
break;
|
||||||
|
@ -203,6 +207,9 @@ QVariant DiveItem::data(int column, int role) const
|
||||||
case COUNTRY:
|
case COUNTRY:
|
||||||
retVal = QString(get_dive_country(dive));
|
retVal = QString(get_dive_country(dive));
|
||||||
break;
|
break;
|
||||||
|
case BUDDIES:
|
||||||
|
retVal = QString(dive->buddy);
|
||||||
|
break;
|
||||||
case LOCATION:
|
case LOCATION:
|
||||||
retVal = QString(get_dive_location(dive));
|
retVal = QString(get_dive_location(dive));
|
||||||
break;
|
break;
|
||||||
|
@ -286,6 +293,9 @@ QVariant DiveItem::data(int column, int role) const
|
||||||
case COUNTRY:
|
case COUNTRY:
|
||||||
retVal = tr("Country");
|
retVal = tr("Country");
|
||||||
break;
|
break;
|
||||||
|
case BUDDIES:
|
||||||
|
retVal = tr("Buddy");
|
||||||
|
break;
|
||||||
case LOCATION:
|
case LOCATION:
|
||||||
retVal = tr("Location");
|
retVal = tr("Location");
|
||||||
break;
|
break;
|
||||||
|
@ -522,6 +532,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
case COUNTRY:
|
case COUNTRY:
|
||||||
ret = tr("Country");
|
ret = tr("Country");
|
||||||
break;
|
break;
|
||||||
|
case BUDDIES:
|
||||||
|
ret = tr("Buddy");
|
||||||
|
break;
|
||||||
case LOCATION:
|
case LOCATION:
|
||||||
ret = tr("Location");
|
ret = tr("Location");
|
||||||
break;
|
break;
|
||||||
|
@ -576,6 +589,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
case PHOTOS:
|
case PHOTOS:
|
||||||
ret = tr("Media before/during/after dive");
|
ret = tr("Media before/during/after dive");
|
||||||
break;
|
break;
|
||||||
|
case BUDDIES:
|
||||||
|
ret = tr("Buddy");
|
||||||
|
break;
|
||||||
case LOCATION:
|
case LOCATION:
|
||||||
ret = tr("Location");
|
ret = tr("Location");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
MAXCNS,
|
MAXCNS,
|
||||||
TAGS,
|
TAGS,
|
||||||
PHOTOS,
|
PHOTOS,
|
||||||
|
BUDDIES,
|
||||||
COUNTRY,
|
COUNTRY,
|
||||||
LOCATION,
|
LOCATION,
|
||||||
COLUMNS
|
COLUMNS
|
||||||
|
@ -75,6 +76,7 @@ public:
|
||||||
MAXCNS,
|
MAXCNS,
|
||||||
TAGS,
|
TAGS,
|
||||||
PHOTOS,
|
PHOTOS,
|
||||||
|
BUDDIES,
|
||||||
COUNTRY,
|
COUNTRY,
|
||||||
LOCATION,
|
LOCATION,
|
||||||
COLUMNS
|
COLUMNS
|
||||||
|
|
Loading…
Add table
Reference in a new issue