diff --git a/gui/manager.glade b/gui/manager.glade index 65d7bed..1d23f8a 100644 --- a/gui/manager.glade +++ b/gui/manager.glade @@ -666,6 +666,7 @@ 0 True False + @@ -681,10 +682,10 @@ True 1 - + 5 0 - + 2 @@ -1137,24 +1138,6 @@ - - - - - - - - - - - - - - - - - - @@ -1175,6 +1158,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/pamac-refresh.py b/pamac-refresh.py index 4cceec0..3ab8306 100755 --- a/pamac-refresh.py +++ b/pamac-refresh.py @@ -23,5 +23,9 @@ if not common.pid_file_exists(): bus = dbus.SystemBus() bus.add_signal_receiver(reply, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionDone") bus.add_signal_receiver(error, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionError") - transaction.Refresh() - loop.run() + try: + transaction.Refresh() + except: + pass + else: + loop.run() diff --git a/pamac/main.py b/pamac/main.py index cc25918..4c5acd2 100644 --- a/pamac/main.py +++ b/pamac/main.py @@ -923,23 +923,72 @@ class Handler: current_filter = ('search', search_entry.get_text().split()) set_packages_list() - #~ def on_list_treeview_button_press_event(self, treeview, event): - #~ if event.button == 1: # left click - #~ treepath, viewcolumn, x, y = treeview.get_path_at_pos(int(event.x), int(event.y)) - #~ treeiter = packages_list.get_iter(treepath) - #~ if treeiter: - #~ if packages_list[treeiter][0] != _('No package found'): - #~ if packages_list[treeiter][0] in transaction.localpkgs.keys(): - #~ set_infos_list(transaction.localpkgs[packages_list[treeiter][0]]) - #~ set_deps_list(transaction.localpkgs[packages_list[treeiter][0]], "local") - #~ set_details_list(transaction.localpkgs[packages_list[treeiter][0]], "local") - #~ set_files_list(transaction.localpkgs[packages_list[treeiter][0]]) - #~ files_scrolledwindow.set_visible(True) - #~ elif packages_list[treeiter][0] in transaction.syncpkgs.keys(): - #~ set_infos_list(transaction.syncpkgs[packages_list[treeiter][0]]) - #~ set_deps_list(transaction.syncpkgs[packages_list[treeiter][0]], "sync") - #~ set_details_list(transaction.syncpkgs[packages_list[treeiter][0]], "sync") - #~ files_scrolledwindow.set_visible(False) + menu = Gtk.Menu() + def on_list_treeview_button_press_event(self, treeview, event): + def mark_to_reinstall(widget, treeiter): + packages_list[treeiter][3] = True + packages_list[treeiter][4] = to_install_icon + transaction.to_add.add(packages_list[treeiter][0]) + def select_optdeps(widget, pkgname, optdeps): + choose_label.set_markup(_('{pkgname} has {number} uninstalled optional deps.\nPlease choose the one(s) you want to install:').format(pkgname = pkgname, number = str(len(optdeps)))) + choose_list.clear() + for long_string in optdeps: + choose_list.append([False, long_string]) + ChooseDialog.run() + for long_string in transaction.to_provide: + transaction.to_add.add(long_string.split(':')[0]) + def install_with_optdeps(widget, treeiter, pkgname, optdeps): + select_optdeps(widget, pkgname, optdeps) + mark_to_reinstall(widget, treeiter) + # Check if right mouse button was clicked + if event.type == Gdk.EventType.BUTTON_PRESS and event.button == 3: + treepath, viewcolumn, x, y = treeview.get_path_at_pos(int(event.x), int(event.y)) + treeiter = packages_list.get_iter(treepath) + if treeiter: + if packages_list[treeiter][0] != _('No package found'): + self.menu = Gtk.Menu() + if packages_list[treeiter][0] in transaction.to_remove | transaction.to_add: + item = Gtk.MenuItem(_('Unselect')) + item.connect('activate', self.on_select_toggle_toggled, treeiter) + self.menu.append(item) + elif packages_list[treeiter][0] in transaction.localpkgs.keys(): + item = Gtk.MenuItem(_('Remove')) + item.connect('activate', self.on_select_toggle_toggled, treeiter) + self.menu.append(item) + item = Gtk.MenuItem(_('Reinstall')) + item.connect('activate', mark_to_reinstall, treeiter) + self.menu.append(item) + optdeps_strings = transaction.localpkgs[packages_list[treeiter][0]].optdepends + if optdeps_strings: + available_optdeps = [] + for optdep_string in optdeps_strings: + optdep = optdep_string.split(':')[0] + if not optdep in transaction.localpkgs.keys(): + available_optdeps.append(optdep_string) + if available_optdeps: + item = Gtk.MenuItem(_('Install optional deps')) + item.connect('activate', select_optdeps, packages_list[treeiter][0], available_optdeps) + self.menu.append(item) + else: + item = Gtk.ImageMenuItem(_('Install')) + item.connect('activate', self.on_select_toggle_toggled, treeiter) + self.menu.append(item) + optdeps_strings = transaction.syncpkgs[packages_list[treeiter][0]].optdepends + if optdeps_strings: + available_optdeps = [] + for optdep_string in optdeps_strings: + optdep = optdep_string.split(':')[0] + if not optdep in transaction.localpkgs.keys(): + available_optdeps.append(optdep_string) + if available_optdeps: + item = Gtk.MenuItem(_('Install with optional deps')) + item.connect('activate', install_with_optdeps, treeiter, packages_list[treeiter][0], available_optdeps) + self.menu.append(item) + treeview.grab_focus() + treeview.set_cursor(treepath, viewcolumn, 0) + self.menu.show_all() + self.menu.popup(None, None, None, None, event.button, event.time) + return True def on_list_treeview_selection_changed(self, treeview): if not packages_list_clearing: @@ -1000,9 +1049,13 @@ class Handler: current_filter = ('repo', repos_list[line][0]) set_packages_list() - def on_cellrenderertoggle1_toggled(self, widget, line): + def on_select_toggle_toggled(self, widget, line): if packages_list[line][1] is True: - if packages_list[line][0] in transaction.to_remove: + if packages_list[line][0] in transaction.to_add: + packages_list[line][3] = True + packages_list[line][4] = installed_icon + transaction.to_add.discard(packages_list[line][0]) + elif packages_list[line][0] in transaction.to_remove: packages_list[line][3] = True packages_list[line][4] = installed_icon transaction.to_remove.discard(packages_list[line][0]) diff --git a/policy_translation b/policy_translation deleted file mode 100644 index 3a33ffd..0000000 --- a/policy_translation +++ /dev/null @@ -1,13 +0,0 @@ -Authentication is required -Autenticació requerida -Autentificering er krævet -Authentifikation wird benötigt -Απαιτείται πιστοποίηση -Se requiere autentificación -Authentification nécessaire -È richiesta l'autenticazione -Autentifisering er krevd -Autentyfikacja jest wymagana -Autenticação é necessária -Este necesară autentificarea -Yetkilendirme Gerekiyor