当前位置: 首页>>代码示例>>Python>>正文


Python Dialogs.getOpenFileName方法代码示例

本文整理汇总了Python中Core.Dialogs.getOpenFileName方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.getOpenFileName方法的具体用法?Python Dialogs.getOpenFileName怎么用?Python Dialogs.getOpenFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core.Dialogs的用法示例。


在下文中一共展示了Dialogs.getOpenFileName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sourceClicked

# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import getOpenFileName [as 别名]
 def sourceClicked(self):
     imagePath = Dialogs.getOpenFileName(translate("ImageDetails", "Choose Image"),
                                         self.lePathOfSource.text(),
                                         str(translate("ImageDetails", "Images (*.%s)")) % uni.getStringFromList(
                                             uni.getListValue("imageExtensions"), " *."), 0)
     if imagePath is not None:
         self.lePathOfSource.setText(imagePath)
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:9,代码来源:CoverDetails.py

示例2: selectImage

# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import getOpenFileName [as 别名]
 def selectImage(self):
     try:
         imagePath = Dialogs.getOpenFileName(translate("MusicDetails", "Choose Image"),
                                             fu.getDirName(self.musicValues["path"]), str(
                 translate("MusicDetails", "Images")) + " " + uni.imageExtStringOnlyPNGAndJPG, 0)
         if imagePath is not None:
             self.leImagePath.setText(imagePath)
     except:
         ReportBug.ReportBug()
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:11,代码来源:MusicDetails.py

示例3: selectPackagePath

# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import getOpenFileName [as 别名]
 def selectPackagePath(self):
     try:
         self.teHashDigest.setText("")
         PathOfPackage = Dialogs.getOpenFileName(translate("Hasher", "Please Select The Pack To Be Created"),
                                                 self.lePathOfPackage.text(),
                                                 translate("Hasher", "All Files (*.*)"))
         if PathOfPackage is not None:
             self.lePathOfPackage.setText(str(PathOfPackage))
     except:
         ReportBug.ReportBug()
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:12,代码来源:Hasher.py

示例4: selectFilePath

# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import getOpenFileName [as 别名]
 def selectFilePath(self):
     try:
         filePath = Dialogs.getOpenFileName(translate("TextCorrector", "Please Select A Text File To Correct"),
                                            self.leFilePath.text(),
                                            translate("TextCorrector", "All Files (*)"))
         if filePath is not None:
             self.leFilePath.setText(str(filePath))
             self.isChangeSourceCharSetChanged = False
             self.sourceCharSet.setCurrentIndex(self.sourceCharSet.findText(uni.MySettings["fileSystemEncoding"]))
             self.fillValues()
     except:
         ReportBug.ReportBug()
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:14,代码来源:TextCorrector.py

示例5: clickedAnAction

# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import getOpenFileName [as 别名]
def clickedAnAction(_action):
    try:
        actionName = _action.objectName()
        if actionName == "Open State":
            f = Dialogs.getOpenFileName(translate("MenuBar", "Open State Of Hamsi Manager"),
                                        fu.userDirectoryPath,
                                        translate("MenuBar", "Application Runner") + " (*.desktop)")
            if f is not None:
                Settings.openStateOfSettings(f)
        elif actionName == "Save State":
            f = Dialogs.getSaveFileName(translate("MenuBar", "Save State Of Hamsi Manager"),
                                        fu.joinPath(fu.userDirectoryPath, "HamsiManager.desktop"),
                                        translate("MenuBar", "Application Runner") + " (*.desktop)")
            if f is not None:
                Settings.saveStateOfSettings(f)
                Dialogs.show(translate("MenuBar", "Current State Saved"),
                             translate("MenuBar",
                                       "Current state saved with preferences.<br>You can continue where you left off."))
        elif actionName == "With This Profile (My Settings)":
            if Execute.executeAsRootWithThread(["--sDirectoryPath", fu.pathOfSettingsDirectory], "HamsiManager"):
                getMainWindow().close()
            else:
                Dialogs.showError(translate("MenuBar", "Can Not Run As Root"),
                                  translate("MenuBar", "Hamsi Manager can not run as root."))
        elif actionName == "With Root Profile (Own Settings)":
            if Execute.executeAsRootWithThread([], "HamsiManager"):
                getMainWindow().close()
            else:
                Dialogs.showError(translate("MenuBar", "Can Not Run As Root"),
                                  translate("MenuBar", "Hamsi Manager can not run as root."))
        elif actionName == "Quit":
            getMainWindow().close()
        elif actionName == "HTML Format":
            if _action.parent().objectName() == "Export To File":
                getMainTable().exportValues("file", "html", "title")
            elif _action.parent().objectName() == "Show In New Window":
                getMainTable().exportValues("dialog", "html", "title")
            elif _action.parent().objectName() == "Copy To Clipboard":
                getMainTable().exportValues("clipboard", "html", "title")
        elif actionName == "Text Format":
            if _action.parent().objectName() == "Export To File":
                getMainTable().exportValues("file", "plainText", "title")
            elif _action.parent().objectName() == "Show In New Window":
                getMainTable().exportValues("dialog", "plainText", "title")
            elif _action.parent().objectName() == "Copy To Clipboard":
                getMainTable().exportValues("clipboard", "plainText", "title")
        elif actionName == "HTML Format (File Tree)":
            if _action.parent().objectName() == "Export To File":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "file", "html", "fileTree",
                               "title")
            elif _action.parent().objectName() == "Show In New Window":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "dialog", "html", "fileTree",
                               "title")
            elif _action.parent().objectName() == "Copy To Clipboard":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "clipboard", "html", "fileTree",
                               "title")
        elif actionName == "Text Format (File Tree)":
            if _action.parent().objectName() == "Export To File":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "file", "plainText", "fileTree",
                               "title")
            elif _action.parent().objectName() == "Show In New Window":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "dialog", "plainText", "fileTree",
                               "title")
            elif _action.parent().objectName() == "Copy To Clipboard":
                fu.getFileTree((getMainWindow().FileManager.currentDirectory), 0, "clipboard", "plainText",
                               "fileTree", "title")
        elif actionName == "About QT":
            if isActivePyKDE4:
                QMessageBox.aboutQt(getMainWindow(), translate("MenuBar", "About QT"))
            else:
                MMessageBox.aboutQt(getMainWindow(), translate("MenuBar", "About QT"))
        elif actionName == "Options":
            from Options import OptionsForm

            OptionsForm.OptionsForm(getMainWindow())
        elif actionName == "My Plugins":
            import MyPlugins

            MyPlugins.MyPlugins()
        elif actionName == "Reconfigure":
            from Tools import Configurator

            Configurator.Configurator("configurePage")
        elif actionName == "My Plugins (System)":
            Execute.execute(["--qm", "--plugins", "--runAsRoot"], "HamsiManager")
        elif actionName == "Reconfigure (System)":
            Execute.execute(["--qm", "--configurator", "--runAsRoot"], "HamsiManager")
        elif actionName == "Update":
            from Core import UpdateControl

            UpdateControl.UpdateControl(getMainWindow())
        elif actionName == "Report Bug":
            ReportBug.ReportBug(True)
        elif actionName == "Suggest Idea":
            from Core import SuggestIdea

            SuggestIdea.SuggestIdea()
        elif actionName == "About Hamsi Manager":
            if isActivePyKDE4 is False:
                MMessageBox.about(getMainWindow(), translate("MenuBar", "About Hamsi Manager"),
#.........这里部分代码省略.........
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:103,代码来源:__init__.py


注:本文中的Core.Dialogs.getOpenFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。