mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
The systray icon is now able to manage title block template editors as well.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1412 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
#include "elementscollectioncache.h"
|
#include "elementscollectioncache.h"
|
||||||
#include "fileelementscollection.h"
|
#include "fileelementscollection.h"
|
||||||
#include "titleblocktemplate.h"
|
#include "titleblocktemplate.h"
|
||||||
#include "templateeditor.h"
|
|
||||||
#include "qettemplateeditor.h"
|
#include "qettemplateeditor.h"
|
||||||
#include "qetproject.h"
|
#include "qetproject.h"
|
||||||
#include "qtextorientationspinboxwidget.h"
|
#include "qtextorientationspinboxwidget.h"
|
||||||
@@ -178,7 +177,7 @@ void QETApp::systray(QSystemTrayIcon::ActivationReason reason) {
|
|||||||
case QSystemTrayIcon::DoubleClick:
|
case QSystemTrayIcon::DoubleClick:
|
||||||
case QSystemTrayIcon::Trigger:
|
case QSystemTrayIcon::Trigger:
|
||||||
// reduction ou restauration de l'application
|
// reduction ou restauration de l'application
|
||||||
fetchWindowStats(diagramEditors(), elementEditors());
|
fetchWindowStats(diagramEditors(), elementEditors(), titleBlockTemplateEditors());
|
||||||
if (every_editor_reduced) restoreEveryEditor(); else reduceEveryEditor();
|
if (every_editor_reduced) restoreEveryEditor(); else reduceEveryEditor();
|
||||||
break;
|
break;
|
||||||
case QSystemTrayIcon::Unknown:
|
case QSystemTrayIcon::Unknown:
|
||||||
@@ -191,6 +190,7 @@ void QETApp::systray(QSystemTrayIcon::ActivationReason reason) {
|
|||||||
void QETApp::reduceEveryEditor() {
|
void QETApp::reduceEveryEditor() {
|
||||||
reduceDiagramEditors();
|
reduceDiagramEditors();
|
||||||
reduceElementEditors();
|
reduceElementEditors();
|
||||||
|
reduceTitleBlockTemplateEditors();
|
||||||
every_editor_reduced = true;
|
every_editor_reduced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,27 +198,38 @@ void QETApp::reduceEveryEditor() {
|
|||||||
void QETApp::restoreEveryEditor() {
|
void QETApp::restoreEveryEditor() {
|
||||||
restoreDiagramEditors();
|
restoreDiagramEditors();
|
||||||
restoreElementEditors();
|
restoreElementEditors();
|
||||||
|
restoreTitleBlockTemplateEditors();
|
||||||
every_editor_reduced = false;
|
every_editor_reduced = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reduit tous les editeurs de schemas dans le systray
|
/// Reduit tous les editeurs de schemas dans le systray
|
||||||
void QETApp::reduceDiagramEditors() {
|
void QETApp::reduceDiagramEditors() {
|
||||||
foreach(QETDiagramEditor *e, diagramEditors()) setMainWindowVisible(e, false);
|
setMainWindowsVisible<QETDiagramEditor>(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Restaure tous les editeurs de schemas dans le systray
|
/// Restaure tous les editeurs de schemas dans le systray
|
||||||
void QETApp::restoreDiagramEditors() {
|
void QETApp::restoreDiagramEditors() {
|
||||||
foreach(QETDiagramEditor *e, diagramEditors()) setMainWindowVisible(e, true);
|
setMainWindowsVisible<QETDiagramEditor>(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reduit tous les editeurs d'element dans le systray
|
/// Reduit tous les editeurs d'element dans le systray
|
||||||
void QETApp::reduceElementEditors() {
|
void QETApp::reduceElementEditors() {
|
||||||
foreach(QETElementEditor *e, elementEditors()) setMainWindowVisible(e, false);
|
setMainWindowsVisible<QETElementEditor>(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Restaure tous les editeurs d'element dans le systray
|
/// Restaure tous les editeurs d'element dans le systray
|
||||||
void QETApp::restoreElementEditors() {
|
void QETApp::restoreElementEditors() {
|
||||||
foreach(QETElementEditor *e, elementEditors()) setMainWindowVisible(e, true);
|
setMainWindowsVisible<QETElementEditor>(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Reduce all known template editors
|
||||||
|
void QETApp::reduceTitleBlockTemplateEditors() {
|
||||||
|
setMainWindowsVisible<QETTitleBlockTemplateEditor>(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Restore all known template editors
|
||||||
|
void QETApp::restoreTitleBlockTemplateEditors() {
|
||||||
|
setMainWindowsVisible<QETTitleBlockTemplateEditor>(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// lance un nouvel editeur de schemas
|
/// lance un nouvel editeur de schemas
|
||||||
@@ -517,14 +528,43 @@ QFont QETApp::diagramTextsFont(qreal size) {
|
|||||||
@return les editeurs de schemas
|
@return les editeurs de schemas
|
||||||
*/
|
*/
|
||||||
QList<QETDiagramEditor *> QETApp::diagramEditors() {
|
QList<QETDiagramEditor *> QETApp::diagramEditors() {
|
||||||
return(static_cast<QETApp *>(qApp) -> detectDiagramEditors());
|
return(QETApp::instance() -> detectWindows<QETDiagramEditor>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return les editeurs d'elements
|
@return les editeurs d'elements
|
||||||
*/
|
*/
|
||||||
QList<QETElementEditor *> QETApp::elementEditors() {
|
QList<QETElementEditor *> QETApp::elementEditors() {
|
||||||
return(static_cast<QETApp *>(qApp) -> detectElementEditors());
|
return(QETApp::instance() -> detectWindows<QETElementEditor>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@return the title block template editors
|
||||||
|
*/
|
||||||
|
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors() {
|
||||||
|
return(QETApp::instance() -> detectWindows<QETTitleBlockTemplateEditor>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param project Opened project object.
|
||||||
|
@return the list of title block template editors which are currently
|
||||||
|
editing a template embedded within \a project.
|
||||||
|
*/
|
||||||
|
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors(QETProject *project) {
|
||||||
|
QList<QETTitleBlockTemplateEditor *> editors;
|
||||||
|
if (!project) return(editors);
|
||||||
|
|
||||||
|
// foreach known template editor
|
||||||
|
foreach (QETTitleBlockTemplateEditor *tbt_editor, titleBlockTemplateEditors()) {
|
||||||
|
// retrieve the location of the currently edited template
|
||||||
|
TitleBlockTemplateLocation tbt_editor_loc(tbt_editor -> location());
|
||||||
|
|
||||||
|
if (tbt_editor_loc.project() == project) {
|
||||||
|
editors << tbt_editor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(editors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -596,28 +636,29 @@ void QETApp::cleanup() {
|
|||||||
qsti -> hide();
|
qsti -> hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return les editeurs de schemas ouverts
|
/**
|
||||||
QList<QETDiagramEditor *> QETApp::detectDiagramEditors() const {
|
@param T a class inheriting QMainWindow
|
||||||
QList<QETDiagramEditor *> diagram_editors;
|
@return the list of windows of type T
|
||||||
foreach(QWidget *qw, topLevelWidgets()) {
|
*/
|
||||||
if (!qw -> isWindow()) continue;
|
template <class T> QList<T *> QETApp::detectWindows() const {
|
||||||
if (QETDiagramEditor *de = qobject_cast<QETDiagramEditor *>(qw)) {
|
QList<T *> windows;
|
||||||
diagram_editors << de;
|
foreach(QWidget *widget, topLevelWidgets()) {
|
||||||
|
if (!widget -> isWindow()) continue;
|
||||||
|
if (T *window = qobject_cast<T *>(widget)) {
|
||||||
|
windows << window;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(diagram_editors);
|
return(windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return les editeurs d'elements ouverts
|
/**
|
||||||
QList<QETElementEditor *> QETApp::detectElementEditors() const {
|
@param T a class inheriting QMainWindow
|
||||||
QList<QETElementEditor *> element_editors;
|
@param visible whether detected main windows should be visible
|
||||||
foreach(QWidget *qw, topLevelWidgets()) {
|
*/
|
||||||
if (!qw -> isWindow()) continue;
|
template <class T> void QETApp::setMainWindowsVisible(bool visible) {
|
||||||
if (QETElementEditor *ee = qobject_cast<QETElementEditor *>(qw)) {
|
foreach(T *e, detectWindows<T>()) {
|
||||||
element_editors << ee;
|
setMainWindowVisible(e, visible);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(element_editors);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1075,6 +1116,8 @@ void QETApp::initSystemTray() {
|
|||||||
restore_diagrams = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs de sch\351ma"), this);
|
restore_diagrams = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs de sch\351ma"), this);
|
||||||
reduce_elements = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs d'\351l\351ment"), this);
|
reduce_elements = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs d'\351l\351ment"), this);
|
||||||
restore_elements = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs d'\351l\351ment"), this);
|
restore_elements = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs d'\351l\351ment"), this);
|
||||||
|
reduce_templates = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs de cartouche", "systray submenu entry"), this);
|
||||||
|
restore_templates = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs de cartouche", "systray submenu entry"), this);
|
||||||
new_diagram = new QAction(QET::Icons::WindowNew, tr("&Nouvel \351diteur de sch\351ma"), this);
|
new_diagram = new QAction(QET::Icons::WindowNew, tr("&Nouvel \351diteur de sch\351ma"), this);
|
||||||
new_element = new QAction(QET::Icons::WindowNew, tr("&Nouvel \351diteur d'\351l\351ment"), this);
|
new_element = new QAction(QET::Icons::WindowNew, tr("&Nouvel \351diteur d'\351l\351ment"), this);
|
||||||
|
|
||||||
@@ -1089,6 +1132,8 @@ void QETApp::initSystemTray() {
|
|||||||
connect(restore_diagrams, SIGNAL(triggered()), this, SLOT(restoreDiagramEditors()));
|
connect(restore_diagrams, SIGNAL(triggered()), this, SLOT(restoreDiagramEditors()));
|
||||||
connect(reduce_elements, SIGNAL(triggered()), this, SLOT(reduceElementEditors()));
|
connect(reduce_elements, SIGNAL(triggered()), this, SLOT(reduceElementEditors()));
|
||||||
connect(restore_elements, SIGNAL(triggered()), this, SLOT(restoreElementEditors()));
|
connect(restore_elements, SIGNAL(triggered()), this, SLOT(restoreElementEditors()));
|
||||||
|
connect(reduce_templates, SIGNAL(triggered()), this, SLOT(reduceTitleBlockTemplateEditors()));
|
||||||
|
connect(restore_templates,SIGNAL(triggered()), this, SLOT(restoreTitleBlockTemplateEditors()));
|
||||||
connect(new_diagram, SIGNAL(triggered()), this, SLOT(newDiagramEditor()));
|
connect(new_diagram, SIGNAL(triggered()), this, SLOT(newDiagramEditor()));
|
||||||
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor()));
|
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor()));
|
||||||
|
|
||||||
@@ -1100,6 +1145,25 @@ void QETApp::initSystemTray() {
|
|||||||
qsti -> show();
|
qsti -> show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a list of \a windows to \a menu.
|
||||||
|
This template function assumes it will be given a QList of pointers to
|
||||||
|
objects inheriting the QMainWindow class.
|
||||||
|
@param T the class inheriting QMainWindow
|
||||||
|
@param menu the menu windows will be added to
|
||||||
|
@param windows A list of top-level windows.
|
||||||
|
*/
|
||||||
|
template <class T> void QETApp::addWindowsListToMenu(QMenu *menu, const QList<T *> &windows) {
|
||||||
|
menu -> addSeparator();
|
||||||
|
foreach (QMainWindow *window, windows) {
|
||||||
|
QAction *current_menu = menu -> addAction(window -> windowTitle());
|
||||||
|
current_menu -> setCheckable(true);
|
||||||
|
current_menu -> setChecked(window -> isVisible());
|
||||||
|
connect(current_menu, SIGNAL(triggered()), &signal_map, SLOT(map()));
|
||||||
|
signal_map.setMapping(current_menu, window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// construit le menu de l'icone dans le systray
|
/// construit le menu de l'icone dans le systray
|
||||||
void QETApp::buildSystemTrayMenu() {
|
void QETApp::buildSystemTrayMenu() {
|
||||||
menu_systray -> clear();
|
menu_systray -> clear();
|
||||||
@@ -1107,7 +1171,8 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
// recupere les editeurs
|
// recupere les editeurs
|
||||||
QList<QETDiagramEditor *> diagrams = diagramEditors();
|
QList<QETDiagramEditor *> diagrams = diagramEditors();
|
||||||
QList<QETElementEditor *> elements = elementEditors();
|
QList<QETElementEditor *> elements = elementEditors();
|
||||||
fetchWindowStats(diagrams, elements);
|
QList<QETTitleBlockTemplateEditor *> tbtemplates = titleBlockTemplateEditors();
|
||||||
|
fetchWindowStats(diagrams, elements, tbtemplates);
|
||||||
|
|
||||||
// ajoute le bouton reduire / restaurer au menu
|
// ajoute le bouton reduire / restaurer au menu
|
||||||
menu_systray -> addAction(every_editor_reduced ? restore_appli : reduce_appli);
|
menu_systray -> addAction(every_editor_reduced ? restore_appli : reduce_appli);
|
||||||
@@ -1119,14 +1184,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
diagrams_submenu -> addAction(new_diagram);
|
diagrams_submenu -> addAction(new_diagram);
|
||||||
reduce_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_reduced);
|
reduce_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_reduced);
|
||||||
restore_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_visible);
|
restore_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_visible);
|
||||||
diagrams_submenu -> addSeparator();
|
addWindowsListToMenu<QETDiagramEditor>(diagrams_submenu, diagrams);
|
||||||
foreach(QETDiagramEditor *diagram, diagrams) {
|
|
||||||
QAction *current_diagram_menu = diagrams_submenu -> addAction(diagram -> windowTitle());
|
|
||||||
current_diagram_menu -> setCheckable(true);
|
|
||||||
current_diagram_menu -> setChecked(diagram -> isVisible());
|
|
||||||
connect(current_diagram_menu, SIGNAL(triggered()), &signal_map, SLOT(map()));
|
|
||||||
signal_map.setMapping(current_diagram_menu, diagram);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ajoute les editeurs d'elements au menu
|
// ajoute les editeurs d'elements au menu
|
||||||
QMenu *elements_submenu = menu_systray -> addMenu(tr("\311diteurs d'\351l\351ment"));
|
QMenu *elements_submenu = menu_systray -> addMenu(tr("\311diteurs d'\351l\351ment"));
|
||||||
@@ -1136,13 +1194,15 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
reduce_elements -> setEnabled(!elements.isEmpty() && !every_element_reduced);
|
reduce_elements -> setEnabled(!elements.isEmpty() && !every_element_reduced);
|
||||||
restore_elements -> setEnabled(!elements.isEmpty() && !every_element_visible);
|
restore_elements -> setEnabled(!elements.isEmpty() && !every_element_visible);
|
||||||
elements_submenu -> addSeparator();
|
elements_submenu -> addSeparator();
|
||||||
foreach(QETElementEditor *element, elements) {
|
addWindowsListToMenu<QETElementEditor>(elements_submenu, elements);
|
||||||
QAction *current_element_menu = elements_submenu -> addAction(element -> windowTitle());
|
|
||||||
current_element_menu -> setCheckable(true);
|
// add title block template editors in a submenu
|
||||||
current_element_menu -> setChecked(element -> isVisible());
|
QMenu *tbtemplates_submenu = menu_systray -> addMenu(tr("\311diteurs de cartouche", "systray menu entry"));
|
||||||
connect(current_element_menu, SIGNAL(triggered()), &signal_map, SLOT(map()));
|
tbtemplates_submenu -> addAction(reduce_templates);
|
||||||
signal_map.setMapping(current_element_menu, element);
|
tbtemplates_submenu -> addAction(restore_templates);
|
||||||
}
|
reduce_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_reduced);
|
||||||
|
restore_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_visible);
|
||||||
|
addWindowsListToMenu<QETTitleBlockTemplateEditor>(tbtemplates_submenu, tbtemplates);
|
||||||
|
|
||||||
// ajoute le bouton quitter au menu
|
// ajoute le bouton quitter au menu
|
||||||
menu_systray -> addSeparator();
|
menu_systray -> addSeparator();
|
||||||
@@ -1150,7 +1210,11 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Met a jour les booleens concernant l'etat des fenetres
|
/// Met a jour les booleens concernant l'etat des fenetres
|
||||||
void QETApp::fetchWindowStats(const QList<QETDiagramEditor *> &diagrams, const QList<QETElementEditor *> &elements) {
|
void QETApp::fetchWindowStats(
|
||||||
|
const QList<QETDiagramEditor *> &diagrams,
|
||||||
|
const QList<QETElementEditor *> &elements,
|
||||||
|
const QList<QETTitleBlockTemplateEditor *> &tbtemplates
|
||||||
|
) {
|
||||||
// compte le nombre de schemas visibles
|
// compte le nombre de schemas visibles
|
||||||
int visible_diagrams = 0;
|
int visible_diagrams = 0;
|
||||||
foreach(QMainWindow *w, diagrams) if (w -> isVisible()) ++ visible_diagrams;
|
foreach(QMainWindow *w, diagrams) if (w -> isVisible()) ++ visible_diagrams;
|
||||||
@@ -1163,6 +1227,14 @@ void QETApp::fetchWindowStats(const QList<QETDiagramEditor *> &diagrams, const Q
|
|||||||
every_element_reduced = !visible_elements;
|
every_element_reduced = !visible_elements;
|
||||||
every_element_visible = visible_elements == elements.count();
|
every_element_visible = visible_elements == elements.count();
|
||||||
|
|
||||||
|
// count visible template editors
|
||||||
|
int visible_templates = 0;
|
||||||
|
foreach(QMainWindow *window, tbtemplates) {
|
||||||
|
if (window -> isVisible()) ++ visible_templates;
|
||||||
|
}
|
||||||
|
every_template_reduced = !visible_templates;
|
||||||
|
every_template_visible = visible_templates == tbtemplates.count();
|
||||||
|
|
||||||
// determine si tous les elements sont reduits
|
// determine si tous les elements sont reduits
|
||||||
every_editor_reduced = every_element_reduced && every_diagram_reduced;
|
every_editor_reduced = every_element_reduced && every_diagram_reduced;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class ElementsCategory;
|
|||||||
class ElementDefinition;
|
class ElementDefinition;
|
||||||
class TitleBlockTemplate;
|
class TitleBlockTemplate;
|
||||||
class QETProject;
|
class QETProject;
|
||||||
|
class QETTitleBlockTemplateEditor;
|
||||||
class QTextOrientationSpinBoxWidget;
|
class QTextOrientationSpinBoxWidget;
|
||||||
class RecentFiles;
|
class RecentFiles;
|
||||||
/**
|
/**
|
||||||
@@ -99,6 +100,8 @@ class QETApp : public QETSingleApplication {
|
|||||||
static QList<QETDiagramEditor *> diagramEditors();
|
static QList<QETDiagramEditor *> diagramEditors();
|
||||||
static QList<QETElementEditor *> elementEditors();
|
static QList<QETElementEditor *> elementEditors();
|
||||||
static QList<QETElementEditor *> elementEditors(QETProject *);
|
static QList<QETElementEditor *> elementEditors(QETProject *);
|
||||||
|
static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors();
|
||||||
|
static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors(QETProject *);
|
||||||
static QTextOrientationSpinBoxWidget *createTextOrientationSpinBoxWidget();
|
static QTextOrientationSpinBoxWidget *createTextOrientationSpinBoxWidget();
|
||||||
static TitleBlockTemplate *defaultTitleBlockTemplate();
|
static TitleBlockTemplate *defaultTitleBlockTemplate();
|
||||||
|
|
||||||
@@ -121,6 +124,8 @@ class QETApp : public QETSingleApplication {
|
|||||||
QAction *restore_diagrams;
|
QAction *restore_diagrams;
|
||||||
QAction *reduce_elements;
|
QAction *reduce_elements;
|
||||||
QAction *restore_elements;
|
QAction *restore_elements;
|
||||||
|
QAction *reduce_templates;
|
||||||
|
QAction *restore_templates;
|
||||||
QAction *new_diagram;
|
QAction *new_diagram;
|
||||||
QAction *new_element;
|
QAction *new_element;
|
||||||
QHash<QMainWindow *, QByteArray> window_geometries;
|
QHash<QMainWindow *, QByteArray> window_geometries;
|
||||||
@@ -130,6 +135,8 @@ class QETApp : public QETSingleApplication {
|
|||||||
bool every_diagram_visible;
|
bool every_diagram_visible;
|
||||||
bool every_element_reduced;
|
bool every_element_reduced;
|
||||||
bool every_element_visible;
|
bool every_element_visible;
|
||||||
|
bool every_template_reduced;
|
||||||
|
bool every_template_visible;
|
||||||
QSignalMapper signal_map;
|
QSignalMapper signal_map;
|
||||||
QSettings *qet_settings;
|
QSettings *qet_settings;
|
||||||
QETArguments qet_arguments_; ///< Analyseur d'arguments
|
QETArguments qet_arguments_; ///< Analyseur d'arguments
|
||||||
@@ -154,6 +161,8 @@ class QETApp : public QETSingleApplication {
|
|||||||
void restoreDiagramEditors();
|
void restoreDiagramEditors();
|
||||||
void reduceElementEditors();
|
void reduceElementEditors();
|
||||||
void restoreElementEditors();
|
void restoreElementEditors();
|
||||||
|
void reduceTitleBlockTemplateEditors();
|
||||||
|
void restoreTitleBlockTemplateEditors();
|
||||||
void newDiagramEditor();
|
void newDiagramEditor();
|
||||||
void newElementEditor();
|
void newElementEditor();
|
||||||
bool closeEveryEditor();
|
bool closeEveryEditor();
|
||||||
@@ -176,8 +185,8 @@ class QETApp : public QETSingleApplication {
|
|||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QETDiagramEditor *> detectDiagramEditors() const;
|
template <class T> QList<T *> detectWindows() const;
|
||||||
QList<QETElementEditor *> detectElementEditors() const;
|
template <class T> void setMainWindowsVisible(bool);
|
||||||
QList<QWidget *> floatingToolbarsAndDocksForMainWindow(QMainWindow *) const;
|
QList<QWidget *> floatingToolbarsAndDocksForMainWindow(QMainWindow *) const;
|
||||||
void parseArguments();
|
void parseArguments();
|
||||||
void initSplashScreen();
|
void initSplashScreen();
|
||||||
@@ -187,7 +196,12 @@ class QETApp : public QETSingleApplication {
|
|||||||
void initConfiguration();
|
void initConfiguration();
|
||||||
void initSystemTray();
|
void initSystemTray();
|
||||||
void buildSystemTrayMenu();
|
void buildSystemTrayMenu();
|
||||||
void fetchWindowStats(const QList<QETDiagramEditor *> &diagrams, const QList<QETElementEditor *> &elements);
|
void fetchWindowStats(
|
||||||
|
const QList<QETDiagramEditor *> &,
|
||||||
|
const QList<QETElementEditor *> &,
|
||||||
|
const QList<QETTitleBlockTemplateEditor *> &
|
||||||
|
);
|
||||||
|
template <class T> void addWindowsListToMenu(QMenu *, const QList<T *> &);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ QETTitleBlockTemplateEditor::QETTitleBlockTemplateEditor(QWidget *parent) :
|
|||||||
tb_template_(0),
|
tb_template_(0),
|
||||||
logo_manager_(0)
|
logo_manager_(0)
|
||||||
{
|
{
|
||||||
|
setWindowIcon(QET::Icons::QETLogo);
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
initWidgets();
|
initWidgets();
|
||||||
initActions();
|
initActions();
|
||||||
initMenus();
|
initMenus();
|
||||||
|
|||||||
Reference in New Issue
Block a user