Commit deda8208 authored by guinux's avatar guinux

implement build functions

parent fb4827a3
......@@ -76,6 +76,16 @@ msgstr ""
msgid "%s: requires %s"
msgstr ""
#: ../src/daemon.vala
#, c-format
msgid "%s: installing %s (%s) breaks dependency '%s'"
msgstr ""
#: ../src/daemon.vala
#, c-format
msgid "%s: removing %s breaks dependency '%s'"
msgstr ""
#: ../src/daemon.vala
#, c-format
msgid "%s and %s are in conflict"
......@@ -119,6 +129,10 @@ msgstr ""
msgid "A Gtk3 frontend for libalpm"
msgstr ""
#: ../src/transaction.vala
msgid "Copy"
msgstr ""
#: ../src/transaction.vala
msgid "Refreshing mirrors list"
msgstr ""
......@@ -169,7 +183,8 @@ msgid "Total download size"
msgstr ""
#: ../src/transaction.vala
msgid "Building packages"
#, c-format
msgid "Building %s"
msgstr ""
#: ../src/transaction.vala
......@@ -349,11 +364,11 @@ msgstr ""
msgid "Your system is up-to-date"
msgstr ""
#: ../src/tray.vala
#: ../src/tray.vala ../src/updater_window.vala
msgid "Update Manager"
msgstr ""
#: ../src/tray.vala
#: ../src/tray.vala ../src/manager_window.vala
msgid "Package Manager"
msgstr ""
......@@ -536,6 +551,10 @@ msgstr ""
msgid "How often to check for updates, value in hours"
msgstr ""
#: ../src/preferences_dialog.vala ../resources/preferences_dialog.ui
msgid "Number of versions of each package to keep in the cache"
msgstr ""
#: ../src/preferences_dialog.vala
msgid "Worldwide"
msgstr ""
......@@ -593,10 +612,6 @@ msgstr ""
msgid "Search"
msgstr ""
#: ../resources/manager_window.ui
msgid "Search in AUR"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "State"
msgstr ""
......@@ -711,14 +726,6 @@ msgstr ""
msgid "Check for updates from AUR"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "Do not ask for confirmation when building packages"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "Number of versions of each package to keep in the cache"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "Remove only the versions of uninstalled packages"
msgstr ""
......
......@@ -638,24 +638,6 @@ All AUR users should be familiar with the build process.</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="no_confirm_build_checkbutton">
<property name="label" translatable="yes">Do not ask for confirmation when building packages</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="margin_left">24</property>
<property name="margin_start">24</property>
<property name="hexpand">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="name">aur</property>
......
......@@ -32,6 +32,9 @@ namespace Pamac {
public UpdateInfos[] to_downgrade;
public UpdateInfos[] to_reinstall;
public UpdateInfos[] to_remove;
public UpdateInfos[] to_build;
public UpdateInfos[] aur_conflicts_to_remove;
public string[] aur_pkgbases_to_build;
}
public struct Updates {
......
This diff is collapsed.
......@@ -55,7 +55,7 @@ namespace Pamac {
transaction.important_details_outpout.connect (on_important_details_outpout);
progress_dialog.box.pack_start (transaction.progress_box);
progress_dialog.box.reorder_child (transaction.progress_box, 0);
progress_dialog.expander.add (transaction.term_grid);
progress_dialog.expander.add (transaction.term_window);
progress_dialog.close_button.clicked.connect (on_close_button_clicked);
progress_dialog.close_button.visible = false;
this.hold ();
......
......@@ -151,6 +151,7 @@ namespace Pamac {
transaction_running = false;
generate_mirrors_list = false;
this.title = dgettext (null, "Package Manager");
Timeout.add (100, populate_window);
}
......@@ -277,6 +278,7 @@ namespace Pamac {
transaction = new Transaction (this as Gtk.ApplicationWindow);
transaction.mode = Mode.MANAGER;
transaction.start_transaction.connect (on_start_transaction);
transaction.start_building.connect (on_start_building);
transaction.important_details_outpout.connect (on_important_details_outpout);
transaction.finished.connect (on_transaction_finished);
transaction.write_pamac_config_finished.connect (on_write_pamac_config_finished);
......@@ -284,13 +286,10 @@ namespace Pamac {
transaction.generate_mirrors_list.connect (on_generate_mirrors_list);
// integrate progress box and term widget
main_stack.add_named (transaction.term_grid, "term");
main_stack.add_named (transaction.term_window, "term");
transaction_infobox.pack_start (transaction.progress_box);
AlpmPackage pkg = transaction.find_installed_satisfier ("yaourt");
if (pkg.name != "") {
support_aur (transaction.enable_aur);
}
support_aur (transaction.enable_aur);
display_package_queue = new Queue<string> ();
......@@ -307,16 +306,18 @@ namespace Pamac {
void on_write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur) {
AlpmPackage pkg = transaction.find_installed_satisfier ("yaourt");
if (pkg.name != "") {
support_aur (enable_aur);
}
support_aur (enable_aur);
}
void on_set_pkgreason_finished () {
refresh_packages_list ();
if (main_stack.visible_child_name == "details") {
display_package_properties (current_package_displayed);
if (transaction.get_installed_pkg (current_package_displayed).name != ""
|| transaction.get_sync_pkg (current_package_displayed).name != "") {
display_package_properties (current_package_displayed);
} else {
display_aur_properties (current_package_displayed);
}
}
}
......@@ -335,14 +336,16 @@ namespace Pamac {
uint total_pending = transaction.to_install.length + transaction.to_remove.length + transaction.to_build.length;
if (total_pending == 0) {
transaction.progress_box.action_label.label = "";
cancel_button.sensitive = false;
apply_button.sensitive = false;
if (important_details) {
transaction_infobox.show_all ();
} else {
transaction_infobox.visible = false;
}
} else {
string info = dngettext (null, "%u pending operation", "%u pending operations", total_pending).printf (total_pending);
transaction.progress_box.action_label.label = info;
cancel_button.sensitive = true;
apply_button.sensitive = true;
// fix an possible visibility issue
transaction_infobox.show_all ();
}
......@@ -413,6 +416,7 @@ namespace Pamac {
details_grid.attach_next_to (box, label, Gtk.PositionType.RIGHT);
} else {
var label2 = new Gtk.Label (detail);
label2.use_markup = true;
label2.halign = Gtk.Align.START;
details_grid.attach_next_to (label2, label, Gtk.PositionType.RIGHT);
}
......@@ -541,7 +545,16 @@ namespace Pamac {
details_grid.attach_next_to (box, label, Gtk.PositionType.RIGHT);
previous_widget = label as Gtk.Widget;
}
previous_widget = populate_details_grid (dgettext (null, "Packager"), details.packager, previous_widget);
// make packager mail clickable
string[] splitted = details.packager.split ("<", 2);
string packager_name = splitted[0];
if (splitted.length > 1) {
string packager_mail = splitted[1].split (">", 2)[0];
string packager_detail = "%s <a href=\"mailto:%s\">%s</a>".printf (packager_name, packager_mail, packager_mail);
previous_widget = populate_details_grid (dgettext (null, "Packager"), packager_detail, previous_widget);
} else {
previous_widget = populate_details_grid (dgettext (null, "Packager"), details.packager, previous_widget);
}
previous_widget = populate_details_grid (dgettext (null, "Build Date"), details.builddate, previous_widget);
if (details.installdate != "") {
previous_widget = populate_details_grid (dgettext (null, "Install Date"), details.installdate, previous_widget);
......@@ -863,7 +876,7 @@ namespace Pamac {
void display_aur_properties (string pkgname) {
current_package_displayed = pkgname;
files_scrolledwindow.visible = false;
set_aur_details (pkgname);
set_aur_details (current_package_displayed);
}
[GtkCallback]
......@@ -1480,11 +1493,18 @@ namespace Pamac {
case "browse":
button_back.visible = false;
filters_stackswitcher.visible = true;
details_button.sensitive = true;
break;
case "details":
button_back.visible = true;
filters_stackswitcher.visible = false;
details_button.sensitive = true;
break;
case "term":
filters_stackswitcher.visible = false;
button_back.visible = true;
details_button.get_style_context ().remove_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
details_button.sensitive = false;
break;
default:
break;
......@@ -1555,7 +1575,6 @@ namespace Pamac {
[GtkCallback]
void on_details_button_clicked () {
details_button.get_style_context ().remove_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
important_details = false;
if (transaction_running) {
main_stack.visible_child_name = "term";
......@@ -1597,7 +1616,12 @@ namespace Pamac {
set_pendings_operations ();
refresh_packages_list ();
if (main_stack.visible_child_name == "details") {
display_package_properties (current_package_displayed);
if (transaction.get_installed_pkg (current_package_displayed).name != ""
|| transaction.get_sync_pkg (current_package_displayed).name != "") {
display_package_properties (current_package_displayed);
} else {
display_aur_properties (current_package_displayed);
}
}
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
......@@ -1618,6 +1642,10 @@ namespace Pamac {
cancel_button.sensitive = false;
}
void on_start_building () {
cancel_button.sensitive = true;
}
void on_important_details_outpout (bool must_show) {
if (must_show) {
main_stack.visible_child_name = "term";
......@@ -1637,7 +1665,12 @@ namespace Pamac {
void on_transaction_finished (bool success) {
refresh_packages_list ();
if (main_stack.visible_child_name == "details") {
display_package_properties (current_package_displayed);
if (transaction.get_installed_pkg (current_package_displayed).name != ""
|| transaction.get_sync_pkg (current_package_displayed).name != "") {
display_package_properties (current_package_displayed);
} else {
display_aur_properties (current_package_displayed);
}
} else if (main_stack.visible_child_name == "term") {
button_back.visible = true;
}
......@@ -1646,15 +1679,11 @@ namespace Pamac {
if (success) {
transaction_running = true;
transaction.sysupgrade (false);
} else {
apply_button.sensitive = true;
}
refreshing = false;
} else {
transaction_running = false;
generate_mirrors_list = false;
cancel_button.sensitive = true;
apply_button.sensitive = true;
}
set_pendings_operations ();
}
......
......@@ -28,7 +28,6 @@ namespace Pamac {
public bool enable_aur { get; private set; }
public bool search_aur { get; private set; }
public bool check_aur_updates { get; private set; }
public bool no_confirm_build { get; private set; }
public unowned HashTable<string,string> environment_variables {
get {
return _environment_variables;
......@@ -73,7 +72,6 @@ namespace Pamac {
enable_aur = false;
search_aur = false;
check_aur_updates = false;
no_confirm_build = false;
parse_file (conf_path);
}
......@@ -113,8 +111,6 @@ namespace Pamac {
search_aur = true;
} else if (key == "CheckAURUpdates") {
check_aur_updates = true;
} else if (key == "NoConfirmBuild") {
no_confirm_build = true;
}
}
} catch (GLib.Error e) {
......@@ -203,17 +199,6 @@ namespace Pamac {
} else {
data.append (line + "\n");
}
} else if (line.contains ("NoConfirmBuild")) {
if (new_conf.lookup_extended ("NoConfirmBuild", null, out variant)) {
if (variant.get_boolean ()) {
data.append ("NoConfirmBuild\n");
} else {
data.append ("#NoConfirmBuild\n");
}
new_conf.remove ("NoConfirmBuild");
} else {
data.append (line + "\n");
}
} else {
data.append (line + "\n");
}
......@@ -265,12 +250,6 @@ namespace Pamac {
} else {
data.append ("#CheckAURUpdates\n");
}
} else if (key == "NoConfirmBuild") {
if (val.get_boolean ()) {
data.append ("NoConfirmBuild\n");
} else {
data.append ("#NoConfirmBuild\n");
}
}
}
}
......
......@@ -47,16 +47,12 @@ namespace Pamac {
[GtkChild]
Gtk.Button generate_mirrors_list_button;
[GtkChild]
Gtk.Box aur_config_box;
[GtkChild]
Gtk.Switch enable_aur_button;
[GtkChild]
Gtk.CheckButton search_aur_checkbutton;
[GtkChild]
Gtk.CheckButton check_aur_updates_checkbutton;
[GtkChild]
Gtk.CheckButton no_confirm_build_checkbutton;
[GtkChild]
Gtk.Label cache_keep_nb_label;
[GtkChild]
Gtk.SpinButton cache_keep_nb_spin_button;
......@@ -132,22 +128,14 @@ namespace Pamac {
transaction.write_mirrors_config_finished.connect (on_write_mirrors_config_finished);
}
pkg = transaction.find_installed_satisfier ("yaourt");
if (pkg.name == "") {
aur_config_box.visible = false;
} else {
enable_aur_button.active = transaction.enable_aur;
search_aur_checkbutton.active = transaction.search_aur;
search_aur_checkbutton.sensitive = transaction.enable_aur;
check_aur_updates_checkbutton.active = transaction.check_aur_updates;
check_aur_updates_checkbutton.sensitive = transaction.enable_aur;
no_confirm_build_checkbutton.active = transaction.no_confirm_build;
no_confirm_build_checkbutton.sensitive = transaction.enable_aur;
enable_aur_button.state_set.connect (on_enable_aur_button_state_set);
search_aur_checkbutton.toggled.connect (on_search_aur_checkbutton_toggled);
check_aur_updates_checkbutton.toggled.connect (on_check_aur_updates_checkbutton_toggled);
no_confirm_build_checkbutton.toggled.connect (on_no_confirm_build_checkbutton_toggled);
}
enable_aur_button.active = transaction.enable_aur;
search_aur_checkbutton.active = transaction.search_aur;
search_aur_checkbutton.sensitive = transaction.enable_aur;
check_aur_updates_checkbutton.active = transaction.check_aur_updates;
check_aur_updates_checkbutton.sensitive = transaction.enable_aur;
enable_aur_button.state_set.connect (on_enable_aur_button_state_set);
search_aur_checkbutton.toggled.connect (on_search_aur_checkbutton_toggled);
check_aur_updates_checkbutton.toggled.connect (on_check_aur_updates_checkbutton_toggled);
}
bool on_remove_unrequired_deps_button_state_set (bool new_state) {
......@@ -203,15 +191,8 @@ namespace Pamac {
transaction.start_write_pamac_config (new_pamac_conf);
}
void on_no_confirm_build_checkbutton_toggled () {
var new_pamac_conf = new HashTable<string,Variant> (str_hash, str_equal);
new_pamac_conf.insert ("NoConfirmBuild", new Variant.boolean (no_confirm_build_checkbutton.active));
transaction.start_write_pamac_config (new_pamac_conf);
}
void on_write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur, bool check_aur_updates,
bool no_confirm_build) {
bool enable_aur, bool search_aur, bool check_aur_updates) {
remove_unrequired_deps_button.state = recurse;
if (refresh_period == 0) {
check_updates_button.state = false;
......@@ -234,8 +215,6 @@ namespace Pamac {
search_aur_checkbutton.sensitive = enable_aur;
check_aur_updates_checkbutton.active = check_aur_updates;
check_aur_updates_checkbutton.sensitive = enable_aur;
no_confirm_build_checkbutton.active = no_confirm_build;
no_confirm_build_checkbutton.sensitive = enable_aur;
}
bool on_check_space_button_state_set (bool new_state) {
......
......@@ -27,7 +27,6 @@ namespace Pamac {
[GtkChild]
public Gtk.Label action_label;
public ProgressBox () {
Object ();
}
......
This diff is collapsed.
......@@ -75,6 +75,7 @@ namespace Pamac {
important_details = false;
generate_mirrors_list = false;
headerbar.title = dgettext (null, "Update Manager");
Timeout.add (100, populate_window);
}
......@@ -89,13 +90,14 @@ namespace Pamac {
transaction = new Transaction (this as Gtk.ApplicationWindow);
transaction.mode = Mode.UPDATER;
transaction.start_transaction.connect (on_start_transaction);
transaction.start_building.connect (on_start_building);
transaction.important_details_outpout.connect (on_important_details_output);
transaction.finished.connect (populate_updates_list);
transaction.get_updates_finished.connect (on_get_updates_finished);
transaction.generate_mirrors_list.connect (on_generate_mirrors_list);
// integrate progress box and term widget
stack.add_named (transaction.term_grid, "term");
stack.add_named (transaction.term_window, "term");
transaction_infobox.pack_start (transaction.progress_box);
// A timeout is needed to let the time to the daemon to deal
......@@ -264,6 +266,10 @@ namespace Pamac {
cancel_button.sensitive = false;
}
void on_start_building () {
cancel_button.sensitive = true;
}
void on_important_details_output (bool must_show) {
if (must_show) {
stackswitcher.visible = false;
......@@ -300,7 +306,7 @@ namespace Pamac {
}
void on_get_updates_finished (Updates updates) {
headerbar.title = "";
headerbar.title = dgettext (null, "Update Manager");
repos_updates_list.clear ();
stackswitcher.visible = false;
repos_scrolledwindow.visible = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment