wörk wörk (day 3)

* added License file
* added changelog feature
* added zsync user-agent
* added application and taskbar icon
* added taskbar progressbar
* added social buttons
* added about page with disclaimer, copyright and library license
* changed gui design alot
* fixed some gui errors
* fixed generateRepo.sh skip empty files
This commit is contained in:
Niklas 2020-03-28 05:17:50 +01:00
parent 9c0b6bcf83
commit 5eeffde3c3
29 changed files with 2020 additions and 1053 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Niklas Schütrumpf (Gurkengewuerz)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1 @@
write your changelog here

View File

@ -92,15 +92,29 @@ while IFS= read -r folder; do
FILEFOLDER=$(find "${folder}" -type f ! -path "*.zsync" | sed 's|^./||')
while IFS= read -r folderfile; do
filebyte=$(wc -c < "${folderfile}")
if [ $filebyte -eq 0 ]; then
echo "Skipping \"${folderfile}\" because file is empty"
continue
fi
foldersize=$(expr $foldersize + $filebyte)
name=$(echo "${folderfile}" | cut -d"/" -f2-)
x="\"${name}\":{\"size\": ${filebyte}, \"sha1\": \"${SHASUMS[$folderfile]}\"},${x}"
done <<< "$FILEFOLDER"
x=$(echo ${x} | rev | cut -c2- | rev)
if [ $foldersize -eq 0 ]; then
echo "Skipping complete folder \"${$folder}\" because all files are empty"
continue
fi
JSONDATA+=( "\"${folder}\": {\"size\":${foldersize},\"content\":{${x}}}" )
else
echo "is file"
filebyte=$(wc -c < "${folder}")
if [ $filebyte -eq 0 ]; then
continue
fi
JSONDATA+=( "\"${folder}\": {\"size\":${filebyte}, \"sha1\": \"${SHASUMS[$folder]}\"}" )
fi
done <<< "$FILELIST"

11
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>de.mc8051</groupId>
<artifactId>arma3launcher</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.1.1000</version>
<repositories>
<repository>
@ -44,7 +44,7 @@
<dependency>
<groupId>com.github.Gurkengewuerz</groupId>
<artifactId>zsyncer</artifactId>
<version>locale_fix-2f7565d392-1</version>
<version>1de0d3f651</version>
</dependency>
</dependencies>
@ -65,6 +65,13 @@
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/icons</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>

View File

