aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-06-03Another futile attempt to keep whitespace consistentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Do not plot pictures that don't have a timestamp.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Also hold a pointer to the struct picture on the model.Gravatar Tomaz Canabrava
Changes to hold a pointer to the struct picture on the model, so we can use it to determine the correct positioning of the image on the profile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add a method to plot the pictures on the profile.Gravatar Tomaz Canabrava
It plots in the wrong place for now, because I need to change the model a bit. But it shares the same pixmap with the other widget which is nice. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Connect & disconnect the PictureModel on the profileGravatar Tomaz Canabrava
Ignore the warnings for now, this patch connects and disconnects the (not done yet) plotPictures() method. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add a static 'instance()' member for the Photos model.Gravatar Tomaz Canabrava
This will make referencing it from a few places more easy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Fix linked list corruption, move code to C.Gravatar Tomaz Canabrava
The picture list is a single linked list where the pictures have a node to their next element. When adding the same picture to two dives, things got way way wrong and crashes were appearing. This will replicate the information (filename, latitude and longitude) for each dive that has the picture, BUT it still tries to save as much as possible on the actual pixmap. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Cancel dive edit when escape key is pressedGravatar Dirk Hohndel
Also seems intuitive. What's odd is that in the Planner you get a confirmation dialog while here you don't. We should be consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: reject plan if escape key is pressedGravatar Dirk Hohndel
This seems intuitive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Make most of the shortcuts widget specificGravatar Dirk Hohndel
Having the window specific means that you can't have a key do different things on different widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: fix editing the dive planner points tableGravatar Dirk Hohndel
The edit starts with the current value, but our data() function didn't return that in the edit role. Thanks Tomaz for explaining this to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner note logic and layout improvedGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add print button to plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Layout improvements to the dive planGravatar Robert C. Helling
Changed to html. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Change from QPixmap to QImage due to thread issues.Gravatar Tomaz Canabrava
QPixmap cannot be accessed from outside the Main thread, but QImage can. so change that. Also, make the Photo widget display in Icon mode. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Make the new picture widget display the pictures.Gravatar Tomaz Canabrava
Small changes in the model to display the pictures of the dives. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add the data() method of the Picture Model.Gravatar Tomaz Canabrava
This method should give the correct data to all views that the model is connected to. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Update the picture model to use the new picture function calls.Gravatar Tomaz Canabrava
Update the picture model to use the new picture function calls, wich made the code smaller and easyer to understand. AND as a plus, it doesn't use the magic 123 identifier for pictures. AND it correctly adds images without timestamp to the list. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-02Break picture handling code from C++ to C.Gravatar Tomaz Canabrava
This commit breaks the loading of images that were done in the divelist into smaller bits. A bit of code refactor was done in order to correct the placement of a few methods. ShiftTimesDialog::EpochFromExiv got moved to Exif::epoch dive_add_picture is now used instead of add_event picture_load_exif_data got implemented using the old listview code. dive_set_geodata_from_picture got implemented using the old listview code. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-02Rewrite dive edit logicGravatar Dirk Hohndel
The existing code took an odd approach. It tried to change all selected dives whenever the user edited a field, and kept all this backup data in case the user rejected the edits. This code takes the opposite approach. Only edit a copy of the selected dive and then when the user accepts it, edit all the dives and when the user rejects the edit simply redraw the screen (as all the "real" data is still unchanged). This not only saves quite a bit of code, it should be much easier to get correct. Admitedly this code will need quite a bit more testing to make sure it works as intended, but as far as I can tell it already gets more scenarios right than the previous implementation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-02Optionally strip diveplan to bare minimumGravatar Robert C. Helling
There are new check-boxes to modify the look of the diveplan in the notes. The old behaviour appears with "verbatim display", others are shorter, runtimes, stoplengths and transitions being optional. Also round to full meters and minutes to remove optical clutter. To be done: Remember these setting in the config. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-02Fix addStop to work as slot againGravatar Dirk Hohndel
In order to call this as slot it needs to have defaults for all arguments. So we need to change the gasmix into a pointer - which is actually better as this allows to easily pass a NULL pointer when we want to continue to use the previous gas. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Rename two C++ methods to the more typical CamelCaseGravatar Dirk Hohndel
Silly little change. Whatever. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Convert plot_gas_value to gasmixGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Override the MinMaxAvgWidget tool tips for the depth instance.Gravatar Tim Wootton
Add new methods to the MinMaxAvgWidget class to allow us to override the default tooltips of its min and max icons, and then uses these methods to make the tooltips for the Stats tab Depth instance more descriptive. See #521 Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01More conversions to gasmixGravatar Dirk Hohndel
addStop, addGas and createSimpleDive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add threaded processing of image pixmapsGravatar Tomaz Canabrava
This code adds threaded processing of a batch of images. It uses the QtConcurrent implementations to call a function repeteadly using MAX_THREADS (Qt gets that for us) and returns a list of it. This call is blocking, so while the pixmaps are being scaled in threads, it will wait for all scalling to be done. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add a method to update the dive pictures on the model.Gravatar Tomaz Canabrava
Call that method from the mainWindow when the dive changes. The updateDivePictures walks around the events of the first dc (since all pictures are distributed allong all dive computers) to get the events of type '123' (I wonder if there's not a better way to save pictures on the dive, like an linked list of char* named pictures.) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add a new widget on the main tab: Pictures.Gravatar Tomaz Canabrava
Currently this does nothing, but since "dive photos" can also mean photos that were taken during the trip to the dive, some of them will not be visible on the profile. this currently shows nothing, because I didn't work out the Model bits yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add stub for a widget to show the dive pictures.Gravatar Tomaz Canabrava
This has a few classes: the model is the list of pictures for the current dive, the delegate is how this pictures will be displayed on screen, the widget is the collection of delegates, and the DivePictureThumbnailThread is a worker-thread to generate the thumbnails so the UI will not freeze. [Dirk Hohndel: added the new files to subsurface.pro] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Do not replot for each picture added to dive.Gravatar Tomaz Canabrava
Instead wait until all pictures have been set and plot that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Fix layout on the Shift-Image-Time import dialogGravatar Tomaz Canabrava
The dialogs where hard-coded and some variations of themes could broke the placement of the text on it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Simplify ruler update code.Gravatar Tomaz Canabrava
This should fix the infinite recursion on OSX and also clean a lot of code, which is also very nice. <3 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Remove some unused variablesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Next step to using gasmix instead of o2/heGravatar Dirk Hohndel
This changes the divedatapoints and functions that deal with them. It changes plan_add_segment(), create_dp(), gasToStr(), and tankInUse() to consume gasmix instead of o2/he. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Use proper typesGravatar Dirk Hohndel
This is step one of many to use gasmix instead of int o2/he. Right now some of these changes look ridiculous because after changing a few lines we immediately go back to o2 = get_o2(gas). The reason is that I wanted to convert a hand full of functions at a time. So in this commit I only change validate_gas(), get_gas_from_events() and get_gasidx() to use a struct gasmix instead of int o2, int he. This state builds and survived some mild testing. Let's continue on top of that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Remove the .used member of the cylinder structureGravatar Dirk Hohndel
Instead calculate this information on the fly, taking into account all dive computers on the dive in questions. There is one wrinkle to this - previously we abused the '.used' member to make sure that a manually added cylinder didn't disappear the moment it was added (think of the workflow: you add a cylinder, then you add a gas change to that cylinder -> right after you add it it is unused and would not be shown). I am thinking that we might have to add the "manually_added" property to the properties that we store in XML / git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Encapsulate the horrid gas encoding in gas change eventsGravatar Dirk Hohndel
We should never pass permille values around as integers. And we shouldn't have to decode the stupid value in more than one place. This doesn't tackle all the places where we access O2 and He "too early" and should instead keep passing around a gaxmix. But it's a first step. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-31Revert "Show the calculated deco stops in the planner table"Gravatar Dirk Hohndel
This reverts commit 7d42b53bba235894668ed1f2da3f5d17cd97b9c5. With the addition of the dive plan details widget we no longer want to show the deco points in the dive planner points table. Conflicts: qt-ui/diveplanner.cpp
2014-05-31Planner: don't include the disclaimer in the dive plan detail widgetGravatar Dirk Hohndel
We want the disclaimer in the final dive that can be printed, but it's distracting when shown while planning the dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-31Planner: show the plan notes in the new widgetGravatar Dirk Hohndel
That was easy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-31Planner: add dive plan output area that replaces dive listGravatar Dirk Hohndel
When switching to / from plan mode, we switch to show either the dive plan detail widget, or the dive list widget. So far this widget does nothing. This just makes sure it's there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-31Planner: wild guess attempt to fix a crash on MacGravatar Dirk Hohndel
Staring at the stack trace it seems that it gets into an infinite recursion when trying to recalculate after being alerted to a change on the ruler. I cannot recreate this here (not on Linux, not on Mac), but here's a random attempt to prevent the issue: simply refuse to recalculate the ruler while in Add or Plan mode. Crude, but might show us if this really is the issue. Otherwise it's easy enough to revert this change. The qDebug() in there should tell us if people on a Mac do indeed see this even without moving the ruler around in Add or Plan mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-31Allow editing segment duration. This shifts all following waypoints.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: don't recreate the dive while cleaning up the widgetsGravatar Dirk Hohndel
Otherwise the change to the Cylinder widget would trigger a recreation of the dive in an inconsistent state. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: remove check for empty diveplanGravatar Dirk Hohndel
This was introduced in commit fc1336107930 ("Don't crash if we try to save a empty plan") - but it doesn't seem to make any sense. It is perfectly reasonable for the diveplan to have no datapoints at this spot - we are just about to call createTemporaryPlan() which will fill those datapoints from the mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: don't do unnecessary work on empty dive plansGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: after freeing the plan, throw away the pointerGravatar Dirk Hohndel
Otherwise we'll happily go back and access the freed data structures later. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Do not offer an editor when double-clicking REMOVE on the planner.Gravatar Tomaz Canabrava
The planner would offer an text-editor if the user double clicked it's remove column. forbidding that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Do not show 'trash' icon for deco stops.Gravatar Tomaz Canabrava
Besides not deleting them, we shouldn't offer the icon for it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>