aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.h
AgeCommit message (Collapse)Author
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>
2013-05-01Hook up adding a weightsystemGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-13Add Qtr_ macros that uses gettext in a tr() compatible mannerGravatar Dirk Hohndel
This should wrap gettext nicely and replace the "_()" macros we use in C code. Also added comments to the top of all the new files. Suggested-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-13Started the real code on the Qt Interface.Gravatar Tomaz Canabrava
1 - Open File already open files, it tries to not break the Gtk version, but some methods on the GTK version still need to be called inside Qt because the code is too tight-coupled. 2 - Close file already close files, same comments for the open file dialog applies here. 3 - The code for adding new cylinders in the cylinder dialog is done, already works and it's integrated with the system. There's a need to implement the edit and delete now, but it will be easyer since I'm starting to not get lost on the code. 4 - Some functions that were used to convert unities have been moved to convert.h ( can be changed later, put there because it's easyer to find something that converts in a convert.h =p ) because they were static functions that operated in the GTK version but I need those functions in the Qt version too. [Dirk Hohndel: lots and lots of whitespace and coding style changes] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07Start creating the Qt UIGravatar Tomaz Canabrava
This is based on several commits from Tomaz - mingled together and mildly extended by Dirk (mostly Makefile hacking). All Qt UI related stuff should eventually move into the qt-ui directory. So the Makefile rules for moc and uic have been adjusted accordingly. The MainWindow class has been moved into its own file in qt-ui (but just with a placeholder, the existing class has simply been ifdef'ed out in qt-gui.cpp for the moment). We still have a couple of Qt things in qt-gui.cpp in the main directory... all this needs to move into the qt-ui directory and be built with separate .h files. Right now we have the one-off Makefile rule to create the qt-gui.moc file from the qt-gui.cpp file. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>