首页 > 解决方案 > 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,

标签: python

解决方案


有一个 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,

你去吧。工作重启按钮


推荐阅读