mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Diagram editor: added a few status and "What's this?" tips.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1696 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
parent
3b7b70f551
commit
1b52030484
@ -47,6 +47,14 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) : QGraphicsView(pare
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
setInteractive(true);
|
||||
|
||||
QString whatsthis = tr(
|
||||
"Ceci est la zone dans laquelle vous concevez vos schémas en y ajoutant"
|
||||
"des éléments et en posant des conducteurs entre leurs bornes. Il est"
|
||||
" également possible d'ajouter des textes indépendants.",
|
||||
"\"What's this?\" tip"
|
||||
);
|
||||
setWhatsThis(whatsthis);
|
||||
|
||||
// active l'antialiasing
|
||||
setRenderHint(QPainter::Antialiasing, true);
|
||||
setRenderHint(QPainter::TextAntialiasing, true);
|
||||
|
@ -94,6 +94,7 @@ ElementsPanel::ElementsPanel(QWidget *parent) :
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setColumnCount(1);
|
||||
setExpandsOnDoubleClick(true);
|
||||
setMouseTracking(true);
|
||||
|
||||
// drag'n drop autorise
|
||||
setDragEnabled(true);
|
||||
@ -401,6 +402,8 @@ QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) {
|
||||
if (TitleBlockTemplatesCollection *tbt_collection = project -> embeddedTitleBlockTemplatesCollection()) {
|
||||
if (QTreeWidgetItem *tbt_collection_qtwi = itemForTemplatesCollection(tbt_collection)) {
|
||||
tbt_collection_qtwi -> setText(0, tr("Cartouches embarqués"));
|
||||
tbt_collection_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection de cartouches embarqu\351e", "Status tip"));
|
||||
|
||||
if (first_add) tbt_collection_qtwi -> setExpanded(true);
|
||||
}
|
||||
}
|
||||
@ -408,10 +411,13 @@ QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) {
|
||||
if (ElementsCollection *elmt_collection = project -> embeddedCollection()) {
|
||||
if (QTreeWidgetItem *elmt_collection_qtwi = itemForElementsCollection(elmt_collection)) {
|
||||
elmt_collection_qtwi -> setText(0, tr("Collection embarquée"));
|
||||
elmt_collection_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection d'\351l\351ments embarqu\351e", "Status tip"));
|
||||
if (first_add) elmt_collection_qtwi -> setExpanded(true);
|
||||
}
|
||||
}
|
||||
|
||||
qtwi_project -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper ce projet", "Status tip"));
|
||||
|
||||
return(qtwi_project);
|
||||
}
|
||||
|
||||
@ -436,14 +442,7 @@ QTreeWidgetItem *ElementsPanel::updateTemplateItem(QTreeWidgetItem *tb_template_
|
||||
0,
|
||||
tr(
|
||||
"Cliquer-d\351posez ce mod\350le de cartouche sur un sch\351ma pour l'y appliquer.",
|
||||
"Tip displayed when selecting a title block template"
|
||||
)
|
||||
);
|
||||
item -> setWhatsThis(
|
||||
0,
|
||||
tr(
|
||||
"Ceci est un mod\350le de cartouche, qui peut \352tre appliqu\351 a un sch\351ma.",
|
||||
"\"What's this\" tip"
|
||||
"Status tip displayed when selecting a title block template"
|
||||
)
|
||||
);
|
||||
return(item);
|
||||
@ -451,6 +450,13 @@ QTreeWidgetItem *ElementsPanel::updateTemplateItem(QTreeWidgetItem *tb_template_
|
||||
|
||||
QTreeWidgetItem *ElementsPanel::updateElementsCategoryItem(QTreeWidgetItem *category_qtwi, ElementsCategory *category, PanelOptions options, bool freshly_created) {
|
||||
QTreeWidgetItem *item = GenericPanel::updateElementsCategoryItem(category_qtwi, category, options, freshly_created);
|
||||
item -> setStatusTip(
|
||||
0,
|
||||
tr(
|
||||
"Double-cliquez pour r\351duire ou d\351velopper cette cat\351gorie d'\351l\351ments",
|
||||
"Status tip displayed by elements category"
|
||||
)
|
||||
);
|
||||
emit(loadingProgressed(++ loading_progress_, -1));
|
||||
return(item);
|
||||
}
|
||||
@ -458,12 +464,9 @@ QTreeWidgetItem *ElementsPanel::updateElementsCategoryItem(QTreeWidgetItem *cate
|
||||
QTreeWidgetItem *ElementsPanel::updateElementItem(QTreeWidgetItem *element_qtwi, ElementDefinition *element, PanelOptions options, bool freshly_created) {
|
||||
QTreeWidgetItem *item = GenericPanel::updateElementItem(element_qtwi, element, options, freshly_created);
|
||||
|
||||
QString whats_this = tr("Ceci est un \351l\351ment que vous pouvez ins\351rer dans votre sch\351ma par cliquer-d\351placer");
|
||||
item -> setWhatsThis(0, whats_this);
|
||||
|
||||
QString status_tip = tr(
|
||||
"Cliquer-d\351posez cet \351l\351ment sur le sch\351ma pour ins\351rer un \351l\351ment \253 %1 \273",
|
||||
"Tip displayed in the status bar when selecting an element"
|
||||
"Cliquer-d\351posez cet \351l\351ment sur un sch\351ma pour y ins\351rer un \351l\351ment \253 %1 \273, double-cliquez dessus pour l'\351diter",
|
||||
"Status tip displayed in the status bar when selecting an element"
|
||||
);
|
||||
item -> setStatusTip(0, status_tip.arg(item -> text(0)));
|
||||
|
||||
@ -542,11 +545,15 @@ void ElementsPanel::reload(bool reload_collections) {
|
||||
TitleBlockTemplatesCollection *common_tbt_collection = QETApp::commonTitleBlockTemplatesCollection();
|
||||
common_tbt_collection_item_ = addTemplatesCollection(common_tbt_collection, invisibleRootItem());
|
||||
common_tbt_collection_item_ -> setIcon(0, system_icon);
|
||||
common_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper la collection de cartouches QElectroTech", "Status tip"));
|
||||
common_tbt_collection_item_ -> setWhatsThis(0, tr("Ceci est la collection de cartouches fournie avec QElectroTech. Install\351e en tant que composant syst\350me, vous ne pouvez normalement pas la personnaliser.", "\"What's this\" tip"));
|
||||
if (first_reload_) common_tbt_collection_item_ -> setExpanded(true);
|
||||
|
||||
// load the common elements collection
|
||||
if (QETApp::commonElementsCollection()->rootCategory()) {
|
||||
if (QETApp::commonElementsCollection() -> rootCategory()) {
|
||||
common_collection_item_ = addCollection(QETApp::commonElementsCollection());
|
||||
common_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper la collection d'\351l\351ments QElectroTech", "Status tip"));
|
||||
common_collection_item_ -> setWhatsThis(0, tr("Ceci est la collection d'\351l\351ments fournie avec QElectroTech. Install\351e en tant que composant syst\350me, vous ne pouvez normalement pas la personnaliser.", "\"What's this\" tip"));
|
||||
if (first_reload_) common_collection_item_ -> setExpanded(true);
|
||||
}
|
||||
|
||||
@ -554,11 +561,15 @@ void ElementsPanel::reload(bool reload_collections) {
|
||||
TitleBlockTemplatesCollection *custom_tbt_collection = QETApp::customTitleBlockTemplatesCollection();
|
||||
custom_tbt_collection_item_ = addTemplatesCollection(custom_tbt_collection, invisibleRootItem());
|
||||
custom_tbt_collection_item_ -> setIcon(0, user_icon);
|
||||
custom_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper votre collection personnelle de cartouches", "Status tip"));
|
||||
custom_tbt_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle de cartouches -- utilisez-la pour cr\351er, stocker et \351diter vos propres cartouches.", "\"What's this\" tip"));
|
||||
if (first_reload_) custom_tbt_collection_item_ -> setExpanded(true);
|
||||
|
||||
// load the custom elements collection
|
||||
if (QETApp::customElementsCollection()->rootCategory()) {
|
||||
if (QETApp::customElementsCollection() -> rootCategory()) {
|
||||
custom_collection_item_ = addCollection(QETApp::customElementsCollection());
|
||||
custom_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper votre collection personnelle d'\351l\351ments", "Status tip"));
|
||||
custom_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle d'\351l\351ments -- utilisez-la pour cr\351er, stocker et \351diter vos propres \351l\351ments.", "\"What's this\" tip"));
|
||||
if (first_reload_) custom_collection_item_ -> setExpanded(true);
|
||||
}
|
||||
|
||||
|
@ -222,6 +222,8 @@ QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi,
|
||||
);
|
||||
}
|
||||
project_qtwi -> setToolTip(0, final_tooltip);
|
||||
QString project_whatsthis = tr("Ceci est un projet QElectroTech, c'est-\340-dire un fichier d'extension .qet regroupant plusieurs sch\351mas/folios. Il embarque \351galement les \351l\351ments et mod\350les de cartouches utilis\351s dans ces sch\351mas/folios.", "\"What's this\" tip");
|
||||
project_qtwi -> setWhatsThis(0, project_whatsthis);
|
||||
return(updateItem(project_qtwi, options, freshly_created));
|
||||
}
|
||||
|
||||
@ -273,11 +275,20 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE
|
||||
}
|
||||
|
||||
if (options & AddChildElementsCollections) {
|
||||
addElementsCollection(
|
||||
QTreeWidgetItem *collection_qtwi = addElementsCollection(
|
||||
project -> embeddedCollection(),
|
||||
project_qtwi,
|
||||
options
|
||||
);
|
||||
QString collection_whatsthis = tr("Ceci est une collection embarqu\351e dans un fichier projet. Elle permet de stocker et g\351rer les \351l\351ments utilis\351s dans les sch\351mas du projet parent.", "\"What's this\" tip");
|
||||
collection_qtwi -> setWhatsThis(0, collection_whatsthis);
|
||||
|
||||
// special instructions for the integration category
|
||||
if (QTreeWidgetItem *integration_qtwi = itemForElementsCategory(project -> integrationCategory())) {
|
||||
QString integration_whats_this = tr("Cette cat\351gorie d'\351l\351ments est utilis\351e pour int\351grer automatiquement dans le projet tout \351l\351ment utilis\351 sur un des sch\351mas de ce projet.", "\"What's this\" tip");
|
||||
integration_qtwi -> setWhatsThis(0, integration_whats_this);
|
||||
}
|
||||
|
||||
}
|
||||
return(fillItem(project_qtwi, options, freshly_created));
|
||||
}
|
||||
@ -510,6 +521,11 @@ QTreeWidgetItem *GenericPanel::getItemForTemplate(const TitleBlockTemplateLocati
|
||||
QTreeWidgetItem *GenericPanel::updateTemplateItem(QTreeWidgetItem *tb_template_qtwi, const TitleBlockTemplateLocation &tb_template, PanelOptions options, bool freshly_created) {
|
||||
Q_UNUSED(options)
|
||||
tb_template_qtwi -> setText(0, tr("Mod\350le \"%1\"", "used to display a title block template").arg(tb_template.name()));
|
||||
QString tbt_whatsthis = tr(
|
||||
"Ceci est un mod\350le de cartouche, qui peut \352tre appliqu\351 \340 un sch\351ma.",
|
||||
"\"What's this\" tip"
|
||||
);
|
||||
tb_template_qtwi -> setWhatsThis(0, tbt_whatsthis);
|
||||
// note the following lines are technically marking the template as used
|
||||
tb_template_qtwi -> setToolTip(0, tb_template.toString());
|
||||
tb_template_qtwi -> setBackground(0, QBrush());
|
||||
@ -690,7 +706,11 @@ QTreeWidgetItem *GenericPanel::getItemForElementsCategory(ElementsCategory *cate
|
||||
QTreeWidgetItem *GenericPanel::updateElementsCategoryItem(QTreeWidgetItem *category_qtwi, ElementsCategory *category, PanelOptions options, bool freshly_created) {
|
||||
Q_UNUSED(options)
|
||||
if (!category || !category_qtwi) return(0);
|
||||
|
||||
QString category_whatsthis = tr(
|
||||
"Ceci est une cat\351gorie d'\351l\351ments, un simple container permettant d'organiser les collections d'\351l\351ments",
|
||||
"\"What's this\" tip"
|
||||
);
|
||||
category_qtwi -> setWhatsThis(0, category_whatsthis);
|
||||
category_qtwi -> setText(0, category -> name());
|
||||
markItemAsContainer(category_qtwi);
|
||||
|
||||
@ -798,6 +818,8 @@ QTreeWidgetItem *GenericPanel::updateElementItem(QTreeWidgetItem *element_qtwi,
|
||||
|
||||
ElementsLocation element_location = element -> location();
|
||||
element_qtwi -> setText(0, cache -> name());
|
||||
QString element_whatsthis = tr("Ceci est un \351l\351ment que vous pouvez ins\351rer dans un sch\351ma.", "\"What's this\" tip");
|
||||
element_qtwi -> setWhatsThis(0, element_whatsthis);
|
||||
if (options & DisplayElementsPreview) {
|
||||
element_qtwi -> setIcon(0, QIcon(cache -> pixmap()));
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
|
||||
tabifyDockWidget(qdw_pa, qdw_undo);
|
||||
QUndoView *undo_view = new QUndoView(&undo_group, this);
|
||||
undo_view -> setEmptyLabel(tr("Aucune modification"));
|
||||
undo_view -> setStatusTip(tr("Cliquez sur une action pour revenir en arri\350re dans l'\351dition de votre sch\351ma", "Status tip"));
|
||||
undo_view -> setWhatsThis(tr("Ce panneau liste les différentes actions effectuées sur le schéma courant. Cliquer sur une action permet de revenir à l'état du schéma juste après son application.", "\"What's this\" tip"));
|
||||
qdw_undo -> setWidget(undo_view);
|
||||
|
||||
addDockWidget(Qt::LeftDockWidgetArea, qdw_undo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user