def on_ProgressCloseButton_clicked(*args): UpdaterWindow.get_window().set_cursor(None) transaction.progress_buffer.delete( transaction.progress_buffer.get_start_iter(), transaction.progress_buffer.get_end_iter()) transaction.need_details_handler(False) transaction.get_updates()
def handle_reply(reply): if transaction.to_build: transaction.build_next() elif reply: transaction.ProgressCloseButton.set_visible(True) transaction.action_icon.set_from_icon_name('dialog-information', Gtk.IconSize.BUTTON) transaction.progress_label.set_text(str(reply)) transaction.progress_bar.set_text('') end_iter = transaction.progress_buffer.get_end_iter() transaction.progress_buffer.insert(end_iter, str(reply)) else: transaction.get_updates() transaction.Release() transaction.get_handle() transaction.mark_needed_pkgs_as_dep() transaction.to_add.clear() transaction.to_remove.clear() transaction.to_update.clear() transaction.to_load.clear() ManagerValidButton.set_sensitive(False) ManagerCancelButton.set_sensitive(False) global search_dict global groups_dict global states_dict global repos_dict search_dict = {} groups_dict = {} states_dict = {} repos_dict = {} if current_filter[0]: refresh_packages_list(current_filter[0](current_filter[1]))
def do_sysupgrade(): global transaction_type """Upgrade a system like pacman -Su""" if transaction.t_lock is False: transaction_type = "update" do_syncfirst, updates = transaction.get_updates() if updates: transaction.to_add = [] transaction.to_remove = [] check_conflicts(updates) if do_syncfirst: for pkg in updates: transaction.to_add.append(pkg.name) if transaction.init_transaction(recurse=True): for pkgname in transaction.to_add: transaction.Add(pkgname) for pkgname in transaction.to_remove: transaction.Remove(pkgname) error = transaction.Prepare() if error: handle_error(error) else: transaction.get_to_remove() transaction.get_to_add() set_transaction_sum() if mode == "updater": if len(transaction.to_add) + len(transaction.to_remove) != 0: ConfDialog.show_all() else: finalize() if mode == "manager": ConfDialog.show_all() else: if transaction.init_transaction(noconflicts=True): error = transaction.Sysupgrade() if error: handle_error(error) else: for pkgname in transaction.to_add: transaction.Add(pkgname) for pkgname in transaction.to_remove: transaction.Remove(pkgname) error = transaction.Prepare() if error: handle_error(error) else: transaction.get_to_remove() transaction.get_to_add() set_transaction_sum() if mode == "updater": if len(transaction.to_add) + len(transaction.to_remove) != 0: ConfDialog.show_all() else: finalize() if mode == "manager": ConfDialog.show_all()
def handle_reply(reply): while Gtk.events_pending(): Gtk.main_iteration() if transaction.to_build: transaction.build_next() elif reply: transaction.Release() transaction.ProgressCloseButton.set_visible(True) transaction.action_icon.set_from_icon_name('dialog-information', Gtk.IconSize.BUTTON) transaction.progress_label.set_text(str(reply)) transaction.progress_bar.set_text('') end_iter = transaction.progress_buffer.get_end_iter() transaction.progress_buffer.insert(end_iter, str(reply)) transaction.get_handle() else: UpdaterWindow.get_window().set_cursor(None) transaction.get_handle() transaction.get_updates() transaction.mark_needed_pkgs_as_dep()
def have_updates(): do_syncfirst, updates = transaction.get_updates() update_listore.clear() update_label.set_justify(Gtk.Justification.CENTER) if not updates: update_listore.append(["", ""]) update_label.set_markup("<big><b>No update available</b></big>") return False else: for pkg in updates: pkgname = pkg.name + " " + pkg.version update_listore.append([pkgname, common.format_size(pkg.size)]) update_label.set_markup("<big><b>Available updates</b></big>") return True
def on_ProgressCloseButton_clicked(*args): UpdaterWindow.get_window().set_cursor(None) transaction.progress_buffer.delete(transaction.progress_buffer.get_start_iter(),transaction.progress_buffer.get_end_iter()) transaction.need_details_handler(False) transaction.get_updates()
def reload_config(msg): config.pamac_conf.reload() transaction.get_updates()
'on_ProgressCancelButton_clicked': on_ProgressCancelButton_clicked } def config_dbus_signals(): bus = dbus.SystemBus() bus.add_signal_receiver(handle_reply, dbus_interface="org.manjaro.pamac", signal_name="EmitTransactionDone") bus.add_signal_receiver(handle_error, dbus_interface="org.manjaro.pamac", signal_name="EmitTransactionError") bus.add_signal_receiver(handle_updates, dbus_interface="org.manjaro.pamac", signal_name="EmitAvailableUpdates") if common.pid_file_exists(): transaction.ErrorDialog.format_secondary_text( _('Pamac is already running')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() else: transaction_done = False transaction.get_handle() transaction.get_dbus_methods() config_dbus_signals() transaction.get_updates() Gtk.main()
signals = {'on_ChooseButton_clicked' : transaction.on_ChooseButton_clicked, 'on_progress_textview_size_allocate' : transaction.on_progress_textview_size_allocate, 'on_choose_renderertoggle_toggled' : transaction.on_choose_renderertoggle_toggled, 'on_PreferencesCloseButton_clicked' : transaction.on_PreferencesCloseButton_clicked, 'on_PreferencesWindow_delete_event' : transaction.on_PreferencesWindow_delete_event, 'on_PreferencesValidButton_clicked' : transaction.on_PreferencesValidButton_clicked, 'on_TransValidButton_clicked' :on_TransValidButton_clicked, 'on_TransCancelButton_clicked' :on_TransCancelButton_clicked, 'on_ProgressCloseButton_clicked' : on_ProgressCloseButton_clicked, 'on_ProgressCancelButton_clicked' : on_ProgressCancelButton_clicked} def config_dbus_signals(): bus = dbus.SystemBus() bus.add_signal_receiver(handle_reply, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionDone") bus.add_signal_receiver(handle_error, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionError") bus.add_signal_receiver(handle_updates, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates") if common.pid_file_exists(): transaction.ErrorDialog.format_secondary_text(_('Pamac is already running')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() else: transaction_done = False transaction.get_handle() transaction.get_dbus_methods() config_dbus_signals() transaction.get_updates() Gtk.main()