예제 #1
0
파일: wizard.py 프로젝트: marnue/assetjet
    def __init__(self):
        QtGui.QDialog.__init__(self) 
       
        self.ui = Ui_db_location()
        self.ui.setupUi(self)

        # Using Qt's version as os.path.expanduser('~') fails on WinPython
        self.initial_dir = os.path.abspath(os.path.join(
                                       QtCore.QDir.homePath(),'AssetJetData'))
        self.ui.location.setText(self.initial_dir)
        self.ui.button_change.clicked.connect(self.selectDir)
예제 #2
0
파일: wizard.py 프로젝트: marnue/assetjet
class DbLocation(QtGui.QDialog):
    def __init__(self):
        QtGui.QDialog.__init__(self) 
       
        self.ui = Ui_db_location()
        self.ui.setupUi(self)

        # Using Qt's version as os.path.expanduser('~') fails on WinPython
        self.initial_dir = os.path.abspath(os.path.join(
                                       QtCore.QDir.homePath(),'AssetJetData'))
        self.ui.location.setText(self.initial_dir)
        self.ui.button_change.clicked.connect(self.selectDir)
        
    def selectDir(self):
        QtGui.QFileDialog.whatsThis = False
        reply = QtGui.QFileDialog.getExistingDirectory(None,
                                                       'Select Directory',
                                                       self.initial_dir)
        if reply: # Leave the path unchanged if the users cancels       
            self.ui.location.setText(reply)
            
    def getText(self):
        return self.ui.location.text()