Skip to content

Commit

Permalink
feat: button to open Saber folder
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Jul 26, 2024
1 parent 1dd7e25 commit e83355a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
49 changes: 49 additions & 0 deletions lib/i18n/_missing_translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ ar:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -135,7 +136,21 @@ ar:
bgPatterns:
tablature(OUTDATED): Tablature
cs:
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
de:
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
es:
common:
done(OUTDATED): Done
Expand All @@ -156,6 +171,7 @@ es:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -228,6 +244,7 @@ fa:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -294,6 +311,7 @@ fr:
off(OUTDATED): No sound
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -377,6 +395,7 @@ he:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -533,6 +552,7 @@ hu:
phone(OUTDATED): Phone
tablet(OUTDATED): Tablet
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -657,6 +677,13 @@ hu:
lockAxisAlignedPan(OUTDATED): Lock panning to horizontal or vertical
needsToSaveBeforeExiting(OUTDATED): Saving your changes... You can safely exit the editor when it's done
it:
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
ja:
common:
done(OUTDATED): Done
Expand Down Expand Up @@ -716,6 +743,7 @@ ja:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -810,6 +838,7 @@ pt-BR:
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
resyncEverything(OUTDATED): Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -874,6 +903,13 @@ pt-BR:
watchServer(OUTDATED): Watch for updates on the server
watchServerReadOnly(OUTDATED): Editing is disabled while watching the server
ru:
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
tr:
common:
done(OUTDATED): Done
Expand All @@ -887,6 +923,7 @@ tr:
off(OUTDATED): No sound
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
openDataDir: Open Saber folder
customDataDir:
cancel(OUTDATED): Cancel
select(OUTDATED): Select
Expand Down Expand Up @@ -942,12 +979,17 @@ zh-Hans-CN:
continueBtn(OUTDATED): Continue
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
pencilSoundSetting(OUTDATED): Pencil sound effect
prefDescriptions:
pencilSoundSetting:
off(OUTDATED): No sound
onButNotInSilentMode(OUTDATED): Enabled (unless in silent mode)
onAlways(OUTDATED): Enabled (even in silent mode)
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
login:
notYou(rich)(OUTDATED): "Not you? ${undoLogin(Choose another account)}."
status:
Expand Down Expand Up @@ -992,3 +1034,10 @@ zh-Hans-CN:
watchServer(OUTDATED): Watch for updates on the server
watchServerReadOnly(OUTDATED): Editing is disabled while watching the server
zh-Hant-TW:
settings:
prefLabels:
customDataDir(OUTDATED): Custom Saber folder
openDataDir: Open Saber folder
customDataDir:
mustBeEmpty(OUTDATED): Selected folder must be empty
mustBeDoneSyncing(OUTDATED): Make sure syncing is complete before changing the folder
1 change: 1 addition & 0 deletions lib/i18n/strings.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class _StringsSettingsEn {
];
late final _StringsSettingsResetEn reset = _StringsSettingsResetEn._(_root);
String get resyncEverything => 'Resync everything';
String get openDataDir => 'Open Saber folder';
late final _StringsSettingsCustomDataDirEn customDataDir = _StringsSettingsCustomDataDirEn._(_root);
}

Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings.i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ settings:
title: "Reset this setting?"
button: Reset
resyncEverything: Resync everything
openDataDir: Open Saber folder
customDataDir:
cancel: Cancel
select: Select
Expand Down
26 changes: 26 additions & 0 deletions lib/pages/home/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:saber/components/settings/update_manager.dart';
import 'package:saber/components/theming/adaptive_alert_dialog.dart';
import 'package:saber/components/theming/adaptive_toggle_buttons.dart';
import 'package:saber/data/editor/pencil_sound.dart';
import 'package:saber/data/file_manager/file_manager.dart';
import 'package:saber/data/flavor_config.dart';
import 'package:saber/data/locales.dart';
import 'package:saber/data/prefs.dart';
Expand Down Expand Up @@ -512,6 +513,31 @@ class _SettingsPageState extends State<SettingsPage> {
title: t.settings.prefLabels.customDataDir,
icon: Icons.folder,
),
if (Platform.isWindows ||
Platform.isLinux ||
Platform.isMacOS ||
Platform.isAndroid)
SettingsButton(
title: t.settings.openDataDir,
icon: Icons.folder_open,
onPressed: () {
if (Platform.isWindows) {
Process.run('explorer', [FileManager.documentsDirectory]);
} else if (Platform.isLinux) {
Process.run('xdg-open', [FileManager.documentsDirectory]);
} else if (Platform.isMacOS) {
Process.run('open', [FileManager.documentsDirectory]);
} else if (Platform.isAndroid) {
Process.run('am', [
'start',
'-a',
'android.intent.action.VIEW',
'-d',
'file://${FileManager.documentsDirectory}'
]);
}
},
),
if (requiresManualUpdates ||
Prefs.shouldCheckForUpdates.value !=
Prefs.shouldCheckForUpdates.defaultValue) ...[
Expand Down

0 comments on commit e83355a

Please sign in to comment.