[Avida-cvs] [Avida2-svn] r105 - trunk/source/python/AvidaGui2
baerb at myxo.css.msu.edu
baerb at myxo.css.msu.edu
Wed Apr 6 09:19:40 PDT 2005
Author: baerb
Date: 2005-04-06 12:19:40 -0400 (Wed, 06 Apr 2005)
New Revision: 105
Modified:
trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
trunk/source/python/AvidaGui2/pyQuitDialogCtrl.py
trunk/source/python/AvidaGui2/pyQuitDialogView.ui
Log:
Added temporary Quit dialog box.
Modified: trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2005-04-05 20:33:47 UTC (rev 104)
+++ trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2005-04-06 16:19:40 UTC (rev 105)
@@ -271,6 +271,8 @@
self.startStatus = False
def startQuitProcessSlot(self):
- m_quit_avida_ed = pyQuitDialogCtrl
- self.emit(PYSIGNAL("quitAvidaPhaseIISig"), ())
+ m_quit_avida_ed = pyQuitDialogCtrl()
+ quit_return = m_quit_avida_ed.showDialog()
+ if quit_return == m_quit_avida_ed.QuitFlag:
+ self.emit(PYSIGNAL("quitAvidaPhaseIISig"), ())
Modified: trunk/source/python/AvidaGui2/pyQuitDialogCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyQuitDialogCtrl.py 2005-04-05 20:33:47 UTC (rev 104)
+++ trunk/source/python/AvidaGui2/pyQuitDialogCtrl.py 2005-04-06 16:19:40 UTC (rev 105)
@@ -12,22 +12,23 @@
def __init__(self):
pyQuitDialogView.__init__(self)
self.connect(self.QuitPushButton, SIGNAL("clicked()"), self.DownQuitSlot)
+ self.FreezeQuitFlag = 0
+ self.QuitFlag = 1
+ self.CancelFlag = 2
def DownQuitSlot(self):
- self.QuitPushButton.setDown()
+ self.QuitPushButton.setDown(True)
def showDialog(self):
- found_valid_name = False
+ self.SaveToFreezerPushButton.setHidden(True)
dialog_result = 1
- while (found_valid_name == False and dialog_result > 0):
+ while (dialog_result > 0):
while (self.exec_loop() and self.result() == 0):
pass
dialog_result = self.result()
- tmp_name = str(self.FileNameLineEdit.text())
- print "dialog_result = " + str(dialog_result) + " QuitPushButton.isDown() = " + str(QuitPushButton.isDown())
if dialog_result == 0:
- return 0
- elif QuitPushButton.isDown():
- return 1
+ return self.CancelFlag
+ elif self.QuitPushButton.isDown():
+ return self.QuitFlag
else:
- return 2
+ return self.FreezeQuitFlag
Modified: trunk/source/python/AvidaGui2/pyQuitDialogView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyQuitDialogView.ui 2005-04-05 20:33:47 UTC (rev 104)
+++ trunk/source/python/AvidaGui2/pyQuitDialogView.ui 2005-04-06 16:19:40 UTC (rev 105)
@@ -8,42 +8,62 @@
<rect>
<x>0</x>
<y>0</y>
- <width>322</width>
- <height>54</height>
+ <width>324</width>
+ <height>135</height>
</rect>
</property>
<property name="caption">
<string>Quit</string>
</property>
- <hbox>
+ <vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton">
+ <widget class="QLayoutWidget">
<property name="name">
- <cstring>SaveToFreezerPushButton</cstring>
+ <cstring>layout21</cstring>
</property>
- <property name="text">
- <string>Freeze and Quit</string>
- </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>SaveToFreezerPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Freeze and Quit</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Quit</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>CancelPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget class="QPushButton">
+ <widget class="QLabel">
<property name="name">
- <cstring>QuitPushButton</cstring>
+ <cstring>WarningLabel</cstring>
</property>
<property name="text">
- <string>Quit</string>
+ <string><b>WARNING!</b> Quiting will not save current work<br>
+Select Cancel and click on "Freeze Petri Dish" <br>
+button to save current population and/or settings.</string>
</property>
</widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>CancelPushButton</cstring>
- </property>
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </hbox>
+ </vbox>
</widget>
<connections>
<connection>
@@ -62,7 +82,7 @@
<sender>QuitPushButton</sender>
<signal>clicked()</signal>
<receiver>pyQuitDialogView</receiver>
- <slot>close()</slot>
+ <slot>accept()</slot>
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
More information about the Avida-cvs
mailing list