diff --git a/data/icons/actions/com.github.gabutakut.gabutdm.amchok.svg b/data/icons/actions/com.github.gabutakut.gabutdm.amchok.svg
new file mode 100644
index 0000000..1570af8
--- /dev/null
+++ b/data/icons/actions/com.github.gabutakut.gabutdm.amchok.svg
@@ -0,0 +1,167 @@
+
+
diff --git a/data/icons/actions/com.github.gabutakut.gabutdm.amchoking.svg b/data/icons/actions/com.github.gabutakut.gabutdm.amchoking.svg
new file mode 100644
index 0000000..84060bc
--- /dev/null
+++ b/data/icons/actions/com.github.gabutakut.gabutdm.amchoking.svg
@@ -0,0 +1,215 @@
+
+
diff --git a/data/icons/actions/com.github.gabutakut.gabutdm.peerchok.svg b/data/icons/actions/com.github.gabutakut.gabutdm.peerchok.svg
new file mode 100644
index 0000000..5a193fb
--- /dev/null
+++ b/data/icons/actions/com.github.gabutakut.gabutdm.peerchok.svg
@@ -0,0 +1,244 @@
+
+
diff --git a/data/icons/actions/com.github.gabutakut.gabutdm.peerchoking.svg b/data/icons/actions/com.github.gabutakut.gabutdm.peerchoking.svg
new file mode 100644
index 0000000..4d1c19d
--- /dev/null
+++ b/data/icons/actions/com.github.gabutakut.gabutdm.peerchoking.svg
@@ -0,0 +1,223 @@
+
+
diff --git a/data/meson.build b/data/meson.build
index 44076aa..366e8db 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -36,7 +36,11 @@ actions = [
'.cookie.svg',
'.opt.svg',
'.menu.svg',
- '.onactive.svg'
+ '.onactive.svg',
+ '.amchok.svg',
+ '.amchoking.svg',
+ '.peerchok.svg',
+ '.peerchoking.svg'
]
foreach m : actions
diff --git a/src/PeersRow.vala b/src/PeersRow.vala
index e65da12..8d5fd2f 100644
--- a/src/PeersRow.vala
+++ b/src/PeersRow.vala
@@ -26,6 +26,8 @@ namespace Gabut {
private Gtk.Label client_id;
private Gtk.Label upload_rate;
private Gtk.Image seeder_img;
+ private Gtk.Image imgamchok;
+ private Gtk.Image imgpeerchok;
private string _host;
public string host {
@@ -45,6 +47,7 @@ namespace Gabut {
}
set {
_peerschoking = value;
+ imgpeerchok.gicon = new ThemedIcon (_peerschoking);
}
}
@@ -88,7 +91,7 @@ namespace Gabut {
}
set {
_seeder = value;
- seeder_img.gicon = new ThemedIcon (bool.parse (_seeder)? "com.github.gabutakut.gabutdm" : "com.github.gabutakut.gabutdm.seed");
+ seeder_img.icon_name =_seeder;
}
}
@@ -99,6 +102,7 @@ namespace Gabut {
}
set {
_amchoking = value;
+ imgamchok.gicon = new ThemedIcon (_amchoking);
}
}
private string _bitfield;
@@ -166,6 +170,14 @@ namespace Gabut {
attributes = color_attribute (60000, 0, 0)
};
+ imgamchok = new Gtk.Image () {
+ valign = Gtk.Align.CENTER
+ };
+
+ imgpeerchok = new Gtk.Image () {
+ valign = Gtk.Align.CENTER
+ };
+
var grid = new Gtk.Grid () {
hexpand = true,
margin_start = 4,
@@ -185,6 +197,8 @@ namespace Gabut {
grid.attach (download_rate, 6, 0);
grid.attach (label_upload, 7, 0);
grid.attach (upload_rate, 8, 0);
+ grid.attach (imgpeerchok, 9, 0);
+ grid.attach (imgamchok, 10, 0);
child = grid;
}
}
diff --git a/src/Preferences.vala b/src/Preferences.vala
index 8e2974e..68816e0 100644
--- a/src/Preferences.vala
+++ b/src/Preferences.vala
@@ -631,14 +631,14 @@ namespace Gabut {
moreoptions.attach (local_port, 0, 3, 1, 1);
moreoptions.attach (headerlabel (_("BT Listen Port:"), 300), 0, 4, 1, 1);
moreoptions.attach (bt_listenport, 0, 5, 1, 1);
- moreoptions.attach (headerlabel (_("DHT Listen Port:"), 300), 0, 6, 1, 1);
- moreoptions.attach (dht_listenport, 0, 7, 1, 1);
+ moreoptions.attach (headerlabel (_("File Allocation:"), 300), 0, 6, 1, 1);
+ moreoptions.attach (allocate_button, 0, 7, 2, 1);
moreoptions.attach (headerlabel (_("RPC Max Request Size (in Byte):"), 300), 1, 0, 1, 1);
moreoptions.attach (maxrequest, 1, 1, 1, 1);
moreoptions.attach (headerlabel (_("Disk Cache (in Byte):"), 300), 1, 2, 1, 1);
moreoptions.attach (diskcache, 1, 3, 1, 1);
- moreoptions.attach (headerlabel (_("File Allocation:"), 300), 1, 4, 1, 1);
- moreoptions.attach (allocate_button, 1, 5, 1, 1);
+ moreoptions.attach (headerlabel (_("DHT Listen Port:"), 300), 1, 4, 1, 1);
+ moreoptions.attach (dht_listenport, 1, 5, 1, 1);
var dialognotify = new Gtk.CheckButton.with_label (_("Open dialog succes when download complete")) {
margin_top = 5,
diff --git a/src/Utils.vala b/src/Utils.vala
index d2fad20..ae8b22d 100644
--- a/src/Utils.vala
+++ b/src/Utils.vala
@@ -1735,14 +1735,17 @@ namespace Gabut {
if (regex.match_full (result, -1, 0, 0, out match_info)) {
while (match_info.matches ()) {
string peerid = GLib.Uri.unescape_string (match_info.fetch (6));
+ var peerschoking = bool.parse (match_info.fetch (5))? "com.github.gabutakut.gabutdm.peerchoking" : "com.github.gabutakut.gabutdm.peerchok";
+ var seeder = bool.parse (match_info.fetch (8))? "com.github.gabutakut.gabutdm" : "com.github.gabutakut.gabutdm.seed";
+ var amchoking = bool.parse (match_info.fetch (1))? "com.github.gabutakut.gabutdm.amchoking" : "com.github.gabutakut.gabutdm.amchok";
var peersrow = new PeersRow () {
host = @"$(match_info.fetch (4)):$(match_info.fetch (7))",
peerid = peerid != "" && peerid != null? get_peerid (peerid.slice (1, 3)) : "Unknow",
downloadspeed = GLib.format_size (int64.parse (match_info.fetch (3))),
uploadspeed = GLib.format_size (int64.parse (match_info.fetch (9))),
- peerschoking = match_info.fetch (5),
- seeder = match_info.fetch (8),
- amchoking = match_info.fetch (1),
+ peerschoking = peerschoking,
+ seeder = seeder,
+ amchoking = amchoking,
bitfield = match_info.fetch (2)
};
liststore.set (@"$(match_info.fetch (4)):$(match_info.fetch (7))", peersrow);