summaryrefslogtreecommitdiffstats
path: root/qt-ui/templateedit.cpp
AgeCommit message (Collapse)Author
2015-10-30Move qt-ui to desktop-widgetsGravatar Tomaz Canabrava
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-18Print: remove the warning about editing bundled templatesGravatar Lubomir I. Ivanov
Bundled templates can no longer be edited, because copies are made in the user directory. The TemplateEdit special case warning is no longer relevant so it can be removed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Printing: minor fixes as suggested by LubomirGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Printing: Remove braces around single lines in if/thenGravatar Gehad elrobey
Remove useless braces around single line if/then. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Printing: make statistics template editableGravatar Gehad elrobey
Now inplace edit is supported, so enable editing the "Default" statistics template, Also show warning when editing this template. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Printing: show warning message when editing bundled templatesGravatar Gehad elrobey
When editing a bundled template show warning message. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Printing: support in-place editing for templatesGravatar Gehad elrobey
Edit the templates into the same file, which is more intuitive as Custom.html is a bit confusing. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22Printing: disable template editing for statistics templatesGravatar Gehad elrobey
Editing statistics templates is not supported now, as there is no custom template for statistics printing, so disable the template edit area. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22Printing: fix typo in template nameGravatar Gehad elrobey
Template names was capitalized, so change the file name to "Custom.html" instead of "custom.html" 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: 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-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-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: 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-20Printing: add default case to switchGravatar Gehad elrobey
Add default case to fix switch warning. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: change 'Discard' to 'Cancel' buttonGravatar Gehad elrobey
Cancel button is more relevant to the dialog message. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add custom color paletteGravatar Gehad elrobey
We can use custom color palette to edit current color palette. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: implement edit buttons in color tabGravatar Gehad elrobey
Add button group and attached edit buttons to it. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: show colors in edit tabGravatar Gehad elrobey
- Add default color struct - Init the color struct with default colors - Show color text in labels - Preview colors Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: update preview on field changesGravatar Gehad elrobey
- Trigger re-rendering on the QPixmap if fields changed. - Change template selection to custom if template text changed. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: update preview on apply settingsGravatar Gehad elrobey
On update call Printer to render on the QPixmap. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add apply button to TemplateEdit classGravatar Gehad elrobey
Add apply button to the dialog, Update the preview after applying the new settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: save only if data is changed in template_optionsGravatar Gehad elrobey
Check if data is changed before saving the new settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: add preview to TemplateEdit dialogGravatar Gehad elrobey
Show QPixmap in QLabel, Use Printer class to render the Preview on the QPixmap. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: show confirmation message before overwriting the templateGravatar Gehad elrobey
Before overwriting the new template show confirmation message. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: implement QPlainTextEdit in TemplateEditGravatar Gehad elrobey
This is the main area to edit the templates inside Subsurface. Whenever the user edits a template the edited template is saved in custom.html and custom.html is considered the selected printing template. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: move template_options to print_options.hGravatar Gehad elrobey
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add QSettings for TemplateEdit classGravatar Gehad elrobey
TemplateOptions struct must be saved to QSettings after the window is closed, also it must be recalled when initializing the window. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add template_options struct that contains templateGravatar Gehad elrobey
The template_options struct holds the settings variables in the code. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add TemplateEdit form to source treeGravatar Gehad elrobey
The TemplateEdit class works to customize the tempalate before printing, User can select the font-size, font-type, color-palette, linespacing and editing the template HTML code. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>