def on_exceptDirButton_clicked(self):
     """
     Private slot to select a file to exempt from translation.
     """
     texcept = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Exempt directory from translation"),
         self.project.ppath,
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
     if not texcept.isEmpty():
         self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept))
 def on_pathButton_clicked(self):
     """
     Private slot called to open a directory selection dialog.
     """
     path = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select source directory"),
         QDir.fromNativeSeparators(self.pathnameEdit.text()),
         QFileDialog.Options(QFileDialog.Option(0)))
     if not path.isEmpty():
         self.pathnameEdit.setText(QDir.toNativeSeparators(path))
 def on_transBinPathButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select directory for binary translations"),
         self.transBinPathEdit.text(),
         QFileDialog.Options(QFileDialog.Option(0)))
     
     if not directory.isEmpty():
         self.transBinPathEdit.setText(Utilities.toNativeSeparators(directory))
 def on_projectDirButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select Project Directory"),
         self.vcsProjectDirEdit.text(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
     
     if not directory.isEmpty():
         self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory))
Exemplo n.º 5
0
 def __newToplevelDir(self):
     """
     Private slot to handle the New toplevel directory popup menu entry.
     """
     dname = KQFileDialog.getExistingDirectory(\
         None,
         QApplication.translate('Browser', "New toplevel directory"),
         QString(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
     if not dname.isEmpty():
         dname = os.path.abspath(unicode(Utilities.toNativeSeparators(dname)))
         self.__model.addTopLevelDir(dname)
Exemplo n.º 6
0
 def on_dirSelectButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select directory"),
         self.dirCombo.currentText(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not directory.isEmpty():
         self.dirCombo.setEditText(Utilities.toNativeSeparators(directory))
Exemplo n.º 7
0
 def on_qt4TransButton_clicked(self):
     """
     Private slot to handle the Qt4 translations directory selection.
     """
     dir = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select Qt4 Translations Directory"),
         self.qt4TransEdit.text(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not dir.isNull():
         self.qt4TransEdit.setText(Utilities.toNativeSeparators(dir))
Exemplo n.º 8
0
 def on_iconDirectoryButton_clicked(self):
     """
     Private slot to select an icon directory.
     """
     dir = KQFileDialog.getExistingDirectory(\
         None,
         self.trUtf8("Select icon directory"),
         QString(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not dir.isEmpty():
         self.iconDirectoryEdit.setText(Utilities.toNativeSeparators(dir))
 def on_dirButton_clicked(self):
     """
     Private method used to open a directory selection dialog.
     """
     cwd = self.ui.workdirCombo.currentText()
     d = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Working directory"),
         cwd,
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not d.isNull() and not d.isEmpty():
         self.ui.workdirCombo.setEditText(Utilities.toNativeSeparators(d))
 def on_workspaceButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     default = self.workspaceEdit.text()
     if default.isEmpty():
         default = Utilities.getHomeDir()
     directory = KQFileDialog.getExistingDirectory(
         self,
         self.trUtf8("Select Workspace Directory"),
         default,
         QFileDialog.Options(0))
     
     if not directory.isEmpty():
         self.workspaceEdit.setText(Utilities.toNativeSeparators(directory))
Exemplo n.º 11
0
 def on_downloadDirButton_clicked(self):
     """
     Private slot to handle the directory selection via dialog.
     """
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select download directory"),
         self.downloadDirEdit.text(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not directory.isNull():
         dn = unicode(Utilities.toNativeSeparators(directory))
         while dn.endswith(os.sep):
             dn = dn[:-1]
         self.downloadDirEdit.setText(dn)
 def on_targetDirButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     startdir = self.targetDirEdit.text()
     if startdir.isEmpty() and self.startdir is not None:
         startdir = self.startdir
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select target directory"),
         startdir,
         QFileDialog.Options(QFileDialog.Option(0)))
         
     if not directory.isNull():
         self.targetDirEdit.setText(Utilities.toNativeSeparators(directory))
 def __dirDialog(self, textEdit):
     """
     Private slot to display a directory selection dialog.
     
     @param textEdit field for the display of the selected directory name
             (QLineEdit)
     """
     startdir = textEdit.text()
     if startdir.isEmpty() and self.startdir is not None:
         startdir = self.startdir
     
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select directory"),
         startdir,
         QFileDialog.Options(QFileDialog.Option(0)))
     
     if not directory.isEmpty():
         textEdit.setText(Utilities.toNativeSeparators(directory))
 def on_qtHelpDirButton_clicked(self):
     """
     Private slot to select the output directory for the QtHelp files.
     
     It displays a directory selection dialog to
     select the directory the QtHelp files are written to.
     """
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select output directory for QtHelp files"),
         self.qtHelpDirEdit.text(),
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not directory.isNull():
         # make it relative, if it is a subdirectory of the project path 
         dn = unicode(Utilities.toNativeSeparators(directory))
         dn = self.project.getRelativePath(dn)
         while dn.endswith(os.sep):
             dn = dn[:-1]
         self.qtHelpDirEdit.setText(dn)
 def on_dirButton_clicked(self):
     """
     Private slot to handle the button press for selecting the target via a 
     selection dialog.
     """
     if os.path.isdir(self.source):
         target = KQFileDialog.getExistingDirectory(\
             None,
             self.trUtf8("Select target"),
             self.targetEdit.text(),
             QFileDialog.Options(QFileDialog.ShowDirsOnly))
     else:
         target = KQFileDialog.getSaveFileName(\
             None,
             self.trUtf8("Select target"),
             self.targetEdit.text(),
             QString(),
             None,
             QFileDialog.Options(QFileDialog.DontConfirmOverwrite))
     
     if not target.isEmpty():
         self.targetEdit.setText(Utilities.toNativeSeparators(target))
 def on_ignoreDirButton_clicked(self):
     """
     Private slot to select a directory to be ignored.
     
     It displays a directory selection dialog to
     select a directory to be ignored.
     """
     startDir = self.ignoreDirEdit.text()
     if startDir.isEmpty():
         startDir = self.ppath
     directory = KQFileDialog.getExistingDirectory(\
         self,
         self.trUtf8("Select directory to exclude"),
         startDir,
         QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
     if not directory.isNull():
         # make it relative, if it is a subdirectory of the project path 
         dn = unicode(Utilities.toNativeSeparators(directory))
         dn = self.project.getRelativePath(dn)
         while dn.endswith(os.sep):
             dn = dn[:-1]
         self.ignoreDirEdit.setText(dn)
 def on_vcsUrlButton_clicked(self):
     """
     Private slot to display a selection dialog.
     """
     if self.protocolCombo.currentText() == "file://":
         directory = KQFileDialog.getExistingDirectory(\
             self,
             self.trUtf8("Select Repository-Directory"),
             self.vcsUrlEdit.text(),
             QFileDialog.Options(QFileDialog.ShowDirsOnly))
         
         if not directory.isEmpty():
             self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory))
     else:
         dlg = SvnRepoBrowserDialog(self.vcs, mode = "select", parent = self)
         dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text())
         if dlg.exec_() == QDialog.Accepted:
             url = dlg.getSelectedUrl()
             if not url.isEmpty():
                 protocol = url.section("://", 0, 0)
                 path = url.section("://", 1, 1)
                 self.protocolCombo.setCurrentIndex(\
                     self.protocolCombo.findText(protocol + "://"))
                 self.vcsUrlEdit.setText(path)