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

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Thu Jun 7 13:56:32 PDT 2007


Author: baerb
Date: 2007-06-07 16:56:32 -0400 (Thu, 07 Jun 2007)
New Revision: 1656

Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyNavBarCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui
Log:

Change look of RightClick Dialog box to look more like other dialog boxes.  
Does not fix problem where you have to click twice on the dialog box to change
radio buttons.




Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyNavBarCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyNavBarCtrl.py	2007-06-07 16:24:19 UTC (rev 1655)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyNavBarCtrl.py	2007-06-07 20:56:32 UTC (rev 1656)
@@ -31,7 +31,7 @@
     if e.source() is self:
       return
 
-    # dropped_item_name is a string...the file name 
+    # dropped_item_name is a string...a file name or raw genotype 
  
     print type(e)
     descr("in contentsDrop event")
@@ -44,7 +44,7 @@
     if ( QIconDrag.canDecode(e)):
       format = QDropEvent.format(e, 0)
     if ( QTextDrag.decode( e, dropped_item_name ) ) :
-      descr("in decode, dropped_item_name is: ", dropped_item_name[:])
+      descr("in decode, dropped_item_name is: ", str(dropped_item_name)[:])
       if dropped_item_name[:9] == 'organism.':
         descr("that was an organism")
         dropped_item_name = dropped_item_name[9:]

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2007-06-07 16:24:19 UTC (rev 1655)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2007-06-07 20:56:32 UTC (rev 1656)
@@ -399,6 +399,5 @@
       painter.end()
 
   def setZoomSlot(self, zoomValue):
-    print("BDB, zoom set to " + str(zoomValue))
     self.m_zoom_spinbox.setValue(zoomValue)
     self.m_zoom_spinbox.setFont(QFont("Arial",13))

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py	2007-06-07 16:24:19 UTC (rev 1655)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py	2007-06-07 20:56:32 UTC (rev 1656)
@@ -18,14 +18,23 @@
     self.NewNameLineEdit.setText(self.item_name)
     self.connect(self.ConfirmPushButton, SIGNAL("clicked()"), 
                  self.DoneDialogSlot)
+    self.connect(self.RenameRadioButton, SIGNAL("clicked()"),
+                 self.EnableNewNameSlot)
+    self.connect(self.DeleteRadioButton, SIGNAL("clicked()"),
+                 self.DisableNewNameSlot)
+    self.connect(self.SaveAsRadioButton, SIGNAL("clicked()"),
+                 self.DisableNewNameSlot)
+    self.connect(self.OpenRadioButton, SIGNAL("clicked()"),
+                 self.DisableNewNameSlot)
 
     (self.file_dir, self.file_core_name)  = os.path.split(self.file_name)
     self.file_ext = self.file_core_name[self.file_core_name.rfind('.'):]
+    self.RenameRadioButton.setChecked(True)
+    self.NewNameLineEdit.setDisabled(False)
     if (self.file_ext == '.organism'):
       self.setCaption(self.file_ext.lstrip('.') + ": " + self.item_name)
       self.OpenRadioButton.setDisabled(True)
       self.OpenRadioButton.setChecked(False)
-      self.SaveAsRadioButton.setChecked(True)
     else:
       self.setCaption(self.file_ext.lstrip('.') + " dish: " + self.item_name)
     self.DeleteFlag = 1
@@ -43,6 +52,12 @@
     elif self.OpenRadioButton.isChecked():
       self.done(self.OpenFlag)
 
+  def EnableNewNameSlot(self):
+    self.NewNameLineEdit.setDisabled(False)
+
+  def DisableNewNameSlot(self):
+    self.NewNameLineEdit.setDisabled(True)
+
   def showDialog(self):
     self.change = False
     self.open_obj = False
@@ -73,21 +88,6 @@
         self.change = True
 
     elif dialog_result == self.SaveAsFlag:
-      # file_dialog = QFileDialog (os.path.join(self.file_dir, '..'), 
-      #   '.junk1234junk', self, 'Export', False)
-      # file_dialog.setCaption('Export ' + self.file_ext.lstrip('.') + " " + 
-      #   self.item_name + ' to:')
-      # file_dialog.setMode(QFileDialog.DirectoryOnly)
-      # # file_dialog.setSelection (self.file_core_name)
-      # file_dialog.show()
-      # file_dialog.exec_loop()
-      # if file_dialog.result() == True:
-      #   export_file_name = os.path.join(str(file_dialog.selectedFile()),
-      #    self.file_core_name)
-      #   if (self.file_ext == '.full'):
-      #     shutil.copytree(self.file_name, str(export_file_name))
-      #   else:
-      #     shutil.copyfile(self.file_name, str(export_file_name))
 
       # If the directory has not been chosen self.file_dir is not
       # correct (at least on the Mac).  It is a relative path where

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui	2007-06-07 16:24:19 UTC (rev 1655)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui	2007-06-07 20:56:32 UTC (rev 1656)
@@ -8,185 +8,244 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>262</width>
-            <height>240</height>
+            <width>510</width>
+            <height>209</height>
         </rect>
     </property>
