aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.h
AgeCommit message (Collapse)Author
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-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-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Migrate MainTab models(QStringListModel)Gravatar Boris Barbulovski
Migrate MainTab models from static xxxCompletioModel::instance() to private MainTab variable members. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Expand tags approach to divemaster fieldGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Extend tags model to Buddy fieldGravatar Sergey Starosek
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>
2013-12-28Remove nonexisting member from headerGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Make sure the save/cancel message is always shownGravatar Henrik Brautaset Aronsen
An addition to the "Move dive notes edit message above the scrollable widget" commit: Make sure the save/cancel message is always displayed on top, regardless of which tab is selected. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-28Make it possible to hide some columns on the Cylinders Equipment pane.Gravatar Tomaz Canabrava
This patch makes it possible to hide some columns on the Cylinders Equipment pane. The 'remove' and 'type' are impossible to hide, since they are the most important ones for a non-tech diver. Fixes #281 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Trigger redraw of the Dive Info pane on preferences changeGravatar Dirk Hohndel
If we change the units we need to redraw the info on this pane. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Handle double clicks on globe during dive edit modeGravatar Dirk Hohndel
When we are editing or adding a dive, the globe widget needs to act differently. Instead of directly changing the lat/lon of selected dives, it needs populate the coordinate text field as if this information was entered by the user (effectively all it is is a way to more conveniently enter coordinates). As a side effect, this also allows us to change the location once it has been added (you just need to go into dive edit mode to do so). There is one weird issue that occasionally (and I can't quite reproduce this) I get lat/lon very close to 0/0 (as if the globe widget was centered on 0/0 and not on whatever it is actually showing). That still needs to be addressed. Fixes #239 Fixes #131 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Fix some random compiler warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Only auto-complete gps information when empty.Gravatar Michael Andreen
Previously gps information was always overwritten, unless the user had modified it in the current editing session. This causes problem with some use cases, like when coordinates are provided before the location name by the companion app. Now gps information is only overwritten when it is: - Empty - Auto-completed in the current editing session. (When the user hits accept it is considered hand-edited.) Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-11Stop clicks on the globe from changing dive list selection while editingGravatar Dirk Hohndel
This caused us to get royally confused when manually adding a dive and trying to set the location through the marble widget. Fixes # 229 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-08Be consistent when passing around gas data in the plannerGravatar Dirk Hohndel
We need to make sure that the correct segment has the correct gas assigned to it - and that those gases are correctly tracked when editing a manually added dive as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-02Added a custom widget for tagging divesGravatar Maximilian Güntner
A custom tag widget has been added to MainTab. Tags are seperated by a comma ",". The implementation supports escaping a comma by using "\,". While typing, the widget supports the user by suggesting tags using a QCompleter. Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-01Enable undo for the Edit mode on Added Dives.Gravatar Tomaz Canabrava
This enables undo for the edit mode on added dives, it uses the premade backup to fill the old dive with data. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01Enable editing a dive that was manually entered.Gravatar Tomaz Canabrava
This patch enables editing a dive that was manually entered, it doesn't cover dive plans yet because on the plan I need to figure out what are the 'user-entered' points, and what are the algorithm point. and I feel lazy. =p One last thing that's missing is to revert the dive to the previous condition if the user cancels the edition, currently canceling and applying ok is the same thing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-10-07Remove info.c/info.hGravatar Dirk Hohndel
The one remaining helper function in there was moved to maintab.cpp (which was the one remaining user). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Correct spelling of "weight" throughout the code.Gravatar Benjamin
"Weight" was misspelled "weigth" in several places in the code and comments. Signed-off-by: Benjamin Fogel <nystire@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-25Code cleanup - create a method for cleaning the Palette.Gravatar Tomaz Canabrava
Code cleanup, create a method for cleaning the palette, less code is better in this case. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Revert to the old values of Cylinders and Weigthsystems on cancelGravatar Tomaz Canabrava
This patch enables canceling the edition of cylinders and weigth systems, as soon as the user press cancel, the old values are re-populated on all selected entries. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Created a placeholder for the Equipment Edition.Gravatar Tomaz Canabrava
This creates a placeholder for the equipment edition, it will ease the 'revert' and 'apply' when editing multi dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-21Allow editing of date & time and air & water temperaturesGravatar Dirk Hohndel
Add two more rows to the widget - this is getting quite busy. There still is some weirdness where the focus isn't returned where it should be and a few other details, but overall getting there. Added helper functions to parse a temperature and to deal with the timezone offset - with that latter one I also fixed the time offset bug in the planner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Hook up adding a diveGravatar Dirk Hohndel
This gets things mostly right. It creates a dive and uses the planner widget to create samples which are copied into the dive. It fills in some reasonable defaults (DC model, timestamp), but doesn't allow editing the timestamp (or the temperatures and air pressure). On accept the planner gets reset and the dive appears correctly in the dive list. Cancel still needs to be handled. And I bet there are many subtle bugs lurking here and there. But it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Good deal of Code Cleanup for the maintabGravatar Tomaz Canabrava
Some cleanup was needed in the MainTab code for ages, now the Edition / Cancel / Ok of the Notes tab is way more intuitive on the code level. This is needed to support multidive edition on the Cylinders and Weigths too, since it's a bit more complicated, I didn't want to start with a Spaguetti Code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-17Improved handling of latitude and longitude.Gravatar Michael Andreen
Coordinates are copied when auto-completing location, they are also displayed and editable in maintab. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-16Merge branch 'multiDiveEdition' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Conflicts: qt-ui/maintab.h
2013-09-02Code Cleanup: Merged the three TableViews shared codeGravatar Tomaz Canabrava
Merged the shared code for the three table views into one code, this way less code is needed if we need to construct another tableview in the future. I still need to clean some of the models too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-16Enable Multi Dive Editing.Gravatar Tomaz Canabrava
This patch enables multi dive editing on the selected dives. It's a bit of big patch where I reworked how it worked since it was written just for a single dive. this means that this can introduce bugs - I'v tested it quite a bit but a thing could slip thru my fingers. :) How this is supposed to work: Select a few dives that you want ( one or more ) then click on the field that you wanna edit / multi edit, and press 'accept'. *only* the edited field will be modified thru all dives. Next patch - I'll change the bg color of the edited fields.A Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Added completion for buddy, divemaster, location and suit.Gravatar Tomaz Canabrava
Added completion for buddy, divemaster, location and suit. The completions uses some models that I created in the last commit - everytime that a divelog file is loaded, it creates a list of completion items. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Makes the 'auto' edition behave in a better way.Gravatar Tomaz Canabrava
This patch makes the auto editon behave in a better way, now you can scroll the notes widget without marking it as editable, and also adds a bit of code cleanup, and a better logic for editing the other widgets. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-17Adds Single-Click editions on the TableViewGravatar Tomaz Canabrava
This is a linus request, adds a Single-click edition on the tableview to make it more consistent with the rest of the interface where edition is permitted. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-27Better positioning of the plus sign icons in the Equip. tabGravatar Lubomir I. Ivanov
There are a couple of problems with said icons: - When the Equip. tab is first seen, no relative event is monitored so that the correct position is updated and the icons are positioned. To solve that we connect the signal MainTab::currentChanged(int) and call MainTab::equipmentPlusUpdate(). - When the info-profile QSplitter resizes with a snap towards/from the edges of the main window, no resize handler is called such as MainTab::resizeEvent(). A solution is to monitor the resize of the info-profile splitter with MainWindow::on_infoProfileSplitter_splitterMoved() and again call MainTab::equipmentPlusUpdate() Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Consistently use slots / signalsGravatar Dirk Hohndel
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind. Let's make this consistent again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-16Save / Restore the sizes of the columns in Cylinders / Weigth widgetsGravatar Tomaz Canabrava
This patch saves / restores the sizes of the columns in the cylinders and weigth table widgets, so everything is now properly behaved. There 's still other things to do - but I'm tired. i's sunday and there's a protest against the brazilian government to go. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-14Show & edit trip location and notes when exactly one trip is selectedGravatar Dirk Hohndel
While we still show the selected_dive in the profile and use it for Dive Info and Equipment, in the Dive Notes tab we now show the trip location and trip notes (and none of the other fields), if the user directly selects a whole trip by clicking on the trip header. This clever reuse of the widget now allows trip location and notes to be edited in place. As a side note: the Gtk version has long allowed the user to edit the trip location and trip notes, but nowhere did it ever SHOW the trip notes... so this is more than just feature parity... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-23Remove obsolete slotsGravatar Dirk Hohndel
The .ui components were removed in commit 0c7a575f7b3b ("Rework on the Equipment tab to make it look more Modern.") but the "automagic" slots were still here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22The never ending, futile fight for whitespace consistencyGravatar Dirk Hohndel
I just need to write a tool that does this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Re Enable the option to add cylinders / weigthsystems.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Rework on the Equipment tab to make it look more Modern.Gravatar Tomaz Canabrava
Note that this is a WIP and it does break functionality - ie, not possible to add Equipments, but this will be fixed in the next commit. Removed add / edit / remove buttons, only a single '+' icon appears on the widget now. the edit / delete will be done in place. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20Integrate visibility Star widget into editing flowGravatar Dirk Hohndel
This also removes some incorrect code from the clear() function for the DiveInfo tab. Putting the readOnly() calls for the DiveNotes tab there was wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Rename buttons for dive editGravatar Dirk Hohndel
The old names made sense in the initial model (where you'd click on the edit button to start an edit). The new names seem much more natural given what we do now. Also a tiny code cleanup removing a redundant if statement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Make direct edit the style of choiceGravatar Dirk Hohndel
Plus minor coding style fixes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Improve the Dirk edit mode.Gravatar Tomaz Canabrava
The dirk edit mode will be triggered as soon as the user clicks on the field that he wants to edit. then he can edit all fields, till he press ok / reset. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-18Added option to edit the selected dive.Gravatar Tomaz Canabrava
Added option to edit the selected dive. Now the user can click on 'Edit', and a nice box will appear stating that the dive is in edit mode, and the user can edit all of the 'Notes' tab fields, including the rating. When the edition is finished, the user needs to click on 'edit' again to mark as accepted, or in reset to reset the fields to it's original state Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Added the code to populate the tabs when a dive is selected.Gravatar Tomaz Canabrava
So, this is what happens now: Every tab should be populated from updateDiveInfo method, it will be called whenever a new dive is selected I'm already populating the 'notes' box to show how it can be done. If you are unsure what's the name of anything, open the file maintab.ui on the designer, click on the item and check its objectName, the access is ui->objectName from here on. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>