diff --git a/core/res/drawable-hdpi/ic_action_priority_high_dark.png b/core/res/drawable-hdpi/ic_action_priority_high_dark.png
new file mode 100644
index 00000000..84478f76
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_high_dark.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_high_light.png b/core/res/drawable-hdpi/ic_action_priority_high_light.png
new file mode 100644
index 00000000..4edf7a36
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_high_light.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_low_dark.png b/core/res/drawable-hdpi/ic_action_priority_low_dark.png
new file mode 100644
index 00000000..8802cad4
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_low_dark.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_low_light.png b/core/res/drawable-hdpi/ic_action_priority_low_light.png
new file mode 100644
index 00000000..23ada0ca
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_low_light.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_normal_dark.png b/core/res/drawable-hdpi/ic_action_priority_normal_dark.png
new file mode 100644
index 00000000..7f7890f2
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_normal_dark.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_normal_light.png b/core/res/drawable-hdpi/ic_action_priority_normal_light.png
new file mode 100644
index 00000000..0246a1b7
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_normal_light.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_off_dark.png b/core/res/drawable-hdpi/ic_action_priority_off_dark.png
new file mode 100644
index 00000000..ab37b556
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_off_dark.png differ
diff --git a/core/res/drawable-hdpi/ic_action_priority_off_light.png b/core/res/drawable-hdpi/ic_action_priority_off_light.png
new file mode 100644
index 00000000..7bf6101d
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_priority_off_light.png differ
diff --git a/core/res/drawable-hdpi/ic_action_trackers_dark.png b/core/res/drawable-hdpi/ic_action_trackers_dark.png
new file mode 100644
index 00000000..97231b91
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_trackers_dark.png differ
diff --git a/core/res/drawable-hdpi/ic_action_trackers_light.png b/core/res/drawable-hdpi/ic_action_trackers_light.png
new file mode 100644
index 00000000..89fa0cd0
Binary files /dev/null and b/core/res/drawable-hdpi/ic_action_trackers_light.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_high_dark.png b/core/res/drawable-mdpi/ic_action_priority_high_dark.png
new file mode 100644
index 00000000..9cfeeebc
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_high_dark.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_high_light.png b/core/res/drawable-mdpi/ic_action_priority_high_light.png
new file mode 100644
index 00000000..bef007c6
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_high_light.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_low_dark.png b/core/res/drawable-mdpi/ic_action_priority_low_dark.png
new file mode 100644
index 00000000..89927f63
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_low_dark.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_low_light.png b/core/res/drawable-mdpi/ic_action_priority_low_light.png
new file mode 100644
index 00000000..44e768fa
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_low_light.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_normal_dark.png b/core/res/drawable-mdpi/ic_action_priority_normal_dark.png
new file mode 100644
index 00000000..7dd2c7bd
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_normal_dark.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_normal_light.png b/core/res/drawable-mdpi/ic_action_priority_normal_light.png
new file mode 100644
index 00000000..4a471f36
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_normal_light.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_off_dark.png b/core/res/drawable-mdpi/ic_action_priority_off_dark.png
new file mode 100644
index 00000000..8d9c72d5
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_off_dark.png differ
diff --git a/core/res/drawable-mdpi/ic_action_priority_off_light.png b/core/res/drawable-mdpi/ic_action_priority_off_light.png
new file mode 100644
index 00000000..d7766bc2
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_priority_off_light.png differ
diff --git a/core/res/drawable-mdpi/ic_action_trackers_dark.png b/core/res/drawable-mdpi/ic_action_trackers_dark.png
new file mode 100644
index 00000000..539bad7d
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_trackers_dark.png differ
diff --git a/core/res/drawable-mdpi/ic_action_trackers_light.png b/core/res/drawable-mdpi/ic_action_trackers_light.png
new file mode 100644
index 00000000..f9c51464
Binary files /dev/null and b/core/res/drawable-mdpi/ic_action_trackers_light.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_high_dark.png b/core/res/drawable-xhdpi/ic_action_priority_high_dark.png
new file mode 100644
index 00000000..5932124c
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_high_dark.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_high_light.png b/core/res/drawable-xhdpi/ic_action_priority_high_light.png
new file mode 100644
index 00000000..c20807d6
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_high_light.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_low_dark.png b/core/res/drawable-xhdpi/ic_action_priority_low_dark.png
new file mode 100644
index 00000000..d0b6ba5f
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_low_dark.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_low_light.png b/core/res/drawable-xhdpi/ic_action_priority_low_light.png
new file mode 100644
index 00000000..abf14070
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_low_light.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_normal_dark.png b/core/res/drawable-xhdpi/ic_action_priority_normal_dark.png
new file mode 100644
index 00000000..8c1f81af
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_normal_dark.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_normal_light.png b/core/res/drawable-xhdpi/ic_action_priority_normal_light.png
new file mode 100644
index 00000000..9405ed21
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_normal_light.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_off_dark.png b/core/res/drawable-xhdpi/ic_action_priority_off_dark.png
new file mode 100644
index 00000000..f6b9ff22
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_off_dark.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_priority_off_light.png b/core/res/drawable-xhdpi/ic_action_priority_off_light.png
new file mode 100644
index 00000000..4424a0c3
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_priority_off_light.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_trackers_dark.png b/core/res/drawable-xhdpi/ic_action_trackers_dark.png
new file mode 100644
index 00000000..2caf74c9
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_trackers_dark.png differ
diff --git a/core/res/drawable-xhdpi/ic_action_trackers_light.png b/core/res/drawable-xhdpi/ic_action_trackers_light.png
new file mode 100644
index 00000000..b607e604
Binary files /dev/null and b/core/res/drawable-xhdpi/ic_action_trackers_light.png differ
diff --git a/core/res/menu/fragment_details.xml b/core/res/menu/fragment_details.xml
index 9434251e..ac38581d 100644
--- a/core/res/menu/fragment_details.xml
+++ b/core/res/menu/fragment_details.xml
@@ -42,6 +42,7 @@
android:title="@string/action_setlabel" />
diff --git a/core/res/menu/fragment_details_file.xml b/core/res/menu/fragment_details_file.xml
index 64116eb7..d0f4a8ba 100644
--- a/core/res/menu/fragment_details_file.xml
+++ b/core/res/menu/fragment_details_file.xml
@@ -2,18 +2,22 @@
+
+
+
+
@@ -18,6 +22,7 @@
+
diff --git a/core/res/values/styles.xml b/core/res/values/styles.xml
index eaf53d89..1d68bca0 100644
--- a/core/res/values/styles.xml
+++ b/core/res/values/styles.xml
@@ -9,6 +9,10 @@
- @drawable/ic_action_labels_light
- @drawable/ic_action_new_light
- @drawable/ic_action_pause_light
+ - @drawable/ic_action_priority_off_light
+ - @drawable/ic_action_priority_low_light
+ - @drawable/ic_action_priority_normal_light
+ - @drawable/ic_action_priority_high_light
- @drawable/ic_action_refresh_light
- @drawable/ic_action_remove_light
- @drawable/ic_action_resume_light
@@ -17,6 +21,7 @@
- @drawable/ic_action_sort_by_size_light
- @drawable/ic_action_start_light
- @drawable/ic_action_stop_light
+ - @drawable/ic_action_trackers_light
- @drawable/ic_action_website_light
- @drawable/loading_progress_light
- @drawable/selectable_background_transdroid2
@@ -33,6 +38,10 @@
- @drawable/ic_action_labels_dark
- @drawable/ic_action_new_dark
- @drawable/ic_action_pause_dark
+ - @drawable/ic_action_priority_off_dark
+ - @drawable/ic_action_priority_low_dark
+ - @drawable/ic_action_priority_normal_dark
+ - @drawable/ic_action_priority_high_dark
- @drawable/ic_action_refresh_dark
- @drawable/ic_action_remove_dark
- @drawable/ic_action_resume_dark
@@ -41,6 +50,7 @@
- @drawable/ic_action_sort_by_size_dark
- @drawable/ic_action_start_dark
- @drawable/ic_action_stop_dark
+ - @drawable/ic_action_trackers_dark
- @drawable/ic_action_website_dark
- @drawable/loading_progress_light
- @drawable/selectable_background_transdroid
diff --git a/core/src/org/transdroid/core/gui/DetailsFragment.java b/core/src/org/transdroid/core/gui/DetailsFragment.java
index 859ecddd..4a2f78e6 100644
--- a/core/src/org/transdroid/core/gui/DetailsFragment.java
+++ b/core/src/org/transdroid/core/gui/DetailsFragment.java
@@ -274,9 +274,13 @@ public class DetailsFragment extends SherlockFragment {
mode.finish();
return true;
} else {
- Priority priority = Priority.Normal;
+ Priority priority = Priority.Off;
if (itemId == R.id.action_priority_low)
priority = Priority.Low;
+ if (itemId == R.id.action_priority_normal)
+ priority = Priority.Normal;
+ if (itemId == R.id.action_priority_high)
+ priority = Priority.High;
getTasksExecutor().updatePriority(torrent, checked, priority);
mode.finish();
return true;
diff --git a/core/src/org/transdroid/core/gui/TorrentsActivity.java b/core/src/org/transdroid/core/gui/TorrentsActivity.java
index 7eb21292..f54599d4 100644
--- a/core/src/org/transdroid/core/gui/TorrentsActivity.java
+++ b/core/src/org/transdroid/core/gui/TorrentsActivity.java
@@ -305,7 +305,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
navigationSpinnerAdapter.updateCurrentFilter(currentFilter);
// Clear the currently shown list of torrents and perhaps the details
- fragmentTorrents.clear();
+ fragmentTorrents.clear(true);
if (fragmentDetails != null && fragmentDetails.getActivity() != null) {
fragmentDetails.clear();
}
@@ -701,7 +701,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
DaemonTaskResult result = RemoveTask.create(currentConnection, torrent, withData).execute();
if (result instanceof DaemonTaskResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(withData ? R.string.result_removed_with_data
- : R.string.result_removed));
+ : R.string.result_removed, torrent.getName()));
} else {
onCommunicationError((DaemonTaskFailureResult) result, false);
}
diff --git a/core/src/org/transdroid/core/gui/TorrentsFragment.java b/core/src/org/transdroid/core/gui/TorrentsFragment.java
index 9857d2d6..4d70e720 100644
--- a/core/src/org/transdroid/core/gui/TorrentsFragment.java
+++ b/core/src/org/transdroid/core/gui/TorrentsFragment.java
@@ -95,10 +95,12 @@ public class TorrentsFragment extends SherlockFragment {
/**
* Clears the currently visible list of torrents.
+ * @param b
*/
- public void clear() {
+ public void clear(boolean clearError) {
this.torrents = null;
- this.connectionErrorMessage = null;
+ if (clearError)
+ this.connectionErrorMessage = null;
this.currentTextFilter = null;
this.currentNavigationFilter = null;
applyAllFilters();
@@ -264,7 +266,7 @@ public class TorrentsFragment extends SherlockFragment {
public void updateConnectionStatus(boolean hasAConnection) {
this.hasAConnection = hasAConnection;
if (!hasAConnection) {
- clear(); // Indirectly also calls updateViewVisibility()
+ clear(true); // Indirectly also calls updateViewVisibility()
} else {
updateViewVisibility();
}
@@ -278,7 +280,7 @@ public class TorrentsFragment extends SherlockFragment {
public void updateIsLoading(boolean isLoading) {
this.isLoading = isLoading;
if (isLoading) {
- clear(); // Indirectly also calls updateViewVisibility()
+ clear(true); // Indirectly also calls updateViewVisibility()
} else {
updateViewVisibility();
}
@@ -294,7 +296,7 @@ public class TorrentsFragment extends SherlockFragment {
this.connectionErrorMessage = connectionErrorMessage;
errorText.setText(connectionErrorMessage);
if (connectionErrorMessage != null) {
- clear(); // Indirectly also calls updateViewVisibility()
+ clear(false); // Indirectly also calls updateViewVisibility()
} else {
updateViewVisibility();
}
diff --git a/core/src/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java b/core/src/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java
index a7880a2b..1cd2b6f3 100644
--- a/core/src/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java
+++ b/core/src/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java
@@ -9,10 +9,16 @@ import android.graphics.RectF;
import android.util.AttributeSet;
import fr.marvinlabs.widget.CheckableRelativeLayout;
+/**
+ * A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far
+ * left indicating the priority of the represented file. The darker the green, the higher the priority, while grey means
+ * the file isn't downloaded at all.
+ * @author Eric Kok
+ */
public class TorrentFilePriorityLayout extends CheckableRelativeLayout {
private final float scale = getContext().getResources().getDisplayMetrics().density;
- private final int WIDTH = (int) (5 * scale + 0.5f);
+ private final int WIDTH = (int) (6 * scale + 0.5f);
private Priority priority = null;
private final Paint offPaint = new Paint();
@@ -34,10 +40,10 @@ public class TorrentFilePriorityLayout extends CheckableRelativeLayout {
}
private void initPaints() {
- offPaint.setColor(0xFF9E9E9E); // Grey
- lowPaint.setColor(0x778ACC12); // Very Light green
- normalPaint.setColor(0xBB8ACC12); // Light green
- highPaint.setColor(0xFF8ACC12); // Green
+ offPaint.setColor(0xFF9E9E9E); // Grey
+ lowPaint.setColor(0xFFC8E88E); // Light green
+ normalPaint.setColor(0xFF8ACC12); // Normal green
+ highPaint.setColor(0xFF4B6617); // Dark green
}
public void setPriority(Priority priority) {
@@ -56,7 +62,7 @@ public class TorrentFilePriorityLayout extends CheckableRelativeLayout {
if (priority == null) {
return;
}
-
+
switch (priority) {
case Low:
canvas.drawRect(fullRect, lowPaint);
diff --git a/core/src/org/transdroid/core/gui/lists/TorrentStatusLayout.java b/core/src/org/transdroid/core/gui/lists/TorrentStatusLayout.java
index 38d2cf7e..8f4d2865 100644
--- a/core/src/org/transdroid/core/gui/lists/TorrentStatusLayout.java
+++ b/core/src/org/transdroid/core/gui/lists/TorrentStatusLayout.java
@@ -9,10 +9,16 @@ import android.graphics.RectF;
import android.util.AttributeSet;
import fr.marvinlabs.widget.CheckableRelativeLayout;
+/**
+ * A relative layout that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left
+ * indicating the status of the represented torrent. Active downloads are blue, seeding torrents are green, errors are
+ * red, etc.
+ * @author Eric Kok
+ */
public class TorrentStatusLayout extends CheckableRelativeLayout {
private final float scale = getContext().getResources().getDisplayMetrics().density;
- private final int WIDTH = (int) (5 * scale + 0.5f);
+ private final int WIDTH = (int) (6 * scale + 0.5f);
private TorrentStatus status = null;
private final Paint inactiveDonePaint = new Paint();
@@ -42,6 +48,11 @@ public class TorrentStatusLayout extends CheckableRelativeLayout {
errorPaint.setColor(0xFFDE3939); // Red
}
+ /**
+ * Registers the status of the represented torrent and invalidates the view so the status colour will be updated
+ * accordingly.
+ * @param status
+ */
public void setStatus(TorrentStatus status) {
this.status = status;
this.invalidate();
diff --git a/lib/src/org/transdroid/daemon/Daemon.java b/lib/src/org/transdroid/daemon/Daemon.java
index fcd866a5..13cc27a2 100644
--- a/lib/src/org/transdroid/daemon/Daemon.java
+++ b/lib/src/org/transdroid/daemon/Daemon.java
@@ -217,7 +217,7 @@ public enum Daemon {
return 80;
}
case Deluge:
- return 8112;
+ return 8112;
case Transmission:
return 9091;
case Bitflu: