workspace.py
66 lines
| 1.8 KiB
| text/x-python
|
PythonLexer
|
r208 | # -*- coding: utf-8 -*- | |
|
r375 | import os | |
|
r577 | from os.path import expanduser | |
|
r375 | from PyQt4.QtGui import QDialog | |
|
r208 | from PyQt4.QtCore import pyqtSignature | |
from PyQt4.QtCore import pyqtSignal | |||
|
r375 | from PyQt4 import QtGui, QtCore | |
|
r577 | ||
from schainpy.gui.viewer.ui_workspace import Ui_Workspace | |||
|
r208 | ||
|
r375 | class Workspace(QDialog, Ui_Workspace): | |
|
r208 | """ | |
Class documentation goes here. | |||
""" | |||
|
r375 | ||
|
r208 | def __init__(self, parent = None): | |
""" | |||
Constructor | |||
""" | |||
|
r375 | QDialog.__init__(self, parent) | |
|
r261 | self.dirList=[] | |
|
r208 | self.setupUi(self) | |
|
r365 | self.setWindowTitle("ROJ-Signal Chain") | |
|
r577 | self.setWindowIcon(QtGui.QIcon("schainpy/gui/figure/adn.jpg")) | |
|
r208 | #*####### DIRECTORIO DE TRABAJO #########*# | |
|
r365 | #self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8)) | |
|
r375 | home=expanduser("~") | |
self.dir=os.path.join(home,'schain_workspace') | |||
if not os.path.exists(self.dir): | |||
os.makedirs(self.dir) | |||
|
r365 | self.dirComBox.addItem(self.dir) | |
self.i=0 | |||
|
r208 | ||
@pyqtSignature("") | |||
|
r365 | def on_dirToolPath_clicked(self): | |
|
r208 | """ | |
Slot documentation goes here. | |||
""" | |||
|
r365 | self.i +=1 | |
|
r208 | self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
|
r365 | self.dirComBox.addItem(self.dirBrowse) | |
self.dirComBox.setCurrentIndex(self.i) | |||
|
r261 | ||
|
r208 | ||
@pyqtSignature("") | |||
|
r365 | def on_dirOkBtn_clicked(self): | |
|
r208 | """ | |
VISTA DE INTERFAZ GRÃFICA | |||
""" | |||
|
r375 | self.accept() | |
# self.close() | |||
# | |||
|
r208 | @pyqtSignature("") | |
|
r365 | def on_dirCancelBtn_clicked(self): | |
|
r208 | """ | |
Cerrar | |||
""" | |||
self.close() | |||
|
r375 | ||
|
r208 | ||