Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemovableMedia: do not use yaru section #268

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,25 @@
"type": "Type",
"unknown": "Unknown",
"bluetoothOpenDeviceSettings": "Open device settings",
"bluetoothRemoveDevice" : "Remove device"
"bluetoothRemoveDevice" : "Remove device",
"removableMediaNeverAsk" : "Never ask or start a program for any removable media",
"removableMediaAudioCd" : "Audio CD",
"removableMediaDvdVideo" : "DVD-Videos",
"removableMediaMusicPlayer" : "Music Player",
"removableMediaPhotos" : "Photos",
"removableMediaApplications" : "Applications",
"removableMediaAudioDvd" : "AudioDVD",
"removableMediaBlankBd" : "Blank BD",
"removableMediaBlankCd" : "Blank CD",
"removableMediaBlankDvd" : "BlankDVD",
"removableMediaBlankHdDvd" : "Blank HD DVD",
"removableMediaEbookReader" : "Ebook Reader",
"removableMediaImagePictureCd" : "Image Picture CD",
"removableMediaOstreeRepository" : "Ostree Repository",
"removableMediaSoftware" : "Software",
"removableMediaVideoBlueray" : "Video Blueray",
"removableMediaVideoHdDvd" : "Video HD DVD",
"removableMediaVideoSvCd" : "Video SV CD",
"removableMediaVideoVCd" : "Video V CD",
"removableMediaWindowsSoftware" : "Windows Software"
}
53 changes: 24 additions & 29 deletions lib/view/pages/removable_media/removable_media_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/constants.dart';
import 'package:settings/l10n/l10n.dart';
import 'package:settings/services/settings_service.dart';
import 'package:settings/view/pages/removable_media/removable_media_model.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
Expand All @@ -22,35 +23,29 @@ class RemovableMediaPage extends StatelessWidget {

return YaruPage(
children: [
YaruSection(
width: kDefaultWidth,
headline: 'Removable Media',
children: [
Padding(
padding: const EdgeInsets.only(top: 8, right: 8, bottom: 8),
child: YaruCheckboxRow(
enabled: true,
value: model.autoRunNever,
onChanged: (value) => model.autoRunNever = value!,
text:
'Never ask or start a program for any removable media'),
),
if (!model.autoRunNever)
for (var mimeType in RemovableMediaModel.mimeTypes.entries)
YaruRow(
enabled: !model.autoRunNever,
trailingWidget: Text(mimeType.value),
actionWidget: DropdownButton<String>(
value: model.getMimeTypeBehavior(mimeType.key),
onChanged: (string) =>
model.setMimeTypeBehavior(string!, mimeType.key),
items: [
for (var string
in RemovableMediaModel.mimeTypeBehaviors)
DropdownMenuItem(
child: Text(string), value: string),
])),
]),
YaruSwitchRow(
width: kDefaultWidth,
trailingWidget: Text(context.l10n.removableMediaNeverAsk),
value: model.autoRunNever,
onChanged: (value) => model.autoRunNever = value,
),
const SizedBox(
height: 20,
),
if (!model.autoRunNever)
for (var mimeType in RemovableMediaModel.mimeTypes.entries)
YaruRow(
width: kDefaultWidth,
enabled: !model.autoRunNever,
trailingWidget: Text(mimeType.value),
actionWidget: DropdownButton<String>(
value: model.getMimeTypeBehavior(mimeType.key),
onChanged: (string) =>
model.setMimeTypeBehavior(string!, mimeType.key),
items: [
for (var string in RemovableMediaModel.mimeTypeBehaviors)
DropdownMenuItem(child: Text(string), value: string),
])),
],
);
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "2.4.1"
xdg_directories:
dependency: transitive
description:
Expand Down Expand Up @@ -891,10 +891,10 @@ packages:
description:
path: "."
ref: HEAD
resolved-ref: "9a76fcc83756e5eba3ac5240b7278e4a1a70384c"
resolved-ref: "591f4805d0a245ae9c804968ba461ee71c8031fd"
url: "https://github.com/ubuntu/yaru_widgets.dart"
source: git
version: "1.0.3"
version: "1.0.4"
sdks:
dart: ">=2.16.0-100.0.dev <3.0.0"
flutter: ">=2.5.0"