mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 14:08:00 -06:00
feat+fix: Add option to set default download/share file type, fix typo in filter to query string, disable unused options in document filter
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:paperless_mobile/features/login/model/client_certificate.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/color_scheme_option.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_settings.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/file_download_type.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/view_type.dart';
|
||||
|
||||
class HiveBoxes {
|
||||
@@ -33,6 +34,7 @@ class HiveTypeIds {
|
||||
static const localUserAccount = 7;
|
||||
static const localUserAppState = 8;
|
||||
static const viewType = 9;
|
||||
static const fileDownloadType = 10;
|
||||
}
|
||||
|
||||
void registerHiveAdapters() {
|
||||
@@ -47,6 +49,7 @@ void registerHiveAdapters() {
|
||||
Hive.registerAdapter(LocalUserAccountAdapter());
|
||||
Hive.registerAdapter(LocalUserAppStateAdapter());
|
||||
Hive.registerAdapter(ViewTypeAdapter());
|
||||
Hive.registerAdapter(FileDownloadTypeAdapter());
|
||||
}
|
||||
|
||||
extension HiveSingleValueBox<T> on Box<T> {
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/color_scheme_option.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/file_download_type.dart';
|
||||
|
||||
part 'global_settings.g.dart';
|
||||
|
||||
@@ -22,11 +23,19 @@ class GlobalSettings with HiveObjectMixin {
|
||||
@HiveField(4)
|
||||
String? currentLoggedInUser;
|
||||
|
||||
@HiveField(5)
|
||||
FileDownloadType defaultDownloadType;
|
||||
|
||||
@HiveField(6)
|
||||
FileDownloadType defaultShareType;
|
||||
|
||||
GlobalSettings({
|
||||
required this.preferredLocaleSubtag,
|
||||
this.preferredThemeMode = ThemeMode.system,
|
||||
this.preferredColorSchemeOption = ColorSchemeOption.classic,
|
||||
this.showOnboarding = true,
|
||||
this.currentLoggedInUser,
|
||||
this.defaultDownloadType = FileDownloadType.alwaysAsk,
|
||||
this.defaultShareType = FileDownloadType.alwaysAsk,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user