Exemplo n.º 1
0
class ApplicationPage(QWizardPage):
    def __init__(self, parent=None):
        super(ApplicationPage, self).__init__(parent)
        self.ui = Ui_ApplicationPage()
        self.ui.setupUi(self)
        self.ui.btnBrowse.clicked.connect(self.browse)
        self.registerField("appName*", self.ui.editApplicationName)
        self.registerField("appVersion", self.ui.editApplicationVersion)
        self.registerField("orgName*", self.ui.editOrganizationName)
        self.registerField("location", self.ui.editLocation)
        self.registerField("encoding", self.ui.editEncoding)
        
        d = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
        self.ui.editLocation.setText(d)
        
    def browse(self):
        initial_dir = self.ui.editLocation.text()
        d = QFileDialog.getExistingDirectory(self, "Browse", initial_dir)
        if not d.isEmpty():
            self.ui.editLocation.setText(d)
Exemplo n.º 2
0
 def __init__(self, parent=None):
     super(ApplicationPage, self).__init__(parent)
     self.ui = Ui_ApplicationPage()
     self.ui.setupUi(self)
     self.ui.btnBrowse.clicked.connect(self.browse)
     self.registerField("appName*", self.ui.editApplicationName)
     self.registerField("appVersion", self.ui.editApplicationVersion)
     self.registerField("orgName*", self.ui.editOrganizationName)
     self.registerField("location", self.ui.editLocation)
     self.registerField("encoding", self.ui.editEncoding)
     
     d = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
     self.ui.editLocation.setText(d)