summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-12-04PrintDialog: add separate Preview/Print buttonsGravatar Lubomir I. Ivanov
We rename our old 'Print' button to 'Preview' (as it did just that), and add a new one called 'Print' which does the direct printing, by creating a QPrintDialog instance. Both buttons are located on top of the dialog for now in a QHBoxLayout. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04PrintDialog: change a commentGravatar Lubomir I. Ivanov
The entire dialog is 'temporary' and should be replaced, so we slightly modify the comment about the PrintOptions widget. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04PrintDialog: add a progress bar in the dialogGravatar Lubomir I. Ivanov
This dialog will be eventually replaced by a better one, but for now we can add a progress bar to it. Next step would be to add separate Print/Preview buttons and emit progress bar updates from the PrintLayout class. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-03Correct parameter namesGravatar Dirk Hohndel
It's very confusing when a parameter is called "minutes" but holds seconds... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Fix bug in creating dive plan from diveGravatar Dirk Hohndel
We don't want to add the last sample - the dive plan functions want to figure out the path to the surface by themselves and get confused by this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Attempt to fix the 'click goes to 0,0' thing on the globe.Gravatar Tomaz Canabrava
This patch attempts to fix the 'click goes to 0,0' bug on the globe. it moves a bit of code around and I particulary don't like the way that we are dealing with 'EditMode', I think I'll refactor that for 4.1. We are alredy dealing with a bunch of states, maybe a State Machine will help on removing code-complexity. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Select the newly added dive after adding it.Gravatar Tomaz Canabrava
Selects the newly added dive after adding it, it uses a rather ugly hack that forced a unselected dive to be marked as 'selected' so we can remember what was the newly added dive, and select it after. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Disable calc_ndl_tts for printGravatar Anton Lundin
NDL and TTS doesn't show up in the printed profiles, and it takes significant time to calculate, so just don't do it. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Don't call fixup_dive when editing a tripGravatar Dirk Hohndel
When editing a trip the key for the notesBackup is NULL. Don't call fixup_dive() on that... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Make sure the save/cancel message is always shownGravatar Henrik Brautaset Aronsen
An addition to the "Move dive notes edit message above the scrollable widget" commit: Make sure the save/cancel message is always displayed on top, regardless of which tab is selected. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Text cleanup to amend lacking consistencyGravatar Henrik Brautaset Aronsen
- Removed the "Visible:" header on the column selector. It doesn't have to be there, and it's not in the similar equipment column selector - PO2 --> pO₂ (and others) - Use same initial case in the units selector in preferences Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Add legend for the Partial Gass Pressure if active.Gravatar Tomaz Canabrava
This patch adds legend for the partial gass pressures if the graphs are active. when enabling / disabling the square that represents the color of a gas will also appear / disappear. Fixes: #272 [Dirk Hohndel: minor changes to layout and whitespace] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Move dive notes edit message above the scrollable widgetGravatar Henrik Brautaset Aronsen
The "Save" and "Cancel" buttons disappeared when scrolling to the bottom of the notes widget. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03More strings to be translatedGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Fix ignoring empty selections on the globe and code cleanup.Gravatar Tomaz Canabrava
If the 'mouseClicked' didn't get any dives at the click-geolocation, ignore it and do not try to select an empty selection. this was causing a lot of issues when map-navigation. Also, good deal of code cleanup. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Make dive edit message box tex more conciseGravatar Dirk Hohndel
commit 3c064d58578f ("Make the message when editing a dive fit better") kinda fixed the wrong problem. A better solution was suggested - just drop the instructions regarding Cancel / Safe. It's quite obvious what to do mow that the buttons are part of the message. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Don't store translated standard weight system namesGravatar Dirk Hohndel
For the names that we have in our "default set" we need to store the English name so Subsurface will "do the right thing" when opening the file in a different locale. With manually entered names in a local language there's not much we can do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Remove unused variableGravatar Anton Lundin
Leftover from previous code that called get_gas_string Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Move code outside of for-loop.Gravatar Tomaz Canabrava
This piece of code didn't need to be on the for-loop, so let's remove it out of it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Huge speedup when selecting Dives from the Globe View.Gravatar Tomaz Canabrava
The old code ( slow++ ) ignored that each new dive-selection we recreated all information on the profile window, so this version ( a lot more verbose, I know. ) will ignore all dives that are being selected and will only send the 'dive was selected' information in the last line of the algorithm, instead of calling it for each dive on the list of 'to be selected' dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Third time's a charm: translating weight system descriptionGravatar Dirk Hohndel
Still trying to fix the same issue that I already tried to address in commit e0b70b82cad9 ("Fix translation of weightsystem names") and before in commit dc03b7e7d689 ("We need the correct context to translate event names"). I missed the WeightModel. Hopefully this was indeed the real fix. Fixes #312 (I know, I keep saying that) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Make the message when editing a dive fit betterGravatar Dirk Hohndel
This should keep the message widget visible without horizontal scroll bar, even on fairly small screens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Removed The button box from mainwindow, buttons are now on the message.Gravatar Tomaz Canabrava
The button box on the bottom of the window made it a bit cluttered on small screens, this patch uses the window of the MessageWidget to show the butons - this way less space is used and things are better spaced on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Fixes Setting the dive-location via the map.Gravatar Tomaz Canabrava
This patch adds a context menu to set the dive location via the globe, being the dive with a coordinate or not. It also fixes setting the dive location on edit mode. Fixes: #315 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02MainWindow: store the window maximized stateGravatar Lubomir I. Ivanov
We add the "maximized" entry for the settings group "MainWindow", and store it on close, so that the window state is the same on the next run. But then also, we only store the window size and resize to that size if not maximized. This attempts to preserve a "restored" window size. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Fix translation of weightsystem namesGravatar Dirk Hohndel
This is very much the same as in commit dc03b7e7d689 ("We need the correct context to translate event names"). I didn't pay enough attention when reading the bug report and missed that the weight system names were also not correctly translated. Fixes #312 (I hope this time for real) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-01Reflect air and water temperature changes in dive infoGravatar Dirk Hohndel
When editing air or water temperature, you are actually editing the information in the active divecomputer structure. But the Dive Info shows the summary data created from the temperature data in all dive computers. For most people who will only ever have one divecomputer per dive this may seem like an artificial distinction, but it's very important if you track more than one computer. So in order to have an edit reflected in what's shown, we must redo the "summary creation" for data from the different divecomputers into the summary fields of the dive. Fixes #313 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-01We need the correct context to translate event namesGravatar Dirk Hohndel
Qt assumes that all strings are in the context of the class in which you use them. So when we want to display the translated event names from within the ProfileGraphicsView we need to make it explicit that these are strings that come from the C part of the code. Doing that showed another bug in the code where we foolishly compared the translated text to a fixed string. Not smart. Fixes #312 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30More strings for translationGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Add application icon to dialogsGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix all leak-at-exit from singletons in SubsurfaceGravatar Thiago Macieira
Subsurface creates a lot of singleton instances on demand, but nothing ever deleted them. Since they are singletons, these memory allocations are technically not leaks. However, they clutter the output in valgrind and other memory analysers, hiding the real issues. The solution is to delete these items at exit. For the models and for gettextFromC, the solution is to use a QScopedPointer, which will delete its payload when it gets destroyed. For the dialogs and other widgets, we can't do that: they need to be deleted before QApplication exits, so we just set the parent in all of them to the main window. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Delete the graphics items for the ticks and labels in the rulerGravatar Thiago Macieira
Ruler::updateTicks() was creating them, but nothing deleted them. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix memory leak of the MinMaxAvgWidgetPrivateGravatar Thiago Macieira
Found by Dr. Memory, run by Lubomir: Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes # 0 replace_operator_new [d:\drmemory_package\common\alloc_replace.c:2421] # 1 MinMaxAvgWidget::MinMaxAvgWidget() [qt-ui/simplewidgets.cpp:64] Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix uninitialised variable readGravatar Thiago Macieira
Found by Dr. Memory, run by Lubomir: Error #48: UNINITIALIZED READ: reading register al # 0 StarWidget::mouseReleaseEvent() [qt-ui/starwidget.cpp:29] Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Print: fix wrong Max. CNS / SAC columnsGravatar Lubomir I. Ivanov
Swap the places of the CNS and SAC values in the profile tables. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Print: add an icon for the print dialogGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Print: adjustments to PrintDialogGravatar Lubomir I. Ivanov
- Hide the sizeing sliders from PrintOptions. we don't really support any of those in PrintLayout and these are not that useful and easy to implement, until some sort of layouting/templating system is in place. - Move the 'Print' button on top as a workaround, since if it's bellow the print options it stays bellow an empty area where the now hidden sizing sliders are. - Resize the dialog to a smaller size Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Merge branch 'print' of github.com:neolit123/subsurfaceGravatar Dirk Hohndel
2013-11-30More strings to be translatedGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix dialog margins and spacingGravatar Sergey Starosek
Make it consistent with other application dialogs. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix string in About dialog for translationGravatar Miika Turkia
The translatable string in about dialog is truncated at the VERSION_STRING. Thus it has to be given as argument to the tr function. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix a crash when no trip existsGravatar Miika Turkia
When there are no trips at all, we have to skip the Yearly statistics alltogether, including the header line (that should display all the dives added together). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Print: yet another font adjustment for the profile tableGravatar Lubomir I. Ivanov
We now only use a slightly large font for the "Dive #" entry. All other font sizes remain at 9px. Another change is that we now attempt to use 11px for individual row height. This makes the table at least 12px bigger (n_rows * increment), but does not cut letters like 'g', which go slightly bellow the font baseline. Perhaps this can be improved later by adjusting the font and row sizes again. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Remove use of uninitialized variable nrGravatar Anton Lundin
nr was used but never initialized. Also, the code removed used select_dive had likely just been forgotten to be removed when the correct code using selectDive() was added a little later in the function. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Print: fix missing vertical line at the last columnGravatar Lubomir I. Ivanov
There was a line missing in the right-most column wrapping the table for the profile print. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Remove unused variableGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Reorder initializers to be more c++-strictGravatar Anton Lundin
c++ have some idea about in what order things should be initialized. This makes us comply with that order. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Minor text cleanupGravatar Henrik Brautaset Aronsen
Use the same case for the first letter in the dive table column headers, use '%' for both gases in the planner, and show "Start time" instead of "Starttime". Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Separate text labels for air and water temperaturesGravatar Henrik Brautaset Aronsen
The "air / water Temperatures" label didn't look to good. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30QT-UI: fix some typosGravatar Alexandre Belloni
Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>