Revision: 6200
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6200&view=rev
Author: wis775
Date: 2011-03-19 13:17:42 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
Now, "Press to open logs" shows the current log file by default instead of a random one.
The combobox holds object from type LogFile, so if we want so select the default, we must use LogFile instead of String.
Modified Paths:
--------------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ViewLogsSheet.java
trunk/sql12/doc/src/main/resources/changes.txt
Added Paths:
-----------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/LogFile.java
Added: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/LogFile.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/LogFile.java (rev 0)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/LogFile.java 2011-03-19 13:17:42 UTC (rev 6200)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Stefan Willinger
+ * wi...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.client.gui;
+
+import java.io.File;
+
+import net.sourceforge.squirrel_sql.fw.util.Utilities;
+
+/**
+ * Represents a Squirrel-SQL log file.
+ *
+ * This class was originally a inner class of {@link ViewLogsSheet}.
+ * @author Stefan Willinger
+ *
+ */
+public class LogFile extends File
+{
+ private static final long serialVersionUID = 1L;
+
+ private final String _stringRep;
+
+ LogFile(File dir, String name)
+ {
+ super(dir, name);
+ final StringBuffer buf = new StringBuffer();
+ buf.append(getName()).append(" (").append(Utilities.formatSize(length())).append(")");
+ _stringRep = buf.toString();
+ }
+
+ /**
+ * @param appLogFile
+ */
+ public LogFile(File appLogFile) {
+ this(appLogFile.getParentFile(), appLogFile.getName());
+ }
+
+ @Override
+ public String toString()
+ {
+ return _stringRep;
+ }
+}
\ No newline at end of file
Property changes on: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/LogFile.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ViewLogsSheet.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ViewLogsSheet.java 2011-03-19 13:15:03 UTC (rev 6199)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ViewLogsSheet.java 2011-03-19 13:17:42 UTC (rev 6200)
@@ -54,7 +54,6 @@
import net.sourceforge.squirrel_sql.fw.gui.ToolBar;
import net.sourceforge.squirrel_sql.fw.util.StringManager;
import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
-import net.sourceforge.squirrel_sql.fw.util.Utilities;
import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
@@ -460,7 +459,8 @@
if (_logDirCmb.getModel().getSize() > 0)
{
- _logDirCmb.setSelectedItem(appLogFile.getName());
+ LogFile logFile = new LogFile(appLogFile);
+ _logDirCmb.setSelectedItem(logFile);
}
// Done after the set of the selected item above so that we control
@@ -572,25 +572,4 @@
super.addItem(new LogFile(_dir, anObject.toString()));
}
}
-
- private static final class LogFile extends File
- {
- private static final long serialVersionUID = 1L;
-
- private final String _stringRep;
-
- LogFile(File dir, String name)
- {
- super(dir, name);
- final StringBuffer buf = new StringBuffer();
- buf.append(getName()).append(" (").append(Utilities.formatSize(length())).append(")");
- _stringRep = buf.toString();
- }
-
- @Override
- public String toString()
- {
- return _stringRep;
- }
- }
}
Modified: trunk/sql12/doc/src/main/resources/changes.txt
===================================================================
--- trunk/sql12/doc/src/main/resources/changes.txt 2011-03-19 13:15:03 UTC (rev 6199)
+++ trunk/sql12/doc/src/main/resources/changes.txt 2011-03-19 13:17:42 UTC (rev 6200)
@@ -29,6 +29,8 @@
Bug-fixes:
+Now, "Press to open logs" shows the current log file by default instead of a random one.
+
3222350: Cannot enter negative values for numeric fields when editing the result table.
3196153: When typing using shift, you must release shift to type space
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|