You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
(31) |
Jul
(12) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Hans F. <fu...@us...> - 2004-06-25 02:45:41
|
Update of /cvsroot/neelix/neelix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23395 Modified Files: TODO Log Message: Editing measure and food complete. Note I didn't use the find_food function in the replicator. Yeah, putting it all in the presenter means we can't take advantage of SQL, but OTOH not using SQL is more database-agnostic and not likely to be a performance hit. "Premature optimization is the root of all evil" and all that. Index: TODO =================================================================== RCS file: /cvsroot/neelix/neelix/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TODO 24 Jun 2004 04:09:45 -0000 1.3 +++ TODO 25 Jun 2004 02:45:31 -0000 1.4 @@ -1,12 +1,11 @@ 0.1.0 - target: July 4, 2004 +Finish Menu functionality Finish Ingredient dialog. - - measure/food in @ingredient_table need to look for an existing match and - if not found create a new one. This ought to be a presenter function. - reordering,addition,deletion of ingredients Recipe management (within categories) (add/del/sort/move) Category management (add/del/sort/move) Cookbook mgmt (add/del/sort) - + 0.2.0 - meal plans - shopping lists |
From: Hans F. <fu...@us...> - 2004-06-25 02:45:41
|
Update of /cvsroot/neelix/neelix/presenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23395/presenter Modified Files: presenter.rb Log Message: Editing measure and food complete. Note I didn't use the find_food function in the replicator. Yeah, putting it all in the presenter means we can't take advantage of SQL, but OTOH not using SQL is more database-agnostic and not likely to be a performance hit. "Premature optimization is the root of all evil" and all that. Index: presenter.rb =================================================================== RCS file: /cvsroot/neelix/neelix/presenter/presenter.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- presenter.rb 14 Jun 2004 20:15:58 -0000 1.5 +++ presenter.rb 25 Jun 2004 02:45:31 -0000 1.6 @@ -1,21 +1,38 @@ # UI-independent (or mostly so) code that is also independent of the model. module Presenter - def Presenter::promoteIngredient(recipe, i) - raise "Can't promote first ingredient" unless i > 0 - sorted_ingredients = recipe.ingredients.sort - sorted_ingredients[i].position, sorted_ingredients[i - 1].position = sorted_ingredients[i - 1].position, sorted_ingredients[i].position - end - def Presenter::demoteIngredient(recipe, i) - raise "Can't demote last ingredient" unless i < recipe.ingredients.length - 1 - sorted_ingredients = recipe.ingredients.sort - sorted_ingredients[i].position, sorted_ingredients[i + 1].position = sorted_ingredients[i + 1].position, sorted_ingredients[i].position - end - def Presenter::deleteIngredient(recipe, i) - sorted_ingredients = recipe.ingredients.sort - ingredient = sorted_ingredients[i] - recipe.ingredients.delete(ingredient) - end - def Presenter::addIngredient(recipe, ingredient) + def Presenter::promoteIngredient(recipe, i) + raise "Can't promote first ingredient" unless i > 0 + sorted_ingredients = recipe.ingredients.sort + sorted_ingredients[i].position, sorted_ingredients[i - 1].position = sorted_ingredients[i - 1].position, sorted_ingredients[i].position + end + def Presenter::demoteIngredient(recipe, i) + raise "Can't demote last ingredient" unless i < recipe.ingredients.length - 1 + sorted_ingredients = recipe.ingredients.sort + sorted_ingredients[i].position, sorted_ingredients[i + 1].position = sorted_ingredients[i + 1].position, sorted_ingredients[i].position + end + def Presenter::deleteIngredient(recipe, i) + sorted_ingredients = recipe.ingredients.sort + ingredient = sorted_ingredients[i] + recipe.ingredients.delete(ingredient) + end + def Presenter::addIngredient(recipe, ingredient) + end + + # find a matching measure or create it. + def Presenter::findCreateMeasure(text) + m = $replicator.measures.find { |m| m.name == text } + if not m + m = $replicator.create('measure',nil) + m.name = text end + m + end + # find a matching food or create it. + def Presenter::findCreateFood(text) + f = $replicator.foods.find { |f| f.name == text } + f = $replicator.create('food',{'name'=>text}) if not f + f + end end -#vim:ts=8:sw=4:nowrap + +# vim:ts=8:sw=2:nowrap |
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 |
From: Hans F. <fu...@us...> - 2004-06-24 04:09:55
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13290/view/qt Modified Files: mw.ui qt.rb Log Message: Editing of everything works, with the exception of measure and food. See TODO for why. Index: mw.ui =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/mw.ui,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mw.ui 23 Jun 2004 13:30:33 -0000 1.2 +++ mw.ui 24 Jun 2004 04:09:45 -0000 1.3 @@ -9,7 +9,7 @@ <x>0</x> <y>0</y> <width>747</width> - <height>519</height> + <height>525</height> </rect> </property> <property name="caption"> @@ -427,12 +427,6 @@ </images> <connections> <connection> - <sender>fileNewAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>fileNew()</slot> - </connection> - <connection> <sender>fileOpenAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> @@ -468,14 +462,74 @@ <receiver>Neelix</receiver> <slot>shelf_item_renamed(QListViewItem*,int,const QString&)</slot> </connection> + <connection> + <sender>directions_edit</sender> + <signal>textChanged()</signal> + <receiver>Neelix</receiver> + <slot>directions_changed()</slot> + </connection> + <connection> + <sender>note_edit</sender> + <signal>textChanged()</signal> + <receiver>Neelix</receiver> + <slot>note_changed()</slot> + </connection> + <connection> + <sender>recipe_entry</sender> + <signal>textChanged(const QString&)</signal> + <receiver>Neelix</receiver> + <slot>recipename_changed(const QString&)</slot> + </connection> + <connection> + <sender>tottime_entry</sender> + <signal>textChanged(const QString&)</signal> + <receiver>Neelix</receiver> + <slot>tottime_changed(const QString&)</slot> + </connection> + <connection> + <sender>author_entry</sender> + <signal>textChanged(const QString&)</signal> + <receiver>Neelix</receiver> + <slot>author_changed(const QString&)</slot> + </connection> + <connection> + <sender>yields_entry</sender> + <signal>textChanged(const QString&)</signal> + <receiver>Neelix</receiver> + <slot>yields_changed(const QString&)</slot> + </connection> + <connection> + <sender>ingredients_table</sender> + <signal>valueChanged(int,int)</signal> + <receiver>Neelix</receiver> + <slot>ingredient_changed(int,int)</slot> + </connection> </connections> +<tabstops> + <tabstop>shelf</tabstop> + <tabstop>recipe_entry</tabstop> + <tabstop>author_entry</tabstop> + <tabstop>tottime_entry</tabstop> + <tabstop>yields_entry</tabstop> + <tabstop>ingredients_table</tabstop> + <tabstop>editTab</tabstop> + <tabstop>directions_edit</tabstop> + <tabstop>note_edit</tabstop> +</tabstops> <slots> - <slot>fileNew()</slot> + <slot>recipename_changed(const QString&)</slot> <slot>fileOpen()</slot> <slot>fileSaveAs()</slot> <slot>shelf_item_renamed(QListViewItem * item, int col, const QString & text)</slot> <slot>helpAbout()</slot> <slot>shelf_currentChanged()</slot> + <slot>tottime_changed(const QString&)</slot> + <slot>ingredient_changed(int,int)</slot> + <slot>yields_changed(const QString&)</slot> + <slot>directions_changed()</slot> + <slot>note_changed(const QString&)</slot> + <slot>author_changed(const QString &)</slot> + <slot>note_changed()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> </UI> Index: qt.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/qt.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- qt.rb 23 Jun 2004 13:31:26 -0000 1.1 +++ qt.rb 24 Jun 2004 04:09:45 -0000 1.2 @@ -91,7 +91,47 @@ @directions_edit.text = r.directions @note_edit.text = r.note + end + + def ingredient_changed(row,col) + recipe = @shelf.currentItem.data + case col + when 0 # quantity + recipe.ingredients[row].quantity = @ingredients_table.text(row,col) + when 1 # measure + #recipe.ingredients[row].measure = @ingredients_table.text(row,col) + puts "implement me: ingredient_changed(#{row},#{col}) (measure)" + when 2 # food + #recipe.ingredients[row].food = @ingredients_table.text(row,col) + puts "implement me: ingredient_changed(#{row},#{col}) (food)" + when 3 # modifier + recipe.ingredients[row].modifier = @ingredients_table.text(row,col) + 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 |
From: Hans F. <fu...@us...> - 2004-06-24 04:09:54
|
Update of /cvsroot/neelix/neelix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13290 Modified Files: TODO Log Message: Editing of everything works, with the exception of measure and food. See TODO for why. Index: TODO =================================================================== RCS file: /cvsroot/neelix/neelix/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TODO 19 Dec 2003 16:56:39 -0000 1.2 +++ TODO 24 Jun 2004 04:09:45 -0000 1.3 @@ -1,6 +1,8 @@ -0.1.0 - target: Christmas 2003 -Ingredient dialog -Ingredient management (ordering, addition, deletion) +0.1.0 - target: July 4, 2004 +Finish Ingredient dialog. + - measure/food in @ingredient_table need to look for an existing match and + if not found create a new one. This ought to be a presenter function. + - reordering,addition,deletion of ingredients Recipe management (within categories) (add/del/sort/move) Category management (add/del/sort/move) Cookbook mgmt (add/del/sort) |
From: Hans F. <fu...@us...> - 2004-06-23 13:31:35
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31674 Added Files: qt.rb Log Message: Dear me, this is a rather important file to have in CVS isn't it? --- NEW FILE: qt.rb --- require 'view/qt/mw.rb' require 'view/qt/aboutdialog.rb' 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) i.data = cookbook i.open = true i.setRenameEnabled(0,true) cookbook.categories.each do |category| j = Qt::ListViewItem.new(i,category.name) j.data = category j.open = true j.setRenameEnabled(0,true) category.recipes.each do |recipe| k = Qt::ListViewItem.new(j,recipe.name) k.data = recipe k.setRenameEnabled(0,true) end 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 when Category when Recipe 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 @tottime_entry.text = r.tottime @yields_entry.text = r.yields @ingredients_table.numRows = r.ingredients.size r.ingredients.each_with_index do |ing,j| @ingredients_table.setText(j,0,ing.quantity.to_s) @ingredients_table.setText(j,1,ing.measure.to_s) @ingredients_table.setText(j,2,ing.food.to_s) @ingredients_table.setText(j,3,ing.modifier.to_s) end adjust_columns @directions_edit.text = r.directions @note_edit.text = r.note end end a = Qt::Application.new(ARGV) w = Neelix.new w.postinitialize w.resize(800,600) # run a.mainWidget = w w.show a.exec |
From: Hans F. <fu...@us...> - 2004-06-23 13:30:42
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30945/view/qt Modified Files: mw.ui Log Message: in-place renaming of cookbooks, categories, and recipes via the shelf works, including updating the recipe name on the counter too. Removed the cookbook and category switcher pages, since all you did there was edit the name of cookbooks and categories which you can do in-place in the shelf. So now, the pretty recipe form is always visible (but disabled if a recipe is not selected). Index: mw.ui =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/mw.ui,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mw.ui 21 Jun 2004 05:19:47 -0000 1.1 +++ mw.ui 23 Jun 2004 13:30:33 -0000 1.2 @@ -9,7 +9,7 @@ <x>0</x> <y>0</y> <width>747</width> - <height>516</height> + <height>519</height> </rect> </property> <property name="caption"> @@ -82,104 +82,10 @@ </property> <widget class="QWidget"> <property name="name"> - <cstring>splash_page</cstring> - </property> - <attribute name="id"> - <number>0</number> - </attribute> - </widget> - <widget class="QWidget"> - <property name="name"> - <cstring>cookbook_page</cstring> - </property> - <attribute name="id"> - <number>1</number> - </attribute> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QLabel"> - <property name="name"> - <cstring>textLabel1</cstring> - </property> - <property name="text"> - <string>Cookbook Name</string> - </property> - </widget> - <widget class="QLineEdit"> - <property name="name"> - <cstring>cookbook_entry</cstring> - </property> - </widget> - <spacer> - <property name="name"> - <cstring>spacer1</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </vbox> - </widget> - <widget class="QWidget"> - <property name="name"> - <cstring>category_page</cstring> - </property> - <attribute name="id"> - <number>2</number> - </attribute> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QLabel"> - <property name="name"> - <cstring>textLabel2</cstring> - </property> - <property name="text"> - <string>Category Name</string> - </property> - </widget> - <widget class="QLineEdit"> - <property name="name"> - <cstring>category_entry</cstring> - </property> - </widget> - <spacer> - <property name="name"> - <cstring>spacer2</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </vbox> - </widget> - <widget class="QWidget"> - <property name="name"> <cstring>recipe_page</cstring> </property> <attribute name="id"> - <number>3</number> + <number>0</number> </attribute> <vbox> <property name="name"> @@ -351,7 +257,10 @@ </widget> <widget class="QTabWidget"> <property name="name"> - <cstring>tabWidget3</cstring> + <cstring>editTab</cstring> + </property> + <property name="enabled"> + <bool>true</bool> </property> <property name="sizePolicy"> <sizepolicy> @@ -379,6 +288,9 @@ <property name="name"> <cstring>directions_edit</cstring> </property> + <property name="enabled"> + <bool>true</bool> + </property> </widget> </hbox> </widget> @@ -550,12 +462,18 @@ <receiver>Neelix</receiver> <slot>shelf_currentChanged()</slot> </connection> + <connection> + <sender>shelf</sender> + <signal>itemRenamed(QListViewItem*,int,const QString&)</signal> + <receiver>Neelix</receiver> + <slot>shelf_item_renamed(QListViewItem*,int,const QString&)</slot> + </connection> </connections> <slots> <slot>fileNew()</slot> <slot>fileOpen()</slot> <slot>fileSaveAs()</slot> - <slot>cookbook_entry_changed(const QString&)</slot> + <slot>shelf_item_renamed(QListViewItem * item, int col, const QString & text)</slot> <slot>helpAbout()</slot> <slot>shelf_currentChanged()</slot> </slots> |
From: Hans F. <fu...@us...> - 2004-06-21 05:19:58
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31356/view/qt Modified Files: Makefile Added Files: mw.ui Removed Files: neelix.ui Log Message: Just a little renaming --- NEW FILE: mw.ui --- <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>Neelix</class> <widget class="QMainWindow"> <property name="name"> <cstring>Neelix</cstring> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>747</width> <height>516</height> </rect> </property> <property name="caption"> <string>Neelix</string> <comment>Recipe Management System</comment> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QSplitter"> <property name="name"> <cstring>splitter3</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <widget class="QListView"> <column> <property name="text"> <string>Shelf</string> </property> <property name="clickable"> <bool>false</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <property name="name"> <cstring>shelf</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="rootIsDecorated"> <bool>true</bool> </property> </widget> <widget class="QGroupBox"> <property name="name"> <cstring>counterBox</cstring> </property> <property name="title"> <string>Counter</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QWidgetStack"> <property name="name"> <cstring>counterStack</cstring> </property> <property name="enabled"> <bool>true</bool> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <widget class="QWidget"> <property name="name"> <cstring>splash_page</cstring> </property> <attribute name="id"> <number>0</number> </attribute> </widget> <widget class="QWidget"> <property name="name"> <cstring>cookbook_page</cstring> </property> <attribute name="id"> <number>1</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> <property name="text"> <string>Cookbook Name</string> </property> </widget> <widget class="QLineEdit"> <property name="name"> <cstring>cookbook_entry</cstring> </property> </widget> <spacer> <property name="name"> <cstring>spacer1</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </vbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>category_page</cstring> </property> <attribute name="id"> <number>2</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> <property name="text"> <string>Category Name</string> </property> </widget> <widget class="QLineEdit"> <property name="name"> <cstring>category_entry</cstring> </property> </widget> <spacer> <property name="name"> <cstring>spacer2</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </vbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>recipe_page</cstring> </property> <attribute name="id"> <number>3</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLayoutWidget"> <property name="name"> <cstring>layout2</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLineEdit" row="0" column="1"> <property name="name"> <cstring>recipe_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLineEdit" row="1" column="1"> <property name="name"> <cstring>author_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLabel" row="0" column="2"> <property name="name"> <cstring>textLabel5</cstring> </property> <property name="text"> <string>Preparation Time</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLabel" row="1" column="2"> <property name="name"> <cstring>textLabel6</cstring> </property> <property name="text"> <string>Yield</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLabel" row="1" column="0"> <property name="name"> <cstring>textLabel4</cstring> </property> <property name="text"> <string>Recipe Author</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLineEdit" row="1" column="3"> <property name="name"> <cstring>yields_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLineEdit" row="0" column="3"> <property name="name"> <cstring>tottime_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> <property name="text"> <string>Recipe Name</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </grid> </widget> <widget class="QSplitter"> <property name="name"> <cstring>recipe_splitter</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <widget class="QTable"> <column> <property name="text"> <string>Quantity</string> </property> </column> <column> <property name="text"> <string>Measure</string> </property> </column> <column> <property name="text"> <string>Ingredient</string> </property> </column> <column> <property name="text"> <string>Modifier</string> </property> </column> <property name="name"> <cstring>ingredients_table</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>5</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="vScrollBarMode"> <enum>AlwaysOn</enum> </property> <property name="hScrollBarMode"> <enum>AlwaysOn</enum> </property> <property name="numRows"> <number>0</number> </property> <property name="numCols"> <number>4</number> </property> <property name="rowMovingEnabled"> <bool>true</bool> </property> <property name="selectionMode"> <enum>SingleRow</enum> </property> </widget> <widget class="QTabWidget"> <property name="name"> <cstring>tabWidget3</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>3</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="tabPosition"> <enum>Bottom</enum> </property> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Directions</string> </attribute> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QTextEdit"> <property name="name"> <cstring>directions_edit</cstring> </property> </widget> </hbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Notes</string> </attribute> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QTextEdit"> <property name="name"> <cstring>note_edit</cstring> </property> </widget> </hbox> </widget> </widget> </widget> </vbox> </widget> </widget> </vbox> </widget> </widget> </vbox> </widget> <menubar> <property name="name"> <cstring>MenuBar</cstring> </property> <item text="&File" name="fileMenu"> <action name="fileNewAction"/> <action name="fileOpenAction"/> <action name="fileSaveAsAction"/> <separator/> <action name="fileExitAction"/> </item> <item text="&Help" name="helpMenu"> <action name="helpAboutAction"/> </item> </menubar> <toolbars> </toolbars> <actions> <action> <property name="name"> <cstring>fileNewAction</cstring> </property> <property name="iconSet"> <iconset>image0</iconset> </property> <property name="text"> <string>New</string> </property> <property name="menuText"> <string>&New</string> </property> <property name="accel"> <string>Ctrl+N</string> </property> </action> <action> <property name="name"> <cstring>fileOpenAction</cstring> </property> <property name="iconSet"> <iconset>image1</iconset> </property> <property name="text"> <string>Open</string> </property> <property name="menuText"> <string>&Open...</string> </property> <property name="accel"> <string>Ctrl+O</string> </property> </action> <action> <property name="name"> <cstring>fileSaveAsAction</cstring> </property> <property name="text"> <string>Save As</string> </property> <property name="menuText"> <string>Save &As...</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>fileExitAction</cstring> </property> <property name="text"> <string>Exit</string> </property> <property name="menuText"> <string>E&xit</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>helpAboutAction</cstring> </property> <property name="text"> <string>&About</string> </property> <property name="menuText"> <string>&About</string> </property> <property name="accel"> <string></string> </property> </action> </actions> <images> <image name="image0"> <data format="XPM.GZ" length="721">789cedd2b10ac2301405d03d5ff148b62056035241fc04c5511087f425a2432b681d44fc777ba329d6b47fe07d19dee50cc9904cd376b3229d896b6deb13131fed85b4bb95e57db75f3e8434869a93d3548e841c13d3fa5c79ecaad9d52404b540351e83caa833c6a03ad4798e41f5a86c30a816f510126ee94d14d52611fb8e2ad49070a4445ca4447ca4446ca444da07fecac7ffd2956ebe64f81ff4c873215e0583a9b0</data> </image> <image name="image1"> <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data> </image> </images> <connections> <connection> <sender>fileNewAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileNew()</slot> </connection> <connection> <sender>fileOpenAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileOpen()</slot> </connection> <connection> <sender>fileSaveAsAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileSaveAs()</slot> </connection> <connection> <sender>fileExitAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>close()</slot> </connection> <connection> <sender>helpAboutAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>helpAbout()</slot> </connection> <connection> <sender>shelf</sender> <signal>currentChanged(QListViewItem*)</signal> <receiver>Neelix</receiver> <slot>shelf_currentChanged()</slot> </connection> </connections> <slots> <slot>fileNew()</slot> <slot>fileOpen()</slot> <slot>fileSaveAs()</slot> <slot>cookbook_entry_changed(const QString&)</slot> <slot>helpAbout()</slot> <slot>shelf_currentChanged()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> </UI> Index: Makefile =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 20 Jun 2004 15:13:05 -0000 1.2 +++ Makefile 21 Jun 2004 05:19:47 -0000 1.3 @@ -1,6 +1,10 @@ -all: ui.rb aboutdialog.rb +uic_generated=mw.rb aboutdialog.rb +all: $(uic_generated) %.rb: %.ui rbuic -p 2 -x $< > $@ -.PHONY: all +clean: + rm -f $(uic_generated) + +.PHONY: all clean --- neelix.ui DELETED --- |
From: Hans F. <fu...@us...> - 2004-06-20 15:15:15
|
Update of /cvsroot/neelix/neelix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29819 Modified Files: Makefile neelix.rb Log Message: neelix.rb now runs the qt view. Type make to build the qt files from the .ui files. You no longer need specify a database when running neelix.rb. Currently it loads db/hans.db if you don't, but eventually it will open a new database dialog (or do something else view-specific if there's no database connection). Index: neelix.rb =================================================================== RCS file: /cvsroot/neelix/neelix/neelix.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- neelix.rb 19 Dec 2003 16:56:39 -0000 1.5 +++ neelix.rb 20 Jun 2004 15:15:07 -0000 1.6 @@ -1,20 +1,23 @@ #!/usr/bin/ruby def usage - puts "usage: neelix <database>" + puts "usage: neelix [<database>]" exit end -usage unless ARGV[0] +#usage unless ARGV[0] require 'dbi' require 'model/model.rb' -dbh = DBI.connect("dbi:sqlite:#{ARGV[0]}") +dbfile = ARGV[0] ? ARGV[0] : "db/hans.db" + +dbh = DBI.connect("dbi:sqlite:#{dbfile}") $replicator.attach(dbh) # This is where you might put a check for another type of UI - e.g. ncurses -require 'view/fox' +#require 'view/fox' +require 'view/qt/qt.rb' dbh.commit -# vim:ts=4:sw=4 +# vim:ts=2:sw=4 Index: Makefile =================================================================== RCS file: /cvsroot/neelix/neelix/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 5 May 2004 13:35:36 -0000 1.5 +++ Makefile 20 Jun 2004 15:15:07 -0000 1.6 @@ -1,8 +1,9 @@ +all: qt db/hans.db -all: - -%: - make -C db $@ +qt: + make -C view/qt +#%: +# make -C db $@ # this assumes the current debian package name (rdoc plain seems to conflict # with ri plain and I can't live without ri) @@ -13,4 +14,4 @@ $(rdoc) -d -o doc model/*.rb view/*.rb presenter/*.rb *.rb if [ $(USER) = fugalh ]; then rsync -r doc shell.sf.net:neelix/htdocs/rdoc; fi -.PHONY: doc all +.PHONY: doc all qt |
From: Hans F. <fu...@us...> - 2004-06-20 15:13:15
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29010 Modified Files: Makefile neelix.ui Added Files: aboutdialog.ui Log Message: Made a lot of progress on populating the widgets. Everything's display-only at this point, nothing changes the database. But it's all there. Index: Makefile =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 19 Jun 2004 03:28:01 -0000 1.1 +++ Makefile 20 Jun 2004 15:13:05 -0000 1.2 @@ -1,2 +1,6 @@ -ui.rb: neelix.ui +all: ui.rb aboutdialog.rb + +%.rb: %.ui rbuic -p 2 -x $< > $@ + +.PHONY: all Index: neelix.ui =================================================================== RCS file: /cvsroot/neelix/neelix/view/qt/neelix.ui,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- neelix.ui 19 Jun 2004 03:28:01 -0000 1.1 +++ neelix.ui 20 Jun 2004 15:13:05 -0000 1.2 @@ -8,8 +8,8 @@ <rect> <x>0</x> <y>0</y> - <width>805</width> - <height>855</height> + <width>747</width> + <height>510</height> </rect> </property> <property name="caption"> @@ -27,59 +27,32 @@ <property name="orientation"> <enum>Horizontal</enum> </property> - <widget class="QGroupBox"> + <widget class="QListView"> + <column> + <property name="text"> + <string>Shelf</string> + </property> + <property name="clickable"> + <bool>false</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> <property name="name"> - <cstring>shelfBox</cstring> + <cstring>shelf</cstring> </property> - <property name="margin"> - <number>2</number> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="title"> - <string>Shelf</string> + <property name="rootIsDecorated"> + <bool>true</bool> </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QListView"> - <column> - <property name="text"> - <string>Column 1</string> - </property> - <property name="clickable"> - <bool>true</bool> - </property> - <property name="resizable"> - <bool>true</bool> - </property> - </column> - <item> - <property name="text"> - <string>New Item</string> - </property> - <property name="pixmap"> - <pixmap></pixmap> - </property> - </item> - <property name="name"> - <cstring>shelf</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>7</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="rootIsDecorated"> - <bool>true</bool> - </property> - <property name="resizeMode"> - <enum>LastColumn</enum> - </property> - </widget> - </vbox> </widget> <widget class="QGroupBox"> <property name="name"> @@ -94,7 +67,10 @@ </property> <widget class="QWidgetStack"> <property name="name"> - <cstring>widgetStack1</cstring> + <cstring>counterStack</cstring> + </property> + <property name="enabled"> + <bool>true</bool> </property> <property name="sizePolicy"> <sizepolicy> @@ -106,11 +82,105 @@ </property> <widget class="QWidget"> <property name="name"> - <cstring>recipe_page</cstring> + <cstring>splash_page</cstring> </property> <attribute name="id"> <number>0</number> </attribute> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>cookbook_page</cstring> + </property> + <attribute name="id"> + <number>1</number> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Cookbook Name</string> + </property> + </widget> + <widget class="QLineEdit"> + <property name="name"> + <cstring>cookbook_entry</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>category_page</cstring> + </property> + <attribute name="id"> + <number>2</number> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Category Name</string> + </property> + </widget> + <widget class="QLineEdit"> + <property name="name"> + <cstring>category_entry</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>recipe_page</cstring> + </property> + <attribute name="id"> + <number>3</number> + </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> @@ -184,7 +254,7 @@ </widget> <widget class="QLineEdit" row="1" column="3"> <property name="name"> - <cstring>yield_entry</cstring> + <cstring>yields_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> @@ -197,7 +267,7 @@ </widget> <widget class="QLineEdit" row="0" column="3"> <property name="name"> - <cstring>preptime_entry</cstring> + <cstring>tottime_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> @@ -233,25 +303,45 @@ <property name="text"> <string>Quantity</string> </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> </column> <column> <property name="text"> <string>Measure</string> </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> </column> <column> <property name="text"> <string>Ingredient</string> </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> </column> <column> <property name="text"> <string>Modifier</string> </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> </column> <property name="name"> <cstring>ingredients_table</cstring> </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="vScrollBarMode"> <enum>AlwaysOn</enum> </property> @@ -259,7 +349,7 @@ <enum>AlwaysOn</enum> </property> <property name="numRows"> - <number>8</number> + <number>0</number> </property> <property name="numCols"> <number>4</number> @@ -317,7 +407,7 @@ </property> <widget class="QTextEdit"> <property name="name"> - <cstring>notes_edit</cstring> + <cstring>note_edit</cstring> </property> </widget> </hbox> @@ -326,92 +416,6 @@ </widget> </vbox> </widget> - <widget class="QWidget"> - <property name="name"> - <cstring>cookbook_page</cstring> - </property> - <attribute name="id"> - <number>1</number> - </attribute> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QLabel"> - <property name="name"> - <cstring>textLabel1</cstring> - </property> - <property name="text"> - <string>Cookbook Name</string> - </property> - </widget> - <widget class="QLineEdit"> - <property name="name"> - <cstring>cookbook_entry</cstring> - </property> - </widget> - <spacer> - <property name="name"> - <cstring>spacer1</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </vbox> - </widget> - <widget class="QWidget"> - <property name="name"> - <cstring>category_page</cstring> - </property> - <attribute name="id"> - <number>2</number> - </attribute> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QLabel"> - <property name="name"> - <cstring>textLabel2</cstring> - </property> - <property name="text"> - <string>Category Name</string> - </property> - </widget> - <widget class="QLineEdit"> - <property name="name"> - <cstring>category_entry</cstring> - </property> - </widget> - <spacer> - <property name="name"> - <cstring>spacer2</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </vbox> - </widget> </widget> </vbox> </widget> @@ -425,27 +429,11 @@ <item text="&File" name="fileMenu"> <action name="fileNewAction"/> <action name="fileOpenAction"/> - <action name="fileSaveAction"/> <action name="fileSaveAsAction"/> <separator/> - <action name="filePrintAction"/> - <separator/> <action name="fileExitAction"/> </item> - <item text="&Edit" name="editMenu"> - <action name="editUndoAction"/> - <action name="editRedoAction"/> - <separator/> - <action name="editCutAction"/> - <action name="editCopyAction"/> - <action name="editPasteAction"/> - <separator/> - <action name="editFindAction"/> - </item> <item text="&Help" name="helpMenu"> - <action name="helpContentsAction"/> - <action name="helpIndexAction"/> - <separator/> <action name="helpAboutAction"/> </item> </menubar> @@ -488,23 +476,6 @@ </action> <action> <property name="name"> - <cstring>fileSaveAction</cstring> - </property> - <property name="iconSet"> - <iconset>image2</iconset> - </property> - <property name="text"> - <string>Save</string> - </property> - <property name="menuText"> - <string>&Save</string> - </property> - <property name="accel"> - <string>Ctrl+S</string> - </property> - </action> - <action> - <property name="name"> <cstring>fileSaveAsAction</cstring> </property> <property name="text"> @@ -519,23 +490,6 @@ </action> <action> <property name="name"> - <cstring>filePrintAction</cstring> - </property> - <property name="iconSet"> - <iconset>image3</iconset> - </property> - <property name="text"> - <string>Print</string> - </property> - <property name="menuText"> - <string>&Print...</string> - </property> - <property name="accel"> - <string>Ctrl+P</string> - </property> - </action> - <action> - <property name="name"> <cstring>fileExitAction</cstring> </property> <property name="text"> @@ -550,140 +504,10 @@ </action> <action> <property name="name"> - <cstring>editUndoAction</cstring> - </property> - <property name="iconSet"> - <iconset>image4</iconset> - </property> - <property name="text"> - <string>Undo</string> - </property> - <property name="menuText"> - <string>&Undo</string> - </property> - <property name="accel"> - <string>Ctrl+Z</string> - </property> - </action> - <action> - <property name="name"> - <cstring>editRedoAction</cstring> - </property> - <property name="iconSet"> - <iconset>image5</iconset> - </property> - <property name="text"> - <string>Redo</string> - </property> - <property name="menuText"> - <string>&Redo</string> - </property> - <property name="accel"> - <string>Ctrl+Y</string> - </property> - </action> - <action> - <property name="name"> - <cstring>editCutAction</cstring> - </property> - <property name="iconSet"> - <iconset>image6</iconset> - </property> - <property name="text"> - <string>Cut</string> - </property> - <property name="menuText"> - <string>&Cut</string> - </property> - <property name="accel"> - <string>Ctrl+X</string> - </property> - </action> - <action> - <property name="name"> - <cstring>editCopyAction</cstring> - </property> - <property name="iconSet"> - <iconset>image7</iconset> - </property> - <property name="text"> - <string>Copy</string> - </property> - <property name="menuText"> - <string>C&opy</string> - </property> - <property name="accel"> - <string>Ctrl+C</string> - </property> - </action> - <action> - <property name="name"> - <cstring>editPasteAction</cstring> - </property> - <property name="iconSet"> - <iconset>image8</iconset> - </property> - <property name="text"> - <string>Paste</string> - </property> - <property name="menuText"> - <string>&Paste</string> - </property> - <property name="accel"> - <string>Ctrl+V</string> - </property> - </action> - <action> - <property name="name"> - <cstring>editFindAction</cstring> - </property> - <property name="iconSet"> - <iconset>image9</iconset> - </property> - <property name="text"> - <string>Find</string> - </property> - <property name="menuText"> - <string>&Find...</string> - </property> - <property name="accel"> - <string>Ctrl+F</string> - </property> - </action> - <action> - <property name="name"> - <cstring>helpContentsAction</cstring> - </property> - <property name="text"> - <string>Contents</string> - </property> - <property name="menuText"> - <string>&Contents...</string> - </property> - <property name="accel"> - <string></string> - </property> - </action> - <action> - <property name="name"> - <cstring>helpIndexAction</cstring> - </property> - <property name="text"> - <string>Index</string> - </property> - <property name="menuText"> - <string>&Index...</string> - </property> - <property name="accel"> - <string></string> - </property> - </action> - <action> - <property name="name"> <cstring>helpAboutAction</cstring> </property> <property name="text"> - <string>About</string> + <string>&About</string> </property> <property name="menuText"> <string>&About</string> @@ -700,30 +524,6 @@ <image name="image1"> <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data> </image> - <image name="image2"> - <data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b13082709340dc644310047193c1dcc424d314883958015846190b80ca24262a2721012087349964a030ba69c9c9303d403e9132087b68279388ecff4414193440948c32aa71d86470bb80863258a21b9a0eb0a7905a6b2e006d59a436</data> - </image> - <image name="image3"> - <data format="XPM.GZ" length="2509">789c7d944973db461085effa152cf54d956a932089a55239c896572d96bcc4b253390033186ea2488aa416a7f2dfd3db0cbd44e6d340f8f8def43406209e1c742ecf4f3b074ff6d69b7a33711d37ae6f3a077e3b9f3ffcf5f71fffeced675987fecab293edffb6b77fb1e9b8ced9e2ba65c08c00baf2117e2f5c86d02d99e196b9d7ed963df53f2ab3c47789258fa7c26564688d4bf30f23673de113e6ac1719ae9459e27f4d5c893f17ae126f8d2be3ebc87d9dff4e3904f317ccfd5ef23f28b3c45f26963c7e510ec1fc9570157dd81857967f883c90cd8635f3208b8c0b6596f863e17a500fd597fe8744c35afc1be33aef8bff5ad9b5e637cc7993f7f346fca571637c1fb9d0f99f9543b07ab2df453ff9723d0551a1f3d791cb8170573904f3a5bf725034e66f133be96fa44c1246799e4a573495e461a29cfcbbc8e64f8d9df96564f5519e876a1019668975fda05c593d5c25d67a6f945d6ef3bdb08b3ed491eba1e467c6561fcf229bff4ad9b5c6c7ccf530fa8089bdf8136596703fb1f800c23ee5ff548e3e7a636f3c8ddc68bd8ab91926066596b05c5fe359c285b2cf8de5f7ed7296f050b825d6f74763dc1a0f227bcdbf60f679e29789353f5666093f4facfe857208e63f156e93df8bdc16c223e358ff28b2f939735b240eca2ce1678983f0a57208e6bf150ec96f8d83f127e650b084cf85e5a32fdf9d10b0c6c6e44835c9631dfd9ff235b618925ad1e89779278af5750df7681ea40316d8111eef876a79ad977ae773d8257ec8efead629fdeb3ca4ba9ae6e11fcdbbef6aa72b7934ef695702eddf4e631a13d2f4c73cd599e115f533a639bbc173e6788d0b5cf23a314fe915dee01a37df698bb77887f7f8805ff190e64c342fb59fe2333ca2e373d30b7c89aff035bec1634a9e904ef1417faf78866ff1fc275de03b7c4fa3a1553e50fd8f78a2ef0bfcf43fe973bcc4cff805bb74d6a3de0e31b37c9f561fe090c6583a19612e9d1dd179417db1575237191eeafb172b9cd22a7d409a7bcc8f0c4e68f01900ef44090db8547f4ee9a966456732445083078f779a8756dfdf52f19b1cd59c699254e31c46d0703f30b6fa5239a5d27faabc22b78409de838316bdd51fd1377730a531a12bd363c949aa3d936f1a6821e8fda566aef8fe011d612eba860569495a9196721ebe7d7ed0c30dac491b58d2bd21c116b634bf25ddd2fd9dd9f3f6efef7bff0111915e41</data> - </image> - <image name="image4"> - <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b13103711c4b530b1308270f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020011bc73cc</data> - </image> - <image name="image5"> - <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b13105719c4b530b1308270f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700f7fd8672</data> - </image> - <image name="image6"> - <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53002abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fbd07ccb</data> - </image> - <image name="image7"> - <data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da8214c44f505c0ae26226b1e8a20a5a1722febb9924a5af58c19b40e77238a1842431ecb66b881371afb03a2b5027bc41ac1f65f9dc1f562f11a52998bd80793411d114146cae9723cfd2cc7266c395ea9aa75c15d74c65aad05c35d79c727215b91636f6d860c689f40910b4e92147d840b3be39d8416d877c860eb9af478d23919c4b8a7a0ed68eb628e4a04521c7fd46c07138e47448dbf1f32fc767e8d43735741af287d3ced83b782fc5075b18a5a5</data> - </image> - <image name="image8"> - <data format="XPM.GZ" length="736">789c7d92d10a82301486eff714c3dd49649984103d42d165105dcce3465d58507611d1bbb773d674aed93f85fd7efb183ab394ef771b9e66ecdecaf60c1c4ef2c6d3fad134cfc371fd62499e7373957c9e4c5832e5c0b7d78bc2b9307331a36055ae960556c05a16656e69e5aaa5355658c202965825566d62176b57b5a64da3f188c084841e0a29a5e831910ef8885e4854501922e8a6b923586a176a8e40051ec1e63b7d0267387c6738424775091d653f98565a858e26c110447107d1886350d4a1c41c3dea7864e87c37f3ce47fc3aee7cd5207ffe90f78a7d0007c6c175</data> - </image> - <image name="image9"> - <data format="XPM.GZ" length="2798">789cb5d5594f1b491007f0773e8545bda1d53ff81a7bb4da07830103b603b92059edc34cf78c0ff0812f3051befb5677554f56c24428d2aa78e0a7aeaeea6be0dd41e9f6aa573a78b7b75c25ab91299961b2281dd8f564b2fdfb9fbfbeefed572a25fe291f46a5cafe1f7bfbd7ab9229f567d3cc81fa0caa945d785f78c72ebc2f9dabb10bef9e73ade2c21913e77ae2c28f2fc48d6a947ab7c4b169d6bc8f9ca3aa0b3fbfaf4e35ff4c5cccdf8813db34de1def34e4c3881b3cc38fb7d5a918f78525ff46dcaca9576a23a627715cd3f53e8a131b7b63edecba69fd8d3af41b1496fa6d7153f78f86b8a86f0bcbfe9ec5493d16cfc5695dfad34c6d651ca9f7cffdbd173743fd441cd64f0f85a5fe489c6a3fd4d5613c0d4eeade43b189747c1b2ce3683abbeebadf5a702ae343716c743d53313f1febc7bfa843bf1371581f9d06ebf8581df257e2b01eba57675a5fea19177e7c109cfa712271aceba58938b13a6ec4a13fba62ee27f53fa9b51fe5c1ba7f7f1f71cd85f7545cdcf73ad8f8ef137762de9fd4ef898b7e51b0d63f52877e65b10de3c785657eacced4fe7b77b763236fab36fa3e1ec5a9d5f341b0e4d3526c42bd4ab0eee7505cf4fb28ce1aea6fc146fa7f76e6d3e115fafa5d7112cebf254eeb328e6a70967b9f8b437fba13db4ceb2fc5453f7f5ffcfac2795f046bbd0fe2a2df486c42bd2bb18dd46375e89f89b99fccf7ef2dadbbf0eea8add6bf16db4cbd1067b9de8fafc7b7a1ef13cf6213e50defadd846b9acff569c3574fe833ad7fa5fc57943cfdb9f9f894cd8cf93982748fdb9386f64dee4df97c978ff52ef4c9d69ff9938cff53cfdf7ec5627f5ae576f8fdfcf0721410ac391c222fb753e720c30c408638e3bdcf31c7a3d9fb3279862c631c70316586285f5ae1e727fd8e091f3e678c216cf68e108c768e3e4957ccb2b39e5fc337470ce71814b74d143ffe59ae4ff01ae7825d7f8c0753fe213d7ff8c2ffcfb0deccefc016ef115df380e51460555d4504784069aafe48f798f87885126a04a4409a564c8be92bfc115655cb94c395a34409d8634a231afe7c58ee5ef35d7bae3dc2eddd384a634a339c7032d90efcce7bba225ad38525aa3461b7ae478da75037a5f2758d196525ec93359aedde23882a563ae95edc8cf90529b4ee894c6bcf2844f66e2ce1239cf9afc7755c5fbc9b8479fdabcc71b3aa38ee4d039d7b9a04b1ecb5ebe677ea1964712ead2f9cf8aac1ecfd10a6f79ffdc7b4d7dee92bcfd7be1bd5ff29ccedbbf2f90dbfbfffefdfef873ef5fce01d04a</data> - </image> </images> <connections> <connection> @@ -739,100 +539,37 @@ <slot>fileOpen()</slot> </connection> <connection> - <sender>fileSaveAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>fileSave()</slot> - </connection> - <connection> <sender>fileSaveAsAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileSaveAs()</slot> </connection> <connection> - <sender>filePrintAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>filePrint()</slot> - </connection> - <connection> <sender>fileExitAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileExit()</slot> </connection> <connection> - <sender>editUndoAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editUndo()</slot> - </connection> - <connection> - <sender>editRedoAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editRedo()</slot> - </connection> - <connection> - <sender>editCutAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editCut()</slot> - </connection> - <connection> - <sender>editCopyAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editCopy()</slot> - </connection> - <connection> - <sender>editPasteAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editPaste()</slot> - </connection> - <connection> - <sender>editFindAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>editFind()</slot> - </connection> - <connection> - <sender>helpIndexAction</sender> - <signal>activated()</signal> - <receiver>Neelix</receiver> - <slot>helpIndex()</slot> - </connection> - <connection> - <sender>helpContentsAction</sender> + <sender>helpAboutAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> - <slot>helpContents()</slot> + <slot>helpAbout()</slot> </connection> <connection> - <sender>helpAboutAction</sender> - <signal>activated()</signal> + <sender>shelf</sender> + <signal>currentChanged(QListViewItem*)</signal> <receiver>Neelix</receiver> - <slot>helpAbout()</slot> + <slot>shelf_currentChanged()</slot> </connection> </connections> <slots> <slot>fileNew()</slot> <slot>fileOpen()</slot> - <slot>fileSave()</slot> <slot>fileSaveAs()</slot> - <slot>filePrint()</slot> <slot>fileExit()</slot> - <slot>editUndo()</slot> - <slot>editRedo()</slot> - <slot>editCut()</slot> - <slot>editCopy()</slot> - <slot>editPaste()</slot> - <slot>editFind()</slot> - <slot>helpIndex()</slot> - <slot>helpContents()</slot> <slot>helpAbout()</slot> + <slot>shelf_currentChanged()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> </UI> --- NEW FILE: aboutdialog.ui --- <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>AboutDialog</class> <widget class="QDialog"> <property name="name"> <cstring>AboutDialog</cstring> </property> <property name="enabled"> <bool>true</bool> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>256</width> <height>245</height> </rect> </property> <property name="caption"> <string>About Neelix</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> <property name="text"> <string><center><h1>Neelix </h1> <h2>Recipe Management System</h2> <p><a href="http://neelix.sf.net/">http://neelix.sf.net/</a></p> <p><font size="-1">Dedicated to Erin Fugal</font></p></center></string> </property> <property name="alignment"> <set>AlignVCenter</set> </property> </widget> <widget class="QLayoutWidget"> <property name="name"> <cstring>layout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <spacer> <property name="name"> <cstring>spacer4</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> <widget class="QPushButton"> <property name="name"> <cstring>pushButton4</cstring> </property> <property name="text"> <string>Close</string> </property> </widget> </hbox> </widget> </vbox> </widget> <connections> <connection> <sender>pushButton4</sender> <signal>clicked()</signal> <receiver>AboutDialog</receiver> <slot>close()</slot> </connection> </connections> <layoutdefaults spacing="6" margin="11"/> </UI> |
From: Hans F. <fu...@us...> - 2004-06-19 03:28:12
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27030 Added Files: Makefile neelix.ui Log Message: Blessed day, qt for ruby has arrived. [1] Fox is nice and all. I really do like it, but Qt has more features and a top-notch designer. Add to that that Qt seems to be the only toolkit with a decent table/spreadsheet widget which I so anxiously desired for the ingredients, and I'm quite decided to switch over to Qt. I've already build as much of the gui as we had in fox with qt designer. It only lacks fine-tuning and functionality. :-) If you have trouble compiling qtruby (I did), just edit the Makefile in smoke/qt to set all_libraries and all_includes correctly. (/usr/share/qt3/lib and /usr/include/qt3 respectively, on Debian) 1. http://raa.ruby-lang.org/project/qtruby/ --- NEW FILE: Makefile --- ui.rb: neelix.ui rbuic -p 2 -x $< > $@ --- NEW FILE: neelix.ui --- <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>Neelix</class> <widget class="QMainWindow"> <property name="name"> <cstring>Neelix</cstring> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>805</width> <height>855</height> </rect> </property> <property name="caption"> <string>Neelix</string> <comment>Recipe Management System</comment> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QSplitter"> <property name="name"> <cstring>splitter3</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <widget class="QGroupBox"> <property name="name"> <cstring>shelfBox</cstring> </property> <property name="margin"> <number>2</number> </property> <property name="title"> <string>Shelf</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QListView"> <column> <property name="text"> <string>Column 1</string> </property> <property name="clickable"> <bool>true</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <item> <property name="text"> <string>New Item</string> </property> <property name="pixmap"> <pixmap></pixmap> </property> </item> <property name="name"> <cstring>shelf</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="rootIsDecorated"> <bool>true</bool> </property> <property name="resizeMode"> <enum>LastColumn</enum> </property> </widget> </vbox> </widget> <widget class="QGroupBox"> <property name="name"> <cstring>counterBox</cstring> </property> <property name="title"> <string>Counter</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QWidgetStack"> <property name="name"> <cstring>widgetStack1</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <widget class="QWidget"> <property name="name"> <cstring>recipe_page</cstring> </property> <attribute name="id"> <number>0</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLayoutWidget"> <property name="name"> <cstring>layout2</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLineEdit" row="0" column="1"> <property name="name"> <cstring>recipe_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLineEdit" row="1" column="1"> <property name="name"> <cstring>author_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLabel" row="0" column="2"> <property name="name"> <cstring>textLabel5</cstring> </property> <property name="text"> <string>Preparation Time</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLabel" row="1" column="2"> <property name="name"> <cstring>textLabel6</cstring> </property> <property name="text"> <string>Yield</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLabel" row="1" column="0"> <property name="name"> <cstring>textLabel4</cstring> </property> <property name="text"> <string>Recipe Author</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> <widget class="QLineEdit" row="1" column="3"> <property name="name"> <cstring>yield_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLineEdit" row="0" column="3"> <property name="name"> <cstring>preptime_entry</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> <widget class="QLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> <property name="text"> <string>Recipe Name</string> </property> <property name="alignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </grid> </widget> <widget class="QSplitter"> <property name="name"> <cstring>recipe_splitter</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <widget class="QTable"> <column> <property name="text"> <string>Quantity</string> </property> </column> <column> <property name="text"> <string>Measure</string> </property> </column> <column> <property name="text"> <string>Ingredient</string> </property> </column> <column> <property name="text"> <string>Modifier</string> </property> </column> <property name="name"> <cstring>ingredients_table</cstring> </property> <property name="vScrollBarMode"> <enum>AlwaysOn</enum> </property> <property name="hScrollBarMode"> <enum>AlwaysOn</enum> </property> <property name="numRows"> <number>8</number> </property> <property name="numCols"> <number>4</number> </property> <property name="rowMovingEnabled"> <bool>true</bool> </property> <property name="selectionMode"> <enum>SingleRow</enum> </property> </widget> <widget class="QTabWidget"> <property name="name"> <cstring>tabWidget3</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>3</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="tabPosition"> <enum>Bottom</enum> </property> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Directions</string> </attribute> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QTextEdit"> <property name="name"> <cstring>directions_edit</cstring> </property> </widget> </hbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Notes</string> </attribute> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QTextEdit"> <property name="name"> <cstring>notes_edit</cstring> </property> </widget> </hbox> </widget> </widget> </widget> </vbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>cookbook_page</cstring> </property> <attribute name="id"> <number>1</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> <property name="text"> <string>Cookbook Name</string> </property> </widget> <widget class="QLineEdit"> <property name="name"> <cstring>cookbook_entry</cstring> </property> </widget> <spacer> <property name="name"> <cstring>spacer1</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </vbox> </widget> <widget class="QWidget"> <property name="name"> <cstring>category_page</cstring> </property> <attribute name="id"> <number>2</number> </attribute> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> <property name="text"> <string>Category Name</string> </property> </widget> <widget class="QLineEdit"> <property name="name"> <cstring>category_entry</cstring> </property> </widget> <spacer> <property name="name"> <cstring>spacer2</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </vbox> </widget> </widget> </vbox> </widget> </widget> </vbox> </widget> <menubar> <property name="name"> <cstring>MenuBar</cstring> </property> <item text="&File" name="fileMenu"> <action name="fileNewAction"/> <action name="fileOpenAction"/> <action name="fileSaveAction"/> <action name="fileSaveAsAction"/> <separator/> <action name="filePrintAction"/> <separator/> <action name="fileExitAction"/> </item> <item text="&Edit" name="editMenu"> <action name="editUndoAction"/> <action name="editRedoAction"/> <separator/> <action name="editCutAction"/> <action name="editCopyAction"/> <action name="editPasteAction"/> <separator/> <action name="editFindAction"/> </item> <item text="&Help" name="helpMenu"> <action name="helpContentsAction"/> <action name="helpIndexAction"/> <separator/> <action name="helpAboutAction"/> </item> </menubar> <toolbars> </toolbars> <actions> <action> <property name="name"> <cstring>fileNewAction</cstring> </property> <property name="iconSet"> <iconset>image0</iconset> </property> <property name="text"> <string>New</string> </property> <property name="menuText"> <string>&New</string> </property> <property name="accel"> <string>Ctrl+N</string> </property> </action> <action> <property name="name"> <cstring>fileOpenAction</cstring> </property> <property name="iconSet"> <iconset>image1</iconset> </property> <property name="text"> <string>Open</string> </property> <property name="menuText"> <string>&Open...</string> </property> <property name="accel"> <string>Ctrl+O</string> </property> </action> <action> <property name="name"> <cstring>fileSaveAction</cstring> </property> <property name="iconSet"> <iconset>image2</iconset> </property> <property name="text"> <string>Save</string> </property> <property name="menuText"> <string>&Save</string> </property> <property name="accel"> <string>Ctrl+S</string> </property> </action> <action> <property name="name"> <cstring>fileSaveAsAction</cstring> </property> <property name="text"> <string>Save As</string> </property> <property name="menuText"> <string>Save &As...</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>filePrintAction</cstring> </property> <property name="iconSet"> <iconset>image3</iconset> </property> <property name="text"> <string>Print</string> </property> <property name="menuText"> <string>&Print...</string> </property> <property name="accel"> <string>Ctrl+P</string> </property> </action> <action> <property name="name"> <cstring>fileExitAction</cstring> </property> <property name="text"> <string>Exit</string> </property> <property name="menuText"> <string>E&xit</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>editUndoAction</cstring> </property> <property name="iconSet"> <iconset>image4</iconset> </property> <property name="text"> <string>Undo</string> </property> <property name="menuText"> <string>&Undo</string> </property> <property name="accel"> <string>Ctrl+Z</string> </property> </action> <action> <property name="name"> <cstring>editRedoAction</cstring> </property> <property name="iconSet"> <iconset>image5</iconset> </property> <property name="text"> <string>Redo</string> </property> <property name="menuText"> <string>&Redo</string> </property> <property name="accel"> <string>Ctrl+Y</string> </property> </action> <action> <property name="name"> <cstring>editCutAction</cstring> </property> <property name="iconSet"> <iconset>image6</iconset> </property> <property name="text"> <string>Cut</string> </property> <property name="menuText"> <string>&Cut</string> </property> <property name="accel"> <string>Ctrl+X</string> </property> </action> <action> <property name="name"> <cstring>editCopyAction</cstring> </property> <property name="iconSet"> <iconset>image7</iconset> </property> <property name="text"> <string>Copy</string> </property> <property name="menuText"> <string>C&opy</string> </property> <property name="accel"> <string>Ctrl+C</string> </property> </action> <action> <property name="name"> <cstring>editPasteAction</cstring> </property> <property name="iconSet"> <iconset>image8</iconset> </property> <property name="text"> <string>Paste</string> </property> <property name="menuText"> <string>&Paste</string> </property> <property name="accel"> <string>Ctrl+V</string> </property> </action> <action> <property name="name"> <cstring>editFindAction</cstring> </property> <property name="iconSet"> <iconset>image9</iconset> </property> <property name="text"> <string>Find</string> </property> <property name="menuText"> <string>&Find...</string> </property> <property name="accel"> <string>Ctrl+F</string> </property> </action> <action> <property name="name"> <cstring>helpContentsAction</cstring> </property> <property name="text"> <string>Contents</string> </property> <property name="menuText"> <string>&Contents...</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>helpIndexAction</cstring> </property> <property name="text"> <string>Index</string> </property> <property name="menuText"> <string>&Index...</string> </property> <property name="accel"> <string></string> </property> </action> <action> <property name="name"> <cstring>helpAboutAction</cstring> </property> <property name="text"> <string>About</string> </property> <property name="menuText"> <string>&About</string> </property> <property name="accel"> <string></string> </property> </action> </actions> <images> <image name="image0"> <data format="XPM.GZ" length="721">789cedd2b10ac2301405d03d5ff148b62056035241fc04c5511087f425a2432b681d44fc777ba329d6b47fe07d19dee50cc9904cd376b3229d896b6deb13131fed85b4bb95e57db75f3e8434869a93d3548e841c13d3fa5c79ecaad9d52404b540351e83caa833c6a03ad4798e41f5a86c30a816f510126ee94d14d52611fb8e2ad49070a4445ca4447ca4446ca444da07fecac7ffd2956ebe64f81ff4c873215e0583a9b0</data> </image> <image name="image1"> <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data> </image> <image name="image2"> <data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b13082709340dc644310047193c1dcc424d314883958015846190b80ca24262a2721012087349964a030ba69c9c9303d403e9132087b68279388ecff4414193440948c32aa71d86470bb80863258a21b9a0eb0a7905a6b2e006d59a436</data> </image> <image name="image3"> <data format="XPM.GZ" length="2509">789c7d944973db461085effa152cf54d956a932089a55239c896572d96bcc4b253390033186ea2488aa416a7f2dfd3db0cbd44e6d340f8f8def43406209e1c742ecf4f3b074ff6d69b7a33711d37ae6f3a077e3b9f3ffcf5f71fffeced675987fecab293edffb6b77fb1e9b8ced9e2ba65c08c00baf2117e2f5c86d02d99e196b9d7ed963df53f2ab3c47789258fa7c26564688d4bf30f23673de113e6ac1719ae9459e27f4d5c893f17ae126f8d2be3ebc87d9dff4e3904f317ccfd5ef23f28b3c45f26963c7e510ec1fc9570157dd81857967f883c90cd8635f3208b8c0b6596f863e17a500fd597fe8744c35afc1be33aef8bff5ad9b5e637cc7993f7f346fca571637c1fb9d0f99f9543b07ab2df453ff9723d0551a1f3d791cb8170573904f3a5bf725034e66f133be96fa44c1246799e4a573495e461a29cfcbbc8e64f8d9df96564f5519e876a1019668975fda05c593d5c25d67a6f945d6ef3bdb08b3ed491eba1e467c6561fcf229bff4ad9b5c6c7ccf530fa8089bdf8136596703fb1f800c23ee5ff548e3e7a636f3c8ddc68bd8ab91926066596b05c5fe359c285b2cf8de5f7ed7296f050b825d6f74763dc1a0f227bcdbf60f679e29789353f5666093f4facfe857208e63f156e93df8bdc16c223e358ff28b2f939735b240eca2ce1678983f0a57208e6bf150ec96f8d83f127e650b084cf85e5a32fdf9d10b0c6c6e44835c9631dfd9ff235b618925ad1e89779278af5750df7681ea40316d8111eef876a79ad977ae773d8257ec8efead629fdeb3ca4ba9ae6e11fcdbbef6aa72b7934ef695702eddf4e631a13d2f4c73cd599e115f533a639bbc173e6788d0b5cf23a314fe915dee01a37df698bb77887f7f8805ff190e64c342fb59fe2333ca2e373d30b7c89aff035bec1634a9e904ef1417faf78866ff1fc275de03b7c4fa3a1553e50fd8f78a2ef0bfcf43fe973bcc4cff805bb74d6a3de0e31b37c9f561fe090c6583a19612e9d1dd179417db1575237191eeafb172b9cd22a7d409a7bcc8f0c4e68f01900ef44090db8547f4ee9a966456732445083078f779a8756dfdf52f19b1cd59c699254e31c46d0703f30b6fa5239a5d27faabc22b78409de838316bdd51fd1377730a531a12bd363c949aa3d936f1a6821e8fda566aef8fe011d612eba860569495a9196721ebe7d7ed0c30dac491b58d2bd21c116b634bf25ddd2fd9dd9f3f6efef7bff0111915e41</data> </image> <image name="image4"> <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b13103711c4b530b1308270f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020011bc73cc</data> </image> <image name="image5"> <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b13105719c4b530b1308270f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700f7fd8672</data> </image> <image name="image6"> <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53002abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fbd07ccb</data> </image> <image name="image7"> <data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da8214c44f505c0ae26226b1e8a20a5a1722febb9924a5af58c19b40e77238a1842431ecb66b881371afb03a2b5027bc41ac1f65f9dc1f562f11a52998bd80793411d114146cae9723cfd2cc7266c395ea9aa75c15d74c65aad05c35d79c727215b91636f6d860c689f40910b4e92147d840b3be39d8416d877c860eb9af478d23919c4b8a7a0ed68eb628e4a04521c7fd46c07138e47448dbf1f32fc767e8d43735741af287d3ced83b782fc5075b18a5a5</data> </image> <image name="image8"> <data format="XPM.GZ" length="736">789c7d92d10a82301486eff714c3dd49649984103d42d165105dcce3465d58507611d1bbb773d674aed93f85fd7efb183ab394ef771b9e66ecdecaf60c1c4ef2c6d3fad134cfc371fd62499e7373957c9e4c5832e5c0b7d78bc2b9307331a36055ae960556c05a16656e69e5aaa5355658c202965825566d62176b57b5a64da3f188c084841e0a29a5e831910ef8885e4854501922e8a6b923586a176a8e40051ec1e63b7d0267387c6738424775091d653f98565a858e26c110447107d1886350d4a1c41c3dea7864e87c37f3ce47fc3aee7cd5207ffe90f78a7d0007c6c175</data> </image> <image name="image9"> <data format="XPM.GZ" length="2798">789cb5d5594f1b491007f0773e8545bda1d53ff81a7bb4da07830103b603b92059edc34cf78c0ff0812f3051befb5677554f56c24428d2aa78e0a7aeaeea6be0dd41e9f6aa573a78b7b75c25ab91299961b2281dd8f564b2fdfb9fbfbeefed572a25fe291f46a5cafe1f7bfbd7ab9229f567d3cc81fa0caa945d785f78c72ebc2f9dabb10bef9e73ade2c21913e77ae2c28f2fc48d6a947ab7c4b169d6bc8f9ca3aa0b3fbfaf4e35ff4c5cccdf8813db34de1def34e4c3881b3cc38fb7d5a918f78525ff46dcaca9576a23a627715cd3f53e8a131b7b63edecba69fd8d3af41b1496fa6d7153f78f86b8a86f0bcbfe9ec5493d16cfc5695dfad34c6d651ca9f7cffdbd173743fd441cd64f0f85a5fe489c6a3fd4d5613c0d4eeade43b189747c1b2ce3683abbeebadf5a702ae343716c743d53313f1febc7bfa843bf1371581f9d06ebf8581df257e2b01eba57675a5fea19177e7c109cfa712271aceba58938b13a6ec4a13fba62ee27f53fa9b51fe5c1ba7f7f1f71cd85f7545cdcf73ad8f8ef137762de9fd4ef898b7e51b0d63f52877e65b10de3c785657eacced4fe7b77b763236fab36fa3e1ec5a9d5f341b0e4d3526c42bd4ab0eee7505cf4fb28ce1aea6fc146fa7f76e6d3e115fafa5d7112cebf254eeb328e6a70967b9f8b437fba13db4ceb2fc5453f7f5ffcfac2795f046bbd0fe2a2df486c42bd2bb18dd46375e89f89b99fccf7ef2dadbbf0eea8add6bf16db4cbd1067b9de8fafc7b7a1ef13cf6213e50defadd846b9acff569c3574fe833ad7fa5fc57943cfdb9f9f894cd8cf93982748fdb9386f64dee4df97c978ff52ef4c9d69ff9938cff53cfdf7ec5627f5ae576f8fdfcf0721410ac391c222fb753e720c30c408638e3bdcf31c7a3d9fb3279862c631c70316586285f5ae1e727fd8e091f3e678c216cf68e108c768e3e4957ccb2b39e5fc337470ce71814b74d143ffe59ae4ff01ae7825d7f8c0753fe213d7ff8c2ffcfb0deccefc016ef115df380e51460555d4504784069aafe48f798f87885126a04a4409a564c8be92bfc115655cb94c395a34409d8634a231afe7c58ee5ef35d7bae3dc2eddd384a634a339c7032d90efcce7bba225ad38525aa3461b7ae478da75037a5f2758d196525ec93359aedde23882a563ae95edc8cf90529b4ee894c6bcf2844f66e2ce1239cf9afc7755c5fbc9b8479fdabcc71b3aa38ee4d039d7b9a04b1ecb5ebe677ea1964712ead2f9cf8aac1ecfd10a6f79ffdc7b4d7dee92bcfd7be1bd5ff29ccedbbf2f90dbfbfffefdfef873ef5fce01d04a</data> </image> </images> <connections> <connection> <sender>fileNewAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileNew()</slot> </connection> <connection> <sender>fileOpenAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileOpen()</slot> </connection> <connection> <sender>fileSaveAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileSave()</slot> </connection> <connection> <sender>fileSaveAsAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileSaveAs()</slot> </connection> <connection> <sender>filePrintAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>filePrint()</slot> </connection> <connection> <sender>fileExitAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>fileExit()</slot> </connection> <connection> <sender>editUndoAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editUndo()</slot> </connection> <connection> <sender>editRedoAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editRedo()</slot> </connection> <connection> <sender>editCutAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editCut()</slot> </connection> <connection> <sender>editCopyAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editCopy()</slot> </connection> <connection> <sender>editPasteAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editPaste()</slot> </connection> <connection> <sender>editFindAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>editFind()</slot> </connection> <connection> <sender>helpIndexAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>helpIndex()</slot> </connection> <connection> <sender>helpContentsAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>helpContents()</slot> </connection> <connection> <sender>helpAboutAction</sender> <signal>activated()</signal> <receiver>Neelix</receiver> <slot>helpAbout()</slot> </connection> </connections> <slots> <slot>fileNew()</slot> <slot>fileOpen()</slot> <slot>fileSave()</slot> <slot>fileSaveAs()</slot> <slot>filePrint()</slot> <slot>fileExit()</slot> <slot>editUndo()</slot> <slot>editRedo()</slot> <slot>editCut()</slot> <slot>editCopy()</slot> <slot>editPaste()</slot> <slot>editFind()</slot> <slot>helpIndex()</slot> <slot>helpContents()</slot> <slot>helpAbout()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> </UI> |
From: Hans F. <fu...@us...> - 2004-06-19 03:23:32
|
Update of /cvsroot/neelix/neelix/view/qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26779/qt Log Message: Directory /cvsroot/neelix/neelix/view/qt added to the repository |
From: Hans F. <hf...@we...> - 2004-06-15 15:31:41
|
My emails from home don't seem to make it to the list. I wonder if sf is doing some lame spam filtering... There's a few bugs open if anyone wants to tackle them. they shouldn't be too hard. Attached is a screenshot of mastercook's recipe window, which might be useful for inspiration. I wish we could get fox to do a spreadsheet widget. -- Hans Fugal System Administrator hf...@we... 801.491.2577 |
From: Jacob F. <lu...@us...> - 2004-06-14 20:16:13
|
Update of /cvsroot/neelix/neelix/presenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19908/presenter Modified Files: presenter.rb Log Message: The ingredient is already being added to the recipe's ingredient list when the ingredient is created, so this line ended up adding it twice. Removed. The method (though now empty) remains because it makes sense in the MVC model and we may want to put other stuff in there later. Index: presenter.rb =================================================================== RCS file: /cvsroot/neelix/neelix/presenter/presenter.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- presenter.rb 5 May 2004 13:35:36 -0000 1.4 +++ presenter.rb 14 Jun 2004 20:15:58 -0000 1.5 @@ -16,7 +16,6 @@ recipe.ingredients.delete(ingredient) end def Presenter::addIngredient(recipe, ingredient) - recipe.ingredients << ingredient end end #vim:ts=8:sw=4:nowrap |
From: Hans F. <fu...@us...> - 2004-06-10 15:40:51
|
Update of /cvsroot/neelix/neelix/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14184/view Modified Files: fox.rb Log Message: I'll start the bug reporting/squashing. The ingredient manipulation buttons don't work without this minor fix. Index: fox.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/fox.rb,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- fox.rb 10 Jun 2004 14:35:23 -0000 1.20 +++ fox.rb 10 Jun 2004 15:40:34 -0000 1.21 @@ -1,5 +1,6 @@ require 'fox' include Fox +require 'presenter/presenter' class CookbookForm < FXVerticalFrame def initialize(parent,o) |
From: Hans F. <fu...@us...> - 2004-06-10 14:35:32
|
Update of /cvsroot/neelix/neelix/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9620/view Modified Files: fox.rb Log Message: The shelf is all but done now. I am adding, and subtracting. I am the operator of my pocket calculator... Index: fox.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/fox.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- fox.rb 10 Jun 2004 06:25:29 -0000 1.19 +++ fox.rb 10 Jun 2004 14:35:23 -0000 1.20 @@ -1,48 +1,257 @@ require 'fox' include Fox -LAYOUT_FILL_XY = LAYOUT_FILL_X|LAYOUT_FILL_Y -# app -app = FXApp.new('Neelix', 'fugalh') -app.init(ARGV) +class CookbookForm < FXVerticalFrame + def initialize(parent,o) + super(parent) + @cookbook = o -# main window -mw = FXMainWindow.new(app, 'Neelix') -mw.resize(800,600) + FXLabel.new(self,"Name") + @name = FXTextField.new(self, 80) -# menu -menubar = FXMenubar.new(mw) + @name.connect(SEL_COMMAND) do |sender,sel,data| + @cookbook.name = data + end -filemenu = FXMenuPane.new(mw) -FXMenuCommand.new(filemenu, "&Exit", nil, mw.getApp(), FXApp::ID_QUIT) -FXMenuTitle.new(menubar, "&File", nil, filemenu) + populate + end + def populate + return if not @cookbook + @name.text = @cookbook.name + end + def cookbook=(o) + @cookbook = o + populate + end +end +class CategoryForm < FXVerticalFrame + def initialize(parent,o) + super(parent) + @category = o -actionmenu = FXMenuPane.new(mw) -actions={} -actions['add_cookbook'] = FXMenuCommand.new(actionmenu, "Add Cook&book", nil) -actions['add_cookbook'].enable -actions['add_category'] = FXMenuCommand.new(actionmenu, "Add &Category", nil) -actions['add_category'].disable -actions['add_recipe'] = FXMenuCommand.new(actionmenu, "Add &Recipe", nil) -actions['add_recipe'].disable -FXMenuTitle.new(menubar,"&Action",nil,actionmenu) -actions['add_cookbook'].connect(SEL_COMMAND) { - c = $replicator.create('cookbook',{'name'=>"New Cookbook"}) -} -actions['add_category'].connect(SEL_COMMAND) { puts "TODO: Add Category proc" } -actions['add_recipe'].connect(SEL_COMMAND) { puts "TODO: Add Recipe proc" } + FXLabel.new(self,"Name") + @name = FXTextField.new(self,80) -helpmenu = FXMenuPane.new(mw) -FXMenuCommand.new(helpmenu, "&About Neelix...").connect(SEL_COMMAND) { - FXMessageBox.information(mw, MBOX_OK, "About Neelix", - "Neelix is cool.\nhttp://sf.net/projects/neelix\n\nDedicated to Erin Fugal") -} -FXMenuTitle.new(menubar, "&Help", nil, helpmenu, LAYOUT_RIGHT) + @name.connect(SEL_COMMAND) do |sender,sel,data| + @category.name = data + end + + populate + end + def populate + return if not @category + @name.text = @category.name + end + def category=(o) + @category = o + populate + end +end +class RecipeForm < FXVerticalFrame + def initialize(parent,r) + super(parent) + @recipe = r -# splitter -splitter = FXSplitter.new(mw,SPLITTER_HORIZONTAL|LAYOUT_FILL_XY) + # create widgets + FXLabel.new(self,"Name") + @name = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) -# shelf + FXLabel.new(self,"Author") + @author = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXLabel.new(self,"Oven Temp.") + @temp = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXLabel.new(self,"Total Time") + @tottime = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXLabel.new(self,"Yields") + @yields = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXLabel.new(self,"Ingredients") + frame = FXHorizontalFrame.new(self,LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) + ingredientFrame = FXVerticalFrame.new(frame, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) + @ingredientList = FXList.new(ingredientFrame,5,nil,0,LAYOUT_FILL_X|LIST_SINGLESELECT) + + frame = FXVerticalFrame.new(frame) + @add = FXButton.new(frame,"Add Ingredient") + @up = FXButton.new(frame,"Move Up") + @delete = FXButton.new(frame,"Delete") + @up.enabled = false + @delete.enabled = false + + FXLabel.new(self,"Directions") + frame = FXVerticalFrame.new(self, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) + @directions = FXText.new(frame, nil, 0, LAYOUT_FILL_X) + @directions.visCols=80 + + FXLabel.new(self,"Notes") + frame = FXVerticalFrame.new(self, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) + @notes = FXText.new(frame, nil, 0, LAYOUT_FILL_X) + @notes.visCols=80 + + # connections + @name.connect(SEL_COMMAND) do |sender,sel,data| + @recipe.name = data + end + + @author.connect(SEL_COMMAND) do |sender,sel,data| + @recipe.author = data + end + + @temp.connect(SEL_COMMAND) do |sender,sel,data| + @recipe.temp = data + end + + @tottime.connect(SEL_COMMAND) do |sender,sel,data| + @recipe.tottime = data + end + + @yields.connect(SEL_COMMAND) do |sender,sel,data| + @recipe.yields = data + end + + @ingredientList.connect(SEL_SELECTED) do |sender,sel,data| + @up.enabled = (data != 0) + @delete.enabled = true + @ingredientList.setCurrentItem(data) + end + + @ingredientList.connect(SEL_COMMAND) do |snd,sel,data| + @ingredientList.selectItem(data) + end + + @ingredientList.connect(SEL_DOUBLECLICKED) do |sender,sel,data| + ingredient = @recipe.ingredients.sort[data] + + ingredientDialog = FXDialogBox.new(self,"Edit Ingredient") + + FXLabel.new(ingredientDialog,"Quantity") + quantity = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + quantity.text = ingredient.quantity.to_s + + FXLabel.new(ingredientDialog,"Measure") + measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) + $replicator.measures.each do |measure| + measures << measure.name + measures.currentItem = measures.numItems - 1 if measure === ingredient.measure + end + + FXLabel.new(ingredientDialog,"Food") + food = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + food.text = ingredient.food.name + + FXLabel.new(ingredientDialog,"Modifier") + modifier = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + modifier.text = ingredient.modifier + + FXButton.new(ingredientDialog,"Accept",nil,ingredientDialog,FXDialogBox::ID_ACCEPT) + FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) + if ingredientDialog.execute == 1 then + ingredient.quantity = quantity.text + ingredient.measure = $replicator.measures[measures.currentItem] + ingredient.modifier = (modifier.text == '' ? nil : modifier.text) + + new_food = food.text + food = $replicator.find_food(new_food) + food = $replicator.create('food', {'name' => new_food}) if food.nil? + ingredient.food = food + end + end + + @add.connect(SEL_COMMAND) do |sender,sel,data| + ingredientDialog = FXDialogBox.new(self,"Add Ingredient") + + FXLabel.new(ingredientDialog,"Quantity") + quantity = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + quantity.text = '0.0' + + FXLabel.new(ingredientDialog,"Measure") + measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) + $replicator.measures.each { |measure| measures << measure.name } + + FXLabel.new(ingredientDialog,"Food") + food = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXLabel.new(ingredientDialog,"Modifier") + modifier = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) + + FXButton.new(ingredientDialog,"Accept",nil,ingredientDialog,FXDialogBox::ID_ACCEPT) + FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) + if ingredientDialog.execute == 1 then + quantity = quantity.text + measure = $replicator.measures[measures.currentItem] + modifier = (modifier.text == '' ? nil : modifier.text) + + new_food = food.text + food = $replicator.find_food(new_food) + food = $replicator.create('food', {'name' => new_food}) if food.nil? + + Presenter::addIngredient(@recipe, $replicator.create('ingredient',{ + 'recipe_id' => @recipe.id, + 'measure_id' => measure.id, + 'quantity' => quantity, + 'food_id' => food.id, + 'modifier' => modifier})) + end + end + + @up.connect(SEL_COMMAND) do |sender,sel,data| + index = @ingredientList.currentItem + if index > 0 + Presenter::promoteIngredient(@recipe, index) + @ingredientList.selectItem(index - 1,true) + end + end + + @delete.connect(SEL_COMMAND) do |sender,sel,data| + selectedIndices = (0 .. @ingredientList.numItems-1).select do |i| + @ingredientList.itemSelected?(i) + end + selectedIndices.each do |index| + Presenter::deleteIngredient(@recipe, index) + end + end + + @directions.connect(SEL_CHANGED) do |sender,sel,data| + @recipe.directions = @directions.text + end + + @notes.connect(SEL_CHANGED) do |sender,sel,data| + @recipe.note = @notes.text + end + + populate + end + + def populate + return if not @recipe + @name.text = @recipe.name + @author.text = @recipe.author + @temp.text = @recipe.temp + @tottime.text = @recipe.tottime + @yields.text = @recipe.yields + + refreshIngredients + @recipe.ingredients.add_observer { refreshIngredients } + + @directions.text = @recipe.directions + @notes.text = @recipe.note + end + + def refreshIngredients + @ingredientList.clearItems + @recipe.ingredients.sort.each do |ingredient| + @ingredientList.appendItem(ingredient.to_s) + end + end + + def recipe=(r) + @recipe = r + populate + update + end +end class Tree attr_accessor :data, :children def initialize(data=nil) @@ -56,7 +265,6 @@ TREELIST_SINGLESELECT| TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES| LAYOUT_FILL_XY) - $replicator.cookbooks.add_observer { rebuild } rebuild end @@ -103,18 +311,23 @@ if ti ti.data = t.data n = ti.first - while n - if not t.children.inject(false) {|memo,obj| memo or obj.data == n.data} - removeItem(n) - end - n = n.next + else + n = self.firstItem + end + while n + n2 = n.next + if not t.children.inject(false) {|memo,obj| memo or obj.data == n.data} + removeItem(n) end + n = n2 end t.children.each do |n| - a = findItemByData(n.data) + i = n.data + a = findItemByData(i) if not a - a = FXTreeItem.new(n.data.name) - a.data = n.data + a = FXTreeItem.new(i.name) + a.data = i + i.add_observer { a.text = i.name; self.update } addItemLast(ti,a) end synctree(n,a) @@ -129,32 +342,93 @@ end end + +LAYOUT_FILL_XY = LAYOUT_FILL_X|LAYOUT_FILL_Y +# app +app = FXApp.new('Neelix', 'fugalh') +app.init(ARGV) + +# main window +mw = FXMainWindow.new(app, 'Neelix') +mw.resize(800,600) + +# menu +menubar = FXMenubar.new(mw) + +filemenu = FXMenuPane.new(mw) +FXMenuCommand.new(filemenu, "&Exit", nil, mw.getApp(), FXApp::ID_QUIT) +FXMenuTitle.new(menubar, "&File", nil, filemenu) + +actionmenu = FXMenuPane.new(mw) +actions={} +actions['add_cookbook'] = FXMenuCommand.new(actionmenu, "Add Cookbook", nil) +actions['add_cookbook'].enable +actions['add_category'] = FXMenuCommand.new(actionmenu, "Add Category", nil) +actions['add_category'].disable +actions['add_recipe'] = FXMenuCommand.new(actionmenu, "Add Recipe", nil) +actions['add_recipe'].disable +actions['del_cookbook'] = FXMenuCommand.new(actionmenu, "Delete Cookbook", nil) +actions['del_cookbook'].disable +actions['del_category'] = FXMenuCommand.new(actionmenu, "Delete Category", nil) +actions['del_category'].disable +actions['del_recipe'] = FXMenuCommand.new(actionmenu, "Delete Recipe", nil) +actions['del_recipe'].disable +FXMenuTitle.new(menubar,"&Action",nil,actionmenu) + +helpmenu = FXMenuPane.new(mw) +FXMenuCommand.new(helpmenu, "&About Neelix...").connect(SEL_COMMAND) { + FXMessageBox.information(mw, MBOX_OK, "About Neelix", + "Neelix is cool.\nhttp://sf.net/projects/neelix\n\nDedicated to Erin Fugal") +} +FXMenuTitle.new(menubar, "&Help", nil, helpmenu, LAYOUT_RIGHT) + +# splitter +splitter = FXSplitter.new(mw,SPLITTER_HORIZONTAL|LAYOUT_FILL_XY) shelfbox = FXGroupBox.new(splitter, "Shelf", FRAME_GROOVE) +counterbox = FXGroupBox.new(splitter,"Counter",FRAME_GROOVE) + +# counter +counter = FXSwitcher.new(counterbox,LAYOUT_FILL_XY) +FXWindow.new(counter) +CookbookForm.new(counter,nil) +CategoryForm.new(counter,nil) +RecipeForm.new(counter,nil) + +# shelf shelfbox.width = 200 shelf = Shelf.new(shelfbox) shelf.connect(SEL_SELECTED) do |sender,sel,ptr| case ptr.data when Cookbook - #counterSwitcher.children[1].cookbook = ptr.data - #counterSwitcher.current = 1 + counter.children[1].cookbook = ptr.data + counter.current = 1 actions['add_cookbook'].enable actions['add_category'].enable actions['add_recipe'].disable + actions['del_cookbook'].enable + actions['del_category'].disable + actions['del_recipe'].disable when Category - #counterSwitcher.children[2].category = ptr.data - #counterSwitcher.current = 2 + counter.children[2].category = ptr.data + counter.current = 2 actions['add_cookbook'].enable actions['add_category'].disable actions['add_recipe'].enable + actions['del_cookbook'].disable + actions['del_category'].enable + actions['del_recipe'].disable when Recipe - #counterSwitcher.children[3].recipe = ptr.data - #counterSwitcher.current = 3 + counter.children[3].recipe = ptr.data + counter.current = 3 actions['add_cookbook'].enable actions['add_category'].disable actions['add_recipe'].disable + actions['del_cookbook'].disable + actions['del_category'].disable + actions['del_recipe'].enable else - #counterSwitcher.current = 0 + counter.current = 0 actions['add_cookbook'].enable actions['add_category'].disable actions['add_recipe'].disable @@ -165,10 +439,40 @@ shelf.expandTree(shelf.firstItem.first) shelf.makeItemVisible(shelf.firstItem.first.first) - -# counter -counter = FXGroupBox.new(splitter, "Counter", FRAME_GROOVE) - +# menu actions +actions['add_cookbook'].connect(SEL_COMMAND) do + c = $replicator.create('cookbook',{'name'=>"New Cookbook"}) + shelf.rebuild +end +actions['add_category'].connect(SEL_COMMAND) do + c = $replicator.create('category', + {'name'=>"New Category",'cookbook_id'=>shelf.currentItem.data.id }) + shelf.rebuild +end +actions['add_recipe'].connect(SEL_COMMAND) do + r = $replicator.create('recipe',{'name'=>'New Recipe'}) + c = shelf.currentItem.data + c.recipes << r + shelf.rebuild +end +actions['del_cookbook'].connect(SEL_COMMAND) do + i = shelf.currentItem + c = i.data + $replicator.cookbooks.delete(c) + shelf.rebuild +end +actions['del_category'].connect(SEL_COMMAND) do + i = shelf.currentItem + c = i.data + i.parent.data.categories.delete(c) + shelf.rebuild +end +actions['del_recipe'].connect(SEL_COMMAND) do + i = shelf.currentItem + r = i.data + i.parent.data.recipes.delete(r) + shelf.rebuild +end app.create mw.show |
From: Hans F. <fu...@us...> - 2004-06-10 14:35:31
|
Update of /cvsroot/neelix/neelix/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9620/model Modified Files: model.rb Log Message: The shelf is all but done now. I am adding, and subtracting. I am the operator of my pocket calculator... Index: model.rb =================================================================== RCS file: /cvsroot/neelix/neelix/model/model.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- model.rb 5 May 2004 04:00:52 -0000 1.10 +++ model.rb 10 Jun 2004 14:35:22 -0000 1.11 @@ -440,6 +440,21 @@ @dbh.select_all('select cookbook_id from cookbook').each do |row| @cookbooks << get('cookbook', row['cookbook_id']) end + @cookbooks.add_observer do + # which cookbooks were previously in the DB? + old_cookbooks = [] + @dbh.select_all("select cookbook_id from cookbook").each do |row| + old_cookbooks << $replicator.get('cookbook', row['cookbook_id']) + end + + # adding takes place in Replicator#create + + # remove any no longer used from the DB + (old_cookbooks - @cookbooks).each do |cookbook| + puts cookbook + @dbh.do("delete from cookbook where cookbook_id=?",cookbook.id) + end + end @measures = ObservableArray.new @dbh.select_all("select measure_id from measure").each do |row| |
From: Hans F. <fu...@us...> - 2004-06-10 06:25:38
|
Update of /cvsroot/neelix/neelix/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11443/view Modified Files: fox.rb Log Message: fixed synchronization of treelist Index: fox.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/fox.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- fox.rb 10 Jun 2004 02:33:16 -0000 1.18 +++ fox.rb 10 Jun 2004 06:25:29 -0000 1.19 @@ -43,49 +43,89 @@ splitter = FXSplitter.new(mw,SPLITTER_HORIZONTAL|LAYOUT_FILL_XY) # shelf +class Tree + attr_accessor :data, :children + def initialize(data=nil) + @data = data + @children = [] + end +end class Shelf < FXTreeList def initialize(parent) super(parent, 1, nil, 0, TREELIST_SINGLESELECT| TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES| LAYOUT_FILL_XY) - @items = {} $replicator.cookbooks.add_observer { rebuild } rebuild end - # rebuild the tree because something has changed - # This is the brute-force way. It may be good enough. - # discard the current tree - # walk the data: - # if the items hash has a matching node, bring it in - # else make a new node - def rebuild - self.clearItems + # build a simple tree representation of the data + def buildtree + t = Tree.new $replicator.cookbooks.each do |cookbook| - if not @items[cookbook] - @items[cookbook] = FXTreeItem.new(cookbook.name) - @items[cookbook].data = cookbook - cookbook.add_observer { @items[cookbook].text = cookbook.name; update } - end - self.addItemLast(nil, @items[cookbook]) + a = Tree.new(cookbook) cookbook.categories.each do |category| - if not @items[category] - @items[category] = FXTreeItem.new(category.name) - @items[category].data = category - category.add_observer { @items[category].text = category.name; update } - end - self.addItemLast(@items[cookbook], @items[category]) + b = Tree.new(category) category.recipes.each do |recipe| - if not @items[recipe] - @items[recipe] = FXTreeItem.new(recipe.name) - @items[recipe].data = recipe - recipe.add_observer { @items[recipe].text = recipe.name; update } - end - self.addItemLast(@items[category], @items[recipe]) + c = Tree.new(recipe) + b.children << c + end + a.children << b + end + t.children << a + end + t + end + + def findItemByData(data) + def rec(ti,data) + return ti if ti.data == data + n = ti.first + while n + r = rec(n,data) + return r if r + n = n.next + end + nil + end + + self.each do |root| + r = rec(root,data) + return r if r + end + nil + end + + # synchronize an FXTreeItem with a Tree + # ti=nil means the imaginary root node + def synctree(t,ti=nil) + if ti + ti.data = t.data + n = ti.first + while n + if not t.children.inject(false) {|memo,obj| memo or obj.data == n.data} + removeItem(n) end + n = n.next end end + t.children.each do |n| + a = findItemByData(n.data) + if not a + a = FXTreeItem.new(n.data.name) + a.data = n.data + addItemLast(ti,a) + end + synctree(n,a) + end + end + + # rebuild the tree because something has changed + # This is the brute-force way. It may be good enough. + def rebuild + synctree(buildtree) + update end end |
From: Hans F. <fu...@us...> - 2004-06-10 02:33:25
|
Update of /cvsroot/neelix/neelix/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31942/view Modified Files: fox.rb Log Message: major refactoring of fox.rb, not complete. (e.g. the treelist is still broken) Index: fox.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/fox.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- fox.rb 5 May 2004 04:00:53 -0000 1.17 +++ fox.rb 10 Jun 2004 02:33:16 -0000 1.18 @@ -1,402 +1,137 @@ require 'fox' include Fox -require 'presenter/presenter' - -class CookbookForm < FXVerticalFrame - def initialize(parent,o) - super(parent) - @cookbook = o - - FXLabel.new(self,"Name") - @name = FXTextField.new(self, 80) - - @name.connect(SEL_COMMAND) do |sender,sel,data| - @cookbook.name = data - end - - populate - end - def populate - return if not @cookbook - @name.text = @cookbook.name - end - def cookbook=(o) - @cookbook = o - populate - end -end -class CategoryForm < FXVerticalFrame - def initialize(parent,o) - super(parent) - @category = o - - FXLabel.new(self,"Name") - @name = FXTextField.new(self,80) - - @name.connect(SEL_COMMAND) do |sender,sel,data| - @category.name = data - end - - populate - end - def populate - return if not @category - @name.text = @category.name - end - def category=(o) - @category = o - populate - end -end -class RecipeForm < FXVerticalFrame - def initialize(parent,r) - super(parent) - @recipe = r - - FXLabel.new(self,"Name") - @name = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - - FXLabel.new(self,"Author") - @author = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - - FXLabel.new(self,"Oven Temp.") - @temp = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - - FXLabel.new(self,"Total Time") - @tottime = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - - FXLabel.new(self,"Yields") - @yields = FXTextField.new(self, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - - FXLabel.new(self,"Ingredients") - frame = FXHorizontalFrame.new(self,LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) - ingredientFrame = FXVerticalFrame.new(frame, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) - @ingredientList = FXList.new(ingredientFrame,5,nil,0,LAYOUT_FILL_X|LIST_SINGLESELECT) - - frame = FXVerticalFrame.new(frame) - @add = FXButton.new(frame,"Add Ingredient") - @up = FXButton.new(frame,"Move Up") - @delete = FXButton.new(frame,"Delete") - @up.enabled = false - @delete.enabled = false - - FXLabel.new(self,"Directions") - frame = FXVerticalFrame.new(self, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) - @directions = FXText.new(frame, nil, 0, LAYOUT_FILL_X) - @directions.visCols=80 - - FXLabel.new(self,"Notes") - frame = FXVerticalFrame.new(self, FRAME_NORMAL|LAYOUT_FILL_X, 0,0,0,0, 0,0,0,0) - @notes = FXText.new(frame, nil, 0, LAYOUT_FILL_X) - @notes.visCols=80 - - # connections - @name.connect(SEL_COMMAND) do |sender,sel,data| - @recipe.name = data - end - - @author.connect(SEL_COMMAND) do |sender,sel,data| - @recipe.author = data - end - - @temp.connect(SEL_COMMAND) do |sender,sel,data| - @recipe.temp = data - end - - @tottime.connect(SEL_COMMAND) do |sender,sel,data| - @recipe.tottime = data - end - - @yields.connect(SEL_COMMAND) do |sender,sel,data| - @recipe.yields = data - end - - @ingredientList.connect(SEL_SELECTED) do |sender,sel,data| - @up.enabled = (data != 0) - @delete.enabled = true - @ingredientList.setCurrentItem(data) - end - - @ingredientList.connect(SEL_COMMAND) do |snd,sel,data| - @ingredientList.selectItem(data) - end - - @ingredientList.connect(SEL_DOUBLECLICKED) do |sender,sel,data| - ingredient = @recipe.ingredients.sort[data] - ingredientDialog = FXDialogBox.new(self,"Edit Ingredient") - - FXLabel.new(ingredientDialog,"Quantity") - quantity = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - quantity.text = ingredient.quantity.to_s - - FXLabel.new(ingredientDialog,"Measure") - measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) - $replicator.measures.each do |measure| - measures << measure.name - measures.currentItem = measures.numItems - 1 if measure === ingredient.measure - end - - FXLabel.new(ingredientDialog,"Food") - food = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - food.text = ingredient.food.name - - FXLabel.new(ingredientDialog,"Modifier") - modifier = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - modifier.text = ingredient.modifier - - FXButton.new(ingredientDialog,"Accept",nil,ingredientDialog,FXDialogBox::ID_ACCEPT) - FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) - if ingredientDialog.execute == 1 then - ingredient.quantity = quantity.text - ingredient.measure = $replicator.measures[measures.currentItem] - ingredient.modifier = (modifier.text == '' ? nil : modifier.text) - - new_food = food.text - food = $replicator.find_food(new_food) - food = $replicator.create('food', {'name' => new_food}) if food.nil? - ingredient.food = food - end - end - - @add.connect(SEL_COMMAND) do |sender,sel,data| - ingredientDialog = FXDialogBox.new(self,"Add Ingredient") - - FXLabel.new(ingredientDialog,"Quantity") - quantity = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) - quantity.text = '0.0' - - FXLabel.new(ingredientDialog,"Measure") - measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) - $replicator.measures.each { |measure| measures << measure.name } - - FXLabel.new(ingredientDialog,"Food") - food = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) +LAYOUT_FILL_XY = LAYOUT_FILL_X|LAYOUT_FILL_Y +# app +app = FXApp.new('Neelix', 'fugalh') +app.init(ARGV) - FXLabel.new(ingredientDialog,"Modifier") - modifier = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) +# main window +mw = FXMainWindow.new(app, 'Neelix') +mw.resize(800,600) - FXButton.new(ingredientDialog,"Accept",nil,ingredientDialog,FXDialogBox::ID_ACCEPT) - FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) - if ingredientDialog.execute == 1 then - quantity = quantity.text - measure = $replicator.measures[measures.currentItem] - modifier = (modifier.text == '' ? nil : modifier.text) +# menu +menubar = FXMenubar.new(mw) - new_food = food.text - food = $replicator.find_food(new_food) - food = $replicator.create('food', {'name' => new_food}) if food.nil? +filemenu = FXMenuPane.new(mw) +FXMenuCommand.new(filemenu, "&Exit", nil, mw.getApp(), FXApp::ID_QUIT) +FXMenuTitle.new(menubar, "&File", nil, filemenu) - Presenter::addIngredient(@recipe, $replicator.create('ingredient',{ - 'recipe_id' => @recipe.id, - 'measure_id' => measure.id, - 'quantity' => quantity, - 'food_id' => food.id, - 'modifier' => modifier})) - end - end +actionmenu = FXMenuPane.new(mw) +actions={} +actions['add_cookbook'] = FXMenuCommand.new(actionmenu, "Add Cook&book", nil) +actions['add_cookbook'].enable +actions['add_category'] = FXMenuCommand.new(actionmenu, "Add &Category", nil) +actions['add_category'].disable +actions['add_recipe'] = FXMenuCommand.new(actionmenu, "Add &Recipe", nil) +actions['add_recipe'].disable +FXMenuTitle.new(menubar,"&Action",nil,actionmenu) +actions['add_cookbook'].connect(SEL_COMMAND) { + c = $replicator.create('cookbook',{'name'=>"New Cookbook"}) +} +actions['add_category'].connect(SEL_COMMAND) { puts "TODO: Add Category proc" } +actions['add_recipe'].connect(SEL_COMMAND) { puts "TODO: Add Recipe proc" } - @up.connect(SEL_COMMAND) do |sender,sel,data| - index = @ingredientList.currentItem - if index > 0 - Presenter::promoteIngredient(@recipe, index) - @ingredientList.selectItem(index - 1,true) - end - end +helpmenu = FXMenuPane.new(mw) +FXMenuCommand.new(helpmenu, "&About Neelix...").connect(SEL_COMMAND) { + FXMessageBox.information(mw, MBOX_OK, "About Neelix", + "Neelix is cool.\nhttp://sf.net/projects/neelix\n\nDedicated to Erin Fugal") +} +FXMenuTitle.new(menubar, "&Help", nil, helpmenu, LAYOUT_RIGHT) - @delete.connect(SEL_COMMAND) do |sender,sel,data| - selectedIndices = (0 .. @ingredientList.numItems-1).select do |i| - @ingredientList.itemSelected?(i) - end - selectedIndices.each do |index| - Presenter::deleteIngredient(@recipe, index) - end - end +# splitter +splitter = FXSplitter.new(mw,SPLITTER_HORIZONTAL|LAYOUT_FILL_XY) - @directions.connect(SEL_CHANGED) do |sender,sel,data| - @recipe.directions = @directions.text - end +# shelf +class Shelf < FXTreeList + def initialize(parent) + super(parent, 1, nil, 0, + TREELIST_SINGLESELECT| + TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES| + LAYOUT_FILL_XY) + @items = {} + $replicator.cookbooks.add_observer { rebuild } + rebuild + end - @notes.connect(SEL_CHANGED) do |sender,sel,data| - @recipe.note = @notes.text + # rebuild the tree because something has changed + # This is the brute-force way. It may be good enough. + # discard the current tree + # walk the data: + # if the items hash has a matching node, bring it in + # else make a new node + def rebuild + self.clearItems + $replicator.cookbooks.each do |cookbook| + if not @items[cookbook] + @items[cookbook] = FXTreeItem.new(cookbook.name) + @items[cookbook].data = cookbook + cookbook.add_observer { @items[cookbook].text = cookbook.name; update } + end + self.addItemLast(nil, @items[cookbook]) + cookbook.categories.each do |category| + if not @items[category] + @items[category] = FXTreeItem.new(category.name) + @items[category].data = category + category.add_observer { @items[category].text = category.name; update } end - - populate - end - - def populate - return if not @recipe - @name.text = @recipe.name - @author.text = @recipe.author - @temp.text = @recipe.temp - @tottime.text = @recipe.tottime - @yields.text = @recipe.yields - - refreshIngredients - @recipe.ingredients.add_observer { refreshIngredients } - - @directions.text = @recipe.directions - @notes.text = @recipe.note - end - - def refreshIngredients - @ingredientList.clearItems - @recipe.ingredients.sort.each do |ingredient| - @ingredientList.appendItem(ingredient.to_s) + self.addItemLast(@items[cookbook], @items[category]) + category.recipes.each do |recipe| + if not @items[recipe] + @items[recipe] = FXTreeItem.new(recipe.name) + @items[recipe].data = recipe + recipe.add_observer { @items[recipe].text = recipe.name; update } + end + self.addItemLast(@items[category], @items[recipe]) end + end end - - def recipe=(r) - @recipe = r - populate - update - end + end end -class NeelixMainWindow < FXMainWindow - def initialize(app) - super(app, 'Neelix') - resize(800,600) - - # Menu - menubar = FXMenubar.new(self) - filemenu = FXMenuPane.new(self) - FXMenuCommand.new(filemenu, "&Exit", nil, getApp(), FXApp::ID_QUIT) - FXMenuTitle.new(menubar,"&File",nil,filemenu) - - actionmenu = FXMenuPane.new(self) - actions={} - actions['add_cookbook'] = FXMenuCommand.new(actionmenu, "Add Cook&book", nil) - actions['add_cookbook'].enable - actions['add_category'] = FXMenuCommand.new(actionmenu, "Add &Category", nil) - actions['add_category'].disable - actions['add_recipe'] = FXMenuCommand.new(actionmenu, "Add &Recipe", nil) - actions['add_recipe'].disable - FXMenuTitle.new(menubar,"&Action",nil,actionmenu) - - helpmenu = FXMenuPane.new(self) - FXMenuCommand.new(helpmenu, "&About Neelix...").connect(SEL_COMMAND) { - FXMessageBox.information(self, MBOX_OK, "About Neelix", - "Neelix is cool.\nhttp://sf.net/projects/neelix\n\nDedicated to Erin Fugal") - } - FXMenuTitle.new(menubar, "&Help", nil, helpmenu, LAYOUT_RIGHT) - - frame = FXHorizontalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) - splitter = FXSplitter.new(frame,SPLITTER_HORIZONTAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) - - # Splitter - shelf = FXGroupBox.new(splitter,"Shelf",FRAME_GROOVE) - shelf.width=200 - counter = FXGroupBox.new(splitter,"Counter",FRAME_GROOVE) - counterSwitcher = FXSwitcher.new(counter,LAYOUT_FILL_X|LAYOUT_FILL_Y) - FXWindow.new(counterSwitcher) - CookbookForm.new(counterSwitcher,nil) - CategoryForm.new(counterSwitcher,nil) - RecipeForm.new(counterSwitcher,nil) - - # Shelf - frame = FXVerticalFrame.new(shelf, FRAME_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 0,0,0,0) - shelfTree = FXTreeList.new(frame,0,nil,0,TREELIST_SINGLESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y) - $replicator.cookbooks.each do |cookbook| - cookbook_item = shelfTree.addItemLast(nil, FXTreeItem.new(cookbook.name)) - cookbook_item.data = cookbook - cookbook.add_observer { cookbook_item.text = cookbook.name; shelfTree.update } - cookbook.categories.each do |category| - category_item = shelfTree.addItemLast(cookbook_item, FXTreeItem.new(category.name)) - category_item.data = category - category.add_observer { category_item.text = category.name; shelfTree.update } - category.recipes.each do |recipe| - item = FXTreeItem.new(recipe.name) - item.data = recipe - shelfTree.addItemLast(category_item, item) - recipe.add_observer { item.text = recipe.name; shelfTree.update } - end - end - end - shelfTree.connect(SEL_SELECTED) do |sender,sel,ptr| - case ptr.data - when Cookbook - counterSwitcher.children[1].cookbook = ptr.data - counterSwitcher.current = 1 - actions['add_cookbook'].enable - actions['add_category'].enable - actions['add_recipe'].disable - when Category - counterSwitcher.children[2].category = ptr.data - counterSwitcher.current = 2 - actions['add_cookbook'].enable - actions['add_category'].disable - actions['add_recipe'].enable - when Recipe - counterSwitcher.children[3].recipe = ptr.data - counterSwitcher.current = 3 - actions['add_cookbook'].enable - actions['add_category'].disable - actions['add_recipe'].disable - else - counterSwitcher.current = 0 - actions['add_cookbook'].enable - actions['add_category'].disable - actions['add_recipe'].disable - end - end - - shelfTree.expandTree(shelfTree.firstItem) - shelfTree.expandTree(shelfTree.firstItem.first) - shelfTree.makeItemVisible(shelfTree.firstItem.first.first) - - # shelf observers - $replicator.cookbooks.add_observer { - ary = $replicator.cookbooks.to_a - data = ary.shift - shelfTree.each do |item| - if data == item.data - data = ary.shift - next - end +shelfbox = FXGroupBox.new(splitter, "Shelf", FRAME_GROOVE) +shelfbox.width = 200 +shelf = Shelf.new(shelfbox) - while data != nil and item.data != data - newitem = FXTreeItem.new(data.name) - newitem.data = data - data.add_observer { - newitem.text = data.name - } - shelfTree.addItemBefore(item,newitem) - shelfTree.selectItem(newitem,true) - data = ary.shift - end +shelf.connect(SEL_SELECTED) do |sender,sel,ptr| + case ptr.data + when Cookbook + #counterSwitcher.children[1].cookbook = ptr.data + #counterSwitcher.current = 1 + actions['add_cookbook'].enable + actions['add_category'].enable + actions['add_recipe'].disable + when Category + #counterSwitcher.children[2].category = ptr.data + #counterSwitcher.current = 2 + actions['add_cookbook'].enable + actions['add_category'].disable + actions['add_recipe'].enable + when Recipe + #counterSwitcher.children[3].recipe = ptr.data + #counterSwitcher.current = 3 + actions['add_cookbook'].enable + actions['add_category'].disable + actions['add_recipe'].disable + else + #counterSwitcher.current = 0 + actions['add_cookbook'].enable + actions['add_category'].disable + actions['add_recipe'].disable + end +end - shelfTree.removeItem(item) if data.nil? - end - ary << data - ary.each { |data| - newitem = FXTreeItem.new(data.name) - newitem.data = data - data.add_observer { - newitem.text = data.name - } - shelfTree.addItemLast(nil,newitem) - shelfTree.selectItem(newitem,true) - } - } - # TODO categories and recipes observers +shelf.expandTree(shelf.firstItem) +shelf.expandTree(shelf.firstItem.first) +shelf.makeItemVisible(shelf.firstItem.first.first) - # actions menu connections - actions['add_cookbook'].connect(SEL_COMMAND) { - c = $replicator.create('cookbook',{'name'=>"New Cookbook"}) - } - actions['add_category'].connect(SEL_COMMAND) { puts "TODO: Add Category proc" } - actions['add_recipe'].connect(SEL_COMMAND) { puts "TODO: Add Recipe proc" } - end -end +# counter +counter = FXGroupBox.new(splitter, "Counter", FRAME_GROOVE) -app = FXApp.new('Neelix', 'fugalh') -app.init(ARGV) -neelix = NeelixMainWindow.new(app) app.create -neelix.show +mw.show app.run -# vim:nowrap:ts=8:sw=4 +# vim:sw=2 |
From: <ben...@id...> - 2004-05-25 08:05:21
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Hans F. <fu...@us...> - 2004-05-05 13:35:45
|
Update of /cvsroot/neelix/neelix/presenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15988/presenter Modified Files: presenter.rb Log Message: update the rdoc on the website (neelix.sf.net) when I (fugalh) run it. Index: presenter.rb =================================================================== RCS file: /cvsroot/neelix/neelix/presenter/presenter.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- presenter.rb 23 Dec 2003 14:59:13 -0000 1.3 +++ presenter.rb 5 May 2004 13:35:36 -0000 1.4 @@ -1,3 +1,4 @@ +# UI-independent (or mostly so) code that is also independent of the model. module Presenter def Presenter::promoteIngredient(recipe, i) raise "Can't promote first ingredient" unless i > 0 |
From: Hans F. <fu...@us...> - 2004-05-05 13:35:44
|
Update of /cvsroot/neelix/neelix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15988 Modified Files: Makefile Log Message: update the rdoc on the website (neelix.sf.net) when I (fugalh) run it. Index: Makefile =================================================================== RCS file: /cvsroot/neelix/neelix/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 5 May 2004 04:00:52 -0000 1.4 +++ Makefile 5 May 2004 13:35:36 -0000 1.5 @@ -11,5 +11,6 @@ rdoc=rdoc1.8 doc: $(rdoc) -d -o doc model/*.rb view/*.rb presenter/*.rb *.rb + if [ $(USER) = fugalh ]; then rsync -r doc shell.sf.net:neelix/htdocs/rdoc; fi .PHONY: doc all |
From: Hans F. <fu...@us...> - 2004-05-05 04:01:01
|
Update of /cvsroot/neelix/neelix/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5488/view Modified Files: fox.rb Log Message: documented model code and added make target for rdoc. woopee! Index: fox.rb =================================================================== RCS file: /cvsroot/neelix/neelix/view/fox.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- fox.rb 23 Dec 2003 14:59:13 -0000 1.16 +++ fox.rb 5 May 2004 04:00:53 -0000 1.17 @@ -132,7 +132,7 @@ FXLabel.new(ingredientDialog,"Measure") measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) - $replicator.measure_list.each do |measure| + $replicator.measures.each do |measure| measures << measure.name measures.currentItem = measures.numItems - 1 if measure === ingredient.measure end @@ -149,7 +149,7 @@ FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) if ingredientDialog.execute == 1 then ingredient.quantity = quantity.text - ingredient.measure = $replicator.measure_list[measures.currentItem] + ingredient.measure = $replicator.measures[measures.currentItem] ingredient.modifier = (modifier.text == '' ? nil : modifier.text) new_food = food.text @@ -168,7 +168,7 @@ FXLabel.new(ingredientDialog,"Measure") measures = FXListBox.new(ingredientDialog, 5, nil, 0, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FILL_X) - $replicator.measure_list.each { |measure| measures << measure.name } + $replicator.measures.each { |measure| measures << measure.name } FXLabel.new(ingredientDialog,"Food") food = FXTextField.new(ingredientDialog, 80, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @@ -180,7 +180,7 @@ FXButton.new(ingredientDialog,"Cancel",nil,ingredientDialog,FXDialogBox::ID_CANCEL) if ingredientDialog.execute == 1 then quantity = quantity.text - measure = $replicator.measure_list[measures.currentItem] + measure = $replicator.measures[measures.currentItem] modifier = (modifier.text == '' ? nil : modifier.text) new_food = food.text |
From: Hans F. <fu...@us...> - 2004-05-05 04:01:01
|
Update of /cvsroot/neelix/neelix/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5488/model Modified Files: model.rb Log Message: documented model code and added make target for rdoc. woopee! Index: model.rb =================================================================== RCS file: /cvsroot/neelix/neelix/model/model.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- model.rb 23 Dec 2003 14:59:12 -0000 1.9 +++ model.rb 5 May 2004 04:00:52 -0000 1.10 @@ -2,26 +2,33 @@ require 'dbi' require 'singleton' + +# This module implements the observable end of the observer pattern module Observable + # Add an observer callback def add_observer(&callback) @observers ||= [] @observers << callback end + # Delete an observer callback def delete_observer( &callback ) @observers ||= [] @observers.delete(callback) end protected + # Notify the observers by executing the callbacks. def notify_observers @observers ||= [] @observers.each { |o| o.call } end end +# An observable Array class ObservableArray < Array include Observable + # Some meta programming to make this manageable class << self def wrap_method(*meths) meths.each do |meth| @@ -36,10 +43,14 @@ end end + # wrap the methods that need to cause a notification. TODO Do we have them + # all? too many? wrap_method :<<, :[]=, :clear, :collect!, :compact!, :delete, :delete_at, :delete_if, :flatten!, :map!, :pop, :push, :reject!, :replace, :reverse!, :shift, :slice!, :sort!, :uniq!, :unshift #wrap_method :assoc, :collect, :compact, :concat, :flatten, :rassoc, :reverse, :slice, :sort, :uniq end +# Food is the essence of ingredients. (An ingredient is a quantity of food +# including a modifier) class Food include Observable @@ -88,6 +99,7 @@ end end +# A Measure is like "cup" or "teaspoon" class Measure include Observable @@ -116,6 +128,14 @@ end end +# An ingredient is conceptually like "4 cups flour (sifted)". The "cups" part +# is a Measure, the "flour" part is a Food. The "(sifted)" part is the +# modifier. +# +# Note that not all "4 cups flour (sifted)" are the same Ingredient object. It +# is simplest to allow this conceptual dupulication because that's how humans +# think of it. (when you change a pancake recipe to use less flour, you don't +# want to change your bread recipes too) class Ingredient include Observable @@ -169,6 +189,7 @@ m end + # The position in the list of ingredients def position @dbh.select_one("select position from ingredient where ingredient_id=?",@id)['position'] end @@ -192,6 +213,7 @@ end end +# A Recipe is a collection of ingredients and some metadata about the recipe. class Recipe include Observable @@ -254,6 +276,8 @@ o end + # preparation and cook time together. Does anybody really know what time it + # is? Does anybody really care? def tottime @dbh.select_one("select tottime from recipe where recipe_id=?", @id)[0] end @@ -263,6 +287,8 @@ o end + # oven temperature. Just a string; we don't do any calculations (so the + # user can do C or F or Kelvin, we don't care.) def temp @dbh.select_one("select temp from recipe where recipe_id=?", @id)[0] end @@ -281,6 +307,7 @@ o end + # "Recipe found in Late Aunt Bertha's shoe." def note @dbh.select_one("select note from recipe where recipe_id=?", @id)[0] end @@ -291,6 +318,7 @@ end end +# A category of recipes in a cookbook. class Category include Observable @@ -338,6 +366,7 @@ end end +# A collection of recipes organized by category. class Cookbook include Observable @@ -384,7 +413,8 @@ end end -# Factory singleton (think Star Trek) +# Factory singleton (think Star Trek) TODO maybe this belongs in the presenter +# file... class Replicator include Singleton @@ -396,10 +426,12 @@ end + # is the database handle valid? def check_dbh raise "Invalid DBH" if (!@dbh.kind_of?(DBI::DatabaseHandle)) end + # Attach to a dbh, e.g. one opened by the main program. def attach(dbh) @dbh = dbh @hash = Hash.new @@ -420,6 +452,7 @@ end end + # get the <type> with id <id> from the database. def get(type,id) check_dbh @@ -464,13 +497,15 @@ end end - # should this be a presenter function? If it were, we couldn't make use of SQL... + # should this be a presenter function? If it were, we couldn't make use of + # SQL... def find_food(name) row = @dbh.select_one("select food_id from food where name=?", name) return get('food', row['food_id']) unless row.nil? nil end + # create a new <type> with the hash of values given. def create(type,values) check_dbh |
From: Hans F. <fu...@us...> - 2004-05-05 04:01:00
|
Update of /cvsroot/neelix/neelix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5488 Modified Files: Makefile Log Message: documented model code and added make target for rdoc. woopee! Index: Makefile =================================================================== RCS file: /cvsroot/neelix/neelix/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 19 Dec 2003 16:56:39 -0000 1.3 +++ Makefile 5 May 2004 04:00:52 -0000 1.4 @@ -1,4 +1,15 @@ + all: %: make -C db $@ + +# this assumes the current debian package name (rdoc plain seems to conflict +# with ri plain and I can't live without ri) +# +# I'm assuming dot is available to make the cool relation graphs. (-d) +rdoc=rdoc1.8 +doc: + $(rdoc) -d -o doc model/*.rb view/*.rb presenter/*.rb *.rb + +.PHONY: doc all |