aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-08-25fixing planner's gas dialogGravatar Danilo Cesar Lemes de Paula
Before this commit this dialog had a weird behavior in which when it was shown, the whole screen was still active. In case of a alt+tab, this dialog is sent to behind the application window, but still visible in the task bar. This commit basically changes this behavior to a regular pop-up. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
2013-08-25use QWebView to show the user manualGravatar Danilo Cesar Lemes de Paula
Looks like the QTextBrowser can't render the manual correctly. Also, QWebView provides a better way to find contents on a webpage, which is an important feature for an user manual (to be implemented). Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-08-13Compile fixGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-13Fixed a bug where the auto-completion would not work via commandline.Gravatar Tomaz Canabrava
Fixed a bug where the auto-completion would not work via command line, I fixed it by reloading the information of dives when a dive file is open via command line or via UI. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Added completion for buddy, divemaster, location and suit.Gravatar Tomaz Canabrava
Added completion for buddy, divemaster, location and suit. The completions uses some models that I created in the last commit - everytime that a divelog file is loaded, it creates a list of completion items. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Added classes to handle the Completion of Dive Editions.Gravatar Tomaz Canabrava
Added classes to handle the completion of dive editions, the classes are BuddyCompletionModel, DiveMasterCompletionModel, SuitCompletionModel and LocationCompletionModel, thanks to plain old C macros, code got really small. and I hope the logic is better than the Gtk version. :) Now next step is to integrate it to the Ui. shouldn't be hard. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Fixes showing the labels of divemaster and buddy after a trip selectionGravatar Tomaz Canabrava
This patches fixes showing back the labels 'Dive master' and 'Buddy' after a trip selection was done, then back to single dive selection. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-13Makes the 'auto' edition behave in a better way.Gravatar Tomaz Canabrava
This patch makes the auto editon behave in a better way, now you can scroll the notes widget without marking it as editable, and also adds a bit of code cleanup, and a better logic for editing the other widgets. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-08Use maxx from graphics context for time calculation.Gravatar Michael Andreen
Fixes #128. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-07ifdef out includes when we build without gtkGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Crude hack to stop the build from failing without asciidocGravatar Dirk Hohndel
This could be made much more elegant. For now it serves its purpose. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Delte the temporary dive from the divelist after calculating deco.Gravatar Robert C. Helling
This bug manifested itself as too long deco obligation when moving waypoints to later and then back to earlier times as all intermedite versions were created as dives in the divelist (and the saturation of these "previous dives" was taken into account. It is not entirely clear to me how the dive will be permanently added to the divelist once ok is pressed: One could in createDecoStops allocate struct dive from the heap rather than from the stack and return a pointer to it and which is then added to the dive list upon pressing ok. [Dirk Hohndel: add include file to make this compile] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Clean up code to remove false messages about errors in EclipseGravatar Benjamin
Imported the subsurface project into Eclipse to try and pull apart how it all works together. Added an include for profile.h and some brackets around a condition, but didn't make any functional changes (I hope). These 2 changes should be purely cosmetic. Signed-off-by: Benjamin Fogel <benjaminfogel@yahoo.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Print: improve table printing by using QTableViewGravatar Lubomir I. Ivanov
The current QTextDocument implementation is slow due to HTML parsing. By using QTableView with QAbstractTableModel we boost the performance of the table print drastically. This patch completely replaces the old solution. There is a hidden QTableView widget which is populated with all data and rendered using a QPainter attached to the printer device. A couple of new classes are added in models.h/cpp that handle the table print model and these are then used in printlayout.h/cpp. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Fix " begin" and " end" for events in plot.Gravatar Michael Andreen
QObject::tr() has source string as first argument and disambiguation as second argument. Currently the events shows "Starts with space!" instead of " begin" or " end" after the event name. Signed-off-by: Michael Andreen <harv@ruin.nu> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Support more than one event of the same type in Qt tooltip.Gravatar Michael Andreen
Since the tooltip text was used as key in the map, two events of the same type, close to eachother, would cause one of them to not be removed. Since ToolTip::removeToolTip() isn't used, we don't need a QMap and can use a QList instead, so all tooltips are properly cleared. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Fix crash in DiveComputerList::addDC() when importing from DM4.Gravatar Michael Andreen
DiveComputerList::getExact() created a temporary QList with the DiveComputerNodes matching a specific model. A pointer to a node in the list was returned, which becomes invalid when the list goes out of scope and gets destroyed. Causing a crash when the model strings are compared later. Instead of using contains() and creating a temporary list, we can just use an iterator, which should be both faster and safer. The crash is easy to trigger with DM4 imports, but can probably be triggered in other cases too. Similar problem with DiveComputerList::get(). Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-21Added the possibility to choose gases in the planner.Gravatar Tomaz Canabrava
Added the possibility to choose gases in the planner, now the user should click on the name of the gas, a popup window will appear, asking the user to choose what gas he wants for that ascent / descent. now we need to hook that up with the createDecoStops method that calculates the decompression. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added a missing #UNDEFGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Good code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added the current gas used on the plannerGravatar Tomaz Canabrava
Added the current gas used on the planner, now it's a matter of choosing the new gas, that will be done in the next commit.e Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Removed unused code.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added button to reduce dive time on the planner.Gravatar Tomaz Canabrava
Added a button and a method to reduce time on the dive planner. The dive planner will not reduce below deco-time and it will also not reduce below TIME_INITIAL_MAX. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added ( finally ) the code to reduce depth on the plannerGravatar Tomaz Canabrava
Added the code to reduce depth on the planner. Depth cannot be lower than 40m and it also won't let the user reduce if there's any point on the 'reduced' area. the icon is ugly - we need an artist. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-19Fix compile on clean sourceGravatar Miika Turkia
Fixes #163 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-18Fixes incorrect editing policies.Gravatar Tomaz Canabrava
The Working Press didn't correctly updated when there was a 'bar' or 'psi' in the string ( and that was defalt behaviour ); The o2 didn't correctly updated when there was a '%' on the string (and that was default behaviour ), The He didn't correctly updated when there was a '%' on the string, and that was also default behavior. Now all of them correctly updates. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-18Added the code to revert Weigths when user cancels editionGravatar Tomaz Canabrava
This is a follow up commit to the previous one that enabled cancel for cylinders, everything in the commit log for the cylinders also applyes here. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-18'Cancel' action Cancels editing Cylinders.Gravatar Tomaz Canabrava
Made the default 'Cancel' action correctly cancel the cylinder edition. This is needed only because we bypassed the default behavior on Qt that took care of this, because we wanted to have more control on how the view would update the items accordingly with wich one of the cylinders were selected on the edition pane - the pressure and size of the cylinders needed to have it's data set, but the Qt Model/View system *thinks* that cancel-edition is simply 'do not commit the edition data, then.' wich would not work with us, because we passed the strange data already. So, I created a backup data that serves us very well. When the user cancels, this backup data is added back on the cylinder, making everything as it was before. [Dirk Hohndel: removed the inadvertendly added boost header] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-18Ask Qt to use system proxies in SubsurfaceGravatar Thiago Macieira
This causes the Marble widget to use proxies automatically too. On Mac, this gets the global proxy settings; on Windows, it gets the IE settings; on Unix, it uses environment variables (set http_proxy and all_proxy). Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-18Colors: a couple of grayscale color tweaksGravatar Lubomir I. Ivanov
change the B/W color (index 1) of some of the colors - e.g. BACKGROUND, ALERT_FG. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Profile: support grayscale plottingGravatar Lubomir I. Ivanov
This patch adds the getColor() helper function to ProfileGraphicsView and EventItem so that retrieving a certain color can depend on a 'isGrayscale' flag. This flag is private and only set by ProfileGraphicsView::setPrintMode() at this point. EventItem also now accepts 'grayscale' as a constructor argument. A couple of side modifications are: - move setBackgroundBrush() to ProfileGraphicsView::plot() - set the same pen color as brush color for the dot in the '!' symbol inside EventItem::EventItem(). TODO: look for color issues when printing using the custom grayscale table Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Print: pass grayscale flag to setPrintMode()Gravatar Lubomir I. Ivanov
We pass the value of 'color_selected' stored in the print options to ProfileGraphicsView::setPrintMode(). This way the profile can be printed in grayscale internally instead of converting a QPixmap to grayscale. There are a couple of questions here: 1) Are all the 'if/then' checks for all individual colors faster than the direct QPixmap/QImage grayscale coversation. 2) The direct grayscale conversation does not give control of individual colors, but can it look actually better? Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Profile: add the isGrayscale flagGravatar Lubomir I. Ivanov
setPrintMode() can now be used to set the profile to be plotted in grayscale. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Print: add method to convert profile to grayscaleGravatar Lubomir I. Ivanov
(experimental) Add the method PrintLayout::convertPixmapToGrayscale() to convert a rendered profile pixmap to grayscale. It will probably be faster to have ProfileGraphicsView render in grayscale under certain conditions (and use a specific color table) instead - e.g.: ProfileGraphicsView::setPrintMode(bool printMode, bool useGrayScale); Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Print: add experimental code for printing profilesGravatar Lubomir I. Ivanov
PrintLayout::printSixDives() goes trough all dives and prints their profiles on full portrait pages. This method is based on resizing the ProfileGraphicsView widget, plotting each dive and then 'grabbing' it using QPixmap::grabWidget(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Profile: use a printMode flag in ProfileGraphicsViewGravatar Lubomir I. Ivanov
When printing the profile there are certain features which we want different (or disabled). This includes font scale ignoring and showing a toolip. To achieve that we check for a printMode flag in ProfileGraphicsView which can be set using setPrintMode(bool). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Print: improve new page detection in table printGravatar Lubomir I. Ivanov
There is a potential issue when placing a heading on a new page. If the height of a data row is larger of that of a heading, a new heading can end up at the bottom of a page leaving that page with two headings. To solve that we add line breaks (<br>) until the new page is reached and add the heading there. Algorithm assumes that the height of a heading is larger than a line break. Also it is now obviously even slower. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Print: support any resolution for the table printGravatar Lubomir I. Ivanov
QTextDocument uses a separate painting device, thus we need to pass our QPrinter instance which may have a resolution different from the screen resolution. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18Don't set if equal, on edit cylinders and weigth types.Gravatar Tomaz Canabrava
Don't set the cylinders and weight types if they are the same than before, this fixes a bad thing that happened when playing with the values. it could blank out the values carefully chosen by you. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-17Adds Single-Click editions on the TableViewGravatar Tomaz Canabrava
This is a linus request, adds a Single-click edition on the tableview to make it more consistent with the rest of the interface where edition is permitted. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-17Added EnterKey to finish edition on Cyl/Weigths with the popup openGravatar Tomaz Canabrava
So, I used the Qt Event Filter strategy to bypass the normal role of user interaction, the Qt ComboBox needed 2 keypresses to close and edit. so I grabbed the first one and send together a second one. Há. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16Fixes the Combobox behavior on the inline-editGravatar Tomaz Canabrava
This patch fixes the combobox behavior on the inline edit to what it was ( well, similar to ) the GTK version, up and arrow keys will walk you to the list of choices, and it will update the other data as soon as you walks over it one drawback is that you cant ( for now, since I do have a very big headache at the moment ) cancel, since the cancel will just forgets the item and do not call 'setData' on the model, but we already called it while walking on the list. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16Support for key_up and down in the combobox delegate.Gravatar Tomaz Canabrava
Adds spport for key_up and key_down in the combobox delegates, now when you press key_up or down, it will show the list of choices instead of going one-by-one in the lineedit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16Clear multi-line string separator on the c++ code.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16Fixeda a typo that got the 'x' value where the requested one was actually y.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-11About: improve dialog layoutGravatar Lubomir I. Ivanov
This modifications makes the About dialog spacing more consitent with different font sizes. Tested on Ubuntu 12.04 with the 'Universal Access->Text size' settings. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-11Print: mark some functions in PrintLayout as 'const'Gravatar Lubomir I. Ivanov
It might be a good practice to declare certain class 'helper' functions as constant members. But I don't think there are performance benefits to that other than the readability ones. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-11Print: complete columns for the table printGravatar Lubomir I. Ivanov
We use the DiveItem struct from models.h so to ease the display of date, depth and duration. All columns present in the GTK build are now displayed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-11Models: add the DiveItem::displayDate() helperGravatar Lubomir I. Ivanov
Add this helper so that we can easily wrap the required memory release after calling get_dive_date_string() (fixes a small memory leak). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-11Models: move the declaration of DiveItem to the headerGravatar Lubomir I. Ivanov
This should allow external use of the type by including models.h. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>