Skip to content

Commit c4a993d

Browse files
committed
forgot these files :(
1 parent a1041d7 commit c4a993d

4 files changed

Lines changed: 93 additions & 1 deletion

File tree

src/main/kotlin/de/shadowdara/videoconverter/Main.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.shadowdara.videoconverter
22

3+
import de.shadowdara.daras_library.io.JarExtractor.extractFile
34
import de.shadowdara.daras_library.io.getCallerJarDirectory
45
import java.io.File
56
import javax.swing.*
@@ -52,3 +53,9 @@ fun runCommand(vararg command: String): Pair<Int, String> {
5253
-1 to e.message.orEmpty()
5354
}
5455
}
56+
57+
fun extractInfo() {
58+
extractFile("profile-info/de.html", "profile-info/de.html")
59+
extractFile("profile-info/en.html", "profile-info/en.html")
60+
extractFile("profile-info/style.css", "profile-info/style.css")
61+
}

src/main/kotlin/de/shadowdara/videoconverter/UI.kt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package de.shadowdara.videoconverter
22

3+
import de.shadowdara.daras_library.io.BrowserOpener.openFileInBrowser
4+
import de.shadowdara.daras_library.io.getCallerJarDirectory
5+
import de.shadowdara.daras_library.io.getJarDirectory
36
import java.awt.BorderLayout
47
import java.awt.Component
58
import java.awt.Dimension
9+
import java.io.File
610
import javax.swing.BorderFactory
711
import javax.swing.Box
812
import javax.swing.BoxLayout
@@ -33,6 +37,54 @@ fun createUI(profileNames: Array<String>, config: Config) {
3337
var selectedFiles: List<String> = emptyList()
3438
var selectedExportFolder: String = ""
3539

40+
// Info Button
41+
val openInfoButton = JButton("Open Profile Info")
42+
openInfoButton.alignmentX = Component.LEFT_ALIGNMENT
43+
44+
openInfoButton.addActionListener {
45+
// Neues Fenster mit mehreren Buttons öffnen
46+
val infoFrame = JFrame("Info Window").apply {
47+
defaultCloseOperation = JFrame.DISPOSE_ON_CLOSE
48+
setSize(300, 300)
49+
setLocationRelativeTo(frame)
50+
}
51+
52+
val panel = JPanel()
53+
panel.layout = BoxLayout(panel, BoxLayout.Y_AXIS)
54+
55+
val button1 = JButton("Profile Info DE")
56+
val button2 = JButton("Profile Info EN")
57+
58+
button1.addActionListener {
59+
extractInfo()
60+
61+
val basePath: String = getCallerJarDirectory().toString()
62+
val relativePath: String = "profile-info/de.html"
63+
64+
// Variante mit File → .path
65+
val filePath = File(basePath, relativePath).path
66+
openFileInBrowser(filePath)
67+
}
68+
69+
button2.addActionListener {
70+
extractInfo()
71+
72+
val basePath: String = getCallerJarDirectory().toString()
73+
val relativePath: String = "profile-info/en.html"
74+
75+
// Variante mit File → .path
76+
val filePath = File(basePath, relativePath).path
77+
openFileInBrowser(filePath)
78+
}
79+
80+
// Buttons zum Panel hinzufügen
81+
panel.add(button1)
82+
panel.add(button2)
83+
84+
infoFrame.contentPane.add(panel)
85+
infoFrame.isVisible = true
86+
}
87+
3688
// Choose Files Button
3789
val chooseFileButton = JButton("Choose Files")
3890
chooseFileButton.alignmentX = Component.LEFT_ALIGNMENT
@@ -125,6 +177,7 @@ fun createUI(profileNames: Array<String>, config: Config) {
125177

126178
// UI zusammenbauen
127179
mainPanel.add(title)
180+
mainPanel.add(openInfoButton)
128181
mainPanel.add(chooseFileButton)
129182
mainPanel.add(chosenFilesLabel)
130183
mainPanel.add(chooseExportFolderButton)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-core-jvm/1.9.0/kotlinx-serialization-core-jvm-1.9.0.jar
22
https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.9.0/kotlinx-serialization-json-jvm-1.9.0.jar
33
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.9.0/kotlin-stdlib-1.9.0.jar
4-
https://github.com/ShadowDara/daras_library/releases/download/v0.1.2/daras_library-0.1.2-SNAPSHOT.jar
4+
https://github.com/ShadowDara/daras_library/releases/download/v0.1.4/daras_library-0.1.4-SNAPSHOT.jar
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
background-color: #f8f8f8;
4+
color: #333;
5+
max-width: 1000px;
6+
margin: 2rem auto;
7+
padding: 1rem;
8+
}
9+
10+
h1 {
11+
text-align: center;
12+
color: #222;
13+
}
14+
15+
.profile {
16+
background: #fff;
17+
padding: 1rem;
18+
margin-bottom: 1rem;
19+
border-left: 6px solid #007acc;
20+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
21+
}
22+
23+
.profile h2 {
24+
margin-top: 0;
25+
}
26+
27+
.profile code {
28+
background: #eee;
29+
padding: 0.2rem 0.4rem;
30+
border-radius: 3px;
31+
font-family: monospace;
32+
}

0 commit comments

Comments
 (0)