Browse Source

Merge branch 'master' into dev

pull/311/head
Eric Kok 9 years ago
parent
commit
7027ba4eff
  1. 18
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java
  2. 2
      app/src/main/java/org/transdroid/daemon/Daemon.java
  3. 5
      app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

18
app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java

@ -92,13 +92,17 @@ public class NavigationHelper {
return true; return true;
if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) {
// Never asked again: show a dialog with an explanation // Never asked again: show a dialog with an explanation
new MaterialDialog.Builder(context).content(R.string.permission_readtorrent).positiveText(android.R.string.ok) activity.runOnUiThread(new Runnable() {
.onPositive(new MaterialDialog.SingleButtonCallback() { public void run() {
@Override new MaterialDialog.Builder(context).content(R.string.permission_readtorrent).positiveText(android.R.string.ok)
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { .onPositive(new MaterialDialog.SingleButtonCallback() {
ActivityCompat.requestPermissions(activity, new String[]{permission}, requestCode); @Override
} public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
}).show(); ActivityCompat.requestPermissions(activity, new String[]{permission}, requestCode);
}
}).show();
}
});
return false; return false;
} }
// Permission not granted (and we asked for it already before) // Permission not granted (and we asked for it already before)

2
app/src/main/java/org/transdroid/daemon/Daemon.java

@ -364,7 +364,7 @@ public enum Daemon {
} }
public static boolean supportsForceRecheck(Daemon type) { public static boolean supportsForceRecheck(Daemon type) {
return type == uTorrent || type == BitTorrent || type == Deluge || type == rTorrent || type == Transmission || type == Dummy; return type == uTorrent || type == BitTorrent || type == Deluge || type == rTorrent || type == Transmission || type == Dummy || type == qBittorrent;
} }
public static boolean supportsExtraPassword(Daemon type) { public static boolean supportsExtraPassword(Daemon type) {

5
app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

@ -298,6 +298,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
} }
return new DaemonTaskSuccessResult(task); return new DaemonTaskSuccessResult(task);
case ForceRecheck:
// Force recheck a torrent
makeRequest(log, "/command/recheck", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
return new DaemonTaskSuccessResult(task);
case SetTransferRates: case SetTransferRates:
// TODO: This doesn't seem to work yet // TODO: This doesn't seem to work yet

Loading…
Cancel
Save