コード例 #1
0
ファイル: viewbrowser.py プロジェクト: pombredanne/paella-svn
 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
コード例 #2
0
class KPartTextEditor(QWidget):
    def __init__(self, mime, parent=None):
        QWidget.__init__(self, parent)
        Layout = QVBoxLayout(self)
        self.part = partchooser.get_part(self, mime)
        if self.part is None:
            return
        self.part.widget().setSizePolicy(QSizePolicy.Expanding,
                                         QSizePolicy.Expanding)
        Layout.addWidget(self.part.widget())
        self.fpath = None

    def openURL(self, url):
        from kdecore import KURL
        self.url = KURL(url)
        if self.part:
            self.part.openURL(self.url)

    def filename(self):
        return str(self.url.fileName())

    def save(self, fpath=None):
        if fpath is None and self.fpath is None:
            pass

    def clear(self):
        self.openUrl('/dev/null')
コード例 #3
0
ファイル: trait.py プロジェクト: pombredanne/paella-svn
 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
コード例 #4
0
def openComposer(to='', cc='', bcc='', subject='', message=''):
    interfaces = [('kmail', 'default'), ('kontact', 'KMailIface')]

    client = DCOPClient()
    client.attach()

    done = False
    for app, part in interfaces:
        obj = DCOPObj(app, client, part)
        try:
            obj.openComposer(to, cc, bcc, qstr(subject), qstr(message), False,
                             KURL())
            done = True
            break
        except TypeError:
            pass

    return done
コード例 #5
0
 def openURL(self, url):
     from kdecore import KURL
     self.url = KURL(url)
     if self.part:
         self.part.openURL(self.url)
コード例 #6
0
ファイル: editors.py プロジェクト: pars-linux/uludag
 def openFile(self, file):
     from os.path import abspath
     self.part.openURL(KURL("file://%s" % abspath(file)))
     self.editedFile = abspath(file)