|
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 |