File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+
12import androidx.compose.desktop.ui.tooling.preview.Preview
23import androidx.compose.foundation.layout.Arrangement
34import androidx.compose.foundation.layout.Column
@@ -28,6 +29,7 @@ import screen.translateDialog
2829import utils.WindowState
2930import utils.isValidXml
3031import utils.languageList
32+ import utils.openOutputFile
3133
3234@Composable
3335@Preview
@@ -157,6 +159,7 @@ fun App() {
157159 delay(3000 )
158160 isShowToast = false
159161 }
162+ openOutputFile()
160163 }
161164 })
162165 }
@@ -165,7 +168,5 @@ fun App() {
165168
166169 }
167170 }
168-
169-
170171 }
171172}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package utils
22
33import models.StringModel
44import org.w3c.dom.Element
5+ import java.awt.Desktop
56import java.io.File
67import javax.xml.parsers.DocumentBuilderFactory
78
@@ -73,4 +74,13 @@ fun isValidXml(xmlString: String): Boolean {
7374 } catch (e: Exception ) {
7475 false
7576 }
77+ }
78+
79+ fun openOutputFile () {
80+ val file = File (" output" )
81+ if (file.exists()) {
82+ if (Desktop .isDesktopSupported() && Desktop .getDesktop().isSupported(Desktop .Action .OPEN )) {
83+ Desktop .getDesktop().open(file)
84+ }
85+ }
7686}
You can’t perform that action at this time.
0 commit comments