@@ -18,7 +18,7 @@ | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
// Compile with: valac --pkg=libalpm --vapidir=../vapi --Xcc=-I../util ../util/alpm-util.c pactree.vala -o pactree | |||
// Compile with: valac --pkg=libalpm --vapidir=../vapi pactree.vala | |||
using Alpm; | |||
@@ -37,10 +37,10 @@ string leaf2_color; | |||
string color_off; | |||
/* globals */ | |||
unowned Handle? handle; | |||
Handle handle; | |||
unowned DB localdb; | |||
Alpm.List<string?> walked = null; | |||
Alpm.List<string?> provisions = null; | |||
Alpm.List<string> walked; | |||
Alpm.List<string> provisions; | |||
/* options */ | |||
bool color; | |||
@@ -127,7 +127,7 @@ static int parse_options(ref unowned string[] args) { | |||
static void local_init() { | |||
Alpm.Errno error; | |||
handle = Handle.new ("/", dbpath, out error); | |||
handle = new Handle ("/", dbpath, out error); | |||
assert (error == 0); | |||
localdb = handle.localdb; | |||
assert (localdb != null); | |||
@@ -187,11 +187,11 @@ static void walk_reverse_deps(Package pkg, int depth) { | |||
if((max_depth >= 0) && (depth > max_depth)) return; | |||
walked.add(pkg.name); | |||
Alpm.List<string?> *required_by = pkg.compute_requiredby(); | |||
Alpm.List<string> required_by = pkg.compute_requiredby(); | |||
int i = 0; | |||
while (i < required_by->length) { | |||
string? pkgname = required_by->nth_data(i); | |||
unowned Alpm.List<string> list = required_by; | |||
while (list != null) { | |||
unowned string pkgname = list.data; | |||
if (walked.find_str(pkgname) != null) { | |||
/* if we've already seen this package, don't print in "unique" output | |||
* and don't recurse */ | |||
@@ -202,9 +202,9 @@ static void walk_reverse_deps(Package pkg, int depth) { | |||
print(pkg.name, pkgname, null, depth); | |||
walk_reverse_deps(localdb.get_pkg(pkgname), depth + 1); | |||
} | |||
i++; | |||
list.next (); | |||
} | |||
Alpm.List.free_all(required_by); | |||
required_by.free_inner(GLib.free); | |||
} | |||
/** | |||
@@ -216,8 +216,10 @@ static void walk_deps(Package pkg, int depth) | |||
walked.add(pkg.name); | |||
foreach (unowned Depend depend in pkg.depends) { | |||
string depname = depend.name; | |||
unowned Alpm.List<unowned Depend> depends = pkg.depends; | |||
while (depends != null) { | |||
unowned Alpm.Depend depend = depends.data; | |||
unowned string depname = depend.name; | |||
unowned Package? provider = find_satisfier (localdb.pkgcache, depname); | |||
if (provider != null) { | |||
@@ -237,6 +239,7 @@ static void walk_deps(Package pkg, int depth) | |||
/* unresolvable package */ | |||
print(pkg.name, null, depname, depth); | |||
} | |||
depends.next (); | |||
} | |||
} | |||
@@ -21,7 +21,7 @@ msgstr "" | |||
msgid "Authentication is required" | |||
msgstr "" | |||
#: ../src/daemon.vala ../src/transaction.vala | |||
#: ../src/daemon.vala | |||
msgid "Failed to initialize alpm library" | |||
msgstr "" | |||
@@ -29,6 +29,26 @@ msgstr "" | |||
msgid "Failed to synchronize any databases" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "Unknown" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "Explicitly installed" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "Installed as a dependency for another package" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "Yes" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "No" | |||
msgstr "" | |||
#: ../src/daemon.vala | |||
msgid "Failed to init transaction" | |||
msgstr "" | |||
@@ -120,7 +140,7 @@ msgstr "" | |||
msgid "Transaction Summary" | |||
msgstr "" | |||
#: ../src/transaction.vala ../src/manager_window.vala | |||
#: ../src/transaction.vala | |||
msgid "To remove" | |||
msgstr "" | |||
@@ -132,7 +152,7 @@ msgstr "" | |||
msgid "To build" | |||
msgstr "" | |||
#: ../src/transaction.vala ../src/manager_window.vala | |||
#: ../src/transaction.vala | |||
msgid "To install" | |||
msgstr "" | |||
@@ -153,11 +173,7 @@ msgid "Building packages" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Running pre-transaction hooks" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Running post-transaction hooks" | |||
msgid "Transaction cancelled" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
@@ -183,36 +199,28 @@ msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Reinstalling %s" | |||
msgid "Upgrading %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Removing %s" | |||
msgid "Reinstalling %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Upgrading %s" | |||
msgid "Downgrading %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Downgrading %s" | |||
msgid "Removing %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Checking integrity" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Checking keyring" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Downloading required keys" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Loading packages files" | |||
msgstr "" | |||
@@ -247,6 +255,11 @@ msgstr "" | |||
msgid "Downloading" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Downloading %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Checking available disk space" | |||
msgstr "" | |||
@@ -261,6 +274,14 @@ msgstr "" | |||
msgid "Database file for %s does not exist" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Checking keyring" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Downloading required keys" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "%s installed as %s.pacnew" | |||
@@ -272,13 +293,11 @@ msgid "%s installed as %s.pacsave" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Refreshing %s" | |||
msgid "Running pre-transaction hooks" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
#, c-format | |||
msgid "Downloading %s" | |||
msgid "Running post-transaction hooks" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
@@ -294,7 +313,8 @@ msgstr[0] "" | |||
msgstr[1] "" | |||
#: ../src/transaction.vala | |||
msgid "Warning" | |||
#, c-format | |||
msgid "Refreshing %s" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
@@ -302,7 +322,7 @@ msgid "Error" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
msgid "Transaction cancelled" | |||
msgid "Warning" | |||
msgstr "" | |||
#: ../src/transaction.vala | |||
@@ -369,8 +389,11 @@ msgid "Mark as explicitly installed" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "local" | |||
msgstr "" | |||
#, c-format | |||
msgid "%u pending operation" | |||
msgid_plural "%u pending operations" | |||
msgstr[0] "" | |||
msgstr[1] "" | |||
#: ../src/manager_window.vala | |||
msgid "Installed" | |||
@@ -381,95 +404,76 @@ msgid "Orphans" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Licenses" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Unknown" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Depends On" | |||
msgid "Foreign" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Optional Dependencies" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Required By" | |||
msgid "Pending" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Optional For" | |||
msgid "Licenses" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Provides" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
#: ../resources/updater_window.ui | |||
msgid "Repository" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Replaces" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
msgid "Groups" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Conflicts With" | |||
msgid "Packager" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Make Dependencies" | |||
msgid "Build Date" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Check Dependencies" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
msgid "Repository" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
msgid "Groups" | |||
msgid "Install Date" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Packager" | |||
msgid "Install Reason" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Build Date" | |||
msgid "Signatures" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Install Date" | |||
msgid "Backup files" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Explicitly installed" | |||
msgid "Depends On" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Installed as a dependency for another package" | |||
msgid "Optional Dependencies" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Install Reason" | |||
msgid "Required By" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Yes" | |||
msgid "Optional For" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "No" | |||
msgid "Provides" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Signatures" | |||
msgid "Replaces" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
msgid "Backup files" | |||
msgid "Conflicts With" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
@@ -488,7 +492,7 @@ msgstr "" | |||
msgid "Last Modified" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
#: ../src/manager_window.vala | |||
msgid "Votes" | |||
msgstr "" | |||
@@ -496,6 +500,11 @@ msgstr "" | |||
msgid "Out of Date" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
#: ../resources/updater_window.ui | |||
msgid "Name" | |||
msgstr "" | |||
#: ../src/manager_window.vala | |||
#, c-format | |||
msgid "" | |||
@@ -507,17 +516,13 @@ msgid_plural "" | |||
msgstr[0] "" | |||
msgstr[1] "" | |||
#: ../src/manager_window.vala | |||
msgid "Uninstalled" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/manager_window.ui | |||
msgid "Install Local Packages" | |||
msgstr "" | |||
#: ../src/manager_window.vala ../resources/progress_dialog.ui | |||
#: ../resources/transaction_sum_dialog.ui ../resources/choose_dep_dialog.ui | |||
#: ../resources/choose_ignorepkgs_dialog.ui | |||
#: ../resources/manager_window.ui ../resources/choose_ignorepkgs_dialog.ui | |||
msgid "_Cancel" | |||
msgstr "" | |||
@@ -571,10 +576,8 @@ msgstr "" | |||
msgid "Progress" | |||
msgstr "" | |||
#: ../resources/progress_dialog.ui ../resources/history_dialog.ui | |||
#: ../resources/transaction_info_dialog.ui ../resources/updater_window.ui | |||
#: ../resources/preferences_dialog.ui | |||
msgid "_Close" | |||
#: ../resources/progress_dialog.ui | |||
msgid "_Hide" | |||
msgstr "" | |||
#: ../resources/progress_dialog.ui ../resources/transaction_info_dialog.ui | |||
@@ -586,6 +589,11 @@ msgstr "" | |||
msgid "Pamac History" | |||
msgstr "" | |||
#: ../resources/history_dialog.ui ../resources/transaction_info_dialog.ui | |||
#: ../resources/updater_window.ui ../resources/preferences_dialog.ui | |||
msgid "_Close" | |||
msgstr "" | |||
#: ../resources/choose_dep_dialog.ui | |||
msgid "Choose Optional Dependencies" | |||
msgstr "" | |||
@@ -606,14 +614,6 @@ msgstr "" | |||
msgid "Refresh databases" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Apply changes" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Cancel all planned changes" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Search in AUR" | |||
msgstr "" | |||
@@ -622,7 +622,7 @@ msgstr "" | |||
msgid "Search" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
#: ../resources/manager_window.ui ../resources/updater_window.ui | |||
msgid "State" | |||
msgstr "" | |||
@@ -630,16 +630,16 @@ msgstr "" | |||
msgid "Repositories" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Name" | |||
#: ../resources/manager_window.ui ../resources/updater_window.ui | |||
msgid "Version" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Version" | |||
#: ../resources/manager_window.ui ../resources/updater_window.ui | |||
msgid "Size" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Size" | |||
msgid "Popularity" | |||
msgstr "" | |||
#: ../resources/manager_window.ui ../resources/updater_window.ui | |||
@@ -647,8 +647,12 @@ msgstr "" | |||
msgid "AUR" | |||
msgstr "" | |||
#: ../resources/manager_window.ui ../resources/updater_window.ui | |||
msgid "_Apply" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
msgid "Description" | |||
msgid "Browse" | |||
msgstr "" | |||
#: ../resources/manager_window.ui | |||
@@ -663,10 +667,6 @@ msgstr "" | |||
msgid "_Refresh" | |||
msgstr "" | |||
#: ../resources/updater_window.ui | |||
msgid "_Apply" | |||
msgstr "" | |||
#: ../resources/preferences_dialog.ui | |||
msgid "Preferences" | |||
msgstr "" | |||
@@ -689,6 +689,10 @@ msgstr "" | |||
msgid "Check for updates" | |||
msgstr "" | |||
#: ../resources/preferences_dialog.ui | |||
msgid "6" | |||
msgstr "" | |||
#: ../resources/preferences_dialog.ui | |||
msgid "Hide tray icon when no update available" | |||
msgstr "" |
@@ -3,6 +3,7 @@ MANAGER_RESOURCES_FILES = manager_window.ui \ | |||
choose_dep_dialog.ui \ | |||
history_dialog.ui \ | |||
package-available.png \ | |||
package-available-locked.png \ | |||
package-install.png \ | |||
package-installed-locked.png \ | |||
package-installed-updated.png \ |
@@ -1,13 +1,16 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.19.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacChooseDependenciesDialog" parent="GtkDialog"> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Choose Optional Dependencies</property> | |||
<property name="modal">True</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="urgency_hint">True</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox1"> | |||
<property name="can_focus">False</property> | |||
@@ -23,25 +26,28 @@ | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="use_underline">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkButton" id="valid_button"> | |||
<property name="label" translatable="yes">_OK</property> | |||
<property name="use_underline">True</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
</object> | |||
@@ -49,6 +55,7 @@ | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="pack_type">end</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -59,6 +66,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -112,6 +120,7 @@ | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -10,6 +10,7 @@ | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="urgency_hint">True</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox1"> | |||
<property name="can_focus">False</property> |
@@ -1,13 +1,16 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.19.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacChooseProviderDialog" parent="GtkDialog"> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Choose a Provider</property> | |||
<property name="modal">True</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="urgency_hint">True</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox2"> | |||
<property name="can_focus">False</property> | |||
@@ -20,14 +23,16 @@ | |||
<child> | |||
<object class="GtkButton" id="valid_button"> | |||
<property name="label" translatable="yes">_OK</property> | |||
<property name="use_underline">True</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
</object> | |||
@@ -35,6 +40,7 @@ | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="pack_type">end</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -52,6 +58,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -62,12 +69,14 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -1,9 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacHistoryDialog" parent="GtkDialog"> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Pamac History</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="default_width">600</property> | |||
<property name="default_height">500</property> | |||
<property name="icon_name">system-software-install</property> | |||
@@ -20,14 +23,16 @@ | |||
<child> | |||
<object class="GtkButton" id="close_button"> | |||
<property name="label" translatable="yes">_Close</property> | |||
<property name="use_underline">True</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
</object> | |||
@@ -35,6 +40,7 @@ | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="pack_type">end</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -58,6 +64,7 @@ | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -5,6 +5,7 @@ | |||
<file preprocess="xml-stripblanks">history_dialog.ui</file> | |||
<file preprocess="xml-stripblanks">choose_dep_dialog.ui</file> | |||
<file preprocess="to-pixdata">package-available.png</file> | |||
<file preprocess="to-pixdata">package-available-locked.png</file> | |||
<file preprocess="to-pixdata">package-install.png</file> | |||
<file preprocess="to-pixdata">package-installed-locked.png</file> | |||
<file preprocess="to-pixdata">package-installed-updated.png</file> |
@@ -1,5 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.19.0 --> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.14"/> | |||
<object class="GtkAdjustment" id="adjustment"> | |||
@@ -9,19 +9,13 @@ | |||
<property name="step_increment">1</property> | |||
<property name="page_increment">10</property> | |||
</object> | |||
<object class="GtkListStore" id="ignorepkgs_liststore"> | |||
<columns> | |||
<!-- column-name name --> | |||
<column type="gchararray"/> | |||
</columns> | |||
</object> | |||
<template class="PamacPreferencesDialog" parent="GtkDialog"> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Preferences</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">normal</property> | |||
<property name="type_hint">dialog</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox"> | |||
<property name="can_focus">False</property> | |||
@@ -54,13 +48,28 @@ | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkNotebook" id="notebook1"> | |||
<object class="GtkStackSwitcher" id="stackswitcher"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="halign">center</property> | |||
<property name="stack">stack</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkStack" id="stack"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<child> | |||
<object class="GtkBox" id="general_config_box"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="margin_left">6</property> | |||
<property name="margin_right">6</property> | |||
<property name="margin_start">6</property> | |||
<property name="margin_end">6</property> | |||
<property name="margin_top">6</property> | |||
@@ -168,6 +177,7 @@ | |||
<object class="GtkSwitch" id="check_updates_button"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="tooltip_text" translatable="yes">Check for updates</property> | |||
<property name="halign">end</property> | |||
</object> | |||
<packing> | |||
@@ -192,6 +202,7 @@ | |||
<object class="GtkLabel" id="refresh_period_label"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="margin_left">24</property> | |||
<property name="margin_start">24</property> | |||
<property name="hexpand">True</property> | |||
<property name="xalign">0</property> | |||
@@ -208,6 +219,7 @@ | |||
<property name="can_focus">True</property> | |||
<property name="tooltip_text" translatable="yes">How often to check for updates, value in hours</property> | |||
<property name="halign">end</property> | |||
<property name="text" translatable="yes">6</property> | |||
<property name="caps_lock_warning">False</property> | |||
<property name="input_purpose">number</property> | |||
<property name="adjustment">adjustment</property> | |||
@@ -234,8 +246,10 @@ | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="margin_left">22</property> | |||
<property name="margin_start">22</property> | |||
<property name="hexpand">True</property> | |||
<property name="xalign">0</property> | |||
<property name="draw_indicator">True</property> | |||
</object> | |||
<packing> | |||
@@ -255,6 +269,7 @@ | |||
<property name="can_focus">False</property> | |||
<property name="halign">start</property> | |||
<property name="valign">start</property> | |||
<property name="margin_left">26</property> | |||
<property name="margin_start">26</property> | |||
<property name="label" translatable="yes">Ignore upgrades for:</property> | |||
<property name="xalign">0</property> | |||
@@ -269,6 +284,7 @@ | |||
<object class="GtkBox" id="box10"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="margin_left">12</property> | |||
<property name="margin_start">12</property> | |||
<property name="hexpand">True</property> | |||
<property name="vexpand">True</property> | |||
@@ -284,12 +300,11 @@ | |||
<object class="GtkTreeView" id="ignorepkgs_treeview"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="model">ignorepkgs_liststore</property> | |||
<property name="headers_visible">False</property> | |||
<property name="search_column">0</property> | |||
<property name="show_expanders">False</property> | |||
<child internal-child="selection"> | |||
<object class="GtkTreeSelection" id="treeview-selection1"/> | |||
<object class="GtkTreeSelection" id="treeview-selection"/> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn1"> | |||
@@ -368,21 +383,17 @@ | |||
</packing> | |||
</child> | |||
</object> | |||
</child> | |||
<child type="tab"> | |||
<object class="GtkLabel" id="tab_label1"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="label" translatable="yes">General</property> | |||
</object> | |||
<packing> | |||
<property name="tab_fill">False</property> | |||
<property name="name">general</property> | |||
<property name="title" translatable="yes">General</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkBox" id="mirrors_config_box"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="margin_left">6</property> | |||
<property name="margin_right">6</property> | |||
<property name="margin_start">6</property> | |||
<property name="margin_end">6</property> | |||
<property name="margin_top">6</property> | |||
@@ -483,20 +494,11 @@ | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="name">official_repositories</property> | |||
<property name="title" translatable="yes">Official Repositories</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child type="tab"> | |||
<object class="GtkLabel" id="tab_label2"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="label" translatable="yes">Official Repositories</property> | |||
</object> | |||
<packing> | |||
<property name="position">1</property> | |||
<property name="tab_fill">False</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkBox" id="aur_config_box"> | |||
<property name="visible">True</property> | |||
@@ -568,6 +570,8 @@ All AUR users should be familiar with the build process.</property> | |||
<object class="GtkLabel" id="enable_aur_label"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="margin_left">6</property> | |||
<property name="margin_right">6</property> | |||
<property name="margin_start">6</property> | |||
<property name="margin_end">6</property> | |||
<property name="hexpand">True</property> | |||
@@ -586,6 +590,8 @@ All AUR users should be familiar with the build process.</property> | |||
<property name="can_focus">True</property> | |||
<property name="tooltip_text" translatable="yes">Allow Pamac to search and install packages from AUR</property> | |||
<property name="halign">end</property> | |||
<property name="margin_left">6</property> | |||
<property name="margin_right">6</property> | |||
<property name="margin_start">6</property> | |||
<property name="margin_end">6</property> | |||
</object> | |||
@@ -608,8 +614,10 @@ All AUR users should be familiar with the build process.</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="margin_left">24</property> | |||
<property name="margin_start">24</property> | |||
<property name="hexpand">True</property> | |||
<property name="xalign">0</property> | |||
<property name="draw_indicator">True</property> | |||
</object> | |||
<packing> | |||
@@ -624,8 +632,10 @@ All AUR users should be familiar with the build process.</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="margin_left">24</property> | |||
<property name="margin_start">24</property> | |||
<property name="hexpand">True</property> | |||
<property name="xalign">0</property> | |||
<property name="draw_indicator">True</property> | |||
</object> | |||
<packing> | |||
@@ -640,8 +650,10 @@ All AUR users should be familiar with the build process.</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="margin_left">24</property> | |||
<property name="margin_start">24</property> | |||
<property name="hexpand">True</property> | |||
<property name="xalign">0</property> | |||
<property name="draw_indicator">True</property> | |||
</object> | |||
<packing> | |||
@@ -652,25 +664,16 @@ All AUR users should be familiar with the build process.</property> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="name">aur</property> | |||
<property name="title" translatable="yes">AUR</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
<child type="tab"> | |||
<object class="GtkLabel" id="tab_label3"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="label" translatable="yes">AUR</property> | |||
</object> | |||
<packing> | |||
<property name="position">2</property> | |||
<property name="tab_fill">False</property> | |||
</packing> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -1,5 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.19.0 --> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacProgressDialog" parent="GtkDialog"> | |||
@@ -7,11 +7,9 @@ | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Progress</property> | |||
<property name="modal">True</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="deletable">False</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox1"> | |||
<property name="visible">True</property> | |||
@@ -39,7 +37,7 @@ | |||
</child> | |||
<child> | |||
<object class="GtkButton" id="close_button"> | |||
<property name="label" translatable="yes">_Close</property> | |||
<property name="label" translatable="yes">_Hide</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> |
@@ -1,11 +1,16 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacTransactionInfoDialog" parent="GtkDialog"> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="modal">True</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="default_width">300</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="urgency_hint">True</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox4"> | |||
<property name="can_focus">False</property> | |||
@@ -21,11 +26,13 @@ | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
</object> | |||
@@ -33,6 +40,7 @@ | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="pack_type">end</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -43,6 +51,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -83,6 +92,7 @@ | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -1,11 +1,14 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacTransactionSumDialog" parent="GtkDialog"> | |||
<property name="title" translatable="yes">Transaction Summary</property> | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="type_hint">dialog</property> | |||
<property name="title" translatable="yes">Transaction Summary</property> | |||
<property name="window_position">center-on-parent</property> | |||
<property name="icon_name">system-software-install</property> | |||
<property name="type_hint">dialog</property> | |||
<child internal-child="vbox"> | |||
<object class="GtkBox" id="dialog-vbox6"> | |||
<property name="can_focus">False</property> | |||
@@ -21,12 +24,13 @@ | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="has_focus">True</property> | |||
<property name="use_underline">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -34,11 +38,13 @@ | |||
<property name="label" translatable="yes">_OK</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="receives_default">False</property> | |||
<property name="use_underline">True</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
</object> | |||
@@ -46,6 +52,7 @@ | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="pack_type">end</property> | |||
<property name="position">0</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -56,6 +63,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -65,7 +73,7 @@ | |||
<property name="hexpand">True</property> | |||
<property name="vexpand">True</property> | |||
<property name="shadow_type">in</property> | |||
<property name="min_content_width">330</property> | |||
<property name="min_content_width">450</property> | |||
<property name="min_content_height">250</property> | |||
<child> | |||
<object class="GtkTreeView" id="treeview"> | |||
@@ -75,7 +83,6 @@ | |||
<property name="vexpand">True</property> | |||
<property name="headers_visible">False</property> | |||
<property name="headers_clickable">False</property> | |||
<property name="enable_search">False</property> | |||
<property name="search_column">0</property> | |||
<property name="show_expanders">False</property> | |||
<child internal-child="selection"> | |||
@@ -87,12 +94,11 @@ | |||
<object class="GtkTreeViewColumn" id="_action"> | |||
<property name="sizing">autosize</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="cellrenderertext5"> | |||
<object class="GtkCellRendererText" id="cellrenderertext1"> | |||
<property name="yalign">0</property> | |||
<property name="weight">600</property> | |||
</object> | |||
<attributes> | |||
<attribute name="text">0</attribute> | |||
<attribute name="markup">0</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
@@ -101,19 +107,38 @@ | |||
<object class="GtkTreeViewColumn" id="_packages"> | |||
<property name="sizing">autosize</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="cellrenderertext6"/> | |||
<object class="GtkCellRendererText" id="cellrenderertext2"/> | |||
<attributes> | |||
<attribute name="text">1</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="_version"> | |||
<property name="sizing">autosize</property> | |||
<property name="title" translatable="yes">column</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="cellrenderertext3"/> | |||
<attributes> | |||
<attribute name="text">2</attribute> | |||
</attributes> | |||
</child> | |||
<child> | |||
<object class="GtkCellRendererText" id="cellrenderertext4"/> | |||
<attributes> | |||
<attribute name="text">3</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -124,6 +149,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">3</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -1,5 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Generated with glade 3.19.0 --> | |||
<!-- Generated with glade 3.20.0 --> | |||
<interface> | |||
<requires lib="gtk+" version="3.12"/> | |||
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow"> | |||
@@ -7,9 +7,9 @@ | |||
<property name="can_focus">False</property> | |||
<property name="border_width">6</property> | |||
<property name="title" translatable="yes">Update Manager</property> | |||
<property name="window_position">center</property> | |||
<property name="default_width">500</property> | |||
<property name="default_width">600</property> | |||
<property name="icon_name">system-software-update</property> | |||
<property name="gravity">center</property> | |||
<child> | |||
<object class="GtkBox" id="box1"> | |||
<property name="visible">True</property> | |||
@@ -30,25 +30,35 @@ | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkNotebook" id="notebook"> | |||
<object class="GtkStackSwitcher" id="stackswitcher"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="halign">center</property> | |||
<property name="stack">stack</property> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkStack" id="stack"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<child> | |||
<object class="GtkScrolledWindow" id="repos_scrolledwindow"> | |||
<property name="width_request">400</property> | |||
<property name="height_request">400</property> | |||
<property name="width_request">600</property> | |||
<property name="height_request">450</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="hexpand">True</property> | |||
<property name="vexpand">True</property> | |||
<child> | |||
<object class="GtkTreeView" id="repos_updates_treeview"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="vexpand">True</property> | |||
<property name="headers_visible">False</property> | |||
<property name="headers_clickable">False</property> | |||
<property name="search_column">0</property> | |||
<property name="search_column">1</property> | |||
<property name="show_expanders">False</property> | |||
<child internal-child="selection"> | |||
<object class="GtkTreeSelection" id="treeview-selection"> | |||
<property name="mode">none</property> | |||
@@ -56,6 +66,11 @@ | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn3"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">40</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">State</property> | |||
<child> | |||
<object class="GtkCellRendererToggle" id="repos_select_update"> | |||
<signal name="toggled" handler="on_repos_select_update_toggled" swapped="no"/> | |||
@@ -68,6 +83,11 @@ | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn1"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">200</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Name</property> | |||
<property name="expand">True</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="repos_update_name"/> | |||
@@ -78,45 +98,77 @@ | |||
</object> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn2"> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn6"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">150</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Version</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="repos_update_download_size"/> | |||
<object class="GtkCellRendererText" id="repos_new_update_version"/> | |||
<attributes> | |||
<attribute name="text">2</attribute> | |||
</attributes> | |||
</child> | |||
<child> | |||
<object class="GtkCellRendererText" id="repos_old_update_version"/> | |||
<attributes> | |||
<attribute name="text">3</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn10"> | |||
<property name="resizable">True</property> | |||
<property name="fixed_width">90</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Repository</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="repos_update_repo"/> | |||
<attributes> | |||
<attribute name="text">4</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn2"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">90</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Size</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="repos_update_size"/> | |||
<attributes> | |||
<attribute name="text">5</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
</child> | |||
<child type="tab"> | |||
<object class="GtkLabel" id="label1"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="label" translatable="yes">Repositories</property> | |||
</object> | |||
<packing> | |||
<property name="tab_fill">False</property> | |||
<property name="name">repos</property> | |||
<property name="title" translatable="yes">Repositories</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<object class="GtkScrolledWindow" id="aur_scrolledwindow"> | |||
<property name="width_request">400</property> | |||
<property name="height_request">400</property> | |||
<property name="width_request">600</property> | |||
<property name="height_request">450</property> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="hexpand">True</property> | |||
<property name="vexpand">True</property> | |||
<child> | |||
<object class="GtkTreeView" id="aur_updates_treeview"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">True</property> | |||
<property name="vexpand">True</property> | |||
<property name="headers_visible">False</property> | |||
<property name="headers_clickable">False</property> | |||
<property name="search_column">0</property> | |||
<property name="search_column">1</property> | |||
<property name="show_expanders">False</property> | |||
<child internal-child="selection"> | |||
<object class="GtkTreeSelection" id="treeview-selection2"> | |||
<property name="mode">none</property> | |||
@@ -124,6 +176,11 @@ | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn4"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">40</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">State</property> | |||
<child> | |||
<object class="GtkCellRendererToggle" id="aur_select_update"> | |||
<signal name="toggled" handler="on_aur_select_update_toggled" swapped="no"/> | |||
@@ -136,6 +193,11 @@ | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn5"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">200</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Name</property> | |||
<property name="expand">True</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="aur_update_name"/> | |||
@@ -145,29 +207,35 @@ | |||
</child> | |||
</object> | |||
</child> | |||
<child> | |||
<object class="GtkTreeViewColumn" id="treeviewcolumn8"> | |||
<property name="resizable">True</property> | |||
<property name="sizing">fixed</property> | |||
<property name="fixed_width">150</property> | |||
<property name="min_width">20</property> | |||
<property name="title" translatable="yes">Version</property> | |||
<child> | |||
<object class="GtkCellRendererText" id="aur_update_version"/> | |||
<attributes> | |||
<attribute name="text">2</attribute> | |||
</attributes> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="name">aur</property> | |||
<property name="title" translatable="yes">AUR</property> | |||
<property name="position">1</property> | |||
</packing> | |||
</child> | |||
<child type="tab"> | |||
<object class="GtkLabel" id="label2"> | |||
<property name="visible">True</property> | |||
<property name="can_focus">False</property> | |||
<property name="label" translatable="yes">AUR</property> | |||
</object> | |||
<packing> | |||
<property name="position">1</property> | |||
<property name="tab_fill">False</property> | |||
</packing> | |||
</child> | |||
</object> | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="expand">True</property> | |||
<property name="fill">True</property> | |||
<property name="position">1</property> | |||
<property name="position">2</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -178,7 +246,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">2</property> | |||
<property name="position">3</property> | |||
</packing> | |||
</child> | |||
<child> | |||
@@ -277,7 +345,7 @@ | |||
<packing> | |||
<property name="expand">False</property> | |||
<property name="fill">True</property> | |||
<property name="position">3</property> | |||
<property name="position">4</property> | |||
</packing> | |||
</child> | |||
</object> |
@@ -1,30 +1,30 @@ | |||
COMMON_VALA_FLAGS = -X -w \ | |||
--pkg=libalpm \ | |||
ALPM_VALA_FLAGS = --pkg=libalpm \ | |||
--pkg=gio-2.0 \ | |||
--pkg=posix \ | |||
--vapidir=./ \ | |||
--vapidir=../vapi \ | |||
-X -I../util \ | |||
-X -D_FILE_OFFSET_BITS=64 \ | |||
-X -D_FILE_OFFSET_BITS=64 | |||
COMMON_VALA_FLAGS = -X -w \ | |||
--pkg=posix \ | |||
-X -DGETTEXT_PACKAGE="pamac" \ | |||
--target-glib=2.38 | |||
TRANSACTION_VALA_FLAGS = --pkg=json-glib-1.0 \ | |||
--pkg=libsoup-2.4 \ | |||
--pkg=gtk+-3.0 \ | |||
TRANSACTION_VALA_FLAGS = --pkg=gtk+-3.0 \ | |||
--pkg=gdk-3.0 \ | |||
--pkg=vte-2.91 \ | |||
-X -lm | |||
COMMON_SOURCES = ../util/alpm-util.c \ | |||
common.vala \ | |||
pamac_config.vala \ | |||
alpm_config.vala \ | |||
PAMAC_LIB_FLAGS = -X -I. \ | |||
-X -L. \ | |||
-X -lpamac \ | |||
--vapidir=./ \ | |||
--pkg=pamac \ | |||
COMMON_SOURCES = common.vala \ | |||
pamac_config.vala | |||
TRANSACTION_SOURCES = transaction.vala \ | |||
alpm_utils.vala \ | |||
aur.vala \ | |||
TRANSACTION_SOURCES = package.vala \ | |||
transaction.vala \ | |||
choose_provider_dialog.vala \ | |||
transaction_sum_dialog.vala \ | |||
transaction_info_dialog.vala \ | |||
@@ -42,7 +42,7 @@ UPDATER_GRESOURCE_FILE = ../resources/pamac.updater.gresource.xml | |||
INSTALLER_GRESOURCE_FILE = ../resources/pamac.installer.gresource.xml | |||
binaries: pamac-refresh pamac-daemon pamac-tray libpamac.so pamac-updater pamac-manager pamac-install | |||
binaries: pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install | |||
clean: | |||
rm -f *.c pamac.h pamac.vapi libpamac.so pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install | |||
@@ -55,7 +55,7 @@ pamac-refresh: pamac_config.vala refresh.vala | |||
pamac_config.vala \ | |||
refresh.vala | |||
pamac-tray: ../vapi/libalpm.vapi $(COMMON_SOURCES) tray.vala | |||
pamac-tray: $(COMMON_SOURCES) alpm_config.vala tray.vala | |||
valac -o pamac-tray \ | |||
$(COMMON_VALA_FLAGS) \ | |||
--pkg=gtk+-3.0 \ | |||
@@ -63,20 +63,23 @@ pamac-tray: ../vapi/libalpm.vapi $(COMMON_SOURCES) tray.vala | |||
$(COMMON_SOURCES) \ | |||
tray.vala | |||
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl.vapi $(COMMON_SOURCES) aur.vala mirrors_config.vala daemon.vala | |||
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl.vapi alpm_config.vala $(COMMON_SOURCES) package.vala aur.vala mirrors_config.vala daemon.vala | |||
valac -o pamac-daemon \ | |||
$(COMMON_VALA_FLAGS) \ | |||
$(ALPM_VALA_FLAGS) \ | |||
--pkg=polkit-gobject-1 \ | |||
--pkg=libcurl \ | |||
--pkg=json-glib-1.0 \ | |||
--pkg=libsoup-2.4 \ | |||
--thread \ | |||
alpm_config.vala \ | |||
$(COMMON_SOURCES) \ | |||
package.vala \ | |||
aur.vala \ | |||
mirrors_config.vala \ | |||
daemon.vala | |||
libpamac.so: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../resources/transaction_resources.c | |||
libpamac.so: $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../resources/transaction_resources.c | |||
valac -o libpamac.so \ | |||
-X -fPIC \ | |||
-X --shared \ | |||
@@ -91,33 +94,24 @@ libpamac.so: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PRE | |||
$(TRANSACTION_SOURCES) \ | |||
$(PREFERENCES_SOURCES) | |||
pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transaction_info_dialog.vala ../resources/manager_resources.c ../util/alpm-util.c packages_model.vala aur_model.vala manager_window.vala manager.vala | |||
pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transaction_info_dialog.vala ../resources/manager_resources.c manager_window.vala manager.vala | |||
valac -o pamac-manager \ | |||
$(COMMON_VALA_FLAGS) \ | |||
-X -I. \ | |||
-X -L. \ | |||
-X -lpamac \ | |||
--pkg=pamac \ | |||
$(PAMAC_LIB_FLAGS) \ | |||
--pkg=json-glib-1.0 \ | |||
--pkg=gtk+-3.0 \ | |||
--pkg=gdk-3.0 \ | |||
--gresources=$(MANAGER_GRESOURCE_FILE) \ | |||
../resources/manager_resources.c \ | |||
../util/alpm-util.c \ | |||
choose_dep_dialog.vala \ | |||
history_dialog.vala \ | |||
packages_model.vala \ | |||
aur_model.vala \ | |||
manager_window.vala \ | |||
manager.vala | |||
pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala updater.vala | |||
valac -o pamac-updater \ | |||
$(COMMON_VALA_FLAGS) \ | |||
-X -I. \ | |||
-X -L. \ | |||
-X -lpamac \ | |||
--pkg=pamac \ | |||
$(PAMAC_LIB_FLAGS) \ | |||
--pkg=json-glib-1.0 \ | |||
--pkg=gtk+-3.0 \ | |||
--pkg=gdk-3.0 \ | |||
@@ -129,10 +123,7 @@ pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala | |||
pamac-install: libpamac.so installer.vala | |||
valac -o pamac-install \ | |||
$(COMMON_VALA_FLAGS) \ | |||
-X -I. \ | |||
-X -L. \ | |||
-X -lpamac \ | |||
--pkg=pamac \ | |||
$(PAMAC_LIB_FLAGS) \ | |||
--pkg=json-glib-1.0 \ | |||
--pkg=gtk+-3.0 \ | |||
installer.vala |
@@ -1,5 +1,5 @@ | |||
/* | |||
* pamac-vala | |||
* alpm_config | |||
* | |||
* Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org> | |||
* | |||
@@ -18,7 +18,7 @@ | |||
*/ | |||
[Compact] | |||
public class AlpmRepo { | |||
class AlpmRepo { | |||
public string name; | |||
public Alpm.Signature.Level siglevel; | |||
public Alpm.Signature.Level siglevel_mask; | |||
@@ -42,68 +42,55 @@ public class AlpmRepo { | |||
} | |||
[Compact] | |||
public class AlpmConfig { | |||
public string conf_path; | |||
public string? rootdir; | |||
public string? dbpath; | |||
public string? logfile; | |||
public string? gpgdir; | |||
public string? arch; | |||
public double deltaratio; | |||
public int usesyslog; | |||
public int checkspace; | |||
public Alpm.List<string?>? cachedirs; | |||
public Alpm.List<string?>? hookdirs; | |||
public Alpm.List<string?>? ignoregroups; | |||
public Alpm.List<string?>? ignorepkgs; | |||
public Alpm.List<string?>? noextracts; | |||
public Alpm.List<string?>? noupgrades; | |||
public GLib.List<string>? holdpkgs; | |||
public GLib.List<string>? syncfirsts; | |||
public Alpm.Signature.Level siglevel; | |||
public Alpm.Signature.Level localfilesiglevel; | |||
public Alpm.Signature.Level remotefilesiglevel; | |||
public Alpm.Signature.Level siglevel_mask; | |||
public Alpm.Signature.Level localfilesiglevel_mask; | |||
public Alpm.Signature.Level remotefilesiglevel_mask; | |||
public GLib.List<AlpmRepo> repo_order; | |||
public Alpm.Handle? handle; | |||
class AlpmConfig { | |||
string conf_path; | |||
string? rootdir; | |||
string? dbpath; | |||
string? logfile; | |||
string? gpgdir; | |||
string? arch; | |||
double deltaratio; | |||
int usesyslog; | |||
int checkspace; | |||
GLib.List<string> cachedirs; | |||
GLib.List<string> hookdirs; | |||
GLib.List<string> ignoregroups; | |||
GLib.List<string> ignorepkgs; | |||
GLib.List<string> noextracts; | |||
GLib.List<string> noupgrades; | |||
GLib.List<string> holdpkgs; | |||
GLib.List<string> syncfirsts; | |||
Alpm.Signature.Level siglevel; | |||
Alpm.Signature.Level localfilesiglevel; | |||
Alpm.Signature.Level remotefilesiglevel; | |||
Alpm.Signature.Level siglevel_mask; | |||
Alpm.Signature.Level localfilesiglevel_mask; | |||
Alpm.Signature.Level remotefilesiglevel_mask; | |||
GLib.List<AlpmRepo> repo_order; | |||
public AlpmConfig (string path) { | |||
conf_path = path; | |||
reload (); | |||
} | |||
public unowned GLib.List<string> get_holdpkgs () { | |||
return holdpkgs; | |||
} | |||
public unowned GLib.List<string> get_syncfirsts () { | |||
return syncfirsts; | |||
} | |||
public void reload () { | |||
// set default options | |||
cachedirs = new GLib.List<string> (); | |||
hookdirs = new GLib.List<string> (); | |||
ignoregroups = new GLib.List<string> (); | |||
ignorepkgs = new GLib.List<string> (); | |||
noextracts = new GLib.List<string> (); | |||
noupgrades = new GLib.List<string> (); | |||
holdpkgs = new GLib.List<string> (); | |||
syncfirsts = new GLib.List<string> (); | |||
// free internal data of alpm lists | |||
if (cachedirs != null) { | |||
cachedirs.free_data (); | |||
cachedirs = new Alpm.List<string> (); | |||
} | |||
if (hookdirs != null) { | |||
hookdirs.free_data (); | |||
hookdirs = new Alpm.List<string?> (); | |||
} | |||
if (ignoregroups != null) { | |||
ignoregroups.free_data (); | |||
ignoregroups = new Alpm.List<string> (); | |||
} | |||
if (ignorepkgs != null) { | |||
ignorepkgs.free_data (); | |||
ignorepkgs = new Alpm.List<string> (); | |||
} | |||
if (noextracts != null) { | |||
noextracts.free_data (); | |||
noextracts = new Alpm.List<string> (); | |||
} | |||
if (noupgrades != null) { | |||
noupgrades.free_data (); | |||
noupgrades = new Alpm.List<string> (); | |||
} | |||
usesyslog = 0; | |||
checkspace = 0; | |||
deltaratio = 0.7; | |||
@@ -131,11 +118,11 @@ public class AlpmConfig { | |||
logfile = "/var/log/pacman.log"; | |||
} | |||
} | |||
if (cachedirs.length == 0) { | |||
cachedirs.add ("/var/cache/pacman/pkg/"); | |||
if (cachedirs.length () == 0) { | |||
cachedirs.append ("/var/cache/pacman/pkg/"); | |||
} | |||
if (hookdirs.length == 0) { | |||
hookdirs.add ("/etc/pacman.d/hooks/"); | |||
if (hookdirs.length () == 0) { | |||
hookdirs.append ("/etc/pacman.d/hooks/"); | |||
} | |||
if (gpgdir == null) { | |||
// gpgdir it is not relative to rootdir, even if | |||
@@ -147,12 +134,12 @@ public class AlpmConfig { | |||
} | |||
} | |||
public void set_handle () { | |||
public Alpm.Handle? get_handle () { | |||
Alpm.Errno error; | |||
handle = Alpm.Handle.new (rootdir, dbpath, out error); | |||
Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, out error); | |||
if (handle == null) { | |||
stderr.printf ("Failed to initialize alpm library" + " (%s)\n".printf(Alpm.strerror (error))); | |||
return; | |||
stderr.printf ("Failed to initialize alpm library" + " (%s)\n".printf (Alpm.strerror (error))); | |||
return null; | |||
} | |||
// define options | |||
handle.logfile = logfile; | |||
@@ -166,15 +153,24 @@ public class AlpmConfig { | |||
remotefilesiglevel = merge_siglevel (siglevel, remotefilesiglevel, remotefilesiglevel_mask); | |||
handle.localfilesiglevel = localfilesiglevel; | |||
handle.remotefilesiglevel = remotefilesiglevel; | |||
handle.cachedirs = cachedirs; | |||
// add hook directories 1-by-1 to avoid overwriting the system directory | |||
foreach (unowned string cachedir in cachedirs) { | |||
handle.add_cachedir (cachedir); | |||
} | |||
foreach (unowned string hookdir in hookdirs) { | |||
handle.add_hookdir (hookdir); | |||
} | |||
handle.ignoregroups = ignoregroups; | |||
handle.ignorepkgs = ignorepkgs; | |||
handle.noextracts = noextracts; | |||
handle.noupgrades = noupgrades; | |||
foreach (unowned string ignoregroup in ignoregroups) { | |||
handle.add_ignoregroup (ignoregroup); | |||
} | |||
foreach (unowned string ignorepkg in ignorepkgs) { | |||
handle.add_ignorepkg (ignorepkg); | |||
} | |||
foreach (unowned string noextract in noextracts) { | |||
handle.add_noextract (noextract); | |||
} | |||
foreach (unowned string noupgrade in noupgrades) { | |||
handle.add_noupgrade (noupgrade); | |||
} | |||
// register dbs | |||
foreach (unowned AlpmRepo repo in repo_order) { | |||
repo.siglevel = merge_siglevel (siglevel, repo.siglevel, repo.siglevel_mask); | |||
@@ -188,9 +184,10 @@ public class AlpmConfig { | |||
db.usage = repo.usage; | |||
} | |||
} | |||
return handle; | |||
} | |||
public void parse_file (string path, string? section = null) { | |||
void parse_file (string path, string? section = null) { | |||
string? current_section = section; | |||
var file = GLib.File.new_for_path (path); | |||
if (file.query_exists ()) { | |||
@@ -236,11 +233,11 @@ public class AlpmConfig { | |||
dbpath = val; | |||
} else if (key == "CacheDir") { | |||
foreach (unowned string dir in val.split (" ")) { | |||
cachedirs.add (dir); | |||
cachedirs.append (dir); | |||
} | |||
} else if (key == "HookDir") { | |||
foreach (unowned string dir in val.split (" ")) { | |||
hookdirs.add (dir); | |||
hookdirs.append (dir); | |||
} | |||
} else if (key == "LogFile") { | |||
logfile = val; | |||
@@ -276,19 +273,19 @@ public class AlpmConfig { | |||
} | |||
} else if (key == "IgnoreGroup") { | |||
foreach (unowned string name in val.split (" ")) { | |||
ignoregroups.add (name); | |||
ignoregroups.append (name); | |||
} | |||
} else if (key == "IgnorePkg") { | |||
foreach (unowned string name in val.split (" ")) { | |||
ignorepkgs.add (name); | |||
ignorepkgs.append (name); | |||
} | |||
} else if (key == "Noextract") { | |||
foreach (unowned string name in val.split (" ")) { | |||
noextracts.add (name); | |||
noextracts.append (name); | |||
} | |||
} else if (key == "NoUpgrade") { | |||
foreach (unowned string name in val.split (" ")) { | |||
noupgrades.add (name); | |||
noupgrades.append (name); | |||
} | |||
} | |||
} else { | |||
@@ -364,6 +361,7 @@ public class AlpmConfig { | |||
// writing a short string to the stream | |||
dos.put_string (new_line); | |||
} | |||
reload (); | |||
} catch (GLib.Error e) { | |||
GLib.stderr.printf("%s\n", e.message); | |||
} | |||
@@ -372,7 +370,7 @@ public class AlpmConfig { | |||
} | |||
} | |||
public Alpm.DB.Usage define_usage (string conf_string) { | |||
Alpm.DB.Usage define_usage (string conf_string) { | |||
Alpm.DB.Usage usage = 0; | |||
foreach (unowned string directive in conf_string.split(" ")) { | |||
if (directive == "Sync") { | |||
@@ -390,7 +388,7 @@ public class AlpmConfig { | |||
return usage; | |||
} | |||
public void process_siglevel (string conf_string, ref Alpm.Signature.Level siglevel, ref Alpm.Signature.Level siglevel_mask) { | |||
void process_siglevel (string conf_string, ref Alpm.Signature.Level siglevel, ref Alpm.Signature.Level siglevel_mask) { | |||
foreach (unowned string directive in conf_string.split(" ")) { | |||
bool affect_package = false; | |||
bool affect_database = false; | |||
@@ -458,7 +456,7 @@ public class AlpmConfig { | |||
siglevel &= ~Alpm.Signature.Level.USE_DEFAULT; | |||
} | |||
public Alpm.Signature.Level merge_siglevel(Alpm.Signature.Level sigbase, Alpm.Signature.Level sigover, Alpm.Signature.Level sigmask) { | |||
Alpm.Signature.Level merge_siglevel(Alpm.Signature.Level sigbase, Alpm.Signature.Level sigover, Alpm.Signature.Level sigmask) { | |||
return (sigmask != 0) ? (sigover & sigmask) | (sigbase & ~sigmask) : sigover; | |||
} | |||
} |
@@ -25,107 +25,66 @@ namespace AUR { | |||
const string rpc_multiinfo = "&type=info"; | |||
const string rpc_multiinfo_arg = "&arg[]="; | |||
public Json.Array search (string[] needles) { | |||
var prev_inter = new Json.Array (); | |||
string uri = rpc_url + rpc_search + Uri.escape_string (needles[0]); | |||
Json.Array rpc_query (string uri) { | |||
var results = new Json.Array (); | |||
var session = new Soup.Session (); | |||
// set a 15 seconds timeout because it is also the dbus daemon timeout | |||
session.timeout = 15; | |||
var message = new Soup.Message ("GET", uri); | |||
var parser = new Json.Parser (); | |||
session.send_message (message); | |||
try { | |||
parser.load_from_data ((string) message.response_body.flatten ().data, -1); | |||
} catch (Error e) { | |||
print (e.message); | |||
critical (e.message); | |||
} | |||
unowned Json.Node? root = parser.get_root (); | |||
if (root != null) { | |||
if (root.get_object ().get_string_member ("type") == "error") { | |||
stderr.printf ("Failed to search %s from AUR\n", needles[0]); | |||
critical ("Failed to query %s from AUR", uri); | |||
} else { | |||
prev_inter = root.get_object ().get_array_member ("results"); | |||
results = root.get_object ().get_array_member ("results"); | |||
} | |||
} | |||
int needles_length = needles.length; | |||
if (needles_length == 1) { | |||
return prev_inter; | |||
} | |||
int i = 1; | |||
var inter = new Json.Array (); | |||
var found = new Json.Array (); | |||
while (i < needles_length) { | |||
inter = new Json.Array (); | |||
uri = rpc_url + rpc_search + Uri.escape_string (needles[i]); | |||
message = new Soup.Message ("GET", uri); | |||
session.send_message (message); | |||
try { | |||
parser.load_from_data ((string) message.response_body.flatten ().data, -1); | |||
} catch (Error e) { | |||
print (e.message); | |||
} | |||
root = parser.get_root (); | |||
if (root != null) { | |||
if (root.get_object ().get_string_member ("type") == "error") { | |||
stderr.printf ("Failed to search %s from AUR\n", needles[i]); | |||
} else { | |||
found = root.get_object ().get_array_member ("results"); | |||
uint j = 0; | |||
uint k; | |||
uint found_length = found.get_length (); | |||
while (j < found_length) { | |||
unowned Json.Node found_node = found.get_element (j); | |||
k = 0; | |||
uint prev_inter_length = prev_inter.get_length (); | |||
while (k < prev_inter_length) { | |||
unowned Json.Node prev_inter_node = prev_inter.get_element (k); | |||
if (strcmp (found_node.get_object ().get_string_member ("Name"), | |||
prev_inter_node.get_object ().get_string_member ("Name")) == 0) { | |||
inter.add_element (prev_inter_node); | |||
prev_inter.remove_element (k); | |||
break; | |||
} | |||
k++; | |||
return results; | |||
} | |||
public async Json.Array search (string[] needles) { | |||
if (needles.length == 0) { | |||
return new Json.Array (); | |||
} else if (needles.length == 1) { | |||
return rpc_query (rpc_url + rpc_search + Uri.escape_string (needles[0])); | |||
} else { | |||
var inter = new Json.Array (); | |||
var prev_inter = new Json.Array (); | |||
foreach (unowned string needle in needles) { | |||
inter = new Json.Array (); | |||
var found = rpc_query (rpc_url + rpc_search + Uri.escape_string (needle)); | |||
prev_inter.foreach_element ((prev_inter_array, prev_inter_index, prev_inter_node) => { | |||
found.foreach_element ((found_array, found_index, found_node) => { | |||
if (strcmp (prev_inter_node.get_object ().get_string_member ("Name"), | |||
found_node.get_object ().get_string_member ("Name")) == 0) { | |||
inter.add_element (prev_inter_node); | |||
} | |||
j++; | |||
} | |||
} | |||
}); | |||
}); | |||
prev_inter = (owned) inter; | |||
} | |||
if (i != (needles_length -1)) { | |||
prev_inter = inter; | |||
} | |||
i++; | |||