예제 #1
0
    def _notify_vote_submit(self, app, username, vote):
        """
        Notify User about Comment submission with current credentials.
        """
        msg = ngettext("Rate <b>%s</b> as <b>%s</b>, with <b>%d</b> star?",
                       "Rate <b>%s</b> as <b>%s</b>, with <b>%d</b> stars?",
                       vote)
        msg = msg % (
            app.name,
            escape_markup(username),
            vote,
        )
        box = NotificationBox(msg,
                              message_type=Gtk.MessageType.INFO,
                              context_id=self.VOTE_NOTIFICATION_CONTEXT_ID)

        def _vote_submit(widget):
            self._vote_submit(app, username, vote)

        box.add_button(_("_Ok, cool!"), _vote_submit)

        def _send_vote():
            self._on_stars_clicked(self._stars, app=app)

        def _logout_webservice(widget):
            self._logout_webservice(app, _send_vote)

        box.add_button(_("_No, logout!"), _logout_webservice)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #2
0
    def _notify_comment_submit(self, app, username, text):
        """
        Notify User about Comment submission with current credentials.
        """
        box = NotificationBox(
            _("You are about to add a <b>comment</b> as <b>%s</b>.") \
                % (escape_markup(username),),
            message_type=Gtk.MessageType.INFO,
            context_id=self.COMMENT_NOTIFICATION_CONTEXT_ID)

        def _comment_submit(widget):
            self._comment_submit(app, username, text)

        box.add_button(_("_Ok, cool!"), _comment_submit)

        def _send_comment():
            self._on_send_comment(None, app=app)

        def _logout_webservice(widget):
            self._logout_webservice(app, _send_comment)

        box.add_button(_("_No, logout!"), _logout_webservice)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #3
0
파일: rigo_app.py 프로젝트: jgarte/entropy
    def _on_applications_managed(self, widget, success, local_activity):
        """
        Emitted by RigoServiceController telling us that
        enqueue application actions have been completed.
        """
        msg = "N/A"
        if not success:
            if local_activity == LocalActivityStates.MANAGING_APPLICATIONS:
                msg = "<b>%s</b>: %s" % (
                    _("Application Management Error"),
                    _("please check the management log"),
                )
            elif local_activity == LocalActivityStates.UPGRADING_SYSTEM:
                msg = "<b>%s</b>: %s" % (
                    _("System Upgrade Error"),
                    _("please check the upgrade log"),
                )
            message_type = Gtk.MessageType.ERROR
        else:
            if local_activity == LocalActivityStates.MANAGING_APPLICATIONS:
                msg = _("Applications managed <b>successfully</b>!")
            elif local_activity == LocalActivityStates.UPGRADING_SYSTEM:
                msg = _("System Upgraded <b>successfully</b>!")
            message_type = Gtk.MessageType.INFO

        box = NotificationBox(
            msg,
            message_type=message_type,
            context_id=RigoServiceController.NOTIFICATION_CONTEXT_ID)
        box.add_destroy_button(_("Ok, thanks"))
        box.add_button(_("Show me"), self._on_show_work_view)
        self._nc.append(box)
        self._work_view_c.deactivate_app_box()
예제 #4
0
파일: rigo_app.py 프로젝트: Sabayon/entropy
    def _on_applications_managed(self, widget, success, local_activity):
        """
        Emitted by RigoServiceController telling us that
        enqueue application actions have been completed.
        """
        msg = "N/A"
        if not success:
            if local_activity == LocalActivityStates.MANAGING_APPLICATIONS:
                msg = "<b>%s</b>: %s" % (
                    _("Application Management Error"),
                    _("please check the management log"),)
            elif local_activity == LocalActivityStates.UPGRADING_SYSTEM:
                msg = "<b>%s</b>: %s" % (
                    _("System Upgrade Error"),
                    _("please check the upgrade log"),)
            message_type = Gtk.MessageType.ERROR
        else:
            if local_activity == LocalActivityStates.MANAGING_APPLICATIONS:
                msg = _("Applications managed <b>successfully</b>!")
            elif local_activity == LocalActivityStates.UPGRADING_SYSTEM:
                msg = _("System Upgraded <b>successfully</b>!")
            message_type = Gtk.MessageType.INFO

        box = NotificationBox(
            msg, message_type=message_type,
            context_id=RigoServiceController.NOTIFICATION_CONTEXT_ID)
        box.add_destroy_button(_("Ok, thanks"))
        box.add_button(_("Show me"), self._on_show_work_view)
        self._nc.append(box)
        self._work_view_c.deactivate_app_box()
