mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Switch components for cut/paste dive to dive site logic
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
99ba2f0687
commit
32da12664d
4 changed files with 30 additions and 41 deletions
3
dive.h
3
dive.h
|
@ -349,14 +349,13 @@ extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_
|
||||||
|
|
||||||
/* when selectively copying dive information, which parts should be copied? */
|
/* when selectively copying dive information, which parts should be copied? */
|
||||||
struct dive_components {
|
struct dive_components {
|
||||||
unsigned int location : 1;
|
unsigned int divesite : 1;
|
||||||
unsigned int notes : 1;
|
unsigned int notes : 1;
|
||||||
unsigned int divemaster : 1;
|
unsigned int divemaster : 1;
|
||||||
unsigned int buddy : 1;
|
unsigned int buddy : 1;
|
||||||
unsigned int suit : 1;
|
unsigned int suit : 1;
|
||||||
unsigned int rating : 1;
|
unsigned int rating : 1;
|
||||||
unsigned int visibility : 1;
|
unsigned int visibility : 1;
|
||||||
unsigned int gps : 1;
|
|
||||||
unsigned int tags : 1;
|
unsigned int tags : 1;
|
||||||
unsigned int cylinders : 1;
|
unsigned int cylinders : 1;
|
||||||
unsigned int weights : 1;
|
unsigned int weights : 1;
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>308</width>
|
<width>401</width>
|
||||||
<height>263</height>
|
<height>317</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -41,9 +41,9 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="location">
|
<widget class="QCheckBox" name="divesite">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Location</string>
|
<string>Dive site</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -54,34 +54,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QCheckBox" name="gps">
|
|
||||||
<property name="text">
|
|
||||||
<string>GPS coordinates</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QCheckBox" name="divemaster">
|
|
||||||
<property name="text">
|
|
||||||
<string>Divemaster</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="buddy">
|
|
||||||
<property name="text">
|
|
||||||
<string>Buddy</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QCheckBox" name="rating">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rating</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QCheckBox" name="visibility">
|
<widget class="QCheckBox" name="visibility">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -117,6 +89,27 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="divemaster">
|
||||||
|
<property name="text">
|
||||||
|
<string>Divemaster</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="buddy">
|
||||||
|
<property name="text">
|
||||||
|
<string>Buddy</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="rating">
|
||||||
|
<property name="text">
|
||||||
|
<string>Rating</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1314,7 +1314,6 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what)
|
||||||
// take the data in our copyPasteDive and apply it to selected dives
|
// take the data in our copyPasteDive and apply it to selected dives
|
||||||
enableEdition();
|
enableEdition();
|
||||||
copyPaste = true;
|
copyPaste = true;
|
||||||
SHOW_SELECTIVE(location);
|
|
||||||
SHOW_SELECTIVE(buddy);
|
SHOW_SELECTIVE(buddy);
|
||||||
SHOW_SELECTIVE(divemaster);
|
SHOW_SELECTIVE(divemaster);
|
||||||
SHOW_SELECTIVE(suit);
|
SHOW_SELECTIVE(suit);
|
||||||
|
@ -1329,8 +1328,8 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what)
|
||||||
ui.rating->setCurrentStars(displayed_dive.rating);
|
ui.rating->setCurrentStars(displayed_dive.rating);
|
||||||
if (what.visibility)
|
if (what.visibility)
|
||||||
ui.visibility->setCurrentStars(displayed_dive.visibility);
|
ui.visibility->setCurrentStars(displayed_dive.visibility);
|
||||||
if (what.gps)
|
if (what.divesite)
|
||||||
updateGpsCoordinates();
|
ui.location->setText(get_dive_location(&displayed_dive));
|
||||||
if (what.tags) {
|
if (what.tags) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
|
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
|
||||||
|
|
|
@ -457,8 +457,7 @@ DiveComponentSelection::DiveComponentSelection(QWidget *parent, struct dive *tar
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
what = _what;
|
what = _what;
|
||||||
UI_FROM_COMPONENT(location);
|
UI_FROM_COMPONENT(divesite);
|
||||||
UI_FROM_COMPONENT(gps);
|
|
||||||
UI_FROM_COMPONENT(divemaster);
|
UI_FROM_COMPONENT(divemaster);
|
||||||
UI_FROM_COMPONENT(buddy);
|
UI_FROM_COMPONENT(buddy);
|
||||||
UI_FROM_COMPONENT(rating);
|
UI_FROM_COMPONENT(rating);
|
||||||
|
@ -478,8 +477,7 @@ DiveComponentSelection::DiveComponentSelection(QWidget *parent, struct dive *tar
|
||||||
void DiveComponentSelection::buttonClicked(QAbstractButton *button)
|
void DiveComponentSelection::buttonClicked(QAbstractButton *button)
|
||||||
{
|
{
|
||||||
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
|
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
|
||||||
COMPONENT_FROM_UI(location);
|
COMPONENT_FROM_UI(divesite);
|
||||||
COMPONENT_FROM_UI(gps);
|
|
||||||
COMPONENT_FROM_UI(divemaster);
|
COMPONENT_FROM_UI(divemaster);
|
||||||
COMPONENT_FROM_UI(buddy);
|
COMPONENT_FROM_UI(buddy);
|
||||||
COMPONENT_FROM_UI(rating);
|
COMPONENT_FROM_UI(rating);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue