summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-05-02Don't hard-code column width.Gravatar Dirk Hohndel
Auto-detect on first start and keep in settings afterwards. So if the user resizes them, Subsurface remembers the correct sizes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Merge branch 'tomaz-css' into QtGravatar Dirk Hohndel
Tomaz' code does a much better job of shading the dive list! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Added code to Select a dive, fixed minor annoyances.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Test the CSS for styling the TableViewGravatar Tomaz Canabrava
This is a test and I shouldn't be taken seriously. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Alternate background colors for dive listGravatar Dirk Hohndel
This was written with massive hand-holding by Tomaz - actually, this was mostly proposed via IRC by Tomaz and then implemented by me... Right now because of the list-of-lists nature of the model we have the small issue that every trip starts with a dark background dive, even if the trip itself has a dark background. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Set better column widths in the dive listGravatar Dirk Hohndel
This code seems rather crude to me. I'm sure this could be done better. This also makes the column alignment work again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Show cylinder and gas used in the Qt dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Move gas string computation into core logic codeGravatar Dirk Hohndel
This is now a helper called from the Gtk UI code (and will soon be used by the Qt UI code). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Show trip date (with number of dives) in dive/trip listGravatar Dirk Hohndel
That was easy :-) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Minor style updatesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Merge branch 'Qt' into RenderStarsOnTableGravatar Tomaz Canabrava
2013-05-01Added Support for the Trips and Dives on the DiveList model.Gravatar Tomaz Canabrava
Now the list and dives will work in the same way that the GTK version does. The code got changed heavly because the old one was just looking at the dives and didn't worked like a tree. small adaptations on the list view and model delegates because of the changes done on this model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-01Fix a couple of small problems in add weightsystemGravatar Dirk Hohndel
The constructor letf the currentWeightsytem variable uninitialized. Instead of creating the memory leak by malloc-ing the newWeightsystem in the on_addWeight_clicked() function use a local variable instead and pass its address around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Create Add Weightsystem dialogGravatar Dirk Hohndel
My first attempt to create a Qt dialog and to hook it up with the program. Unsurprisingly this doesn't quite work as expected (i.e., the values I enter aren't populated in the model), but it's a start... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Don't add cylinders and weightsystems past the MAXGravatar Dirk Hohndel
We actually should disable the 'Add' button, I guess. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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