some fixes and improvements
This commit is contained in:
@@ -59,8 +59,6 @@ public int pkgcmp (Alpm.Package pkg1, Alpm.Package pkg2) {
|
||||
|
||||
public unowned Alpm.List<Alpm.Package?> search_all_dbs (Alpm.Handle handle, Alpm.List<string?> needles) {
|
||||
unowned Alpm.List<Alpm.Package?> syncpkgs = null;
|
||||
unowned Alpm.List<Alpm.Package?> tmp = null;
|
||||
unowned Alpm.List<Alpm.Package?> diff = null;
|
||||
unowned Alpm.List<Alpm.Package?> result = null;
|
||||
|
||||
result = handle.localdb.search (needles);
|
||||
@@ -69,15 +67,11 @@ public unowned Alpm.List<Alpm.Package?> search_all_dbs (Alpm.Handle handle, Alpm
|
||||
if (syncpkgs.length == 0)
|
||||
syncpkgs = db.search (needles);
|
||||
else {
|
||||
tmp = db.search (needles);
|
||||
diff = tmp.diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp);
|
||||
syncpkgs.join (diff);
|
||||
syncpkgs.join (db.search (needles).diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp));
|
||||
}
|
||||
}
|
||||
|
||||
diff = syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp);
|
||||
|
||||
result.join (diff);
|
||||
result.join (syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp));
|
||||
//result.sort ((Alpm.List.CompareFunc) pkgcmp);
|
||||
|
||||
return result;
|
||||
@@ -92,17 +86,7 @@ public unowned Alpm.List<Alpm.Package?> group_pkgs_all_dbs (Alpm.Handle handle,
|
||||
result.add (pkg);
|
||||
}
|
||||
|
||||
// FIX IT: provided methods don't work for syncdbs so it's done manually
|
||||
foreach (unowned Alpm.DB db in handle.syncdbs) {
|
||||
foreach (unowned Alpm.Package pkg in db.pkgcache) {
|
||||
foreach (string name in pkg.groups) {
|
||||
if (name == grp_name) {
|
||||
if (Alpm.pkg_find (result, pkg.name) == null)
|
||||
result.add (pkg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result.join (Alpm.find_group_pkgs (handle.syncdbs, grp_name).diff (result, (Alpm.List.CompareFunc) pkgcmp));
|
||||
|
||||
//result.sort ((Alpm.List.CompareFunc) pkgcmp);
|
||||
|
||||
@@ -111,25 +95,19 @@ public unowned Alpm.List<Alpm.Package?> group_pkgs_all_dbs (Alpm.Handle handle,
|
||||
|
||||
public unowned Alpm.List<Alpm.Package?> get_all_pkgs (Alpm.Handle handle) {
|
||||
unowned Alpm.List<Alpm.Package?> syncpkgs = null;
|
||||
unowned Alpm.List<Alpm.Package?> tmp = null;
|
||||
unowned Alpm.List<Alpm.Package?> diff = null;
|
||||
unowned Alpm.List<Alpm.Package?> result = null;
|
||||
|
||||
result = handle.localdb.pkgcache;
|
||||
result = handle.localdb.pkgcache.copy ();
|
||||
|
||||
foreach (unowned Alpm.DB db in handle.syncdbs) {
|
||||
if (syncpkgs.length == 0)
|
||||
syncpkgs = db.pkgcache;
|
||||
syncpkgs = db.pkgcache.copy ();
|
||||
else {
|
||||
tmp = db.pkgcache;
|
||||
diff = tmp.diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp);
|
||||
syncpkgs.join (diff);
|
||||
syncpkgs.join (db.pkgcache.diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp));
|
||||
}
|
||||
}
|
||||
|
||||
diff = syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp);
|
||||
|
||||
result.join (diff);
|
||||
result.join (syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp));
|
||||
//result.sort ((Alpm.List.CompareFunc) pkgcmp);
|
||||
|
||||
return result;
|
||||
|
@@ -74,12 +74,12 @@ namespace Pamac {
|
||||
previous_percent = 0;
|
||||
}
|
||||
|
||||
public async void write_config (HashTable<string,string> new_conf, GLib.BusName sender) {
|
||||
public void write_config (HashTable<string,string> new_conf, GLib.BusName sender) {
|
||||
var pamac_config = new Pamac.Config ("/etc/pamac.conf");
|
||||
try {
|
||||
Polkit.Authority authority = Polkit.Authority.get_sync (null);
|
||||
Polkit.Subject subject = Polkit.SystemBusName.new (sender);
|
||||
Polkit.AuthorizationResult result = yield authority.check_authorization (
|
||||
Polkit.AuthorizationResult result = authority.check_authorization_sync (
|
||||
subject,
|
||||
"org.manjaro.pamac.commit",
|
||||
null,
|
||||
@@ -94,11 +94,11 @@ namespace Pamac {
|
||||
}
|
||||
}
|
||||
|
||||
public async void set_pkgreason (string pkgname, uint reason, GLib.BusName sender) {
|
||||
public void set_pkgreason (string pkgname, uint reason, GLib.BusName sender) {
|
||||
try {
|
||||
Polkit.Authority authority = Polkit.Authority.get_sync (null);
|
||||
Polkit.Subject subject = Polkit.SystemBusName.new (sender);
|
||||
Polkit.AuthorizationResult result = yield authority.check_authorization (
|
||||
Polkit.AuthorizationResult result = authority.check_authorization_sync (
|
||||
subject,
|
||||
"org.manjaro.pamac.commit",
|
||||
null,
|
||||
@@ -483,6 +483,7 @@ namespace Pamac {
|
||||
public void trans_cancel () {
|
||||
handle.trans_interrupt ();
|
||||
handle.trans_release ();
|
||||
init_alpm_config ();
|
||||
}
|
||||
|
||||
public void quit () {
|
||||
|
@@ -21,7 +21,6 @@ namespace Pamac {
|
||||
|
||||
public class Installer: Gtk.Application {
|
||||
Transaction transaction;
|
||||
Pamac.Config pamac_config;
|
||||
bool pamac_run;
|
||||
|
||||
public Installer () {
|
||||
@@ -46,8 +45,7 @@ namespace Pamac {
|
||||
transaction_info_dialog.run ();
|
||||
transaction_info_dialog.hide ();
|
||||
} else {
|
||||
pamac_config = new Pamac.Config ("/etc/pamac.conf");
|
||||
transaction = new Pamac.Transaction (null, pamac_config);
|
||||
transaction = new Pamac.Transaction (null);
|
||||
transaction.finished.connect (on_emit_trans_finished);
|
||||
this.hold ();
|
||||
}
|
||||
|
@@ -49,8 +49,12 @@ namespace Pamac {
|
||||
}
|
||||
|
||||
public override void activate () {
|
||||
if (pamac_run == false)
|
||||
if (pamac_run == false) {
|
||||
manager_window.present ();
|
||||
while (Gtk.events_pending ())
|
||||
Gtk.main_iteration ();
|
||||
manager_window.show_all_pkgs ();
|
||||
}
|
||||
}
|
||||
|
||||
public override void shutdown () {
|
||||
|
@@ -59,8 +59,6 @@ namespace Pamac {
|
||||
[GtkChild]
|
||||
public TreeView search_treeview;
|
||||
[GtkChild]
|
||||
public TreeSelection search_treeview_selection;
|
||||
[GtkChild]
|
||||
public TreeView groups_treeview;
|
||||
[GtkChild]
|
||||
public TreeView states_treeview;
|
||||
@@ -93,27 +91,29 @@ namespace Pamac {
|
||||
[GtkChild]
|
||||
public Button cancel_button;
|
||||
|
||||
public Gtk.Menu right_click_menu;
|
||||
public Gtk.MenuItem deselect_item;
|
||||
public Gtk.MenuItem install_item;
|
||||
public Gtk.MenuItem remove_item;
|
||||
public Gtk.SeparatorMenuItem separator_item;
|
||||
public Gtk.MenuItem reinstall_item;
|
||||
public Gtk.MenuItem install_optional_deps_item;
|
||||
public Gtk.MenuItem explicitly_installed_item;
|
||||
public GLib.List<Pamac.Package> selected_pkgs;
|
||||
// menu
|
||||
Gtk.Menu right_click_menu;
|
||||
Gtk.MenuItem deselect_item;
|
||||
Gtk.MenuItem install_item;
|
||||
Gtk.MenuItem remove_item;
|
||||
Gtk.SeparatorMenuItem separator_item;
|
||||
Gtk.MenuItem reinstall_item;
|
||||
Gtk.MenuItem install_optional_deps_item;
|
||||
Gtk.MenuItem explicitly_installed_item;
|
||||
GLib.List<Pamac.Package> selected_pkgs;
|
||||
|
||||
public ListStore search_list;
|
||||
public ListStore groups_list;
|
||||
public ListStore states_list;
|
||||
public ListStore repos_list;
|
||||
public ListStore deps_list;
|
||||
public ListStore details_list;
|
||||
// liststore
|
||||
ListStore search_list;
|
||||
ListStore groups_list;
|
||||
ListStore states_list;
|
||||
ListStore repos_list;
|
||||
ListStore deps_list;
|
||||
ListStore details_list;
|
||||
|
||||
PackagesModel packages_list;
|
||||
HashTable<string, Json.Array> aur_results;
|
||||
|
||||
public Pamac.Config pamac_config;
|
||||
Pamac.Config pamac_config;
|
||||
public Transaction transaction;
|
||||
|
||||
public SortInfo sortinfo;
|
||||
@@ -177,7 +177,8 @@ namespace Pamac {
|
||||
|
||||
pamac_config = new Pamac.Config ("/etc/pamac.conf");
|
||||
|
||||
transaction = new Pamac.Transaction (this as ApplicationWindow, pamac_config);
|
||||
transaction = new Pamac.Transaction (this as ApplicationWindow);
|
||||
transaction.check_aur = pamac_config.enable_aur;
|
||||
transaction.finished.connect (on_emit_trans_finished);
|
||||
|
||||
history_dialog = new HistoryDialog (this);
|
||||
@@ -201,9 +202,18 @@ namespace Pamac {
|
||||
cancel_button.set_sensitive (sensitive);
|
||||
}
|
||||
|
||||
public void show_all_pkgs () {
|
||||
this.get_window ().set_cursor (new Gdk.Cursor (Gdk.CursorType.WATCH));
|
||||
populate_packages_list (get_all_pkgs (transaction.handle));
|
||||
this.get_window ().set_cursor (null);
|
||||
}
|
||||
|
||||
public void update_lists () {
|
||||
string[] grps = {};
|
||||
TreeIter iter;
|
||||
TreeSelection selection;
|
||||
selection = repos_treeview.get_selection ();
|
||||
selection.changed.disconnect (on_repos_treeview_selection_changed);
|
||||
foreach (unowned DB db in transaction.handle.syncdbs) {
|
||||
repos_list.insert_with_values (out iter, -1, 0, db.name);
|
||||
foreach (unowned Group grp in db.groupcache) {
|
||||
@@ -213,14 +223,29 @@ namespace Pamac {
|
||||
}
|
||||
}
|
||||
repos_list.insert_with_values (out iter, -1, 0, dgettext (null, "local"));
|
||||
repos_list.get_iter_first (out iter);
|
||||
selection.select_iter (iter);
|
||||
selection.changed.connect_after (on_repos_treeview_selection_changed);
|
||||
|
||||
selection = groups_treeview.get_selection ();
|
||||
selection.changed.disconnect (on_groups_treeview_selection_changed);
|
||||
foreach (string name in grps)
|
||||
groups_list.insert_with_values (out iter, -1, 0, name);
|
||||
groups_list.set_sort_column_id (0, SortType.ASCENDING);
|
||||
groups_list.get_iter_first (out iter);
|
||||
selection.select_iter (iter);
|
||||
selection.changed.connect_after (on_groups_treeview_selection_changed);
|
||||
|
||||
selection = states_treeview.get_selection ();
|
||||
selection.changed.disconnect (on_states_treeview_selection_changed);
|
||||
states_list.insert_with_values (out iter, -1, 0, dgettext (null, "Installed"));
|
||||
//states_list.insert_with_values (out iter, -1, 0, dgettext (null, "Uninstalled"));
|
||||
states_list.insert_with_values (out iter, -1, 0, dgettext (null, "Orphans"));
|
||||
states_list.insert_with_values (out iter, -1, 0, dgettext (null, "To install"));
|
||||
states_list.insert_with_values (out iter, -1, 0, dgettext (null, "To remove"));
|
||||
states_list.get_iter_first (out iter);
|
||||
selection.select_iter (iter);
|
||||
selection.changed.connect_after (on_states_treeview_selection_changed);
|
||||
}
|
||||
|
||||
public void set_infos_list (Pamac.Package pkg) {
|
||||
@@ -654,11 +679,10 @@ namespace Pamac {
|
||||
|
||||
void on_explicitly_installed_item_activate () {
|
||||
foreach (Pamac.Package pkg in selected_pkgs) {
|
||||
transaction.set_pkgreason.begin (pkg.name, PkgReason.EXPLICIT, (obj, res) => {
|
||||
transaction.set_pkgreason.end (res);
|
||||
refresh_packages_list ();
|
||||
});
|
||||
transaction.set_pkgreason (pkg.name, PkgReason.EXPLICIT);
|
||||
}
|
||||
transaction.refresh_alpm_config ();
|
||||
refresh_packages_list ();
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
@@ -833,7 +857,7 @@ namespace Pamac {
|
||||
search_pkgs.begin (search_string, (obj, res) => {
|
||||
Json.Array aur_pkgs;
|
||||
unowned Alpm.List<Alpm.Package?> pkgs = search_pkgs.end (res, out aur_pkgs);
|
||||
if (pkgs.length != 0) {
|
||||
if (pkgs.length != 0 || aur_pkgs.get_length () != 0) {
|
||||
// add search string in search_list if needed
|
||||
bool found = false;
|
||||
TreeIter? iter;
|
||||
@@ -855,27 +879,28 @@ namespace Pamac {
|
||||
if ((string) line == search_string) {
|
||||
found = true;
|
||||
// block the signal to not populate when we select the iter in search_list
|
||||
search_treeview_selection.changed.disconnect (on_search_treeview_selection_changed);
|
||||
selection.changed.disconnect (on_search_treeview_selection_changed);
|
||||
selection.select_iter (_iter);
|
||||
search_treeview_selection.changed.connect_after (on_search_treeview_selection_changed);
|
||||
selection.changed.connect_after (on_search_treeview_selection_changed);
|
||||
populate_packages_list (pkgs, aur_pkgs);
|
||||
}
|
||||
return found;
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if (found == false) {
|
||||
search_list.insert_with_values (out iter, -1, 0, search_string);
|
||||
// block the signal to not populate when we select the iter in search_list
|
||||
search_treeview_selection.changed.disconnect (on_search_treeview_selection_changed);
|
||||
selection.changed.disconnect (on_search_treeview_selection_changed);
|
||||
selection.select_iter (iter);
|
||||
search_treeview_selection.changed.connect_after (on_search_treeview_selection_changed);
|
||||
selection.changed.connect_after (on_search_treeview_selection_changed);
|
||||
populate_packages_list (pkgs, aur_pkgs);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
// populate with empty lists
|
||||
populate_packages_list (pkgs, aur_pkgs);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,15 +980,11 @@ namespace Pamac {
|
||||
} else if (state == dgettext (null, "Installed")) {
|
||||
pkgs = transaction.handle.localdb.pkgcache;
|
||||
} else if (state == dgettext (null, "Uninstalled")) {
|
||||
unowned Alpm.List<Alpm.Package?> tmp = null;
|
||||
unowned Alpm.List<Alpm.Package?> diff = null;
|
||||
foreach (unowned DB db in transaction.handle.syncdbs) {
|
||||
if (pkgs.length == 0)
|
||||
pkgs = db.pkgcache;
|
||||
pkgs = db.pkgcache.copy ();
|
||||
else {
|
||||
tmp = db.pkgcache;
|
||||
diff = tmp.diff (pkgs, (Alpm.List.CompareFunc) pkgcmp);
|
||||
pkgs.join (diff);
|
||||
pkgs.join (db.pkgcache.diff (pkgs, (Alpm.List.CompareFunc) pkgcmp));
|
||||
}
|
||||
}
|
||||
} else if (state == dgettext (null, "Orphans")) {
|
||||
@@ -1094,11 +1115,9 @@ namespace Pamac {
|
||||
if (refresh_period != pamac_config.refresh_period)
|
||||
new_conf.insert ("RefreshPeriod", refresh_period.to_string ());
|
||||
if (new_conf.size () != 0) {
|
||||
transaction.write_config.begin (new_conf, (obj, res) => {
|
||||
transaction.write_config.end (res);
|
||||
pamac_config.reload ();
|
||||
search_aur_button.set_active (pamac_config.enable_aur);
|
||||
});
|
||||
transaction.write_config (new_conf);
|
||||
pamac_config.reload ();
|
||||
search_aur_button.set_active (pamac_config.enable_aur);
|
||||
}
|
||||
}
|
||||
preferences_dialog.hide ();
|
||||
|
@@ -24,8 +24,8 @@ using Alpm;
|
||||
namespace Pamac {
|
||||
[DBus (name = "org.manjaro.pamac")]
|
||||
public interface Daemon : Object {
|
||||
public abstract async void write_config (HashTable<string,string> new_conf) throws IOError;
|
||||
public abstract async void set_pkgreason (string pkgname, uint reason) throws IOError;
|
||||
public abstract void write_config (HashTable<string,string> new_conf) throws IOError;
|
||||
public abstract void set_pkgreason (string pkgname, uint reason) throws IOError;
|
||||
public abstract void refresh (int force, bool emit_signal) throws IOError;
|
||||
public abstract ErrorInfos trans_init (TransFlag transflags) throws IOError;
|
||||
public abstract ErrorInfos trans_sysupgrade (int enable_downgrade) throws IOError;
|
||||
@@ -59,7 +59,6 @@ namespace Pamac {
|
||||
public string[] holdpkg;
|
||||
public string[] ignorepkg;
|
||||
public Handle handle;
|
||||
public Pamac.Config pamac_config;
|
||||
|
||||
public Alpm.TransFlag flags;
|
||||
// those hashtables will be used as set
|
||||
@@ -81,6 +80,9 @@ namespace Pamac {
|
||||
bool sysupgrade_after_build;
|
||||
int build_status;
|
||||
int enable_downgrade;
|
||||
public bool check_aur;
|
||||
UpdatesInfos[] aur_updates;
|
||||
bool aur_checked;
|
||||
|
||||
Terminal term;
|
||||
Pty pty;
|
||||
@@ -94,9 +96,8 @@ namespace Pamac {
|
||||
|
||||
public signal void finished (bool error);
|
||||
|
||||
public Transaction (ApplicationWindow? window, Pamac.Config pamac_config) {
|
||||
public Transaction (ApplicationWindow? window) {
|
||||
refresh_alpm_config ();
|
||||
this.pamac_config = pamac_config;
|
||||
mode = Mode.MANAGER;
|
||||
flags = Alpm.TransFlag.CASCADE;
|
||||
to_add = new HashTable<string, string> (str_hash, str_equal);
|
||||
@@ -142,19 +143,22 @@ namespace Pamac {
|
||||
sysupgrade_after_trans = false;
|
||||
sysupgrade_after_build = false;
|
||||
build_status = 0;
|
||||
check_aur = false;
|
||||
aur_updates = {};
|
||||
aur_checked = false;
|
||||
}
|
||||
|
||||
public async void write_config (HashTable<string,string> new_conf) {
|
||||
public void write_config (HashTable<string,string> new_conf) {
|
||||
try {
|
||||
yield daemon.write_config (new_conf);
|
||||
daemon.write_config (new_conf);
|
||||
} catch (IOError e) {
|
||||
stderr.printf ("IOError: %s\n", e.message);
|
||||
}
|
||||
}
|
||||
|
||||
public async void set_pkgreason (string pkgname, PkgReason reason) {
|
||||
public void set_pkgreason (string pkgname, PkgReason reason) {
|
||||
try {
|
||||
yield daemon.set_pkgreason (pkgname, (uint) reason);
|
||||
daemon.set_pkgreason (pkgname, (uint) reason);
|
||||
refresh_alpm_config ();
|
||||
} catch (IOError e) {
|
||||
stderr.printf ("IOError: %s\n", e.message);
|
||||
@@ -247,8 +251,11 @@ namespace Pamac {
|
||||
} else {
|
||||
UpdatesInfos[] updates = get_repos_updates (handle, ignorepkg);
|
||||
uint repos_updates_len = updates.length;
|
||||
if (pamac_config.enable_aur) {
|
||||
UpdatesInfos[] aur_updates = get_aur_updates (handle, ignorepkg);
|
||||
if (check_aur) {
|
||||
if (aur_checked == false) {
|
||||
aur_updates = get_aur_updates (handle, ignorepkg);
|
||||
aur_checked = true;
|
||||
}
|
||||
if (aur_updates.length != 0) {
|
||||
clear_lists ();
|
||||
if (repos_updates_len != 0)
|
||||
@@ -749,22 +756,32 @@ namespace Pamac {
|
||||
}
|
||||
if (total_download > 0) {
|
||||
fraction = (float) (xfered + already_downloaded) / total_download;
|
||||
textbar = "%s/%s".printf (format_size (xfered + already_downloaded), format_size (total_download));
|
||||
if (fraction > 0)
|
||||
textbar = "%s/%s".printf (format_size (xfered + already_downloaded), format_size (total_download));
|
||||
else
|
||||
textbar = "%s".printf (format_size (xfered + already_downloaded));
|
||||
} else {
|
||||
fraction = (float) xfered / total;
|
||||
textbar = "%s/%s".printf (format_size (xfered), format_size (total));
|
||||
if (fraction > 0)
|
||||
textbar = "%s/%s".printf (format_size (xfered), format_size (total));
|
||||
else
|
||||
textbar = "%s".printf (format_size (xfered));
|
||||
}
|
||||
if (fraction != previous_percent) {
|
||||
previous_percent = fraction;
|
||||
progress_dialog.progressbar.set_fraction (fraction);
|
||||
}
|
||||
|
||||
if (fraction > 0) {
|
||||
if (fraction != previous_percent) {
|
||||
previous_percent = fraction;
|
||||
progress_dialog.progressbar.set_fraction (fraction);
|
||||
}
|
||||
} else
|
||||
progress_dialog.progressbar.set_fraction (0);
|
||||
if (textbar != previous_textbar) {
|
||||
previous_textbar = textbar;
|
||||
progress_dialog.progressbar.set_text (textbar);
|
||||
}
|
||||
if (xfered == total)
|
||||
if (xfered == total) {
|
||||
already_downloaded += total;
|
||||
previous_filename = "";
|
||||
}
|
||||
}
|
||||
|
||||
void on_emit_totaldownload (uint64 total) {
|
||||
|
@@ -47,17 +47,17 @@ namespace Pamac {
|
||||
updates_list = new Gtk.ListStore (2, typeof (string), typeof (string));
|
||||
updates_treeview.set_model (updates_list);
|
||||
|
||||
transaction = new Transaction (this as ApplicationWindow, pamac_config);
|
||||
transaction = new Transaction (this as ApplicationWindow);
|
||||
transaction.mode = Mode.UPDATER;
|
||||
transaction.check_aur = pamac_config.enable_aur;
|
||||
transaction.finished.connect (on_emit_trans_finished);
|
||||
|
||||
preferences_dialog = new PreferencesDialog (this as ApplicationWindow);
|
||||
|
||||
top_label.set_markup("<b>%s</b>".printf (dgettext (null, "Your system is up-to-date")));
|
||||
bottom_label.set_visible (false);
|
||||
apply_button.set_sensitive (false);
|
||||
|
||||
transaction.refresh (0);
|
||||
on_refresh_button_clicked ();
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
@@ -84,11 +84,9 @@ namespace Pamac {
|
||||
if (refresh_period != pamac_config.refresh_period)
|
||||
new_conf.insert ("RefreshPeriod", refresh_period.to_string ());
|
||||
if (new_conf.size () != 0) {
|
||||
transaction.write_config.begin (new_conf, (obj, res) => {
|
||||
transaction.write_config.end (res);
|
||||
pamac_config.reload ();
|
||||
set_updates_list.begin ();
|
||||
});
|
||||
transaction.write_config (new_conf);
|
||||
pamac_config.reload ();
|
||||
set_updates_list.begin ();
|
||||
}
|
||||
}
|
||||
preferences_dialog.hide ();
|
||||
@@ -118,12 +116,7 @@ namespace Pamac {
|
||||
}
|
||||
|
||||
public void on_emit_trans_finished (bool error) {
|
||||
while (Gtk.events_pending ())
|
||||
Gtk.main_iteration ();
|
||||
set_updates_list.begin ((obj, res) => {
|
||||
set_updates_list.end (res);
|
||||
this.get_window ().set_cursor (null);
|
||||
});
|
||||
set_updates_list.begin ();
|
||||
}
|
||||
|
||||
public async void set_updates_list () {
|
||||
@@ -132,6 +125,10 @@ namespace Pamac {
|
||||
string size;
|
||||
uint64 dsize = 0;
|
||||
uint updates_nb = 0;
|
||||
this.get_window ().set_cursor (new Gdk.Cursor (Gdk.CursorType.WATCH));
|
||||
while (Gtk.events_pending ())
|
||||
Gtk.main_iteration ();
|
||||
top_label.set_markup ("");
|
||||
updates_list.clear ();
|
||||
// get syncfirst updates
|
||||
UpdatesInfos[] syncfirst_updates = get_syncfirst_updates (transaction.handle, transaction.syncfirst);
|
||||
@@ -147,6 +144,8 @@ namespace Pamac {
|
||||
updates_list.insert_with_values (out iter, -1, 0, name, 1, size);
|
||||
}
|
||||
} else {
|
||||
while (Gtk.events_pending ())
|
||||
Gtk.main_iteration ();
|
||||
UpdatesInfos[] updates = get_repos_updates (transaction.handle, transaction.ignorepkg);
|
||||
foreach (UpdatesInfos infos in updates) {
|
||||
name = infos.name + " " + infos.version;
|
||||
@@ -187,6 +186,10 @@ namespace Pamac {
|
||||
bottom_label.set_visible (true);
|
||||
} else
|
||||
bottom_label.set_visible (false);
|
||||
|
||||
this.get_window ().set_cursor (null);
|
||||
while (Gtk.events_pending ())
|
||||
Gtk.main_iteration ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user