@ -1,9 +1,34 @@
/*
* MIT License
*
* Copyright (c) 2020-2020 Niklas Schütrumpf (Gurkengewuerz)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package de.mc8051.arma3launcher;
import com.formdev.flatlaf.FlatDarkLaf;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import de.mc8051.arma3launcher.steam.SteamTimer;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import org.ini4j.Ini;
import javax.swing.*;
@ -28,6 +53,7 @@ public class ArmA3Launcher {
public static String VERSION;
public static String CLIENT_NAME;
public static String APPLICATION_PATH;
public static String USER_AGENT;
public static Config config;
public static Ini user_config;
@ -39,11 +65,12 @@ public class ArmA3Launcher {
final Properties properties = new Properties();
properties.load(ArmA3Launcher.class.getClassLoader().getResourceAsStream("project.properties"));
VERSION = properties.getProperty("version");
APPLICATION_PATH = getAppData() + CLIENT_NAME;
USER_AGENT = config.getString("sync.useragent") + "/" + VERSION;
if (new File(APPLICATION_PATH).mkdirs()) {
Logger.getLogger(ArmA3Launcher.class.getName()).log(Level.SEVERE, "Can not create " + APPLICATION_PATH);
System.exit(0);
@ -66,6 +93,8 @@ public class ArmA3Launcher {
UIManager.setLookAndFeel(new FlatDarkLaf());
JFrame frame = new JFrame(CLIENT_NAME);
TaskBarUtils.getInstance().setWindow(frame);
LauncherGUI gui = new LauncherGUI();
frame.setContentPane(gui.mainPanel);
@ -74,14 +103,18 @@ public class ArmA3Launcher {
public void windowClosing(WindowEvent e) {
steamTimer.cancel();
steamTimer.purge();
TaskBarUtils.getInstance().removeTrayIcon();
gui.exit();
frame.dispose();
}
});
frame.setMinimumSize(new Dimension(1000, 500));
frame.setMinimumSize(new Dimension(1000, 550));
frame.pack();
frame.setIconImage(TaskBarUtils.IMAGE_ICON);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
steamTimer.scheduleAtFixedRate(
new SteamTimer(),

View File

@ -3,9 +3,11 @@
<grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="1048" height="556"/>
<xy x="20" y="20" width="1052" height="550"/>
</constraints>
<properties/>
<properties>
<minimumSize width="765" height="550"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6353c" binding="splitView">
@ -16,24 +18,26 @@
</constraints>
<properties>
<continuousLayout value="false"/>
<dividerLocation value="-1"/>
<dividerLocation value="200"/>
<dividerSize value="10"/>
<enabled value="false"/>
<orientation value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="53e6a" layout-manager="GridLayoutManager" row-count="11" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="7" right="0"/>
<grid id="53e6a" layout-manager="GridLayoutManager" row-count="14" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="8" bottom="7" right="8"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<properties>
<background color="-14210516"/>
</properties>
<border type="none"/>
<children>
<component id="a313e" class="javax.swing.JButton" binding="settingsPanelButton">
<constraints>
<grid row="10" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="1" use-parent-layout="false"/>
<grid row="12" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<alignmentY value="0.0"/>
@ -41,6 +45,7 @@
<focusPainted value="false"/>
<focusable value="true"/>
<font size="16"/>
<icon value="icons/settings_16.png"/>
<margin top="0" left="0" bottom="0" right="0"/>
<text resource-bundle="lang" key="settings"/>
</properties>
@ -55,26 +60,28 @@
</vspacer>
<component id="24f9e" class="javax.swing.JButton" binding="updatePanelButton">
<constraints>
<grid row="8" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="1" use-parent-layout="false"/>
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<focusPainted value="false"/>
<font size="16"/>
<icon value="icons/download_16.png"/>
<text resource-bundle="lang" key="update"/>
</properties>
</component>
<component id="bb7df" class="javax.swing.JButton" binding="playPanelButton">
<constraints>
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="1" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<focusPainted value="false"/>
<font size="16"/>
<icon value="icons/play_16.png"/>
<margin top="0" left="0" bottom="0" right="0"/>
<text resource-bundle="lang" key="play"/>
</properties>
</component>
<grid id="6408f" binding="logo" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="6408f" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
@ -82,10 +89,20 @@
</grid>
</constraints>
<properties>
<background color="-12515584"/>
<background color="-12828863"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
<children>
<component id="ce2e5" class="javax.swing.JLabel" binding="logo">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
<component id="bf05a" class="javax.swing.JLabel" binding="title">
<constraints>
@ -101,7 +118,7 @@
</component>
<component id="d5ae3" class="javax.swing.JLabel" binding="subtitle">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="1" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Monospaced" size="12" style="2"/>
@ -110,7 +127,7 @@
</component>
<component id="a4768" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Steam"/>
@ -118,7 +135,7 @@
</component>
<component id="8aa9e" class="javax.swing.JLabel" binding="steamStatus">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="6" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -126,7 +143,7 @@
</component>
<component id="af44e" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="ArmA 3"/>
@ -134,7 +151,7 @@
</component>
<component id="b308b" class="javax.swing.JLabel" binding="armaStatus">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="5" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -147,18 +164,72 @@
</vspacer>
<component id="798c0" class="javax.swing.JButton" binding="presetPanelButton">
<constraints>
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="1" use-parent-layout="false"/>
<grid row="11" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<focusPainted value="false"/>
<font size="16"/>
<icon value="icons/preset_16.png"/>
<margin top="0" left="0" bottom="0" right="0"/>
<text resource-bundle="lang" key="presets"/>
</properties>
</component>
<component id="c2d0" class="javax.swing.JButton" binding="changelogButton">
<constraints>
<grid row="10" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<focusPainted value="false"/>
<font size="16"/>
<icon value="icons/changelog_16.png"/>
<text resource-bundle="lang" key="changelog"/>
</properties>
</component>
<grid id="607df" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="4356e" class="javax.swing.JLabel" binding="twitterIcon">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="icons/twitter_32.png"/>
<text value=""/>
<toolTipText resource-bundle="lang" key="follow_on_twitter"/>
</properties>
</component>
<component id="7735c" class="javax.swing.JLabel" binding="githubIcon">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="icons/github_32.png"/>
<text value=""/>
<toolTipText resource-bundle="lang" key="star_on_github"/>
</properties>
</component>
</children>
</grid>
<tabbedpane id="379d1" binding="tabbedPane1" default-binding="true">
<component id="b239b" class="javax.swing.JLabel" binding="aboutLabel">
<constraints>
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="6" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="11"/>
<foreground color="-7500403"/>
<text resource-bundle="lang" key="about"/>
</properties>
</component>
</children>
</grid>
<tabbedpane id="379d1" binding="tabbedPane1">
<constraints>
<splitpane position="right"/>
</constraints>
@ -260,7 +331,7 @@
</grid>
</children>
</grid>
<grid id="dfe66" binding="updateTab" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="dfe66" binding="updateTab" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="5" right="0"/>
<constraints>
<tabbedpane title="Update"/>
@ -268,123 +339,33 @@
<properties/>
<border type="none"/>
<children>
<grid id="21764" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="124da" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="2" left="5" bottom="3" right="0"/>
<constraints border-constraint="North"/>
<properties>
<background color="-14736860"/>
<enabled value="false"/>
</properties>
<border type="none"/>
<children>
<component id="d8ac6" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="16" style="1"/>
<text resource-bundle="lang" key="repository_content"/>
</properties>
</component>
</children>
</grid>
<grid id="74882" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="South"/>
<properties/>
<border type="none"/>
<children>
<component id="13d22" class="javax.swing.JButton" binding="expandAllButton">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="expand_all"/>
</properties>
</component>
<component id="43543" class="javax.swing.JComboBox" binding="comboBox1" default-binding="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="2b206" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="preset"/>
</properties>
</component>
<component id="c9d68" class="javax.swing.JButton" binding="refreshRepoButton">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="update_repository"/>
</properties>
</component>
<component id="4ec7b" class="javax.swing.JButton" binding="collapseAllButton">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="collapse_all"/>
</properties>
</component>
</children>
</grid>
<scrollpane id="56725" binding="updateTreeScrolPane">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<grid id="44d39" binding="updateTreePanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints/>
<properties/>
<border type="none"/>
<children>
<component id="38143" class="javax.swing.JTree" binding="tree1" default-binding="true">
<constraints border-constraint="Center"/>
<properties/>
</component>
</children>
</grid>
</children>
</scrollpane>
</children>
</grid>
<grid id="dc84b" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="10" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<properties>
<opaque value="true"/>
</properties>
<border type="empty"/>
<children>
<grid id="7c658" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<grid id="6dccb" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<grid id="86f5e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@ -410,7 +391,9 @@
<grid id="3b45c" layout-manager="GridLayoutManager" row-count="6" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="3" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<component id="24910" class="javax.swing.JLabel">
@ -553,7 +536,9 @@
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<grid id="c1274" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@ -576,7 +561,7 @@
</component>
</children>
</grid>
<grid id="b8ac" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="b8ac" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
@ -592,7 +577,7 @@
</component>
<component id="f5997" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="speed"/>
@ -600,7 +585,7 @@
</component>
<component id="25551" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="remaining_time"/>
@ -616,7 +601,7 @@
</component>
<component id="617c7" class="javax.swing.JLabel" binding="syncDownloadSpeedLabel">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -624,23 +609,7 @@
</component>
<component id="b64ac" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="d85a8" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="downloaded"/>
</properties>
</component>
<component id="d9013" class="javax.swing.JLabel" binding="syncDownloadedLabel">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -670,7 +639,9 @@
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<grid id="967fb" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@ -693,7 +664,7 @@
</component>
</children>
</grid>
<grid id="c304c" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="c304c" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
@ -704,6 +675,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="14" style="1"/>
<string value=""/>
<stringPainted value="true"/>
<value value="0"/>
@ -714,6 +686,7 @@
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="14" style="1"/>
<string value=""/>
<stringPainted value="true"/>
<value value="0"/>
@ -722,7 +695,7 @@
<grid id="99173" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -762,6 +735,154 @@
</grid>
</children>
</grid>
<component id="c7987" class="javax.swing.JLabel" binding="syncStatusLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<grid id="9ae8" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="0" bottom="0" right="5"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="21764" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="124da" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="2" left="5" bottom="3" right="0"/>
<constraints border-constraint="North"/>
<properties>
<background color="-14736860"/>
<enabled value="false"/>
</properties>
<border type="none"/>
<children>
<component id="d8ac6" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="16" style="1"/>
<text resource-bundle="lang" key="repository_content"/>
</properties>
</component>
</children>
</grid>
<grid id="74882" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="South"/>
<properties/>
<border type="none"/>
<children>
<component id="13d22" class="javax.swing.JButton" binding="expandAllButton">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="expand_all"/>
</properties>
</component>
<component id="43543" class="javax.swing.JComboBox" binding="comboBox1" default-binding="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="2b206" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="preset"/>
</properties>
</component>
<component id="c9d68" class="javax.swing.JButton" binding="refreshRepoButton">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="update_repository"/>
</properties>
</component>
<component id="4ec7b" class="javax.swing.JButton" binding="collapseAllButton">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text resource-bundle="lang" key="collapse_all"/>
</properties>
</component>
</children>
</grid>
<scrollpane id="56725" binding="updateTreeScrolPane">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<grid id="44d39" binding="updateTreePanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints/>
<properties/>
<border type="none"/>
<children>
<component id="38143" class="javax.swing.JTree" binding="tree1" default-binding="true">
<constraints border-constraint="Center"/>
<properties/>
</component>
</children>
</grid>
</children>
</scrollpane>
</children>
</grid>
</children>
</grid>
</children>
</grid>
<grid id="b7c21" binding="changelogTab" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Changelog"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="f877d" binding="changelogScroll">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<autoscrolls value="false"/>
<opaque value="true"/>
<visible value="true"/>
</properties>
<border type="empty"/>
<children>
<component id="635e3" class="javax.swing.JTextArea" binding="changelogPane">
<constraints/>
<properties>
<autoscrolls value="false"/>
<editable value="false"/>
<font name="Monospaced" size="15"/>
<lineWrap value="true"/>
<text value="No Changelog Availaible"/>
<visible value="true"/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="8ba0d" binding="presetsTab" layout-manager="BorderLayout" hgap="0" vgap="0">
@ -814,7 +935,7 @@
</children>
</grid>
<grid id="11456" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="5" right="0"/>
<margin top="10" left="0" bottom="5" right="5"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
@ -899,7 +1020,7 @@
<border type="none"/>
<children>
<grid id="b3a23" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="5" right="0"/>
<margin top="10" left="0" bottom="5" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
@ -962,18 +1083,32 @@
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="b20fe" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="empty"/>
<children>
<scrollpane id="ef8aa" binding="settingScrollPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<properties>
<opaque value="false"/>
</properties>
<border type="empty"/>
<children>
<grid id="4b04" layout-manager="GridLayoutManager" row-count="39" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="0" left="0" bottom="0" right="5"/>
<constraints/>
<properties/>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="80449" class="javax.swing.JLabel">
@ -1750,6 +1885,180 @@
</children>
</grid>
</children>
</grid>
<grid id="61390" binding="aboutTab" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="About"/>
</constraints>
<properties>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<grid id="60e3d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="150" bottom="5" right="150"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="ee1c0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<enabled value="false"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="4b83" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="98919" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="81837" class="javax.swing.JLabel" binding="aboutClient">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="true"/>
<font size="18" style="1"/>
<text value="Client v1.0.1000"/>
</properties>
</component>
<component id="3c6b0" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<requestFocusEnabled value="true"/>
<text resource-bundle="lang" key="client_up_to_date"/>
</properties>
</component>
<grid id="80ce0" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="1b70" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="developer_page"/>
</properties>
</component>
<component id="6f09" class="javax.swing.JLabel" binding="aboutDeveloperLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<requestFocusEnabled value="true"/>
<text value="github.com"/>
</properties>
</component>
<component id="25a45" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="project_page"/>
</properties>
</component>
<component id="eed8f" class="javax.swing.JLabel" binding="aboutProjectLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="gurkengewuerz.de"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="e5ad4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="8032a" class="javax.swing.JLabel" binding="aboutLogo">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
<component id="54464" class="javax.swing.JLabel" binding="aboutCopyrightLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Copyright (c) 2020-{year} Niklas Schütrumpf (Gurkengewuerz)"/>
</properties>
</component>
</children>
</grid>
<grid id="ea1de" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="327d">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty"/>
<children>
<component id="934be" class="javax.swing.JTextPane" binding="disclaimer">
<constraints/>
<properties>
<contentType value="text/html"/>
<editable value="false"/>
<enabled value="true"/>
<text value="&lt;html&gt;&#10; &lt;head&gt;&#10; &#10; &lt;/head&gt;&#10; &lt;body&gt;&#10; &lt;/body&gt;&#10;&lt;/html&gt;&#10;"/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</splitpane>

View File

@ -8,10 +8,12 @@ import de.mc8051.arma3launcher.model.PresetTableModel;
import de.mc8051.arma3launcher.model.RepositoryTreeNode;
import de.mc8051.arma3launcher.model.ServerTableModel;
import de.mc8051.arma3launcher.objects.AbstractMod;
import de.mc8051.arma3launcher.objects.Changelog;
import de.mc8051.arma3launcher.objects.Mod;
import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.objects.Modset;
import de.mc8051.arma3launcher.objects.Server;
import de.mc8051.arma3launcher.repo.DownloadStatus;
import de.mc8051.arma3launcher.repo.FileChecker;
import de.mc8051.arma3launcher.repo.RepositoryManger;
import de.mc8051.arma3launcher.repo.SyncList;
@ -19,11 +21,12 @@ import de.mc8051.arma3launcher.repo.Syncer;
import de.mc8051.arma3launcher.steam.SteamTimer;
import de.mc8051.arma3launcher.utils.Callback;
import de.mc8051.arma3launcher.utils.Humanize;
import de.mc8051.arma3launcher.utils.ImageUtils;
import de.mc8051.arma3launcher.utils.LangUtils;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.text.DefaultFormatter;
import javax.swing.tree.DefaultMutableTreeNode;
@ -34,14 +37,23 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.lang.management.ManagementFactory;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Properties;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
@ -60,7 +72,6 @@ public class LauncherGUI implements Observer {
private JLabel steamStatus;
private JLabel armaStatus;
private JButton presetPanelButton;
private JPanel logo;
private JPanel presetsTab;
private JButton playPresetButton;
private JButton clonePresetButton;
@ -129,17 +140,32 @@ public class LauncherGUI implements Observer {
private JLabel syncDeletedFilesLabel;
private JLabel syncAddedFilesLabel;
private JLabel syncChangedFilesLabel;
private JLabel syncSizeLabel;
public JLabel syncSizeLabel;
private JLabel syncChangedFileSizeLabel;
private JLabel syncFileCountLabel;
public JLabel syncDownloadedLabel;
public JLabel syncFileCountLabel;
public JLabel syncDownloadSpeedLabel;
private JSplitPane splitView;
public JLabel syncStatusLabel;
private JLabel logo;
private JLabel aboutLabel;
private JButton changelogButton;
private JPanel changelogTab;
private JPanel aboutTab;
private JTextArea changelogPane;
private JScrollPane changelogScroll;
private JLabel twitterIcon;
private JLabel githubIcon;
private JTextPane disclaimer;
private JLabel aboutLogo;
private JLabel aboutClient;
private JLabel aboutProjectLabel;
private JLabel aboutDeveloperLabel;
private JLabel aboutCopyrightLabel;
private JCheckBoxTree repoTree;
private FileChecker fileChecker;
private Syncer syncer;
private SyncList lastSynclist;
private SyncList lastSynclist = null;
public LauncherGUI() {
fileChecker = new FileChecker(syncCheckProgress);
@ -150,6 +176,16 @@ public class LauncherGUI implements Observer {
fileChecker.addObserver(this);
syncer.addObserver(this);
new Thread(() -> {
RepositoryManger.getInstance().refreshMeta();
try {
Thread.sleep(750);
} catch (InterruptedException e) {
e.printStackTrace();
}
RepositoryManger.getInstance().refreshModset();
}).start();
updateTreePanel.remove(tree1);
repoTree = new JCheckBoxTree();
@ -184,45 +220,54 @@ public class LauncherGUI implements Observer {
updatePanelButton.setMargin(x);
playPanelButton.setMargin(x);
presetPanelButton.setMargin(x);
changelogButton.setMargin(x);
playPresetButton.setMargin(new Insets(10, 10, 10, 10));
playPanelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tabbedPane1.setSelectedIndex(0);
}
});
updatePanelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tabbedPane1.setSelectedIndex(1);
}
});
presetPanelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tabbedPane1.setSelectedIndex(2);
}
});
settingsPanelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tabbedPane1.setSelectedIndex(3);
}
});
serverTable.setModel(new ServerTableModel());
presetList.setModel(new PresetTableModel());
presetList.setCellRenderer(new PresetListRenderer());
presetList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
presetList.setCellRenderer(new PresetListRenderer());
modList.setCellRenderer(new ModListRenderer());
subtitle.setText(
ArmA3Launcher.config.getString("subtitle")
.replace("${name}", ArmA3Launcher.CLIENT_NAME)
.replace("${version}", ArmA3Launcher.VERSION));
title.setText(
ArmA3Launcher.config.getString("title")
.replace("${name}", ArmA3Launcher.CLIENT_NAME)
.replace("${version}", ArmA3Launcher.VERSION));
initSettings();
logo.setIcon(new ImageIcon(ImageUtils.getScaledImage(TaskBarUtils.IMAGE_LGO, 128, 128)));
aboutLogo.setIcon(new ImageIcon(ImageUtils.getScaledImage(TaskBarUtils.IMAGE_LGO, 128, 128)));
aboutClient.setText(ArmA3Launcher.config.getString("name") + " v" + ArmA3Launcher.VERSION);
aboutDeveloperLabel.setText("<html><a href=''>https://gurkengewuerz.de</a></html>");
aboutProjectLabel.setText("<html><a href=''>"+ArmA3Launcher.config.getString("social.github")+"</a></html>");
InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("disclaimer.html");
if(resourceAsStream != null) {
Scanner s = new Scanner(resourceAsStream).useDelimiter("\\A");
String result = s.hasNext() ? s.next() : "";
disclaimer.setText(result);
}
aboutCopyrightLabel.setText(aboutCopyrightLabel.getText().replace("{year}", "" + Calendar.getInstance().get(Calendar.YEAR)));
twitterIcon.setBorder(new EmptyBorder(2,2,2,2));
githubIcon.setBorder(new EmptyBorder(2,2,2,2));
settingScrollPane.getVerticalScrollBar().setUnitIncrement(16);
updateTreeScrolPane.getVerticalScrollBar().setUnitIncrement(16);
splitView.setDividerLocation(-1);
presetList.addListSelectionListener(e -> {
if (!e.getValueIsAdjusting()) {
PresetTableModel m = (PresetTableModel) presetList.getModel();
Modset modset = (Modset) m.getElementAt(presetList.getSelectedIndex());
@ -238,23 +283,8 @@ public class LauncherGUI implements Observer {
updateModList(modset);
}
}
});
modList.setCellRenderer(new ModListRenderer());
subtitle.setText(
ArmA3Launcher.config.getString("subtitle")
.replace("${name}", ArmA3Launcher.CLIENT_NAME)
.replace("${version}", ArmA3Launcher.VERSION));
title.setText(
ArmA3Launcher.config.getString("title")
.replace("${name}", ArmA3Launcher.CLIENT_NAME)
.replace("${version}", ArmA3Launcher.VERSION));
initSettings();
settingsResetDefault.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -268,73 +298,106 @@ public class LauncherGUI implements Observer {
}
});
settingScrollPane.getVerticalScrollBar().setUnitIncrement(16);
updateTreeScrolPane.getVerticalScrollBar().setUnitIncrement(16);
collapseAllButton.addActionListener(e -> repoTree.collapseAllNodes());
playPanelButton.addActionListener(e -> tabbedPane1.setSelectedIndex(0));
updatePanelButton.addActionListener(e -> tabbedPane1.setSelectedIndex(1));
changelogButton.addActionListener(e -> {
tabbedPane1.setSelectedIndex(2);
Changelog.refresh();
});
presetPanelButton.addActionListener(e -> tabbedPane1.setSelectedIndex(3));
settingsPanelButton.addActionListener(e -> tabbedPane1.setSelectedIndex(4));
refreshRepoButton.addActionListener(e -> RepositoryManger.getInstance().refreshModset());
expandAllButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
repoTree.expandAllNodes();
}
});
collapseAllButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
repoTree.collapseAllNodes();
}
});
expandAllButton.addActionListener(e -> repoTree.expandAllNodes());
syncDownloadAbortButton.addActionListener(e -> syncer.stop());
syncCheckAbortButton.addActionListener(e -> fileChecker.stop());
new Thread(() -> {
RepositoryManger.getInstance().refreshMeta();
try {
Thread.sleep(750);
} catch (InterruptedException e) {
e.printStackTrace();
}
RepositoryManger.getInstance().refreshModset();
}).start();
syncCheckButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
syncCheckButton.addActionListener(e -> {
syncCheckButton.setEnabled(false);
syncCheckAbortButton.setEnabled(true);
syncCheckStatusLabel.setText("Running!");
new Thread(() -> fileChecker.check()).start();
refreshRepoButton.setEnabled(false);
repoTree.setCheckboxesEnabled(false);
repoTree.setCheckboxesChecked(false);
}
});
syncCheckAbortButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
fileChecker.stop();
}
});
syncDownloadButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(lastSynclist == null) return;
syncDownloadButton.addActionListener(e -> {
if (!fileChecker.isChecked()) return;
syncDownloadButton.setEnabled(false);
syncDownloadAbortButton.setEnabled(true);
syncPauseButton.setEnabled(true);
syncCheckButton.setEnabled(false);
refreshRepoButton.setEnabled(false);
new Thread(() -> syncer.sync(lastSynclist.clone())).start();
}
});
syncDownloadAbortButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
syncer.stop();
}
});
syncPauseButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
syncPauseButton.addActionListener(e -> {
syncer.setPaused(!syncer.isPaused());
syncPauseButton.setEnabled(false);
});
twitterIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
twitterIcon.setBorder(BorderFactory.createLineBorder(Color.BLACK, 2));
}
@Override
public void mouseExited(MouseEvent e) {
twitterIcon.setBorder(new EmptyBorder(2,2,2,2));
}
});
githubIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
githubIcon.setBorder(BorderFactory.createLineBorder(Color.BLACK, 2));
}
@Override
public void mouseExited(MouseEvent e) {
githubIcon.setBorder(new EmptyBorder(2,2,2,2));
}
});
aboutLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
tabbedPane1.setSelectedIndex(5);
}
});
twitterIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
openURL(ArmA3Launcher.config.getString("social.twitter"));
}
});
githubIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
openURL(ArmA3Launcher.config.getString("social.github"));
}
});
aboutDeveloperLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
openURL("https://gurkengewuerz.de");
}
});
aboutProjectLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
openURL(ArmA3Launcher.config.getString("social.github"));
}
});
}
@ -377,6 +440,7 @@ public class LauncherGUI implements Observer {
playPresetButton.setEnabled(false);
syncCheckButton.setEnabled(false);
refreshRepoButton.setEnabled(false);
syncDownloadButton.setEnabled(false);
playButton.setToolTipText(LangUtils.getInstance().getString("arma_running"));
playPresetButton.setToolTipText(LangUtils.getInstance().getString("arma_running"));
@ -408,11 +472,15 @@ public class LauncherGUI implements Observer {
syncCheckButton.setEnabled(true);
refreshRepoButton.setEnabled(true);
syncDownloadButton.setEnabled(fileChecker.isChecked());
syncCheckButton.setToolTipText(null);
refreshRepoButton.setToolTipText(null);
} else {
syncCheckButton.setEnabled(true);
refreshRepoButton.setEnabled(true);
syncCheckButton.setEnabled(false);
refreshRepoButton.setEnabled(false);
syncDownloadButton.setEnabled(false);
syncCheckButton.setToolTipText(LangUtils.getInstance().getString("path_not_set"));
refreshRepoButton.setToolTipText(LangUtils.getInstance().getString("path_not_set"));
@ -655,7 +723,7 @@ public class LauncherGUI implements Observer {
RepositoryTreeNode lastNode = modFolder;
ArrayList<String> path = modfile.getPath();
for (int i = 0; i < path.size() -1; i++) {
for (int i = 0; i < path.size() - 1; i++) {
boolean found = false;
for (int j = 0; j < lastNode.getChildCount(); j++) {
@ -703,11 +771,11 @@ public class LauncherGUI implements Observer {
public void checkStateChanged(JCheckBoxTree.CheckChangeEvent event) {
lastSynclist = getSyncList();
if (lastSynclist.getSize() != 0)
syncSizeLabel.setText(Humanize.binaryPrefix(lastSynclist.getSize()));
else syncSizeLabel.setText("0.0 B");
syncSizeLabel.setText("0.0 B/" + Humanize.binaryPrefix(lastSynclist.getSize()));
else syncSizeLabel.setText("0.0 B/0.0 B");
if (lastSynclist.getCount() != 0) {
syncDownloadButton.setEnabled(true);
syncFileCountLabel.setText("" + lastSynclist.getCount());
syncFileCountLabel.setText("0/" + lastSynclist.getCount());
} else {
syncDownloadButton.setEnabled(false);
syncFileCountLabel.setText("");
@ -838,6 +906,17 @@ public class LauncherGUI implements Observer {
refreshRepoButton.setEnabled(false);
break;
}
} else if (s.equals(RepositoryManger.Type.CHANGELOG.toString())) {
if (RepositoryManger.getInstance().getStatus(RepositoryManger.Type.CHANGELOG) == DownloadStatus.FINNISHED) {
SwingUtilities.invokeLater(() -> {
changelogPane.setText(Changelog.get());
changelogPane.setCaretPosition(0);
changelogPane.setLineWrap(true);
changelogPane.setWrapStyleWord(true);
changelogPane.revalidate();
changelogPane.repaint();
});
}
} else if (s.equals("fileChecker")) {
syncCheckButton.setEnabled(true);
syncCheckAbortButton.setEnabled(false);
@ -867,26 +946,70 @@ public class LauncherGUI implements Observer {
syncPauseButton.setEnabled(false);
repoTree.setCheckboxesChecked(false);
refreshRepoButton.setEnabled(true);
syncAddedFilesLabel.setText("" + 0);
syncChangedFilesLabel.setText("" + 0);
syncDeletedFilesLabel.setText("" + 0);
syncChangedFileSizeLabel.setText("0.0 B");
} else if (s.equals("syncStopped")) {
new Thread(() -> fileChecker.check()).start();
SwingUtilities.invokeLater(() -> {
syncDownloadButton.setEnabled(false);
syncDownloadAbortButton.setEnabled(false);
syncPauseButton.setEnabled(false);
syncStatusLabel.setText("Sync stopped");
syncFileProgress.setValue(0);
TaskBarUtils.getInstance().setValue(0);
TaskBarUtils.getInstance().off();
});
} else if (s.equals("syncComplete")) {
new Thread(() -> fileChecker.check()).start();
SwingUtilities.invokeLater(() -> {
syncDownloadButton.setEnabled(false);
syncDownloadAbortButton.setEnabled(false);
syncPauseButton.setEnabled(false);
syncStatusLabel.setText("Sync finished");
syncFileProgress.setValue(0);
syncFileProgress.setString("");
TaskBarUtils.getInstance().setValue(0);
TaskBarUtils.getInstance().off();
TaskBarUtils.getInstance().attention();
TaskBarUtils.getInstance().notification("Sync complete", "", TrayIcon.MessageType.INFO);
});
} else if (s.equals("syncContinue")) {
SwingUtilities.invokeLater(() -> {
syncDownloadAbortButton.setEnabled(true);
syncPauseButton.setEnabled(true);
syncPauseButton.setText(LangUtils.getInstance().getString("pause"));
syncDownloadButton.setEnabled(false);
TaskBarUtils.getInstance().normal();
});
} else if (s.equals("syncPaused")) {
SwingUtilities.invokeLater(() -> {
syncDownloadAbortButton.setEnabled(true);
syncPauseButton.setEnabled(true);
syncPauseButton.setText(LangUtils.getInstance().getString("resume"));
syncDownloadButton.setEnabled(false);
syncFileProgress.setValue(0);
TaskBarUtils.getInstance().paused();
});
}
}
public void exit() {
fileChecker.stop();
syncer.stop();
}
public void openURL(String url) {
try {
Desktop.getDesktop().browse(new URL(url).toURI());
} catch (Exception ignored) {
}
}
}

View File

@ -0,0 +1,29 @@
package de.mc8051.arma3launcher.objects;
import de.mc8051.arma3launcher.repo.RepositoryManger;
import de.mc8051.arma3launcher.utils.Callback;
/**
* Created by gurkengewuerz.de on 27.03.2020.
*/
public class Changelog {
private static long lastUpdate = 0;
private static String cache = "";
public static void refresh() {
if(cache.isEmpty() || System.currentTimeMillis() - lastUpdate > 5 * 60 * 1000) { // 5 Minuten
RepositoryManger.getInstance().refreshChangelog();
lastUpdate = System.currentTimeMillis();
}
}
public static String get() {
return cache;
}
public static void setChangelog(String changelog) {
cache = changelog;
}
}

