def search_button_clicked(self, widget=None):
        """
        Reload the subscriptions from the server when the Search button
        is clicked.
        """
        if not self.date_picker.date_entry_validate():
            return
        try:
            pb_title = _("Searching")
            pb_label = _("Searching for subscriptions. Please wait.")
            if self.pb:
                self.pb.set_title(pb_title)
                self.pb.set_label(pb_label)
            else:
                # show pulsating progress bar while we wait for results
                self.pb = progress.Progress(pb_title, pb_label)
                self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
                self.pb.set_transient_for(self.parent_win)

            # fire off async refresh
            async_stash = async .AsyncPool(self.pool_stash)
            async_stash.refresh(self.date_picker.date, self._update_display)
        except Exception as e:
            handle_gui_exception(
                e, _("Error fetching subscriptions from server:  %s"),
                self.parent_win)
Exemple #2
0
 def _display_progress_bar(self):
     if self.progress_bar:
         self.progress_bar.set_title(_("Testing Connection"))
         self.progress_bar.set_label(_("Please wait"))
     else:
         self.progress_bar = progress.Progress(_("Testing Connection"), _("Please wait"))
         self.timer = gobject.timeout_add(100, self.progress_bar.pulse)
         self.progress_bar.set_parent_window(self.dlg)
 def _display_progress_bar(self):
     if self.progress_bar:
         self.progress_bar.set_title(_("Testing Connection"))
         self.progress_bar.set_label(_("Please wait"))
     else:
         self.progress_bar = progress.Progress(_("Testing Connection"), _("Please wait"))
         self.timer = ga_GObject.timeout_add(100, self.progress_bar.pulse)
         self.progress_bar.set_transient_for(self.networkConfigDialog)
Exemple #4
0
    def _on_unsubscribe_prompt_response(self, dialog, response, selection):
        if not response:
            return

        serial = int(selection['serial'])

        if self.identity.is_valid():
            self.pb = progress.Progress(_("Removing"),
                    _("Removing subscription. Please wait."))
            self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
            self.pb.set_transient_for(self.parent_win)
            self.async_bind.unbind(serial, selection, self._unsubscribe_callback, self._handle_unbind_exception)
        else:
            # unregistered, just delete the certs directly
            action = EntCertDeleteAction(self.entitlement_dir)
            action.perform([serial])
        self.update_subscriptions()
    def _on_unsubscribe_prompt_response(self, dialog, response, selection):
        if not response:
            return

        serial = long(selection['serial'])

        if self.identity.is_valid():
            self.pb = progress.Progress(
                _("Removing"), _("Removing subscription. Please wait."))
            self.timer = gobject.timeout_add(100, self.pb.pulse)
            self.pb.set_parent_window(
                self.content.get_parent_window().get_user_data())
            self.async_bind.unbind(serial, selection,
                                   self._unsubscribe_callback,
                                   self._handle_unbind_exception)
        else:
            # unregistered, just delete the certs directly
            self.backend.entcertlib.delete([serial])
            self.backend.cs.force_cert_check()
    def _contract_selected(self, pool, quantity=1):
        if not valid_quantity(quantity):
            show_error_window(_("Quantity must be a positive number."),
                              parent=self.parent_win)
            return

        self._contract_selection_cancelled()

        # Start the progress bar
        self.pb = progress.Progress(_("Attaching"),
                                    _("Attaching subscription. Please wait."))
        self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
        self.pb.set_transient_for(self.parent_win)
        # Spin off a thread to handle binding the selected pool.
        # After it has completed the actual bind call, available
        # subs will be refreshed, but we won't re-run compliance
        # until we have serialized the certificates
        self.async_bind.bind(
            pool,
            quantity,
            bind_callback=self._async_bind_callback,
            cert_callback=self.backend.cs.force_cert_check,
            except_callback=self._async_bind_exception_callback)
Exemple #7
0
 def _show_progress_bar(self, title, label, progress_parent=None):
     self.pb = progress.Progress(title, label, True)
     self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
     self.pb.set_transient_for(progress_parent or self._get_dialog_widget())
 def setUp(self):
     self.pw = progress.Progress("test title", "this is a test label")