Issue #556 Goto main class on startup not working fix

This commit is contained in:
Jindra Pet��k
2014-04-04 06:51:59 +02:00
parent 9774fbd2a7
commit 8734eb3381
2 changed files with 10 additions and 2 deletions
@@ -375,6 +375,7 @@ public class Main {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
boolean first = true; boolean first = true;
SWF firstSWF = null;
for (final SWFSourceInfo sourceInfo : sourceInfos) { for (final SWFSourceInfo sourceInfo : sourceInfos) {
SWFList swfs = null; SWFList swfs = null;
try { try {
@@ -391,6 +392,9 @@ public class Main {
final SWFList swfs1 = swfs; final SWFList swfs1 = swfs;
final boolean first1 = first; final boolean first1 = first;
first = false; first = false;
if(firstSWF == null){
firstSWF = swfs1.get(0);
}
try { try {
Main.startWork(AppStrings.translate("work.creatingwindow") + "..."); Main.startWork(AppStrings.translate("work.creatingwindow") + "...");
View.execInEventDispatch(new Runnable() { View.execInEventDispatch(new Runnable() {
@@ -407,6 +411,7 @@ public class Main {
} }
loadingDialog.setVisible(false); loadingDialog.setVisible(false);
final SWF fswf = firstSWF;
View.execInEventDispatch(new Runnable() { View.execInEventDispatch(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -414,6 +419,9 @@ public class Main {
mainFrame.setVisible(true); mainFrame.setVisible(true);
} }
Main.stopWork(); Main.stopWork();
if (mainFrame != null && Configuration.gotoMainClassOnStartup.get()) {
mainFrame.getPanel().gotoDocumentClass(fswf);
}
} }
}); });
@@ -720,9 +720,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
showCard(CARDEMPTYPANEL); showCard(CARDEMPTYPANEL);
updateUi(swf); updateUi(swf);
if (first && Configuration.gotoMainClassOnStartup.get()) { /*if (first && Configuration.gotoMainClassOnStartup.get()) {
gotoDocumentClass(swf); gotoDocumentClass(swf);
} }*/
first = false; first = false;
} }
} }