Commit 00553e5e authored by guinux's avatar guinux

v3.0.0

parent d7d393ed
......@@ -21,8 +21,7 @@ msgstr ""
msgid "Authentication is required"
msgstr ""
#: ../src/daemon.vala
#: ../src/daemon.vala ../src/manager_window.vala ../src/preferences_dialog.vala
msgid "Failed to initialize alpm library"
msgstr ""
......@@ -30,14 +29,6 @@ msgstr ""
msgid "Failed to synchronize any databases"
msgstr ""
#: ../src/daemon.vala
msgid "No"
msgstr ""
#: ../src/daemon.vala
msgid "Yes"
msgstr ""
#: ../src/daemon.vala
msgid "Failed to init transaction"
msgstr ""
......@@ -90,7 +81,7 @@ msgstr ""
msgid "%s is invalid or corrupted"
msgstr ""
#: ../src/daemon.vala
#: ../src/daemon.vala ../src/transaction.vala
msgid "Authentication failed"
msgstr ""
......@@ -110,6 +101,11 @@ msgstr ""
msgid "Preparing"
msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Choose a provider for %s"
msgstr ""
#: ../src/transaction.vala ../resources/transaction_sum_dialog.ui
msgid "Transaction Summary"
msgstr ""
......@@ -146,6 +142,14 @@ msgstr ""
msgid "Building packages"
msgstr ""
#: ../src/transaction.vala
msgid "Running pre-transaction hooks"
msgstr ""
#: ../src/transaction.vala
msgid "Running post-transaction hooks"
msgstr ""
#: ../src/transaction.vala
msgid "Checking dependencies"
msgstr ""
......@@ -259,19 +263,26 @@ msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "%s installed as %s.pacorig"
msgid "Refreshing %s"
msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Refreshing %s"
msgid "Downloading %s"
msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Downloading %s"
msgid "About %u seconds remaining"
msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "About %lu minute remaining"
msgid_plural "About %lu minutes remaining"
msgstr[0] ""
msgstr[1] ""
#: ../src/transaction.vala
msgid "Warning"
msgstr ""
......@@ -281,7 +292,7 @@ msgstr ""
msgid "Error"
msgstr ""
#: ../src/transaction.vala ../src/progress_dialog.vala
#: ../src/transaction.vala
msgid "Transaction cancelled"
msgstr ""
......@@ -324,22 +335,6 @@ msgstr[1] ""
msgid "Show available updates"
msgstr ""
#: ../src/choose_provider_dialog.vala
#, c-format
msgid "Choose a provider for %s"
msgstr ""
#: ../src/choose_dep_dialog.vala
#, c-format
msgid ""
"%s has %u uninstalled optional dependency.\n"
"Choose if you would like to install it"
msgid_plural ""
"%s has %u uninstalled optional dependencies.\n"
"Choose those you would like to install"
msgstr[0] ""
msgstr[1] ""
#: ../src/manager_window.vala
msgid "Deselect"
msgstr ""
......@@ -380,6 +375,10 @@ msgstr ""
msgid "Licenses"
msgstr ""
#: ../src/manager_window.vala
msgid "Unknown"
msgstr ""
#: ../src/manager_window.vala
msgid "Depends On"
msgstr ""
......@@ -417,65 +416,76 @@ msgid "Groups"
msgstr ""
#: ../src/manager_window.vala
msgid "Maintainer"
msgid "Packager"
msgstr ""
#: ../src/manager_window.vala
msgid "First Submitted"
msgid "Build Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Last Modified"
msgid "Install Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Packager"
msgid "Explicitly installed"
msgstr ""
#: ../src/manager_window.vala
msgid "Build Date"
msgid "Installed as a dependency for another package"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Date"
msgid "Install Reason"
msgstr ""
#: ../src/manager_window.vala
msgid "Explicitly installed"
msgid "Yes"
msgstr ""
#: ../src/manager_window.vala
msgid "Installed as a dependency for another package"
msgid "No"
msgstr ""
#: ../src/manager_window.vala
msgid "Unknown"
msgid "Signatures"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Reason"
msgid "Backup files"
msgstr ""
#: ../src/manager_window.vala
msgid "Signatures"
msgid "Maintainer"
msgstr ""
#: ../src/manager_window.vala
msgid "Votes"
msgid "First Submitted"
msgstr ""
#: ../src/manager_window.vala
msgid "Out of Date"
msgid "Last Modified"
msgstr ""
#: ../src/manager_window.vala
msgid "Backup files"
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Votes"
msgstr ""
#: ../src/manager_window.vala
msgid "No package found"
msgid "Out of Date"
msgstr ""
#: ../src/manager_window.vala
#, c-format
msgid ""
"%s has %u uninstalled optional dependency.\n"
"Choose if you would like to install it"
msgid_plural ""
"%s has %u uninstalled optional dependencies.\n"
"Choose those you would like to install"
msgstr[0] ""
msgstr[1] ""
#: ../src/manager_window.vala
msgid "Uninstalled"
msgstr ""
......@@ -595,7 +605,7 @@ msgstr ""
msgid "State"
msgstr ""
#: ../resources/manager_window.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "Repositories"
msgstr ""
......@@ -611,6 +621,11 @@ msgstr ""
msgid "Size"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/preferences_dialog.ui
msgid "AUR"
msgstr ""
#: ../resources/manager_window.ui
msgid "Description"
msgstr ""
......@@ -708,10 +723,6 @@ msgstr ""
msgid "Do not ask for confirmation when building packages"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "AUR"
msgstr ""
#: ../resources/choose_ignorepkgs_dialog.ui
msgid "Choose Ignored Upgrades"
msgstr ""
This diff is collapsed.
......@@ -6,7 +6,7 @@
<property name="title" translatable="yes">Progress</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">500</property>
<property name="width_request">500</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="deletable">False</property>
......@@ -29,7 +29,6 @@
<property name="use_underline">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow">
......@@ -30,64 +30,142 @@
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="width_request">400</property>
<property name="height_request">400</property>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkTreeView" id="updates_treeview">
<object class="GtkScrolledWindow" id="repos_scrolledwindow">
<property name="width_request">400</property>
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">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>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<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>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkCellRendererToggle" id="select_update">
<signal name="toggled" handler="on_select_update_toggled" swapped="no"/>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<child>
<object class="GtkCellRendererToggle" id="repos_select_update">
<signal name="toggled" handler="on_repos_select_update_toggled" swapped="no"/>
</object>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="update_name"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="repos_update_name"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<child>
<object class="GtkCellRendererText" id="repos_update_download_size"/>
<attributes>
<attribute name="text">2</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>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="aur_scrolledwindow">
<property name="width_request">400</property>
<property name="height_request">400</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="GtkTreeViewColumn" id="treeviewcolumn2">
<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>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkCellRendererText" id="download_size"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
<child>
<object class="GtkCellRendererToggle" id="aur_select_update">
<signal name="toggled" handler="on_aur_select_update_toggled" swapped="no"/>
</object>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn5">
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="aur_update_name"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<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">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
......
COMMON_VALA_FLAGS = -X -w \
COMMON_VALA_FLAGS = -g --save-temps -X -w \
--pkg=libalpm \
--pkg=gio-2.0 \
--pkg=posix \
--pkg=json-glib-1.0 \
--pkg=libsoup-2.4 \
--vapidir=../vapi \
--Xcc=-I../util \
-X -D_FILE_OFFSET_BITS=64 \
-X -DGETTEXT_PACKAGE="pamac" \
--target-glib=2.38
TRANSACTION_VALA_FLAGS = --pkg=json-glib-1.0 \
--pkg=gtk+-3.0 \
TRANSACTION_VALA_FLAGS = --pkg=gtk+-3.0 \
--pkg=gmodule-2.0 \
--pkg=gdk-3.0 \
--pkg=vte-2.91
--pkg=vte-2.91 \
-X -lm
COMMON_SOURCES = ../util/alpm-util.c \
common.vala \
pamac_config.vala \
package.vala \
alpm_config.vala \
alpm_utils.vala \
aur.vala \
TRANSACTION_SOURCES = transaction.vala \
choose_provider_dialog.vala \
......@@ -44,37 +49,28 @@ pamac-refresh: pamac_config.vala refresh.vala
valac -o pamac-refresh \
-X -w \
--pkg=gio-2.0 \
--pkg=posix \
pamac_config.vala \
refresh.vala
pamac-tray: ../vapi/libalpm.vapi ../util/alpm-util.c common.vala alpm_config.vala pamac_config.vala tray.vala
pamac-tray: ../vapi/libalpm.vapi $(COMMON_SOURCES) tray.vala
valac -o pamac-tray \
$(COMMON_VALA_FLAGS) \
../util/alpm-util.c \
--pkg=posix \
--pkg=gtk+-3.0 \
--pkg=libnotify \
common.vala \
alpm_config.vala \
pamac_config.vala \
$(COMMON_SOURCES) \
tray.vala
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi $(COMMON_SOURCES) mirrors_config.vala alpm_config.vala alpm_utils.vala aur.vala daemon.vala
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi $(COMMON_SOURCES) mirrors_config.vala daemon.vala
valac -o pamac-daemon \
$(COMMON_VALA_FLAGS) \
--pkg=posix \
--pkg=json-glib-1.0 \
--pkg=libsoup-2.4 \
--pkg=polkit-gobject-1 \
--thread \
$(COMMON_SOURCES) \
mirrors_config.vala \
alpm_config.vala \
aur.vala \
alpm_utils.vala \
daemon.vala
pamac-manager: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) choose_dep_dialog.vala history_dialog.vala ../resources/manager_resources.c packages_model.vala manager_window.vala manager.vala
pamac-manager: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) choose_dep_dialog.vala history_dialog.vala ../resources/manager_resources.c packages_model.vala aur_model.vala manager_window.vala manager.vala
valac -o pamac-manager \
$(COMMON_VALA_FLAGS) \
$(TRANSACTION_VALA_FLAGS) \
......@@ -86,6 +82,7 @@ pamac-manager: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(P
choose_dep_dialog.vala \
history_dialog.vala \
packages_model.vala \
aur_model.vala \
manager_window.vala \
manager.vala
......
This diff is collapsed.
......@@ -17,59 +17,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
public int pkgcmp (Alpm.Package pkg1, Alpm.Package pkg2) {
return strcmp (pkg1.name, pkg2.name);
public int compare_name (Alpm.Package pkg_a, Alpm.Package pkg_b) {
return strcmp (pkg_a.name, pkg_b.name);
}
public Alpm.List<unowned Alpm.Package?> search_all_dbs (Alpm.Handle handle, Alpm.List<string?> needles) {
var syncpkgs = new Alpm.List<unowned Alpm.Package?> ();
var result = handle.localdb.search (needles);
foreach (var db in handle.syncdbs) {
if (syncpkgs.length == 0)
syncpkgs = db.search (needles);
else {
syncpkgs.join (db.search (needles).diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp));
}
}
result.join (syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp));
//result.sort ((Alpm.List.CompareFunc) pkgcmp);
return result;
public int compare_state (Alpm.Package pkg_a, Alpm.Package pkg_b) {
return (int) (pkg_a.origin > pkg_b.origin) - (int) (pkg_a.origin < pkg_b.origin);
}
public Alpm.List<unowned Alpm.Package?> group_pkgs (Alpm.Handle handle, string grp_name) {
var result = new Alpm.List<unowned Alpm.Package?> ();
unowned Alpm.Group? grp = handle.localdb.get_group (grp_name);
if (grp != null) {
foreach (var pkg in grp.packages)
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);
return result;
public int compare_version (Alpm.Package pkg_a, Alpm.Package pkg_b) {
return Alpm.pkg_vercmp (pkg_a.version, pkg_b.version);
}
public Alpm.List<unowned Alpm.Package?> all_pkgs (Alpm.Handle handle) {
var syncpkgs = new Alpm.List<unowned Alpm.Package?> ();
var result = new Alpm.List<unowned Alpm.Package?> ();
result = handle.localdb.pkgcache.copy ();
foreach (var db in handle.syncdbs) {
if (syncpkgs.length == 0)
syncpkgs = db.pkgcache.copy ();
else {
syncpkgs.join (db.pkgcache.diff (syncpkgs, (Alpm.List.CompareFunc) pkgcmp));
}
}
result.join (syncpkgs.diff (result, (Alpm.List.CompareFunc) pkgcmp));
//result.sort ((Alpm.List.CompareFunc) pkgcmp);
public int compare_repo (Alpm.Package pkg_a, Alpm.Package pkg_b) {
return strcmp (pkg_a.db.name, pkg_b.db.name);
}
return result;
public int compare_size (Alpm.Package pkg_a, Alpm.Package pkg_b) {
return (int) (pkg_a.isize > pkg_b.isize) - (int) (pkg_a.isize < pkg_b.isize);
}
/*
* pamac-vala
*
* Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a get of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Pamac.ManagerWindow manager_window;
// custom sort functions
public int aur_compare_name (Json.Object pkg_a, Json.Object pkg_b) {
return strcmp (pkg_a.get_string_member ("Name"), pkg_b.get_string_member ("Name"));
}
public int aur_compare_state (Json.Object pkg_a, Json.Object pkg_b) {
unowned Alpm.Package? alpm_pkg_a = manager_window.alpm_config.handle.localdb.get_pkg (pkg_a.get_string_member ("Name"));
unowned Alpm.Package? alpm_pkg_b = manager_window.alpm_config.handle.localdb.get_pkg (pkg_b.get_string_member ("Name"));
if (pkg_a != null) {
if (pkg_b != null) {
return (int) (alpm_pkg_a.origin > alpm_pkg_b.origin) - (int) (alpm_pkg_a.origin < alpm_pkg_b.origin);
} else {
return 1;
}
} else {
if (pkg_b != null) {
return -1;
} else {
return 0;
}
}
}
public int aur_compare_version (Json.Object pkg_a, Json.Object pkg_b) {
return Alpm.pkg_vercmp (pkg_a.get_string_member ("Version"), pkg_b.get_string_member ("Version"));
}
public int aur_compare_votes (Json.Object pkg_a, Json.Object pkg_b) {
return (int) (pkg_a.get_int_member ("NumVotes") > pkg_b.get_int_member ("NumVotes")) - (int) (pkg_a.get_int_member ("NumVotes") < pkg_b.get_int_member ("NumVotes"));
}
namespace Pamac {
public class AURModel : Object, Gtk.TreeModel {
private Json.Array pkgs_infos;
private GLib.List<Json.Object?> pkgs;
public AURModel (Json.Array? pkgs_infos, ManagerWindow _manager_window) {
manager_window = _manager_window;
this.pkgs_infos = pkgs_infos;
pkgs = new GLib.List<Json.Object?> ();
if (pkgs_infos != null) {
pkgs_infos.foreach_element ((array, index, node) => {
pkgs.append (node.get_object ());
});
}
}
// TreeModel interface
public Type get_column_type (int index) {
switch (index) {
case 0: // name
case 2: // version
return typeof (string);
case 3: // votes
return typeof (int64);
case 1: // icon
return typeof (Gdk.Pixbuf);
default:
return Type.INVALID;
}
}
public Gtk.TreeModelFlags get_flags () {
return Gtk.TreeModelFlags.LIST_ONLY | Gtk.TreeModelFlags.ITERS_PERSIST;
}
public void get_value (Gtk.TreeIter iter, int column, out Value val) {
unowned Json.Object? pkg_info = pkgs.nth_data (iter.stamp);
switch (column) {
case 0:
val = Value (typeof (string));
if (pkg_info == null) {
val.set_string (dgettext (null, "No package found"));
} else {
val.set_string (pkg_info.get_string_member ("Name"));
}
break;
case 1:
val = Value (typeof (Object));
if (pkg_info != null) {
unowned Alpm.Package? pkg = manager_window.alpm_config.handle.localdb.get_pkg (pkg_info.get_string_member ("Name"));
if (pkg != null) {
if (manager_window.alpm_config.holdpkgs.find_custom (pkg.name, strcmp) != null) {
val.set_object (manager_window.locked_icon);
} else if (manager_window.transaction.to_add.contains (pkg.name)) {
val.set_object (manager_window.to_reinstall_icon);
} else if (manager_window.transaction.to_remove.contains (pkg.name)) {
val.set_object (manager_window.to_remove_icon);
} else {
val.set_object (manager_window.installed_icon);
}
} else if (manager_window.transaction.to_build.contains (pkg_info.get_string_member ("Name"))) {
val.set_object (manager_window.to_install_icon);
} else {
val.set_object (manager_window.uninstalled_icon);
}
}
break;
case 2:
val = Value (typeof (string));
if (pkg_info != null) {
unowned Alpm.Package? pkg = manager_window.alpm_config.handle.localdb.get_pkg (pkg_info.get_string_member ("Name"));
if (pkg != null) {
val.set_string (pkg.version);
} else {
val.set_string (pkg_info.get_string_member ("Version"));
}
}
break;