aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
AgeCommit message (Collapse)Author
2013-05-31Use a slightly shorter date string for Info tabGravatar Dirk Hohndel
This way the spacing of the elements looks nicer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30Align Labels on center.Gravatar Tomaz Canabrava
There was already a code for that on the maintab.cpp, but since I moved all labels to groupboxes, the code stopped working, and I tougth it'd better to kill the code since it's faster and safer to use the interface builder for that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-25Try to make the equipment tab more compactGravatar Dirk Hohndel
My attempts to actually set the width of the columns with the SizeHintRole all failed - so I gave up on that and am forcing things to work by making the texts in the header somewhat longer and then resizing to that. Definitely not what I wanted to do - but that plus reducing the font size gives us a much more reasonable / compact look. I really hope that someone else can explain to me how to get the SizeHintRole to affect the width (and not just the height - that part worked just fine) of a the cells in a column. Then we can replace this hack by a much better solution (that won't fail if the translated strings look different). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-24Improve wording on buttons when editing a diveGravatar Henrik Brautaset Aronsen
Use the more familiar Save/Undo instead of OK/reset Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-23Add weightsystem delegate to enable editing of weightsystemGravatar Dirk Hohndel
This is very much analogous to the way cylinders are implemented. That means that just like with cylinders, if the user enters a new type and hits 'tab' before hitting 'enter', Subsurface will crash. 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-22Start editing Dive Notes when clicking on Rating or VisibilityGravatar Dirk Hohndel
Those widgets respond to MouseButtonPress and not FocusIn. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Removed the unused add cylinder and add weigthsystem dialogs.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Added a Delegate for editing CylindersGravatar Tomaz Canabrava
Now when you edit 'Type', a drop-down list will appear and will enable you to choose from it's contents. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Added a 'trash' icon on the Cylinders and Weigthsystem modelsGravatar Tomaz Canabrava
So, the Cylinders and Weigthsystems got a new Trash icon, and the interface already intercepts the clicks ( on all columns ) and send this to the 'remove' method on boch models. On the model I'm just filtering the indexes that are not 'DELETE' and creating a stub method to be filled later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Only enable the add buttons when there's a dive loadedGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-21Fixed memory leakGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Added support for visualization the Weigthssystems on the Equipment Tab.Gravatar Tomaz Canabrava
This patch adds support showing and for editing weigthsystems in the equipment tab, so, now the two things that are missing are 'edit' and 'delete', wich are quite easy to do. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Added the code to show the cylinders from a dive.Gravatar Tomaz Canabrava
i Added the code to show the cylinders from a dive, this code also already permits additions from the interface, so the user can click 'add' and insert what he wants there. 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-19Display the statisticsGravatar Dirk Hohndel
This would be correct if the current selection code wasn't broken. Right now we only add to our internal notion of what is selected - we never deselect anything. Once that is fixed, thestatistics should be correctly displayed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Try to add a StarWidget for visibilityGravatar Dirk Hohndel
It's not editable. And of course it continues to look like utter crap - even more so now since this is left aligned and everything else is centered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19When no dive is displayed, the DiveNotes field should not be editableGravatar Dirk Hohndel
This also fixes a potential crash if no dives were loaded and the user started editing the fields and clicked OK. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Figure out if the user changed anything when editingGravatar Dirk Hohndel
And mark the divelist changed. 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-19Fix edit behaviorGravatar Dirk Hohndel
Commit 7b00668b400b ("Improve the Dirk edit mode.") had what looks like an "autocomplete" typo. This also stops us from changing the text on the button that in this edit mode is always just the "OK" button. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Merge branch 'chooseEditMode' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-19Continue populating the DiveInfo tabGravatar Dirk Hohndel
Pulled one more helper from statistics-gtk.c (but didn't modify the code there to use it as that code is no longer being compiled). 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-19Made possible to choose the edit style on compile timeGravatar Tomaz Canabrava
This is just a for choosing the default edit style in the future. I prefer the new edit style as the user is sure what the hell is going on ( ie - if he chooses to edit, he is editing, there's a message warning him that he is editing and everything else is blocked till he finishes editing. ) and the GTK version is 'edit whenever I feel like', wich I think is more unsafe but dirk asked me to put an option and let the others choose. e Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-18While editing the left button is renamed to "OK" to accept the changesGravatar Dirk Hohndel
This seemed more logical than keeping it as "edit" and basically having to hit "edit" a second time in order to save a change. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-18Make impossible to change dives while editing one.Gravatar Tomaz Canabrava
This is to prevent loss of data, so if the user is editing something, either cancel the edition or save it, to continue moving around on the Dive List. - Only the dive list is affected, user can still play with the globe and the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.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-14Clean up some typosGravatar Henrik Brautaset Aronsen
Cosmetic commit to clean up some of the annoying typos in qt-ui Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-13Change setText(QString()) to clear()Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-13Fix segfault on mouseOver at the Profile with an invalid dive selected ( trip )Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Tweaks to maintabGravatar Amit Chaudhuri
Align statistics tab labels as per infotab. Amend helper function to show degree symbol for temp measurements. Change order of member initialisation list to match order of decl (ProfileGraphicsView::ProfileGraphicsView) Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Horizontally align labels on info widget page.Gravatar Amit Chaudhuri
Left aligning text values looked wrong. Use Qobject cast to filter labels from any other qobjects around and set alignment. Doing this via Qt Designer would be tedious. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Fix crash on right click dive tripGravatar Amit Chaudhuri
A null pointer dereference occured after right click on a dive trip because updateDiveInfo was called with dive == -1 causing get_dive(int) to return null. Wrap to avoid crash and clear dive info widget text labels. [Dirk Hohndel: this is different from the fix I had committed earlier; I decided to combine the ideas, clean this one up a bit more and this is the result] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Avoid potential crash if no dive is selectedGravatar Dirk Hohndel
I missed to spots where we would unconditionally dereference the dive pointer. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Reported-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Enable the code that was #if 0'ed outGravatar Thiago Macieira
Linking error is fixed. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Start populating the maintab Dive Info widgetGravatar Dirk Hohndel
Establish some useful helpers and use them when updating the values. One of the helpers (from statistics.c) puzzlingly doesn't link - so that's ifdefed out. Also had to re-arrange the settings reading code (it came too late) and to extract the expanding code of the top dive from the settings reading code (as it had no business being there to begin with). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Fill Dive Notes widgetGravatar Dirk Hohndel
Make sure we clear things out if no dive is selected. 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-06Reformat statistics tab in MainTab tab widgetGravatar Amit Chaudhuri
Rename various labels and text into clear pairs and reflect changes into .cpp file. To avoid clashes with names on other tabs use '..All..' to emphasise that this page deals with an aggregate across the selected dives. Re-format the statistics tab. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Reformat dive info page in tab widgetGravatar Amit Chaudhuri
Clean up the formatting. Distinguish between headings and value labels. Tidy up text appearance (remove trailing ':') Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Fix a couple of small problems in add weightsystemGravatar Dirk Hohndel
The constructor letf the currentWeightsytem variable uninitialized. Instead of creating the memory leak by malloc-ing the newWeightsystem in the on_addWeight_clicked() function use a local variable instead and pass its address around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Create Add Weightsystem dialogGravatar Dirk Hohndel
My first attempt to create a Qt dialog and to hook it up with the program. Unsurprisingly this doesn't quite work as expected (i.e., the values I enter aren't populated in the model), but it's a start... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Don't add cylinders and weightsystems past the MAXGravatar Dirk Hohndel
We actually should disable the 'Add' button, I guess. 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-14Merge branch 'fixCppStyleToC' of https://github.com/tcanabrava/subsurface ↵Gravatar Dirk Hohndel
into Qt