games_nebula.py 文件源码

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

项目:games_nebula 作者: yancharkin 项目源码 文件源码
def cb_filechooserbutton_mylib_install_dir(self, button):

        new_mylib_install_dir = button.get_filename()

        if new_mylib_install_dir != self.mylib_install_dir:

            message_dialog = Gtk.MessageDialog(
                self.main_window,
                0,
                Gtk.MessageType.QUESTION,
                Gtk.ButtonsType.YES_NO,
                _("Installation directory changed")
                )
            message_dialog.format_secondary_text(_("Do you really want to change installation directory?\n" + \
                "All your installed games will be moved to the new location.\nProceed?"))
            content_area = message_dialog.get_content_area()
            content_area.set_property('margin-left', 10)
            content_area.set_property('margin-right', 10)
            content_area.set_property('margin-top', 10)
            content_area.set_property('margin-bottom', 10)
            action_area = message_dialog.get_action_area()
            action_area.set_property('spacing', 10)

            message_dialog_response = message_dialog.run()

            if message_dialog_response == Gtk.ResponseType.YES:

                os.system('mv -f ' + self.mylib_install_dir + '/* ' + \
                new_mylib_install_dir + ' && rmdir ' + self.mylib_install_dir)

                os.system('rm ' + new_mylib_install_dir + '/*/.configured > /dev/null 2>&1')

                self.mylib_install_dir = new_mylib_install_dir

            elif message_dialog_response == Gtk.ResponseType.NO:

                button.set_filename(self.mylib_install_dir)

            message_dialog.destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号