aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-04-23Introduce a cache of the configurationGravatar Thiago Macieira
You may have noticed that running make is a little slow. Every time that it is loaded, it will try to detect everything again. So, instead, save the output and reload it the next time. This is implemented by adding a rule that (re-)creates the config.cache file, which is included by make. If the file doesn't exist yet, make will first run the rule which creates it, then reload itself. You can also cause it to reconfigure by running "make configure". Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Trim Makefile, Configure.mk and Rules.mkGravatar Thiago Macieira
Configure.mk contains the detection rules, whereas Rules.mk contains the rules to actually build Subsurface. This simplifies Makefile greatly, which is the file that should be actually modified during regular updates to the codebase. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Create Rules.mk and Configure.mk by copying the MakefileGravatar Thiago Macieira
This is to help Git know that the two files are the same content as the Makefile. The next commit will trim the files to what they need to be.
2013-04-23Reorder the MakefileGravatar Thiago Macieira
Create three sections: 1) the detection rules 2) the main rules, what we usually edit 3) the build rules, which we usually don't change Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Move the MSGOBJS variable definition a little further downGravatar Thiago Macieira
Move it closer to the actual rules. This is not a variable that we'll usually modify. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Remove the unused OSSUPPORT_CFLAGS variableGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Move the list of objects a little further upGravatar Thiago Macieira
This also implies we don't need the OSSUPPORT variable anymore. We simply add to OBJS. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Split the SQLite3, libzip, libxslt and osmgpsmap detection from useGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23Move some of the checks a little bit upGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.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-22Fix crash with some setupsGravatar Dirk Hohndel
Initialize Qt earlier, before Gtk gets its hands on argc / argv. Suggested-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-18Move creation of dive and dive trip date string into helper functionsGravatar Dirk Hohndel
This allows this code to easily be shared by Gtk and Qt UI. 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-15Remove second dive_trip_list definition and douplicate helper functionGravatar Dirk Hohndel
dive_trip_list is simply a global variable, declared in dive.h. The clear_trip_indexes() helper is purely logic and was moved to divetrip.c - but then not deleted in divetrip-gtk.c Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-14Separate Gtk related code from core logic: statisticsGravatar Dirk Hohndel
Fairly straight forward, so far just one tiny bit of code restructuring, everything else separated cleanly. Added statistics-gtk.c and statistics.h This should make no difference to functionality. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-14Separate Gtk related code from core logic: infoGravatar Dirk Hohndel
Surprisingly straight forward, just a couple of places where we really mix significant logic with UI code (for example setting the window title). I had to move amount_selected from display-gtk.h to display.h - I guess the number of dives that are selected is UI independent. But I wonder if we still will track this as a global variable in a Qt UI (since the Gtk selection logic is the main reason this existed in the first place). Added a new info.h files for the necessary declarations. This should make no difference to functionality. 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>
2013-04-13Add Qtr_ macros that uses gettext in a tr() compatible mannerGravatar Dirk Hohndel
This should wrap gettext nicely and replace the "_()" macros we use in C code. Also added comments to the top of all the new files. Suggested-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-13Remove the mandatory -fPIC from CXXFLAGSGravatar Thiago Macieira
This isn't necessary. There's code below adding -fPIE when necessary only. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-13Started the real code on the Qt Interface.Gravatar Tomaz Canabrava
1 - Open File already open files, it tries to not break the Gtk version, but some methods on the GTK version still need to be called inside Qt because the code is too tight-coupled. 2 - Close file already close files, same comments for the open file dialog applies here. 3 - The code for adding new cylinders in the cylinder dialog is done, already works and it's integrated with the system. There's a need to implement the edit and delete now, but it will be easyer since I'm starting to not get lost on the code. 4 - Some functions that were used to convert unities have been moved to convert.h ( can be changed later, put there because it's easyer to find something that converts in a convert.h =p ) because they were static functions that operated in the GTK version but I need those functions in the Qt version too. [Dirk Hohndel: lots and lots of whitespace and coding style changes] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-12Add dive list view to main windowGravatar Amit Chaudhuri
Add files for dive list model/view implementation. Replace TableView with the custom list view. Amendments to makefile to match. Note: we don't yet handle trips and may want to add additional columns to describe the dive. A single, dummy dive is added to show how this works (get root; item is child of root). Purely to illustrate - needs proper integration etc. Amend member names for dive list view components Various naming changes to conform to coding style. Required changes to members (remove prefix) and methods (avoid clash with members). Clean up indentation (swap spaces for tabs). Code for model/view was written with a different editor which had different settings :-/ [Dirk Hohndel: minor whitespace cleanup] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10Update .gitignoreGravatar Alberto Mardegan
Ignore some moc/uic-generated files. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-10MainWindow: remove useless includeGravatar Alberto Mardegan
This was accidentally reintroduced by a previous commit, and was causing a moc warning. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-10Add logic to switch viewsGravatar Amit Chaudhuri
Rename the 3 main widgets in the Qt mainwindow. Wire view menu options to the setVisible methods of same. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10Avoid C++ style streamsGravatar Henrik Brautaset Aronsen
As Thiago wrote: qDebug("actionNew") also works. The current policy is to avoid C++ style source code as much as possible. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09Add stub slots for all menu itemsGravatar Amit Chaudhuri
Naming of QActions was inconsistent wrt abbreviations - fixed. Add stub slots for each action relying on connect by name. Add qDebug() message to allow people to check that menu items fire slots; not really necessary but may provide some reassurance as we build familiarity with Qt. Some changes to display text for menu items (e.g. Tree becomes View All). Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09Makefile: detect which files need moc and uicGravatar Alberto Mardegan
Add some magic rules to detect which files need to be processed by the moc or uic tools, as well as a way to manually specify exceptions. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09Make Qt branch cross-build for WindowsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09Add a slot to mainwindow but amend to use Q_SLOTSGravatar Amit Chaudhuri
For some reason, 'private slots:' causes a build error but private Q_SLOTS: works. The error was that 'slots' did not name a type and it appeared to be insensitive to whether the Makefile rule for .moc was in its current place or preceeded the rule for .cpp. Add a slot using the connectByName idiom e.g. actionNew connects to slot on_actionNew_triggered(). Use qDebug to show this fires if the menu option is selected. Above to demonstrate how to begin to link menu to code paths. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-08Change tab widget names.Gravatar Amit Chaudhuri
Names for individual tab widgets were not specific and caused warnings from UIC. Rename the individual widgets to reflect purpose. [Dirk Hohndel: removed some of the hunks that appeared to be unintentional changes not mentioned in the commit log] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-08Remove the toplevel ui directoryGravatar Dirk Hohndel
This is fron Alberto's first stab at MainWindow, but Tomaz is doing all this work in the qt-ui directory now... Reported-by: Pierre-Yves Chibon <pingou@pingoured.fr> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07Forgot to add planner-gtk.cGravatar Dirk Hohndel
Oops Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07Fix some of the gcc-4.8 warningsGravatar Dirk Hohndel
Most of the warnings are IMHO false positives: e.g.: an enum variable is initialized in a switch statement that has a case for each possible enum value - yet gcc 4.8 warns that it could be used uninitialized; or: two variables are initialized together in the code - second one of them is previously initialized to -1 at declaration time, both are initialized in an if (second one == -1) clause - so they are guaranteed to both be initialized... I did not "fix" those as the code is actually correct. But there are three spots where it catches things that could indeed go wrong (with odd input data in one of them). This commit also adds a check to only call g_type_init() for older versions of glib as in newer ones it is deprecated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07Separate Gtk related code from core logic: plannerGravatar Dirk Hohndel
Relatively straight forward, just a handful of places where we call show_error() (a UI function) from the logic code. In the process I noticed a few places where error returns weren't dealt with correctly. Added a new planner.h files for the necessary declarations. This should make no difference to functionality. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07Start creating the Qt UIGravatar Tomaz Canabrava
This is based on several commits from Tomaz - mingled together and mildly extended by Dirk (mostly Makefile hacking). All Qt UI related stuff should eventually move into the qt-ui directory. So the Makefile rules for moc and uic have been adjusted accordingly. The MainWindow class has been moved into its own file in qt-ui (but just with a placeholder, the existing class has simply been ifdef'ed out in qt-gui.cpp for the moment). We still have a couple of Qt things in qt-gui.cpp in the main directory... all this needs to move into the qt-ui directory and be built with separate .h files. Right now we have the one-off Makefile rule to create the qt-gui.moc file from the qt-gui.cpp file. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-06Continue to separate Gtk related code from core logic: divelistGravatar Dirk Hohndel
Move some more logic out of the divelist-gtk.c file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-06Separate Gtk related code from core logic: divelistGravatar Dirk Hohndel
This is simplistic & brute force: any function that touches Gtk related data structures is moved to divelist-gtk.c, everything else stays in divelist.c. Header files have been adjusted so that this still compiles and appears to work. More thought is needed to truly abstract this out, but this seems to be a good point to commit this change. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-02Add a Qt main windowGravatar Alberto Mardegan
This is just an empty window with a File menu and a few items. It shows how to hook up functions to menu actions. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-02Move set_filename() calls outside of parse_file()Gravatar Alberto Mardegan
Remove the boolean parameter from parse_file; the code is more readable by having an explicit call to set_filename() where necessary, rather than a boolean parameter. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-01Improve Makefile rules for running mocGravatar Alberto Mardegan
The previous rules were conflicting, and the naming of the moc-generated file to be included in .cpp files was deviating from what's most used in Qt: the usual way is to #include "file.moc" and not #include "file.moc.cpp" Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-01Define QT_NO_KEYWORDSGravatar Alberto Mardegan
This prevents Qt headers from defining macro symbols such as "emit" and "signals", therefore avoiding conflicts when struct members with the same names are defined in some C header. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-01Match subsurface_get_conf* in windows/macos.c with linux.cGravatar Henrik Brautaset Aronsen
The signatures for subsurface_get_conf* in windows.c and macos.c was slightly different from those in linux.c, which broke the build (at least on Mac). Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-01Introduce QApplicationGravatar Alberto Mardegan
Instantiate a QApplication and let Qt handle the event loop. Add a QTranslator subclass to translate the UI via gettext. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>