mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Preferences UI: final cleanup
This commit does some final cleaning up to the code, mostly deleting white space and comments. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
42a85dfa7e
commit
6212bb6721
18 changed files with 40 additions and 37 deletions
|
@ -10,7 +10,6 @@ qPrefDiveComputer *qPrefDiveComputer::instance()
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
void qPrefDiveComputer::loadSync(bool doSync)
|
||||
{
|
||||
// last computer used
|
||||
|
@ -30,7 +29,6 @@ void qPrefDiveComputer::loadSync(bool doSync)
|
|||
DISK_DC(2)
|
||||
DISK_DC(3)
|
||||
DISK_DC(4)
|
||||
|
||||
}
|
||||
|
||||
// these are the 'active' settings
|
||||
|
|
|
@ -14,7 +14,6 @@ void qPrefEquipment::loadSync(bool doSync)
|
|||
{
|
||||
disk_default_cylinder(doSync);
|
||||
disk_display_unused_tanks(doSync);
|
||||
|
||||
}
|
||||
|
||||
HANDLE_PREFERENCE_TXT(Equipment, "default_cylinder", default_cylinder);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include "qPrefGeneral.h"
|
||||
#include "qPrefPrivate.h"
|
||||
|
||||
|
||||
static const QString group = QStringLiteral("GeneralSettings");
|
||||
|
||||
QString qPrefGeneral::st_diveshareExport_uid;
|
||||
|
@ -17,7 +16,6 @@ qPrefGeneral *qPrefGeneral::instance()
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
void qPrefGeneral::loadSync(bool doSync)
|
||||
{
|
||||
disk_defaultsetpoint(doSync);
|
||||
|
|
|
@ -17,7 +17,6 @@ void qPrefGeocoding::loadSync(bool doSync)
|
|||
disk_third_taxonomy_category(doSync);
|
||||
}
|
||||
|
||||
|
||||
void qPrefGeocoding::set_first_taxonomy_category(taxonomy_category value)
|
||||
{
|
||||
if (value != prefs.geocoding.category[0]) {
|
||||
|
@ -34,7 +33,6 @@ void qPrefGeocoding::disk_first_taxonomy_category(bool doSync)
|
|||
prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::propValue(keyFromGroupAndName(group, "cat0"), default_prefs.geocoding.category[0]).toInt();
|
||||
}
|
||||
|
||||
|
||||
void qPrefGeocoding::set_second_taxonomy_category(taxonomy_category value)
|
||||
{
|
||||
if (value != prefs.geocoding.category[1]) {
|
||||
|
@ -43,6 +41,7 @@ void qPrefGeocoding::set_second_taxonomy_category(taxonomy_category value)
|
|||
emit instance()->second_taxonomy_categoryChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
void qPrefGeocoding::disk_second_taxonomy_category(bool doSync)
|
||||
{
|
||||
if (doSync)
|
||||
|
@ -60,6 +59,7 @@ void qPrefGeocoding::set_third_taxonomy_category(taxonomy_category value)
|
|||
emit instance()->third_taxonomy_categoryChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
void qPrefGeocoding::disk_third_taxonomy_category(bool doSync)
|
||||
{
|
||||
if (doSync)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class qPrefGeocoding : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(taxonomy_category first_taxonomy_category READ first_taxonomy_category WRITE set_first_taxonomy_category NOTIFY first_taxonomy_categoryChanged)
|
||||
|
|
|
@ -19,8 +19,6 @@ void qPrefLog::loadSync(bool doSync)
|
|||
disk_show_average_depth(doSync);
|
||||
}
|
||||
|
||||
HANDLE_PREFERENCE_TXT(Log, "default_filename", default_filename);
|
||||
|
||||
void qPrefLog::set_default_file_behavior(enum def_file_behavior value)
|
||||
{
|
||||
if (value != prefs.default_file_behavior ||
|
||||
|
@ -50,6 +48,7 @@ void qPrefLog::disk_default_file_behavior(bool doSync)
|
|||
}
|
||||
}
|
||||
|
||||
HANDLE_PREFERENCE_TXT(Log, "default_filename", default_filename);
|
||||
|
||||
HANDLE_PREFERENCE_BOOL(Log, "extraEnvironmentalDefault", extraEnvironmentalDefault);
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ void qPrefMedia::loadSync(bool doSync)
|
|||
disk_ffmpeg_executable(doSync);
|
||||
disk_auto_recalculate_thumbnails(doSync);
|
||||
disk_auto_recalculate_thumbnails(doSync);
|
||||
|
||||
}
|
||||
|
||||
HANDLE_PREFERENCE_BOOL(Media, "auto_recalculate_thumbnails", auto_recalculate_thumbnails);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class qPrefTechnicalDetails : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE set_calcalltissues NOTIFY calcalltissuesChanged)
|
||||
|
|
|
@ -30,7 +30,6 @@ void PreferencesDc::on_resetRememberedDCs_clicked()
|
|||
qPrefDiveComputer::set_vendor4(QString());
|
||||
}
|
||||
|
||||
|
||||
void PreferencesDc::refreshSettings()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -22,12 +22,6 @@ PreferencesDefaults::~PreferencesDefaults()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
/*void PreferencesDefaults::on_resetSettings_clicked()
|
||||
{
|
||||
auto dialog = PreferencesDialog::instance();
|
||||
dialog->defaultsRequested();
|
||||
} */
|
||||
|
||||
void PreferencesDefaults::refreshSettings()
|
||||
{
|
||||
ui->font->setCurrentFont(qPrefDisplay::divelist_font());
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include <QMessageBox>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "qt-models/models.h"
|
||||
|
||||
PreferencesEquipment::PreferencesEquipment() : AbstractPreferencesWidget(tr("Equipment"), QIcon(":preferences-equipment-icon"), 5)
|
||||
{
|
||||
ui = new Ui::PreferencesEquipment();
|
||||
|
|
|
@ -14,11 +14,34 @@
|
|||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
||||
<item>
|
||||
<widget class="QLabel" name="label_georef1">
|
||||
<property name="toolTip">
|
||||
<string extracomment="Help info 1"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reverse dive site lookup format</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QLabel" name="label_georef2">
|
||||
<property name="toolTip">
|
||||
<string extracomment="Help info 1"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Selecting the blue globe icon to the right of Location in the Notes tab opens the Edit Dive Site panel. There, an icon to the right of the dive site coordinates allows reverse lookup of the dive site. This finds the country and closest town to the divesite and adds them as dive site tags above the dive site name in the Notes tab. The combo boxes below allow one to select the order in which these tags are shown in the Notes tab. This requires an Internet connection.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_12">
|
||||
<property name="title">
|
||||
<string>Dive site layout</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QComboBox" name="first_item">
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "ui_preferences_media.h"
|
||||
#include "core/settings/qPrefMedia.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "qt-models/models.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
|
@ -10,13 +11,10 @@
|
|||
#include <QFileDialog>
|
||||
#include <QProcess>
|
||||
|
||||
#include "qt-models/models.h"
|
||||
|
||||
PreferencesMedia::PreferencesMedia() : AbstractPreferencesWidget(tr("Media"), QIcon(":preferences-media-icon"), 6)
|
||||
{
|
||||
ui = new Ui::PreferencesMedia();
|
||||
ui->setupUi(this);
|
||||
|
||||
}
|
||||
|
||||
PreferencesMedia::~PreferencesMedia()
|
||||
|
@ -75,7 +73,6 @@ void PreferencesMedia::refreshSettings()
|
|||
ui->ffmpegExecutable->setText(qPrefMedia::ffmpeg_executable());
|
||||
|
||||
ui->auto_recalculate_thumbnails->setChecked(prefs.auto_recalculate_thumbnails);
|
||||
|
||||
}
|
||||
|
||||
void PreferencesMedia::syncSettings()
|
||||
|
@ -85,5 +82,4 @@ void PreferencesMedia::syncSettings()
|
|||
media->set_extract_video_thumbnails_position(ui->videoThumbnailPosition->value());
|
||||
media->set_ffmpeg_executable(ui->ffmpegExecutable->text());
|
||||
qPrefMedia::set_auto_recalculate_thumbnails(ui->auto_recalculate_thumbnails->isChecked());
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Photographs or videos are sometimes edited. If a photo is more recent than its thumbnail, checking the checkbox below will allow creating a new thumbnail after the media has been edited.</string>
|
||||
<string>Photographs or videos are sometimes edited after being uploaded and linked to Subsurface. If a photo is therefore more recent than its original thumbnail, checking the checkbox below will allow creating a new thumbnail after the media has been edited.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "preferences_reset.h"
|
||||
#include "ui_preferences_reset.h"
|
||||
#include "core/dive.h"
|
||||
#include "preferencesdialog.h"
|
||||
|
||||
PreferencesReset::PreferencesReset(): AbstractPreferencesWidget(tr("Reset"), QIcon(":preferences-reset-icon"), 11 ), ui(new Ui::PreferencesReset())
|
||||
|
|
|
@ -22,8 +22,8 @@ public slots:
|
|||
|
||||
private:
|
||||
Ui::PreferencesReset *ui;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
|
||||
|
||||
|
||||
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
|
||||
|
@ -39,7 +36,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Selecting this button will reset all settings to their default values</string>
|
||||
<string>Selecting this button will reset all preferences to their default values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -50,7 +47,7 @@
|
|||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="resetSettings">
|
||||
<property name="text">
|
||||
<string>Reset all settings</string>
|
||||
<string>Reset all preferences</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -101,6 +101,9 @@ SOURCES += ../../subsurface-mobile-main.cpp \
|
|||
../../core/settings/qPrefProxy.cpp \
|
||||
../../core/settings/qPrefTechnicalDetails.cpp \
|
||||
../../core/settings/qPrefUnit.cpp \
|
||||
../../core/settings/qPrefEquipment.cpp \
|
||||
../../core/settings/qPrefLog.cpp \
|
||||
../../core/settings/qPrefMedia.cpp \
|
||||
../../core/settings/qPrefUpdateManager.cpp \
|
||||
../../core/subsurface-qt/CylinderObjectHelper.cpp \
|
||||
../../core/subsurface-qt/DiveObjectHelper.cpp \
|
||||
|
@ -226,6 +229,9 @@ HEADERS += \
|
|||
../../core/settings/qPrefProxy.h \
|
||||
../../core/settings/qPrefTechnicalDetails.h \
|
||||
../../core/settings/qPrefUnit.h \
|
||||
../../core/settings/qPrefEquipment.h \
|
||||
../../core/settings/qPrefLog.h \
|
||||
../../core/settings/qPrefMedia.h \
|
||||
../../core/settings/qPrefUpdateManager.h \
|
||||
../../core/subsurface-qt/CylinderObjectHelper.h \
|
||||
../../core/subsurface-qt/DiveObjectHelper.h \
|
||||
|
|
Loading…
Reference in a new issue