From f93f415b77fd777bccbac6c73f2aecfe01464fb8 Mon Sep 17 00:00:00 2001 From: Ryan Hansberry Date: Fri, 2 Oct 2015 17:50:01 -0700 Subject: Text selection now uses TextView. Pre-Honeycomb uses the same method as before. --- .../org/connectbot/service/TerminalBridge.java | 44 ++++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'app/src/main/java/org/connectbot/service/TerminalBridge.java') diff --git a/app/src/main/java/org/connectbot/service/TerminalBridge.java b/app/src/main/java/org/connectbot/service/TerminalBridge.java index b9e29e8..b532a20 100644 --- a/app/src/main/java/org/connectbot/service/TerminalBridge.java +++ b/app/src/main/java/org/connectbot/service/TerminalBridge.java @@ -71,6 +71,7 @@ public class TerminalBridge implements VDUDisplay { public int defaultBg = HostDatabase.DEFAULT_BG_COLOR; protected final TerminalManager manager; + public TerminalView terminalView; public HostBean host; @@ -340,6 +341,33 @@ public class TerminalBridge implements VDUDisplay { } } + /** + * Only intended for pre-Honeycomb devices. + */ + public void setSelectingForCopy(boolean selectingForCopy) { + this.selectingForCopy = selectingForCopy; + } + + /** + * Only intended for pre-Honeycomb devices. + */ + public boolean isSelectingForCopy() { + return selectingForCopy; + } + + /** + * Only intended for pre-Honeycomb devices. + */ + public SelectionArea getSelectionArea() { + return selectionArea; + } + + public void copyCurrentSelection() { + if (terminalView != null) { + terminalView.copyCurrentSelectionToClipboard(); + } + } + /** * Inject a specific string into this terminal. Used for post-login strings * and pasting clipboard. @@ -482,18 +510,6 @@ public class TerminalBridge implements VDUDisplay { } } - public void setSelectingForCopy(boolean selectingForCopy) { - this.selectingForCopy = selectingForCopy; - } - - public boolean isSelectingForCopy() { - return selectingForCopy; - } - - public SelectionArea getSelectionArea() { - return selectionArea; - } - public synchronized void tryKeyVibrate() { manager.tryKeyVibrate(); } @@ -538,6 +554,10 @@ public class TerminalBridge implements VDUDisplay { forcedSize = false; } + public float getFontSize() { + return fontSizeDp; + } + /** * Add an {@link FontSizeChangedListener} to the list of listeners for this * bridge. -- cgit v1.2.3