[Avida-SVN] r1661 - branches/developers/avida-edward/source/python/AvidaGui2

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Fri Jun 8 07:37:13 PDT 2007


Author: baerb
Date: 2007-06-08 10:37:13 -0400 (Fri, 08 Jun 2007)
New Revision: 1661

Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui
   branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py
Log:

Started adding menu items for manipulating items in the freezer.



Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2007-06-08 14:32:16 UTC (rev 1660)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2007-06-08 14:37:13 UTC (rev 1661)
@@ -35,10 +35,11 @@
     self.m_ctrl_to_cli_dict = {}
     self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("initializeWithDefaultPetriDishSig"),
        self.Restart_ExpActionSlot)
+    self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("freezerItemsSelectedSig"),
+       self.ModifyFreezerItemMenuItemsSlot)
 
 
 
-
     if (session_mdl.directory_chosen == False):
       self.setCaption('%s - %s' % (avida_ed_version_string, "Unnamed  Workspace") )
     else:
@@ -198,6 +199,18 @@
   def raiseAnaViewSlot(self):
     self.navBarItemClickedSlot(self.m_nav_bar_ctrl.m_one_analyze_cli)
 
+  # when user clicks on an item (or items) in the freezer list change the 
+  # menu to reflect the choice
+
+  def ModifyFreezerItemMenuItemsSlot(self, file_list):
+    self.fileRenameItemAction.setEnabled(True)
+    itemsPicked = file_list.split("\t")[1:]
+    if (len(itemsPicked) == 1):
+      self.fileRenameItemAction.setMenuText("Rename " + itemsPicked[0])
+    else:
+      self.fileRenameItemAction.setMenuText("Rename " + str(len(itemsPicked)) +
+        " freezer items")
+
   def close(self, also_delete = False):
     self.emit(PYSIGNAL("quitAvidaPhaseISig"), ())
     return False
@@ -500,6 +513,11 @@
 
   # public slot
 
+  def fileRenameItem(self):
+    descr("BDB")
+
+  # public slot
+
   def fileExit(self):
     info("pyEduWorkspaceCtrl.fileExit(): Not implemented yet")
 

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui	2007-06-08 14:32:16 UTC (rev 1660)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui	2007-06-08 14:37:13 UTC (rev 1661)
@@ -195,6 +195,8 @@
         <action name="fileSaveImagesAction"/>
         <action name="fileImportItemAction"/>
         <separator/>
+        <action name="fileRenameItemAction"/>
+        <separator/>
         <action name="m_print_action"/>
     </item>
     <item text="&amp;Edit" name="editMenu">
@@ -307,6 +309,8 @@
         <property type="0">-1</property>
         <property type="1">pyFreezerView</property>
         <property type="0">-1</property>
+        <property type="1">pyFreezerView</property>
+        <property type="0">-1</property>
         <property type="pyFreezerView"></property>
         <property type="-1">1</property>
     </customwidget>
@@ -386,6 +390,8 @@
         <property type="0">-1</property>
         <property type="1">pyNavBarView</property>
         <property type="0">-1</property>
+        <property type="1">pyNavBarView</property>
+        <property type="0">-1</property>
         <property type="pyNavBarView"></property>
         <property type="-1">1</property>
     </customwidget>
@@ -885,6 +891,20 @@
             <string>Import Freezer Items</string>
         </property>
     </action>
+    <action>
+        <property name="name">
+            <cstring>fileRenameItemAction</cstring>
+        </property>
+        <property name="enabled">
+            <bool>false</bool>
+        </property>
+        <property name="text">
+            <string>Rename Freezer Item</string>
+        </property>
+        <property name="toolTip">
+            <string>Rename Highlighted Freezer Item</string>
+        </property>
+    </action>
 </actions>
 <images>
     <image name="image0">
@@ -1033,6 +1053,12 @@
         <receiver>pyEduWorkspaceView</receiver>
         <slot>fileImportItem()</slot>
     </connection>
+    <connection>
+        <sender>fileRenameItemAction</sender>
+        <signal>activated()</signal>
+        <receiver>pyEduWorkspaceView</receiver>
+        <slot>fileRenameItem()</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">pyEduWorkspaceView.ui.h</include>
@@ -1056,6 +1082,7 @@
     <slot>helpContents()</slot>
     <slot>helpAbout()</slot>
     <slot>fileImportItem()</slot>
+    <slot>fileRenameItem()</slot>
 </slots>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py	2007-06-08 14:32:16 UTC (rev 1660)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py	2007-06-08 14:37:13 UTC (rev 1661)
@@ -281,6 +281,8 @@
           second_level = second_level.nextSibling()
         top_level = top_level.nextSibling()
 
+      self.m_session_mdl.m_session_mdtr.emit(
+        PYSIGNAL("freezerItemsSelectedSig"), (file_list,))
       dragHolder = self.itemDrag( file_list, self )
       dragHolder.dragCopy()
 




More information about the Avida-cvs mailing list