mainframe.py 文件源码

python
阅读 102 收藏 0 点赞 0 评论 0

项目:fomod-validator 作者: GandaG 项目源码 文件源码
def path_button_clicked(self):
        """
        Called when the user clicks the button next to the line edit - the path choosing button.

        First checks if there is text in the line edit and uses that for the initial search directory. If not, then it
        defaults to the user $HOME directory.

        Once a directory is chosen and the user has not clicked cancel (cancel returns an empty path) it directly sets
        the line edit text.
        """
        open_dialog = QFileDialog()
        if not self.path_text.text():
            button_path = expanduser("~")
        else:
            button_path = self.path_text.text()

        temp_path = open_dialog.getExistingDirectory(self, "Package directory:", button_path)

        if temp_path:
            self.path_text.setText(temp_path)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号