aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2015-07-20Printing: show colors in edit tabGravatar Gehad elrobey
- Add default color struct - Init the color struct with default colors - Show color text in labels - Preview colors Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add colors tab to edit windowGravatar Gehad elrobey
Select custom colors for print templates, by default there are five colors that can be used dynamically in prints. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: update preview on field changesGravatar Gehad elrobey
- Trigger re-rendering on the QPixmap if fields changed. - Change template selection to custom if template text changed. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: update preview on apply settingsGravatar Gehad elrobey
On update call Printer to render on the QPixmap. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add apply button to TemplateEdit classGravatar Gehad elrobey
Add apply button to the dialog, Update the preview after applying the new settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: save only if data is changed in template_optionsGravatar Gehad elrobey
Check if data is changed before saving the new settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add preview to TemplateEdit dialogGravatar Gehad elrobey
Show QPixmap in QLabel, Use Printer class to render the Preview on the QPixmap. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: check for different printing modesGravatar Gehad elrobey
Add PRINT/PREVIEW print modes, check for printing modes before casting. We must pass a QPaintDevice with type QPixmap for previewing and with type QPrinter for actual printing. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: show confirmation message before overwriting the templateGravatar Gehad elrobey
Before overwriting the new template show confirmation message. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-18Don't hide location completion when user types spaceGravatar Dirk Hohndel
Odd that I never noticed this until several people pointed it out to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18Add nr of dives at the site to completion stringGravatar Dirk Hohndel
I'm not convinced that this is useful enough to keep, but let's give it a try and see what people think. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18Location completion: remove space between '~' and distanceGravatar Dirk Hohndel
Just a minor visual improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17Make sure we don't pass the wrong infoGravatar Tomaz Canabrava
We were returning false here which meant that we were overriding the information with the wrong value later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17Remove buggy codeGravatar Tomaz Canabrava
This code is already implemented as a signal-connection on the maintab.cpp / globe.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Fix mouse interaction with the Location ListGravatar Tomaz Canabrava
paint methods should be used only to paint, not to trigger other widget behaviours ( we could got ourselves into a bad recursion bug from that ). Also, enabled mouse tracking to correctly track the mouse movement inside the widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Show only 1 possibility if string is uniqueGravatar Tomaz Canabrava
We should only show one possibility if the dive_site name string is unique - we don't have that dive_site yet - so we pass to the Completer filter a Dummy string that will surelly not be a dive site - konami code. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Location edit: correctly position globe if create dive options are activeGravatar Dirk Hohndel
This way when the user looks through the list of completion options the globe behaves in a consistent way, i.e., if the current dive site has a GPS fix and the user activates one of the two options to create a dive site with that GPS information, the globe show the right area (and the globe zooms out if the current dive site doesn't have a GPS fix). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Change API signature to act on dive_site, not uuidGravatar Dirk Hohndel
This way in the future we can pass in a pointer to a dive site that isn't linked in our dive site list yet (i.e., while we are editing). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Dive site edit: add second "create" line without completionGravatar Dirk Hohndel
We now have TWO special entries. One with just what the user has typed and one with the first completion of that text. This way both Henrik and Linus can get what they want. I'm not sure I love this, but it's easy to revert if the consensus is that this is too confusing. But it's much easier to discuss this if people can actually play with it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16KMessageWidget: hide messages regardless whether it's visibleGravatar Dirk Hohndel
Even if the message isn't visible hide it, don't just return. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Dive edit: handle dive sites more sanely while editingGravatar Dirk Hohndel
While we edit things, displayed_dive_site is the authoratative source of data that should be displayed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Don't reset editMode when refreshing the displayGravatar Dirk Hohndel
Just because we want to update the latest information on the Notes tab doesn't mean we are done editing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Just call the member functionGravatar Dirk Hohndel
This code was embarrassingly indirect. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Dive site handling: make sure the data in displayed_dive is updatedGravatar Dirk Hohndel
After an edit when the dive is redisplayed we are not copying the data from current dive back over displayed dive (as the reasonable assumption is that we just edited the displayed dive and copied the information into the current dive)- so make sure that after the dive site handling the displayed dive does in fact have the correct dive site information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15Dive site handling: special case for auto generated divesGravatar Dirk Hohndel
When we download GPS data from the webservice we can end up with dive sites that are simply a place holder for the the GPS fix. If we replace the name of one of those sites we should just delete the site (assuming it isn't used in another dive, which is unlikely but theoretically possible). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15Dive site handling: correctly handle the different scenariosGravatar Dirk Hohndel
- do not create dive sites unless the user has accepted the changes - all modification are tracked in the displayed_dive_site - when the user accepts the changes, the real dive site list (and the selected dives) are updated according to what is in the displayed_dive_site This adds quite verbose debugging messages and disables a section of code that has a special case for data created by the Subsurface web service. This code needs some re-thinking and should eventually go away. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15Better text for dive site completionsGravatar Dirk Hohndel
Also make the explanation text slightly smaller. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Merge branch 'tomaz'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Fix selecting the first indexGravatar Tomaz Canabrava
The way a QCompleter works is that it grabs whatever data it has in the completerRole and sets it back on the line edit. I Bypassed the QCompleter delegate to show something other than the completerRole (so, for instance, if you write 'B', you could get 'Blue Hole' as the returned text, but in fact the QCompleter has the 'B' as internal string (because of the weird - and wrong way in which we are dealing with completion - trying to complete for something that's not inside the model yet). So I hooked up a signal that will listen to the complete's index, and if it's the first row() it's surely the special case - then we bypass QCompleter return string and use our own. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Offer an option to just complete the textGravatar Tomaz Canabrava
Make the kids fight no more. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Remove quick edit dive site widgetGravatar Tomaz Canabrava
Voted down by common consent. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Location completer: show candidate sites on the globeGravatar Dirk Hohndel
As the user scrolls through the possible completions, show them on the globe as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Location completer: show taxonomy according to preferencesGravatar Dirk Hohndel
The user has picked their preferences of which taxonomy data they want to see. Show them what they asked for. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Location completer: give distance if knownGravatar Dirk Hohndel
If both the displayed dive and the dive site which is shown as a potential completion have a GPS fix, indicate the distance. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Change Location Management to make Linus HappyGravatar Tomaz Canabrava
Do not overwrite a dive site if the name is the same as any other dive site, create a new one and duplicate the information. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Move code that handles location to a sane placeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Select right divesite on clickGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Get the selected dive site from the listGravatar Tomaz Canabrava
Hooked up an eventFilter on the QListView that displays our dive sites so it would filter the keys enter and space, storing the current dive_site uuid when that happens. Also it stores the uuid on clicks. Now we need to get that information when processing acceptedChanges() and check if the uuid stored there == displayed_dive_site.uuid and also if text != displayed_dive_site.name, because if the user didn't click on anything but only wrote stuff on the LineEdit no dive site would be selected and so uuid == displayed_dive_site.uuid (wich would mean 'no changes') Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Wait until the BT scanning process is done on Android platformsGravatar Claudiu Olteanu
Block the Save button on Android platforms until the scanning for remote Bluetooth devices is finished. The reason we do that is because there is a bug on the Android platform or on the QtBluetooth library which stops the downloading process and blocks the devices on the Download mode. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12Divinglog import: add .sql extension for importGravatar Miika Turkia
Generic divelog might come with the .sql extension, thus adding that to the file filter. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12Globe: Remove workarounds for ancient Marble versionsGravatar Dirk Hohndel
We build against our own Marble, anyway. So this isn't needed anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-10Don't show the update messages in the mobile appGravatar Dirk Hohndel
Android provides update notifications already. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-09Teach divemode editing about multiple dc'sGravatar Anton Lundin
This teaches the edit divemode about the fact that we can have multiple dc's with different divemodes. The previous code always just edited the first dc. This was reported by Ian Pitt in: https://groups.google.com/forum/#!category-topic/subsurface-divelog/4Zf47KS4Ifk Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Globe: another attempt to fix the globe zoomGravatar Dirk Hohndel
The fact that Marble doesn't tell us when it's done flying to the next point is making this excessively complicated to get right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Use current dive site to get the informationGravatar Tomaz Canabrava
and not the displayed_dive_site. tsc. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Planner: redo the spacing of the prefsGravatar Joakim Bygdell
Divide the space eaqually to all three settings panels. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Correctly paint the statesGravatar Tomaz Canabrava
The state handling is a pain to do manually, but I can't really use the style painter because if I do that it would paint the string of the model (and that's something I don't wanna do) so I clear the text, draw the control, then I paint the stuff that I really need. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Use taxonomy or coords on the delegateGravatar Tomaz Canabrava
The Taxonomy text should be used if there's a taxonomy for the dive site. If there isn't, then use coords. If there's none, then nothing will appear on the bottom of the dive site name. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Better spacing on the delegateGravatar Tomaz Canabrava
Makes the location delegate pleasant to the eye. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08Show the correct delegate on the completerGravatar Tomaz Canabrava
For some reason the completer wouldn't show the delegate if the line order of the code was different. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>