[qet] [2448] minor visual change |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2448
Author: blacksun
Date: 2013-08-24 14:45:21 +0200 (Sat, 24 Aug 2013)
Log Message:
-----------
minor visual change
Modified Paths:
--------------
branches/0.4/sources/diagramcommands.cpp
branches/0.4/sources/diagramview.cpp
branches/0.4/sources/diagramview.h
branches/0.4/sources/qetdiagrameditor.cpp
branches/0.4/sources/qetdiagrameditor.h
Modified: branches/0.4/sources/diagramcommands.cpp
===================================================================
--- branches/0.4/sources/diagramcommands.cpp 2013-08-24 12:03:26 UTC (rev 2447)
+++ branches/0.4/sources/diagramcommands.cpp 2013-08-24 12:45:21 UTC (rev 2448)
@@ -126,7 +126,7 @@
///Refait l'ajout
void AddImageCommand::redo() {
diagram -> addDiagramImageItem(imageitem);
- imageitem -> setPos(position);
+ imageitem -> setPos(position - imageitem -> boundingRect().center());
}
/**
Modified: branches/0.4/sources/diagramview.cpp
===================================================================
--- branches/0.4/sources/diagramview.cpp 2013-08-24 12:03:26 UTC (rev 2447)
+++ branches/0.4/sources/diagramview.cpp 2013-08-24 12:45:21 UTC (rev 2448)
@@ -1249,7 +1249,10 @@
QString pathPictures = QDesktopServices::storageLocation ( QDesktopServices::PicturesLocation );
QString fileName = QFileDialog::getOpenFileName(this, tr("Selectionner une image..."), pathPictures.toStdString().c_str(), tr("Image Files (*.png *.jpg *.bmp *.svg)"));
- if(fileName.isEmpty())return;
+ if(fileName.isEmpty()) {
+ emit ImageAddedCanceled(false);
+ return;
+ }
int ret = image_to_add_.load(fileName);
if(!ret){
Modified: branches/0.4/sources/diagramview.h
===================================================================
--- branches/0.4/sources/diagramview.h 2013-08-24 12:03:26 UTC (rev 2447)
+++ branches/0.4/sources/diagramview.h 2013-08-24 12:45:21 UTC (rev 2448)
@@ -127,6 +127,8 @@
void editTitleBlockTemplate(const QString &, bool);
/// Signal emitted after a image was added
void ImageAdded(bool);
+ /// Signal emmitted fater windows selection image have been canceled
+ void ImageAddedCanceled(bool);
public slots:
void selectNothing();
Modified: branches/0.4/sources/qetdiagrameditor.cpp
===================================================================
--- branches/0.4/sources/qetdiagrameditor.cpp 2013-08-24 12:03:26 UTC (rev 2447)
+++ branches/0.4/sources/qetdiagrameditor.cpp 2013-08-24 12:45:21 UTC (rev 2448)
@@ -216,7 +216,7 @@
add_text = new QAction(QET::Icons::PartTextField, tr("Ajouter un champ de texte"), this);
add_edittext = new QAction(QET::Icons::EditText, tr("\311diter le champ de texte"), this);
add_column = new QAction(QET::Icons::EditTableInsertColumnRight, tr("Ajouter une colonne"), this);
- adding_image = new QAction(QET::Icons::adding_image, tr("Ajouter une image"), this);
+ add_image = new QAction(QET::Icons::adding_image, tr("Ajouter une image"), this);
remove_column = new QAction(QET::Icons::EditTableDeleteColumn, tr("Enlever une colonne"), this);
add_row = new QAction(QET::Icons::EditTableInsertRowUnder, tr("Ajouter une ligne"), this);
remove_row = new QAction(QET::Icons::EditTableDeleteRow, tr("Enlever une ligne"), this);
@@ -338,6 +338,7 @@
// traitements speciaux
add_text -> setCheckable(true);
+ add_image -> setCheckable(true);
windowed_view_mode -> setCheckable(true);
tabbed_view_mode -> setCheckable(true);
mode_selection -> setCheckable(true);
@@ -400,7 +401,7 @@
connect(infos_diagram, SIGNAL(triggered()), this, SLOT(editCurrentDiagramProperties()));
connect(add_text, SIGNAL(triggered()), this, SLOT(slot_addText()) );
connect(add_edittext, SIGNAL(triggered()), this, SLOT(slot_editText()) );
- connect(adding_image, SIGNAL(triggered()), this, SLOT(slot_addImage()) );
+ connect(add_image, SIGNAL(triggered()), this, SLOT(slot_addImage()) );
connect(add_column, SIGNAL(triggered()), this, SLOT(slot_addColumn()) );
connect(remove_column, SIGNAL(triggered()), this, SLOT(slot_removeColumn()) );
connect(add_row, SIGNAL(triggered()), this, SLOT(slot_addRow()) );
@@ -564,7 +565,7 @@
diagram_bar -> addAction(infos_diagram);
diagram_bar -> addAction(conductor_reset);
diagram_bar -> addAction(add_text);
- diagram_bar -> addAction(adding_image);
+ diagram_bar -> addAction(add_image);
// ajout de la barre d'outils a la fenetre principale
addToolBar(Qt::TopToolBarArea, main_bar);
@@ -1153,7 +1154,7 @@
remove_column -> setEnabled(editable_diagram);
add_row -> setEnabled(editable_diagram);
remove_row -> setEnabled(editable_diagram);
- adding_image ->setEnabled(editable_diagram);
+ add_image ->setEnabled(editable_diagram);
//display the beta feature only in debug mode
#ifdef QT_NO_DEBUG
@@ -1486,6 +1487,7 @@
Ajoute un texte au schema courant
*/
void QETDiagramEditor::slot_addText() {
+ add_image -> setChecked(false);
if (DiagramView *dv = currentDiagram()) {
dv -> addText();
}
@@ -1494,6 +1496,7 @@
Ajoute une image au schema courant
*/
void QETDiagramEditor::slot_addImage() {
+ add_text -> setChecked(false);
if (DiagramView *dv = currentDiagram()) {
dv -> addImage();
}
@@ -1765,7 +1768,8 @@
connect(dv, SIGNAL(modeChanged()), this, SLOT(slot_updateModeActions()));
connect(dv, SIGNAL(textAdded(bool)), add_text, SLOT(setChecked(bool)));
connect(dv, SIGNAL(textAdded(bool)), add_edittext, SLOT(setChecked(bool)));
- connect(dv, SIGNAL(adding_image(bool)), adding_image, SLOT(setChecked(bool)));
+ connect(dv, SIGNAL(ImageAdded(bool)), add_image, SLOT(setChecked(bool)));
+ connect(dv, SIGNAL(ImageAddedCanceled(bool)), add_image, SLOT(setChecked(bool)));
}
/**
Modified: branches/0.4/sources/qetdiagrameditor.h
===================================================================
--- branches/0.4/sources/qetdiagrameditor.h 2013-08-24 12:03:26 UTC (rev 2447)
+++ branches/0.4/sources/qetdiagrameditor.h 2013-08-24 12:45:21 UTC (rev 2448)
@@ -216,7 +216,7 @@
QAction *cascade_window; ///< Show MDI subwindows as cascade
QAction *prev_window; ///< Switch to the previous document
QAction *next_window; ///< Switch to the next document
- QAction *adding_image; ///< Tool to add an independent image item on diagrams
+ QAction *add_image; ///< Tool to add an independent image item on diagrams
private:
QMdiArea workspace;
QSignalMapper windowMapper;