summaryrefslogtreecommitdiffstats
path: root/qt-ui
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-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-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-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-23Merge branch 'StarWidgetResource' of git://github.com/tcanabrava/subsurface ↵Gravatar Dirk Hohndel
into Qt
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-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-22Initial version of the Star Picker Widget.Gravatar Tomaz Canabrava
A very simple to use widget: StarWidget *stars = new StarWidget( windowParent); stars->setMaximumStars(10); stars->setCurrentStars( rand()%10); stars->show(); connect(stars, SIGNAL(valueChanged(int)), someObj, SLOT(starsChangedValue(int))); It currently uses a 'star.svg' file on the same folder as the binary. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-22Move model related code from MainWindow and adjustments.Gravatar Tomaz Canabrava
Moves the DiveTrip model related code to models.h The DiveTripModel was implemented in three parts: DiveTripModel.h DiveTripModel.cpp MainWindow.cpp (the code to populate the model) This patch changes the DiveTripModel from it's original implementation to the file models.h, wich should store all models (Dirk requested the Qt developers to not create 2 files per class, but instead to use a file for functionality, and data-models are one functionality.) Besides that, this code cleans up a bit the style: removed operator<< for .push_back, const references where they apply, moved the internal DiveItem class to the .cpp since it should be visible only to the DiveTripModel class, and redesigned the current interface of the model to be identical of the GTK one (used the UTF8-star and 2 subscribed, for instance). Amit (the creator of the original code) should comment here if it's ok with my changes. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-18Use helper function to get dive date stringGravatar Dirk Hohndel
Correct order of arguments in the DiveItem constructor call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-18Use get_dive to populate divelistview with divesGravatar Amit Chaudhuri
Add dives from dive_table to the model/view using the functions provided to extract the dives. We do not yet handle trips. Formatting of date/time, depth and duration need attention. Relies on earlier patch to delay Qt ui construction. We should look at the signals we publish to link to other widgets etc.. [Dirk Hohndel: use for_each_dive -- clean up some white space] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-18Delay Qt ui constructionGravatar Amit Chaudhuri
The Qt ui will need to read the dive_table to populate widgets with dives. Gtk functionality in init_ui is required to parse the dives. Split init_ui to allow parsing to proceed and complete before Qt ui mainwindow constructor is called. Play with qDebug()'s printf style (Thiago!) Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15Added the code that will load and populate the Tank InfoGravatar Tomaz Canabrava
Added the code that will load and populate the Tank Info ComboBox that`s used by the user to select the Cylinder description. Code curerntly implements more than the GTK version since the GTK version of it was a plain-list, this one is a table based model that can be used in ListViews ( like we use now in the ComboBox ) but also in TableViews ( if there`s a need in the future to see everything that`s catalogued in the Tank Info struct. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-14Merge branch 'fixCppStyleToC' of https://github.com/tcanabrava/subsurface ↵Gravatar Dirk Hohndel
into Qt
2013-04-14Undoing the last Qtr_ hackGravatar Dirk Hohndel
The Qtr_ hack isn't needed as in commit 720fc15b2dcd ("Introduce QApplication") had already made sure that we are using gettext. I didn't revert the two commits as I wanted to keep the added header comments and fix the tooling in the Makefile as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-14Fixed the C++ code Style to conform the C style that was previously agreed upon.Gravatar Tomaz Canabrava
Removed the use of operator<<() in a bunch of lines to do direct calls this way the code will not scare non-c++ hearted people. :) s Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-14Add common.h fileGravatar Dirk Hohndel
Oops Signed-off-by: Dirk Hohndel <dirk@hohndel.org>