@@ -1,66 +1,70 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | from PyQt4.QtGui import QMainWindow |
|
3 | from PyQt4.QtGui import QMainWindow | |
4 | from PyQt4.QtCore import pyqtSignature |
|
4 | from PyQt4.QtCore import pyqtSignature | |
5 | from PyQt4.QtCore import pyqtSignal |
|
5 | from PyQt4.QtCore import pyqtSignal | |
6 | from PyQt4 import QtGui |
|
6 | from PyQt4 import QtGui | |
7 | from mainwindow import MainWindow |
|
7 | from viewcontroller.mainwindow import MainWindow | |
8 |
from |
|
8 | from viewer.ui_workspace import Ui_Workspace | |
9 |
|
9 | |||
10 | class Workspace(QMainWindow, Ui_Workspace): |
|
10 | class Workspace(QMainWindow, Ui_Workspace): | |
11 | """ |
|
11 | """ | |
12 | Class documentation goes here. |
|
12 | Class documentation goes here. | |
13 | """ |
|
13 | """ | |
14 | closed=pyqtSignal() |
|
14 | closed=pyqtSignal() | |
15 | def __init__(self, parent = None): |
|
15 | def __init__(self, parent = None): | |
16 | """ |
|
16 | """ | |
17 | Constructor |
|
17 | Constructor | |
18 | """ |
|
18 | """ | |
19 | QMainWindow.__init__(self, parent) |
|
19 | QMainWindow.__init__(self, parent) | |
|
20 | self.dirList=[] | |||
20 | self.setupUi(self) |
|
21 | self.setupUi(self) | |
21 | #*####### DIRECTORIO DE TRABAJO #########*# |
|
22 | #*####### DIRECTORIO DE TRABAJO #########*# | |
22 | self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8)) |
|
23 | self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8)) | |
23 | self.dir=str("C:\WorkSpaceGui") |
|
24 | self.dir=str("C:\WorkSpaceGui") | |
24 | self.dirCmbBox.addItem(self.dir) |
|
25 | self.dirCmbBox.addItem(self.dir) | |
|
26 | self.dirList.append(self.dir) | |||
25 |
|
27 | |||
26 | @pyqtSignature("") |
|
28 | @pyqtSignature("") | |
27 | def on_dirBrowsebtn_clicked(self): |
|
29 | def on_dirBrowsebtn_clicked(self): | |
28 | """ |
|
30 | """ | |
29 | Slot documentation goes here. |
|
31 | Slot documentation goes here. | |
30 | """ |
|
32 | """ | |
|
33 | ||||
31 | self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
34 | self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
32 | self.dirCmbBox.addItem(self.dirBrowse) |
|
35 | self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", self.dirBrowse, None, QtGui.QApplication.UnicodeUTF8)) | |
|
36 | self.dirList.append(self.dirBrowse) | |||
|
37 | self.dirCmbBox.clear() | |||
|
38 | for i in self.dirList: | |||
|
39 | self.dirCmbBox.addItem(i) | |||
|
40 | ||||
|
41 | ||||
33 |
|
42 | |||
34 | @pyqtSignature("") |
|
43 | @pyqtSignature("") | |
35 | def on_dirButton_clicked(self): |
|
44 | def on_dirButton_clicked(self): | |
36 | """ |
|
45 | """ | |
37 | Slot documentation goes here. |
|
46 | Slot documentation goes here. | |
38 | """ |
|
47 | """ | |
|
48 | pass | |||
39 |
|
49 | |||
40 | @pyqtSignature("") |
|
50 | @pyqtSignature("") | |
41 | def on_dirOkbtn_clicked(self): |
|
51 | def on_dirOkbtn_clicked(self): | |
42 | """ |
|
52 | """ | |
43 | VISTA DE INTERFAZ GRÃFICA |
|
53 | VISTA DE INTERFAZ GRÃFICA | |
44 | """ |
|
54 | """ | |
45 |
self.s |
|
55 | self.close() | |
46 |
|
||||
47 |
|
56 | |||
48 | @pyqtSignature("") |
|
57 | @pyqtSignature("") | |
49 | def on_dirCancelbtn_clicked(self): |
|
58 | def on_dirCancelbtn_clicked(self): | |
50 | """ |
|
59 | """ | |
51 | Cerrar |
|
60 | Cerrar | |
52 | """ |
|
61 | """ | |
53 | self.close() |
|
62 | self.close() | |
54 |
|
63 | |||
55 | def showmemainwindow(self): |
|
|||
56 | self.Dialog= MainWindow(self) |
|
|||
57 | self.Dialog.show() |
|
|||
58 | self.hide() |
|
|||
59 |
|
||||
60 | def closeEvent(self, event): |
|
64 | def closeEvent(self, event): | |
61 | self.closed.emit() |
|
65 | self.closed.emit() | |
62 | event.accept() |
|
66 | event.accept() | |
63 |
|
67 | |||
64 |
|
68 | |||
65 |
|
69 | |||
66 | No newline at end of file |
|
70 |
General Comments 0
You need to be logged in to leave comments.
Login now