- hideTitleBar tip
- android home widget err handle
- sftp loading dialog
This commit is contained in:
lollipopkit
2024-05-22 20:45:11 +08:00
parent 9304a0377b
commit 7c3818bc51
17 changed files with 131 additions and 78 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 904;
static const int build = 907;
static const String engine = "3.22.0";
static const String buildAt = "2024-05-20 16:10:12";
static const int modifications = 11;
static const int script = 47;
static const String buildAt = "2024-05-22 19:34:37";
static const int modifications = 14;
static const int script = 48;
}

View File

@@ -121,6 +121,7 @@
"goBackQ": "Zurückkommen?",
"goto": "Pfad öffnen",
"hideTitleBar": "Titelleiste ausblenden",
"hideTitleBarTip": "Nach dem Einschalten halten Sie bitte die drei Tasten in der oberen rechten Ecke gedrückt, um sie zu ziehen.",
"highlight": "Code highlight",
"homeWidgetUrlConfig": "Home-Widget-Link konfigurieren",
"host": "Host",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Go back?",
"goto": "Go to",
"hideTitleBar": "Hide title bar",
"hideTitleBarTip": "After turning it on, please hold down the three buttons in the top right corner to drag.",
"highlight": "Code highlight",
"homeWidgetUrlConfig": "Config home widget url",
"host": "Host",

View File

@@ -121,6 +121,7 @@
"goBackQ": "¿Regresar?",
"goto": "Ir a",
"hideTitleBar": "Ocultar barra de título",
"hideTitleBarTip": "Después de encenderlo, mantenga presionados los tres botones en la esquina superior derecha para arrastrar.",
"highlight": "Resaltar código",
"homeWidgetUrlConfig": "Configuración de URL del widget de inicio",
"host": "Anfitrión",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Revenir en arrière ?",
"goto": "Aller à",
"hideTitleBar": "Masquer la barre de titre",
"hideTitleBarTip": "Après l'avoir allumé, veuillez maintenir les trois boutons dans le coin supérieur droit pour les faire glisser.",
"highlight": "Mise en surbrillance du code",
"homeWidgetUrlConfig": "Configurer l'URL du widget d'accueil",
"host": "Hôte",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Datang kembali?",
"goto": "Pergi ke",
"hideTitleBar": "Sembunyikan bilah judul",
"hideTitleBarTip": "Setelah dinyalakan, tekan dan tahan tiga tombol di sudut kanan atas untuk menyeret.",
"highlight": "Sorotan kode",
"homeWidgetUrlConfig": "Konfigurasi URL Widget Rumah",
"host": "Host",

View File

@@ -121,6 +121,7 @@
"goBackQ": "戻りますか?",
"goto": "移動",
"hideTitleBar": "タイトルバーを非表示にする",
"hideTitleBarTip": "電源を入れた後、右上隅の3つのボタンを押し続けてドラッグしてください。",
"highlight": "コードハイライト",
"homeWidgetUrlConfig": "ホームウィジェットURL設定",
"host": "ホスト",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Terug gaan?",
"goto": "Ga naar",
"hideTitleBar": "Titelbalk verbergen",
"hideTitleBarTip": "Houd na het inschakelen de drie knoppen in de rechterbovenhoek ingedrukt om te slepen.",
"highlight": "Code-highlight",
"homeWidgetUrlConfig": "Home-widget-url configureren",
"host": "Host",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Voltar?",
"goto": "Ir para",
"hideTitleBar": "Ocultar barra de título",
"hideTitleBarTip": "Após ligar, segure os três botões no canto superior direito para arrastar.",
"highlight": "Destaque de código",
"homeWidgetUrlConfig": "Configuração de URL do widget da tela inicial",
"host": "Host",

View File

@@ -121,6 +121,7 @@
"goBackQ": "Вернуться?",
"goto": "перейти к",
"hideTitleBar": "Скрыть заголовок",
"hideTitleBarTip": "После включения удерживайте три кнопки в правом верхнем углу, чтобы перетаскивать.",
"highlight": "подсветка кода",
"homeWidgetUrlConfig": "конфигурация URL виджета домашнего экрана",
"host": "хост",

