The scroll-and-highlight animation when integrating an element into a project is now optional.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1714 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-04-29 20:29:40 +00:00
parent 7990889d99
commit b56a594c54
4 changed files with 18 additions and 2 deletions

View File

@@ -105,6 +105,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
bool use_system_colors = settings.value("usesystemcolors", "true").toBool(); bool use_system_colors = settings.value("usesystemcolors", "true").toBool();
bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed"; bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
bool integrate_elements = settings.value("diagrameditor/integrate-elements", true).toBool(); bool integrate_elements = settings.value("diagrameditor/integrate-elements", true).toBool();
bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool();
QString default_element_informations = settings.value("elementeditor/default-informations", "").toString(); QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
appearance_ = new QGroupBox(tr("Apparence"), this); appearance_ = new QGroupBox(tr("Apparence"), this);
@@ -116,7 +117,8 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
warning_view_mode_ = new QLabel(tr("Ces param\350tres s'appliqueront d\350s la prochaine ouverture d'un \351diteur de sch\351mas.")); warning_view_mode_ = new QLabel(tr("Ces param\350tres s'appliqueront d\350s la prochaine ouverture d'un \351diteur de sch\351mas."));
elements_management_ = new QGroupBox(tr("Gestion des \351l\351ments"), this); elements_management_ = new QGroupBox(tr("Gestion des \351l\351ments"), this);
integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)"), elements_management_); integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)"));
highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les \351l\351ments fraichement int\351gr\351s", "configuration option"));
default_element_infos_label_ = new QLabel( default_element_infos_label_ = new QLabel(
tr( tr(
"Chaque \351l\351ment embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre. " "Chaque \351l\351ment embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre. "
@@ -136,6 +138,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
} }
integrate_elements_ -> setChecked(integrate_elements); integrate_elements_ -> setChecked(integrate_elements);
highlight_integrated_elements_ -> setChecked(highlight_integrated_elements);
default_element_infos_textfield_ -> setPlainText(default_element_informations); default_element_infos_textfield_ -> setPlainText(default_element_informations);
QVBoxLayout *appearance_layout = new QVBoxLayout(); QVBoxLayout *appearance_layout = new QVBoxLayout();
@@ -150,6 +153,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
QVBoxLayout *elements_management_layout = new QVBoxLayout(); QVBoxLayout *elements_management_layout = new QVBoxLayout();
elements_management_layout -> addWidget(integrate_elements_); elements_management_layout -> addWidget(integrate_elements_);
elements_management_layout -> addWidget(highlight_integrated_elements_);
elements_management_layout -> addWidget(default_element_infos_label_); elements_management_layout -> addWidget(default_element_infos_label_);
elements_management_layout -> addWidget(default_element_infos_textfield_); elements_management_layout -> addWidget(default_element_infos_textfield_);
elements_management_ -> setLayout(elements_management_layout); elements_management_ -> setLayout(elements_management_layout);
@@ -192,6 +196,7 @@ void GeneralConfigurationPage::applyConf() {
settings.setValue("diagrameditor/viewmode", view_mode) ; settings.setValue("diagrameditor/viewmode", view_mode) ;
settings.setValue("diagrameditor/integrate-elements", integrate_elements_ -> isChecked()); settings.setValue("diagrameditor/integrate-elements", integrate_elements_ -> isChecked());
settings.setValue("diagrameditor/highlight-integrated-elements", highlight_integrated_elements_ -> isChecked());
settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText()); settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText());
} }

View File

@@ -99,6 +99,7 @@ class GeneralConfigurationPage : public ConfigPage {
QLabel *warning_view_mode_; QLabel *warning_view_mode_;
QGroupBox *elements_management_; QGroupBox *elements_management_;
QCheckBox *integrate_elements_; QCheckBox *integrate_elements_;
QCheckBox *highlight_integrated_elements_;
QLabel *default_element_infos_label_; QLabel *default_element_infos_label_;
QTextEdit *default_element_infos_textfield_; QTextEdit *default_element_infos_textfield_;
}; };

View File

@@ -388,7 +388,9 @@ void ElementsPanel::panelContentChange() {
QList<ElementsLocation> ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) { QList<ElementsLocation> ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) {
// the base implementation simply refreshes the adequate category and returns the list of added locations // the base implementation simply refreshes the adequate category and returns the list of added locations
QList<ElementsLocation> added_locations = GenericPanel::elementIntegrated(project, location); QList<ElementsLocation> added_locations = GenericPanel::elementIntegrated(project, location);
if (!added_locations.count()) return(added_locations); if (!added_locations.count() || !mustHighlightIntegratedElements()) {
return(added_locations);
}
// the additional job of this method consists in displaying the integrated elements... // the additional job of this method consists in displaying the integrated elements...
if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) { if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) {
@@ -550,6 +552,13 @@ int ElementsPanel::elementsCollectionItemsCount() {
return(items_count); return(items_count);
} }
/**
@return true if freshly integrated elements should be highlighted, false otherwise.
*/
bool ElementsPanel::mustHighlightIntegratedElements() const {
return(QETApp::settings().value("diagrameditor/highlight-integrated-elements", true).toBool());
}
/** /**
Recharge l'arbre des elements Recharge l'arbre des elements
@param reload_collections true pour relire les collections depuis leurs sources (fichiers, projets...) @param reload_collections true pour relire les collections depuis leurs sources (fichiers, projets...)

View File

@@ -60,6 +60,7 @@ class ElementsPanel : public GenericPanel {
void reloadCollections(); void reloadCollections();
int elementsCollectionItemsCount(); int elementsCollectionItemsCount();
bool mustHighlightIntegratedElements() const;
signals: signals:
void requestForProject(QETProject *); void requestForProject(QETProject *);