From 3cdaf5db5598bb0df7c67015fc8a8b6f9575cbcf Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 18 Apr 2023 14:07:10 -0700 Subject: [PATCH 1/4] Upgrade Cwtch --- LIBCWTCH-GO.version | 2 +- lib/main.dart | 2 +- lib/settings.dart | 3 +++ lib/views/globalsettingsview.dart | 17 +++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index 8cf6253a..078b0378 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2023-04-17-10-52-v0.0.3-15-gf485e37 \ No newline at end of file +2023-04-18-13-51-v0.0.3-16-ge12afc9 \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index f972a018..449b4026 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -131,7 +131,7 @@ class FlwtchState extends State with WindowListener { key: Key('app'), navigatorKey: navKey, locale: settings.locale, - showPerformanceOverlay: false, + showPerformanceOverlay: settings.profileMode, localizationsDelegates: >[ AppLocalizations.delegate, MaterialLocalizationDelegate(), diff --git a/lib/settings.dart b/lib/settings.dart index 956fd5b9..e1f94305 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -69,6 +69,9 @@ class Settings extends ChangeNotifier { String get torCacheDir => _torCacheDir; + // Whether to show the profiling interface, not saved + bool profileMode = false; + set useSemanticDebugger(bool newval) { this._useSemanticDebugger = newval; notifyListeners(); diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index fda4ca89..549b031f 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -545,6 +545,23 @@ class _GlobalSettingsViewState extends State { child: SelectableText(AppLocalizations.of(context)!.versionBuilddate.replaceAll("%1", EnvironmentConfig.BUILD_VER).replaceAll("%2", EnvironmentConfig.BUILD_DATE)), ) ]), + SwitchListTile( + title: Text("Show Performance Overlay", style: TextStyle(color: settings.current().mainTextColor)), + subtitle: Text("Display an overlay graph of render time."), + value: settings.profileMode, + onChanged: (bool value) { + setState(() { + if (value) { + settings.profileMode = value; + } else { + settings.profileMode = value; + } + }); + }, + activeTrackColor: settings.theme.defaultButtonActiveColor, + inactiveTrackColor: settings.theme.defaultButtonDisabledColor, + secondary: Icon(Icons.bar_chart, color: settings.current().mainTextColor), + ), Visibility( visible: EnvironmentConfig.BUILD_VER == dev_version && !Platform.isAndroid, child: SwitchListTile( From 75026ad57f4fbb5a82baa0653373061ae0c3287c Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 18 Apr 2023 14:09:36 -0700 Subject: [PATCH 2/4] Upgrade VerifyOrResume API --- android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt | 2 +- lib/cwtch/ffi.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt index 3b3c4d85..7f19e000 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt @@ -442,7 +442,7 @@ class MainActivity: FlutterActivity() { val profile: String = call.argument("ProfileOnion") ?: "" val conversation: Int = call.argument("conversation") ?: 0 val fileKey: String = call.argument("fileKey") ?: "" - Cwtch.verifyOrResumeDownload(profile, conversation.toLong(), fileKey) + Cwtch.verifyOrResumeDownloadDefaultLimit(profile, conversation.toLong(), fileKey) } "UpdateSettings" -> { val json: String = call.argument("json") ?: "" diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index b5ed651c..5c70e7bc 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -498,7 +498,7 @@ class CwtchFfi implements Cwtch { @override // ignore: non_constant_identifier_names void VerifyOrResumeDownload(String profileOnion, int contactHandle, String filekey) { - var fn = library.lookup>("c_VerifyOrResumeDownload"); + var fn = library.lookup>("c_VerifyOrResumeDownloadDefaultLimit"); // ignore: non_constant_identifier_names final VerifyOrResumeDownload = fn.asFunction(); final u1 = profileOnion.toNativeUtf8(); From 8cd1bec07b7eb6f941802fddb03aee87bd3ac0b0 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 18 Apr 2023 14:11:36 -0700 Subject: [PATCH 3/4] Add Translate TODO --- lib/views/globalsettingsview.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 549b031f..30f1fc18 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -546,6 +546,7 @@ class _GlobalSettingsViewState extends State { ) ]), SwitchListTile( + // TODO: Translate, Remove, OR Hide Prior to Release title: Text("Show Performance Overlay", style: TextStyle(color: settings.current().mainTextColor)), subtitle: Text("Display an overlay graph of render time."), value: settings.profileMode, From cbe78ff2a76ac8b2e39003d1badca48630819e5d Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 18 Apr 2023 14:13:54 -0700 Subject: [PATCH 4/4] Notify Listeners for ProfileMode --- lib/settings.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/settings.dart b/lib/settings.dart index e1f94305..74eb7af8 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -70,7 +70,13 @@ class Settings extends ChangeNotifier { String get torCacheDir => _torCacheDir; // Whether to show the profiling interface, not saved - bool profileMode = false; + bool _profileMode = false; + + bool get profileMode => _profileMode; + set profileMode(bool newval) { + this._profileMode = newval; + notifyListeners(); + } set useSemanticDebugger(bool newval) { this._useSemanticDebugger = newval;