Commit b3508655 by Tobias

added support for directly open images with stegosuite

1 parent 405a78c8
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.stegosuite</groupId>
<artifactId>stegosuite</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.7-SNAPSHOT</version>
<name>stegosuite</name>
<description>A free steganography and steganlysis tool to hide information in image files.</description>
<properties>
......
[Desktop Entry]
Name=stegosuite
Name=Stegosuite
Categories=Graphics;
Comment=A steganography and steganalysis tool
Exec=stegosuite %u
Icon=/usr/share/stegosuite/icons/stegosuite.png
MimeType=
MimeType=image/gif;image/bmp;
Terminal=false
Type=Application
......@@ -13,7 +13,9 @@ public class Stegosuite {
Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.DEBUG);
if (args.length == 0) {
new Gui();
new Gui(null);
} else if (args[0].startsWith("/")) {
new Gui(args[0]);
} else {
new Cli(args);
}
......
......@@ -42,13 +42,20 @@ public class Gui {
private static Label statusBar;
private final ResourceBundle L = ResourceBundle.getBundle("Messages");
public Gui() {
private String imagePath = null;
public Gui(String path) {
display = new Display();
guiComponents = new GuiComponents();
shell = guiComponents.createShell(display);
statusBar = guiComponents.createStatusBar(shell);
menuBar = guiComponents.createMenuBar(shell);
showStartScreen();
if (path != null) {
imagePath = path;
} else {
showStartScreen();
}
final String[] FILTER_NAMES = { "BMP/GIF-Files (*.bmp/*.gif)", "BMP-Files (*.bmp)", "GIF-Files (*.gif)" };
final String[] FILTER_EXTS = { "*.bmp;*.gif", "*.bmp", "*.gif" };
......@@ -88,6 +95,10 @@ public class Gui {
// ======================================
shell.open();
if (imagePath != null) {
loadImages(imagePath);
}
// main loop
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
......@@ -107,7 +118,9 @@ public class Gui {
String extension = FileUtils.getFileExtension(path);
if (ImageFormat.getRegisteredImageExtensions().containsKey(extension)) {
if (tabFolder == null) {
shell.getChildren()[1].dispose();
if (shell.getChildren().length > 1) {
shell.getChildren()[1].dispose();
}
startTabFolder();
}
try {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!