[Avida-cvs] [avida-svn] r439 - branches/developers/avida-edward/source/python/AvidaGui2
baerb@myxo.css.msu.edu
baerb at myxo.css.msu.edu
Tue Jan 17 07:57:55 PST 2006
Author: baerb
Date: 2006-01-17 10:57:55 -0500 (Tue, 17 Jan 2006)
New Revision: 439
Modified:
branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui
Log:
Finished file services menu (when right clicking on a item in the freezer)
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py 2006-01-17 01:15:39 UTC (rev 438)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py 2006-01-17 15:57:55 UTC (rev 439)
@@ -11,18 +11,21 @@
class pyRightClickDialogCtrl (pyRightClickDialogView):
def __init__(self, item_name, file_name):
pyRightClickDialogView.__init__(self)
- self.file_name = file_name
- self.NewNameLineEdit.setText(item_name)
+ self.file_name = str(file_name)
+ self.item_name = str(item_name)
+ self.NewNameLineEdit.setText(self.item_name)
self.connect(self.ConfirmPushButton, SIGNAL("clicked()"),
self.DoneDialogSlot)
(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.NameTextLabel.setText(item_name)
if (self.file_ext == '.organism'):
- self.TypeTextLabel.setText(self.file_ext.lstrip('.') + ":")
+ self.setCaption(self.file_ext.lstrip('.') + ": " + self.item_name)
+ self.OpenRadioButton.setDisabled(True)
+ self.OpenRadioButton.setChecked(False)
+ self.SaveAsRadioButton.setChecked(True)
else:
- self.TypeTextLabel.setText(self.file_ext.lstrip('.') + " dish:")
+ self.setCaption(self.file_ext.lstrip('.') + " dish: " + self.item_name)
self.DeleteFlag = 1
self.RenameFlag = 2
self.SaveAsFlag = 3
@@ -72,17 +75,23 @@
file_dialog = QFileDialog (os.path.join(self.file_dir, '..'),
'.junk1234junk', self, 'Export', False)
file_dialog.setCaption('Export ' + self.file_ext.lstrip('.') + " " +
- str(self.NameTextLabel.text()) + ' to:')
+ 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:
- print "BDB dir name = " + str(file_dialog.dir().selectedFile())
- export_file_name = os.path.join(str(file_dialog.dir().selectedFile()),
- self.file_core_name)
+ # tmp_dir = file_dialog.dir()
+ # tmp_file = file_dialog.selectedFile()
+ # print "BDB dir name = " + str(tmp_dir.path())
+ # print "BDB file name = " + str(tmp_file)
+ export_file_name = os.path.join(str(file_dialog.selectedFile()),
+ self.file_core_name)
print "BDB export file name = " + str(export_file_name)
- # shutil.copytree(self.file_name, str(file_dialog.dir().path()))
+ if (self.file_ext == '.full'):
+ shutil.copytree(self.file_name, str(export_file_name))
+ else:
+ shutil.copyfile(self.file_name, str(export_file_name))
elif dialog_result == self.OpenFlag:
self.open_obj = True
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui 2006-01-17 01:15:39 UTC (rev 438)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogView.ui 2006-01-17 15:57:55 UTC (rev 439)
@@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>262</width>
- <height>267</height>
+ <height>240</height>
</rect>
</property>
<property name="paletteBackgroundColor">
@@ -29,9 +29,9 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>12</y>
+ <y>23</y>
<width>242</width>
- <height>231</height>
+ <height>206</height>
</rect>
</property>
<property name="paletteBackgroundColor">
@@ -51,32 +51,6 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout2</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>TypeTextLabel</cstring>
- </property>
- <property name="text">
- <string>Type:</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>NameTextLabel</cstring>
- </property>
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </hbox>
- </widget>
<widget class="QRadioButton">
<property name="name">
<cstring>DeleteRadioButton</cstring>
More information about the Avida-cvs
mailing list