mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-30 19:56:10 +00:00
Batch folder download
This commit is contained in:
parent
a21aa3e68f
commit
d423ebfa92
3 changed files with 16 additions and 2 deletions
|
@ -265,11 +265,12 @@ public interface DaoFolder {
|
||||||
|
|
||||||
@Query("UPDATE folder" +
|
@Query("UPDATE folder" +
|
||||||
" SET poll = :poll" +
|
" SET poll = :poll" +
|
||||||
|
", download = :download" +
|
||||||
", sync_days = :sync_days" +
|
", sync_days = :sync_days" +
|
||||||
", keep_days = :keep_days" +
|
", keep_days = :keep_days" +
|
||||||
" WHERE account = :account" +
|
" WHERE account = :account" +
|
||||||
" AND type = '" + EntityFolder.USER + "'")
|
" AND type = '" + EntityFolder.USER + "'")
|
||||||
int setFolderProperties(long account, boolean poll, int sync_days, int keep_days);
|
int setFolderProperties(long account, boolean poll, boolean download, int sync_days, int keep_days);
|
||||||
|
|
||||||
@Query("UPDATE folder SET keywords = :keywords WHERE id = :id")
|
@Query("UPDATE folder SET keywords = :keywords WHERE id = :id")
|
||||||
int setFolderKeywords(long id, String keywords);
|
int setFolderKeywords(long id, String keywords);
|
||||||
|
|
|
@ -623,6 +623,7 @@ public class FragmentFolders extends FragmentBase {
|
||||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_folder_all, null);
|
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_folder_all, null);
|
||||||
final CheckBox cbPoll = view.findViewById(R.id.cbPoll);
|
final CheckBox cbPoll = view.findViewById(R.id.cbPoll);
|
||||||
|
final CheckBox cbDownload = view.findViewById(R.id.cbDownload);
|
||||||
final EditText etSyncDays = view.findViewById(R.id.etSyncDays);
|
final EditText etSyncDays = view.findViewById(R.id.etSyncDays);
|
||||||
final EditText etKeepDays = view.findViewById(R.id.etKeepDays);
|
final EditText etKeepDays = view.findViewById(R.id.etKeepDays);
|
||||||
final CheckBox cbKeepAll = view.findViewById(R.id.cbKeepAll);
|
final CheckBox cbKeepAll = view.findViewById(R.id.cbKeepAll);
|
||||||
|
@ -641,6 +642,7 @@ public class FragmentFolders extends FragmentBase {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
args.putBoolean("poll", cbPoll.isChecked());
|
args.putBoolean("poll", cbPoll.isChecked());
|
||||||
|
args.putBoolean("download", cbDownload.isChecked());
|
||||||
args.putString("sync", etSyncDays.getText().toString());
|
args.putString("sync", etSyncDays.getText().toString());
|
||||||
args.putString("keep", cbKeepAll.isChecked()
|
args.putString("keep", cbKeepAll.isChecked()
|
||||||
? Integer.toString(Integer.MAX_VALUE)
|
? Integer.toString(Integer.MAX_VALUE)
|
||||||
|
@ -651,6 +653,7 @@ public class FragmentFolders extends FragmentBase {
|
||||||
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
||||||
long account = args.getLong("account");
|
long account = args.getLong("account");
|
||||||
boolean poll = args.getBoolean("poll");
|
boolean poll = args.getBoolean("poll");
|
||||||
|
boolean download = args.getBoolean("download");
|
||||||
String sync = args.getString("sync");
|
String sync = args.getString("sync");
|
||||||
String keep = args.getString("keep");
|
String keep = args.getString("keep");
|
||||||
|
|
||||||
|
@ -663,6 +666,7 @@ public class FragmentFolders extends FragmentBase {
|
||||||
db.folder().setFolderProperties(
|
db.folder().setFolderProperties(
|
||||||
account,
|
account,
|
||||||
poll,
|
poll,
|
||||||
|
download,
|
||||||
Integer.parseInt(sync),
|
Integer.parseInt(sync),
|
||||||
Integer.parseInt(keep));
|
Integer.parseInt(keep));
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,15 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvUser" />
|
app:layout_constraintTop_toBottomOf="@id/tvUser" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cbDownload"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="@string/title_download_folder"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/cbPoll" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSyncDays"
|
android:id="@+id/tvSyncDays"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -42,7 +51,7 @@
|
||||||
android:text="@string/title_sync_days"
|
android:text="@string/title_sync_days"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cbPoll" />
|
app:layout_constraintTop_toBottomOf="@id/cbDownload" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/etSyncDays"
|
android:id="@+id/etSyncDays"
|
||||||
|
|
Loading…
Reference in a new issue