summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-08-30 07:02:48 +0000
committerNorbert Preining <preining@logic.at>2017-08-30 07:02:48 +0000
commit62ece492afd5cdc8e776f5b5913077d6220fb949 (patch)
treef51efefc241e49145fe98e4c17a2ebe449957a9d /Master/texmf-dist
parent393f15ebb52f333071ef3f2880b3f92995f96333 (diff)
tlcockpit: working on windows, add documentation
git-svn-id: svn://tug.org/texlive/trunk@45171 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/support/tlcockpit/LICENSE (renamed from Master/texmf-dist/source/support/tlcockpit/LICENSE)0
-rw-r--r--Master/texmf-dist/doc/support/tlcockpit/README.md81
-rw-r--r--Master/texmf-dist/doc/support/tlcockpit/screenshots/mainwindow.pngbin0 -> 100565 bytes
-rw-r--r--Master/texmf-dist/doc/support/tlcockpit/screenshots/pkg-details.pngbin0 -> 64148 bytes
-rw-r--r--Master/texmf-dist/scripts/tlcockpit/tlcockpit.jarbin11609271 -> 11611177 bytes
-rw-r--r--Master/texmf-dist/source/support/tlcockpit/README.md6
-rw-r--r--Master/texmf-dist/source/support/tlcockpit/build.sbt5
-rw-r--r--Master/texmf-dist/source/support/tlcockpit/src/main/scala/tlcockpit/ApplicationMain.scala37
8 files changed, 116 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/support/tlcockpit/LICENSE b/Master/texmf-dist/doc/support/tlcockpit/LICENSE
index 9cecc1d4669..9cecc1d4669 100644
--- a/Master/texmf-dist/source/support/tlcockpit/LICENSE
+++ b/Master/texmf-dist/doc/support/tlcockpit/LICENSE
diff --git a/Master/texmf-dist/doc/support/tlcockpit/README.md b/Master/texmf-dist/doc/support/tlcockpit/README.md
new file mode 100644
index 00000000000..bd806ba995e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/tlcockpit/README.md
@@ -0,0 +1,81 @@
+TLCockpit - GUI frontend to tlmgr
+=================================
+
+TLCockpit aims at being a GUI for [tlmgr](https://www.tug.org/texlive/tlmgr.html), the [TeX Live](https://www.tug.org/texlive/) Manager, with a modern look and feel.
+
+TLCockpit is included in TeX Live, but you need the latest version of tlmgr, see the secion on <em>Test versions</em> in the above document.
+
+Supported functionality
+-----------------------
+
+By now only loading of remote repository, listing installed, updated,
+or all packages. Clicking on a package in the list opens a details
+window.
+
+Furthermore, an input field allows entering arbitrary commands of the
+*tlmgr shell*, see [tlmgr manual](https://www.tug.org/texlive/doc/tlmgr.html#shell) for details.
+
+Installing/Running
+------------------
+
+If you don't want to build your own deployment jar (which I don't recommend),
+download [tlcockpit.jar](jar/tlcockpit.jar) and run it with
+
+```
+java -jar tlcockpit.jar
+```
+
+The `tlmgr` program has to be in the PATH, and be the most current version.
+
+Requirements
+------------
+A recent Java installation that included JavaFX is required. If you see
+errors like
+```
+Error: A JNI error has occurred, please check your installation and try again
+Exception in thread "main" java.lang.NoClassDefFoundError: javafx/event/EventTarget
+ at java.lang.ClassLoader.defineClass1(Native Method)
+ at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
+...
+```
+that means that the Java installation does not provides JavaFX.
+
+On Windows the latest JRE from Oracle include JavaFX. On Linux one might
+need to install some extra packages (Debian/Ubuntu: openjfx).
+
+Development
+-----------
+
+Development is done in Scala with the ScalaFX widget set. The project is
+mainly a challenge for myself to learn Scala. Building is done with *sbt*,
+opening the project in IntelliJ works fine.
+
+Deplyment is done via [sbt assembly](https://github.com/sbt/sbt-assembly)
+which packs all the necessary libraries into one jar file.
+
+Contributions are welcome, improvements are easily done as I just started
+writing Scala and my style is horrible ;-)
+
+Screenshots
+-----------
+
+Main window
+
+![Main window](screenshots/mainwindow.png)
+
+Package details
+
+![Package details](screenshots/pkg-details.png)
+
+
+License
+-------
+
+GPL3+
+
+
+Author
+------
+
+Norbert Preining
+
diff --git a/Master/texmf-dist/doc/support/tlcockpit/screenshots/mainwindow.png b/Master/texmf-dist/doc/support/tlcockpit/screenshots/mainwindow.png
new file mode 100644
index 00000000000..b74fd22499d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/tlcockpit/screenshots/mainwindow.png
Binary files differ
diff --git a/Master/texmf-dist/doc/support/tlcockpit/screenshots/pkg-details.png b/Master/texmf-dist/doc/support/tlcockpit/screenshots/pkg-details.png
new file mode 100644
index 00000000000..3bdbec16eb5
--- /dev/null
+++ b/Master/texmf-dist/doc/support/tlcockpit/screenshots/pkg-details.png
Binary files differ
diff --git a/Master/texmf-dist/scripts/tlcockpit/tlcockpit.jar b/Master/texmf-dist/scripts/tlcockpit/tlcockpit.jar
index ed2a5340871..da080ccef16 100644
--- a/Master/texmf-dist/scripts/tlcockpit/tlcockpit.jar
+++ b/Master/texmf-dist/scripts/tlcockpit/tlcockpit.jar
Binary files differ
diff --git a/Master/texmf-dist/source/support/tlcockpit/README.md b/Master/texmf-dist/source/support/tlcockpit/README.md
deleted file mode 100644
index b5dbd476964..00000000000
--- a/Master/texmf-dist/source/support/tlcockpit/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-TLCockpit - GUI frontend to tlmgr
-=================================
-
-TLCockpit aims at being a GUI for tlmgr (TeX Live Manager) with a modern look and feel.
-
-
diff --git a/Master/texmf-dist/source/support/tlcockpit/build.sbt b/Master/texmf-dist/source/support/tlcockpit/build.sbt
index f5c2eab7150..c5f7bbd251e 100644
--- a/Master/texmf-dist/source/support/tlcockpit/build.sbt
+++ b/Master/texmf-dist/source/support/tlcockpit/build.sbt
@@ -6,5 +6,10 @@ scalaVersion := "2.12.3"
libraryDependencies += "org.scalafx" % "scalafx_2.12" % "8.0.102-R11"
+// unmanagedJars in Compile += Attributed.blank(file(System.getenv("JAVA_HOME") + "/jre/lib/ext/jfxrt.jar"))
+// unmanagedJars in Compile += Attributed.blank(file("/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar"))
+
+mainClass in assembly := Some("TLCockpit.ApplicationMain")
+
// for scalafx
fork := true
diff --git a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/tlcockpit/ApplicationMain.scala b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/tlcockpit/ApplicationMain.scala
index 50b5aee4b76..a12d5bad2ed 100644
--- a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/tlcockpit/ApplicationMain.scala
+++ b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/tlcockpit/ApplicationMain.scala
@@ -52,6 +52,14 @@ class TLPackage(name_ : String, lrev_ : String, rrev_ : String, shortdesc_ : Str
val rrev = new StringProperty(this, "revision", rrev_)
}
+
+object OsInfo {
+ val OS = System.getProperty("os.name")
+ def isWindows: Boolean = {
+ OS.startsWith("Windows")
+ }
+}
+
class TlmgrProcess(updout: String => Unit, upderr: String => Unit) {
val inputString = new SyncVar[String] // used for the tlmgr process input
val outputString = new SyncVar[String] // used for the tlmgr process output
@@ -91,7 +99,7 @@ class TlmgrProcess(updout: String => Unit, upderr: String => Unit) {
// process creation
if (process == null) {
val procIO = new ProcessIO(inputFn(_), outputFn(_), errorFn(_))
- val processBuilder: ProcessBuilder = Seq("tlmgr", "--machine-readable", "shell")
+ val processBuilder: ProcessBuilder = Seq({if (OsInfo.isWindows) "tlmgr.bat" else "tlmgr"}, "--machine-readable", "shell")
process = processBuilder.run(procIO)
}
}
@@ -193,6 +201,14 @@ class TlmgrProcess(updout: String => Unit, upderr: String => Unit) {
object ApplicationMain extends JFXApp {
+ var testmode = false
+ if (parameters.unnamed.length > 0) {
+ if (parameters.unnamed(0) == "-test" || parameters.unnamed(0) == "--test") {
+ println("Testing mode enabled, not actually calling tlmgr!")
+ testmode = true
+ }
+ }
+
val pkgs = ArrayBuffer[TLPackage]()
val viewpkgs = ObservableBuffer[TLPackage]()
@@ -210,15 +226,22 @@ object ApplicationMain extends JFXApp {
val cmdline = new TextField()
val tlmgr = new TlmgrProcess((s:String) => outputfield.text = s,
(s:String) => errorfield.text = s)
- tlmgr.start_process()
- // wait until we got a prompt
- val foo: Array[String] = tlmgr.get_output_till_prompt()
- // println("current output: ")
- // foo.map(println(_))
+ if (!testmode) {
+ tlmgr.start_process()
+
+ // wait until we got a prompt
+ val foo: Array[String] = tlmgr.get_output_till_prompt()
+ // println("current output: ")
+ // foo.map(println(_))
+ }
// load the initial set of packages
- val pkglines: Array[String] = tlmgr.send_command("info --only-installed --data name,localrev,shortdesc")
+ val pkglines = if (testmode)
+ Array("aa,0,1,ffobar", "bb,4,5,fafaf")
+ else
+ tlmgr.send_command("info --only-installed --data name,localrev,shortdesc")
+
pkglines.map(line => {
val fields: Array[String] = line.split(",",-1)
val sd = if (fields(2).isEmpty) "" else fields(2).substring(1).dropRight(1).replace("""\"""",""""""")