This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
116 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.soywiz.vitaorganizer.ext | ||
|
||
import java.awt.Desktop | ||
import java.net.URI | ||
import java.net.URISyntaxException | ||
import java.net.URL | ||
|
||
fun openWebpage(uri: URI) { | ||
val desktop = if (Desktop.isDesktopSupported()) Desktop.getDesktop() else null | ||
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { | ||
try { | ||
desktop.browse(uri) | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
} | ||
|
||
} | ||
} | ||
|
||
fun openWebpage(url: URL) = openWebpage(url.toURI()) | ||
|
||
fun openWebpage(url: String) = openWebpage(URL(url).toURI()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.soywiz.vitaorganizer.popups | ||
|
||
import com.soywiz.vitaorganizer.Texts | ||
import com.soywiz.vitaorganizer.VitaOrganizer | ||
import com.soywiz.vitaorganizer.ext.onClick | ||
import com.soywiz.vitaorganizer.ext.openWebpage | ||
import java.awt.* | ||
import javax.swing.* | ||
|
||
class AboutFrame() : JFrame(Texts.format("ABOUT_TITLE")) { | ||
fun JLinkLabel(text: String, link: String, extra: String = ""): JLabel { | ||
return JLabel("""<html><a href="$link">$text</a>$extra</html>""").apply { | ||
cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) | ||
}.onClick { | ||
openWebpage(link) | ||
} | ||
} | ||
|
||
fun Contibutor(text: String, link: String, role: String = ""): JComponent { | ||
return JLinkLabel(text, link, if (role.isNotEmpty()) " - $role" else "") | ||
} | ||
|
||
init { | ||
isResizable = false | ||
add(JPanel(BorderLayout()).apply { | ||
add(JLabel("VitaOrganizer ${VitaOrganizer.currentVersion}", SwingConstants.CENTER).apply { | ||
font = Font("Arial", Font.BOLD, 24) | ||
}, BorderLayout.NORTH) | ||
add(object : JPanel() { | ||
override fun getInsets(): Insets { | ||
return Insets(10, 10, 10, 10) | ||
} | ||
|
||
init { | ||
layout = BoxLayout(this, BoxLayout.Y_AXIS) | ||
|
||
add(JLabel(Texts.format("ABOUT_PROGRAMMING"))) | ||
add(Contibutor("soywiz", "http://soywiz.com/")) | ||
add(Contibutor("luckylucks", "https://github.com/luckylucks/")) | ||
add(JLabel(Texts.format("ABOUT_TRANSLATIONS"))) | ||
add(Contibutor("paweloszu", "https://github.com/paweloszu", "Polish")) | ||
add(Contibutor("RijjiResa", "https://github.com/RijjiResa", "Norwegian")) | ||
add(Contibutor("pvc1", "https://github.com/pvc1", "Russian")) | ||
add(Contibutor("Mdslino", "https://github.com/Mdslino", "Brazilian")) | ||
add(Contibutor("gordon0001", "https://github.com/gordon0001", "German")) | ||
add(Contibutor("charlyzard", "https://github.com/charlyzard", "Spanish")) | ||
add(Contibutor("anthologist", "https://github.com/anthologist", "Italian")) | ||
add(Contibutor("adeldk", "https://github.com/adeldk", "French")) | ||
} | ||
}) | ||
preferredSize = Dimension(500, 400) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters