Example #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
Example #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
Example #3
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
Example #4
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)
Example #5
0
 def selectSystemTarballDialog(self):
     win = KFileDialog('.', '', self, 'SystemTarball', True)
     win.connect(win, SIGNAL('okClicked()'), self.fileSelected)
     win.show()
     self._dialog = win