aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2015-08-15Printing: disable ui elements on statistics printGravatar Gehad elrobey
Disable all the UI elements for "dive list print", disable all the template settings as well, Template Edit button will be enabled after statistics print supports color palettes. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: export border to templatesGravatar Gehad elrobey
As there is a problem with sizing the borders in QWebView, "vw" sizing is not working as supposed with border-width, As a workaround we export border-width dynamically, so that border-width is relatively the same for all page sizes. The border-width is equal to the page width / 1000 which gives a nice range for borders for A0 - A5 papers, Also prevent drawing zero pixel borders and use 1 px borders as the minimum border. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: rename "Table cells" to "Table cells 1"Gravatar Gehad elrobey
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: make default borders blackGravatar Gehad elrobey
Make all borders black by default. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: replace dark and light colorsGravatar Gehad elrobey
Make dark colors for headers while lighter colors for data fields, this is more intuitive, and makes the palettes more appealing. Make dark color default for cells2 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: add another color in color palettesGravatar Gehad elrobey
Add another color 'Table cells 2' to the color palette, make all the backgrounds solid white by default. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: add statistics printGravatar Gehad elrobey
Add statistics table print option. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: hide warnings in dive profile while printingGravatar Gehad elrobey
While printing only draw headings, SP changes, gas events or bookmark events, otherwise don't show anything. Many warning logos can hide the useful information especially in templates with small dive profile area. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Remove title of the dive site tab editGravatar Tomaz Canabrava
There's no need to show the 'dive site' name on the group box Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15Printing: fix TemplateEdit color selection bugGravatar Gehad elrobey
When choosing a color from the QColorDialog, the TemplateEdit trigger to change the current selected template to be custom, and then changes the selected color. When the selected template is changed old template values are copied to the current template which results in incorrect behaviour. This is fixed by checking for the current editting state before setting the saved palettes as the current used palette. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: fix wrong custom palette indexGravatar Gehad elrobey
The custom palette index is defined by the CUSTOM directive, and it should be used. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: don't save invalid colorsGravatar Gehad elrobey
When QColorDialog is closed with 'Cancel' button, it returns invalid color that must be discarded. So check if color is valid to prevent replacing the current color with black. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Minor code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15Change colors of stars if widget has focusGravatar Tomaz Canabrava
Some widgets on the main tab don't show any kind of focus indicator on some systems (like Mac), so it's a good thing to provide another way to show that they indeed have focus. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15Remove obsolete commentGravatar Tomaz Canabrava
We don't allow building against Qt4 anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15Add DiveSitePicturesModelGravatar Tomaz Canabrava
This model should be used inside the Edit Dive Site mode. It should display all photos from all dives that are part of this dive site, ignoring trips. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-09Set proper mode for file open dialogGravatar Miika Turkia
Fixes #913 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-09Update the text if DC changesGravatar Miika Turkia
When switching from one DC to the next, the text of DC name is not updated due to commit 487ddce3531f6b738affc84edf066bd0ea4a16bb. This patch re-inserts the call to updateText() for the specific function to get the DC name updated properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-03Make debugging cleanerGravatar Robert C. Helling
Don't try to connect the globe when NOMARBLE is active. Check exisistance before trying to open an image file. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Another fix to build with NO_MARBLEGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Enable building with NO_MARBLE againGravatar Dirk Hohndel
This was broken in commit 7efa92406794 ("Transform GlobeGPS in a static instance() class"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Fixed layout spacing issues.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Repopulate the labels on the globe after an editGravatar Tomaz Canabrava
Strangely, it still doesn't show the flag where it should be (but it shows just after a reselect, so it's mostly a cache issue somewhere) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Paint the coords-widget yellow after clicking on the globeGravatar Tomaz Canabrava
When we clicked in the globe and changed programatically the text on the coordinates edit widget, the background was still white instead of the bright yellow that it should have to show that it was modified. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Save the gps edit into the current dive_siteGravatar Tomaz Canabrava
The accept method didn't save the gps edit even if we put correct text on it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Change the coordinates via globe.Gravatar Tomaz Canabrava
Now when the user selects the dive site edit, the globe will enter in edit mode too. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Add a button to pick the coordinates via globe on the dive site editGravatar Tomaz Canabrava
It's a placeholder for now, but next commit will make it work. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Transform GlobeGPS in a static instance() classGravatar Tomaz Canabrava
This is needed to start easing the transition from the completely wrong and bogus MainWindow::instance()->globe() calls. this is still wrong, but with it I removed one level of indirection. I did that now because I wanted to not taint the location management when I use it to deal with the globe. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Correctly update the dive when the user edits dive_siteGravatar Tomaz Canabrava
We didn't correctly update the dive site as soon as the dive_site edit finished, and this time we are actually correctly updating things using signals instead of calling the mainwindow for everything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Remove unused signalGravatar Tomaz Canabrava
And move things around, informationManagementEnded was a good name but endEditDiveSite is better. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Remove unused action on the mainwindow.Gravatar Tomaz Canabrava
The Manage dive sites action should be in the View menu because it makes more sense to "view dive site edit" Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29Don't connect to the MainWindowGravatar Dirk Hohndel
We really shouldn't need to connect to the MainWindow in order to get the right scale for the fonts when printing. While printing likely will remain a desktop only function, this is just bad design. And making calls like this from the paint() function is a bad plan, anyway. So instead we make sure that every DiveTextItem knows what the printScale was when it was created (or actually, when the text was first set as they frequently get created before we have a scene which we use to get to the profile), and gets updated whenever that scale changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29Profile: make sure text is scaled correctly when drawnGravatar Dirk Hohndel
We had all this wonderful code to scale the text correctly, except we went out of our way to make sure the code wouldn't be called unless something changed on this specific text item. But that's bogus because the scaling depends on external factors like the fontPrintScale. So instead of calling updateText() when attributes of this DiveTextItem change simply call it right before the DiveTextItem gets painted. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29Make gradient factor text an independent item on the profileGravatar Dirk Hohndel
Having it as part of the DiveCalculatedCeiling class caused us to manage this text 17 times (and plotting it 17 times) which is rather silly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Printing: add new default color schemeGravatar Dirk Hohndel
This is based on the Subusrface logo colors, keeping the hue and modifying the saturation and value in order to get what to me looks like a fairly pleasant color setup. This is an attempt to come up with a good default. By all means, this is supposed to be a starting point to make it better, not a decision on what the colors should be. I would however claim that they are better than the previously available options :-) I like the idea of basing this on our existing colors - but even that is up for modification if someone has a better proposal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Seabear import: fix detection of empty linesGravatar Miika Turkia
The old code trusted in Windows new lines with length of 3. The new code strips out spaces and line ending chars resulting in empty line being of length 0. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Printing: safer Template->Import|Export handlingGravatar Lubomir I. Ivanov
Check if the file string is empty and return, else process it. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: select current template upon importingGravatar Gehad elrobey
When importing a template, make it the user currently selected template. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: choose first template if selected template is not foundGravatar Gehad elrobey
If user selected template is not found, we choose the first template as a default choice. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: don't name color templates with confusing numbersGravatar Gehad elrobey
Use the color_palette enum instead. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: add the "Shades of blue" color themeGravatar Gehad elrobey
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: support importing/exporting of templatesGravatar Gehad elrobey
Implement 'import/export' features, so it's easier to share customized printing templates. Also support deleting existing templates. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: add "Import", "Export" and "Delete" buttons for templatesGravatar Gehad elrobey
Use the button group to import, export or delete a template from the printing_templates directory. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: add member function to print optionsGravatar Gehad elrobey
Get the currently selected template. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: fix TemplateEdit layoutGravatar Gehad elrobey
Make the TemplateEdit dialog resizable. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: remove "Table" option from print options radio groupGravatar Gehad elrobey
"Table" print is now a template, so remove the radio button. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: fix issue with old QSettings groupGravatar Gehad elrobey
As I am using the same old QSettings group name, some variables may not be correctly initialized, so we need to check for incorrect values before we start. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: save/load selected template by QSettingsGravatar Gehad elrobey
We save the selected template name on closing the printDialog, We also load the last selected template from QSettings when initializing the dialog. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: use grantlee templates from the current existing template listGravatar Gehad elrobey
We use templates from the grantlee templates list created and dynamically. So we don't need static templates anymore. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28Printing: remove existing values in print template comboboxGravatar Gehad elrobey
We don't need static template names anymore. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>