52 #include <QMessageBox> 53 #include <QStandardPaths> 54 #include <KAutoSaveFile> 67 m_row_column_actions_group (this),
68 m_selection_actions_group (this),
69 m_add_item_actions_group (this),
70 m_zoom_actions_group (this),
71 m_select_actions_group (this),
72 m_file_actions_group (this),
73 open_dialog_dir (QStandardPaths::writableLocation(QStandardPaths::DesktopLocation))
77 QSplitter *splitter_ =
new QSplitter(
this);
78 splitter_->setChildrenCollapsible(
false);
84 setCentralWidget(splitter_);
94 setWindowTitle(
tr(
"QElectroTech",
"window title"));
96 statusBar() -> showMessage(
tr(
"QElectroTech",
"status bar message"));
111 setMinimumSize(QSize(500, 350));
112 setWindowState(Qt::WindowMaximized);
121 uint opened_projects = 0;
125 foreach(QString file, files)
145 qdw_pa =
new QDockWidget(
tr(
"Projets",
"dock title"),
this);
147 qdw_pa -> setObjectName (
"projects panel");
148 qdw_pa -> setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
149 qdw_pa -> setFeatures (QDockWidget::AllDockWidgetFeatures);
150 qdw_pa -> setMinimumWidth (160);
153 addDockWidget(Qt::LeftDockWidgetArea,
qdw_pa);
194 QUndoView *undo_view =
new QUndoView(&
undo_group,
this);
196 undo_view -> setEmptyLabel (
tr(
"Aucune modification"));
197 undo_view -> setStatusTip (
tr(
"Cliquez sur une action pour revenir en arrière dans l'édition de votre schéma",
"Status tip"));
198 undo_view -> setWhatsThis (
tr(
"Ce panneau liste les différentes actions effectuées sur le folio courant. Cliquer sur une action permet de revenir à l'état du schéma juste après son application.",
"\"What's this\" tip"));
200 qdw_undo =
new QDockWidget(
tr(
"Annulations",
"dock title"),
this);
201 qdw_undo -> setObjectName(
"diagram_undo");
203 qdw_undo -> setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
204 qdw_undo -> setFeatures(QDockWidget::AllDockWidgetFeatures);
208 addDockWidget(Qt::LeftDockWidgetArea,
qdw_undo);
243 m_export_diagram->setStatusTip(
tr(
"Exporte le folio courant dans un autre format",
"status bar tip"));
246 if (current_project) {
247 current_project -> exportProject();
253 m_print->setShortcut(QKeySequence(QKeySequence::Print));
254 m_print->setStatusTip(
tr(
"Imprime un ou plusieurs folios du projet courant",
"status bar tip"));
255 connect(
m_print, &QAction::triggered, [
this]() {
257 if (current_project) {
258 current_project -> printProject();
265 m_quit_editor->setStatusTip(
tr(
"Ferme l'application QElectroTech",
"status bar tip"));
266 connect(
m_quit_editor, &QAction::triggered,
this, &QETDiagramEditor::close);
271 undo->setShortcut(QKeySequence::Undo);
272 undo->setStatusTip(
tr(
"Annule l'action précédente",
"status bar tip"));
276 redo->setShortcut(QKeySequence::Redo);
277 redo->setStatusTip(
tr(
"Restaure l'action annulée",
"status bar tip"));
284 m_cut -> setShortcut(QKeySequence::Cut);
285 m_copy -> setShortcut(QKeySequence::Copy);
286 m_paste -> setShortcut(QKeySequence::Paste);
288 m_cut -> setStatusTip(
tr(
"Transfère les éléments sélectionnés dans le presse-papier",
"status bar tip"));
289 m_copy -> setStatusTip(
tr(
"Copie les éléments sélectionnés dans le presse-papier",
"status bar tip"));
290 m_paste -> setStatusTip(
tr(
"Place les éléments du presse-papier sur le folio",
"status bar tip"));
292 connect(
m_cut, &QAction::triggered, [
this]() {
296 connect(
m_copy, &QAction::triggered, [
this]() {
300 connect(
m_paste, &QAction::triggered, [
this]() {
308 m_conductor_reset->setStatusTip(
tr(
"Recalcule les chemins des conducteurs sans tenir compte des modifications",
"status bar tip"));
311 dv->resetConductors();
316 m_auto_conductor->setStatusTip (
tr(
"Utiliser la création automatique de conducteur(s) quand cela est possible",
"Status tip of auto conductor"));
320 pv->project()->setAutoConductor(ac);
325 m_grey_background -> setStatusTip (
tr(
"Affiche la couleur de fond du folio en blanc ou en gris",
"Status tip of white/grey background button"));
335 m_draw_grid->setStatusTip(
tr(
"Affiche ou masque la grille des folios"));
338 connect(
m_draw_grid, &QAction::triggered, [
this](
bool checked) {
349 m_edit_diagram_properties -> setStatusTip(
tr(
"Édite les propriétés du folio (dimensions, informations du cartouche, propriétés des conducteurs...)",
"status bar tip"));
354 project_view->editCurrentDiagramProperties();
369 current_project->addNewDiagram();
381 if (current_project->cleanProject()) {
382 pa -> reloadAndFilter();
391 current_project->addNewDiagramFolioList();
408 m_tabbed_view_mode->setStatusTip(
tr(
"Présente les différents projets ouverts des onglets",
"status bar tip"));
413 m_windowed_view_mode->setStatusTip(
tr(
"Présente les différents projets ouverts dans des sous-fenêtres",
"status bar tip"));
423 m_tile_window->setStatusTip(
tr(
"Dispose les fenêtres en mosaïque",
"status bar tip"));
427 m_cascade_window->setStatusTip(
tr(
"Dispose les fenêtres en cascade",
"status bar tip"));
432 m_mode_selection->setStatusTip(
tr(
"Permet de sélectionner les éléments",
"status bar tip"));
438 dv->setSelectionMode();
444 m_mode_visualise->setStatusTip(
tr(
"Permet de visualiser le folio sans pouvoir le modifier",
"status bar tip"));
449 dv->setVisualisationMode();
462 m_next_window->setStatusTip(
tr(
"Active le projet suivant",
"status bar tip"));
477 new_file ->setShortcut(QKeySequence::New);
478 open_file ->setShortcut(QKeySequence::Open);
482 new_file ->setStatusTip(
tr(
"Crée un nouveau projet",
"status bar tip") );
483 open_file ->setStatusTip(
tr(
"Ouvre un projet existant",
"status bar tip") );
484 m_close_file ->setStatusTip(
tr(
"Ferme le projet courant",
"status bar tip") );
485 m_save_file ->setStatusTip(
tr(
"Enregistre le projet courant et tous ses folios",
"status bar tip") );
486 m_save_file_as ->setStatusTip(
tr(
"Enregistre le projet courant avec un autre nom de fichier",
"status bar tip") );
504 add_column -> setStatusTip(
tr(
"Ajoute une colonne au folio",
"status bar tip"));
505 remove_column -> setStatusTip(
tr(
"Enlève une colonne au folio",
"status bar tip"));
506 add_row -> setStatusTip(
tr(
"Agrandit le folio en hauteur",
"status bar tip"));
507 remove_row -> setStatusTip(
tr(
"Rétrécit le folio en hauteur",
"status bar tip"));
509 add_column ->setData(
"add_column");
510 remove_column->setData(
"remove_column");
511 add_row ->setData(
"add_row");
512 remove_row ->setData(
"remove_row");
529 m_delete_selection->setStatusTip(
tr(
"Enlève les éléments sélectionnés du folio",
"status bar tip"));
530 m_rotate_selection->setStatusTip(
tr(
"Pivote les éléments et textes sélectionnés",
"status bar tip"));
531 m_rotate_texts ->setStatusTip(
tr(
"Pivote les textes sélectionnés à un angle précis",
"status bar tip"));
532 m_find_element ->setStatusTip(
tr(
"Retrouve l'élément sélectionné dans le panel",
"status bar tip"));
548 select_all ->setShortcut(QKeySequence::SelectAll);
549 select_nothing->setShortcut(QKeySequence::Deselect);
550 select_invert ->setShortcut(QKeySequence(
tr(
"Ctrl+I")));
552 select_all ->setStatusTip(
tr(
"Sélectionne tous les éléments du folio",
"status bar tip") );
553 select_nothing->setStatusTip(
tr(
"Désélectionne tous les éléments du folio",
"status bar tip") );
554 select_invert ->setStatusTip(
tr(
"Désélectionne les éléments sélectionnés et sélectionne les éléments non sélectionnés",
"status bar tip") );
556 select_all ->setData(
"select_all");
557 select_nothing->setData(
"deselect");
558 select_invert ->setData(
"invert_selection");
572 zoom_content->setShortcut(QKeySequence(
tr(
"Ctrl+8")));
573 zoom_fit ->setShortcut(QKeySequence(
tr(
"Ctrl+9")));
574 zoom_reset ->setShortcut(QKeySequence(
tr(
"Ctrl+0")));
576 zoom_in ->setStatusTip(
tr(
"Agrandit le folio",
"status bar tip"));
577 zoom_out ->setStatusTip(
tr(
"Rétrécit le folio",
"status bar tip"));
578 zoom_content->setStatusTip(
tr(
"Adapte le zoom de façon à afficher tout le contenu du folio indépendamment du cadre"));
579 zoom_fit ->setStatusTip(
tr(
"Adapte le zoom exactement sur le cadre du folio",
"status bar tip"));
580 zoom_reset ->setStatusTip(
tr(
"Restaure le zoom par défaut",
"status bar tip"));
582 zoom_in ->setData(
"zoom_in");
583 zoom_out ->setData(
"zoom_out");
584 zoom_content->setData(
"zoom_content");
585 zoom_fit ->setData(
"zoom_fit");
586 zoom_reset ->setData(
"zoom_reset");
598 add_text ->setStatusTip(
tr(
"Ajoute un champ de texte sur le folio actuel"));
599 add_image ->setStatusTip(
tr(
"Ajoute une image sur le folio actuel"));
600 add_line ->setStatusTip(
tr(
"Ajoute une ligne sur le folio actuel"));
601 add_rectangle->setStatusTip(
tr(
"Ajoute un rectangle sur le folio actuel"));
602 add_ellipse ->setStatusTip(
tr(
"Ajoute une ellipse sur le folio actuel"));
603 add_polyline ->setStatusTip(
tr(
"Ajoute une polyligne sur le folio actuel"));
605 add_text ->setData(
"text");
606 add_image ->setData(
"image");
607 add_line ->setData(
"line");
608 add_rectangle->setData(
"rectangle");
609 add_ellipse ->setData(
"ellipse");
610 add_polyline ->setData(
"polyline");
613 action->setCheckable(
true);
625 m_find =
new QAction(
tr(
"Chercher/remplacer"),
this);
626 m_find->setShortcut(QKeySequence::Find);
627 connect(
m_find, &QAction::triggered, [
this]() {
692 QMenu *menu_fichier =
new QMenu(
tr(
"&Fichier"));
693 QMenu *menu_edition =
new QMenu(
tr(
"&Édition"));
694 QMenu *menu_project =
new QMenu(
tr(
"&Projet"));
695 QMenu *menu_affichage =
new QMenu(
tr(
"Afficha&ge"));
710 menu_fichier -> addSeparator();
714 menu_fichier -> addAction(
m_print);
715 menu_fichier -> addSeparator();
719 menu_edition -> addAction(
undo);
720 menu_edition -> addAction(
redo);
721 menu_edition -> addSeparator();
722 menu_edition -> addAction(
m_cut);
723 menu_edition -> addAction(
m_copy);
724 menu_edition -> addAction(
m_paste);
725 menu_edition -> addSeparator();
727 menu_edition -> addSeparator();
729 menu_edition -> addSeparator();
731 menu_edition -> addSeparator();
734 menu_edition -> addSeparator();
736 menu_edition -> addSeparator();
737 menu_edition -> addAction(
m_find);
744 menu_project -> addSeparator();
749 main_tool_bar -> toggleViewAction() -> setStatusTip(
tr(
"Affiche ou non la barre d'outils principale"));
750 view_tool_bar -> toggleViewAction() -> setStatusTip(
tr(
"Affiche ou non la barre d'outils Affichage"));
751 diagram_tool_bar -> toggleViewAction() -> setStatusTip(
tr(
"Affiche ou non la barre d'outils Schéma"));
752 qdw_pa -> toggleViewAction() -> setStatusTip(
tr(
"Affiche ou non le panel d'appareils"));
753 qdw_undo -> toggleViewAction() -> setStatusTip(
tr(
"Affiche ou non la liste des modifications"));
758 projects_view_mode -> setTearOffEnabled(
true);
762 menu_affichage -> addSeparator();
765 menu_affichage -> addSeparator();
768 menu_affichage -> addSeparator();
781 bool can_quit =
true;
784 if (!isVisible() || isMinimized()) {
785 if (isMaximized()) showMaximized();
799 setAttribute(Qt::WA_DeleteOnClose);
813 if (
m_first_show && e->type() == QEvent::WindowActivate)
833 QString title = (project_view -> project() -> title ());
834 if (title.isEmpty()) title =
"QElectroTech ";
835 QString filePath = (project_view -> project() -> filePath ());
836 statusBar()-> showMessage(
tr(
"Projet %1 enregistré dans le repertoire: %2.").arg(title).arg (filePath), 2000);
852 if (save_file.
isOk()) {
855 QString title = (project_view -> project() -> title ());
856 if (title.isEmpty()) title =
"QElectroTech ";
857 QString filePath = (project_view -> project() -> filePath ());
858 statusBar()->showMessage(
tr(
"Projet %1 enregistré dans le repertoire: %2.").arg(title).arg (filePath), 2000);
877 new_project -> setDefaultBorderProperties (BorderProperties:: defaultProperties());
880 new_project -> setDefaultReportProperties (ReportProperties:: defaultProperties());
881 new_project -> setDefaultXRefProperties (XRefProperties:: defaultProperties());
884 new_project -> addNewDiagram();
899 if (qApp -> activeWindow() !=
this)
return(
false);
909 QString filepath = QFileDialog::getOpenFileName(
911 tr(
"Ouvrir un fichier"),
913 tr(
"Projets QElectroTech (*.qet);;Fichiers XML (*.xml);;Tous les fichiers (*)")
915 if (filepath.isEmpty())
return(
false);
934 return(sub_window -> close());
961 if (filepath.isEmpty())
return(
false);
963 QFileInfo filepath_info(filepath);
968 if (diagram_editor ==
this)
986 if (!filepath_info.exists())
992 tr(
"Impossible d'ouvrir le fichier",
"message box title"),
994 tr(
"Il semblerait que le fichier %1 que vous essayez d'ouvrir" 995 " n'existe pas ou plus.")
1003 if (!filepath_info.isReadable())
1008 tr(
"Impossible d'ouvrir le fichier",
"message box title"),
1009 tr(
"Il semblerait que le fichier que vous essayez d'ouvrir ne " 1010 "soit pas accessible en lecture. Il est donc impossible de " 1011 "l'ouvrir. Veuillez vérifier les permissions du fichier.")
1018 if (!filepath_info.isWritable())
1023 tr(
"Ouverture du projet en lecture seule",
"message box title"),
1024 tr(
"Il semblerait que le projet que vous essayez d'ouvrir ne " 1025 "soit pas accessible en écriture. Il sera donc ouvert en " 1041 tr(
"Échec de l'ouverture du projet",
"message box title"),
1044 "Il semblerait que le fichier %1 ne soit pas un fichier" 1045 " projet QElectroTech. Il ne peut donc être ouvert.",
1046 "message box content" 1082 pa -> elementsPanel().projectWasOpened(project);
1094 QList<ProjectView *> result;
1095 QList<QMdiSubWindow *> window_list(
m_workspace.subWindowList());
1096 foreach(QMdiSubWindow *window, window_list) {
1097 if (
ProjectView *project_view = qobject_cast<ProjectView *>(window -> widget())) {
1098 result << project_view;
1109 QMdiSubWindow *current_window =
m_workspace.activeSubWindow();
1110 if (!current_window)
return(
nullptr);
1112 QWidget *current_widget = current_window -> widget();
1113 if (!current_widget)
return(
nullptr);
1115 if (
ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
1116 return(project_view);
1143 return(project_view -> currentDiagram());
1161 if (selected_elements.count() != 1)
1164 return(selected_elements.first());
1174 if (project_view -> diagram_views().contains(diagram_view)) {
1175 return(project_view);
1188 foreach(
DiagramView *diagram_view, project_view -> diagram_views()) {
1189 if (diagram_view -> diagram() == diagram) {
1190 return(project_view);
1203 if (opened_project -> project() == project) {
1204 return(opened_project);
1217 if (
QETProject *project = opened_project -> project()) {
1218 if (project -> filePath() == filepath) {
1219 return(opened_project);
1232 foreach(QMdiSubWindow *sub_window,
m_workspace.subWindowList()) {
1233 if (sub_window -> widget() == widget) {
1252 QString value = action->data().toString();
1255 if (!dv || value.isEmpty())
return;
1257 if (value ==
"zoom_in")
1259 else if (value ==
"zoom_out")
1261 else if (value ==
"zoom_content")
1263 else if (value ==
"zoom_fit")
1265 else if (value ==
"zoom_reset")
1276 QString value = action->data().toString();
1279 if (!dv || value.isEmpty())
return;
1281 if (value ==
"select_all")
1283 else if (value ==
"deselect")
1285 else if (value ==
"invert_selection")
1297 QString value = action->data().toString();
1304 if (value ==
"line")
1306 else if (value ==
"rectangle")
1308 else if (value ==
"ellipse")
1310 else if (value ==
"polyline")
1313 statusBar()-> showMessage(
tr(
"Double-click pour terminer la forme, Click droit pour annuler le dernier point"));
1314 connect(diagram_event, &DiagramEventInterface::destroyed, [
this]() {
1315 statusBar()->clearMessage();
1318 else if (value ==
"image")
1324 action->setChecked(
false);
1328 diagram_event = deai;
1330 else if (value ==
"text")
1336 connect(diagram_event, &DiagramEventInterface::destroyed, [action]() {action->setChecked(
false);});
1347 QString value = action->data().toString();
1352 if (!dv || value.isEmpty())
return;
1354 if (value ==
"delete_selection")
1356 diagram->clearSelection();
1360 else if (value ==
"rotate_selection")
1366 else if (value ==
"rotate_selected_text")
1370 else if (value ==
"edit_selected_element")
1372 else if (value ==
"group_selected_texts")
1374 QList<DynamicElementTextItem *> deti_list = dc.
m_element_texts.toList();
1375 if(deti_list.size() <= 1)
1384 QString value = action->data().toString();
1393 if (value ==
"add_column")
1395 else if (value ==
"remove_column")
1397 else if (value ==
"add_row")
1399 else if (value ==
"remove_row")
1414 bool opened_project = pv;
1415 bool opened_diagram = dv;
1416 bool editable_project = (pv && !pv -> project() -> isReadOnly());
1430 m_print -> setEnabled(opened_diagram);
1480 QList <QAction *> action_list;
1482 for(QAction *action : action_list)
1483 action->setEnabled(
false);
1504 m_cut -> setEnabled(!
ro && copiable_items);
1505 m_copy -> setEnabled(copiable_items);
1512 int selected_texts = texts.count();
1518 QList<DynamicElementTextItem *> deti_list = dc.
m_element_texts.toList();
1519 if(deti_list.size() > 1 && dc.
count() == deti_list.count())
1521 Element *elmt = deti_list.first()->parentElement();
1525 if(elmt != deti->parentElement())
1537 int selected_editable = selected_elements_count +
1538 (selected_texts - selected_conductor_texts - selected_dynamic_elmt_text) +
1541 selected_conductors_count;
1543 if (selected_editable == 1)
1547 if (selected_elements_count)
1553 else if (selected_texts)
1559 else if (selected_image)
1565 else if (selected_conductors_count)
1599 switch((
int)(dv -> dragMode()))
1601 case QGraphicsView::NoDrag:
1604 case QGraphicsView::ScrollHandDrag:
1608 case QGraphicsView::RubberBandDrag:
1629 bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
1643 if (!project_view)
return;
1645 foreach(
DiagramView *dv, project_view -> diagram_views())
1653 if (
QETProject *project = project_view -> project())
1661 connect(project_view, SIGNAL(errorEncountered(QString)),
this, SLOT(
showError(
const QString &)));
1664 QWidget *current_window =
m_workspace.activeSubWindow();
1665 bool maximise = ((!current_window) || (current_window -> windowState() & Qt::WindowMaximized));
1668 QMdiSubWindow *sub_window =
m_workspace.addSubWindow(project_view);
1669 sub_window -> setWindowIcon(project_view -> windowIcon());
1670 sub_window -> systemMenu() -> clear();
1675 for(QAction *act : sub_window->actions())
1677 if(act->shortcut() == QKeySequence::Close)
1678 act->setShortcut(QKeySequence());
1682 if (maximise) project_view -> showMaximized();
1683 else project_view -> show();
1690 QList<QString> edited_files_list;
1692 QString diagram_file(project_view -> project() -> filePath());
1693 if (!diagram_file.isEmpty()) {
1694 edited_files_list << QFileInfo(diagram_file).canonicalFilePath();
1697 return(edited_files_list);
1707 if (filepath.isEmpty())
return(
nullptr);
1709 QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath();
1710 if (searched_can_file_path.isEmpty()) {
1715 QString project_can_file_path = QFileInfo(project_view -> project() -> filePath()).canonicalFilePath();
1716 if (project_can_file_path == searched_can_file_path) {
1717 return(project_view);
1737 for (KAutoSaveFile *file : backup_files)
1748 QString(
tr(
"Une erreur est survenue lors de l'ouverture du fichier %1.",
1749 "message box content")).arg(file->managedFile().fileName()));
1788 if (!windows.isEmpty())
windows_menu -> addSeparator();
1789 QActionGroup *windows_actions =
new QActionGroup(
this);
1791 QString pv_title = project_view -> windowTitle();
1793 windows_actions -> addAction(action);
1794 action -> setStatusTip(QString(
tr(
"Active le projet « %1 »")).arg(pv_title));
1795 action -> setCheckable(
true);
1797 connect(action, SIGNAL(triggered()), &
windowMapper, SLOT(map()));
1851 QVariant geometry = settings.value(
"diagrameditor/geometry");
1852 if (geometry.isValid()) restoreGeometry(geometry.toByteArray());
1855 QVariant state = settings.value(
"diagrameditor/state");
1856 if (state.isValid()) restoreState(state.toByteArray());
1859 bool tabbed = settings.value(
"diagrameditor/viewmode",
"tabbed") ==
"tabbed";
1874 settings.setValue(
"diagrameditor/geometry", saveGeometry());
1875 settings.setValue(
"diagrameditor/state", saveState());
1883 if (
QETProject *project = diagram -> project()) {
1886 project_view -> showDiagram(diagram);
1906 if (!project_view)
return;
1915 QETProject *project = project_view -> project();
1917 pa -> elementsPanel().projectWasClosed(project);
1919 undo_group.removeStack(project -> undoStack());
1922 project_view -> deleteLater();
1923 project -> deleteLater();
1931 if (!project_view)
return;
1949 if (!project)
return;
1958 project_view -> addNewDiagram();
1967 if (!diagram)
return;
1970 if (
QETProject *diagram_project = diagram -> project()) {
1975 project_view -> showDiagram(diagram);
1989 if (!diagram)
return;
1992 if (
QETProject *diagram_project = diagram -> project()) {
1993 if (diagram_project -> isReadOnly())
return;
2008 if (!diagram)
return;
2011 if (
QETProject *diagram_project = diagram -> project()) {
2012 if (diagram_project -> isReadOnly())
return;
2027 if (!diagram)
return;
2030 if (
QETProject *diagram_project = diagram -> project()) {
2031 if (diagram_project -> isReadOnly())
return;
2047 if (!diagram)
return;
2050 if (
QETProject *diagram_project = diagram -> project()) {
2051 if (diagram_project -> isReadOnly())
return;
2066 if (!diagram)
return;
2069 if (
QETProject *diagram_project = diagram -> project()) {
2070 if (diagram_project -> isReadOnly())
return;
2088 if (
DiagramView *current_diagram = current_project -> currentDiagram()) {
2089 bool isFolioList =
false;
2092 if (dynamic_cast<DiagramFolioList *>(current_diagram -> diagram()))
2099 foreach (
DiagramView *diag, current_project -> diagram_views()) {
2100 if (dynamic_cast<DiagramFolioList *>(diag -> diagram())) {
2107 }
else if (current_project -> diagram_views().size() % 58 == 0) {
2108 foreach (
DiagramView *diag, current_project -> diagram_views()) {
2110 if (ptr && ptr -> getId() == current_project -> project() -> getFolioSheetsQuantity() - 1) {
2145 QETApp::instance() -> openElementLocations(QList<ElementsLocation>() << location);
2162 if (result.
isOk())
return;
2170 if (error.isEmpty())
return;
2181 Q_UNUSED(subWindows);
2207 QProcess *process =
new QProcess(qApp);
2218 success = process->startDetached(
"/Library/Frameworks/Python.framework/Versions/3.5/bin/qet_tb_generator");
2225 success = process->startDetached(
"qet_tb_generator");
2230 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 2232 tr(
"Error launching qet_tb_generator plugin"),
2233 QObject::tr(
"To install the plugin qet_tb_generator" 2237 "<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>" 2239 "Requires python 3.5 or above." 2242 " First install on Windows" 2245 "1. Install, if required, python 3.5 or above" 2249 "<a href='https://www.python.org/downloads/'>python.org</a>" 2251 "2. pip install qet_tb_generator" 2254 " Update on Windows" 2257 "python -m pip install --upgrade qet_tb_generator" 2259 ">>user could launch in a terminal this script in this directory" 2261 " C:\\users\\XXXX\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts " 2266 #elif defined(Q_OS_MAC) 2268 tr(
"Error launching qet_tb_generator plugin"),
2269 QObject::tr(
"To install the plugin qet_tb_generator" 2273 "<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>" 2276 " First install on macOSX" 2279 "1. Install, if required, python 3.5 " 2283 "<a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a>" 2285 "2. pip3 install qet_tb_generator" 2291 " pip3 install --upgrade qet_tb_generator" 2299 tr(
"Error launching qet_tb_generator plugin"),
2300 QObject::tr(
"To install the plugin qet_tb_generator" 2304 "<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>" 2307 "Requires python 3.5 or above." 2311 " First install on Linux" 2314 "1. check you have pip3 installed: pip3 --version" 2316 "If not install with: sudo apt-get install python3-pip" 2318 "2. Install the program: sudo pip3 install qet_tb_generator" 2320 "3. Run the program: qet_tb_generator" 2327 "sudo pip3 install --upgrade qet_tb_generator"
QActionGroup m_row_column_actions_group
QList< ProjectView * > openedProjects() const
static ConductorProperties defaultProperties()
ConductorProperties::defaultProperties.
DiagramPropertiesEditorDockWidget * m_selection_properties_editor
QAction * m_group_selected_texts
static bool unregisterProject(QETProject *)
void setUpToolBar()
QETDiagramEditor::setUpToolBar.
QAction * m_paste
Paste clipboard content on the current diagram.
QList< Diagram * > diagrams() const
bool hasCopiableItems() const
DiagramContent::hasCopiableItems.
DiagramView * currentDiagramView() const
QAction * m_cut
Cut selection to clipboard.
void setDisplayGrid(bool)
void changeZValue(QET::DepthOption option)
Diagram::changeZValue Change the Z value of the current selected item, according to ...
QAction * m_export_diagram
Export diagrams of the current project as imagess.
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
ElementsPanelWidget * pa
Elements panel.
void slot_updateComplexActions()
QETDiagramEditor::slot_updateComplexActions Manage the actions who need some conditions to be enable ...
void zoom(const qreal zoom_factor)
DiagramView::zoom Zomm the view. A zoom_factor > 1 zoom in. A zoom_factor < 1 zoom out...
QString errorMessage() const
QList< DiagramTextItem * > selectedTexts() const
DiagramContent::selectedTexts.
void editDiagramProperties(DiagramView *)
void moveDiagramDownx10(Diagram *)
QSignalMapper windowMapper
QIcon EditTableDeleteColumn
QActionGroup * grp_visu_sel
Action group for visualisation vs edition mode.
void slot_updateWindowsMenu()
void removeDiagramFromProject()
void setUpAutonumberingWidget()
QETDiagramEditor::setUpAutonumberingWidget Setup the dock for AutoNumbering Selection.
QIcon DocumentSpreadsheet
void setUpElementsCollectionWidget()
QETDiagramEditor::setUpElementsCollectionWidget Set up the dock widget of element collection...
QAction * m_print
Print diagrams of the current project.
QAction * m_edit_diagram_properties
Show a dialog to edit diagram properties.
void editElementInEditor(const ElementsLocation &)
QSet< Conductor * > selectedConductors() const
QAction * m_grey_background
Switch the background color in white or grey.
QIcon EditTableInsertColumnRight
void slot_updateActions()
QETDiagramEditor::slot_updateActions Manage actions.
bool closeProject(ProjectView *)
void editSelectedElementInEditor()
QAction * m_tabbed_view_mode
Actions related to file (open, close, save...)
QAction * m_rotate_texts
Direct selected text items to a specific angle.
void moveDiagramUpx10(Diagram *)
QAction * m_next_window
Switch to the next document.
The DiagramEventAddText class This diagram event handle the creation of a new text in a diagram...
ProjectView * viewForFile(const QString &) const
void setUpElementsPanel()
QETDiagramEditor::setUpElementsPanel Setup the element panel and element panel widget.
QMenu * settings_menu_
Settings menu.
Element * currentElement() const
bool isReadOnly() const
Diagram::isReadOnly.
QDockWidget * m_qdw_elmt_collection
Dock for the elements panel.
AutoNumberingDockWidget * m_autonumbering_dock
void showError(const QETResult &)
QToolBar * m_add_item_tool_bar
void addProjectView(ProjectView *)
QETDiagramEditor::addProjectView Add a new project view to workspace and build the connection between...
QAction * m_mode_selection
Set edition mode.
QToolBar * diagram_tool_bar
static bool registerProject(QETProject *)
QMdiSubWindow * subWindowForWidget(QWidget *) const
bool event(QEvent *) override
bool isValid()
RotateSelectionCommand::isValid.
QETDiagramEditor(const QStringList &=QStringList(), QWidget *=nullptr)
QETDiagramEditor::QETDiagramEditor Constructor.
QActionGroup * m_group_view_mode
Action group for project.
QAction * m_project_terminalBloc
generate terminal block
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
void moveDiagramUpTop(Diagram *)
QAction * m_save_file_as
Save current project as a specific file.
bool isNull() const
DiagramEventAddImage::isNull.
QAction * m_save_file
Save current project.
void addItemGroupTriggered(QAction *action)
QETDiagramEditor::addItemGroupTriggered This slot is called when an item must be added to the curent ...
void editSelection()
DiagramView::editSelection Edit the selected item if he can be edited and if only one item is selecte...
void adjustSceneRect()
DiagramView::adjustSceneRect Calcul and set the area of the scene visualized by this view...
void moveDiagramDown(Diagram *)
QIcon EditTableInsertRowUnder
The RotateTextsCommand class Open a dialog for edit the rotation of the current selected texts and te...
bool openAndAddProject(const QString &, bool=true)
void setUpUndoStack()
QETDiagramEditor::setUpUndoStack Setup the undostack and undo stack widget.
QAction * m_cascade_window
Show MDI subwindows as cascade.
QDockWidget * qdw_pa
Directory to use for file dialogs such as File > save.
bool drawGrid() const
QETDiagramEditor::drawGrid.
void removeDiagram(Diagram *)
void setUpActions()
QETDiagramEditor::setUpActions Set up all Qaction.
void zoomGroupTriggered(QAction *action)
static RecentFiles * projectsRecentFiles()
void findElementRequired(const ElementsLocation &)
ElementsCollectionWidget * m_element_collection_widget
Dock for the undo list.
QAction * undo
Cancel the latest action.
QAction * m_project_nomenclature
generate nomenclature
QAction * m_edit_selection
To edit selected item.
QActionGroup m_zoom_actions_group
Action related to adding (add text image shape...)
void closeEvent(QCloseEvent *) override
QAction * redo
Redo the latest cancelled operation.
void writeSettings()
QETDiagramEditor::writeSettings Write the settings.
QMenu * help_menu_
Help menu.
The DiagramEventAddShape class This event manage the creation of a shape.
void slot_updateModeActions()
QETDiagramEditor::slot_updateModeActions Manage action who need an opened diagram or project to be up...
QAction * m_project_folio_list
Sommaire des schemas.
ProjectState state() const
QSet< DynamicElementTextItem * > m_element_texts
void slot_updatePasteAction()
ProjectView * currentProjectView() const
QAction * m_quit_editor
Quit the diagram editor.
void generateTerminalBlock()
QETDiagramEditor::generateTerminalBlock.
The DiagramEventAddImage class This diagram event, handle the adding of an image in a diagram...
static DialogWaiting * instance(QWidget *parent=nullptr)
DepthOption
List the various kind of changes for the zValue.
void slot_updateAutoNumDock()
QETDiagramEditor::slot_updateAutoNumDock Update Auto Num Dock Widget when changing Project...
QList< ElementTextItemGroup * > selectedTextsGroup() const
DiagramContent::selectedTextsGroup.
void setEventInterface(DiagramEventInterface *event_interface)
Diagram::setEventInterface Set event_interface has current interface. Diagram become the ownership of...
void setUpMenu()
QETDiagramEditor::setUpMenu.
static void dropInstance()
void slot_updateUndoStack()
QETDiagramEditor::slot_updateUndoStack Update the undo stack view.
BorderProperties exportBorder()
The RotateSelectionCommand class Rotate the selected items in the given diagram.
void addDiagramToProject(QETProject *)
bool newProject()
QETDiagramEditor::newProject Create an empty project.
QActionGroup m_selection_actions_group
Action related to add/remove rows/column in diagram.
QAction * m_find_element
Find the selected element in the panel.
void save()
QETDiagramEditor::save Ask the current active project to save.
void setUpSelectionPropertiesEditor()
QETDiagramEditor::setUpSelectionPropertiesEditor Setup the dock for edit the current selection...
void activateWidget(QWidget *)
void selectionGroupTriggered(QAction *action)
QETDiagramEditor::selectionGroupTriggered This slot is called when an action should be made on the cu...
~QETDiagramEditor() override
QActionGroup m_file_actions_group
Action related to global selections.
QAction * m_delete_selection
Only zoom action must displayed in the toolbar.
void projectWasClosed(ProjectView *)
static QColor background_color
background color of diagram
SearchAndReplaceWidget m_search_and_replace_widget
QList< QString > editedFiles() const
QAction * m_clean_project
Clean the content of the curent project by removing useless items.
QToolBar * m_depth_tool_bar
QActionGroup * m_depth_action_group
Action related to edit a selected item.
void openBackupFiles(QList< KAutoSaveFile *> backup_files)
QETDiagramEditor::openBackupFiles.
void selectGroupTriggered(QAction *action)
QETDiagramEditor::selectGroupTriggered This slot is called when selection need to change...
void moveDiagramUp(Diagram *)
void saveAs()
QETDiagramEditor::saveAs Ask the current active project to save as.
QList< QAction * > m_zoom_action_toolBar
QAction * m_tile_window
Show MDI subwindows as tile.
QAction * m_mode_visualise
Set visualisation mode.
QActionGroup m_add_item_actions_group
QAction * m_auto_conductor
Enable/Disable the use of auto conductor.
void rowColumnGroupTriggered(QAction *action)
static bool clipboardMayContainDiagram()
void diagramWasAdded(DiagramView *)
QETDiagramEditor::diagramWasAdded Manage the adding of diagram view in a project. ...
QAction * m_windowed_view_mode
Display projects as windows.
The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false.
bool openRecentFile(const QString &)
int columns_count
Columns count.
void insertMenu(QMenu *, QMenu *, bool=true)
void editProjectProperties(ProjectView *)
QETProject * currentProject() const
QETDiagramEditor::currentProject.
the parsing of the XML content failed
QAction * m_project_add_diagram
Add a diagram to the current project.
QAction * m_previous_window
Switch to the previous document.
The AddTextsGroupCommand class Manage the adding of a texts group.
bool hasDeletableItems() const
DiagramContent::hasDeletableItems.
bool addProject(QETProject *, bool=true)
QAction * m_copy
Copy selection to clipboard.
void reloadOldElementPanel()
BorderTitleBlock border_and_titleblock
Diagram dimensions and title block.
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
void editElementRequired(const ElementsLocation &)
bool canRotateSelection() const
Diagram::canRotateSelection.
void readSettings()
QETDiagramEditor::readSettings Read the settings.
QActionGroup * depthActionGroup(QObject *parent=nullptr)
QET::depthActionGroup.
void activateDiagram(Diagram *)
QAction * m_remove_diagram_from_project
Delete a diagram from the current project.
static TitleBlockProperties defaultProperties()
TitleBlockProperties::defaultProperties Return the default properties stored in the setting file...
QAction * m_conductor_reset
Reset paths of selected conductors.
void subWindowActivated(QMdiSubWindow *subWindows)
QETDiagramEditor::subWindowActivated Slot used to update menu and undo stack when subwindows of MDIar...
int count(int=All) const
DiagramContent::count.
void activateProject(QETProject *)
ProjectView * findProject(DiagramView *) const
bool event(QEvent *) override
QETDiagramEditor::event Reimplemented to : -Load elements collection when WindowActivate.
static QETApp * instance()
int rows_count
Rows count.
QAction * m_project_edit_properties
Edit the properties of the current project.
QAction * m_rotate_selection
Rotate selected elements and text items by 90 degrees.
QAction * m_draw_grid
Switch the background grid display or not.
QAction * m_close_file
Close current project file.
static QETDiagramEditor * diagramEditorForFile(const QString &)
QMessageBox::StandardButton warning(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
void findElementInPanel(const ElementsLocation &)
QETDiagramEditor::findElementInPanel Find the item for in the element panel.
void selectionChanged()
QETDiagramEditor::selectionChanged This slot is called when a diagram selection was changed...
QActionGroup m_select_actions_group
Action related to zoom for diagram.