QElectroTech
0.70
|
#include <templatelogomanager.h>
Signals | |
void | logosChanged (const TitleBlockTemplate *) |
Public Member Functions | |
TitleBlockTemplateLogoManager (TitleBlockTemplate *, QWidget *=nullptr) | |
~TitleBlockTemplateLogoManager () override | |
QString | currentLogo () const |
bool | isReadOnly () const |
void | setReadOnly (bool) |
Protected Member Functions | |
void | emitLogosChangedSignal () |
Private Slots | |
void | updateLogoInformations (QListWidgetItem *, QListWidgetItem *) |
void | addLogo () |
void | exportLogo () |
void | removeLogo () |
void | renameLogo () |
Private Member Functions | |
void | initWidgets () |
void | fillView () |
QSize | iconsize () const |
QString | confirmLogoName (const QString &) |
Private Attributes | |
TitleBlockTemplate * | managed_template_ |
title block template which this class manages logos More... | |
QVBoxLayout * | vlayout0_ |
QVBoxLayout * | vlayout1_ |
vertical layouts More... | |
QHBoxLayout * | hlayout0_ |
QHBoxLayout * | hlayout1_ |
horizontal layouts More... | |
QLabel * | logos_label_ |
simple displayed label More... | |
QListWidget * | logos_view_ |
area showing the logos More... | |
QPushButton * | add_button_ |
button to add a new logo More... | |
QPushButton * | export_button_ |
button to export an embedded logo More... | |
QPushButton * | delete_button_ |
button to delete an embedded logo More... | |
QGroupBox * | logo_box_ |
current logo properties box More... | |
QLabel * | logo_name_label_ |
"name:" label More... | |
QLineEdit * | logo_name_ |
current logo name More... | |
QPushButton * | rename_button_ |
button to rename the current logo More... | |
QLabel * | logo_type_ |
current logo type More... | |
QDialogButtonBox * | buttons_ |
ok/cancel buttons More... | |
QDir | open_dialog_dir_ |
last opened directory More... | |
bool | read_only_ |
Whether this logo manager should allow logo edition (renaming, addition, deletion) More... | |
This widget allows users to manage (list, add, edit, delete) logos embedded within a title block template.
Definition at line 27 of file templatelogomanager.h.
TitleBlockTemplateLogoManager::TitleBlockTemplateLogoManager | ( | TitleBlockTemplate * | managed_template, |
QWidget * | parent = nullptr |
||
) |
Constructor
managed_template | Title block template this widget manages logos for. |
parent | Parent QWidget. |
Definition at line 29 of file templatelogomanager.cpp.
References fillView(), and initWidgets().
|
override |
Destructor
Definition at line 40 of file templatelogomanager.cpp.
|
privateslot |
Ask the user for a filepath, and add it as a new logo in the managed template.
Definition at line 264 of file templatelogomanager.cpp.
References confirmLogoName(), QET::QetMessageBox::critical(), emitLogosChangedSignal(), fillView(), managed_template_, open_dialog_dir_, and QET::Icons::tr.
Referenced by initWidgets().
|
private |
When adding a logo, it may occur its name is already used by another pre-existing logo. This method asks users whether they want to erase the existing logo, change the initial name or simply cancel the operation.
initial_name | Initial name of the logo to be added |
TODO prevent the user from entering an empty name
Definition at line 182 of file templatelogomanager.cpp.
References QET::Icons::Cancel, managed_template_, and QET::Icons::tr.
Referenced by addLogo().
QString TitleBlockTemplateLogoManager::currentLogo | ( | ) | const |
Definition at line 47 of file templatelogomanager.cpp.
References logos_view_, and managed_template_.
Referenced by exportLogo(), removeLogo(), and renameLogo().
|
protected |
Emit the logosChanged() signal.
Definition at line 67 of file templatelogomanager.cpp.
References logosChanged(), and managed_template_.
Referenced by addLogo(), removeLogo(), and renameLogo().
|
privateslot |
Export the currently selected logo
Definition at line 296 of file templatelogomanager.cpp.
References QET::QetMessageBox::critical(), currentLogo(), managed_template_, open_dialog_dir_, and QET::Icons::tr.
Referenced by initWidgets().
|
private |
Update the logos display.
Definition at line 136 of file templatelogomanager.cpp.
References iconsize(), logos_view_, managed_template_, and updateLogoInformations().
Referenced by addLogo(), removeLogo(), renameLogo(), and TitleBlockTemplateLogoManager().
|
private |
Definition at line 170 of file templatelogomanager.cpp.
Referenced by fillView(), and initWidgets().
|
private |
Initialize widgets composing the Logo manager
Definition at line 74 of file templatelogomanager.cpp.
References QET::Icons::Add, add_button_, addLogo(), buttons_, delete_button_, QET::Icons::DocumentExport, QET::Icons::EditRename, export_button_, exportLogo(), hlayout0_, hlayout1_, iconsize(), QET::Icons::InsertImage, logo_box_, logo_name_, logo_name_label_, logo_type_, logos_label_, logos_view_, open_dialog_dir_, QET::Icons::Remove, removeLogo(), rename_button_, renameLogo(), QET::Icons::tr, updateLogoInformations(), vlayout0_, and vlayout1_.
Referenced by TitleBlockTemplateLogoManager().
bool TitleBlockTemplateLogoManager::isReadOnly | ( | ) | const |
Definition at line 60 of file templatelogomanager.cpp.
References read_only_.
|
signal |
Referenced by emitLogosChangedSignal().
|
privateslot |
Delete the currently selected logo.
Definition at line 319 of file templatelogomanager.cpp.
References currentLogo(), emitLogosChangedSignal(), fillView(), and managed_template_.
Referenced by initWidgets().
|
privateslot |
Rename currently selected logo.
Definition at line 332 of file templatelogomanager.cpp.
References currentLogo(), emitLogosChangedSignal(), fillView(), logo_name_, managed_template_, QET::Icons::tr, and QET::QetMessageBox::warning().
Referenced by initWidgets().
void TitleBlockTemplateLogoManager::setReadOnly | ( | bool | read_only | ) |
read_only | Whether this logo manager should allow logo edition (renaming, addition, deletion) |
Definition at line 375 of file templatelogomanager.cpp.
References add_button_, delete_button_, logo_name_, read_only_, and rename_button_.
|
privateslot |
Update the displayed informations relative to the currently selected logo.
current | Newly selected logo item |
previous | Previously selected logo item |
Definition at line 245 of file templatelogomanager.cpp.
References logo_name_, logo_type_, managed_template_, and QET::Icons::tr.
Referenced by fillView(), and initWidgets().
|
private |
button to add a new logo
Definition at line 66 of file templatelogomanager.h.
Referenced by initWidgets(), and setReadOnly().
|
private |
|
private |
button to delete an embedded logo
Definition at line 68 of file templatelogomanager.h.
Referenced by initWidgets(), and setReadOnly().
|
private |
button to export an embedded logo
Definition at line 67 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |
Definition at line 63 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |
horizontal layouts
Definition at line 63 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |
current logo properties box
Definition at line 69 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |
current logo name
Definition at line 71 of file templatelogomanager.h.
Referenced by initWidgets(), renameLogo(), setReadOnly(), and updateLogoInformations().
|
private |
|
private |
current logo type
Definition at line 73 of file templatelogomanager.h.
Referenced by initWidgets(), and updateLogoInformations().
|
private |
simple displayed label
Definition at line 64 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |
area showing the logos
Definition at line 65 of file templatelogomanager.h.
Referenced by currentLogo(), fillView(), and initWidgets().
|
private |
title block template which this class manages logos
Definition at line 61 of file templatelogomanager.h.
Referenced by addLogo(), confirmLogoName(), currentLogo(), emitLogosChangedSignal(), exportLogo(), fillView(), removeLogo(), renameLogo(), and updateLogoInformations().
|
private |
last opened directory
Definition at line 75 of file templatelogomanager.h.
Referenced by addLogo(), exportLogo(), and initWidgets().
|
private |
Whether this logo manager should allow logo edition (renaming, addition, deletion)
Definition at line 76 of file templatelogomanager.h.
Referenced by isReadOnly(), and setReadOnly().
|
private |
button to rename the current logo
Definition at line 72 of file templatelogomanager.h.
Referenced by initWidgets(), and setReadOnly().
|
private |
Definition at line 62 of file templatelogomanager.h.
Referenced by initWidgets().
|
private |