Author: aschnell Date: Tue Jan 27 16:17:43 2009 New Revision: 55080 URL: http://svn.opensuse.org/viewcvs/yast?rev=55080&view=rev Log: - added simple user-interaction to graph widget Modified: trunk/libyui/VERSION trunk/libyui/package/yast2-libyui.changes trunk/libyui/src/YGraph.cc trunk/libyui/src/YGraph.h trunk/qt-graph/VERSION.cmake trunk/qt-graph/package/yast2-qt-graph.changes trunk/qt-graph/src/YQGraph.cc trunk/qt-graph/src/YQGraph.h trunk/qt-graph/yast2-qt-graph.spec.in trunk/storage/storage/src/include/ep-graph.ycp Modified: trunk/libyui/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/VERSION?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/libyui/VERSION (original) +++ trunk/libyui/VERSION Tue Jan 27 16:17:43 2009 @@ -1 +1 @@ -2.18.2 +2.18.3 Modified: trunk/libyui/package/yast2-libyui.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/package/yast2-libyui.changes?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/libyui/package/yast2-libyui.changes (original) +++ trunk/libyui/package/yast2-libyui.changes Tue Jan 27 16:17:43 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jan 27 15:33:29 CET 2009 - aschnell@suse.de + +- extended YGraph for simple user-interaction +- V 2.18.3 + +------------------------------------------------------------------- Fri Jan 16 11:32:21 CET 2009 - kkaempf@suse.de - Fix bnc#427372 once more, YWidgetFactory:createTable was missing Modified: trunk/libyui/src/YGraph.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YGraph.cc?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/libyui/src/YGraph.cc (original) +++ trunk/libyui/src/YGraph.cc Tue Jan 27 16:17:43 2009 @@ -96,6 +96,13 @@ } +string +YGraph::activatedNode() const +{ + return ""; +} + + const YPropertySet & YGraph::propertySet() { @@ -106,9 +113,11 @@ /* * @property string Filename name of the file describing the graph * @property string Layout layout-algorithm used from the graph + * @property string Item activated node (read-only) */ propSet.add( YProperty( YUIProperty_Filename, YStringProperty ) ); propSet.add( YProperty( YUIProperty_Layout, YStringProperty ) ); + propSet.add( YProperty( YUIProperty_Item, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } @@ -139,6 +148,7 @@ if ( propertyName == YUIProperty_Filename ) return YPropertyValue( filename() ); else if ( propertyName == YUIProperty_Layout ) return YPropertyValue( layoutAlgorithm() ); + else if ( propertyName == YUIProperty_Item ) return YPropertyValue( activatedNode() ); else { return YWidget::getProperty( propertyName ); Modified: trunk/libyui/src/YGraph.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YGraph.h?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/libyui/src/YGraph.h (original) +++ trunk/libyui/src/YGraph.h Tue Jan 27 16:17:43 2009 @@ -21,7 +21,7 @@ #include "YWidget.h" -extern "C" +extern "C" { struct Agraph_t; typedef struct Agraph_t graph_t; @@ -125,6 +125,11 @@ **/ virtual void setGraph( graph_t * graph ); + /** + * Return name of activated node. + */ + virtual string activatedNode() const; + protected: /** Modified: trunk/qt-graph/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/VERSION.cmake?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/qt-graph/VERSION.cmake (original) +++ trunk/qt-graph/VERSION.cmake Tue Jan 27 16:17:43 2009 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "18") -SET(VERSION_PATCH "1") +SET(VERSION_PATCH "2") Modified: trunk/qt-graph/package/yast2-qt-graph.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/package/yast2-qt-graph.changes?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/qt-graph/package/yast2-qt-graph.changes (original) +++ trunk/qt-graph/package/yast2-qt-graph.changes Tue Jan 27 16:17:43 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jan 27 15:34:53 CET 2009 - aschnell@suse.de + +- added simple user-interaction +- 2.18.2 + +------------------------------------------------------------------- Fri Jan 23 20:29:34 CET 2009 - aschnell@suse.de - improved renderer Modified: trunk/qt-graph/src/YQGraph.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/YQGraph.cc?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/qt-graph/src/YQGraph.cc (original) +++ trunk/qt-graph/src/YQGraph.cc Tue Jan 27 16:17:43 2009 @@ -37,6 +37,9 @@ YGraph(parent, filename, layoutAlgorithm) { setWidgetRep(this); + + connect(this, SIGNAL(nodeDoubleClickEvent(const QString&)), + this, SLOT(nodeActivated(const QString&))); } @@ -45,6 +48,9 @@ YGraph(parent, graph) { setWidgetRep(this); + + connect(this, SIGNAL(nodeDoubleClickEvent(const QString&)), + this, SLOT(nodeActivated(const QString&))); } @@ -88,4 +94,12 @@ } +void +YQGraph::nodeActivated(const QString& name) +{ + lastActivatedNode = name.toStdString(); + YQUI::ui()->sendEvent(new YWidgetEvent(this, YEvent::Activated)); +} + + #include "YQGraph.moc" Modified: trunk/qt-graph/src/YQGraph.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/YQGraph.h?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/qt-graph/src/YQGraph.h (original) +++ trunk/qt-graph/src/YQGraph.h Tue Jan 27 16:17:43 2009 @@ -62,6 +62,16 @@ void renderGraph(graph_t* graph); + string activatedNode() const { return lastActivatedNode; } + +private slots: + + void nodeActivated(const QString& name); + +private: + + string lastActivatedNode; + }; Modified: trunk/qt-graph/yast2-qt-graph.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/yast2-qt-graph.spec.in?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/qt-graph/yast2-qt-graph.spec.in (original) +++ trunk/qt-graph/yast2-qt-graph.spec.in Tue Jan 27 16:17:43 2009 @@ -1,10 +1,9 @@ @HEADERCOMMENT@ - @HEADER@ BuildRequires: cmake libqt4-devel graphviz-devel -BuildRequires: yast2-devtools yast2-qt-devel >= 2.18.4 yast2-libyui-devel >= 2.18.2 -Requires: yast2-qt >= 2.18.4 yast2-libyui >= 2.18.2 +BuildRequires: yast2-devtools yast2-qt-devel >= 2.18.4 yast2-libyui-devel >= 2.18.3 +Requires: yast2-qt >= 2.18.4 yast2-libyui >= 2.18.3 Provides: yast2-qt:/usr/lib/YaST2/plugin/libpy2qt_graph.so.2 Provides: yast2_ui_graph Summary: - Modified: trunk/storage/storage/src/include/ep-graph.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-graph.ycp?rev=55080&r1=55079&r2=55080&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-graph.ycp (original) +++ trunk/storage/storage/src/include/ep-graph.ycp Tue Jan 27 16:17:43 2009 @@ -40,6 +40,13 @@ { switch (widget) { + case `graph: + { + string node = (string) UI::QueryWidget(`id(`graph), `Item); + y2milestone("double click on node %1", node); + } + break; + case `export: { string filename = UI::AskForSaveFileName("/tmp", "*.dot", "Save as..."); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org