Python gi.repository.Gtk.ProgressBar() Examples

The following are 13 code examples of gi.repository.Gtk.ProgressBar(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module gi.repository.Gtk , or try the search function .
Example #1
Source File: mail.py    From king-phisher with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
		self.label = Gtk.Label(label='Send')
		"""The :py:class:`Gtk.Label` representing this tabs name."""
		super(MailSenderSendTab, self).__init__(*args, **kwargs)
		self.textview = self.gobjects['textview_mail_sender_progress']
		"""The :py:class:`Gtk.TextView` object that renders text status messages."""
		self.textview.modify_font(Pango.FontDescription(self.config['text_font']))
		self.textbuffer = self.textview.get_buffer()
		"""The :py:class:`Gtk.TextBuffer` instance associated with :py:attr:`~.MailSenderSendTab.textview`."""
		self.textbuffer_iter = self.textbuffer.get_start_iter()
		self.progressbar = self.gobjects['progressbar_mail_sender']
		"""The :py:class:`Gtk.ProgressBar` instance which is used to display progress of sending messages."""
		self.pause_button = self.gobjects['togglebutton_mail_sender_pause']
		self.sender_thread = None
		"""The :py:class:`.MailSenderThread` instance that is being used to send messages."""
		self.application.connect('exit', self.signal_kpc_exit)
		self.application.connect('exit-confirm', self.signal_kpc_exit_confirm)
		self.textview.connect('populate-popup', self.signal_textview_populate_popup) 
Example #2
Source File: search_widget.py    From addons-source with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, label):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        slb = ScrolledListBox(max_height=200)
        slb.set_policy(Gtk.PolicyType.NEVER,
                       Gtk.PolicyType.AUTOMATIC)

        self.list_box = slb.list_box
        self.list_box.set_activate_on_single_click(True)
        self.list_box.set_sort_func(self.sort_func)

        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        panel_lable = Gtk.Label(label=_('<b>%s:</b>') % label)
        panel_lable.set_use_markup(True)
        vbox.add(panel_lable)
        self.progress_bar = Gtk.ProgressBar()
        self.progress_bar.set_show_text(True)
        vbox.add(self.progress_bar)

        self.add(vbox)
        self.add(slb) 
Example #3
Source File: list.py    From Authenticator with GNU General Public License v2.0 5 votes vote down vote up
def _build_widgets(self):
        self.otp_progress_bar = Gtk.ProgressBar()
        self.add(self.otp_progress_bar)
        AccountsManager.get_default().connect(
            "counter_updated", self._on_counter_updated)

        self.accounts_container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.accounts_container.get_style_context().add_class("accounts-container")
        accounts_scrolled = Gtk.ScrolledWindow()
        accounts_scrolled.add_with_viewport(self.accounts_container)
        self.pack_start(accounts_scrolled, True, True, 0) 
Example #4
Source File: kano_progress.py    From kano-toolset with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, pulse=True, rate=0.01):

        Gtk.ProgressBar.__init__(self)
        self.activity_mode = pulse
        self.still_working = True
        self.progress_rate = rate

        if self.activity_mode:
            self.pulse()
        else:
            self.set_fraction(0.0)

        GObject.timeout_add(50, self.on_timeout, None) 
Example #5
Source File: kano_progress.py    From kano-toolset with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, pulse=True, title="", rate=0.01):
        apply_colours_to_screen()
        apply_styling_to_screen(self.CSS_PATH)

        ProgressBar.__init__(self, pulse, rate)
        self.get_style_context().add_class("KanoProgressBar")

        self.win = Gtk.Window()
        self.win.get_style_context().add_class("KanoProgressBar")
        self.win.set_decorated(False)
        self.win.set_resizable(False)
        self.win.set_position(Gtk.WindowPosition.CENTER)
        self.win.connect("delete-event", Gtk.main_quit)

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.win.add(box)

        label = Gtk.Label(title)
        label.set_padding(10, 10)
        label.get_style_context().add_class("KanoProgressBar")
        box.pack_start(label, False, False, 5)
        box.pack_start(self, False, False, 0) 
Example #6
Source File: filechooser.py    From deskcon-desktop with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent):
        Gtk.Dialog.__init__(self, "Filetransfer", parent, 0)            

        self.set_default_size(150, 50)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_transient_for(parent)

        label = Gtk.Label("Transfering Files ...")
        self.progressbar = Gtk.ProgressBar()

        box = self.get_content_area()
        box.add(label)
        box.add(self.progressbar)
        self.show_all() 
