Masato Taruishi
taru****@users*****
2004年 9月 15日 (水) 18:24:36 JST
=================================================================== RCS file: demo/haviewer/lib/haviewer/haviewer.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- demo/haviewer/lib/haviewer/haviewer.rb 2004/09/14 11:01:43 1.3 +++ demo/haviewer/lib/haviewer/haviewer.rb 2004/09/15 09:24:36 1.4 @@ -163,6 +163,7 @@ $haview = HAViewer.new(ARGV[0]) $haview.add_view( "status", HAViewer::UltraPossum.new($haview) ) $haview.add_view( "entry", HAViewer::UltraPossum::EntryView.new($haview) ) +$haview.add_view( "config", HAViewer::UltraPossum::ConfigView.new($haview) ) $haview.glade["dialog1"].set_title( "UltraPossum HA Viewer (#{HAViewer::UltraPossum::Conf["ORGANIZATION"]})" ) $haview.update HAViewer::Hosts.each do |host| =================================================================== RCS file: demo/haviewer/lib/haviewer/ultrapossum.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- demo/haviewer/lib/haviewer/ultrapossum.rb 2004/09/13 13:00:41 1.7 +++ demo/haviewer/lib/haviewer/ultrapossum.rb 2004/09/15 09:24:36 1.8 @@ -303,6 +303,29 @@ end + class ConfigView < View + + Column = [ "Key", "Value" ] + def initialize(haview) + super + @list = Gtk::ListStore.new( String, String ) + @columns = [] + Column.size.times do |i| + @columns << Gtk::TreeViewColumn.new(Column[i], Gtk::CellRendererText.new, { :markup => i }) + end + @row = {} + Conf.keys.sort.each do |key| + @row[key] =****@list***** + @list.set_value(@row[key], 0, key ) + @list.set_value(@row[key], 1, Conf[key] ) + end + @columns.each do |val| + @glade["treeview3"].append_column(val) + end + @glade["treeview3"].set_model(@list) + end + end + end end