def close_window(self, button, event): if common.need_reboot: kdialog = KanoDialog( _("Reboot?"), _("Your Kano needs to reboot for changes to apply"), [ { 'label': _("LATER"), 'color': 'grey', 'return_value': False }, { 'label': _("REBOOT NOW"), 'color': 'orange', 'return_value': True } ], parent_window=self.get_toplevel() ) kdialog.set_action_background('grey') do_reboot_now = kdialog.run() if do_reboot_now: os.system("sudo systemctl reboot") self._trigger_tracking_event() Gtk.main_quit()
def _show_icon_tutorial(self): try: from kano_profile.apps import save_app_state_variable, load_app_state_variable if load_app_state_variable('kano-apps', 'icon-tutorial-shown'): return else: save_app_state_variable('kano-apps', 'icon-tutorial-shown', True) except ImportError: # ignore problems importing kano_profile, as we don't want it to # be a dependency pass kdialog = KanoDialog( _("Add more apps to the desktop"), _("Click the '+' button to the right of the app name to " "make it appear on the desktop. You can remove it again " "by clicking on 'x'."), {_("OK, GOT IT"): { "return_value": 0, "color": "green" }}, parent_window=self) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run()
def _show_icon_tutorial(self): try: from kano_profile.apps import save_app_state_variable, load_app_state_variable if load_app_state_variable('kano-apps', 'icon-tutorial-shown'): return else: save_app_state_variable('kano-apps', 'icon-tutorial-shown', True) except ImportError: # ignore problems importing kano_profile, as we don't want it to # be a dependency pass kdialog = KanoDialog( _("Add more apps to the desktop"), _( "Click the '+' button to the right of the app name to " "make it appear on the desktop. You can remove it again " "by clicking on 'x'." ), { _("OK, GOT IT"): { "return_value": 0, "color": "green" } }, parent_window=self ) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run()
def close_window(self, button, event): if common.need_reboot: kdialog = KanoDialog( _("Reboot?"), _("Your Kano needs to reboot for changes to apply"), [ { 'label': _("LATER"), 'color': 'grey', 'return_value': False }, { 'label': _("REBOOT NOW"), 'color': 'orange', 'return_value': True } ], parent_window=self.get_toplevel() ) kdialog.set_action_background('grey') do_reboot_now = kdialog.run() if do_reboot_now: os.system("sudo systemctl reboot") self._trigger_tracking_event() Gtk.main_quit()
def _show_more_cb(self, widget): kdialog = KanoDialog( self._app["title"], self._app['description'] if "description" in self._app else self._app['tagline'], {_("OK, GOT IT"): { "return_value": 0, "color": "green" }}, parent_window=self._window) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run() return True
def _show_more_cb(self, widget): kdialog = KanoDialog( self._app["title"], self._app['description'] if "description" in self._app else self._app['tagline'], { _("OK, GOT IT"): { "return_value": 0, "color": "green" } }, parent_window=self._window ) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run() return True
def _show_icon_tutorial(self): if load_app_state_variable('kano-apps', 'icon-tutorial-shown'): return else: save_app_state_variable('kano-apps', 'icon-tutorial-shown', True) kdialog = KanoDialog( _("Add more apps to the desktop"), _("Click the '+' button to the right of the app name to " "make it appear on the desktop. You can remove it again " "by clicking on 'x'."), {_("OK, GOT IT"): { "return_value": 0, "color": "green" }}, parent_window=self) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run()
def _show_icon_tutorial(self): if load_app_state_variable('kano-apps', 'icon-tutorial-shown'): return else: save_app_state_variable('kano-apps', 'icon-tutorial-shown', True) kdialog = KanoDialog( "Add more apps to the desktop", "Click the '+' button to the right of the app name to " "make it appear on the desktop. You can remove it again " "by clicking on 'x'.", { "OK, GOT IT": { "return_value": 0, "color": "green" } }, parent_window=self ) kdialog.set_action_background("grey") kdialog.title.description.set_max_width_chars(40) kdialog.run()