mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 10:12:17 +10:00
patch for mac-specific file handler
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<classpathentry kind="lib" path="lib/balloontip-1.2.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jep-2.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/poi-3.5-FINAL-20090928.jar"/>
|
||||
<classpathentry kind="lib" path="lib/AppleJavaExtensions.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/diylc-core"/>
|
||||
<classpathentry kind="lib" path="lib/xstream-1.4.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/java-http-proxy.jar"/>
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.appframework.miscutils.PropertyInjector;
|
||||
import org.diylc.appframework.miscutils.Utils;
|
||||
import org.diylc.common.IPlugInPort;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.lang.LangUtil;
|
||||
@@ -119,7 +120,9 @@ public class DIYLCStarter {
|
||||
for (int i = 0; i < fonts.length; i++) {
|
||||
try {
|
||||
LOG.info("Dynamically loading font: " + fonts[i].getName());
|
||||
Font customFont = Font.createFont(Font.TRUETYPE_FONT, new File(fonts[i].getAbsolutePath())).deriveFont(12f);
|
||||
Font customFont =
|
||||
Font.createFont(Font.TRUETYPE_FONT, new File(fonts[i].getAbsolutePath()))
|
||||
.deriveFont(12f);
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
// register the font
|
||||
ge.registerFont(customFont);
|
||||
@@ -141,11 +144,11 @@ public class DIYLCStarter {
|
||||
|
||||
String val = System.getProperty(SCRIPT_RUN);
|
||||
if (!"true".equals(val)) {
|
||||
int response =
|
||||
JOptionPane.showConfirmDialog(null, "It is not recommended to run DIYLC by clicking on the diylc.jar file.\n"
|
||||
int response = JOptionPane.showConfirmDialog(null,
|
||||
"It is not recommended to run DIYLC by clicking on the diylc.jar file.\n"
|
||||
+ "Please use diylc.exe on Windows or run.sh on OSX/Linux to ensure the best\n"
|
||||
+ "performance and reliability. Do you want to continue?", "DIYLC", JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.WARNING_MESSAGE);
|
||||
+ "performance and reliability. Do you want to continue?",
|
||||
"DIYLC", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||
if (response != JOptionPane.YES_OPTION) {
|
||||
System.exit(0);
|
||||
}
|
||||
@@ -164,6 +167,8 @@ public class DIYLCStarter {
|
||||
|
||||
mainFrame.setVisible(true);
|
||||
|
||||
// assign open file handler for Mac
|
||||
if (Utils.isMac()) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Application.getApplication().setOpenFileHandler((AppEvent.OpenFilesEvent ofe) -> {
|
||||
List<File> files = ofe.getFiles();
|
||||
@@ -175,11 +180,13 @@ public class DIYLCStarter {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (args.length > 0) {
|
||||
presenter.loadProjectFromFile(args[0]);
|
||||
} else {
|
||||
boolean showTemplates = ConfigurationManager.getInstance().readBoolean(TemplateDialog.SHOW_TEMPLATES_KEY, false);
|
||||
boolean showTemplates =
|
||||
ConfigurationManager.getInstance().readBoolean(TemplateDialog.SHOW_TEMPLATES_KEY, false);
|
||||
if (showTemplates) {
|
||||
TemplateDialog templateDialog = new TemplateDialog(mainFrame, mainFrame.getPresenter());
|
||||
if (!templateDialog.getFiles().isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user