|
From: Hans F. <fu...@us...> - 2004-06-25 02:24:05
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20359/view/qt Modified Files: qt.rb Log Message: Reordered some funcitons. Index: qt.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/qt.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- qt.rb 24 Jun 2004 04:09:45 -0000 1.2 +++ qt.rb 25 Jun 2004 02:23:56 -0000 1.3 @@ -4,20 +4,12 @@ class Qt::ListViewItem attr_accessor :data end + class Neelix def postinitialize build_shelf @shelf.currentItem = @shelf.firstChild end - - def helpAbout - AboutDialog.new.exec - end - - def fileExit - $qApp.quit - end - def build_shelf $replicator.cookbooks.each do |cookbook| i = Qt::ListViewItem.new(@shelf,cookbook.name) @@ -37,19 +29,6 @@ end end end - - def shelf_currentChanged - i = @shelf.currentItem.data - self.counter_currentItem = i - case i - when Cookbook - @counterStack.enabled = false - when Category - @counterStack.enabled = false - when Recipe - @counterStack.enabled = true - end - end def counter_currentItem=(i) case i when Cookbook @@ -58,22 +37,6 @@ refresh_recipe(i) end end - def adjust_columns - @ingredients_table.numCols.times do |j| - @ingredients_table.adjustColumn(j) - end - end - - def shelf_item_renamed(item,col,text) - data = item.data - data.name = text - - case data - when Recipe - @recipe_entry.text = text - end - end - def refresh_recipe(r) @recipe_entry.text = r.name @author_entry.text = r.author @@ -92,7 +55,53 @@ @directions_edit.text = r.directions @note_edit.text = r.note end + def adjust_columns + @ingredients_table.numCols.times do |j| + @ingredients_table.adjustColumn(j) + end + end + + def fileExit + $qApp.quit + end + def helpAbout + AboutDialog.new.exec + end + + def shelf_currentChanged + i = @shelf.currentItem.data + self.counter_currentItem = i + case i + when Cookbook + @counterStack.enabled = false + when Category + @counterStack.enabled = false + when Recipe + @counterStack.enabled = true + end + end + def shelf_item_renamed(item,col,text) + data = item.data + data.name = text + case data + when Recipe + @recipe_entry.text = text + end + end + + def recipename_changed(text) + @shelf.currentItem.data.name = text + end + def author_changed(text) + @shelf.currentItem.data.author = text + end + def tottime_changed(text) + @shelf.currentItem.data.tottime = text + end + def yields_changed(text) + @shelf.currentItem.data.yields = text + end def ingredient_changed(row,col) recipe = @shelf.currentItem.data case col @@ -109,31 +118,12 @@ end end - - def tottime_changed(text) - @shelf.currentItem.data.tottime = text - end - - def yields_changed(text) - @shelf.currentItem.data.yields = text - end - def directions_changed() @shelf.currentItem.data.directions = @directions_edit.text end - def note_changed() @shelf.currentItem.data.note = @note_edit.text end - - def author_changed(text) - @shelf.currentItem.data.author = text - end - - def recipename_changed(text) - @shelf.currentItem.data.name = text - end - end a = Qt::Application.new(ARGV) @@ -145,3 +135,5 @@ a.mainWidget = w w.show a.exec + +# vim:fdm=syntax |