Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65117 - in /branches/SuSE-Code-11-SP2-Branch/gtk/src: YGTreeView.cc YGUI.h
Author: rpmcruz
Date: Tue Aug 2 02:58:43 2011
New Revision: 65117

URL: http://svn.opensuse.org/viewcvs/yast?rev=65117&view=rev
Log:
Reverted new YTree support.

Modified:
branches/SuSE-Code-11-SP2-Branch/gtk/src/YGTreeView.cc
branches/SuSE-Code-11-SP2-Branch/gtk/src/YGUI.h

Modified: branches/SuSE-Code-11-SP2-Branch/gtk/src/YGTreeView.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/gtk/src/YGTreeView.cc?rev=65117&r1=65116&r2=65117&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/gtk/src/YGTreeView.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/gtk/src/YGTreeView.cc Tue Aug 2 02:58:43
2011
@@ -202,18 +202,33 @@

virtual bool _immediateMode() { return true; }
virtual bool _shrinkable() { return false; }
+ virtual bool _recursiveSelection() { return false; }
+
+ void setMark (GtkTreeIter *iter, YItem *yitem, gint column, bool state,
bool recursive)
+ {
+ setRowMark (iter, column, state);
+ yitem->setSelected (state);
+
+ if (recursive)
+ for (YItemConstIterator it = yitem->childrenBegin();
+ it != yitem->childrenEnd(); it++) {
+ GtkTreeIter _iter;
+ getTreeIter (*it, &_iter);
+ setMark (&_iter, *it, column, state, true);
+ }
+ }

void toggleMark (GtkTreePath *path, gint column)
{
GtkTreeIter iter;
if (!gtk_tree_model_get_iter (getModel(), &iter, path))
return;
-
gboolean state;
gtk_tree_model_get (getModel(), &iter, column, &state, -1);
state = !state;
- setRowMark (&iter, column, state);
- getYItem (&iter)->setSelected (state);
+
+ YItem *yitem = getYItem (&iter);
+ setMark (&iter, yitem, column, state, _recursiveSelection());
syncCount();
emitEvent (YEvent::ValueChanged);
}
@@ -641,6 +656,10 @@
class YGTree : public YTree, public YGTreeView
{
public:
+#if YAST2_VERSION >= 2020003
+ YGTree (YWidget *parent, const string &label, bool multiselection, bool
recursiveSelection)
+ : YTree (NULL, label, multiselection, recursiveSelection),
+#else
#if YAST2_VERSION >= 2019002
YGTree (YWidget *parent, const string &label, bool multiselection)
: YTree (NULL, label, multiselection),
@@ -648,6 +667,7 @@
YGTree (YWidget *parent, const string &label)
: YTree (NULL, label),
#endif
+#endif
YGTreeView (this, parent, label, true)
{
#if YAST2_VERSION >= 2019002
@@ -671,6 +691,10 @@
g_signal_connect (getWidget(), "row-expanded", G_CALLBACK
(row_expanded_cb), this);
}

+#if YAST2_VERSION >= 2020003
+ virtual bool _recursiveSelection() { return recursiveSelection(); }
+#endif
+
void addNode (YItem *item, GtkTreeIter *parent)
{
GtkTreeIter iter;
@@ -750,6 +774,19 @@
virtual YTreeItem *currentItem()
{ return (YTreeItem *) getFocusItem(); }

+ void _markItem (YItem *item, bool select, bool recursive) {
+ GtkTreeIter iter;
+ getTreeIter (item, &iter);
+ setRowMark (&iter, 2, select);
+
+ if (recursive) {
+ YTreeItem *_item = (YTreeItem *) item;
+ for (YItemConstIterator it = _item->childrenBegin();
+ it != _item->childrenEnd(); it++)
+ _markItem (*it, select, true);
+ }
+ }
+
// YGSelectionStore

void doAddItem (YItem *item) {} // rebuild will be called anyway
@@ -758,9 +795,11 @@
{
#if YAST2_VERSION >= 2019002
if (hasMultiSelection()) {
- GtkTreeIter iter;
- getTreeIter (item, &iter);
- setRowMark (&iter, 2, select);
+#if YAST2_VERSION >= 2020003
+ _markItem (item, select, recursiveSelection());
+#else
+ _markItem (item, select, false);
+#endif
syncCount();
}
else
@@ -816,6 +855,10 @@
YGSELECTION_WIDGET_IMPL (YTree)
};

+#if YAST2_VERSION >= 2020003
+YTree *YGWidgetFactory::createTree (YWidget *parent, const string &label, bool
multiselection, bool recursiveSelection)
+{ return new YGTree (parent, label, multiselection, recursiveSelection); }
+#else
#if YAST2_VERSION >= 2019002
YTree *YGWidgetFactory::createTree (YWidget *parent, const string &label, bool
multiselection)
{ return new YGTree (parent, label, multiselection); }
@@ -823,4 +866,5 @@
YTree *YGWidgetFactory::createTree (YWidget *parent, const string &label)
{ return new YGTree (parent, label); }
#endif
+#endif


Modified: branches/SuSE-Code-11-SP2-Branch/gtk/src/YGUI.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/gtk/src/YGUI.h?rev=65117&r1=65116&r2=65117&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/gtk/src/YGUI.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/gtk/src/YGUI.h Tue Aug 2 02:58:43 2011
@@ -89,11 +89,15 @@
virtual YRadioButton *createRadioButton (YWidget *parent, const string
&label, bool isChecked);
virtual YComboBox *createComboBox (YWidget *parent, const string & label,
bool editable);
virtual YSelectionBox *createSelectionBox (YWidget *parent, const
string &label);
+#if YAST2_VERSION >= 2020003
+ virtual YTree *createTree (YWidget *parent, const string &label, bool
multiselection, bool recursiveSelection);
+#else
#if YAST2_VERSION >= 2019002
virtual YTree *createTree (YWidget *parent, const string &label, bool
multiselection);
#else
virtual YTree *createTree (YWidget *parent, const string &label);
#endif
+#endif
virtual YTable *createTable (YWidget *parent, YTableHeader *headers,
bool multiSelection);
virtual YProgressBar *createProgressBar (YWidget *parent, const string
&label, int maxValue);
virtual YBusyIndicator *createBusyIndicator (YWidget *parent, const
string &label, int timeout);

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages