aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-05-01Hook up adding a weightsystemGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Add data and add functions for WeightModelGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Use the existing current_dive macro in Qt codeGravatar Dirk Hohndel
Replicating this with the currentDive member seems to make no sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-28Merge branch 'RenderStarsOnTable' of ↵Gravatar Dirk Hohndel
https://github.com/tcanabrava/subsurface into Qt
2013-04-28Save and retore splitter dimensions.Gravatar Amit Chaudhuri
Rename splitters and remove seemingly redundant empty splitter. Use save/restoreState to save splitter sizes using QSettings. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-28Fixed loading the stars when opening with file as argv. minor cleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-27Merge branch 'RenderStarsOnTable' of ↵Gravatar Dirk Hohndel
https://github.com/tcanabrava/subsurface into Qt
2013-04-27Minor coding style cleanups - and use core logic functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27Add support for remembering settingsGravatar Amit Chaudhuri
Use QSettings to provide persistent storage of settings. For example, we store and restore the size of the MainWindow. We use the organisation name hohndel.org and keep subsurface as the application name. A section is specified for things to do with the MainWindow; other sections could be added e.g. for preferred units? Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27Added support for showing the Stars on the DiveTableGravatar Tomaz Canabrava
For the stars on the dive table I had to rework a bit my StarRating widget, because it used a pixmap for each widget that were created. Not it uses only 2 pixmaps: the active and inactive ones. A new file was created named modeldelegates(h, cpp) that should hold all delegates of the models. For the GTK / C folks, a 'Delegate' ia s way to bypass the default behavior of the view that's displaying the data. I also added the code to display the stars if no delegate is set ( good for debugging. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-25Remove the explicit UTF-8 conversionsGravatar Dirk Hohndel
Thanks to commit bdbfdcdfa0fb ('Ask Qt 4 to use the UTF-8 codec as the "codec for C strings"') we no longer need the explicit UTF-8 conversion when creating QStrings from char *. Suggested-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-25Merge branch 'QtStuff' of git://github.com/tcanabrava/subsurface into QtGravatar Dirk Hohndel
2013-04-25Ask Qt 4 to use the UTF-8 codec as the "codec for C strings"Gravatar Thiago Macieira
Qt 5 does this by default, so it's not necessary there (in fact, setCodecForCStrings was removed, so you catch any mistakes). Now all QString methods taking a const char* or QByteArray (constructor, append(), operator+=, operator<, etc.) will interpret that char array as UTF-8. Conversely, the QByteArray methods taking a QString will generate UTF-8 too. This includes the badly named QString::fromAscii() and QString::toAscii(). Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-25Make dirk happy by enabling sort in the model.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-25Minor cleanup of constructors and one accessor for DiveItemGravatar Dirk Hohndel
Suggested-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-25Remove useless members of DiveItemGravatar Henrik Brautaset Aronsen
Just use the dive struct directly. Suggested-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-25Simplify DiveItemGravatar Henrik Brautaset Aronsen
The DiveItem constructor had 13 variables. By passing it the full dive we reduce that to 2. [Dirk Hohndel: changed to use "struct dive *" instead of just "dive *"] Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Use Subsurface's data structures for DiveItemGravatar Dirk Hohndel
We have these data structures for a reason. They provide context about the units used and prevent mistakes. And of course they are used everywhere else so we should use them here, too. This also tries to display some more data and make things look a bit more like the Gtk version when it comes to alignment and formatting. My guess is this will make Qt developers' eyes bleed. My apologies. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Call the get_date functions with timestamp_t instead of struct tmGravatar Dirk Hohndel
This is the much more natural way to use this function, now that I look at it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Fix building for Windows: cache the Windows-specific variablesGravatar Thiago Macieira
Otherwise, we won't link to winsock or set the subsystem correctly. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24MSVC is c89Gravatar Dirk Hohndel
In case someone wants to compile this with an outdated C compiler... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Split report_dives into UI and logic and move to divelist filesGravatar Dirk Hohndel
Functionality is unchanged, except we now have a nice process_dives function that deals with all the logic and that gets called from report_dives from the Gtk code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Merge branch 'useStarWidgets' of git://github.com/tcanabrava/subsurface into QtGravatar Dirk Hohndel
2013-04-24Correctly format depth and timeGravatar Dirk Hohndel
We really need those leading 0s. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Fix column headings for divelistGravatar Dirk Hohndel
This looks better and is consistent with the Gtk version. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24Fix the order of the DiveInformation tab bar.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-24Remove the use of this->Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-24Use the star widget in it's right placeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-24Amend divetrip model to use int unitsGravatar Amit Chaudhuri
Amend the DiveItem class to avoid float in favour of int. Add getters which return display friendly QStrings reflecting user preferences for (e.g.) depth. Modify DiveTripModel to support controlled alignment by column; right align for depth and duration. Fix problems with utf8 encoding on rating stars, degree symbols and O2 subscript. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23A hook for DM4 XML importGravatar Miika Turkia
This will take the DM4 XSLT into use. In the future it is quite likely that we will have to start using something more specific on top of the root element name to identify dive log formats. But as "Dive" is currently a unique root element name for us, this suffices for now. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23XSLT for importing individual DM4 divesGravatar Miika Turkia
This XSLT can be used when exporting single dives from DM4 and importing them to Subsurface. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Retain event sort order on restartGravatar Miika Turkia
The events that had same time stamp were reversed in order on every new load of the log file. This patch will keep the order static. (Changing order is annoying when using version control to store the logs.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Add a simple table-based cns calculationsGravatar Anton Lundin
For dives where divecomputers haven't provided us with a cns, we calculate our cns accumulated during that dive based on a simple table. We also check if we did a dive in the prior 12 ours and grab the cns from it and calculate how much of that still affects us. [Dirk Hohndel: a couple of small changes: remove unnecessary check of cns values in the samples of the first dive computer, changed the way we determine the 'previous dive' and used the end time of that previous dive for the decay calculation] Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Switch to UTF-8 on .DLD exportGravatar Miika Turkia
Let's use the shiny new UTF-8 encoding on divelogs.de export. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Merge branch 'StarWidgetResource' of git://github.com/tcanabrava/subsurface ↵Gravatar Dirk Hohndel
into Qt
2013-04-23Fix missing gtk-mac-integration includesGravatar Henrik Brautaset Aronsen
GTKCFLAGS were overwritten. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Remove trailing spaces from config.cache fileGravatar Henrik Brautaset Aronsen
Things like «ifeq ($(UNAME), darwin)» would not trigger, since variables in the config.cache files had trailing spaces. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Use the star from the resource file instead of hardcoding it's patchGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-23Fix config.cache creation on a MacGravatar Henrik Brautaset Aronsen
Mac uses BSD sed by default, which doesn't support \n substition by default. Replacing sed with tr. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Set the window icon in QtGravatar Dirk Hohndel
And even use the resource file to allow me to use an alias for it in the actual code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Consolidate the two .qrc filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Merge branch 'buildsystem-for-dirk' of ↵Gravatar Dirk Hohndel
http://github.com/thiagomacieira/subsurface into Qt
2013-04-23Fix compilation: in C++, enums don't have operator++Gravatar Thiago Macieira
To use ++, we need to declare the variable as int. But then we need to cast to the enum type. This is using C-style casts because this is still C-like code. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Clean up the moc intermediates too in make cleanGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Don't hardcode the paths for mkdir: just get them from the targetGravatar Thiago Macieira
The $(@D) (equivalent to $(dir $@)) tells us what the directory the target is in. We could also have used the one for the source. They're equivalent there. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Add support for Qt resources in SubsurfaceGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Prettify the msgfmt and linking argumentsGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Make the "silent mode" compilation be optional only.Gravatar Thiago Macieira
If you run make V=1 Then we'll output the full command-line. It's useful for debugging problems with the build. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Generate the C++ dependencies at configure-timeGravatar Thiago Macieira
We use the -MG preprocessor option to the compiler to ask it to check all #includes and tell us what's missing. Then our own rules will generate the moc and uic files that the .cpp #include. Unfortunately, our rules make uic generate output in qt-ui/ for qt-ui/*.ui, while the compiler generates rules for no directory. We need to fake it by forcing the generation. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Get the list of dependency includes from the SOURCES listGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>