|
|
@ -42,7 +42,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final defaultCategoryOption = SelectOption<DefaultCategory>( |
|
|
|
late final defaultCategoryOption = SelectOption<DefaultCategory>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: generalCategory, |
|
|
|
category: generalCategory, |
|
|
|
key: 'default-category', |
|
|
|
key: NewsOptionKeys.defaultCategory, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultCategory, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultCategory, |
|
|
|
defaultValue: DefaultCategory.articles, |
|
|
|
defaultValue: DefaultCategory.articles, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -55,7 +55,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final articleViewTypeOption = SelectOption<ArticleViewType>( |
|
|
|
late final articleViewTypeOption = SelectOption<ArticleViewType>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: articlesCategory, |
|
|
|
category: articlesCategory, |
|
|
|
key: 'article-view-type', |
|
|
|
key: NewsOptionKeys.articleViewType, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticleViewType, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticleViewType, |
|
|
|
defaultValue: ArticleViewType.direct, |
|
|
|
defaultValue: ArticleViewType.direct, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -71,7 +71,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final articleDisableMarkAsReadTimeoutOption = ToggleOption( |
|
|
|
late final articleDisableMarkAsReadTimeoutOption = ToggleOption( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: articlesCategory, |
|
|
|
category: articlesCategory, |
|
|
|
key: 'article-disable-mark-as-read-timeout', |
|
|
|
key: NewsOptionKeys.articleDisableMarkAsReadTimeout, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticleDisableMarkAsReadTimeout, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticleDisableMarkAsReadTimeout, |
|
|
|
defaultValue: false, |
|
|
|
defaultValue: false, |
|
|
|
); |
|
|
|
); |
|
|
@ -79,7 +79,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final defaultArticlesFilterOption = SelectOption<FilterType>( |
|
|
|
late final defaultArticlesFilterOption = SelectOption<FilterType>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: articlesCategory, |
|
|
|
category: articlesCategory, |
|
|
|
key: 'default-articles-filter', |
|
|
|
key: NewsOptionKeys.defaultArticlesFilter, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultArticlesFilter, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultArticlesFilter, |
|
|
|
defaultValue: FilterType.unread, |
|
|
|
defaultValue: FilterType.unread, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -92,7 +92,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final articlesSortPropertyOption = SelectOption<ArticlesSortProperty>( |
|
|
|
late final articlesSortPropertyOption = SelectOption<ArticlesSortProperty>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: articlesCategory, |
|
|
|
category: articlesCategory, |
|
|
|
key: 'articles-sort-property', |
|
|
|
key: NewsOptionKeys.articlesSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticlesSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticlesSortProperty, |
|
|
|
defaultValue: ArticlesSortProperty.publishDate, |
|
|
|
defaultValue: ArticlesSortProperty.publishDate, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -107,7 +107,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final articlesSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
late final articlesSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: articlesCategory, |
|
|
|
category: articlesCategory, |
|
|
|
key: 'articles-sort-box-order', |
|
|
|
key: NewsOptionKeys.articlesSortBoxOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticlesSortOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsArticlesSortOrder, |
|
|
|
defaultValue: SortBoxOrder.descending, |
|
|
|
defaultValue: SortBoxOrder.descending, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
@ -116,7 +116,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final foldersSortPropertyOption = SelectOption<FoldersSortProperty>( |
|
|
|
late final foldersSortPropertyOption = SelectOption<FoldersSortProperty>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: foldersCategory, |
|
|
|
category: foldersCategory, |
|
|
|
key: 'folders-sort-property', |
|
|
|
key: NewsOptionKeys.foldersSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFoldersSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFoldersSortProperty, |
|
|
|
defaultValue: FoldersSortProperty.alphabetical, |
|
|
|
defaultValue: FoldersSortProperty.alphabetical, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -130,7 +130,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final foldersSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
late final foldersSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: foldersCategory, |
|
|
|
category: foldersCategory, |
|
|
|
key: 'folders-sort-box-order', |
|
|
|
key: NewsOptionKeys.foldersSortBoxOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFoldersSortOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFoldersSortOrder, |
|
|
|
defaultValue: SortBoxOrder.ascending, |
|
|
|
defaultValue: SortBoxOrder.ascending, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
@ -139,7 +139,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final defaultFolderViewTypeOption = SelectOption<DefaultFolderViewType>( |
|
|
|
late final defaultFolderViewTypeOption = SelectOption<DefaultFolderViewType>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: foldersCategory, |
|
|
|
category: foldersCategory, |
|
|
|
key: 'default-folder-view-type', |
|
|
|
key: NewsOptionKeys.defaultFolderViewType, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultFolderViewType, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsDefaultFolderViewType, |
|
|
|
defaultValue: DefaultFolderViewType.articles, |
|
|
|
defaultValue: DefaultFolderViewType.articles, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -151,7 +151,7 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final feedsSortPropertyOption = SelectOption<FeedsSortProperty>( |
|
|
|
late final feedsSortPropertyOption = SelectOption<FeedsSortProperty>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: feedsCategory, |
|
|
|
category: feedsCategory, |
|
|
|
key: 'feeds-sort-property', |
|
|
|
key: NewsOptionKeys.feedsSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFeedsSortProperty, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFeedsSortProperty, |
|
|
|
defaultValue: FeedsSortProperty.alphabetical, |
|
|
|
defaultValue: FeedsSortProperty.alphabetical, |
|
|
|
values: { |
|
|
|
values: { |
|
|
@ -165,13 +165,32 @@ class NewsAppSpecificOptions extends NextcloudAppOptions { |
|
|
|
late final feedsSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
late final feedsSortBoxOrderOption = SelectOption<SortBoxOrder>( |
|
|
|
storage: super.storage, |
|
|
|
storage: super.storage, |
|
|
|
category: feedsCategory, |
|
|
|
category: feedsCategory, |
|
|
|
key: 'feeds-sort-box-order', |
|
|
|
key: NewsOptionKeys.feedsSortBoxOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFeedsSortOrder, |
|
|
|
label: (final context) => AppLocalizations.of(context).optionsFeedsSortOrder, |
|
|
|
defaultValue: SortBoxOrder.ascending, |
|
|
|
defaultValue: SortBoxOrder.ascending, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
|
values: sortBoxOrderOptionValues, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum NewsOptionKeys implements Storable { |
|
|
|
|
|
|
|
defaultCategory._('default-category'), |
|
|
|
|
|
|
|
articleViewType._('article-view-type'), |
|
|
|
|
|
|
|
articleDisableMarkAsReadTimeout._('article-disable-mark-as-read-timeout'), |
|
|
|
|
|
|
|
defaultArticlesFilter._('default-articles-filter'), |
|
|
|
|
|
|
|
articlesSortProperty._('articles-sort-property'), |
|
|
|
|
|
|
|
articlesSortBoxOrder._('articles-sort-box-order'), |
|
|
|
|
|
|
|
foldersSortProperty._('folders-sort-property'), |
|
|
|
|
|
|
|
foldersSortBoxOrder._('folders-sort-box-order'), |
|
|
|
|
|
|
|
defaultFolderViewType._('default-folder-view-type'), |
|
|
|
|
|
|
|
feedsSortProperty._('feeds-sort-property'), |
|
|
|
|
|
|
|
feedsSortBoxOrder._('feeds-sort-box-order'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const NewsOptionKeys._(this.value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
final String value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum DefaultCategory { |
|
|
|
enum DefaultCategory { |
|
|
|
articles, |
|
|
|
articles, |
|
|
|
folders, |
|
|
|
folders, |
|
|
|