Example #7
Source File: progress.py    From pyWinUSB with MIT License 5 votes vote down vote up
def __create_window(self):
        box = Gtk.VBox(spacing=8)
        self.add(box)

        # Pasek postępu
        self.progress_bar = Gtk.ProgressBar()
        self.progress_bar.set_show_text(True)
        box.pack_start(self.progress_bar, True, True, 0)

        # Pasek statusu
        self.status_bar = Gtk.Statusbar()
        self.status_context = self.status_bar.get_context_id("Status")
        box.pack_start(self.status_bar, True, True, 0) 
Example #8
Source File: wizard.py    From syncthing-gtk with GNU General Public License v2.0 5 votes vote down vote up
def init_page(self):
		""" Displayed while wizard downloads and extracts daemon """
		self.label = WrappedLabel("<b>" + _("Downloading Syncthing daemon.") + "</b>")
		self.version = WrappedLabel(_("Please wait..."))
		self.pb = Gtk.ProgressBar()
		self.label.props.margin_bottom = 15
		self.target = None
		self.attach(self.label,		0, 0, 1, 1)
		self.attach(self.version,	0, 1, 1, 1)
		self.attach(self.pb,		0, 2, 1, 1) 
Example #9
Source File: file_dialog.py    From bokken with GNU General Public License v2.0 5 votes vote down vote up
def get_file(self, widget):
        import re
        import ui.gtk3.common

        # Disable all the interface and Ok button.
        self.hbox.set_sensitive(False)
        self.options_hbox.set_sensitive(False)
        self.butt_ok.set_sensitive(False)

        # Progress bar
        self.progress_box = Gtk.VBox(False, 0)
        self.hseparator4 = Gtk.HSeparator()
        self.progress_bar = Gtk.ProgressBar()
        self.progress_box.pack_start(self.hseparator4, False, False, 0)
        self.progress_box.pack_start(self.progress_bar, False, False, 0)

        self.main_vbox.pack_start(self.progress_box, False, False, 2)
        self.progress_box.show_all()

        ui.gtk3.common.repaint()

        self.file = self.input_entry.get_child().get_text()
        if not re.match('^[a-z]+://', self.file):
            # It's a local file.
            self.manager.add_item('file://' + self.file)
        self.get_options()
        self.response(0) 
Example #10
Source File: gtk.py    From bups with MIT License 5 votes vote down vote up
def __init__(self, manager, parent=None):
		Gtk.Window.__init__(self, title=_("Backup"))
		self.set_border_width(10)
		self.set_icon_name("drive-harddisk")
		self.set_position(Gtk.WindowPosition.CENTER)

		if parent is not None:
			self.set_transient_for(parent)

		vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
		self.add(vbox)

		self.label = Gtk.Label(_("Ready."), xalign=0)
		self.label.set_justify(Gtk.Justification.LEFT)
		vbox.pack_start(self.label, False, False, 0)

		self.progressbar = Gtk.ProgressBar()
		vbox.pack_start(self.progressbar, False, False, 0)

		self.textview = Gtk.TextView()
		#self.textview.modify_bg(Gtk.StateType.NORMAL, Gdk.Color(0, 0, 0))
		#self.textview.modify_text(Gtk.StateType.NORMAL, Gdk.Color(255, 255, 255))
		fontdesc = Pango.FontDescription("monospace")
		self.textview.modify_font(fontdesc)
		self.textview.set_editable(False)
		sw = Gtk.ScrolledWindow()
		sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
		sw.set_min_content_height(200)
		sw.add(self.textview)
		exp = Gtk.Expander()
		exp.set_label(_("Details"))
		exp.add(sw)
		vbox.pack_start(exp, True, True, 0)

		hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=50)
		vbox.add(hbox)
		self.close_button = Gtk.Button(_("Close"))
		self.close_button.connect("clicked", self.on_close_clicked)
		hbox.pack_end(self.close_button, False, False, 0)

		self.manager = manager 