-    <property name="paletteBackgroundColor">
-        <color>
-            <red>255</red>
-            <green>255</green>
-            <blue>100</blue>
-        </color>
-    </property>
     <property name="caption">
-        <string>pyRightClickDialogView</string>
+        <string></string>
     </property>
-    <widget class="QButtonGroup">
+    <property name="toolTip" stdset="0">
+        <string>&lt;p&gt;The new name of the item if you choose to rename it.&lt;/p&gt;</string>
+    </property>
+    <vbox>
         <property name="name">
-            <cstring>ItemChoicesButtonGroup</cstring>
+            <cstring>unnamed</cstring>
         </property>
-        <property name="geometry">
-            <rect>
-                <x>10</x>
-                <y>23</y>
-                <width>242</width>
-                <height>206</height>
-            </rect>
-        </property>
-        <property name="paletteBackgroundColor">
-            <color>
-                <red>255</red>
-                <green>255</green>
-                <blue>100</blue>
-            </color>
-        </property>
-        <property name="title">
-            <string></string>
-        </property>
-        <property name="alignment">
-            <set>AlignHCenter</set>
-        </property>
-        <vbox>
+        <widget class="QLabel">
             <property name="name">
-                <cstring>unnamed</cstring>
+                <cstring>MainMessageTextLabel</cstring>
             </property>
-            <widget class="QRadioButton">
+            <property name="font">
+                <font>
+                    <family>Arial</family>
+                    <pointsize>16</pointsize>
+                </font>
+            </property>
+            <property name="text">
+                <string>What do you want to do with this item?</string>
+            </property>
+            <property name="alignment">
+                <set>AlignCenter</set>
+            </property>
+        </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>FullEmptyButtonGroup</cstring>
+            </property>
+            <property name="focusPolicy">
+                <enum>NoFocus</enum>
+            </property>
+            <property name="frameShape">
+                <enum>NoFrame</enum>
+            </property>
+            <property name="title">
+                <string></string>
+            </property>
+            <hbox>
                 <property name="name">
-                    <cstring>DeleteRadioButton</cstring>
+                    <cstring>unnamed</cstring>
                 </property>
-                <property name="paletteBackgroundColor">
-                    <color>
-                        <red>255</red>
-                        <green>255</green>
-                        <blue>100</blue>
-                    </color>
-                </property>
-                <property name="focusPolicy">
-                    <enum>StrongFocus</enum>
-                </property>
-                <property name="text">
-                    <string>delete</string>
-                </property>
-            </widget>
-            <widget class="QLayoutWidget">
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>RenameRadioButton</cstring>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>16</pointsize>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>TabFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Rename</string>
+                    </property>
+                    <property name="checked">
+                        <bool>true</bool>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Rename the freezer item&lt;/p&gt;</string>
+                    </property>
+                </widget>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>DeleteRadioButton</cstring>
+                    </property>
+                    <property name="enabled">
+                        <bool>true</bool>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>16</pointsize>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>NoFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Delete</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Delete the freezer item&lt;/P&gt;</string>
+                    </property>
+                </widget>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>SaveAsRadioButton</cstring>
+                    </property>
+                    <property name="enabled">
+                        <bool>true</bool>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>16</pointsize>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>NoFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Export</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;P&gt;Export freezer item to a .aex file.&lt;/P&gt;</string>
+                    </property>
+                </widget>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>OpenRadioButton</cstring>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>16</pointsize>
+                        </font>
+                    </property>
+                    <property name="text">
+                        <string>Open</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Open freezer item&lt;/P&gt;</string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget class="QLineEdit">
+            <property name="name">
+                <cstring>NewNameLineEdit</cstring>
+            </property>
+            <property name="font">
+                <font>
+                    <family>Arial</family>
+                    <pointsize>16</pointsize>
+                </font>
+            </property>
+            <property name="frameShape">
+                <enum>LineEditPanel</enum>
+            </property>
+            <property name="frameShadow">
+                <enum>Sunken</enum>
+            </property>
+            <property name="toolTip" stdset="0">
+                <string>&lt;P&gt;Enter a new, unique (case-sensitive) name&lt;/p&gt;</string>
+            </property>
+        </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>FreezeCancelButtonGroup</cstring>
+            </property>
+            <property name="focusPolicy">
+                <enum>NoFocus</enum>
+            </property>
+            <property name="frameShape">
+                <enum>NoFrame</enum>
+            </property>
+            <property name="title">
+                <string></string>
+            </property>
+            <hbox>
                 <property name="name">
