def handle_updates(update_data): syncfirst, updates = update_data if transaction_done: exiting('') elif updates: transaction.ErrorDialog.format_secondary_text(_('Some updates are available.\nPlease update your system first')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() exiting('') else: transaction.action_handler(_('Preparing')+'...') transaction.icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png') while Gtk.events_pending(): Gtk.main_iteration() common.write_pid_file() transaction.interface.connect_signals(signals) transaction.config_dbus_signals() pkgs_to_install = argv[1:] install(pkgs_to_install)
def handle_updates(update_data): syncfirst, updates = update_data if transaction_done: exiting('') elif updates: transaction.ErrorDialog.format_secondary_text( _('Some updates are available.\nPlease update your system first')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() exiting('') else: transaction.action_handler(_('Preparing') + '...') transaction.icon_handler( '/usr/share/pamac/icons/24x24/status/package-setup.png') while Gtk.events_pending(): Gtk.main_iteration() common.write_pid_file() transaction.interface.connect_signals(signals) transaction.config_dbus_signals() pkgs_to_install = argv[1:] install(pkgs_to_install)
'on_UpdaterWindow_delete_event' : on_UpdaterWindow_delete_event, 'on_UpdaterPreferencesButton_clicked': on_UpdaterPreferencesButton_clicked, 'on_Updater_ApplyButton_clicked' : on_Updater_ApplyButton_clicked, 'on_Updater_RefreshButton_clicked' : on_Updater_RefreshButton_clicked, 'on_Updater_CloseButton_clicked' : on_Updater_CloseButton_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") bus.add_signal_receiver(reload_config, dbus_interface = "org.manjaro.pamac", signal_name = "EmitReloadConfig") if common.pid_file_exists(): transaction.ErrorDialog.format_secondary_text(_('Pamac is already running')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() else: common.write_pid_file() interface.connect_signals(signals) transaction.get_dbus_methods() transaction.config_dbus_signals() config_dbus_signals() UpdaterWindow.show() UpdaterWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) while Gtk.events_pending(): Gtk.main_iteration() transaction.refresh() Gtk.main()
bus.add_signal_receiver(reload_config, dbus_interface="org.manjaro.pamac", signal_name="EmitReloadConfig") if common.pid_file_exists(): transaction.ErrorDialog.format_secondary_text( _('Pamac is already running')) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() else: common.write_pid_file() interface.connect_signals(signals) transaction.get_dbus_methods() transaction.config_dbus_signals() config_dbus_signals() state_column.set_cell_data_func(state_rendererpixbuf, state_column_display_func) name_column.set_cell_data_func(name_renderertext, name_column_display_func) version_column.set_cell_data_func(version_renderertext, version_column_display_func) repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func) size_column.set_cell_data_func(size_renderertext, size_column_display_func) transaction.get_handle() update_lists() ManagerWindow.show() #ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) #transaction.refresh() while Gtk.events_pending(): Gtk.main_iteration()