Commit 7e249f14 authored by Matija Obreza's avatar Matija Obreza

Code cleanup for 1.4 release

parent a4720d36
......@@ -595,6 +595,10 @@ public class PushDialog extends Dialog {
for (Object[] row : rows) {
count++;
if (row.length == 0) {
continue;
}
final String accessionInstCode = row[instCodeCol].toString();
if (instCodes.add(accessionInstCode)) {
_log.info("Detected INSTCODE: " + accessionInstCode + " in line " + (extraSkipRows + count));
......
......@@ -59,7 +59,7 @@ public class SettingsDialog extends Dialog {
private static final String CUSTOM_SERVER_URL = "http://localhost:8080";
private static final String SANDBOX_SERVER_URL = "https://api.sandbox.genesys-pgr.org";
private static final String SANDBOX_CLIENT_ID = "Ap8Od.ydMSWlJ7qL9sJWtXXMCA@sandbox.genesys-pgr.org";
private static final String PRODUCTION_SERVER_URL = "https://api.genesys-pgr.org";
private static final String PRODUCTION_SERVER_URL = "https://www.genesys-pgr.org";
private static final String PRODUCTION_CLIENT_ID = "fTxcm.TrySiiiOLncyeWfmQKyp@www.genesys-pgr.org";
private Binding scope;
......
......@@ -21,6 +21,7 @@ import org.apache.log4j.WriterAppender;
import org.apache.log4j.spi.LoggingEvent;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
......@@ -75,7 +76,7 @@ public class SwtLogAppender extends WriterAppender {
}
final String mes = layout.format(loggingEvent) + (throwableStr == null ? "" : sb.toString());
logBuffer.append(mes);
if (logBuffer.length() > maxBufferSize) {
if (logBuffer.length() > maxBufferSize && text.getSelectionCount() == 0) {
// System.err.println("CLEARING POOL len=" + logBuffer.length() +
// " removing=" + (logBuffer.length() - maxBufferSize));
logBuffer.replace(0, logBuffer.length() - maxBufferSize, "");
......@@ -88,10 +89,15 @@ public class SwtLogAppender extends WriterAppender {
// System.err.println(mes);
display.asyncExec(() -> {
if (text != null) {
int scrollPos = text.getLineCount() - 1;
// int lineCount = text.getLineCount();
int selectedCount = text.getSelectionCount();
Point selection = text.getSelection();
text.setText(logBuffer.toString());
if (selectedCount > 0) {
text.setSelection(selection.x, selection.y);
}
int topIndex = text.getTopIndex();
if ((scrollPos <= 0 && topIndex == 0) || topIndex >= scrollPos - 3) {
if (selectedCount == 0 || topIndex == 0) {
text.setSelection(text.getText().length() * 2);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment