add setting to disable automatic clipboard access (#159)
This commit is contained in:
@@ -85,6 +85,7 @@ class GeneralSettings with FastEquatable {
|
||||
final bool doubleBackCloseTab;
|
||||
final Duration unassignedTabsAutoCleanInterval;
|
||||
final int maxSearchHistoryEntries;
|
||||
final bool allowClipboardAccess;
|
||||
|
||||
GeneralSettings({
|
||||
required this.themeMode,
|
||||
@@ -112,6 +113,7 @@ class GeneralSettings with FastEquatable {
|
||||
required this.doubleBackCloseTab,
|
||||
required this.unassignedTabsAutoCleanInterval,
|
||||
required this.maxSearchHistoryEntries,
|
||||
required this.allowClipboardAccess,
|
||||
});
|
||||
|
||||
GeneralSettings.withDefaults({
|
||||
@@ -140,6 +142,7 @@ class GeneralSettings with FastEquatable {
|
||||
bool? doubleBackCloseTab,
|
||||
Duration? unassignedTabsAutoCleanInterval,
|
||||
int? maxSearchHistoryEntries,
|
||||
bool? allowClipboardAccess,
|
||||
}) : themeMode = themeMode ?? ThemeMode.dark,
|
||||
enableReadability = enableReadability ?? true,
|
||||
enforceReadability = enforceReadability ?? false,
|
||||
@@ -168,7 +171,8 @@ class GeneralSettings with FastEquatable {
|
||||
doubleBackCloseTab = doubleBackCloseTab ?? true,
|
||||
unassignedTabsAutoCleanInterval =
|
||||
unassignedTabsAutoCleanInterval ?? Duration.zero,
|
||||
maxSearchHistoryEntries = maxSearchHistoryEntries ?? 5;
|
||||
maxSearchHistoryEntries = maxSearchHistoryEntries ?? 5,
|
||||
allowClipboardAccess = allowClipboardAccess ?? true;
|
||||
|
||||
factory GeneralSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$GeneralSettingsFromJson(json);
|
||||
@@ -202,5 +206,6 @@ class GeneralSettings with FastEquatable {
|
||||
doubleBackCloseTab,
|
||||
unassignedTabsAutoCleanInterval,
|
||||
maxSearchHistoryEntries,
|
||||
allowClipboardAccess,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ abstract class _$GeneralSettingsCWProxy {
|
||||
|
||||
GeneralSettings maxSearchHistoryEntries(int maxSearchHistoryEntries);
|
||||
|
||||
GeneralSettings allowClipboardAccess(bool allowClipboardAccess);
|
||||
|
||||
/// Creates a new instance with the provided field values.
|
||||
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
|
||||
///
|
||||
@@ -102,6 +104,7 @@ abstract class _$GeneralSettingsCWProxy {
|
||||
bool doubleBackCloseTab,
|
||||
Duration unassignedTabsAutoCleanInterval,
|
||||
int maxSearchHistoryEntries,
|
||||
bool allowClipboardAccess,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -217,6 +220,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
GeneralSettings maxSearchHistoryEntries(int maxSearchHistoryEntries) =>
|
||||
call(maxSearchHistoryEntries: maxSearchHistoryEntries);
|
||||
|
||||
@override
|
||||
GeneralSettings allowClipboardAccess(bool allowClipboardAccess) =>
|
||||
call(allowClipboardAccess: allowClipboardAccess);
|
||||
|
||||
@override
|
||||
/// Creates a new instance with the provided field values.
|
||||
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
|
||||
@@ -251,6 +258,7 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
Object? doubleBackCloseTab = const $CopyWithPlaceholder(),
|
||||
Object? unassignedTabsAutoCleanInterval = const $CopyWithPlaceholder(),
|
||||
Object? maxSearchHistoryEntries = const $CopyWithPlaceholder(),
|
||||
Object? allowClipboardAccess = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GeneralSettings(
|
||||
themeMode: themeMode == const $CopyWithPlaceholder() || themeMode == null
|
||||
@@ -399,6 +407,12 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
? _value.maxSearchHistoryEntries
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: maxSearchHistoryEntries as int,
|
||||
allowClipboardAccess:
|
||||
allowClipboardAccess == const $CopyWithPlaceholder() ||
|
||||
allowClipboardAccess == null
|
||||
? _value.allowClipboardAccess
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: allowClipboardAccess as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -474,6 +488,7 @@ GeneralSettings _$GeneralSettingsFromJson(
|
||||
.toInt(),
|
||||
),
|
||||
maxSearchHistoryEntries: (json['maxSearchHistoryEntries'] as num?)?.toInt(),
|
||||
allowClipboardAccess: json['allowClipboardAccess'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GeneralSettingsToJson(
|
||||
@@ -513,6 +528,7 @@ Map<String, dynamic> _$GeneralSettingsToJson(
|
||||
'unassignedTabsAutoCleanInterval':
|
||||
instance.unassignedTabsAutoCleanInterval.inMicroseconds,
|
||||
'maxSearchHistoryEntries': instance.maxSearchHistoryEntries,
|
||||
'allowClipboardAccess': instance.allowClipboardAccess,
|
||||
};
|
||||
|
||||
const _$ThemeModeEnumMap = {
|
||||
|
||||
Reference in New Issue
Block a user