aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
AgeCommit message (Collapse)Author
2013-11-14Fix some random compiler warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Maintain the selection when aborting "dive add"Gravatar Dirk Hohndel
We remember what was selected before and restore it. Maybe there's a more "Qt way" of doing this, but my implementation appears to work :-) Also remove unconditional debug output that snuck into an earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Switch to the Dive Notes tab when manually adding a diveGravatar Dirk Hohndel
This gives a more consistent and expected user experience. Fixes #236 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Fix loading the information of splitter sizes on empty config.Gravatar Tomaz Canabrava
We previously did did bad things when running with an empty configuration. This attemps to clean it. We will now correctly handle the splitters in almost all cases ( if I didn't break anything on the way. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Introduce an on/off switch for calculating ndl/ttsGravatar Anton Lundin
Let the user choose if the calculation of ndl and tts is worth the time it takes. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Make gas selection for add dive workGravatar Dirk Hohndel
This now offers the correct gases for which we have cylinders defined. For both the planner and add dive we still don't end up with the correct cylinders in the resulting dive. But that's for another commit to fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Handle add dive cancel correctlyGravatar Dirk Hohndel
This should leave the program in a consistent state after add dive was cancelled (and do the right thing in case the dive list was empty). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12First steps to make add dive work with the correct infrastructureGravatar Dirk Hohndel
This just makes sure that we do the right thing with the staging drive, that we don't mess up the selection, the we are smart about using our helper functions, etc. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-10Show a cylinder widget in the dive plannerGravatar Dirk Hohndel
This is intended to allow the user to provide the gases / cylinders that she will be diving with. With that information the planner can warn the user about insufficient gases, but more importantly it can show relevant gases in the gas select drop down. Right now the add cylinder button doesn't add a cylinder - that's a problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Forgot to remove this debug, sorry.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-11-09Removed inconsistency when user tried to add dive while planning.Gravatar Tomaz Canabrava
The user could add a dive, and in the middle click on the 'plan' button. Since we didn't cared about that on the widget, a lot of inconsistencies could occour. this fixes that by setting a flag on the Planner, that has now three modes: nothing, plan and add. (maybe in the future an edit mode will be valid too.) If in 'NOTHING' mode, user can enter the addition, edition and planning. If in any other mode, user can't do a thing. The mode gets back to NOTHING when user accepts or cancels a plan / add / edition. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Save the status of the tree before trying to reset the display.Gravatar Tomaz Canabrava
This is a try: when the user changes the orientation on the columns by clicking on the title of them and organizing by something that's not the number, we lost track of the opened branches. this commit doesn't fix that, but it fixes a possible similar issue. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-11-09Moved the code that handles DiveList column sizes to its correct file.Gravatar Tomaz Canabrava
I got a bit lost trying to find the code that handled DiveList columns today, so I thought it was better to move it to its file, after all we do have a divelistview.h :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Fixes breaking the sizes of the columns of the listView.Gravatar Tomaz Canabrava
This just proves one point: I'm retarded. I moved some code around and forgot to close the old group, so I created a group inside 'MainWindow' that handled the ListWidget, wich was not the right thing to do at all. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Fix inconsistent position of screen splittersGravatar Tomaz Canabrava
I basically rewrote the way we handled the splitters. It now uses a state to know what it's doing, and will only update the value of the saved-to-disk splitter size if the state shows the splitters (currently only VIEWALL), where all the other states should hide the splitters, and the values of the splitters don't matter. Fixes #225 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07Don't translate the fake DC modelsGravatar Dirk Hohndel
Since the model name is written into the XML file it has to be a literal string that isn't translated. Otherwise a datafile written in one locale behaves differently when opened by Subsurface under a different locale. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07Adjust default start time of added diveGravatar Dirk Hohndel
It should be 'now' in the current timezone. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05Don't force the DiveListView to be a tree when reloadingGravatar Dirk Hohndel
We should keep whatever view the user last used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-01Enable editing a dive that was manually entered.Gravatar Tomaz Canabrava
This patch enables editing a dive that was manually entered, it doesn't cover dive plans yet because on the plan I need to figure out what are the 'user-entered' points, and what are the algorithm point. and I feel lazy. =p One last thing that's missing is to revert the dive to the previous condition if the user cancels the edition, currently canceling and applying ok is the same thing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01Code cleanup - Stop calling the same 6 lines everywhere.Gravatar Tomaz Canabrava
There's a method named refreshDisplay, fairly unused, let's use it a bit mroe. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01Added a new option to edit the dives.Gravatar Tomaz Canabrava
Added a new option to edit the dive in the profile view. The option will only be visible if the dive was manually entered or if the dive is a plan. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-10-31Removed Reference to dangling pointer.Gravatar Tomaz Canabrava
We cannot use tr("").toLocal8bit().constData(); on a function that expects a char* because the object will be deleted on the next line, so a strdup is necessary. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-10-24Minimum hooking-up done, divelogs.de shows on menu-activation.Gravatar Tomaz Canabrava
This patch does the hooking up to show the dialog of the divelogs.de window when the user selects it on the menu.: Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24Created a 'WebService' dialog that will handle download and upload.Gravatar Tomaz Canabrava
Created a WebService dialog that will handle download and upload from all child based webservices. Also, ported the currently - only - one webservice to use the new dialog. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-20Export dives in UDDF formatGravatar Miika Turkia
Implement exporting in UDDF format as was done in Gtk version. File menu exports all the dives, right click on selection exports the selected ones. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Implement hook up autogroup menuGravatar Dirk Hohndel
This tracks the autogroup state remembered in data files. Toggling the checkable menu item causes the divelist to be marked as changed. This might actually be untrue - but that's really hard to track so this is the "better safe than sorry" approach. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Show SAC in the mouseover.Gravatar Anton Lundin
This is really nice to have when looking at specific parts of a dive. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16GUI for CSV importGravatar Miika Turkia
This patch implements GUI for importing CSV log files. One is able to configure what columns contain time, depth and temperature fields. Pre-configured log applications currently included are ADP log viewer and XP5. (Both of these use actually tab as separator, so the field separator currently hard-coded.) [Dirk Hohndel: minor fixes] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Trying to switch to Qt translationGravatar Dirk Hohndel
This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06First steps towards removing glib dependenciesGravatar Dirk Hohndel
- remove the build flags and libraries from the Makefile / Configure.mk - remove the glib types (gboolean, gchar, gint64, gint) - comment out / hack around gettext - replace the glib file helper functions - replace g_ascii_strtod - replace g_build_filename - use environment variables instead of g_get_home_dir() & g_get_user_name() - comment out GPS string parsing (uses glib utf8 macros) This needs massive cleanup, but it's a snapshot of what I have right now, in case people want to look at it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Merge branch 'bugfixes' of git://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-10-04Fix display sane values on subsurface at first time opening.Gravatar Tomaz Canabrava
This patch fixes some unsane values that was being retrieved by the ui-files on first time opening. it creates a basic layout of the application using the current desktop size. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04Added the .ssrf extension to the open dialog filter.Gravatar Patrick Valsecchi
Fixes #205 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Code Cleanup - Uneeded preferences stored at the old prefs settingGravatar Tomaz Canabrava
Those preferences removed ( basically the ones about visibility of the List View of the Table ) are now managed by the Qt Settings system, and thus there's no need to have them there. wich gave us a pretty good cleanup. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04Added configuration options for vertical speed units.Gravatar Patrick Valsecchi
Some people (free divers) are loving ft/s or m/s units for vertical speeds. Now they can choose between /min or /s in the configuration (only Qt UI). Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Fixed First run of subsurface - Start on Fullscreen.Gravatar Tomaz Canabrava
For a new installation, subsurface will now start on fullscreen, this fixes the bug where subsurface would start using the interface file ( mainwindow.ui ) configured size, and that silly monster always changes when editing something. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04Fix the first load of Subsurface - "File not found" error.Gravatar Tomaz Canabrava
The first time the user loads subsurface, the default_filename is not configured yet, but yet the software tries to load "", sending an error message that this file doesn't exists. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-27implemented zoom actionGravatar Maximilian Güntner
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-26Code Cleanup, less magic indexes.Gravatar Tomaz Canabrava
This patch removes the magic indexes used to control the mainwindow display of the profile and planner by an enum. a bit more verbose but hard to miss. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-22Correctly handle empty dive list after deleteGravatar Dirk Hohndel
Things need to be cleared out and disabled. But fixing this bug leaves another issue - while the newly selected dive after a delete acts as if it was selected, it doesn't show up as selected in the dive list. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20When manually adding a dive, start with a simple diveGravatar Dirk Hohndel
This is much friendlier than just showing an empty profile. I picked a nice and simple three level dive. 25 minutes at 18m, 15 minutes at 9m, and a safety stop. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Hook up adding a diveGravatar Dirk Hohndel
This gets things mostly right. It creates a dive and uses the planner widget to create samples which are copied into the dive. It fills in some reasonable defaults (DC model, timestamp), but doesn't allow editing the timestamp (or the temperatures and air pressure). On accept the planner gets reset and the dive appears correctly in the dive list. Cancel still needs to be handled. And I bet there are many subtle bugs lurking here and there. But it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Don't show the planner widget when adding a diveGravatar Dirk Hohndel
This looks like it might work, but since we keep recreating the dive, the info entered in the info pane is actually lost. But it's a step in the right direction. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Use Planner dialog to add diveGravatar Dirk Hohndel
Right now this is just calling the same code and setting a flag whether we are planning or adding a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Show sample time in the mouseover.Gravatar Anton Lundin
This is really nice to have when looking at specific coutures of a dive or events. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Fix SIGSEGV after dive computer downloadGravatar Linus Torvalds
This fixes a crash in the current Qt subsurface code that can happen after downloading dives from a dive computer, and the new dives merge with old dives, causing the old dives to be re-allocated into the merged one. In that case, the list widgets don't get fully updated, and contain stale pointers to old dives that no longer exists. Doing anything that refreshes the display will hide this problem, and you do need to have multiple dive computers on the same dive to trigger it in the first place, so it's reasonably hard to hit, but very annoying when you do. This patch just makes us reload all the dive UI tables, which may be overkill. It also doesn't actually fix the fact that we seem to do "process_dives()" within the context of the downloader thread, which looks like a possible source of races. The "process_dives()" should also be moved to the main thread, but needs the preferDownloaded() information that is part of the download window, so it doesn't fit here. Somebody else (Tomaz?) will hopefully fix that part. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-16Plug the Cancel action on the Dive Planner Table and start the 'ok' code.Gravatar Tomaz Canabrava
Plug the cancel action on the dive planner ( before that, only by hitting the 'ESC' button things worked, so now you can also click on the Cancel box that's on the right of the planner profile window. Also, the beginning of the 'ok' code is also at place. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-10Fill ws_info structure and use it when entering weight systemsGravatar Dirk Hohndel
The code to initialize the weight systems from the last datafile loaded had not been brought over from the Gtk version. We now correctly update the data structure when loading file (but not yet when editing values). Most likely the same needs to be done for the tanks as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>