Example #11
Source File: widgets.py    From zim-desktop-wiki with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, op):
		'''Constructor
		@param parent: either a parent gtk widget or C{None}. Only used to
		set the dialog on top of the right parent window
		@param op: operation that supports a "step" signal, a "finished" signal
		and a "run_on_idle" method - see L{NotebookOperation} for the default
		implementation
		'''
		self.op = op
		self._total = None
		self.cancelled = False
		GObject.GObject.__init__(self)
		self.set_transient_for(get_window(parent))
		self.set_modal(True)
		self.add_button(CANCEL_STR, Gtk.ResponseType.CANCEL) # T: Button label
		self.set_border_width(10)
		self.vbox.set_spacing(5)
		self.set_default_size(300, 0)

		label = Gtk.Label()
		label.set_markup('<b>' + encode_markup_text(op.message) + '</b>')
		label.set_alignment(0.0, 0.5)
		self.vbox.pack_start(label, False, True, 0)

		self.progressbar = Gtk.ProgressBar()
		self.vbox.pack_start(self.progressbar, False, True, 0)

		self.msg_label = Gtk.Label()
		self.msg_label.set_alignment(0.0, 0.5)
		self.msg_label.set_ellipsize(Pango.EllipsizeMode.START)
		self.vbox.pack_start(self.msg_label, False, True, 0)

		self.op.connect('step', self.on_step)
		self.op.connect('finished', self.on_finished) 
Example #12
Source File: progressdialog.py    From lplayer with MIT License 4 votes vote down vote up
def __init__(self, title, parent):
        Gtk.Dialog.__init__(self, title, parent,
                            Gtk.DialogFlags.MODAL |
                            Gtk.DialogFlags.DESTROY_WITH_PARENT)
        self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
        self.set_size_request(330, 30)
        self.set_resizable(False)
        self.set_icon_from_file(comun.ICON)
        self.connect('destroy', self.close)
        self.set_modal(True)
        vbox = Gtk.VBox(spacing=5)
        vbox.set_border_width(5)
        self.get_content_area().add(vbox)
        #
        frame1 = Gtk.Frame()
        vbox.pack_start(frame1, True, True, 0)
        grid = Gtk.Grid()

        grid.set_margin_top(10)
        grid.set_margin_bottom(10)
        grid.set_margin_left(10)
        grid.set_margin_right(10)
        grid.set_column_spacing(5)
        grid.set_row_spacing(5)
        frame1.add(grid)
        #
        self.label = Gtk.Label()
        grid.attach(self.label, 0, 0, 2, 1)

        self.progressbar = Gtk.ProgressBar()
        self.progressbar.set_size_request(300, 0)
        grid.attach(self.progressbar, 0, 1, 2, 1)

        button_stop = Gtk.Button()
        button_stop.set_size_request(40, 40)
        button_stop.set_image(
            Gtk.Image.new_from_stock(Gtk.STOCK_STOP, Gtk.IconSize.BUTTON))
        button_stop.connect('clicked', self.on_button_stop_clicked)
        grid.attach(button_stop, 3, 0, 1, 2)

        self.number_of_elements_processed = 0
        self.number_of_elements = 0
        self.show_all() 
Example #13
Source File: discovererDialog.py    From pychess with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, discoverer):
        self.discoverer = discoverer
        self.widgets = uistuff.GladeWidgets("discovererDialog.glade")

        # =======================================================================
        # Clear glade defaults
        # =======================================================================
        for child in self.widgets["enginesTable"].get_children():
            self.widgets["enginesTable"].remove(child)

        self.finished = False
        self.throbber = None
        self.nameToBar = {}

        discoverer.pre_discover()
        binnames = self.discoverer.toBeRechecked.keys()
        if len(binnames) == 0:
            self.finished = True
        # ======================================================================
        # Insert the names to be discovered
        # ======================================================================
        for i, name in enumerate(binnames):
            label = Gtk.Label(label=name + ":")
            label.props.xalign = 1
            self.widgets["enginesTable"].attach(label, 0, 1, i, i + 1)
            bar = Gtk.ProgressBar()
            self.widgets["enginesTable"].attach(bar, 1, 2, i, i + 1)
            self.nameToBar[name] = bar

        # =======================================================================
        # Add throbber
        # =======================================================================

        self.throbber = Gtk.Spinner()
        self.throbber.set_size_request(50, 50)
        self.widgets["throbberDock"].add(self.throbber)

        # =======================================================================
        # Show the window
        # =======================================================================
        self.widgets["discovererDialog"].set_position(
            Gtk.WindowPosition.CENTER_ON_PARENT)
        self.widgets["discovererDialog"].show_all()
        self.throbber.start()