Esempio n. 1
0
 def _slotFileio(self, actiontype):
     filesel = KFileDialog('.', '', self,
                           '%sEnvironment' % actiontype.upper(), True)
     filesel.actiontype = actiontype
     self.connect(filesel, SIGNAL('okClicked()'), self.file_selected)
     filesel.show()
     self.filesel = filesel
Esempio n. 2
0
 def selectWithinSystemTarballDialog(self, filename):
     win = KFileDialog('.', '', self, 'SystemTarball', True)
     win.setURL(KURL('tar://%s' % filename))
     win.connect(win, SIGNAL('okClicked()'), self.newTemplateSelected)
     win.tarball_filename = filename
     win.show()
     self._dialog = win
Esempio n. 3
0
 def selectWithinSystemTarballDialog(self, filename):
     win = KFileDialog('.', '', self, 'SystemTarball', True)
     win.setURL(KURL('tar://%s' % filename))
     win.connect(win, SIGNAL('okClicked()'), self.newTemplateSelected)
     win.tarball_filename = filename
     win.show()
     self._dialog = win
 def select_launch_command(self):
     if self.select_launch_command_dlg is None:
         file_filter = "*.exe *.bat *.com|Dos Executables\n*|All Files"
         dlg = KFileDialog(self.fullpath, file_filter,  self, 'select_launch_command_dlg', True)
         dlg.connect(dlg, SIGNAL('okClicked()'), self.launch_command_selected)
         dlg.connect(dlg, SIGNAL('cancelClicked()'), self.destroy_select_launch_command_dlg)
         dlg.connect(dlg, SIGNAL('closeClicked()'), self.destroy_select_launch_command_dlg)
         dlg.show()
         self.select_launch_command_dlg = dlg
     else:
         # we shouldn't need this with a modal dialog
         KMessageBox.error(self, opendlg_errormsg)
Esempio n. 5
0
File: tab.py Progetto: pipacs/etc
 def slotOpen(self, id = -1):
     fileName = KFileDialog.getOpenFileName(self.lastDir, "*", self, 
         str(i18n("Open Log File")))
     print fileName
     if not fileName.isEmpty():
         self.lastDir = os.path.dirname(str(fileName))
         self.monitor(str(fileName))
Esempio n. 6
0
 def slotOpen(self, id=-1):
     fileName = KFileDialog.getOpenFileName(self.lastDir, "*", self,
                                            str(i18n("Open Log File")))
     print fileName
     if not fileName.isEmpty():
         self.lastDir = os.path.dirname(str(fileName))
         self.monitor(str(fileName))
 def select_title_screenshot(self, name):
     #raise StandardError, 'select_title_screenshot has a few problems.'
     if self.select_title_screenshot_dlg is None:
         file_filter = "*.png|PNG Images\n*|All Files"
         path = self.app.dosbox.get_capture_path(name)
         dlg = KFileDialog(path, file_filter, self.dialog_parent,
                           'select_title_screenshot_dlg', True)
         dlg.connect(dlg, SIGNAL('okClicked()'), self.title_screenshot_selected)
         dlg.connect(dlg, SIGNAL('cancelClicked()'), self.destroy_select_title_screenshot_dlg)
         dlg.connect(dlg, SIGNAL('closeClicked()'), self.destroy_select_title_screenshot_dlg)
         dlg.game_name = name
         dlg.show()
         self.select_title_screenshot_dlg = dlg
     else:
         # we shouldn't need this with a modal dialog
         KMessageBox.error(self.dialog_parent, opendlg_errormsg)
Esempio n. 8
0
 def slotFile(self):
     self.realLoc = KFileDialog.getOpenFileName(QString.null, QString.null,
                                                self,
                                                i18n("Select COMAR Script"))
     if not self.realLoc or str(self.realLoc).strip() == "":
         return
     self.leFile.setText(os.path.split(str(self.realLoc))[1])
Esempio n. 9
0
 def onOpen(self, id = -1):
     """Open file for monitoring."""
     fileName = KFileDialog.getOpenFileName(self.lastDir, "*", self, 
         str(i18n("Open Log File")))
     if not fileName.isEmpty():
         fileName = str(fileName)
         self.lastDir = os.path.dirname(fileName)
         self.monitor(fileName)
Esempio n. 10
0
 def fileSelected(self):
     filesel = self._dialog
     filename = str(filesel.selectedFile())
     print filename
     filesel.close()
     filesel = KFileDialog('.', '', self, 'SystemTarball', True)
     url = 'tar://%s' % filename
     filesel.setURL(KURL(url))
     filesel.connect(filesel, SIGNAL('okClicked()'),
                     self.newTemplateSelected)
     filesel.show()
     self._dialog = filesel