예제 #5
0
 def _on_comment_login_success(self, widget, username, app):
     """
     Notify user that we successfully logged in!
     """
     box = NotificationBox(
         _("Logged in as <b>%s</b>! How about your <b>comment</b>?") \
             % (escape_markup(username),),
         message_type=Gtk.MessageType.INFO,
         context_id=self.COMMENT_NOTIFICATION_CONTEXT_ID)
     def _send_comment(widget):
         self._on_send_comment(widget, app=app)
     box.add_button(_("_Send now"), _send_comment)
     box.add_destroy_button(_("_Later"))
     self._nc.append(box)
예제 #6
0
    def _on_comment_login_success(self, widget, username, app):
        """
        Notify user that we successfully logged in!
        """
        box = NotificationBox(
            _("Logged in as <b>%s</b>! How about your <b>comment</b>?") \
                % (escape_markup(username),),
            message_type=Gtk.MessageType.INFO,
            context_id=self.COMMENT_NOTIFICATION_CONTEXT_ID)

        def _send_comment(widget):
            self._on_send_comment(widget, app=app)

        box.add_button(_("_Send now"), _send_comment)
        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #7
0
    def _on_stars_login_success(self, widget, username, app):
        """
        Notify user that we successfully logged in!
        """
        box = NotificationBox(
            _("Logged in as <b>%s</b>! How about your <b>vote</b>?") \
                % (escape_markup(username),),
            message_type=Gtk.MessageType.INFO,
            context_id=self.VOTE_NOTIFICATION_CONTEXT_ID)

        def _send_vote(widget):
            self._on_stars_clicked(self._stars, app=app)
        box.add_button(_("_Vote now"), _send_vote)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #8
0
    def _on_stars_login_success(self, widget, username, app):
        """
        Notify user that we successfully logged in!
        """
        box = NotificationBox(
            _("Logged in as <b>%s</b>! How about your <b>vote</b>?") \
                % (escape_markup(username),),
            message_type=Gtk.MessageType.INFO,
            context_id=self.VOTE_NOTIFICATION_CONTEXT_ID)

        def _send_vote(widget):
            self._on_stars_clicked(self._stars, app=app)

        box.add_button(_("_Vote now"), _send_vote)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #9
0
    def _notify_comment_submit(self, app, username, text):
        """
        Notify User about Comment submission with current credentials.
        """
        box = NotificationBox(
            _("You are about to add a <b>comment</b> as <b>%s</b>.") \
                % (escape_markup(username),),
            message_type=Gtk.MessageType.INFO,
            context_id=self.COMMENT_NOTIFICATION_CONTEXT_ID)

        def _comment_submit(widget):
            self._comment_submit(app, username, text)
        box.add_button(_("_Ok, cool!"), _comment_submit)

        def _send_comment():
            self._on_send_comment(None, app=app)
        def _logout_webservice(widget):
            self._logout_webservice(app, _send_comment)
        box.add_button(_("_No, logout!"), _logout_webservice)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)
예제 #10
0
    def _notify_vote_submit(self, app, username, vote):
        """
        Notify User about Comment submission with current credentials.
        """
        msg = ngettext("Rate <b>%s</b> as <b>%s</b>, with <b>%d</b> star?",
                       "Rate <b>%s</b> as <b>%s</b>, with <b>%d</b> stars?",
                       vote)
        msg = msg % (app.name, escape_markup(username), vote,)
        box = NotificationBox(msg,
            message_type=Gtk.MessageType.INFO,
            context_id=self.VOTE_NOTIFICATION_CONTEXT_ID)

        def _vote_submit(widget):
            self._vote_submit(app, username, vote)
        box.add_button(_("_Ok, cool!"), _vote_submit)

        def _send_vote():
            self._on_stars_clicked(self._stars, app=app)
        def _logout_webservice(widget):
            self._logout_webservice(app, _send_vote)
        box.add_button(_("_No, logout!"), _logout_webservice)

        box.add_destroy_button(_("_Later"))
        self._nc.append(box)