View File

@ -79,6 +79,10 @@ public class ModFile implements AbstractMod {
return modfileString;
}
public String getModPath() {
return (parent == null ? "" : parent + "/") + modfileString;
}
public File getLocaleFile() {
return f;
}

View File

@ -30,6 +30,8 @@ public class FileChecker implements Observable {
private JProgressBar pb;
private boolean stop = false;
private boolean checked = false;
private ArrayList<Path> deleted = new ArrayList<>();
private HashMap<String, ArrayList<ModFile>> changed = new HashMap<>();
int changedCount = 0;
@ -93,6 +95,11 @@ public class FileChecker implements Observable {
checkDeleted();
notifyObservers("fileChecker");
checked = true;
}
public boolean isChecked() {
return checked;
}
public void stop() {

View File

@ -4,6 +4,7 @@ import de.mc8051.arma3launcher.ArmA3Launcher;
import de.mc8051.arma3launcher.interfaces.Observable;
import de.mc8051.arma3launcher.interfaces.Observer;
import de.mc8051.arma3launcher.objects.AbstractMod;
import de.mc8051.arma3launcher.objects.Changelog;
import de.mc8051.arma3launcher.objects.Mod;
import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.objects.Modset;
@ -45,6 +46,7 @@ public class RepositoryManger implements Observable {
private RepositoryManger() {
statusMap.put(Type.METADATA, DownloadStatus.FINNISHED);
statusMap.put(Type.MODSET, DownloadStatus.FINNISHED);
statusMap.put(Type.CHANGELOG, DownloadStatus.FINNISHED);
}
private void getAsync(String urlS, Callback.HttpCallback callback) {
@ -55,7 +57,7 @@ public class RepositoryManger implements Observable {
HttpRequest request = HttpRequest.newBuilder()
.uri(url)
.GET()
.headers("Content-Type", "text/plain;charset=UTF-8")
.headers("User-Agent", ArmA3Launcher.USER_AGENT)
.timeout(Duration.of(3, SECONDS))
.build();
@ -191,6 +193,26 @@ public class RepositoryManger implements Observable {
});
}
public void refreshChangelog() {
statusMap.replace(Type.CHANGELOG, DownloadStatus.RUNNING);
RepositoryManger.getInstance().notifyObservers(Type.CHANGELOG.toString());
getAsync(ArmA3Launcher.config.getString("sync.url") + "/.sync/changelog.txt", new Callback.HttpCallback() {
@Override
public void response(Response r) {
if (!r.isSuccessful()) {
statusMap.replace(Type.CHANGELOG, DownloadStatus.ERROR);
RepositoryManger.getInstance().notifyObservers(Type.CHANGELOG.toString());
return;
}
statusMap.replace(Type.CHANGELOG, DownloadStatus.FINNISHED);
RepositoryManger.getInstance().notifyObservers(Type.CHANGELOG.toString());
Changelog.setChangelog(r.getBody());
}
});
}
public static RepositoryManger getInstance() {
if (instance == null) instance = new RepositoryManger();
return instance;
@ -218,7 +240,8 @@ public class RepositoryManger implements Observable {
public enum Type {
METADATA("metadata"),
MODSET("modset");
MODSET("modset"),
CHANGELOG("changelog");
private String modset;

View File

@ -10,6 +10,7 @@ import de.mc8051.arma3launcher.interfaces.Observer;
import de.mc8051.arma3launcher.objects.AbstractMod;
import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.utils.Humanize;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import javax.swing.*;
import java.io.IOException;
@ -36,17 +37,19 @@ public class Syncer extends ZsyncObserver implements Observable {
private SyncList modlist;
private boolean currentDownload_failed = false;
private String currentDownload_sizeS;
private boolean controlfile_downloaded = false;
private int failed = 0;
private int success = 0;
long syncSize;
int syncCount;
private long syncSize;
private String syncSizeString;
private int syncCount;
long downloadStarted;
long downloadEnded;
long downloadSize;
long downloadDownloaded;
private long downloadStarted;
private long downloadEnded;
private long downloadSize;
private long downloadDownloaded;
private Zsync zsync;
private LauncherGUI gui;
@ -69,10 +72,12 @@ public class Syncer extends ZsyncObserver implements Observable {
success = 0;
syncSize = ml.getSize();
syncSizeString = Humanize.binaryPrefix(syncSize);
syncCount = ml.getCount();
SwingUtilities.invokeLater(() -> {
gui.syncDownloadProgress.setMaximum(syncCount);
gui.syncDownloadProgress.setValue(0);
TaskBarUtils.getInstance().normal();
});
boolean lastPause = false;
@ -120,11 +125,13 @@ public class Syncer extends ZsyncObserver implements Observable {
if (mf != null) {
Zsync.Options o = new Zsync.Options();
o.setOutputFile(Paths.get(mf.getLocaleFile().getAbsolutePath()));
o.setUseragent(ArmA3Launcher.USER_AGENT);
try {
currentDownload = mf;
currentDownload_failed = false;
controlfile_downloaded = false;
currentDownload_sizeS = Humanize.binaryPrefix(currentDownload.getSize());
zsync.zsync(URI.create(mf.getRemoteFile() + ".zsync"), o, this);
} catch (ZsyncException | IllegalArgumentException e) {
@ -178,14 +185,14 @@ public class Syncer extends ZsyncObserver implements Observable {
@Override
public void zsyncStarted(URI requestedZsyncUri, Zsync.Options options) {
super.zsyncStarted(requestedZsyncUri, options);
System.out.println("ZSync started " + options.getOutputFile());
}
@Override
public void controlFileDownloadingComplete() {
super.controlFileDownloadingComplete();
System.out.println("controlFileDownloadingComplete");
controlfile_downloaded = true;
SwingUtilities.invokeLater(() -> {
gui.syncFileProgress.setValue(0);
gui.syncFileProgress.setString("0 %");
});
System.out.println("ZSync started " + options.getOutputFile());
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Sync started"));
}
@Override
@ -193,6 +200,7 @@ public class Syncer extends ZsyncObserver implements Observable {
super.zsyncFailed(exception);
currentDownload_failed = true;
System.out.println("Zsync failed " + exception.getMessage());
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Sync failed"));
}
@Override
@ -211,13 +219,22 @@ public class Syncer extends ZsyncObserver implements Observable {
else success++;
final long finalSize = syncSize - modlist.getSize();
int i = success + failed;
int percentage = (int) ((double)i / (double)Long.valueOf(syncCount).intValue() * 100);
final int i = success + failed;
final int percentage = (int) ((double) i / (double) Long.valueOf(syncCount).intValue() * 100);
final String modPath = currentDownload.getModPath();
SwingUtilities.invokeLater(() -> {
gui.syncDownloadProgress.setValue(i);
gui.syncDownloadedLabel.setText(Humanize.binaryPrefix(finalSize) + " " + " (" + failed + " failed)");
gui.syncDownloadProgress.setString(percentage + "%");
gui.syncFileCountLabel.setText(i + "/" + syncCount + " (" + failed + " failed)");
gui.syncSizeLabel.setText(Humanize.binaryPrefix(finalSize) + "/" + syncSizeString);
if (currentDownload_failed)
gui.syncStatusLabel.setText(modPath + ": Sync failed");
else
gui.syncStatusLabel.setText(modPath + ": Sync finished");
gui.syncDownloadProgress.setString(percentage + " %");
TaskBarUtils.getInstance().setValue(percentage);
});
finnishCurrent();
@ -227,6 +244,16 @@ public class Syncer extends ZsyncObserver implements Observable {
public void controlFileDownloadingStarted(URI uri, long length) {
super.controlFileDownloadingStarted(uri, length);
System.out.println("controlFileDownloadingStarted " + length);
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Get Header"));
}
@Override
public void controlFileDownloadingComplete() {
super.controlFileDownloadingComplete();
System.out.println("controlFileDownloadingComplete");
controlfile_downloaded = true;
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Hashing"));
}
@Override
@ -234,26 +261,23 @@ public class Syncer extends ZsyncObserver implements Observable {
super.remoteFileDownloadingStarted(uri, length);
System.out.println("remoteFileDownloadingStarted " + length);
SwingUtilities.invokeLater(() -> {
gui.syncFileProgress.setMaximum(Long.valueOf(length).intValue());
gui.syncFileProgress.setValue(0);
});
downloadSize = length;
downloadDownloaded = 0;
downloadStarted = System.nanoTime();
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Downloading"));
}
@Override
public void bytesDownloaded(long bytes) {
super.bytesDownloaded(bytes);
// System.out.println("Downloaded " + bytes);
downloadDownloaded += bytes;
// TODO: Fix file Download Progress
if (controlfile_downloaded) {
final int percentage = (int) (((double) downloadDownloaded / (double) downloadSize) * 100);
SwingUtilities.invokeLater(() -> {
gui.syncFileProgress.setValue(Long.valueOf(downloadDownloaded).intValue());
gui.syncFileProgress.setValue(percentage);
gui.syncFileProgress.setString(percentage + " % " + Humanize.binaryPrefix(downloadDownloaded) + "/" + currentDownload_sizeS);
});
}
}

View File

@ -9,11 +9,15 @@ import java.io.File;
*/
public class Callback {
public static interface JFileSelectCallback { //declare an interface with the callback methods, so you can use on more than one class and just refer to the interface
public interface JFileSelectCallback {
boolean allowSelection(File path);
}
public static interface HttpCallback {
public interface HttpCallback {
void response(Response r);
}
public interface ChangelogCallback {
void response(String changelog);
}
}

View File

@ -16,7 +16,7 @@ public class Humanize {
final long[] dividers = new long[] { T, G, M, K, 1 };
final String[] units = new String[] { "TB", "GB", "MB", "KB", "B" };
if(value < 1)
throw new IllegalArgumentException("Invalid file size: " + value);
return "0.0 B";
String result = null;
for(int i = 0; i < dividers.length; i++){
final long divider = dividers[i];

View File

@ -0,0 +1,21 @@
package de.mc8051.arma3launcher.utils;
import java.awt.*;
import java.awt.image.BufferedImage;
/**
* Created by gurkengewuerz.de on 27.03.2020.
*/
public class ImageUtils {
public static Image getScaledImage(Image srcImg, int w, int h){
BufferedImage resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = resizedImg.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(srcImg, 0, 0, w, h, null);
g2.dispose();
return resizedImg;
}
}

View File

@ -0,0 +1,143 @@
package de.mc8051.arma3launcher.utils;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 27.03.2020.
*/
public class TaskBarUtils {
public static BufferedImage IMAGE_ICON = createIcon();
public static BufferedImage IMAGE_LGO = createLogo();
private static TaskBarUtils instance;
private final boolean isTaskbarSupported;
private final boolean isSystemtraySupported;
private Taskbar taskbar;
private SystemTray tray;
private TrayIcon trayIcon;
private Window w;
private TaskBarUtils() {
isTaskbarSupported = Taskbar.isTaskbarSupported();
if (isTaskbarSupported) {
taskbar = Taskbar.getTaskbar();
}
isSystemtraySupported = SystemTray.isSupported();
if (isSystemtraySupported) {
tray = SystemTray.getSystemTray();
try {
trayIcon = new TrayIcon(IMAGE_ICON);
trayIcon.setImageAutoSize(true);
tray.add(trayIcon);
trayIcon.addActionListener(e -> {
if (w == null) return;
if(!(w instanceof JFrame)) return;
SwingUtilities.invokeLater(() -> {
JFrame frame = (JFrame) w;
if(frame.getState()!=Frame.NORMAL) { frame.setState(Frame.NORMAL); }
frame.setVisible(true);
frame.setAlwaysOnTop(true);
frame.toFront();
frame.requestFocus();
frame.setAlwaysOnTop(false);
frame.repaint();
});
});
} catch (AWTException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
}
}
}
public static TaskBarUtils getInstance() {
if (instance == null) instance = new TaskBarUtils();
return instance;
}
public void error(Window w) {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.PROGRESS_STATE_WINDOW)) return;
taskbar.setWindowProgressState(w, Taskbar.State.ERROR);
}
public void normal() {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.PROGRESS_STATE_WINDOW)) return;
taskbar.setWindowProgressState(w, Taskbar.State.NORMAL);
}
public void off() {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.PROGRESS_STATE_WINDOW)) return;
taskbar.setWindowProgressState(w, Taskbar.State.OFF);
}
public void paused() {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.PROGRESS_STATE_WINDOW)) return;
taskbar.setWindowProgressState(w, Taskbar.State.PAUSED);
}
public void setValue(int val) {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.PROGRESS_VALUE_WINDOW)) return;
taskbar.setWindowProgressValue(w, val);
}
public void attention() {
if (w == null) return;
if (!isTaskbarSupported) return;
if (!taskbar.isSupported(Taskbar.Feature.USER_ATTENTION_WINDOW)) return;
taskbar.requestWindowUserAttention(w);
}
public void notification(String caption, String text, TrayIcon.MessageType type) {
if (!isSystemtraySupported) return;
if (trayIcon == null) return;
trayIcon.displayMessage(caption, text, type);
}
public void setWindow(Window w) {
this.w = w;
}
public void removeTrayIcon() {
if (!isSystemtraySupported) return;
if (trayIcon == null) return;
tray.remove(trayIcon);
}
static BufferedImage createIcon() {
try {
return ImageIO.read(TaskBarUtils.class.getResourceAsStream("/icons/logo_32.png"));
} catch (IOException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
return null;
}
}
static BufferedImage createLogo() {
try {
return ImageIO.read(TaskBarUtils.class.getResourceAsStream("/icons/logo_256.png"));
} catch (IOException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
return null;
}
}
}

View File

@ -3,8 +3,13 @@
"title": "Welcome! :P",
"subtitle": "${name} v${version}",
"sync": {
"useragent": "TheTownSyncer",
"url": "http://46.4.195.36"
},
"social": {
"twitter": "https://twitter.com/TheTownServer",
"github": "https://github.com/Gurkengewuerz/arma3launcher"
},
"client": {
"armaPath": "",
"modPath": "",

View File

@ -0,0 +1,189 @@
<html>
<head>
</head>
<body>
<h1>Haftungsausschluss</h1>
Gemäß <i>§1 Absatz 2 Satz 3 ProdHaftG</i> haftet das Entwickler-Team nicht für Schäden,
die aus der Nutzung des Clients entstehen, da dieser unentgeltlich angeboten und ehrenamtlich entwickelt wird. Das
Entwickler-Team übernimmt darüber hinaus keine Garantie für die ordnungsgemäße Funktion des Clients.<br/><br/>
Darausfolgt auch, dass es keinen Anspruch darauf gibt, dass der Client auf jedem System funktioniert oder Programmfehler
durch
Updates behoben werden. Wir bemühen uns zwar, ein fehlerfreies Programm anzubieten, bitten aber um Verständnis, dass
nicht jeder Fehler unsererseits behoben werden kann.
<br/>
<br/>
<h1>Icons</h1>
<div>
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
</div>
<div>
Icons made by <a href="https://www.flaticon.com/authors/pixel-perfect" title="Pixel perfect">Pixel perfect</a> from
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
</div>
<div>
Icons made by <a href="https://www.flaticon.com/authors/roundicons" title="Roundicons">Roundicons</a> from
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
</div>
<br/>
<br/>
<h1>Licenses</h1>
<h3>de.mc8051.arma3launcher</h3>
<tt>
MIT License<br/>
<br/>
Copyright (c) 2020 Niklas Schütrumpf (Gurkengewuerz)<br/>
<br/>
Permission is hereby granted, free of charge, to any person obtaining a copy<br/>
of this software and associated documentation files (the "Software"), to deal<br/>
in the Software without restriction, including without limitation the rights<br/>
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>
copies of the Software, and to permit persons to whom the Software is<br/>
furnished to do so, subject to the following conditions:<br/>
<br/>
The above copyright notice and this permission notice shall be included in all<br/>
copies or substantial portions of the Software.<br/>
<br/>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br/>
SOFTWARE.<br/>
</tt>
<br/>
<h3>com.formdev.flatlaf</h3>
<a href="">https://github.com/JFormDesigner/FlatLaf</a><br/>
<tt>
Copyright 2019 FormDev Software GmbH<br/>
<br/>
Licensed under the Apache License, Version 2.0 (the "License");<br/>
you may not use this file except in compliance with the License.<br/>
You may obtain a copy of the License at<br/>
<br/>
http://www.apache.org/licenses/LICENSE-2.0<br/>
<br/>
Unless required by applicable law or agreed to in writing, software<br/>
distributed under the License is distributed on an "AS IS" BASIS,<br/>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
See the License for the specific language governing permissions and<br/>
limitations under the License.<br/>
</tt>
<br/>
<h3>co.bitshfted.xapps.zsync</h3>
<a href="">https://github.com/bitshifted/zsyncer</a><br/>
<tt>
Copyright (c) 2015, Salesforce.com, Inc. All rights reserved.<br/>
Copyright (c) 2020, Bitshift (bitshifted.co), Inc. All rights reserved.<br/>
<br/>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the<br/>
following conditions are met:<br/>
<br/>
Redistributions of source code must retain the above copyright notice, this list of conditions and the following<br/>
disclaimer.<br/>
<br/>
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following<br/>
disclaimer in the documentation and/or other materials provided with the distribution.<br/>
<br/>
Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products<br/>
derived from this software without specific prior written permission.<br/>
<br/>
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,<br/>
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br/>
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<br/>
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br/>
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br/>
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br/>
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br/>
</tt>
<br/>
<h3>com.github.RalleYTN.SimpleRegistry</h3>
<a href="">https://github.com/RalleYTN/SimpleRegistry</a><br/>
<tt>
MIT License<br/>
<br/>
Copyright (c) 2017 Ralph Niemitz<br/>
<br/>
Permission is hereby granted, free of charge, to any person obtaining a copy<br/>
of this software and associated documentation files (the "Software"), to deal<br/>
in the Software without restriction, including without limitation the rights<br/>
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>
copies of the Software, and to permit persons to whom the Software is<br/>
furnished to do so, subject to the following conditions:<br/>
<br/>
The above copyright notice and this permission notice shall be included in all<br/>
copies or substantial portions of the Software.<br/>
<br/>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br/>
SOFTWARE.<br/>
</tt>
<br/>
<h3>com.typesafe.config</h3>
<a href="">https://github.com/lightbend/config</a><br/>
<tt>
Copyright (C) 2011-2012 Typesafe Inc. http://typesafe.com<br/>
<br/>
Licensed under the Apache License, Version 2.0 (the "License");<br/>
you may not use this file except in compliance with the License.<br/>
You may obtain a copy of the License at<br/>
<br/>
http://www.apache.org/licenses/LICENSE-2.0<br/>
<br/>
Unless required by applicable law or agreed to in writing, software<br/>
distributed under the License is distributed on an "AS IS" BASIS,<br/>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
See the License for the specific language governing permissions and<br/>
limitations under the License.<br/>
</tt>
<br/>
<h3>org.ini4j.ini4j</h3>
<a href="">https://github.com/facebookarchive/ini4j</a><br/>
<tt>
Copyright 2005,2009 Ivan SZKIBA<br/>
<br/>
Licensed under the Apache License, Version 2.0 (the "License");<br/>
you may not use this file except in compliance with the License.<br/>
You may obtain a copy of the License at<br/>
<br/>
http://www.apache.org/licenses/LICENSE-2.0<br/>
<br/>
Unless required by applicable law or agreed to in writing, software<br/>
distributed under the License is distributed on an "AS IS" BASIS,<br/>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
See the License for the specific language governing permissions and<br/>
limitations under the License.<br/>
</tt>
<h3>org.json.json</h3>
<a href="">https://json.org</a><br/>
<tt>
Copyright (c) 2018 JSON.org<br/>
<br/>
Permission is hereby granted, free of charge, to any person obtaining a copy<br/>
of this software and associated documentation files (the "Software"), to deal<br/>
in the Software without restriction, including without limitation the rights<br/>
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>
copies of the Software, and to permit persons to whom the Software is<br/>
furnished to do so, subject to the following conditions:<br/>
<br/>
The above copyright notice and this permission notice shall be included in all<br/>
copies or substantial portions of the Software.<br/>
<br/>
The Software shall be used for Good, not Evil.<br/>
<br/>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br/>
SOFTWARE.<br/>
</tt>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

View File

@ -10,7 +10,6 @@ check_modset=Modset automatisch
client_settings=Client Einstellungen
clone=Klonen
closed=geschlossen
common=Allgemein
cpucount_desc=Gibt an, wie viele Kerne der CPU von Arma 3 genutzt werden sollen.
crashdiag_desc=Zusätzlich zur RPT wird beim Arma-Absturz ein Log vom Crash in einer binarisierten Datei abgelegt.
description=Bezeichnung
@ -56,7 +55,6 @@ rename=Umbennen
repository_content=Repository Inhalt
reset_default=Auf Standard zurücksetzten
running=gestartet
select_all=Alles auswählen
select_folder=Ordner auswählen
select_mods=Mods auswählen
select_server=Server-Auswahl
@ -97,3 +95,10 @@ resume=Fortsetzen
changed_filesize=Veränderte Dateien
changed_files=Geänderte Dateien
file_count=Dateianzahl
changelog=Changelog
about=Über
follow_on_twitter=Folgt und auf Twitter
star_on_github="Star us" auf GitHub
client_up_to_date=Client ist aktuell
developer_page=Entwickler-Seite
project_page=Projektseite

View File

@ -10,7 +10,6 @@ check_modset=Check Modset automatically
client_settings=Client Settings
clone=Clone
closed=closed
common=Common
cpucount_desc=Specifies how many cores of the CPU should be used by Arma 3.
crashdiag_desc=In addition to the RPT, a log of the crash is stored in a binarized file.
description=Description
@ -55,7 +54,6 @@ remove=Remove
rename=Rename
reset_default=Reset to default
running=running
select_all=Select All
select_folder=Choose folder
select_mods=Select mods
select_server=Select Server
@ -95,3 +93,10 @@ changed_filesize=Changed size
changed_files=Changed files
changed_filesize_tooltip=This is the approximate maximum file size that will be downloaded
file_count=Number of files
changelog=Changelog
about=About
follow_on_twitter=Follow us on Twitter
star_on_github=Star us on GitHub
client_up_to_date=Client is up to date
developer_page=Developer page
project_page=Project page