QElectroTech  0.70
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TitleBlockTemplateLogoManager Class Reference

#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

TitleBlockTemplatemanaged_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TitleBlockTemplateLogoManager()

TitleBlockTemplateLogoManager::TitleBlockTemplateLogoManager ( TitleBlockTemplate managed_template,
QWidget *  parent = nullptr 
)

Constructor

Parameters
managed_templateTitle block template this widget manages logos for.
parentParent QWidget.

Definition at line 29 of file templatelogomanager.cpp.

References fillView(), and initWidgets().

◆ ~TitleBlockTemplateLogoManager()

TitleBlockTemplateLogoManager::~TitleBlockTemplateLogoManager ( )
override

Destructor

Definition at line 40 of file templatelogomanager.cpp.

Member Function Documentation

◆ addLogo

void TitleBlockTemplateLogoManager::addLogo ( )
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().

◆ confirmLogoName()

QString TitleBlockTemplateLogoManager::confirmLogoName ( const QString &  initial_name)
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.

Parameters
initial_nameInitial name of the logo to be added
Returns
Either a null QString if the user cancelled the operation, or the name to be used when adding the logo.

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().

◆ currentLogo()

QString TitleBlockTemplateLogoManager::currentLogo ( ) const
Returns
the name of the currently selected logo, or a null QString if none is selected.

Definition at line 47 of file templatelogomanager.cpp.

References logos_view_, and managed_template_.

Referenced by exportLogo(), removeLogo(), and renameLogo().

◆ emitLogosChangedSignal()

void TitleBlockTemplateLogoManager::emitLogosChangedSignal ( )
protected

Emit the logosChanged() signal.

Definition at line 67 of file templatelogomanager.cpp.

References logosChanged(), and managed_template_.

Referenced by addLogo(), removeLogo(), and renameLogo().

◆ exportLogo

void TitleBlockTemplateLogoManager::exportLogo ( )
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().

◆ fillView()

void TitleBlockTemplateLogoManager::fillView ( )
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().

◆ iconsize()

QSize TitleBlockTemplateLogoManager::iconsize ( ) const
private
Returns
the icon size to display the logos embedded within the managed template.

Definition at line 170 of file templatelogomanager.cpp.

Referenced by fillView(), and initWidgets().

◆ initWidgets()

void TitleBlockTemplateLogoManager::initWidgets ( )
private

◆ isReadOnly()

bool TitleBlockTemplateLogoManager::isReadOnly ( ) const
Returns
Whether this logo manager should allow logo edition (renaming, addition, deletion).

Definition at line 60 of file templatelogomanager.cpp.

References read_only_.

◆ logosChanged

void TitleBlockTemplateLogoManager::logosChanged ( const TitleBlockTemplate )
signal

Referenced by emitLogosChangedSignal().

◆ removeLogo

void TitleBlockTemplateLogoManager::removeLogo ( )
privateslot

Delete the currently selected logo.

Definition at line 319 of file templatelogomanager.cpp.

References currentLogo(), emitLogosChangedSignal(), fillView(), and managed_template_.

Referenced by initWidgets().

◆ renameLogo

void TitleBlockTemplateLogoManager::renameLogo ( )
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().

◆ setReadOnly()

void TitleBlockTemplateLogoManager::setReadOnly ( bool  read_only)
Parameters
read_onlyWhether 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_.

◆ updateLogoInformations

void TitleBlockTemplateLogoManager::updateLogoInformations ( QListWidgetItem *  current,
QListWidgetItem *  previous 
)
privateslot

Update the displayed informations relative to the currently selected logo.

Parameters
currentNewly selected logo item
previousPreviously 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().

Member Data Documentation

◆ add_button_

QPushButton* TitleBlockTemplateLogoManager::add_button_
private

button to add a new logo

Definition at line 66 of file templatelogomanager.h.

Referenced by initWidgets(), and setReadOnly().

◆ buttons_

QDialogButtonBox* TitleBlockTemplateLogoManager::buttons_
private

ok/cancel buttons

Definition at line 74 of file templatelogomanager.h.

Referenced by initWidgets().

◆ delete_button_

QPushButton* TitleBlockTemplateLogoManager::delete_button_
private

button to delete an embedded logo

Definition at line 68 of file templatelogomanager.h.

Referenced by initWidgets(), and setReadOnly().

◆ export_button_

QPushButton* TitleBlockTemplateLogoManager::export_button_
private

button to export an embedded logo

Definition at line 67 of file templatelogomanager.h.

Referenced by initWidgets().

◆ hlayout0_

QHBoxLayout* TitleBlockTemplateLogoManager::hlayout0_
private

Definition at line 63 of file templatelogomanager.h.

Referenced by initWidgets().

◆ hlayout1_

QHBoxLayout * TitleBlockTemplateLogoManager::hlayout1_
private

horizontal layouts

Definition at line 63 of file templatelogomanager.h.

Referenced by initWidgets().

◆ logo_box_

QGroupBox* TitleBlockTemplateLogoManager::logo_box_
private

current logo properties box

Definition at line 69 of file templatelogomanager.h.

Referenced by initWidgets().

◆ logo_name_

QLineEdit* TitleBlockTemplateLogoManager::logo_name_
private

current logo name

Definition at line 71 of file templatelogomanager.h.

Referenced by initWidgets(), renameLogo(), setReadOnly(), and updateLogoInformations().

◆ logo_name_label_

QLabel* TitleBlockTemplateLogoManager::logo_name_label_
private

"name:" label

Definition at line 70 of file templatelogomanager.h.

Referenced by initWidgets().

◆ logo_type_

QLabel* TitleBlockTemplateLogoManager::logo_type_
private

current logo type

Definition at line 73 of file templatelogomanager.h.

Referenced by initWidgets(), and updateLogoInformations().

◆ logos_label_

QLabel* TitleBlockTemplateLogoManager::logos_label_
private

simple displayed label

Definition at line 64 of file templatelogomanager.h.

Referenced by initWidgets().

◆ logos_view_

QListWidget* TitleBlockTemplateLogoManager::logos_view_
private

area showing the logos

Definition at line 65 of file templatelogomanager.h.

Referenced by currentLogo(), fillView(), and initWidgets().

◆ managed_template_

TitleBlockTemplate* TitleBlockTemplateLogoManager::managed_template_
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().

◆ open_dialog_dir_

QDir TitleBlockTemplateLogoManager::open_dialog_dir_
private

last opened directory

Definition at line 75 of file templatelogomanager.h.

Referenced by addLogo(), exportLogo(), and initWidgets().

◆ read_only_

bool TitleBlockTemplateLogoManager::read_only_
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().

◆ rename_button_

QPushButton* TitleBlockTemplateLogoManager::rename_button_
private

button to rename the current logo

Definition at line 72 of file templatelogomanager.h.

Referenced by initWidgets(), and setReadOnly().

◆ vlayout0_

QVBoxLayout* TitleBlockTemplateLogoManager::vlayout0_
private

Definition at line 62 of file templatelogomanager.h.

Referenced by initWidgets().

◆ vlayout1_

QVBoxLayout * TitleBlockTemplateLogoManager::vlayout1_
private

vertical layouts

Definition at line 62 of file templatelogomanager.h.

Referenced by initWidgets().


The documentation for this class was generated from the following files: