##// END OF EJS Templates
workspace.py...
Alexander Valdez -
r375:d7aa668a0f5b
parent child
Show More
@@ -1,63 +1,65
1 1 # -*- coding: utf-8 -*-
2
3 from PyQt4.QtGui import QMainWindow
2 import os
3 from PyQt4.QtGui import QDialog
4 4 from PyQt4.QtCore import pyqtSignature
5 5 from PyQt4.QtCore import pyqtSignal
6 from PyQt4 import QtGui
6 from PyQt4 import QtGui, QtCore
7 7 from viewer.ui_workspace import Ui_Workspace
8 from os.path import expanduser
8 9
9 class Workspace(QMainWindow, Ui_Workspace):
10 class Workspace(QDialog, Ui_Workspace):
10 11 """
11 12 Class documentation goes here.
12 13 """
13 closed=pyqtSignal()
14
14 15 def __init__(self, parent = None):
15 16 """
16 17 Constructor
17 18 """
18 QMainWindow.__init__(self, parent)
19 QDialog.__init__(self, parent)
19 20 self.dirList=[]
20 21 self.setupUi(self)
21 22 self.setWindowTitle("ROJ-Signal Chain")
22 23 self.setWindowIcon(QtGui.QIcon("figure/adn.jpg"))
23 24 #*####### DIRECTORIO DE TRABAJO #########*#
24 25 #self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8))
25
26 self.dir=str("C:\WorkSpaceGui")
26 home=expanduser("~")
27 self.dir=os.path.join(home,'schain_workspace')
28 if not os.path.exists(self.dir):
29 os.makedirs(self.dir)
27 30 self.dirComBox.addItem(self.dir)
28 31 self.i=0
29 32
30 33
31 34 @pyqtSignature("")
32 35 def on_dirToolPath_clicked(self):
33 36 """
34 37 Slot documentation goes here.
35 38 """
36 39 self.i +=1
37 40 self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
38 41 self.dirComBox.addItem(self.dirBrowse)
39 42 self.dirComBox.setCurrentIndex(self.i)
40 43
41 44
42 45
43 46 @pyqtSignature("")
44 47 def on_dirOkBtn_clicked(self):
45 48 """
46 49 VISTA DE INTERFAZ GRÁFICA
47 50 """
48 self.close()
49
51 self.accept()
52 # self.close()
53 #
50 54 @pyqtSignature("")
51 55 def on_dirCancelBtn_clicked(self):
52 56 """
53 57 Cerrar
54 58 """
55 59 self.close()
56 60
57 def closeEvent(self, event):
58 self.closed.emit()
59 event.accept()
61
60 62
61 63
62 64
63 65 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now