aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2013-07-11Print: show column titles for table printGravatar Lubomir I. Ivanov
Patch does: - set individual column width and name (held in tableColumnNames, tableColumnWidths) - reduce font size in the table - more small tweaks in the style sheet TODO: finish printing all dive data Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-11Print: move some header includes to cpp filesGravatar Lubomir I. Ivanov
We don't really need includes of display.h and dive.h in printoptions.h and printlayout.h or forward declartions of 'struct dive' and 'struct options' in there. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: cleanup for PrintLayout::printTable()Gravatar Lubomir I. Ivanov
also includes: - experiment with colored background for headings - experiment with 'left' alignment for headings ('th' tag CSS does not support 'text-align') - whitespace fixes Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: use the actual dive tableGravatar Lubomir I. Ivanov
Currently only for the table print, but now we use the actual dive table to iterate trough all dives (find only selected if needed) and print their 'number' element in table rows. Also improves the new-page detection algorithm slightly. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: initial implementation of the table printGravatar Lubomir I. Ivanov
PrintLayout for now only handles the table print, while the data output itself is work in progress. For now there is a simple HTML/CSS table logic based on QTextDocument. There is an iterative algorithm which listens for a page increase and adds a heading on top of the new page. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: add a print preview for testing purposesGravatar Lubomir I. Ivanov
Use a QPrintPreviewDialog, while the print logic is WIP. This way Qt will show the print output in a window instead of exporting to a file and opending it manualy. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: add a setup() method to PrintLayoutGravatar Lubomir I. Ivanov
The setup() method will be called each time to obtain the current printer settings. Also it calculates required scalling based on screen agains printer DPI. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: add a class for print layoutingGravatar Lubomir I. Ivanov
PrintLayout is a class that will handle the layouting part of dive profiles, text, tables depending on the settings of a QPrinter and the PrinterDialog and PrintOptions instances. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: connect all the options widgets to slotsGravatar Lubomir I. Ivanov
By connecting to slots we always modify values at a previously set 'struct options' pointer. Also have the setup of slots and pre-set values in a separate setup(struct options *) function. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: correct tab order in the options widgetGravatar Lubomir I. Ivanov
Tab order should begin from the topmost widget and then descend towards the bottom end of the dialog. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: label update on height slider moveGravatar Lubomir I. Ivanov
The PrintOptions widget has value labels next to the horizontal sliders. Add slots to update these labels when a slider moves. Patch also makes a modification so that the PrintOptions constructor requires a 'struct options' pointer. If an options struct is not received we do not set predefined values and do not connect signals to slots, where options will be updated immediately. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-09Print: further adjust the print options widget UIGravatar Lubomir I. Ivanov
Makes the controls less cluterred on Ubuntu. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-09Print: add all controls to the print options widgetGravatar Lubomir I. Ivanov
- adds missing file printoptions.ui - adds all controls present in the GTK version of the print dialog custom tab Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-09Print: add UI for a print dialogGravatar Lubomir I. Ivanov
PrintOptions is a QWidget class to be used as an addition to a future print dialog (possibly based on QPrintDialog). Currently only contains a couple of radio buttons. PrintDialog (printdialog.cpp/h) which is a basic QDialog is currently added for testing only and it holds an instance of PrintOptions. Calling File->Print opens this test dialog for now. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-05Calculate deco stops, TTS and NDLGravatar Anton Lundin
Calculate TTS and NDL, and Deco stops when they don't already exist in the samle and show them in the mouse-over. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-05Profile: prevent a bug when switching viewsGravatar Lubomir I. Ivanov
While in zoomed mode and when resizing the splitters or switching views the profile tooltip can end up being at the wrong location and also the zoom state becomes corrupt, so perhaps the entire transformation needs to be reset. To prevent the bug we listen for relevent to the profile splitter resize event, view changes and clear()/plot() the entire profile graphics. This is an slow/expensive solution and perhaps there are cheaper alternatives e.g. updating only the scene rectangle and tooltip, somehow. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-05Profile: improve tooltip animationGravatar Lubomir I. Ivanov
Remove a couple of expand() calls(?). Also store the last expanded rectangle size in the private variable nextRectangle and use that in collapse() animation. Patch prevents a small jump/resize glitch if the user quickly hovers over and out of the profile while the tooltip is still resizing. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-05Profile: small tweak for tooltip separator lineGravatar Lubomir I. Ivanov
Add 3px of a initial horizontal offset. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-05Profile: collapse tooltip back to original heightGravatar Lubomir I. Ivanov
When collapsing the tooltip we want it's border to become the same height as when no tooltip info was visible - i.e. post creation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Fix Uemis Zurich downloadsGravatar Linus Torvalds
Commit 48ba01b807cc ("Enable downloads from the UEMIS Zurich") mistakenly switched the meaning of the "force_download" argument when it moved from "struct argument_block" to being a direct argument. This fixes it right back. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Qt: Implement trip merging logicGravatar Linus Torvalds
So during my Maui trip, I had a short hiatus in diving, causing subsurface to start a new trip for the last day of diving. I could have just started the old gtk branch to fix it up, but decided that I might as well try to implement the "merge trip" logic in the Qt branch instead. This is the end result of that. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Profile: attempt on better zoom and pan logicGravatar Lubomir I. Ivanov
QGraphicsView::AnchorUnderMouse does not work for Qt 4.8.1 on Ubuntu 12.04 and if the mouseMoveEvent overload is disabled it practically can be seen that the anchor point is [0, 0] instead of the mouse location. After a suggestion found on the web this patch attempts to use the hidden scroll bars to calculate reposition on pan and zoom *near the mouse cursor. On the other hand QAbstactSlider (QScrollBar) class strangly uses negative offsets for minimum scroll position, which makes the implementation even more ugly. [*near] because it's not that accurate! Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Profile: use more levels of zoomGravatar Lubomir I. Ivanov
Makes it easier to see colored lines - e.g. velocity with 20 levels of zoom. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Profile: prevent a zoom glitch at maximum zoom levelGravatar Lubomir I. Ivanov
The 'else if' condition in ProfileGraphicsView::wheelEvent() is causing a zoom-in / zoom-out loop at zoomLevel = 10. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Added a messageBox when the planner quits with a working plan.Gravatar Tomaz Canabrava
Added a messageBox to warn the user that he quit with a working plan, to reduce the risk of unwanted loss of work. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Added the left / right shortcuts for moving the handlers around in time.Gravatar Tomaz Canabrava
Added the left / right shortcuts for moving the handlers around in time, this also made me wonder why we have the 'previous dc' on the menu, it got actually to broke my code on the shortcuts for the planner because they are active everytime - should they be active only when the profile's visible or they serve any other purpose? If they serve only for the profile, I'll get them out of the menu and put them in their proper place - the profile view. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>