|
From: SVN by r. <sv...@ca...> - 2008-08-06 20:33:01
|
Author: roy
Date: 2008-08-06 22:32:52 +0200 (Wed, 06 Aug 2008)
New Revision: 284
Modified:
src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java
src/main/java/nl/improved/sqlclient/jcurses/SQLShellWindow.java
Log:
fixes show 'queries in progress' that will be executed once the current query is done
Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java
===================================================================
--- src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-08-06 14:23:23 UTC (rev 283)
+++ src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-08-06 20:32:52 UTC (rev 284)
@@ -522,7 +522,7 @@
List<SQLCommand> returnValue = new ArrayList<SQLCommand>();
Iterator<CommandInfo> i = commandQueue.iterator();
while (i.hasNext()) {
- returnValue.add(i.next().cmd);
+ returnValue.add(i.next().sql);
}
return returnValue;
}
Modified: src/main/java/nl/improved/sqlclient/jcurses/SQLShellWindow.java
===================================================================
--- src/main/java/nl/improved/sqlclient/jcurses/SQLShellWindow.java 2008-08-06 14:23:23 UTC (rev 283)
+++ src/main/java/nl/improved/sqlclient/jcurses/SQLShellWindow.java 2008-08-06 20:32:52 UTC (rev 284)
@@ -231,14 +231,18 @@
tmpList.addAll(screenBuffer);
//add prompt
- SQLCommand commandLines = getCommand();
- List<? extends CharSequence> currentLines = commandLines.getLines();
- for (int i = 0; i < currentLines.size(); i++) {
- if (i == 0 && screen.getShowPrompt()) {
- tmpList.add(Screen.PROMPT+"> "+currentLines.get(i));
- } else {
- String nrI = Integer.toString(i+1);
- tmpList.add(screen.getEmptyLine().substring(0,Screen.PROMPT.length() - nrI.length()) + nrI+"> "+currentLines.get(i));
+ List<SQLCommand> commands = getUnprocessedCommands();
+ commands.add(getCommand());
+ for (SQLCommand commandLines : commands) {
+ //SQLCommand commandLines = getCommand();
+ List<? extends CharSequence> currentLines = commandLines.getLines();
+ for (int i = 0; i < currentLines.size(); i++) {
+ if (i == 0 && screen.getShowPrompt()) {
+ tmpList.add(Screen.PROMPT+"> "+currentLines.get(i));
+ } else {
+ String nrI = Integer.toString(i+1);
+ tmpList.add(screen.getEmptyLine().substring(0,Screen.PROMPT.length() - nrI.length()) + nrI+"> "+currentLines.get(i));
+ }
}
}
int startLine;
@@ -268,6 +272,7 @@
color = new CharColor(CharColor.BLACK, CharColor.WHITE, CharColor.REVERSE, CharColor.REVERSE);
String cursorChar = " ";
Point cursorPosition = screen.getCursorPosition();
+ SQLCommand commandLines = getCommand();
if (commandLines.getLines().size() > 0) {
String tmp = commandLines.getLines().get(cursorPosition.y).toString();
if (cursorPosition.x < 0) {
|