summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
AgeCommit message (Collapse)Author
2015-07-05Correct logicGravatar Robert C. Helling
At least my compiler warns about ! binding stronger than == and thus comparing a bool to an int. I guess this is what was meant. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Notes pane: don't show empty taxonomy tagsGravatar Dirk Hohndel
No point in searching for the right tag if the user picked no taxonomy to be shown. And no point in showing an empty value, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Rename enum values for taxonomyGravatar Dirk Hohndel
This avoids confusion and namespace collisions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Merge branch 'taxonomy'Gravatar Dirk Hohndel
2015-07-02Remove a few more debug messagesGravatar Dirk Hohndel
Yes, I could go back and try to fix the earlier commits. This is easier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Trigger reverse geo lookup by pressing the buttonGravatar Dirk Hohndel
This may not be the best UI, but for now it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Notes pane: don't show taxonomy info for trip locationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Notes pane: move the location taxonomy to a better spotGravatar Dirk Hohndel
And display it smaller, marked as "tags". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Correctly display the data on the delegateGravatar Tomaz Canabrava
A bit more complex than I tought it would be (and a ton of trial and error to find the right spot on the delegate to draw stuff) this delegate follows the current style (so it should be okaish on a dark and on a light theme) This is supposed to work on a QCompleter, but it doesn't (I really don't know why, so maybe I'll remove that completer. sigh.) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Added again a QCompleter to show the possibilitiesGravatar Tomaz Canabrava
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Remove location completion modelGravatar Tomaz Canabrava
This is a functional but hard to expand model for the dive sites. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Geo taxonomy: show the chosen taxonomy entries in the notes paneGravatar Dirk Hohndel
This isn't perfect - I'd like to have them show behind the word Location instead as what we have now creates movement in the position of the fields on the screen which I think is distracting. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27Dive site rewrite: be smarter when dealing with auto created sitesGravatar Dirk Hohndel
If we download dive site locations from the companion app we can be slightly smarter if the user overwrite the location feel on the Notes tab. We can be pretty sure that they wanted to keep the GPS location and just correct the dive site name (or possibly assign that location to an existing dive site). This tries to accomplish that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27Dive site rewrite: mark location field as soon as editing startsGravatar Dirk Hohndel
Don't wait until the user switches focus to a different part of the tab to mark the location field. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: make trip location edit workGravatar Dirk Hohndel
Don't erase the trip information after the user started editing it. Don't act as if a dive was edited - it's trip information we are modifying. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: clearing the location field means no dive siteGravatar Dirk Hohndel
If the user wants to remove the dive site from a dive they need to be able to do that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: fix adding a new dive and chaning notes / descriptionGravatar Tomaz Canabrava
I had to create an event filter to deal with the missing callbacks from QPlainTextEdit (it doesn't support editingFinished()). Also we need to manually create a dive site on a newly added dive if the user entered one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: change the default sizes of the dialogGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: do not use Qt Model MatchGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: fix potential crashGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: copy the changed dive site to the originalGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: create a dive site if string doesn't existGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: mark location as changed when a dive site changesGravatar Tomaz Canabrava
Not sure this is the best approach. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: better member nameGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: try to fix a crashGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: copy the current dive to the displayed diveGravatar Tomaz Canabrava
This way we can actually edit something. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: correctly position the edit site widgetGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: create a dive site edit dialog without bordersGravatar Tomaz Canabrava
Plan is to make it pretty later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: add the taxonomy labels for the dive sitesGravatar Tomaz Canabrava
This doesn't work yet because we don't get the taxonomy from the geo referencing services yet - but it's ready to be populated. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: use a QCompleter to show the list of dive sitesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: location edit on notes tab is again a LineEditGravatar Tomaz Canabrava
Hopefully we now have the UI semantics figured out. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix a number of resource leaksGravatar Dirk Hohndel
Free memory returned from parse_mkvi_value() Free memory returned from printGPSCoords() Free memory allocated in added_list and removed_list Free memory allocated when adding suffix to dive site name Free memory allocated in cache_deco_state() Free memory allocated in build_filename() Free memory allocated in get_utf8() Free memory allocated in alloc_dive() Free memory allocated as cache but never used Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Remove all the no longer necessary code that aborts read of first V2 fileGravatar Dirk Hohndel
This was a poorly implemented hack when we executed the reverse geo lookup in the main thread and opening a V2 file could take a very long time. We need to do the "Welcome" message quite differently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Cloud storage: warn the user if we are not onlineGravatar Dirk Hohndel
This isn't perfect, but at least tells the user if we weren't able to connect and are working just off the local cache. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10When done reverse geocoding, hide the notificationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Fix building with NO_MARBLE issueGravatar Gehad elrobey
We can't build with -DNO_MARBLE after some previous commit broke globe.cpp - centerOnCurrentDive() is still existing in the code while removed from header in 6b81fb49d09. - Some referenced to MainWindow::instance()->globe() even if we are building with no marble. - include stdint.h Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Select the correct dive in EditAddedDive modeGravatar Tomaz Canabrava
If we added two dives, and then tried to edit the first added one, the current 'added dive' set on main_tab would be the second one, so when we got to the accept() part of the call, it would reselect the last added_dive that we had. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Always send the UUID of the coordinates to the globeGravatar Tomaz Canabrava
We were relying in the current_dive to display the globe coordinates correctly - but this is not always the case: you can be inserting a new dive site and it isn't yet inside of the dive until the user presses accept. So always pass the uuid of the dive site that we want to display. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Connect the signalsGravatar Tomaz Canabrava
Connect the signals and slots so we can use the stuff I programmed. Sorry for the noise on the patch - most of this is whitespace fixes done by the QtCreator. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Remove broken methodGravatar Tomaz Canabrava
This method was written a long time ago, now we need to use the new versions of it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Do not trigger a dive site change when setting a diveGravatar Tomaz Canabrava
When setting a dive, we fire the dive site change a few times after the index of the QComboBox is changed; we don't need that - fire just once. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Don't clear the underline model of the comboboxGravatar Tomaz Canabrava
Clear was the right method to call when we used a line edit, and the line edit didn't had a model to provide data. Calling clear() on a QComboBox will delete all itens inside of it, and what we wanted was to choose an invalid index - and that's -1 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Remove commented out codeGravatar Tomaz Canabrava
This code was commented out when I started to port the locations to new code, and it's harmless to remove it now. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Don't rely on current_dive to get the dive site idGravatar Tomaz Canabrava
Since we are modifying the dive site inside of the dive, we can't ask the dive for the new one, and we also can't use the name of the dive site, as there's the possibility that two or more could have the same name, so rely only on the index of it to get the uuid. The index is variable since we will sort the dive_site_table alphabetically, but this doesn't matter since we are using it only temporarely to get the uuid, and this one never changes. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Update KMessageWidget to KF5Gravatar Tomaz Canabrava
The KMessageWidget that we used was from an ancient version of KDE4, KF5 is out for quite a while, so it's good that we also update our software that uses parts of KDE. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01Simplify model handling and crashes fixesGravatar Tomaz Canabrava
So, there's only one crash left (that I put a big TODO: on the maintab.cpp about) and I'll fix it tomorrow as it's quite late here and I'm almost sleeping at the keyboard. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01Create a new DiveSite when user clicks on addGravatar Tomaz Canabrava
Also reorganized a bit of the code, and renamed a few misleading methods. [Dirk Hohndel: remove some C++11 code] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31Fix crashGravatar Dirk Hohndel
With no dive sites we dereference a NULL pointer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31Don't ask for a GeoCoordinate when editing a diveGravatar Tomaz Canabrava
This should be asked when we are in dive_site_edit mode. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31We are not using a completer for location anymoreGravatar Tomaz Canabrava
So, remove it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>