diff --git a/borderinset.cpp b/borderinset.cpp index b30c4871f..6b26f470d 100644 --- a/borderinset.cpp +++ b/borderinset.cpp @@ -10,7 +10,7 @@ BorderInset::BorderInset(QObject *parent) : QObject(parent) { min_nb_columns = 3; columns_width = 50.0; columns_height = 500.0; - min_columns_height = 20.0; + min_columns_height = 80.0; inset_width = nb_columns * columns_width; inset_height = 50.0; columns_header_height = 20.0; @@ -194,3 +194,11 @@ void BorderInset::setInsetHeight(const qreal &new_ih) { inset_height = qMax(20.0, qMin(columns_height, new_ih)); updateRectangles(); } + +/** + Ajuste la largeur du cartouche de facon a ce que celui-ci soit aussi large + que le schema +*/ +void BorderInset::adjustInsetToColumns() { + setInsetWidth(nbColumn() * columnsWidth()); +} diff --git a/borderinset.h b/borderinset.h index 103c3fd1f..9765c5fbd 100644 --- a/borderinset.h +++ b/borderinset.h @@ -57,6 +57,7 @@ class BorderInset : public QObject { void setColumnsHeight (const qreal &); void setInsetWidth (const qreal &); void setInsetHeight (const qreal &); + void adjustInsetToColumns (); // methodes d'acces en ecriture aux informations du cartouche void setAuthor (const QString &author) { bi_author = author; } diff --git a/diagramcommands.cpp b/diagramcommands.cpp index be8260854..6ad460999 100644 --- a/diagramcommands.cpp +++ b/diagramcommands.cpp @@ -495,6 +495,7 @@ void ChangeBorderCommand::applyChanges(int coeff) { if (headersHeightDifference) { border.setColumnsHeaderHeight(border.columnsHeaderHeight() + (headersHeightDifference * coeff)); } + border.adjustInsetToColumns(); } /// Annule les changements apportes au schema diff --git a/diagramview.cpp b/diagramview.cpp index 532207532..d028087bb 100644 --- a/diagramview.cpp +++ b/diagramview.cpp @@ -13,7 +13,7 @@ DiagramView::DiagramView(QWidget *parent) : QGraphicsView(parent) { setInteractive(true); setCacheMode(QGraphicsView::CacheBackground); - setOptimizationFlags(QGraphicsView::DontClipPainter|QGraphicsView::DontSavePainterState|QGraphicsView::DontAdjustForAntialiasing); + setOptimizationFlags(QGraphicsView::DontSavePainterState|QGraphicsView::DontAdjustForAntialiasing); // active l'antialiasing setRenderHint(QPainter::Antialiasing, true); @@ -491,10 +491,46 @@ void DiagramView::dialogEditInfos() { // recupere le cartouche du schema InsetProperties inset = scene -> border_and_inset.exportInset(); + // recupere les dimensions du schema + int columns_count_value = scene -> border_and_inset.nbColumn(); + int columns_width_value = scene -> border_and_inset.columnsWidth(); + int columns_height_value = scene -> border_and_inset.columnsHeight(); + // construit le dialogue QDialog popup; popup.setMinimumWidth(400); - popup.setWindowTitle(tr("Cartouche du sch\351ma")); + popup.setWindowTitle(tr("Propri\351t\351s du sch\351ma")); + + QGroupBox *diagram_size_box = new QGroupBox(tr("Dimensions du sch\351ma"), &popup); + QGridLayout diagram_size_box_layout(diagram_size_box); + + QLabel *ds1 = new QLabel(tr("Colonnes :")); + + QSpinBox *columns_count = new QSpinBox(diagram_size_box); + columns_count -> setMinimum(scene -> border_and_inset.minNbColumns()); + columns_count -> setValue(columns_count_value); + + QSpinBox *columns_width = new QSpinBox(diagram_size_box); + columns_width -> setMinimum(1); + columns_width -> setSingleStep(10); + columns_width -> setValue(columns_width_value); + columns_width -> setPrefix(tr("\327")); + columns_width -> setSuffix(tr("px")); + + QLabel *ds2 = new QLabel(tr("Hauteur :")); + + QSpinBox *columns_height = new QSpinBox(diagram_size_box); + columns_height -> setRange(scene -> border_and_inset.minColumnsHeight(), 10000); + columns_height -> setSingleStep(80); + columns_height -> setValue(columns_height_value); + + diagram_size_box_layout.addWidget(ds1, 0, 0); + diagram_size_box_layout.addWidget(columns_count, 0, 1); + diagram_size_box_layout.addWidget(columns_width, 0, 2); + diagram_size_box_layout.addWidget(ds2, 1, 0); + diagram_size_box_layout.addWidget(columns_height, 1, 1); + + QGroupBox *inset_infos = new QGroupBox(tr("Informations du cartouche"), &popup); QLineEdit *titre = new QLineEdit(inset.title, &popup); QLineEdit *auteur = new QLineEdit(inset.author, &popup); @@ -504,8 +540,8 @@ void DiagramView::dialogEditInfos() { date -> setCalendarPopup(true); QLineEdit *fichier = new QLineEdit(inset.filename, &popup); QLineEdit *folio = new QLineEdit(inset.folio, &popup); - QWidget bidon(&popup); - QGridLayout layout_champs(&bidon); + QGridLayout layout_champs(inset_infos); + layout_champs.addWidget(new QLabel(tr("Titre : ")), 0, 0); layout_champs.addWidget(titre, 0, 1); layout_champs.addWidget(new QLabel(tr("Auteur : ")), 1, 0); @@ -524,7 +560,8 @@ void DiagramView::dialogEditInfos() { // ajout dans une disposition verticale QVBoxLayout layout_v(&popup); - layout_v.addWidget(&bidon); + layout_v.addWidget(diagram_size_box); + layout_v.addWidget(inset_infos); layout_v.addWidget(&boutons); // si le dialogue est accepte if (popup.exec() == QDialog::Accepted) { @@ -535,10 +572,23 @@ void DiagramView::dialogEditInfos() { new_inset.filename = fichier -> text(); new_inset.folio = folio -> text(); - // s'il y a des modifications + // s'il y a des modifications au cartouche if (new_inset != inset) { scene -> undoStack().push(new ChangeInsetCommand(scene, inset, new_inset)); } + + // s'il y a des modifications + if ( + columns_count_value != columns_count -> value() ||\ + columns_width_value != columns_width -> value() ||\ + columns_height_value != columns_height -> value() + ) { + ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); + cbc -> columnsCountDifference = columns_count -> value() - columns_count_value; + cbc -> columnsWidthDifference = columns_width -> value() - columns_width_value; + cbc -> columnsHeightDifference = columns_height -> value() - columns_height_value; + scene -> undoStack().push(cbc); + } } } @@ -572,7 +622,7 @@ void DiagramView::removeColumn() { */ void DiagramView::expand() { ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); - cbc -> columnsHeightDifference = 20.0; + cbc -> columnsHeightDifference = 80.0; scene -> undoStack().push(cbc); } @@ -581,7 +631,7 @@ void DiagramView::expand() { */ void DiagramView::shrink() { ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); - cbc -> columnsHeightDifference = -20.0; + cbc -> columnsHeightDifference = -80.0; scene -> undoStack().push(cbc); } @@ -715,4 +765,4 @@ bool DiagramView::event(QEvent *e) { return(true); } return(QGraphicsView::event(e)); -} \ No newline at end of file +} diff --git a/lang/qet_en.qm b/lang/qet_en.qm index 46e87a415..fa7765b2b 100644 Binary files a/lang/qet_en.qm and b/lang/qet_en.qm differ diff --git a/lang/qet_en.ts b/lang/qet_en.ts index 8757b5f7a..84d4223b7 100644 --- a/lang/qet_en.ts +++ b/lang/qet_en.ts @@ -125,27 +125,27 @@ BorderInset - + Auteur : Author : - + Date : Date : - + Fichier : File : - + Folio : Folio : - + Titre du document : Document title : @@ -181,37 +181,37 @@ ConductorPropertiesWidget - + Type de conducteur Conductor Type - + Multifilaire Multiline - + Texte : Text : - + Unifilaire SIngleline - + phase phase - + terre ground - + neutre neutral @@ -219,12 +219,12 @@ Diagram - + Avertissement Warning - + Ce document semble avoir été enregistré avec une version ultérieure de QElectroTech. Il est possible que l'ouverture de tout ou partie de ce document échoue. This document seems to have been saved by a more recent version of QElectroTech. The opening of the document may fail totally or partially. @@ -232,109 +232,139 @@ DiagramView - + ? ? - + Auteur : Author : - - Cartouche du schéma - Diagram inset - - - + Date : Date : - + Enregistrer le schéma en cours ? Save the current diagram ? - + Enregistrer sous Save as - + Erreur Error - + Fichier : File : - + Folio : Folio : - + Impossible d'ecrire dans ce fichier Can't write to the file - + Schéma QElectroTech (*.qet) QElectroTech Diagram (*.qet) - + Titre : Title : - + Voulez-vous enregistrer le schéma Do you wish to save the diagram - + nouveau schéma new diagram - + Éditer les propriétés d'un conducteur Edit conductor properties + + + Propriétés du schéma + Diagram properties + + + + Dimensions du schéma + Diagram size + + + + Colonnes : + Columns : + + + + × + × + + + + px + px + + + + Hauteur : + Height : + + + + Informations du cartouche + Inset properties + ElementDeleter - + Supprimer l'élément ? Delete element ? - + Êtes-vous sûr de vouloir supprimer cet élément ? Do you really wish to delete this element ? - + Suppression de l'élément Deleting element - + La suppression de l'élément a échoué. Vérifiez vos droits sur le fichier Deleting element failed. Check your rights on the file - + . . @@ -342,82 +372,82 @@ Check your rights on the file ElementScene - + ligne line - + ellipse ellipse - + arc arc - + cercle circle - + borne terminal - + texte text - + champ de texte textfield - + polygone polygon - + Ce document XML n'est pas une definition d'élément. This XML document is not an element definition. - + Les dimensions ou le point de saisie ne sont pas valides. The size or the hotspot are not valid. - + Les orientations ne sont pas valides. Orientations are not valids. - + Éditer la taille et le point de saisie Edit size and hotspot - + Éditer les orientations Edit orientations - + L'orientation par défaut est l'orientation dans laquelle s'effectue la création de l'élément. Default orientation is the orientation which the drawing of the element takes place with. - + Éditer les noms Edit names - + Vous pouvez spécifier le nom de l'élément dans plusieurs langues. You may enter the element name in several languages. @@ -456,38 +486,38 @@ Check your rights on the file ElementsCategoryDeleter - + Supprimer la catégorie ? Delete category ? - + Êtes-vous sûr de vouloir supprimer cette catégorie ? Tous les éléments et les catégories contenus dans cette catégorie seront supprimés Do you really wish to delete this category ? Every elements and categories nestd in this category will be deleted - + Êtes-vous vraiment sûr de vouloir supprimer cette catégorie ? Les changements seront définitifs. Are you really really sure you want to delete this category ? Changes will be permanent. - + Suppression de la catégorie Category deletion - + La suppression de la catégorie a échoué. Vérifiez vos droits sur le dossier Category deletion failed. Please check rights of the directory - + . . @@ -586,12 +616,12 @@ Please check rights of the directory Delete element - + Gestionnaire de catégories Categories manager - + Vous pouvez utiliser ce gestionnaire pour ajouter, supprimer ou modifier les catégories. Use this manager to add, delete or modify categories. @@ -977,37 +1007,37 @@ Please check rights of the directory OrientationSetWidget - + Possible Allowed - + Impossible Forbidden - + Nord : North : - + Est : East : - + Sud : South : - + Ouest : West : - + Par défaut Default @@ -1131,62 +1161,62 @@ Please check rights of the directory QETDiagramEditor - + Active la fenêtre Activates the window - + Active la fenêtre précédente Activates the previous window - + Active la fenêtre suivante Activates the next window - + Adapte la taille du schéma afin qu'il soit entièrement visible Changes the size of the plan so that it fits in the view - + Afficha&ge Displ&ay - + Affiche des informations sur la bibliothèque Qt Displays informations about Qt library - + Affiche des informations sur QElectroTech Displays informations about QElectroTech - + Affiche ou non la barre d'outils Displays or not the toolbar - + Affiche ou non le panel d'appareils Displays or not the elements panel - + Affiche QElectroTech en mode fenêtré Displays QElectroTech in windowed mode - + Affiche QElectroTech en mode plein écran Displays QELectroTech in full screen mode - + Afficher Display @@ -1196,17 +1226,17 @@ Please check rights of the directory Expand the diagram - + Agrandit le schéma Expand the diagram - + Agrandit le schéma en hauteur Expand the diagram's height - + &Aide &Help @@ -1216,17 +1246,17 @@ Please check rights of the directory Add a column - + Ajoute une colonne au schéma Add a column to the diagram - + Aligne les fenêtres réduites Arranges all iconized windows at the bottom of the workspace - + Annule l'action précédente Undoes the previous action @@ -1251,12 +1281,12 @@ Please check rights of the directory &Cascade - + Ce fichier n'est pas un document XML valide. This file is not a valid XML Document. - + Ce fichier n'existe pas. This file does not exist. @@ -1266,7 +1296,7 @@ Please check rights of the directory &Paste - + &Configuration &Settings @@ -1276,7 +1306,7 @@ Please check rights of the directory &Configure QElectroTech - + Copie les éléments sélectionnés dans le presse-papier Copies selected elements @@ -1291,17 +1321,17 @@ Please check rights of the directory Cu&t - + Crée un nouveau schéma Opens a new diagram - + Ctrl+0 - + Ctrl+9 @@ -1326,7 +1356,7 @@ Please check rights of the directory - + Ctrl+Shift+F Ctrl+Shift+F @@ -1341,7 +1371,7 @@ Please check rights of the directory - + Désélectionne les éléments sélectionnés et sélectionne les éléments non sélectionnés Deselects selected elements and select non-selected elements @@ -1351,32 +1381,32 @@ Please check rights of the directory Select none - + Désélectionne tous les éléments du schéma Deselect all elements on the plan - + Dispose les fenêtres en cascade Arranges windows in a cascade pattern - + Dispose les fenêtres en mosaïque Arranges windows in a tile pattern - + Édite les informations affichées par le cartouche Edit informations displayed by the inset - + &Édition &Edit - + Enlève les éléments sélectionnés du schéma Removes selected elements from the plan @@ -1386,17 +1416,17 @@ Please check rights of the directory Remove a column - + Enlève une colonne au schéma Remove a column from the diagram - + Enregistre le schéma courant Saves the current plan - + Enregistre le schéma courant avec un autre nom de fichier Saves the current plan as another filename @@ -1411,12 +1441,12 @@ Please check rights of the directory Save as - + Erreur Error - + Exporte le schéma courant dans un autre format Exports the curent plan to another format @@ -1431,7 +1461,7 @@ Please check rights of the directory Previous Window - + Fe&nêtres Wi&ndows @@ -1441,12 +1471,12 @@ Please check rights of the directory Next Window - + Ferme l'application QElectroTech Closes QElectroTech - + Ferme le schéma courant Closes the current plan @@ -1456,7 +1486,7 @@ Please check rights of the directory &Close - + &Fichier &File @@ -1466,17 +1496,17 @@ Please check rights of the directory &Import - + Importe un schéma dans le schéma courant Imports a plan into the current plan - + Impossible de lire ce fichier. Could not read file. - + Imprime le schéma courant Prints the current plan @@ -1485,11 +1515,6 @@ Please check rights of the directory Imprimer Print - - - Informations sur le schéma - Diagram informations - Inverser la sélection @@ -1516,17 +1541,17 @@ Please check rights of the directory &New - + O&utils &Tools - + Outils Tools - + Ouvre un schéma existant Open an existing diagram @@ -1536,7 +1561,7 @@ Please check rights of the directory &Open - + Ouvrir un fichier Open a file @@ -1556,22 +1581,22 @@ Please check rights of the directory F&ullScreen Mode - + Permet de régler différents paramètres de QElectroTech Allows to specify various parameters for QElectroTech - + Permet de sélectionner les éléments Allows to select elements - + Permet de visualiser le schéma sans pouvoir le modifier Allows to view the plan without modifying it - + Pivote les éléments sélectionnés Rotates selected elements @@ -1581,7 +1606,7 @@ Please check rights of the directory Rotate - + Place les éléments du presse-papier sur le schéma Pastes elements from the clipboard into the plan @@ -1596,12 +1621,12 @@ Please check rights of the directory &Quit - + Restaure l'action annulée Restores the undone action - + Restaure le zoom par défaut Restores default zoom level @@ -1611,22 +1636,22 @@ Please check rights of the directory Shrink the diagram - + Rétrécit le schéma Shrinks the plan - + Rétrécit le schéma en hauteur Shrink the diagram's height - + Schémas QElectroTech (*.qet);;Fichiers XML (*.xml);;Tous les fichiers (*) QElectroTech Diagrams (*.qet);;XML Files (*.xml);;All files (*) - + Sélectionne tous les éléments du schéma Selects all elements on the plan @@ -1646,12 +1671,12 @@ Please check rights of the directory Select All - + Transfère les éléments sélectionnés dans le presse-papier Puts selected elements into the clipboard - + Une erreur s'est produite lors de l'ouverture du fichier. An error occured while opening the file. @@ -1686,7 +1711,7 @@ Please check rights of the directory Conductor properties - + Édite les propriétés du conducteur sélectionné Edit the selected conductor properties @@ -1710,6 +1735,16 @@ Please check rights of the directory Ctrl+K Ctrl+K + + + Propriétés du schéma + Diagram Properties + + + + Ctrl+L + Ctrl+L + QETElementEditor @@ -2132,52 +2167,52 @@ Please check rights of the directory add 1 - + ajouter un conducteur add a conductor - + supprimer delete - + coller paste - + couper cut - + déplacer move - + modifier le texte modify text - + pivoter rotate - + modifier un conducteur modify a conductor - + modifier le cartouche modify the inset - + modifier les dimensions du schéma modify the diagram size @@ -2222,12 +2257,12 @@ Please check rights of the directory conductor - + Borne Terminal - + modifier les propriétés d'un conducteur modify conductor properties @@ -2242,7 +2277,7 @@ Please check rights of the directory was saved with a more recent version of QElectroTech. - + Réinitialiser Reset diff --git a/qetdiagrameditor.cpp b/qetdiagrameditor.cpp index 23db623ff..90178c10e 100644 --- a/qetdiagrameditor.cpp +++ b/qetdiagrameditor.cpp @@ -163,7 +163,7 @@ void QETDiagramEditor::actions() { rotate_selection = new QAction(QIcon(":/ico/pivoter.png"), tr("Pivoter"), this); conductor_prop = new QAction(QIcon(":/ico/conductor.png"), tr("Propri\351t\351s du conducteur"), this); conductor_reset = new QAction(QIcon(":/ico/conductor2.png"), tr("R\351initialiser les conducteurs"), this); - infos_diagram = new QAction(QIcon(":/ico/info.png"), tr("Informations sur le sch\351ma"), this); + infos_diagram = new QAction(QIcon(":/ico/info.png"), tr("Propri\351t\351s du sch\351ma"), this); add_column = new QAction(QIcon(":/ico/add_col.png"), tr("Ajouter une colonne"), this); remove_column = new QAction(QIcon(":/ico/remove_col.png"), tr("Enlever une colonne"), this); expand_diagram = new QAction( tr("Agrandir le sch\351ma"), this); @@ -212,6 +212,7 @@ void QETDiagramEditor::actions() { rotate_selection -> setShortcut(QKeySequence(tr("Ctrl+R"))); conductor_prop -> setShortcut(QKeySequence(tr("Ctrl+J"))); conductor_reset -> setShortcut(QKeySequence(tr("Ctrl+K"))); + infos_diagram -> setShortcut(QKeySequence(tr("Ctrl+L"))); zoom_in -> setShortcut(QKeySequence::ZoomIn); zoom_out -> setShortcut(QKeySequence::ZoomOut);