aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/preferences.cpp
AgeCommit message (Collapse)Author
2014-07-23Animation speed is a value, not a booleanGravatar Tomaz Canabrava
This breaks compatibility with old preferences, but it's a single key and not that very important so I don't think it's a bigger issue I've renamed prefs.animation to prefs.animation_speed to denote that it's a value, and not a state. Also, fixed the places that were treating it as a state (on/off) to treat it like a correct value. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Added a 'use default file' button on preferences.Gravatar Tomaz Canabrava
Added a 'Use default file' button on preferences in a way that doesn't clutters the interface. Fixes #630 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Do not create a backup for Q_FOREACH containerGravatar Tomaz Canabrava
Q_FOREACH will expand and already creates a copy of the contained container, so this is just a waste of cpu cycles and also increases a tiny bit the memory consumption. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10preferences capitalisation consistencyGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28Rename slot to get rid of auto-connect warningGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Make system proxy as defaultGravatar Sergey Starosek
On first start (no settings saved yet) system-wide proxy should be default. Proposed-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Implement proxy settings loading/savingGravatar Sergey Starosek
- proxy settings are stored under [Network] group - default is "No proxy" - duplicate #def GET_TXT replaced with GET_INT_DEF Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26UI setup for "Network settings" pageGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25Add ability to reset the settingsGravatar Dirk Hohndel
This may be a bit crude and it doesn't actually FULLY reset the settings (as for example the column widths will still be maintained), but it's a good start, I think. Fixes #552 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-23Be more consistent in partial pressure namingGravatar Henrik Brautaset Aronsen
Lets just use pO₂ instead of PO2, ppO2, ppO₂, PO₂. They all mean the same, but it's better to be consistent Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Gratuitous whitespace changesGravatar Dirk Hohndel
I keep trying to get to consistenct. Completely hopeless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05Correctly parse boolean preferencesGravatar Dirk Hohndel
QVariant does the right thing, regardless of whether the value is stored as int or as string - so let's just use that instead of manually checking for integers (and failing if the values are stored as "true" and "false"). Fixes #511 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05Fix odd indentationGravatar Dirk Hohndel
I need to fix this in the tool as well... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-25Fixing Hotkeys inconsistency for divecomputer/pref/numbering windowsGravatar Gehad
Fixing the Hotkeys inconsistencies in subsurface, All the popups should react to 'esc' and 'ctrl-w'/'cmd-w' as 'cancel'. also 'ctrl-q'/'cmd-q' should quit subsurface. Fixes #489 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-16Renaming the prefs struct members to be consistent with the QSettings.Gravatar Gehad Elrobey
-Renaming prefs members for consistency. -Changing references of QSettings to the prefs structure instead. -Removing unused functions in pref.h were left over from an old version. -Changing the data-type of bool members to short for consistency with other members. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-14Add option to save userid in data filesGravatar Venkatesh Shukla
The userid of Subsurface Webservice can be included in locally saved xml files and git repository. For xml files, it is stored in userid tag. For git repo, it is stored in 00-Subsurface file present in the repo. Preference dialog and webservice dialog modified to include option for saving userid locally. In case of difference in default userid and userid in local file, some semantics are followed. These can be referred to here: http://lists.hohndel.org/pipermail/subsurface/2014-April/011422.html Fixes #473 Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10Feature to show or hide heart rate graphGravatar Lakshman
Adds new push button "HR" to the button bar on the dive profile to toggle display of heart rate. TODO: New icon for the heart rate button is needed. Fixes #485 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-07Fix incorrect behavior in preference windowGravatar Gehad
When doing some changes in the preference window and clicking "Apply", the 'Close without saving' button is supposed to restore the previous values. However some fields were not restored correctly. - The Animations Slider was never restored to its initial value. (A new member in the pref struct was added - pref.animation) - The 'Font' and 'Font size' were restored correctly to the previous values but their effects weren't restored to the UI and that required to open the prefrences window again and press ok. Fixes #481 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-05Remove check option to show units in text labelGravatar Lakshman
Currently the feature to show temperature units while adding dive is provided through checkbox in preferences->units section. This patch disables this checkbox and always enables this feature. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28Toggle showing average depthGravatar Lakshman
Add additional check box in "preferences->graph" section that allows users to hide average depth on dive profile. By default this option is checked to show average depth. Fixes #475 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11Support save / load for the Animation Speed on the PreferencesGravatar Tomaz Canabrava
User can now fine-tune the animation speed on the preferences, a value of zero disables it completely. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10Show temperature units in the label when editing diveGravatar Lakshman
Currently when user wants to add a new dive information, the ways to know what unit system is being used are - Through preferences panel. - Save the dive information, which displays units in the text field. This patch provides an option to the user to show current unit system by displaying the unit on the side of the label when the user is editing the fields. This feature can be enabled or disabled by using the new checkbox option i.e. `Show units in text labels` included in `preferences->units` section. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Store zoomed plot in preferencesGravatar Tomaz Canabrava
This patch makes the 'Zoomed Plot' a preference that can be stored and retrieved, this way if the user sets the plot to be 'zoomed', this information will persist even if they closed or opened subsurface again. Also, added the 'Scale' button on the new profile, but didn't did the glue code yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-26Fixing default font on preference windowGravatar Danilo Cesar Lemes de Paula
Default font was hardcoded as 14. What happen if you change any other preference value is that the application would start to use fontSize=14. This commit loads the right value in the QDoubleSpinBox Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Replace mainWindow() with MainWindow::instance()Gravatar Boris Barbulovski
C++ style of accessing single instance class object. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Handle cancel in PreferencesDialog::on_chooseFile_clickedGravatar Patrick Majewski
If I click in the Preferences Dialog on the 3 dots to choose a default file to load and cancel the opening FileDialog an empty string is returned and set to the coresponding QLineEdit. The new behavior (and mostly expected) is to update the QLineEdit only if there is a filename returned from QFileDialog. Signed-off-by: Patrick Majewski <dive@patrick-majewski.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Remove the graph options from the PreferencesGravatar Dirk Hohndel
All of these are now set from the toolbar next to the new profile. This removes functionality for people using the old profile, but as we will rip that out and switch to the new profile, soon, that seems an acceptable side effect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Load preferences before they are saved.Gravatar Michael Andreen
Load all the settings in the PreferenceDialog constructor. Previously all the settings were overwritten with default values the first time PreferencesDialog::syncSettings() was called. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Move save of preferences to the preferences dialog.Gravatar Tomaz Canabrava
I had a few very strange bugs regarding to preferences (like clicking on apply twice so things worked), because the code that moved from "QSettings" to 'Internal Settings Struct' was being triggered on the mainwindow, *after* the settingsChanged signal was emmited. This should fix the problem. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Create a toolbox on the left side of the new profileGravatar Tomaz Canabrava
For quick acess of preferences the show / hide stuff from the Settings dialog is now in that toolbox and in the future we can put a few more, like 'Show Notifications Panel' and 'Enable Legend' Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-05Optimizations and fixes on the new profile.Gravatar Tomaz Canabrava
This patch optimizes a few items when hitting the 'save preferences' dialog, since when a preference is modified, all the items try to reload their visual based on wether a preference changed or not, the correct code for 'hey, my pref changed, let's update' needed to be done. now the axis will only set a new maximum if it's different from the old one ( and thus, going to a new dive with the same maxdepth or maxtime as the old one will not touch their axis, not triggering gratuitous animations. ) also, the 'incr by 3m' was not being called - it seems that our 'syncsettings' method is not storing things on the 'prefs' global var. I added just for the incr by 3m case, but it's something that we need to check later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Whitespace and coding style updatesGravatar Dirk Hohndel
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-11Don't show tanks that aren't used during a diveGravatar Dirk Hohndel
Some dive computers will always download all tanks that they store, not just the ones used in a dive. Most people only want to see the tanks that they actually used during the dive (and for the others there's an option to go back to the old behavior, just in case). All this is only in memory / during runtime. If the dive computer provided the extra data we will not throw it away. Fixes #373 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-18Make default font setting actually workGravatar Tomaz Canabrava
We were asking the widget.font() which returned the font that the QFontSelector uses to display it's contents, instead of using currentFont() that's the correctly selected font. duh. :)) Fixes #368 Fixes #375 (for #375 the solution is to select a different font that a) looks better and b) has the missing characters) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-18Whitespace fixGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-12Fix the logic when to display the "language changed" warningGravatar Dirk Hohndel
If the user had never set up the language selection they could end up getting the "language changed, restart required" warning even if they didn't touch the language setting at all. This fixes that issue by assuming that UseSystemLanguage is true if the setting is undefined and only comparing the selected language if that selection actually matters (i.e., UseSystemLanguage is false). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08Rename the radio button to match label kgs->kgGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08Fix units boxes in preference panelGravatar Anton Lundin
The groupBox-es got renamed, and thus the unit-systems radio-buttons was enabling/disabling the wrong buttons. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07Language chooser improvementsGravatar Sergey Starosek
Show language instead of country, sort the list. Show country in brackets to avoid ambiguity for locales like de_DE and de_CH. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Added 'English' and 'Use System Default' options.Gravatar Tomaz Canabrava
These complete the ability to select languages from the preferences panel. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Added a filter option to the Language ChooserGravatar Tomaz Canabrava
This patch adds a filter option to the Language Chooser. if you choose filter, only the filtered options will appear. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Code CleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Settings for Display preferences didn't really set the preferences.Gravatar Tomaz Canabrava
The code that should set the preferences was actually retrieving it, this will correctly set it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Added a language preference to the Settings.Gravatar Tomaz Canabrava
When the user first opens the application the default language is selected; this can be changed to a hardcoded one by going to system preferences and choosing the one you want. Restart required. Fixes #136 [Dirk Hohndel: whitespace fixes, removed qDebug() call, rephrased the message displayed prompting the user to restart.] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04Add some limits to the GF'sGravatar Anton Lundin
Sets the limit for GF's in the preferences panel to 1<=x<=150 and color it read if gf > 100. Remove the % in the diveplanner view that was rejected for the preferences view. The 150 maximum is needed because QSpinBox defaults to maximum 99. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix all leak-at-exit from singletons in SubsurfaceGravatar Thiago Macieira
Subsurface creates a lot of singleton instances on demand, but nothing ever deleted them. Since they are singletons, these memory allocations are technically not leaks. However, they clutter the output in valgrind and other memory analysers, hiding the real issues. The solution is to delete these items at exit. For the models and for gettextFromC, the solution is to use a QScopedPointer, which will delete its payload when it gets destroyed. For the dialogs and other widgets, we can't do that: they need to be deleted before QApplication exits, so we just set the parent in all of them to the main window. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-24Create a drop down to choose default cylinderGravatar Anton Lundin
This also renames the ui element to match. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-23Use the default cylinder if definedGravatar Dirk Hohndel
With this every cylinder downloaded from a divecomputer that doesn't provide cylinder data, and every cylinder manually added anywhere will default to the default cylinder that is set in the preferences. For people who most of the time dive with the same equipment (always on dive boats with AL80, or almost always diving their personal HP119) this should be a nice improvement. If you don't like this behavior, simply leave the default cylinder setting in the preferences empty. This commit also fixes the incorrect s->value call (should be s->setValue). I wonder what this did to the default filename before... Fixes #145 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-23Create a text entry for default cylinder in preferencesGravatar Dirk Hohndel
We don't do anything with this just yet. And frankly, a drop down of the cylinders that we know of would be even better. But hey, it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>