diff --git a/linux/gtk/ui/devicewidget.d b/linux/gtk/ui/devicewidget.d index 3f92fd8..4c58257 100644 --- a/linux/gtk/ui/devicewidget.d +++ b/linux/gtk/ui/devicewidget.d @@ -32,6 +32,7 @@ import ui.utils; class DeviceWidget: PreferencesGroup { iDevice device; LockdowndClient lockdowndClient; + Window toolSelectionWindow; this(iDeviceInfo deviceInfo) { string udid = deviceInfo.udid; @@ -79,7 +80,7 @@ class DeviceWidget: PreferencesGroup { void showTools(iDevice device) { auto rootWindow = cast(Window) this.getRoot(); - auto toolSelectionWindow = new ToolSelectionWindow(rootWindow, device); + toolSelectionWindow = new ToolSelectionWindow(rootWindow, device); toolSelectionWindow.show(); } @@ -120,4 +121,10 @@ class DeviceWidget: PreferencesGroup { fileChooser.show(); } + + void closeWindows() { + if (toolSelectionWindow) { + toolSelectionWindow.close(); + } + } } diff --git a/linux/gtk/ui/mainwindow.d b/linux/gtk/ui/mainwindow.d index 6afccc6..6fd011f 100644 --- a/linux/gtk/ui/mainwindow.d +++ b/linux/gtk/ui/mainwindow.d @@ -117,7 +117,9 @@ class MainWindow: Window { void removeDeviceWidget(iDeviceInfo deviceId) { if (deviceId in deviceWidgets) { - deviceWidgets[deviceId].unparent(); + auto deviceWidget = deviceWidgets[deviceId]; + deviceWidget.unparent(); + deviceWidget.closeWindows(); deviceWidgets.remove(deviceId); if (deviceWidgets.length == 0) { connectDeviceLabel.show(); diff --git a/linux/gtk/ui/toolselectionwindow.d b/linux/gtk/ui/toolselectionwindow.d index 0ce8496..bec800f 100644 --- a/linux/gtk/ui/toolselectionwindow.d +++ b/linux/gtk/ui/toolselectionwindow.d @@ -58,7 +58,7 @@ class ToolSelectionWindow: Dialog { uiTry!(() => tool.run((string message, bool canCancel = true) { Tid parentTid = thisTid(); runInUIThread({ - auto messageDialog = new MessageDialog(this, DialogFlags.MODAL, MessageType.INFO, canCancel ? ButtonsType.OK_CANCEL : ButtonsType.OK, message); + auto messageDialog = new MessageDialog(this, DialogFlags.DESTROY_WITH_PARENT | DialogFlags.MODAL, MessageType.INFO, canCancel ? ButtonsType.OK_CANCEL : ButtonsType.OK, message); messageDialog.addOnResponse((response, _) { if (canCancel) { parentTid.send(response != ResponseType.OK); diff --git a/source/tools/sidestorepairingfile.d b/source/tools/sidestorepairingfile.d index 329fc5d..e44dabe 100644 --- a/source/tools/sidestorepairingfile.d +++ b/source/tools/sidestorepairingfile.d @@ -69,7 +69,7 @@ class SideStoreTool: Tool { } break; default: - if (notify("Unknown error, please check that the device is unlocked and trusts the computer (press OK to try again)")) { + if (notify("Unknown error, please check that the device is plugged correctly, unlocked and trusts the computer. (press OK to try again)")) { return; } break;