删除菜单栏后如何恢复?

删除菜单栏后如何恢复?

我正在使用 Ubuntu Quickly,我运行了命令quickly design,然后删除了菜单栏。但是当我运行时,我收到此错误:

AttributeError: UiFactory instance has no attribute 'helpMenu'

我尝试注释掉一些部分,但是对源代码的简单搜索并没有显示帮助菜单。

而在谷歌上搜索“快速”会给你很多误报......

答案1

问题来自于修改后的基 Window 类,它很快就出现在 _lib/Window.py 中:

Traceback (most recent call last):
  File "bin/testapp", line 33, in <module>
    testapp.main()
  File "/home/ian/pythontesting/testapp/testapp/__init__.py", line 33, in main
    window = TestappWindow.TestappWindow()
  File "/home/ian/pythontesting/testapp/testapp_lib/Window.py", line 35, in __new__
    new_object.finish_initializing(builder)
  File "/home/ian/pythontesting/testapp/testapp/TestappWindow.py", line 24, in finish_initializing
    super(TestappWindow, self).finish_initializing(builder)
  File "/home/ian/pythontesting/testapp/testapp_lib/Window.py", line 61, in finish_initializing
    LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
AttributeError: UiFactory instance has no attribute 'helpMenu'

构建器不再有菜单。它位于 try/except 块中,因此应该会失败,但实际上并没有,因为它不会处理属性错误。修改 Window.py 文件,使第 63 行显示为:

except (ImportError, AttributeError):

现在它应该可以正常工作了。我向 launchpad 提交了一份错误报告:https://bugs.launchpad.net/quickly/+bug/1051686

相关内容