Skip to content

Commit

Permalink
opt.: sftp rename
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed Sep 25, 2023
1 parent 4d06a52 commit 153bfc1
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 53 deletions.
36 changes: 18 additions & 18 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -596,7 +596,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -720,7 +720,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -730,7 +730,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -748,7 +748,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -758,7 +758,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -779,7 +779,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -792,7 +792,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
Expand All @@ -818,7 +818,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -831,7 +831,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -854,7 +854,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -867,7 +867,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -890,7 +890,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -902,7 +902,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
Expand Down Expand Up @@ -931,7 +931,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -943,7 +943,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand All @@ -969,7 +969,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -981,7 +981,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand Down
8 changes: 4 additions & 4 deletions lib/data/res/build_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class BuildData {
static const String name = "ServerBox";
static const int build = 575;
static const int build = 577;
static const String engine = "3.13.5";
static const String buildAt = "2023-09-24 15:59:57";
static const int modifications = 13;
static const int script = 18;
static const String buildAt = "2023-09-25 18:52:38";
static const int modifications = 3;
static const int script = 19;
}
36 changes: 19 additions & 17 deletions lib/view/page/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,6 @@ class _EditorPageState extends State<EditorPage> {
backgroundColor: _codeTheme['root']?.backgroundColor,
appBar: _buildAppBar(),
body: _buildBody(),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.done),
onPressed: () async {
// If path is not null, then it's a file editor
// save the text and return true to pop the page
if (widget.path != null) {
context.showLoadingDialog();
await File(widget.path!).writeAsString(_controller.text);
context.pop();
context.pop(true);
return;
}
// else it's a text editor
// return the text to the previous page
context.pop(_controller.text);
},
),
);
}

Expand All @@ -130,6 +113,7 @@ class _EditorPageState extends State<EditorPage> {
actions: [
PopupMenuButton<String>(
icon: const Icon(Icons.language),
tooltip: l10n.language,
onSelected: (value) {
_controller.language = Highlights.all[value];
_langCode = value;
Expand All @@ -143,6 +127,24 @@ class _EditorPageState extends State<EditorPage> {
);
}).toList();
},
),
IconButton(
icon: const Icon(Icons.save),
tooltip: l10n.save,
onPressed: () async {
// If path is not null, then it's a file editor
// save the text and return true to pop the page
if (widget.path != null) {
context.showLoadingDialog();
await File(widget.path!).writeAsString(_controller.text);
context.pop();
context.pop(true);
return;
}
// else it's a text editor
// return the text to the previous page
context.pop(_controller.text);
},
)
],
);
Expand Down
2 changes: 1 addition & 1 deletion lib/view/page/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class _HomePageState extends State<HomePage>
text: text,
langCode: 'json',
title: l10n.setting,
).go(context);
).go<String>(context);
if (result == null) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/view/page/setting/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class _IOSSettingsPageState extends State<IOSSettingsPage> {
text: text,
langCode: 'json',
title: 'Watch app',
).go(context);
).go<String>(context);
if (result == null) {
return;
}
Expand Down
6 changes: 2 additions & 4 deletions lib/view/page/storage/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,8 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
}
final result = await AppRoute.editor(
path: file.absolute.path,
).go<String>(context);
final f = File(file.absolute.path);
if (result != null) {
f.writeAsString(result);
).go<bool>(context);
if (result == true) {
context.showSnackBar(l10n.saved);
setState(() {});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/view/page/storage/sftp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {

void _rename(SftpName file) {
context.pop();
final textController = TextEditingController();
final textController = TextEditingController(text: file.filename);
context.showRoundDialog(
title: Text(l10n.rename),
child: Input(
Expand Down
2 changes: 1 addition & 1 deletion lib/view/widget/omit_start_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ class OmitStartText extends StatelessWidget {
);
});
}
}
}
12 changes: 6 additions & 6 deletions macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,9 @@
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -491,9 +491,9 @@
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -506,9 +506,9 @@
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 575;
CURRENT_PROJECT_VERSION = 577;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.575;
MARKETING_VERSION = 1.0.577;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down

0 comments on commit 153bfc1

Please sign in to comment.