-                    <cstring>layout1</cstring>
+                    <cstring>unnamed</cstring>
                 </property>
-                <hbox>
+                <widget class="QPushButton">
                     <property name="name">
-                        <cstring>unnamed</cstring>
+                        <cstring>ConfirmPushButton</cstring>
                     </property>
-                    <widget class="QRadioButton">
-                        <property name="name">
-                            <cstring>RenameRadioButton</cstring>
-                        </property>
-                        <property name="paletteBackgroundColor">
-                            <color>
-                                <red>255</red>
-                                <green>255</green>
-                                <blue>100</blue>
-                            </color>
-                        </property>
-                        <property name="focusPolicy">
-                            <enum>StrongFocus</enum>
-                        </property>
-                        <property name="text">
-                            <string>rename</string>
-                        </property>
-                    </widget>
-                    <widget class="QLineEdit">
-                        <property name="name">
-                            <cstring>NewNameLineEdit</cstring>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
-            <widget class="QRadioButton">
-                <property name="name">
-                    <cstring>SaveAsRadioButton</cstring>
-                </property>
-                <property name="paletteBackgroundColor">
-                    <color>
-                        <red>255</red>
-                        <green>255</green>
-                        <blue>100</blue>
-                    </color>
-                </property>
-                <property name="focusPolicy">
-                    <enum>StrongFocus</enum>
-                </property>
-                <property name="text">
-                    <string>export</string>
-                </property>
-            </widget>
-            <widget class="QRadioButton">
-                <property name="name">
-                    <cstring>OpenRadioButton</cstring>
-                </property>
-                <property name="paletteBackgroundColor">
-                    <color>
-                        <red>255</red>
-                        <green>255</green>
-                        <blue>100</blue>
-                    </color>
-                </property>
-                <property name="focusPolicy">
-                    <enum>StrongFocus</enum>
-                </property>
-                <property name="text">
-                    <string>open</string>
-                </property>
-                <property name="checked">
-                    <bool>true</bool>
-                </property>
-            </widget>
-            <widget class="QPushButton">
-                <property name="name">
-                    <cstring>ConfirmPushButton</cstring>
-                </property>
-                <property name="paletteBackgroundColor">
-                    <color>
-                        <red>255</red>
-                        <green>255</green>
-                        <blue>100</blue>
-                    </color>
-                </property>
-                <property name="focusPolicy">
-                    <enum>StrongFocus</enum>
-                </property>
-                <property name="text">
-                    <string>Confirm</string>
-                </property>
-            </widget>
-            <widget class="QPushButton">
-                <property name="name">
-                    <cstring>CancelPushButton</cstring>
-                </property>
-                <property name="paletteBackgroundColor">
-                    <color>
-                        <red>255</red>
-                        <green>255</green>
-                        <blue>100</blue>
-                    </color>
-                </property>
-                <property name="focusPolicy">
-                    <enum>StrongFocus</enum>
-                </property>
-                <property name="text">
-                    <string>Cancel</string>
-                </property>
-            </widget>
-        </vbox>
-    </widget>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>StrongFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Confirm</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;P&gt;Save the named file&lt;/P&gt;</string>
+                    </property>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>CancelPushButton</cstring>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>StrongFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Cancel</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Don't save, return to the program&lt;/P&gt;</string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
 </widget>
 <connections>
     <connection>
         <sender>CancelPushButton</sender>
         <signal>clicked()</signal>
         <receiver>pyRightClickDialogView</receiver>
-        <slot>close()</slot>
+        <slot>reject()</slot>
     </connection>
+    <connection>
+        <sender>ConfirmPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>pyRightClickDialogView</receiver>
+        <slot>accept()</slot>
+    </connection>
 </connections>
+<tabstops>
+    <tabstop>RenameRadioButton</tabstop>
+    <tabstop>NewNameLineEdit</tabstop>
+    <tabstop>ConfirmPushButton</tabstop>
+    <tabstop>CancelPushButton</tabstop>
+    <tabstop>DeleteRadioButton</tabstop>
+    <tabstop>SaveAsRadioButton</tabstop>
+    <tabstop>FreezeCancelButtonGroup</tabstop>
+    <tabstop>FullEmptyButtonGroup</tabstop>
+</tabstops>
 <layoutdefaults spacing="6" margin="11"/>
 </UI>




More information about the Avida-cvs mailing list