Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/devlinx9/muon-ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
devlinx9 committed Oct 30, 2021
2 parents 207e87a + 26aec0e commit c864887
Show file tree
Hide file tree
Showing 54 changed files with 1,752 additions and 621 deletions.
72 changes: 68 additions & 4 deletions muon-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>muon</groupId>
<artifactId>muon</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.2.0</version>
</parent>
<groupId>muon-app</groupId>
<artifactId>muon-app</artifactId>
Expand Down Expand Up @@ -144,7 +144,7 @@
<dependency>
<groupId>com.hierynomus</groupId>
<artifactId>sshj</artifactId>
<version>0.28.0</version>
<version>0.31.0</version>
</dependency>


Expand Down Expand Up @@ -172,7 +172,7 @@
</dependencies>

<build>
<finalName>muon-${project.version}</finalName>
<finalName>muon_${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -209,7 +209,7 @@
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
<finalName>muon-${project.version}-full</finalName>
<finalName>muon_${project.version}</finalName>
<archiverConfig>
<compress>false</compress>
</archiverConfig>
Expand All @@ -229,6 +229,70 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir>${basedir}/src/deb/control</controlDir>
<deb>${project.build.directory}/muon_${project.version}.deb</deb>
<dataSet>
<data>
<src>${basedir}/src/deb/opt/muon/muon-logo.png</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/opt/muon/muon-logo.png</prefix>
<user>loader</user>
<group>loader</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<src>${basedir}/src/deb/usr/share/applications/muon.desktop</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/applications</prefix>
<user>loader</user>
<group>loader</group>
<filemode>644</filemode>
</mapper>
</data>
<data>
<src>${basedir}/src/deb/usr/bin/muon</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/bin</prefix>
<user>loader</user>
<group>loader</group>
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.build.finalName}.jar</src>
<type>file</type>
<dst>muon.jar</dst>
<mapper>
<type>perm</type>
<prefix>/opt/muon</prefix>
<user>loader</user>
<group>loader</group>
<filemode>644</filemode>
</mapper>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
Expand Down
10 changes: 10 additions & 0 deletions muon-app/src/deb/control/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: muon
Version: 1.2.0
Section: base
Priority: optional
Architecture: all
Depends: openjdk-11-jre
Maintainer: Subhra Das Gupta <subhra74@github.com>
Description: Muon is a modern graphical SSH client
Muon is a modern graphical SSH client which provides
simple easy to use GUI for common tasks
Binary file added muon-app/src/deb/opt/muon/muon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions muon-app/src/deb/usr/bin/muon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
java -jar /opt/muon/muon.jar
5 changes: 5 additions & 0 deletions muon-app/src/deb/usr/share/applications/muon.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Desktop Entry]
Name=Muon SSH client
Exec=/usr/bin/muon
Icon=/opt/muon/muon-logo.png
Type=Application
38 changes: 32 additions & 6 deletions muon-app/src/main/java/muon/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
//import java.io.OutputStream;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -41,6 +37,7 @@
import muon.app.ui.laf.AppSkinDark;
import muon.app.ui.laf.AppSkinLight;
import muon.app.updater.VersionEntry;
import util.Language;
import util.PlatformUtils;
import util.Win32DragHandler;

