34 lines
1.7 KiB
Dart
34 lines
1.7 KiB
Dart
/// 약속 (E6, 결정 10/22 ①): Windows 에서 예전 판이 저장한 X-plore 모양을 한 번만 묻는다.
|
|
/// [ExplorerSettings.styleAskPending] 일 때만 창을 띄우고, [바꾸기] 면 Total Commander, [그대로] 면 X-plore 를 둔다.
|
|
/// 어느 쪽이든 다시 묻지 않는다 (물었다는 표시는 설정 저장에 늘 들어감). 창 밖을 눌러 닫지 못한다 (답을 골라야 함).
|
|
library;
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../app/app_controller.dart';
|
|
import '../../l10n/tr.dart';
|
|
|
|
/// 물었으면 true (답과 상관없이). 물을 것이 없으면 false
|
|
Future<bool> askExplorerStyleOnce(BuildContext context, AppController c) async {
|
|
if (!c.settings.explorer.styleAskPending) return false;
|
|
c.settings.explorer.styleAskPending = false; // 창을 띄우는 동안 다시 부르면 또 띄우지 않게
|
|
final change = await showDialog<bool>(
|
|
context: context,
|
|
barrierDismissible: false,
|
|
builder: (ctx) => AlertDialog(
|
|
title: Text(tr('파일 탐색기 모양')),
|
|
content: Text(tr('Windows 의 처음 모양이 Total Commander 로 바뀌었습니다 (목록 · ".." · 아래 F3~F8 단추 줄). '
|
|
'지금 쓰는 X-plore 모양을 바꿀까요? 환경 설정 > 파일 탐색기 > 모양에서 언제든 바꿀 수 있습니다.')),
|
|
actions: [
|
|
TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(tr('그대로'))),
|
|
FilledButton(onPressed: () => Navigator.pop(ctx, true), child: Text(tr('바꾸기'))),
|
|
],
|
|
),
|
|
);
|
|
await c.updateSettings((x) {
|
|
x.explorer.styleAskPending = false;
|
|
if (change == true) x.explorer.style = 'totalcmd';
|
|
});
|
|
return true;
|
|
}
|