Esempio n. 11
0
    def setSource(self, url):
        action, context, id = str(url).split('.')
        if action == 'show':
            if context == 'parent':
                win = TraitMainWindow(self.app, self.parent(), self.doc.suite)
                win.view.set_trait(id)
            elif context == 'template':
                fid = id.replace(',', '.')
                package, template = fid.split('...')
                win = ViewWindow(self.app, self.parent(), SimpleEdit,
                                 'TemplateView')
                templatefile = self.doc.trait._templates.templatedata(
                    package, template)
                win.view.setText(templatefile)
                win.resize(600, 800)
            elif context == 'script':
                scriptfile = self.doc.trait._scripts.scriptdata(id)
                win = ViewWindow(self.app, self.parent(), SimpleEdit,
                                 'ScriptView')
                win.view.setText(scriptfile)
                win.resize(600, 800)
            else:
                self._url_error(url)
        elif action == 'edit':
            if context == 'templates':
                #win = KFileDialog('.', '*', self, 'hello file dialog', False)
                #win.show()
                #win = TemplateEditorWindow(self.app, self.parent(), self.doc.suite)
                win = KFileDialog('.', '', self, 'SystemTarball', True)
                self.connect(win, SIGNAL('okClicked()'), self.fileSelected)
                win.show()
                self._dialog = win

            elif context == 'packages':
                win = PackageSelectorWindow(self.app, self.parent(),
                                            self.doc.suite)
            elif context == 'script':
                self.doc.trait.edit_script(id)
            elif context == 'template':
                fid = id.replace(',', '.')
                package, template = fid.split('...')
                self.doc.trait.edit_template(package, template)
            else:
                self._url_error(url)
        elif action == 'new':
            if context == 'package':
                win = SimpleRecordDialog(self, ['package', 'action'])
                win.connect(win, SIGNAL('okClicked()'), self.slotAddPackage)
                win.setRecordData(dict(action='install'))
                self._dialog = win
        else:
            self._url_error(url)
Esempio n. 12
0
 def fileSelected(self):
     filesel = self._dialog
     filename = str(filesel.selectedFile())
     print filename
     filesel.close()
     filesel = KFileDialog('.', '', self, 'SystemTarball', True)
     url = 'tar://%s' % filename
     filesel.setURL(KURL(url))
     filesel.connect(filesel, SIGNAL('okClicked()'), self.newTemplateSelected)
     filesel.show()
     self._dialog = filesel
Esempio n. 13
0
 def _slotFileio(self, actiontype):
     filesel = KFileDialog('.', '', self, '%sEnvironment' % actiontype.upper(), True)
     filesel.actiontype = actiontype
     self.connect(filesel, SIGNAL('okClicked()'), self.file_selected)
     filesel.show()
     self.filesel = filesel
 def menuOpen(self):
     kate.debug("menuOpen()")
     project_path = KFileDialog.getExistingDirectory()
     if project_path:
         self.openProject(project_path)
Esempio n. 15
0
 def selectSystemTarballDialog(self):
     win = KFileDialog('.', '', self, 'SystemTarball', True)
     win.connect(win, SIGNAL('okClicked()'), self.fileSelected)
     win.show()
     self._dialog = win
Esempio n. 16
0
 def getPrivateKey(self, parent=None):
     i = KFileDialog.getOpenFileName("", i18n("*|Certificates"), parent, i18n("Select Private Key File"))
     if i:
         self.auth_private_key = i
         self.auth_private_key_but.setText(self.auth_private_key.section('/', -1))
Esempio n. 17
0
 def getClientCert(self, parent=None):
     i = KFileDialog.getOpenFileName("", i18n("*|Certificates"), parent, i18n("Select Client Certificate File"))
     if i:
         self.auth_client_cert = i
         self.auth_client_cert_but.setText(self.auth_client_cert.section('/', -1))
Esempio n. 18
0
 def selectSystemTarballDialog(self):
     win = KFileDialog('.', '', self, 'SystemTarball', True)
     win.connect(win, SIGNAL('okClicked()'), self.fileSelected)
     win.show()
     self._dialog = win
 def slotFile(self):
     self.realLoc = KFileDialog.getOpenFileName(QString.null, QString.null, self, i18n("Select Additional File"))
     if not self.realLoc or str(self.realLoc).strip() == "":
         return
     self.leFile.setText(os.path.split(str(self.realLoc))[1])