예제 #1
0
    def _on_infobar_response(self, infobar: Gtk.InfoBar, response):
        if response == Gtk.ResponseType.YES and not self.spices.processing_jobs:
            self.spices.refresh_cache()
            pass

        infobar.set_revealed(False)
        self.search_entry.grab_focus()
예제 #2
0
파일: toolwindow.py 프로젝트: awacha/cct
 def on_infobar_response(self, infobar: Gtk.InfoBar, response=Gtk.ResponseType):
     self.infolabel.set_label('')
     self.infoimage.set_from_icon_name('image-missing', Gtk.IconSize.DIALOG)
     infobar.hide()
     assert isinstance(self.widget, Gtk.Window)
     self.widget.resize(1, 1)  # shrink the window back.
     return False
예제 #3
0
 def thread_error(self, thread: Any, errno: int, errname: str, trace: str,
                  threadbox: Gtk.InfoBar):
     threadbox.get_action_area().get_children()[1].hide()  # Pause button
     pb = threadbox.get_content_area().get_children()[0].get_children()[1]
     pb.set_text(_('Error: %s') % errname)
     b = threadbox.add_button(_('Details'), 11)
     b.connect('clicked', self.show_traceback, errno, errname, trace)
     b.show()
     self.to_remove.append(threadbox)
예제 #4
0
    def on_info_bar_response(self, info_bar: Gtk.InfoBar, response: int):
        """React to the user responding to a Gtk.InfoBar.

        Args:
            info_bar (Gtk.InfoBar): The Gtk.InfoBar that received the response
            response (int): The response id (Gtk.ResponseType)
        """
        if response == Gtk.ResponseType.CLOSE:
            info_bar.set_revealed(False)
            GLib.timeout_add(250, info_bar.set_visible, False)
예제 #5
0
    def add(self, notif: Gtk.InfoBar):
        """Add a new notification widget to self.
        Automatically handles the CLOSE reponse.

        Args:
            notif (Gtk.InfoBar): The widget
        """
        def callback(widget, resp):
            if resp == Gtk.ResponseType.CLOSE:
                notif.unparent()

        notif.connect('response', callback)

        self.append(notif)
 def _delete_event_dialog_response_cb(info_bar: Gtk.InfoBar,
                                      response: int):
     GLib.source_remove(source_id)
     info_bar.disconnect(self._delete_event_dialog_response_handler_id)
     self._info_bar.props.revealed = False
     if response == Gtk.ResponseType.CANCEL:
         return
     elif response == Gtk.ResponseType.OK:
         if self._download_manager.props.running:
             self._download_manager.disconnect(
                 self._download_manager_finished_changed_handler_id)
             # hookup signal to downloadmanager running property
             self._download_manager.connect("notify::running",
                                            self._delete_event_killer)
             # stop it manually
             self._download_manager.stop()
 def _refill_info_bar(info_bar: Gtk.InfoBar, message_type: Gtk.MessageType,
                      text: str):
     info_bar.set_message_type(message_type)
     content: Gtk.Box = info_bar.get_content_area()
     for c in content.get_children():
         content.remove(c)
     lbl: Gtk.Label = Gtk.Label.new(text)
     lbl.set_line_wrap(True)
     content.add(lbl)
     info_bar.set_revealed(True)
     info_bar.show_all()
예제 #8
0
 def thread_stopped(self, thread: Any, threadbox: Gtk.InfoBar):
     threadbox.hide()
예제 #9
0
 def thread_resume(self, thread: Any, threadbox: Gtk.InfoBar):
     pb = threadbox.get_content_area().get_children()[0].get_children()[1]
     txt = pb.get_text()
     if txt.find(self.paused_text):
         txt = txt[:-len(self.paused_text)]
         pb.set_text(txt)
예제 #10
0
 def thread_pause(self, thread: Any, threadbox: Gtk.InfoBar):
     pb = threadbox.get_content_area().get_children()[0].get_children()[1]
     txt = pb.get_text()
     txt += self.paused_text
     pb.set_text(txt)
예제 #11
0
파일: app.py 프로젝트: varzhou/CoBang
 def on_info_bar_response(self, infobar: Gtk.InfoBar, response_id: int):
     infobar.set_visible(False)
예제 #12
0
파일: view.py 프로젝트: J-Arun-Mani/Scream
    def close_infobar(self, infobar: Gtk.InfoBar, response=None):

        infobar.set_revealed(False)