git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@5200 ebf7c1c2-ba36-0410-9fe8-c592906822b4

This commit is contained in:
coalado 2009-04-09 09:12:18 +00:00
parent 04aeeade5c
commit 3403f3caf0
7 changed files with 81 additions and 78 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,17 +1,10 @@
import java.awt.BorderLayout;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import org.jdesktop.swingx.JXCollapsiblePane;
import org.jdesktop.swingx.JXLoginDialog;
public class header {
@ -45,39 +38,8 @@ public class header {
}
public static void main(String[] args) throws IOException {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("Test Oriented Collapsible Pane");
f.add(new JLabel("Press Ctrl+F or Ctrl+G to collapse panes."), BorderLayout.NORTH);
JTree tree1 = new JTree();
tree1.setBorder(BorderFactory.createEtchedBorder());
f.add(tree1);
JXCollapsiblePane pane = new JXCollapsiblePane();
pane.setCollapsed(true);
JTree tree2 = new JTree();
tree2.setBorder(BorderFactory.createEtchedBorder());
pane.add(tree2);
f.add(pane, BorderLayout.SOUTH);
pane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl F"), JXCollapsiblePane.TOGGLE_ACTION);
pane = new JXCollapsiblePane();
JTree tree3 = new JTree();
pane.add(tree3);
tree3.setBorder(BorderFactory.createEtchedBorder());
f.add(pane, BorderLayout.WEST);
pane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl G"), JXCollapsiblePane.TOGGLE_ACTION);
f.setSize(640, 480);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
});
}
}

View File

