aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-11-02Speed up XML loadingGravatar Linus Torvalds
This tries to speed up XML loading for large XML files (and thus subsurface startup times) by trimming the fat off our own matching code. The actual libxml overhead (particularly string allocation) tends to be the dominant part, so this only speeds up a big load by about 12% for me, but hey, it can be noticeable. Dirk's example nasty 175MB xml file with ~5200 dives takes "only' 7.7 seconds to load, when it used to take 8.8s. And that's on a fast machine. For smaller xml files, the dynamic loading costs etc startup costs tend to be big enough that the xml parsing costs aren't as noticeable. Aside from switching the node names around to "little endian" (ie least significant name first) format to avoid some unnecessary strlen() calls, this makes the nodename generation use a non-locale 'tolower()', and only decodes up to two levels of names (since that's the maximum we ever match against anyway). It also introduces a "-q" argument to make startup timing easier. Passing in "-q" just makes subsurface quit imediately after doing all necessary startup code. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-02Added a custom widget for tagging divesGravatar Maximilian Güntner
A custom tag widget has been added to MainTab. Tags are seperated by a comma ",". The implementation supports escaping a comma by using "\,". While typing, the widget supports the user by suggesting tags using a QCompleter. Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02Replaced the tag implementationGravatar Maximilian Güntner
The new implementation supports custom tags which are provided by the user as well as default tags which are provided by subsurface. Default tags can be translated and will be written to XML in their non-localized form. Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02change the key from const char * to QByteArrayGravatar Maximilian Güntner
if trGettext() gets called with a *text that resides in the stack, the QHash will return incorrect values after the second call of trGettext() with that *text. Example (assuming nothing has been translated): void func(const char *text) { char *translated = trGettext(text); doSomethingWith(translated); } func("foo"); (1) func("bar"); (2) (1) *translated is "foo" (2) *translated should be "bar" but is "foo" because the key (const char*) points to the value "foo" which has been set in the previous call (1). Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-01Merge branch 'editMode' of github.com:tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-11-01Enable undo for the Edit mode on Added Dives.Gravatar Tomaz Canabrava
This enables undo for the edit mode on added dives, it uses the premade backup to fill the old dive with data. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01Changed the backup implementation of the samples on EditDive.Gravatar Tomaz Canabrava
Changed the backup implementation of the samples on EditDive, it's way cleaner now what's happening, and it's also better for the cancel edit. Next: The Cancel Edit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
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-27Add alt based shortcuts to access menusGravatar Miika Turkia
This adds alt-f shortcut to access file menu as well as other similar alt based shortcuts for other menu items. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-27Merge branch 'webservices' of github.com:tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-10-25fix device probing for UEMIS computer on linuxGravatar Danilo Cesar Lemes de Paula
When the device probing was ported from the Gtk version we skipped the UEMIS code. It's still based on the contents of /proc/mounts, although without the use of glib's helpers. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-10-24code cleanup: removed unused function from mainwindow.hGravatar Tomaz Canabrava
The setupSplitters method was created quite a while ago to deal with the splitters when I didn't used a more sane approach. I forgot to delete it back them, removing now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
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-24Reorganized the downlads menu for the inclusion of more webservices.Gravatar Tomaz Canabrava
This patch moves around a few items on the menu to a new submenu downloads/uploads. I think it's not the best way, but it already fives a bit more of 'unverbosity', because the old menu had 'Download from Dive Computer', 'Download from Webservices', and now we would introduce a new 'Download from Divelogs.de' I tougth it was better to have a 'parent' named 'Download' and put all children inside. this can grow quite big as soon as I implement the plugin system for that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24Added the skeleton for the Download / Upload from Divelogs.deGravatar Tomaz Canabrava
Added the skeleton code for the Download / Upload from Divelogs. de webservice. Now I need to hoopup things from the .ui side and do the actual implementation of the code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24fix the string of the subsurfice webservice on the settings.Gravatar Tomaz Canabrava
The setting was 'webservice', but this is too wide, since we are supporting more than one. changed it to 'subsurface_webservice_uid' Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24Fixed a crash when the user canceled the download from webservice dialog.Gravatar Tomaz Canabrava
Null references, ah, love them. 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-24Subject: [PATCH] No need to center on dive after editing coordinates.Gravatar Michael Andreen
This is done automatically now. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-20Add current date to CSV importGravatar Miika Turkia
Since CSV import does not include date/time stamp, we need to generate one for ourselves. This patch uses current time of the import as dive time. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.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-20Get rid of compiler warning on format stringsGravatar Miika Turkia
This gets rid of compiler warnings "format not a string literal and no format arguments [-Wformat-security]". E.g. when building distribution packages these warnings are often treated as errors preventing the build (with good reason). Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2013-10-20Use configured vertical speed units in rulerGravatar Anton Lundin
Ruler was hard-coded to use seconds as speed unit. This makes it use get_vertical_speed_units to switch between seconds and minutes. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Remove the "in C" part about Subsurface's descriptionGravatar Thiago Macieira
It's not written purely in C anymore. There's quite a lot of C++ now, not to mention Perl, XSLT, shell scripting, etc. :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Some adjustments to "save as"Gravatar Dirk Hohndel
The popup menu entries should be all lowercase. Also we should handle this the same as regular save and open when it comes to remembering the last path. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Added 'Save As' option on the dive list menu.Gravatar Tomaz Canabrava
This adds the 'Save As' option on the dive list, very straigth forward, just simple and beauty. tested and working. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> 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-17Fix marble losting track of zoom levelGravatar Dirk Hohndel
Marble had a bug on the way it treats zoom level, there's no way for it to find out if it's user-input or algorithm input and when a user clicks on a dive, it spins and centers on it, but if the user clicks on another dive when it's still spinning, it will get the zoom in the actual state ( spinning, usually zoom is far away from the first position ) and continue the spin to the other position. This patch works by saving the first location and triggering a helper function with a timer that will only update the zoom level if the timer is not active ( and thus, will not get the bugged zoom state set by the animation. ). Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> 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-17Move sac-calculation to profile.cGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Rename T: to Temp: in Information boxGravatar Anton Lundin
D as in depth, T as in time and not another T as in temp. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Open CSV files only via the GUIGravatar Miika Turkia
Since the CSV import transformation is now parametrized and does not have any defaults, we need to use the CSV import GUI. Thus give an error message if one is opening CSV file directly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Get information only from first line at each timeGravatar Miika Turkia
As some CSV log files seem to contain multiple sample lines for a single time, we'll just grab the first one of them to avoid duplicates. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Field variables for CSV importGravatar Miika Turkia
Field variables for the CSV XSLT import have disappeared at some point during developing GUI for the CSV import. So adding them to the XSLT for the field selections to have effect. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16Helpers: move some date related function to qt-gui.cppGravatar Lubomir I. Ivanov
divelist.c: get_dive_date_string() get_short_dive_date_string() get_trip_date_string() MinGW support for *printf and parameter positions (e.g. %1$d) is horribly broken. Instead of implementing *proper* support for this feature Microsoft decide to ignore the standard (again) and they implement new functions with the '_p' suffix, such as 'sprintf_p', which seem to be available from a 2003 runtime. To top that 'sprintf_p' is not really a 'sprintf' but rather a 'snprintf'. It seems that the MinGW people ignore the issue and do not provide wrappers of any sort, or at least for the current recommended compiler for Qt 4.8.5 on Windows - which is a 4.4.0. A note of warning; inspecting how MinGW does certain things in headers such as stdio.h, can ensue bad dreams or other negative effects on to the viewer. This forces us to move the following functions from the 'back-end' (divelist.c) to the 'front-end' (qt-gui.cpp) and use QString. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> 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-16Rounding error on time changeGravatar Miika Turkia
When we convert time in seconds to mm:ss format, we do not want to round but get floor instead. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16Prettier printingGravatar Patrick Valsecchi
Going through pixmaps for the profile was not needed and was making our prints look very pixelated. In Qt4, QWidget child classes are printed as bitmaps. So appart from changing the code to print the tables to use a QGraphicsView instead, there is nothing we can do, so the rest of the printing is still done as bitmaps. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16Missing translation source fileGravatar Dirk Hohndel
I'm still not 100% sure that this is the way to do it but ran out of time - and right now the build complains that this file is missing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16Set GIT_DIR when calling out to Git from the MakefileGravatar Thiago Macieira
This is necessary for out-of-source builds to work. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15First step to being able to use transifex again for translationsGravatar Dirk Hohndel
This sadly contains a very noisy .ts file diff as those files now are one directory down from their original spot, so recreating them changed all the source paths. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Use git rev-parse --symbolic-full-name to get the HEAD target refGravatar Thiago Macieira
This will prevent us trying to depend on a file that doesn't exist in case someone goes on a detached HEAD. For example, this could happen during a bisect. (detached head) $ git rev-parse --symbolic-full-name HEAD HEAD (master) $ git rev-parse --symbolic-full-name HEAD refs/heads/master This will break on a packed ref, though. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Dependencies are too aggressive for version.hGravatar Dirk Hohndel
Apparently qmake can't tell that #include "version.h" and #include "libdivecomputer/version.h" are not the same thing. Instead of spending another bunch of hours on fixing the buildsystem I decided to just cleanup the spots where we actually use the version file and rename it to ssrf-version.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Fixed the moving around of the InfoPanel on non KDE enviroments.Gravatar Tomaz Canabrava
This patch restores the ability to move the info-overlay panel on the profile. For some reason the eventFilter wasn't working (and actually, looking at the code, it really shouldn't, because I didn't see where I set it to work, maybe someone (me) broke it a long time ago) well, it seems fixed now at least. :) Tested on XFCE, Gnome and KDE, with three different window managers. [Dirk Hohndel: removed debug output] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Printing adjustmentsGravatar Robert Helling
Add units to the SAC in the print-out, reduce max depth in metric to one decimal place, and leave some more characters of the notes to be printed.. Signed-off-by: Robert C. Helling <helling@atdotde.de Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Fix stupid editing errorGravatar Dirk Hohndel
Don't do "obvious cleanups" at 4 in the morning when you can't sleep because of emotionally draining issues outside of your control... and if you do, at least compile test them. This was introduced by me in commit 2f9f46cb0253 ("Random white space cleanup"). Sorry. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Fixed the Tab behavior on the QCombobox DelegateGravatar Tomaz Canabrava
This Patch fixes the tab behavior on the QComboBox delegate. For a QComboBox, tab was being treated as 'cancel' action on edit, but since it will send a editingFinished() signal, and the Qt::Key_Return will also send a editingFinished() signal, I couldn't use that method and had to do a little hack around it. The code is mostly clean and works. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>