View File

@@ -121,6 +121,7 @@
"goBackQ": "返回?",
"goto": "前往",
"hideTitleBar": "隐藏标题栏",
"hideTitleBarTip": "开启后请按住右上角三个按钮来拖动",
"highlight": "代码高亮",
"homeWidgetUrlConfig": "桌面部件链接配置",
"host": "主机",

View File

@@ -121,6 +121,7 @@
"goBackQ": "返回?",
"goto": "前往",
"hideTitleBar": "隱藏標題欄",
"hideTitleBarTip": "開啟後請按住右上角三個按鈕來拖動",
"highlight": "代碼高亮",
"homeWidgetUrlConfig": "桌面部件鏈接配置",
"host": "主機",

View File

@@ -1088,6 +1088,7 @@ class _SettingPageState extends State<SettingPage> {
Widget _buildHideTitleBar() {
return ListTile(
title: Text(l10n.hideTitleBar),
subtitle: Text(l10n.hideTitleBarTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.hideTitleBar),
);
}

View File

@@ -428,8 +428,12 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
final result = await AppRoutes.editor(path: localPath).go<bool>(context);
if (result != null && result) {
Pros.sftp
.add(SftpReq(req.spi, remotePath, localPath, SftpReqType.upload));
Pros.sftp.add(SftpReq(
req.spi,
remotePath,
localPath,
SftpReqType.upload,
));
context.showSnackBar(l10n.added2List);
}
}
@@ -471,8 +475,10 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
final useRmr = Stores.setting.sftpRmrDir.fetch();
final text = () {
if (isDir && !useRmr) {
return l10n
.askContinue('${l10n.dirEmpty}\n${l10n.delete} ${file.filename}');
return l10n.askContinue(
'${l10n.dirEmpty}\n${l10n.delete} '
'${file.filename}',
);
}
return l10n.askContinue('${l10n.delete} ${file.filename}');
}();
@@ -498,20 +504,10 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
await _status.client!.remove(remotePath);
}
});
} catch (e) {
context.showRoundDialog(
title: l10n.error,
child: Text(e.toString()),
actions: [
TextButton(
onPressed: () => context.pop(),
child: Text(l10n.ok),
)
],
);
return;
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Delete', s);
}
_listDir();
},
child: Text(l10n.delete, style: UIs.textRed),
),
@@ -549,10 +545,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
);
return;
}
final dir = '${_status.path!.path}/${textController.text}';
await _status.client!.mkdir(dir);
context.pop();
_listDir();
try {
await context.showLoadingDialog(fn: () async {
final dir = '${_status.path!.path}/${textController.text}';
await _status.client!.mkdir(dir);
});
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Create folder', s);
}
},
child: Text(l10n.ok, style: UIs.textRed),
),
@@ -588,10 +590,15 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
return;
}
context.pop();
final path = '${_status.path!.path}/${textController.text}';
await context.showLoadingDialog(
fn: () => _client!.run('touch "$path"'));
_listDir();
try {
await context.showLoadingDialog(fn: () async {
final path = '${_status.path!.path}/${textController.text}';
await _client!.run('touch "$path"');
});
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Create file', s);
}
},
child: Text(l10n.ok, style: UIs.textRed),
),
@@ -627,9 +634,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
);
return;
}
await _status.client?.rename(file.filename, textController.text);
context.pop();
_listDir();
try {
await context.showLoadingDialog(fn: () async {
final newName = textController.text;
await _status.client?.rename(file.filename, newName);
});
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Rename', s);
}
},
child: Text(l10n.rename, style: UIs.textRed),
),
@@ -658,6 +672,21 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
_listDir();
}
Future<void> _showErrDialog(
BuildContext ctx, Object e, String op, StackTrace s) async {
Loggers.app.warning('$op failed', e, s);
return ctx.showRoundDialog(
title: l10n.error,
child: Text(e.toString()),
actions: [
TextButton(
onPressed: () => ctx.pop(),
child: Text(l10n.ok),
),
],
);
}
String _getRemotePath(SftpName name) {
final prePath = _status.path!.path;
// Only support Linux as remote now, so the seperator is '/'