Expand Down Expand Up @@ -79,9 +76,11 @@ public class App {
public static final String APP_INSTANCE_ID = UUID.randomUUID().toString();

public static GraphicalHostKeyVerifier HOST_KEY_VERIFIER;
public static ResourceBundle bundle;

public static void main(String[] args) throws UnsupportedLookAndFeelException {




Security.addProvider(new BouncyCastleProvider());

Expand Down Expand Up @@ -117,6 +116,16 @@ public static void main(String[] args) throws UnsupportedLookAndFeelException {
System.out.println("Searching for known editors...done");
}

Language language= null;
if (settings.getLanguage() == null){
language=Language.ENGLISH;
} else {
language=settings.getLanguage();
}
Locale locale = new Locale(language.getLangAbbr());

bundle = ResourceBundle.getBundle("muon.app.common.i18n.Messages", locale);

SKIN = settings.isUseGlobalDarkTheme() ? new AppSkinDark() : new AppSkinLight();

UIManager.setLookAndFeel(SKIN.getLaf());
Expand Down Expand Up @@ -174,6 +183,23 @@ public synchronized static void loadSettings() {
settings = new Settings();
}

public synchronized static Settings loadSettings2() {
File file = new File(CONFIG_DIR, CONFIG_DB_FILE);
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
if (file.exists()) {
try {
settings = objectMapper.readValue(file, new TypeReference<Settings>() {
});
return settings;
} catch (IOException e) {
e.printStackTrace();
}
}
settings = new Settings();
return settings;
}

public synchronized static void saveSettings() {
File file = new File(CONFIG_DIR, CONFIG_DB_FILE);
ObjectMapper objectMapper = new ObjectMapper();
Expand Down
18 changes: 18 additions & 0 deletions muon-app/src/main/java/muon/app/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import muon.app.ui.components.settings.DarkTerminalTheme;
import muon.app.ui.components.settings.EditorEntry;
import util.CollectionHelper;
import util.Language;

public class Settings {
private boolean usingMasterPassword = false;
Expand Down Expand Up @@ -40,6 +41,7 @@ public class Settings {
private boolean terminalBell = false;
private String terminalFontName = "NotoMono-Regular";
private int terminalFontSize = 14;
private Language language = Language.ENGLISH;
private String terminalTheme = "Dark";
private String terminalPalette = "xterm";
private int[] palleteColors = { 0x000000, 0xcd0000, 0x00cd00, 0xcdcd00, 0x1e90ff, 0xcd00cd, 0x00cdcd, 0xe5e5e5,
Expand Down Expand Up @@ -402,6 +404,22 @@ public void setTerminalTheme(String terminalTheme) {
this.terminalTheme = terminalTheme;
}

/**
*
* @return Language
*/
public Language getLanguage() {
return language;
}

/**
*
* @param language
*/
public void setLanguage(Language language) {
this.language = language;
}

/**
* @return the terminalPalette
*/
Expand Down
33 changes: 7 additions & 26 deletions muon-app/src/main/java/muon/app/common/FileInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import util.TimeUtils;

public class FileInfo implements Serializable, Comparable<FileInfo> {
public class FileInfo implements Serializable {
private static final Pattern USER_REGEX = Pattern
.compile("^[^\\s]+\\s+[^\\s]+\\s+([^\\s]+)\\s+([^\\s]+)");
private String name;
private final String name;
private String path;
private long size;
private FileType type;
Expand All @@ -24,9 +24,9 @@ public class FileInfo implements Serializable, Comparable<FileInfo> {
private boolean hidden;

public FileInfo(String name, String path, long size, FileType type,
long lastModified, int permission, String protocol,
String permissionString, long created, String extra,
boolean hidden) {
long lastModified, int permission, String protocol,
String permissionString, long created, String extra,
boolean hidden) {
super();
this.name = name;
this.path = path;
Expand Down Expand Up @@ -172,26 +172,7 @@ public void setHidden(boolean hidden) {
this.hidden = hidden;
}

@Override
public int compareTo(FileInfo o) {
if (getType() == FileType.Directory || getType() == FileType.DirLink) {
if (o.getType() == FileType.Directory
|| o.getType() == FileType.DirLink) {
return getName().compareToIgnoreCase(o.getName());
} else {
return 1;
}
} else {
if (o.getType() == FileType.Directory
|| o.getType() == FileType.DirLink) {
return -1;
} else {
return getName().compareToIgnoreCase(o.getName());
}
}
// if (o != null && o.getName() != null) {
// return getName().compareToIgnoreCase(o.getName());
// }
// return 1;
public boolean isDirectory() {
return getType() == FileType.Directory || getType() == FileType.DirLink;
}
}
Loading

0 comments on commit c864887

Please sign in to comment.