# HG changeset patch # User František Kučera # Date 1285607090 -7200 # Node ID bea5d9e11d372eef3ece8c56b04e663772d58e2b # Parent dfb345ef945216df775ff9f3cfe2974fb89bbda4 Souborové dialogy si pamatují naposledy použitý adresář. diff -r dfb345ef9452 -r bea5d9e11d37 java/Postak/nbproject/build-impl.xml --- a/java/Postak/nbproject/build-impl.xml Sat Feb 28 18:06:12 2009 +0100 +++ b/java/Postak/nbproject/build-impl.xml Mon Sep 27 19:04:50 2010 +0200 @@ -20,6 +20,13 @@ --> + + + + + + + @@ -144,26 +202,79 @@ - + + + - + + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -198,7 +309,7 @@ - + @@ -213,6 +324,7 @@ + @@ -269,8 +381,11 @@ + + + @@ -287,12 +402,16 @@ + + + + - + @@ -303,20 +422,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + @@ -332,14 +517,25 @@ - + + + + + + - - + + + + + + + + @@ -352,7 +548,7 @@ Must select some files in the IDE or set javac.includes - + @@ -372,13 +568,13 @@ - + - + - + @@ -393,27 +589,26 @@ java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - + + + + + + - - - + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" @@ -422,7 +617,7 @@ - + - + @@ -489,7 +696,18 @@ + + + + + + + + + + + @@ -511,7 +729,7 @@ - + @@ -528,7 +746,7 @@ Must select some files in the IDE or set javac.includes - + @@ -550,7 +768,7 @@ - Some tests failed; see details above. + Some tests failed; see details above. @@ -563,9 +781,9 @@ - Some tests failed; see details above. + Some tests failed; see details above. - + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + diff -r dfb345ef9452 -r bea5d9e11d37 java/Postak/nbproject/genfiles.properties --- a/java/Postak/nbproject/genfiles.properties Sat Feb 28 18:06:12 2009 +0100 +++ b/java/Postak/nbproject/genfiles.properties Mon Sep 27 19:04:50 2010 +0200 @@ -1,8 +1,8 @@ build.xml.data.CRC32=ecce8ba0 build.xml.script.CRC32=e861f380 -build.xml.stylesheet.CRC32=958a1d3e +build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=ecce8ba0 -nbproject/build-impl.xml.script.CRC32=a6ef0080 -nbproject/build-impl.xml.stylesheet.CRC32=65b8de21 +nbproject/build-impl.xml.script.CRC32=c76a5265 +nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45 diff -r dfb345ef9452 -r bea5d9e11d37 java/Postak/nbproject/project.properties --- a/java/Postak/nbproject/project.properties Sat Feb 28 18:06:12 2009 +0100 +++ b/java/Postak/nbproject/project.properties Mon Sep 27 19:04:50 2010 +0200 @@ -5,6 +5,7 @@ # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes diff -r dfb345ef9452 -r bea5d9e11d37 java/Postak/src/cz/frantovo/postak/Nastaveni.java --- a/java/Postak/src/cz/frantovo/postak/Nastaveni.java Sat Feb 28 18:06:12 2009 +0100 +++ b/java/Postak/src/cz/frantovo/postak/Nastaveni.java Mon Sep 27 19:04:50 2010 +0200 @@ -8,104 +8,116 @@ * @author fiki */ public class Nastaveni implements Serializable { - private static final long serialVersionUID = -3155540704924123097L; - - private String postovniServer = "localhost"; - private int postovniPort = 25; - private String postovniJmeno; - private char[] postovniHeslo; - private int limitZprav = 1000; - - /** Připojovací řetězec */ - private String databaze; - private String dbJmeno; - private char[] dbHeslo; - - /** Výchozí příjemci */ - private ArrayList vychoziPrijemci; - - /** Přejatá konstanta od SuperPošťáka */ - private String cestaKCertifikatum; - public String getCestaKCertifikatum() { - return cestaKCertifikatum; - } + private static final long serialVersionUID = -3155540704924123097L; + private String postovniServer = "localhost"; + private int postovniPort = 25; + private String postovniJmeno; + private char[] postovniHeslo; + private int limitZprav = 1000; + /** Připojovací řetězec */ + private String databaze; + private String dbJmeno; + private char[] dbHeslo; + /** Výchozí příjemci */ + private ArrayList vychoziPrijemci; + /** Přejatá konstanta od SuperPošťáka */ + private String cestaKCertifikatum; + /** + * Výchozí adresář pro ukládání a načítání souborů + * např. pro souborové dialogy + */ + private String pracovniAdresar; - public void setCestaKCertifikatum(String cestaKCertifikatum) { - this.cestaKCertifikatum = cestaKCertifikatum; - } + public String getPracovniAdresar() { + if (pracovniAdresar == null) { + return System.getProperty("user.home"); + } else { + return pracovniAdresar; + } + } - public String getPostovniServer() { - return postovniServer; - } + public void setPracovniAdresar(String pracovniAdresar) { + this.pracovniAdresar = pracovniAdresar; + } - public void setPostovniServer(String postovniServer) { - this.postovniServer = postovniServer; - } + public String getCestaKCertifikatum() { + return cestaKCertifikatum; + } - public int getPostovniPort() { - return postovniPort; - } + public void setCestaKCertifikatum(String cestaKCertifikatum) { + this.cestaKCertifikatum = cestaKCertifikatum; + } - public void setPostovniPort(int postovniPort) { - this.postovniPort = postovniPort; - } + public String getPostovniServer() { + return postovniServer; + } - public String getPostovniJmeno() { - return postovniJmeno; - } + public void setPostovniServer(String postovniServer) { + this.postovniServer = postovniServer; + } - public void setPostovniJmeno(String postovniJmeno) { - this.postovniJmeno = postovniJmeno; - } + public int getPostovniPort() { + return postovniPort; + } - public char[] getPostovniHeslo() { - return postovniHeslo; - } + public void setPostovniPort(int postovniPort) { + this.postovniPort = postovniPort; + } - public void setPostovniHeslo(char[] postovniHeslo) { - this.postovniHeslo = postovniHeslo; - } + public String getPostovniJmeno() { + return postovniJmeno; + } - public int getLimitZprav() { - return limitZprav; - } + public void setPostovniJmeno(String postovniJmeno) { + this.postovniJmeno = postovniJmeno; + } - public void setLimitZprav(int limitZprav) { - this.limitZprav = limitZprav; - } + public char[] getPostovniHeslo() { + return postovniHeslo; + } - public String getDatabaze() { - return databaze; - } + public void setPostovniHeslo(char[] postovniHeslo) { + this.postovniHeslo = postovniHeslo; + } - public String getDbJmeno() { - return dbJmeno; - } + public int getLimitZprav() { + return limitZprav; + } - public char[] getDbHeslo() { - return dbHeslo; - } + public void setLimitZprav(int limitZprav) { + this.limitZprav = limitZprav; + } - public ArrayList getVychoziPrijemci() { - return vychoziPrijemci; - } + public String getDatabaze() { + return databaze; + } - public void setDatabaze(String databaze) { - this.databaze = databaze; - } + public String getDbJmeno() { + return dbJmeno; + } - public void setDbJmeno(String dbJmeno) { - this.dbJmeno = dbJmeno; - } + public char[] getDbHeslo() { + return dbHeslo; + } - public void setDbHeslo(char[] dbHeslo) { - this.dbHeslo = dbHeslo; - } + public ArrayList getVychoziPrijemci() { + return vychoziPrijemci; + } - public void setVychoziPrijemci(ArrayList vychoziPrijemci) { - this.vychoziPrijemci = vychoziPrijemci; - } - + public void setDatabaze(String databaze) { + this.databaze = databaze; + } + public void setDbJmeno(String dbJmeno) { + this.dbJmeno = dbJmeno; + } + + public void setDbHeslo(char[] dbHeslo) { + this.dbHeslo = dbHeslo; + } + + public void setVychoziPrijemci(ArrayList vychoziPrijemci) { + this.vychoziPrijemci = vychoziPrijemci; + } } diff -r dfb345ef9452 -r bea5d9e11d37 java/Postak/src/cz/frantovo/postak/Postak.java --- a/java/Postak/src/cz/frantovo/postak/Postak.java Sat Feb 28 18:06:12 2009 +0100 +++ b/java/Postak/src/cz/frantovo/postak/Postak.java Mon Sep 27 19:04:50 2010 +0200 @@ -90,7 +90,7 @@ } naplnPrijemce(mimeZprava, zprava); mimeZprava.setSubject(zprava.getPredmet()); - mimeZprava.setHeader("User-Agent", "http://frantovo.cz/projekty/SuperPostak/"); + mimeZprava.setHeader("User-Agent", "http://frantovo.cz/projekty/SuperPostak/ | https://posta.veverka.ch/posta/"); if (zprava.isFormatHTML()) { mimeZprava.setText(zprava.getText(), "UTF-8", "html"); } else { diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/nbproject/build-impl.xml --- a/java/SuperPostak/nbproject/build-impl.xml Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/nbproject/build-impl.xml Mon Sep 27 19:04:50 2010 +0200 @@ -21,6 +21,13 @@ --> + + + + + + + @@ -145,26 +203,79 @@ - + + + - + + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -199,7 +310,7 @@ - + @@ -214,6 +325,7 @@ + @@ -270,8 +382,11 @@ + + + @@ -288,12 +403,16 @@ + + + + - + @@ -304,22 +423,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,14 +532,25 @@ - + + + + + + - - + + + + + + + + @@ -356,7 +563,7 @@ Must select some files in the IDE or set javac.includes - + @@ -376,13 +583,13 @@ - + - + - + @@ -397,27 +604,26 @@ java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - + + + + + + - - - + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" @@ -426,7 +632,7 @@ - + - + @@ -493,7 +711,18 @@ + + + + + + + + + + + @@ -515,7 +744,7 @@ - + @@ -532,7 +761,7 @@ Must select some files in the IDE or set javac.includes - + @@ -554,7 +783,7 @@ - Some tests failed; see details above. + Some tests failed; see details above. @@ -567,9 +796,9 @@ - Some tests failed; see details above. + Some tests failed; see details above. - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/nbproject/genfiles.properties --- a/java/SuperPostak/nbproject/genfiles.properties Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/nbproject/genfiles.properties Mon Sep 27 19:04:50 2010 +0200 @@ -1,8 +1,8 @@ build.xml.data.CRC32=d917048a build.xml.script.CRC32=7b671108 -build.xml.stylesheet.CRC32=958a1d3e +build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=d917048a -nbproject/build-impl.xml.script.CRC32=957eb65c -nbproject/build-impl.xml.stylesheet.CRC32=65b8de21 +nbproject/build-impl.xml.script.CRC32=f09a3efb +nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45 diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/nbproject/project.properties --- a/java/SuperPostak/nbproject/project.properties Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/nbproject/project.properties Mon Sep 27 19:04:50 2010 +0200 @@ -5,6 +5,7 @@ # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes @@ -30,7 +31,8 @@ ${libs.MySQLDriver.classpath}:\ ${libs.jTDS-Sybase-MSSQL.classpath}:\ ${libs.Sybase.com.classpath}:\ - ${reference.Postak.jar} + ${reference.Postak.jar}:\ + ${libs.OracleJDBC.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.form --- a/java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.form Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.form Mon Sep 27 19:04:50 2010 +0200 @@ -1,4 +1,4 @@ - +
@@ -17,7 +17,7 @@ - + diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.java --- a/java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.java Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/PanelPrijemcu.java Mon Sep 27 19:04:50 2010 +0200 @@ -2,6 +2,7 @@ import cz.frantovo.gui.tabulky.TableSorterModel; import cz.frantovo.postak.InternetAddressKomu; +import cz.frantovo.postak.Nastaveni; import cz.frantovo.postak.Postak; import java.awt.Cursor; import java.io.BufferedReader; @@ -26,9 +27,10 @@ */ public class PanelPrijemcu extends javax.swing.JPanel { - private static Logger log = Logger.getLogger(PanelPrijemcu.class.getName()); + private static final Logger log = Logger.getLogger(PanelPrijemcu.class.getName()); private static final long serialVersionUID = -8981943048392428523L; private ModelTabulky data = new ModelTabulky(); + private Nastaveni nastaveni = new Nastaveni(); /** Creates new form PanelPrijemcu */ public PanelPrijemcu() { @@ -42,6 +44,10 @@ return data.data; } + public void setNastaveni(Nastaveni nastaveni) { + this.nastaveni = nastaveni; + } + /** * @param prijemci pokud je null, nastaví prázdná kolekce. */ @@ -179,9 +185,11 @@ JFileChooser dialog = new JFileChooser(); dialog.setMultiSelectionEnabled(false); dialog.setDialogTitle("Uložit seznam do souboru"); + dialog.setCurrentDirectory(new File(nastaveni.getPracovniAdresar())); int vysledek = dialog.showSaveDialog(this); if (vysledek == JFileChooser.APPROVE_OPTION) { File soubor = dialog.getSelectedFile(); + nastaveni.setPracovniAdresar(soubor.getParent()); try { setCursor(new Cursor(Cursor.WAIT_CURSOR)); OutputStreamWriter zapisovac = new FileWriter(soubor); @@ -217,9 +225,11 @@ JFileChooser dialog = new JFileChooser(); dialog.setMultiSelectionEnabled(false); dialog.setDialogTitle("Načíst adresy ze souboru"); + dialog.setCurrentDirectory(new File(nastaveni.getPracovniAdresar())); int vysledek = dialog.showOpenDialog(this); if (vysledek == JFileChooser.APPROVE_OPTION) { File soubor = dialog.getSelectedFile(); + nastaveni.setPracovniAdresar(soubor.getParent()); try { setCursor(new Cursor(Cursor.WAIT_CURSOR)); BufferedReader ctenar = new BufferedReader(new FileReader(soubor)); diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.form --- a/java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.form Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.form Mon Sep 27 19:04:50 2010 +0200 @@ -1,4 +1,4 @@ - + diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java --- a/java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java Mon Sep 27 19:04:50 2010 +0200 @@ -72,6 +72,11 @@ inicializujCardLayout(); setLocationRelativeTo(null); + /** Kvůli souborovým dialogům – aby se otvírali ve stejné složce jako minule. */ + prijemciDodatecni.setNastaveni(nastaveni); + prijemciVychozi.setNastaveni(nastaveni); + prijemciZkusebni.setNastaveni(nastaveni); + /** Vyřešíme problém TAB vs. Focus */ vyresitTabFocusProblem(vstupSQL); vyresitTabFocusProblem(vstupZprava); @@ -135,6 +140,7 @@ nactiOvladacJDBC("com.mysql.jdbc.Driver", "MySQL"); nactiOvladacJDBC("net.sourceforge.jtds.jdbc.Driver", "jTDS Sybase a MS SQL"); nactiOvladacJDBC("com.sybase.jdbc2.jdbc.SybDriver", "Sybase.com"); + nactiOvladacJDBC("oracle.jdbc.OracleDriver", "Oracle"); } /** @@ -1047,6 +1053,7 @@ Collection adresy = getPrijemciSQL(); ZobrazovacAdres zobrazovac = new ZobrazovacAdres(this, false); + zobrazovac.setNastaveni(nastaveni); zobrazovac.setAdresy(adresy); zobrazovac.setLocationRelativeTo(this); zobrazovac.setVisible(true); diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.form --- a/java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.form Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.form Mon Sep 27 19:04:50 2010 +0200 @@ -1,4 +1,4 @@ - + diff -r dfb345ef9452 -r bea5d9e11d37 java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.java --- a/java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.java Sat Feb 28 18:06:12 2009 +0100 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/ZobrazovacAdres.java Mon Sep 27 19:04:50 2010 +0200 @@ -1,6 +1,7 @@ package cz.frantovo.superPostak; import cz.frantovo.postak.InternetAddressKomu; +import cz.frantovo.postak.Nastaveni; import java.util.Collection; /** @@ -22,6 +23,10 @@ panelAdres.setAdresy(adresy); } + public void setNastaveni(Nastaveni n) { + panelAdres.setNastaveni(n); + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is