Skip to content

Commit db0fa0d

Browse files
fix critical windows bug with cmd prompt on process spawn and wrap text in custom text field properly
1 parent 4d76281 commit db0fa0d

File tree

8 files changed

+56
-32
lines changed

8 files changed

+56
-32
lines changed

lib/screens/settings/basic_settings.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BasicSettingsScreen extends StatelessWidget {
5454
CustomTextField(
5555
title: 'Output file name (press enter to save)',
5656
subtitle:
57-
"This will define the output filename if you don't like the default ones,\nEach file will be appeded with a _1, _2 when needed",
57+
"This will define the output filename if you don't like the default ones. Each file will be appeded with a _1, _2 when needed",
5858
onEditingComplete: () => context.read<SettingsBloc>().add(
5959
SaveSettingsEvent(
6060
state.settingsModel.copyWith(
@@ -129,7 +129,7 @@ class BasicSettingsScreen extends StatelessWidget {
129129
title: 'Delay (ms)',
130130
intOnly: true,
131131
subtitle:
132-
'For srt/sami/webvtt, add this number of milliseconds to all times.\nYou can also use negative numbers to make subs appear early.',
132+
'For srt/sami/webvtt, add this number of milliseconds to all times.You can also use negative numbers to make subs appear early.',
133133
onEditingComplete: () => context.read<SettingsBloc>().add(
134134
SaveSettingsEvent(
135135
state.settingsModel.copyWith(

lib/screens/settings/components/custom_textfield.dart

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:ccxgui/utils/responsive.dart';
33
import 'package:flutter/material.dart';
44
import 'package:flutter/services.dart';
55

6-
//TODO: warp lines properly
76
class CustomTextField extends StatefulWidget {
87
final String title;
98
final String subtitle;
@@ -32,26 +31,29 @@ class _CustomTextFieldState extends State<CustomTextField> {
3231
return Padding(
3332
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
3433
child: Row(
34+
mainAxisSize: MainAxisSize.min,
3535
mainAxisAlignment: MainAxisAlignment.spaceBetween,
3636
children: [
37-
Column(
38-
crossAxisAlignment: CrossAxisAlignment.start,
39-
children: [
40-
Text(
41-
widget.title,
42-
style: TextStyle(
43-
color: Colors.white,
44-
fontSize: 16,
37+
Expanded(
38+
child: Column(
39+
crossAxisAlignment: CrossAxisAlignment.start,
40+
children: [
41+
Text(
42+
widget.title,
43+
style: TextStyle(
44+
color: Colors.white,
45+
fontSize: 16,
46+
),
4547
),
46-
),
47-
Text(
48-
widget.subtitle,
49-
style: TextStyle(
50-
color: Colors.grey.shade400,
51-
fontSize: 13,
48+
Text(
49+
widget.subtitle,
50+
style: TextStyle(
51+
color: Colors.grey.shade400,
52+
fontSize: 13,
53+
),
5254
),
53-
),
54-
],
55+
],
56+
),
5557
),
5658
Container(
5759
color: kBgLightColor,

lib/screens/settings/input_settings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class InputSettingsScreen extends StatelessWidget {
101101
CustomTextField(
102102
title: 'Continuous stream',
103103
subtitle:
104-
"Consider the file as a continuous stream that is growing as ccextractor processes it\nso don't try to figure out its size and don't terminate processing when reaching the current end",
104+
"Consider the file as a continuous stream that is growing as ccextractor processes it so don't try to figure out its size and don't terminate processing when reaching the current end",
105105
intOnly: true,
106106
onEditingComplete: () => context.read<SettingsBloc>().add(
107107
SaveSettingsEvent(

lib/screens/settings/obscure_settings.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Flutter imports:
22
import 'package:ccxgui/screens/settings/components/custom_divider.dart';
3+
import 'package:ccxgui/screens/settings/components/custom_textfield.dart';
34
import 'package:flutter/material.dart';
45
import 'package:flutter/rendering.dart';
56

@@ -26,6 +27,8 @@ class ObscureSettingsScreen extends StatelessWidget {
2627
);
2728
}
2829
if (state is CurrentSettingsState) {
30+
TextEditingController programNumberController =
31+
TextEditingController(text: state.settingsModel.program_number);
2932
return Scaffold(
3033
appBar: AppBar(
3134
title: Text(
@@ -99,7 +102,20 @@ class ObscureSettingsScreen extends StatelessWidget {
99102
);
100103
},
101104
),
102-
//TODO: add program-number?
105+
CustomTextField(
106+
title: 'Program number',
107+
subtitle:
108+
'In TS mode, specifically select a program to process.',
109+
intOnly: true,
110+
onEditingComplete: () => context.read<SettingsBloc>().add(
111+
SaveSettingsEvent(
112+
state.settingsModel.copyWith(
113+
program_number: programNumberController.text,
114+
),
115+
),
116+
),
117+
controller: programNumberController,
118+
),
103119
CustomSwitchListTile(
104120
title: 'Multiprogram',
105121
subtitle:

pubspec.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.6.1"
31+
version: "2.7.0"
3232
bloc:
3333
dependency: "direct main"
3434
description:
@@ -112,7 +112,7 @@ packages:
112112
name: charcode
113113
url: "https://pub.dartlang.org"
114114
source: hosted
115-
version: "1.2.0"
115+
version: "1.3.1"
116116
checked_yaml:
117117
dependency: transitive
118118
description:
@@ -409,7 +409,7 @@ packages:
409409
name: meta
410410
url: "https://pub.dartlang.org"
411411
source: hosted
412-
version: "1.3.0"
412+
version: "1.7.0"
413413
mime:
414414
dependency: transitive
415415
description:
@@ -647,7 +647,7 @@ packages:
647647
name: test_api
648648
url: "https://pub.dartlang.org"
649649
source: hosted
650-
version: "0.3.0"
650+
version: "0.4.1"
651651
timing:
652652
dependency: transitive
653653
description:
@@ -700,7 +700,7 @@ packages:
700700
window_size:
701701
dependency: "direct main"
702702
description:
703-
path: "plugins/window_size"
703+
path: "plugins\\window_size"
704704
ref: HEAD
705705
resolved-ref: e48abe7c3e9ebfe0b81622167c5201d4e783bb81
706706
url: "git://github.com/google/flutter-desktop-embedding.git"

windows/flutter/generated_plugin_registrant.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#include "generated_plugin_registrant.h"
68

79
#include <file_selector_windows/file_selector_plugin.h>

windows/flutter/generated_plugin_registrant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#ifndef GENERATED_PLUGIN_REGISTRANT_
68
#define GENERATED_PLUGIN_REGISTRANT_
79

windows/runner/main.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
99
_In_ wchar_t *command_line, _In_ int show_command) {
10-
// Attach to console when present (e.g., 'flutter run') or create a
11-
// new console when running with a debugger.
12-
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13-
CreateAndAttachConsole();
14-
}
15-
10+
// Attach to console when present (e.g., 'flutter run') or create a
11+
// new console when running with a debugger.
12+
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13+
CreateAndAttachConsole();
14+
} else {
15+
AllocConsole();
16+
ShowWindow(GetConsoleWindow(), SW_HIDE);
17+
}
1618
// Initialize COM, so that it is available for use in the library and/or
1719
// plugins.
1820
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);

0 commit comments

Comments
 (0)