python - Python - 尝试为 Cardapio 制作重启按钮
问题描述
我正在尝试将 Cardapio 窗口底部的按钮之一变成重启按钮。我知道需要编辑的区域,但不知道放什么让它像重启按钮一样 - 就像你从命令行输入“gnome-session-quit --reboot”一样。其他两个就像注销和关机按钮一样,并且像他们应该的那样行事。
这是代码区域-
_('Reboot'),
_('Reboot the System'),
'system-restart',
self.de.??????????????????????,
self._view.RIGHT_SESSION_PANE,
],
[
_('Log Out'),
_('Log out of this session to log in as a different user'),
'system-log-out',
self.de.save_session,
self._view.RIGHT_SESSION_PANE,
],
[
_('Shut Down'),
_('Shut down the system'),
'system-shutdown',
self.de.shutdown,
self._view.RIGHT_SESSION_PANE,
解决方案
有一个 DesktopEnvironment.py 文件列出了所有 self.de.xxx 命令
我在这个文件中添加了 self.reboot = 'gnome-session-quit --reboot'
然后 cardapio.py 需要指向它
_('Reboot'), _('Reboot the System'), 'system-reboot', self.de.reboot self._view.RIGHT_SESSION_PANE,
你去吧。工作重启按钮
推荐阅读
- ios - 大内存消耗 UITextView
- javascript - jQuery 到 Vue js
- python-2.7 - 在 python elif 语句中添加列表
- scrapy - Scrapy Request方法的meta-args是浅拷贝,而在scrapy_redis中Request方法的meta-args是深拷贝,为什么?
- c++ - Is there a reason why numeric_limits do not work on reference types?
- spring-boot - 带有微服务的千分尺
- r - merge data frame and named vector
- java - Opertion performance between ArrayList or single String
- javascript - 如何在浏览器上生成视频文件
- c - CPU relaxation and delays in loops concerning GUIs