Add link to the help wiki

This commit is contained in:
Ming Ming 2021-08-18 12:24:50 +08:00
parent 26d45b5c32
commit a7a8825f0a
3 changed files with 23 additions and 1 deletions

View file

@ -653,6 +653,7 @@
}, },
"configButtonLabel": "CONFIG", "configButtonLabel": "CONFIG",
"useAsAlbumCoverTooltip": "Use as album cover", "useAsAlbumCoverTooltip": "Use as album cover",
"helpTooltip": "Help",
"changelogTitle": "Changelog", "changelogTitle": "Changelog",
"@changelogTitle": { "@changelogTitle": {

View file

@ -19,6 +19,19 @@
"metadataTaskProcessingNotification", "metadataTaskProcessingNotification",
"metadataTaskPauseNoWiFiNotification", "metadataTaskPauseNoWiFiNotification",
"configButtonLabel", "configButtonLabel",
"useAsAlbumCoverTooltip" "useAsAlbumCoverTooltip",
"helpTooltip"
],
"es": [
"helpTooltip"
],
"fr": [
"helpTooltip"
],
"ru": [
"helpTooltip"
] ]
} }

View file

@ -9,6 +9,7 @@ import 'package:nc_photos/pref.dart';
import 'package:nc_photos/theme.dart'; import 'package:nc_photos/theme.dart';
import 'package:nc_photos/widget/account_picker_dialog.dart'; import 'package:nc_photos/widget/account_picker_dialog.dart';
import 'package:nc_photos/widget/settings.dart'; import 'package:nc_photos/widget/settings.dart';
import 'package:url_launcher/url_launcher.dart';
/// AppBar for home screens /// AppBar for home screens
class HomeSliverAppBar extends StatelessWidget { class HomeSliverAppBar extends StatelessWidget {
@ -99,6 +100,10 @@ class HomeSliverAppBar extends StatelessWidget {
value: _menuValueAbout, value: _menuValueAbout,
child: Text(L10n.of(context).settingsMenuLabel), child: Text(L10n.of(context).settingsMenuLabel),
), ),
PopupMenuItem(
value: _menuValueHelp,
child: Text(L10n.of(context).helpTooltip),
),
], ],
onSelected: (option) { onSelected: (option) {
if (option >= 0) { if (option >= 0) {
@ -107,6 +112,8 @@ class HomeSliverAppBar extends StatelessWidget {
if (option == _menuValueAbout) { if (option == _menuValueAbout) {
Navigator.of(context).pushNamed(Settings.routeName, Navigator.of(context).pushNamed(Settings.routeName,
arguments: SettingsArguments(account)); arguments: SettingsArguments(account));
} else if (option == _menuValueHelp) {
launch("https://gitlab.com/nkming2/nc-photos/-/wikis/home");
} }
} }
}, },
@ -132,4 +139,5 @@ class HomeSliverAppBar extends StatelessWidget {
final void Function(int)? onSelectedMenuActions; final void Function(int)? onSelectedMenuActions;
static const _menuValueAbout = -1; static const _menuValueAbout = -1;
static const _menuValueHelp = -2;
} }