@ -28,6 +28,7 @@ import java.rmi.Naming;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Properties;
import java.util.TreeSet;
import java.util.logging.Level;
@ -241,7 +242,6 @@ public class Main {
LOGGER.info("init Localisation");
Main.setSplashStatus(splashScreen, 10, JDLocale.L("gui.splash.text.loadLanguage", "lade Sprachen"));
JDSounds.setSoundTheme("default");
if (!JDInitFlags.SWITCH_NEW_INSTANCE && Main.tryConnectToServer(args)) {
@ -412,7 +412,6 @@ public class Main {
JOptionPane.showMessageDialog(null, "JDownloader cannot create the config files. Make sure, that JD_HOME/config/ exists and is writeable");
}
// JFrame.setDefaultLookAndFeelDecorated(true);
// JDialog.setDefaultLookAndFeelDecorated(true);
if (JDInitFlags.SWITCH_DEBUG) {
@ -430,17 +429,22 @@ public class Main {
final JDController controller = init.initController();
// if (JDInitFlags.SWITCH_DEBUG || JDUtilities.getConfiguration().getBooleanProperty(Configuration.LOGGER_FILELOG, false)) {
// if (JDInitFlags.SWITCH_DEBUG ||
// JDUtilities.getConfiguration().getBooleanProperty
// (Configuration.LOGGER_FILELOG, false)) {
// try {
//
// File log = JDUtilities.getResourceFile("logs/" + (JDInitFlags.SWITCH_DEBUG ? "debug" : "") + "log_" + System.currentTimeMillis() + ".log");
// File log = JDUtilities.getResourceFile("logs/" +
// (JDInitFlags.SWITCH_DEBUG ? "debug" : "") + "log_" +
// System.currentTimeMillis() + ".log");
// LOGGER.info("DEBUGGER: Write log to "+log);
// if (!log.getParentFile().exists()) {
// log.getParentFile().mkdirs();
// }
// controller.setLogFileWriter(new BufferedWriter(new FileWriter(log)));
// } catch (IOException e) {
// jd.controlling.JDLogger.getLogger().log(java.util.logging.Level.SEVERE,"Exception occured",e);
//jd.controlling.JDLogger.getLogger().log(java.util.logging.Level.SEVERE
// ,"Exception occured",e);
// }
// }
LOGGER.info("init Webupdate");
@ -449,6 +453,10 @@ public class Main {
LOGGER.info("init plugins");
Main.setSplashStatus(splashScreen, 15, JDLocale.L("gui.splash.text.loadPlugins", "Lade Plugins"));
init.initPlugins();
Locale.setDefault(Locale.ENGLISH);
LOGGER.info("init gui");
Main.setSplashStatus(splashScreen, 20, JDLocale.L("gui.splash.text.loadGUI", "Lade Benutzeroberfläche"));
new GuiRunnable() {
@ -495,12 +503,27 @@ try{
}
init.checkUpdate();
// logger.info(JDUtilities.getSubConfig(SimpleGUI.GUICONFIGNAME).
// getBooleanProperty(SimpleGUI.PARAM_DISABLE_CONFIRM_DIALOGS,
// false).toString());
// if ((JDUtilities.getRunType() == JDUtilities.RUNTYPE_LOCAL_JARED) && (JDUtilities.getConfiguration().getBooleanProperty(Configuration.LOGGER_FILELOG, false) || level.equals(Level.ALL) || level.equals(Level.FINER) || level.equals(Level.FINE)) && !JDInitFlags.SWITCH_DEBUG && (!JDUtilities.getSubConfig(SimpleGuiConstants.GUICONFIGNAME).getBooleanProperty(SimpleGuiConstants.PARAM_DISABLE_CONFIRM_DIALOGS, false))) {
// JDUtilities.getGUI().showHelpMessage(JDLocale.L("main.start.logwarning.title", "Logwarnung"), JDLocale.LF("main.start.logwarning.body", "ACHTUNG. Das Loglevel steht auf %s und der Dateischreiber ist %s. \r\nDiese Einstellungen belasten das System und sind nur zur Fehlersuche geeignet.", level.getName(), JDUtilities.getConfiguration().getBooleanProperty(Configuration.LOGGER_FILELOG, false) ? JDLocale.L("main.status.active", "an") : JDLocale.L("main.status.inactive", "aus")), true, JDLocale.L("main.urls.faq", "http://jdownloader.org/faq.php?lng=deutsch"), null, 10);
// if ((JDUtilities.getRunType() == JDUtilities.RUNTYPE_LOCAL_JARED) &&
// (JDUtilities.getConfiguration().getBooleanProperty(Configuration.
// LOGGER_FILELOG, false) || level.equals(Level.ALL) ||
// level.equals(Level.FINER) || level.equals(Level.FINE)) &&
// !JDInitFlags.SWITCH_DEBUG &&
// (!JDUtilities.getSubConfig(SimpleGuiConstants
// .GUICONFIGNAME).getBooleanProperty
// (SimpleGuiConstants.PARAM_DISABLE_CONFIRM_DIALOGS, false))) {
// JDUtilities.getGUI().showHelpMessage(JDLocale.L(
// "main.start.logwarning.title", "Logwarnung"),
// JDLocale.LF("main.start.logwarning.body",
// "ACHTUNG. Das Loglevel steht auf %s und der Dateischreiber ist %s. \r\nDiese Einstellungen belasten das System und sind nur zur Fehlersuche geeignet."
// , level.getName(),
// JDUtilities.getConfiguration().getBooleanProperty(Configuration
// .LOGGER_FILELOG, false) ? JDLocale.L("main.status.active", "an") :
// JDLocale.L("main.status.inactive", "aus")), true,
// JDLocale.L("main.urls.faq",
// "http://jdownloader.org/faq.php?lng=deutsch"), null, 10);
// }
JDUtilities.getController().fireControlEvent(new ControlEvent(this, ControlEvent.CONTROL_INIT_COMPLETE, null));

View File

@ -98,7 +98,7 @@ public interface UIInterface extends ControlListener {
public boolean showConfirmDialog(String string);
public boolean showConfirmDialog(String string, String title);
public String[] showLoginDialog(String title,String defaultUser,String defaultPassword,String errorMessage);
/**
* Zeigt einen MessageDialog mit Countdown an
*

View File

@ -107,8 +107,11 @@ import net.miginfocom.swing.MigLayout;
import org.jdesktop.swingx.JXCollapsiblePane;
import org.jdesktop.swingx.JXFrame;
import org.jdesktop.swingx.JXLoginDialog;
import org.jdesktop.swingx.JXTipOfTheDay;
import org.jdesktop.swingx.JXTitledSeparator;
import org.jdesktop.swingx.JXLoginPane.Status;
import org.jdesktop.swingx.auth.LoginService;
import org.jdesktop.swingx.tips.DefaultTip;
import org.jdesktop.swingx.tips.DefaultTipOfTheDayModel;
import org.jvnet.substance.SubstanceLookAndFeel;
@ -1437,4 +1440,19 @@ public class SimpleGUI extends JXFrame implements UIInterface, ActionListener, W
return this.linkListPane;
}
public String[] showLoginDialog(String title, String defaultUser, String defaultPassword,String error) {
JXLoginDialog d = new JXLoginDialog(this,JDLocale.L("gui.dialogs.login.title","Login required"),true);
if(defaultPassword!=null)d.getPanel().setPassword(defaultPassword.toCharArray());
d.getPanel().setUserName(defaultUser);
d.getPanel().setErrorMessage(error);
d.getPanel().setMessage(title);
d.setVisible(true);
if(d.getStatus()!=Status.SUCCEEDED)return null;
return new String[]{ d.getPanel().getUserName(),new String(d.getPanel().getPassword())};
}
}