Skip to content

Commit de60697

Browse files
authored
Merge pull request #264 from bostrot/upgrade-packages
Upgrade packages
2 parents 16f6ef0 + dae7af6 commit de60697

File tree

9 files changed

+204
-169
lines changed

9 files changed

+204
-169
lines changed

.github/workflows/publisher.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: Empty for latest tag or specify a tag to publish
88
type: string
99
release:
10-
types: [published]
10+
types: [created]
1111

1212
jobs:
1313
# Publish to Microsoft Store

lib/api/wsl.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ class WSLApi {
7575
{String startPath = '',
7676
String startUser = '',
7777
String startCmd = ''}) async {
78-
List<String> args = ['wsl', '-d', distribution];
78+
List<String> args = [];
79+
args.addAll(['wsl', '-d', distribution]);
7980
if (startPath != '') {
8081
args.addAll(['--cd', startPath]);
8182
}
@@ -91,7 +92,6 @@ class WSLApi {
9192
}
9293
await Process.start('start', args,
9394
mode: ProcessStartMode.detached, runInShell: true);
94-
9595
if (kDebugMode) {
9696
print("Done starting $distribution");
9797
}
@@ -201,12 +201,15 @@ class WSLApi {
201201
mode: ProcessStartMode.normal, runInShell: true);
202202
}
203203

204-
/// Start Windows Terminal\
205-
/// *(falls back to PowerShell on exception)*
204+
/// Start Windows Terminal or PowerShell
206205
void startWindowsTerminal(String distribution) async {
207206
List<String> launchWslHome = ['wsl', '-d', distribution, '--cd', '~'];
208207
try {
209-
await Process.start('wt', launchWslHome);
208+
// Run windows terminal in same window wt -w 0 nt
209+
var args = ['wt', '-w', '0', 'nt'];
210+
args.addAll(launchWslHome);
211+
212+
await Process.run('start', args);
210213
} catch (_) {
211214
// Windows Terminal not installed
212215
Notify.message('openwithwt-not-found-error'.i18n());

lib/components/list_item.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,6 @@ class Bar extends StatelessWidget {
210210
),
211211
),
212212
),
213-
Tooltip(
214-
message: 'openwithwt-text'.i18n(),
215-
child: MouseRegion(
216-
cursor: SystemMouseCursors.click,
217-
child: IconButton(
218-
icon: const Icon(FluentIcons.power_shell, size: 16.0),
219-
onPressed: () {
220-
plausible.event(name: "wsl_wt");
221-
WSLApi().startWindowsTerminal(widget.item);
222-
},
223-
),
224-
),
225-
),
226213
Tooltip(
227214
message: 'openwithvscode-text'.i18n(),
228215
child: MouseRegion(

lib/nav/panelist.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ final List<NavigationPaneItem> originalItems = [
1414
title: Text('homepage-text'.i18n()),
1515
body: const SizedBox.shrink(),
1616
onTap: () {
17-
if (router.location != '/') router.pushNamed('home');
17+
if (router.routerDelegate.currentConfiguration.uri.toString() != '/') {
18+
router.pushNamed('home');
19+
}
1820
},
1921
),
2022
PaneItem(
@@ -23,7 +25,8 @@ final List<NavigationPaneItem> originalItems = [
2325
title: Text('managequickactions-text'.i18n()),
2426
body: const SizedBox.shrink(),
2527
onTap: () {
26-
if (router.location != '/quickactions') {
28+
if (router.routerDelegate.currentConfiguration.uri.toString() !=
29+
'/quickactions') {
2730
router.pushNamed('quickactions');
2831
}
2932
},
@@ -34,7 +37,8 @@ final List<NavigationPaneItem> originalItems = [
3437
title: Text('templates-text'.i18n()),
3538
body: const SizedBox.shrink(),
3639
onTap: () {
37-
if (router.location != '/templates') {
40+
if (router.routerDelegate.currentConfiguration.uri.toString() !=
41+
'/templates') {
3842
router.pushNamed('templates');
3943
}
4044
},
@@ -63,7 +67,8 @@ final List<NavigationPaneItem> footerItems = [
6367
title: Text('settings-text'.i18n()),
6468
body: const SizedBox.shrink(),
6569
onTap: () {
66-
if (router.location != '/settings') router.pushNamed('settings');
70+
if (router.routerDelegate.currentConfiguration.uri.toString() !=
71+
'/settings') router.pushNamed('settings');
6772
},
6873
),
6974
LinkPaneItemAction(

lib/nav/root_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class RootPageState extends State<RootPage> with WindowListener {
105105
}
106106

107107
int _calculateSelectedIndex(BuildContext context) {
108-
final location = router.location;
108+
final location = router.routerDelegate.currentConfiguration.uri.toString();
109109
int indexOriginal = originalItems
110110
.toList()
111111
.indexWhere((element) => element.key == Key(location));

0 commit comments

Comments
 (0)