summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-05-25Localize worldmap exportGravatar Miika Turkia
Call the translation functions for text strings when exporting the worldmap to allow localized exports. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-25Use user preferred units on worldmap exportGravatar Miika Turkia
We should use the temperature units preferred by the user when exporting dive info on Worldmap. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-25Location must be quoted on worldmap exportGravatar Miika Turkia
User supplied text fields must be quoted on worldmap export. Without quoting the HTML is broken e.g. with location "Angel's Window" Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove leftovers from the planner.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Reenables the air edition and deletion of handlers on the planner/addGravatar Tomaz Canabrava
Only a tiny bit of poke around the contextMenuEvent - the events of the planner are dealt by the QGraphicsItem, and this makes the logic pretty easy to follow. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Reenamble 'Delete Dive Point' on the planer / addGravatar Tomaz Canabrava
Just removed an #if 0 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Add location and max depth to world map exportGravatar Rick Walsh
From fdf157bb4db042e63f215607b284663f606bd98c Mon Sep 17 00:00:00 2001 From: Rick Walsh <rickmwalsh@gmail.com> Date: Sun, 25 May 2014 14:57:36 +1200 Subject: [PATCH] Add location and max depth to world map export Adds location name and maximum depth to the exported world map html file. Minor formatting changes to exported text for consistency and clarity. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> From fdf157bb4db042e63f215607b284663f606bd98c Mon Sep 17 00:00:00 2001 From: Rick Walsh <rickmwalsh@gmail.com> Date: Sun, 25 May 2014 14:57:36 +1200 Subject: [PATCH] Add location and max depth to world map export Adds location name and maximum depth to the exported world map html file. Minor formatting changes to exported text for consistency and clarity. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Speed up the multi dive selectionGravatar Tomaz Canabrava
Dirk's code in commit a3d300ca919d ("Correctly implement multi dive selection") had a major flaw - it kept redrawing the selected dives one after another. Not what we need. So this fixes this up so that it doesn't take more than a sec to select all the dives that are on the same part of the click on the globe. I've achieved this by creating a boolean ' dontEmitDiveChanged and sending the signal only if this flag is false. The reason that we can't simply remove the emit from the selectionChanged is because the selectionChanged is what we have when we click on the diveList, if we removed this from there, nothing will happen upon selection. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Correctly implement multi dive selectionGravatar Dirk Hohndel
The old code had several issues. It broke the synchronization between dive->select and Qt selected status and worse, it would partially unselect previously selected dives when called. This patch, however, causes the selection via the map to be glacially slow because it forces a redraw of every single selected profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Rename the export dialogGravatar Gehad
Give the export dialog a better name than just dialog. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Dive list: move trip merging logic into divelist.cGravatar Dirk Hohndel
This also fixes a couple of issues with the existing code: - removes a memory leak - treats null and "" the same Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Dive list: work around odd problem with selectionsGravatar Dirk Hohndel
According to the documentation clearSelection() should emit selectionChanged() - but I can verify in the debugger that sometimes this doesn't appear to happen - consequently our notion of what's selected gets confused. To work around this, after calling clearSelection() we simply manuall deselect all dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Dive list: move trip selection / deselection logic to divelist.cGravatar Dirk Hohndel
This is core logic, not UI code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Dive list: more consistent handling of "add to trip"Gravatar Dirk Hohndel
When multiple dives are selected, we need to be smarter about when to show "add to trip immediately above" or "... below". This code is quite readable, I think, and does the trick. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Port the KeyPress actions to the new profile.Gravatar Tomaz Canabrava
[Dirk Hohndel: combined two commits into one and cleaned up some whitespace issues] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Add some helper functionsGravatar Dirk Hohndel
First step towards getting the "add to trip" logic in the divelist context menu to be consistent and correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove export and save as from dive list context menuGravatar Dirk Hohndel
The context menu is getting way too big and confusing. This is now much more cleanly done from the File->Export dialog. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove a ton of code.Gravatar Tomaz Canabrava
The code removed was already ported to the New Profile. We managed to clean quite a bit. huhhy Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove the depth / time increase and decrease functions.Gravatar Tomaz Canabrava
The new profile code handles the resizing of the profile area in order to accomodate the depth and time of the dive much more intuitively - the old manual buttons to do so are no longer needed. This also removes a few other unused methods. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Make mouse dragging work as it should.Gravatar Tomaz Canabrava
This patch makes mouse dragging work as it should, a tiny bit different than the old version, but I think it's a better way. What's missing: Keyboard actions. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove unused code.Gravatar Tomaz Canabrava
This code is not ported to the new profile, but from what I can understand from it, it doesn't need to be. The purpose of this code was to setup the correct colors and strings for the current mouse position, we already do this on the Profile in a different way, on the Notification Area. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove code already ported to the new profile.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Fixe movement of DiveHandlers when moving the NotificationAreaGravatar Tomaz Canabrava
The QGraphicsView system moves every selected item when the user clicks and drags one. This patch makes a cache of all selected items and removes the selection on them. When the user stops dragging the Notification, the selection is restored. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Make the planner actually work.Gravatar Tomaz Canabrava
This commit makes the planner actually work. There ar still a few edges, but oh, joy - the new Profile gave a very unexpected and nice addition to it - Grab the last handler of the initial dive, and move it to the right, or get any handler, and move it to the bottom to see what I mean. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Change how the handler handlers itself.Gravatar Tomaz Canabrava
This patch adds a itemChange method, that emits a 'changed' signal when the handler is moved. I'll use that signal on the profile to call the correct method. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Add Subsurface XML export to Export dialogGravatar Dirk Hohndel
Also be consistent about the default folder we use when opening the file dialog. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Rework the Export dialogGravatar Dirk Hohndel
The UI design looked too tight in my screen. The explanation texts were a bit inconsistent (and in one case simply wrong). The explanation for the initial selection wasn't shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Add descriptions for different formats in the export dialogGravatar Gehad
When choosing a format from the export dialog a two line description of the format appears. This is helpful and prevents confusion. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Gratuitous whitespace changesGravatar Dirk Hohndel
I keep trying to get to consistenct. Completely hopeless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Small tweaks to our whitespace handlingGravatar Dirk Hohndel
This is still not (and likely will never be) intended to just be blindly run and mechanically applied to all files. It tries to implement our rules but it is not perfect and more importantly, we have parts of the code where we intentionally break our rules for various reasons of readability in that particular situation. But running this against the sources files you touch often will point out things that are wrong and should be fixed. This fixes the indentation for continuation lines and the handling of the for each style loops (clang 3.5 should have this built in - I'll play with the current development version of this later). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Good code cleanup on the old DivePlanner code.Gravatar Tomaz Canabrava
All code that was removed already is working on the New Profile, The code that's behind #if 0 means that it still needs to be ported and because of some removal, it was not possible to keep it compiling (mostly the removal of the Ruler class, that is the Axis, on the new profile). The rest of the code that's untouched - most probably will keep that way. The DivePlannerPointsModel is correct and well done, no need to change that, only the Graphics part. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Profile now correctly displays the planned dive.Gravatar Tomaz Canabrava
But it doesn't move the handlers yet, and when you confirm it you also must click on the dive to select it or the profile will show garbage. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Code Cleanup: connections can be made between signals.Gravatar Tomaz Canabrava
A signal can connect to another signal, so I removed a slot that had the sole purpose to call another signal and replaced that with a direct call. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Disconnect temporary connections on the Profile.Gravatar Tomaz Canabrava
This code adds the disconnections of temporaries. A temporary connection is a connection that should be active only on a certain state, and we need to clean that for the new state that will enter after. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Move two necessary functions for the Planner behavior to the Profile code.Gravatar Tomaz Canabrava
Those two functions are important and necessary for the Planner, they create and remove the little balls that act as handlers so the profile can be edited with the mouse. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Back to profile or empty state when finishing addition.Gravatar Tomaz Canabrava
This patch adds a signal to MainTab, that should be removed from there when we finish the rework on the edit part, to go to the edit classes, but in the meantime, let's keep it there. The signal is connected to the ProfileWidget in a way that the end of the edit will also trigger the profile to go back to ProfileState (show the dive, if there's any) or empty Profile (if there's none). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Enable editing the 'Add dive' from the new profile.Gravatar Tomaz Canabrava
This is highly broken in many ways - but it's the right first step. I ported two of the most important methods from the old profile and now if you are in add dive mode, double clicking on the new profile will correctly add a handler on the planned dive. To see and move the handler around, however, you need to activate the old planner. Next step: add the handlers on the new profile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Temporary Tab Widget for the planner and the Profile View.Gravatar Tomaz Canabrava
This is a temporary measure to help me port the planner to the new profile. it will be removed when I finish the port, but it makes the software still usable, so there's no worris. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Source and dest are created on the constructor, no need to check for them.Gravatar Tomaz Canabrava
The code checked if dest and source existed before trying to call an method on them, but dest and source are created on the constructor, and thus, the if is dummy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Move settings of the Ruler to the Ruler.Gravatar Tomaz Canabrava
As with any other graphics object, the settings for the ruler should be managed by the ruler, clearing up the Profile logic and making the code easier to read. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22PreferencesChanged -> settingsChanged.Gravatar Tomaz Canabrava
We used both preferencesChanged and settingsChanged in different methods and classes to mean the same thing, this adds consistency. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Don't replot every time a pref changes, regardless of what preferences.Gravatar Tomaz Canabrava
The list of preferences that should trigger a full repaint are at the top of this method, *if* this introduces a bug it is because some of the preferences are not being correctly triaged yet and that needs to be fixed. Regardless of that, now the profile will only enable / disable the *ruler* instead of replotting everything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Remove use of QSettings for ruler visibility, use prefs.rulergraph instead.Gravatar Tomaz Canabrava
The QSettings is a bit bloated on its use, so we are trying to narrow down the amount of calls to it. We have a preferences struct, use that instead. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Code Cleanup: Move the Hide/Show ruler to an internal methodGravatar Tomaz Canabrava
By moving the Hide/Show of the ruler to an internal method, we gain a bit of codecleanuperism by removing a lot of unnecessary calls to their dest and source drag-handlers. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Create a 'remove_event' function that removes an event.Gravatar Tomaz Canabrava
The logic of removing the event was in the UI, and this makes the code harder to test because we need to take into account also the events that the interface is receiving, instead of only relying on the algorithm to test. so, now it lives in dive.h/.c and a unittest is easyer to make. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Fix compilation with CMake.Gravatar Tomaz Canabrava
This changes are only to make CMake compile again after the addition of the export dialog. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-21Shortcuts for the exporting window.Gravatar Gehad elrobey
Add the ability to close the exporting window, also Quit Subsurface with this window in front, for consistency. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-21Add ability to export only selected dives in worldmap exporterGravatar Gehad elrobey
This patch adds the ability to export selected dives only in the worldmap exporter. After Miika added the export dialog in commit 7dc642860def ("Implementing export dialog") and exporting only selected dives became a choice while exporting. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-21Implementing export dialogGravatar Miika Turkia
As our menus are getting many export entries, it is better to create a single export dialog where user is able to select the export type and whether to export selected dives or all of them. This should also be more intuitive than the current way when export from file menu export all dives and right click menu on divelist exports only selected dives. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Code Cleanup: use qMin instad of if( min ) setMin else setMax.Gravatar Tomaz Canabrava
silly code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>