annotate app/src/main/java/com/five_ten_sg/connectbot/bean/HostBean.java @ 476:186d340afd3b

add fg/bg color setting to global:// section of deployment.connections file
author Carl Byington <carl@five-ten-sg.com>
date Sun, 20 Oct 2019 14:19:17 -0700
parents d29cce60f393
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 /*
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2 * ConnectBot: simple, powerful, open-source SSH client for Android
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3 * Copyright 2007 Kenny Root, Jeffrey Sharkey
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 *
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5 * Licensed under the Apache License, Version 2.0 (the "License");
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6 * you may not use this file except in compliance with the License.
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7 * You may obtain a copy of the License at
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 *
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 * http://www.apache.org/licenses/LICENSE-2.0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 *
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
11 * Unless required by applicable law or agreed to in writing, software
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
12 * distributed under the License is distributed on an "AS IS" BASIS,
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
14 * See the License for the specific language governing permissions and
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
15 * limitations under the License.
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
16 */
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
17
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 package com.five_ten_sg.connectbot.bean;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20 import com.five_ten_sg.connectbot.util.HostDatabase;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
21 import android.content.ContentValues;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 import android.net.Uri;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 /**
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
25 * @author Kenny Root
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
26 *
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
27 */
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
28 public class HostBean extends AbstractBean {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
29 public static final String BEAN_NAME = "host";
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
30
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
31 /* Database fields */
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
32 private long id = -1;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
33 private String nickname = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
34 private String username = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
35 private String hostname = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
36 private int port = 22;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
37 private String protocol = "ssh";
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
38 private String hostKeyAlgo = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
39 private byte[] hostKey = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
40 private long lastConnect = -1;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
41 private String color;
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
42 private boolean useKeys = true;
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
43 private String useAuthAgent = HostDatabase.AUTHAGENT_NO;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
44 private String postLogin = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
45 private long pubkeyId = -1;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
46 private String delKey = HostDatabase.DELKEY_DEL;
188
cf677a6f586d use floating point font size, change size by scaling factor rather than linear addition
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
47 private float fontSize = -1;
242
e0f5e706a655 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 241
diff changeset
48 private boolean fixedSize = false;
241
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
49 private int fixedWidth = 80;
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
50 private int fixedHeight = 25;
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
51 private boolean wantSession = true;
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
52 private boolean compression = false;
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
53 private String httpproxy = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
54 private String encoding = HostDatabase.ENCODING_DEFAULT;
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
55 private boolean stayConnected = false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
56 private boolean wantX11Forward = false;
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
57 private String x11Host = "localhost";
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
58 private int x11Port = 6000;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
59 private String monitor = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
60 private String hostemulation = null;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
61 private String encryption5250 = null;
119
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
62 private String library = null;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
63 private String initialMenu = null;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
64 private String program = null;
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
65
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
66 public HostBean() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
67 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
68
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
69 @Override
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
70 public String getBeanName() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
71 return BEAN_NAME;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
72 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
73
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
74 public HostBean(String nickname, String protocol, String username, String hostname, int port) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
75 this.nickname = nickname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
76 this.protocol = protocol;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
77 this.username = username;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
78 this.hostname = hostname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
79 this.port = port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
80 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
81
83
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
82 public boolean isSSH() {
88
1c22e6a7efff convert ctrl keys to virtual keys; use proper android home directory
Carl Byington <carl@five-ten-sg.com>
parents: 83
diff changeset
83 return protocol.equals("ssh");
83
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
84 }
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
85
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
86 public boolean is5250() {
88
1c22e6a7efff convert ctrl keys to virtual keys; use proper android home directory
Carl Byington <carl@five-ten-sg.com>
parents: 83
diff changeset
87 return protocol.equals("tn5250");
83
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
88 }
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
89
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
90 public boolean isTelnet() {
88
1c22e6a7efff convert ctrl keys to virtual keys; use proper android home directory
Carl Byington <carl@five-ten-sg.com>
parents: 83
diff changeset
91 return protocol.equals("telnet");
83
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
92 }
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
93
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
94 public boolean isAsync() {
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
95 return isSSH() || isTelnet();
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
96 }
4ccfde0bc506 disable host config items that are not applicable to the host protocol
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
97
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
98 public void setId(long id) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
99 this.id = id;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
100 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
101 public long getId() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
102 return id;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
103 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
104 public void setNickname(String nickname) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
105 this.nickname = nickname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
106 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
107 public String getNickname() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
108 return nickname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
109 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
110 public void setUsername(String username) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
111 this.username = username;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
112 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
113 public String getUsername() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
114 return username;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
115 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
116 public void setHostname(String hostname) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
117 this.hostname = hostname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
118 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
119 public String getHostname() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
120 return hostname;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
121 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
122 public void setPort(int port) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
123 this.port = port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
124 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
125 public int getPort() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
126 return port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
127 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
128
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
129 public void setProtocol(String protocol) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
130 this.protocol = protocol;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
131 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
132
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
133 public String getProtocol() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
134 return protocol;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
135 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
136
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
137 public void setHostKeyAlgo(String hostKeyAlgo) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
138 this.hostKeyAlgo = hostKeyAlgo;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
139 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
140 public String getHostKeyAlgo() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
141 return hostKeyAlgo;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
142 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
143 public void setHostKey(byte[] hostKey) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
144 if (hostKey == null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
145 this.hostKey = null;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
146 else
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
147 this.hostKey = hostKey.clone();
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
148 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
149 public byte[] getHostKey() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
150 if (hostKey == null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
151 return null;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
152 else
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
153 return hostKey.clone();
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
154 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
155 public void setLastConnect(long lastConnect) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
156 this.lastConnect = lastConnect;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
157 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
158 public long getLastConnect() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
159 return lastConnect;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
160 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
161 public void setColor(String color) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
162 this.color = color;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
163 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
164 public String getColor() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
165 return color;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
166 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
167 public void setUseKeys(boolean useKeys) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
168 this.useKeys = useKeys;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
169 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
170 public boolean getUseKeys() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
171 return useKeys;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
172 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
173 public void setUseAuthAgent(String useAuthAgent) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
174 this.useAuthAgent = useAuthAgent;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
175 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
176 public String getUseAuthAgent() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
177 return useAuthAgent;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
178 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
179 public void setPostLogin(String postLogin) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
180 this.postLogin = postLogin;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
181 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
182 public String getPostLogin() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
183 return postLogin;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
184 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
185 public void setPubkeyId(long pubkeyId) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
186 this.pubkeyId = pubkeyId;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
187 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
188 public long getPubkeyId() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
189 return pubkeyId;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
190 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
191 public void setWantSession(boolean wantSession) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
192 this.wantSession = wantSession;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
193 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
194 public boolean getWantSession() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
195 return wantSession;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
196 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
197 public void setDelKey(String delKey) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
198 this.delKey = delKey;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
199 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
200 public String getDelKey() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
201 return delKey;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
202 }
188
cf677a6f586d use floating point font size, change size by scaling factor rather than linear addition
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
203 public void setFontSize(float fontSize) {
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
204 this.fontSize = fontSize;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
205 }
188
cf677a6f586d use floating point font size, change size by scaling factor rather than linear addition
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
206 public float getFontSize() {
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
207 return fontSize;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
208 }
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
209 public void setFixedSize(boolean fixedSize) {
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
210 this.fixedSize = fixedSize;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
211 }
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
212 public boolean getFixedSize() {
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
213 return fixedSize;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
214 }
241
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
215 public void setFixedWidth(int fixedWidth) {
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
216 this.fixedWidth = fixedWidth;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
217 }
241
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
218 public int getFixedWidth() {
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
219 return fixedWidth;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
220 }
241
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
221 public void setFixedHeight(int fixedHeight) {
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
222 this.fixedHeight = fixedHeight;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
223 }
241
8b68dfb283d2 add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 238
diff changeset
224 public int getFixedHeight() {
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
225 return fixedHeight;
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
226 }
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
227 public void setCompression(boolean compression) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
228 this.compression = compression;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
229 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
230 public boolean getCompression() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
231 return compression;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
232 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
233 public void setHttpproxy(String httpproxy) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
234 this.httpproxy = httpproxy;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
235 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
236 public String getHttpproxy() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
237 return httpproxy;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
238 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
239
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
240 public void setEncoding(String encoding) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
241 this.encoding = encoding;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
242 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
243
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
244 public String getEncoding() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
245 return this.encoding;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
246 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
247
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
248 public void setStayConnected(boolean stayConnected) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
249 this.stayConnected = stayConnected;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
250 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
251
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
252 public boolean getStayConnected() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
253 return stayConnected;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
254 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
255
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
256 public String getDescription() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
257 String description = String.format("%s@%s", username, hostname);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
258
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
259 if (port != 22)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
260 description += String.format(":%d", port);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
261
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
262 return description;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
263 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
264
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
265 public boolean getWantX11Forward() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
266 return this.wantX11Forward;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
267 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
268
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
269 public void setWantX11Forward(boolean wantX11Forward) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
270 this.wantX11Forward = wantX11Forward;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
271 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
272
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
273 public String getX11Host() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
274 return this.x11Host;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
275 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
276
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
277 public void setX11Host(String x11Host) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
278 this.x11Host = x11Host;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
279 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
280
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
281 public int getX11Port() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
282 return this.x11Port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
283 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
284
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
285 public void setX11Port(int x11Port) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
286 this.x11Port = x11Port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
287 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
288
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
289 public String getMonitor() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
290 return this.monitor;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
291 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
292
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
293 public void setMonitor(String monitor) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
294 this.monitor = monitor;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
295 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
296
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
297 public String getHostEmulation() {
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
298 return this.hostemulation;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
299 }
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
300
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
301 public void setHostEmulation(String hostemulation) {
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
302 this.hostemulation = hostemulation;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
303 }
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
304
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
305 public String getEncryption5250() {
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
306 return this.encryption5250;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
307 }
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
308
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
309 public void setEncryption5250(String encryption5250) {
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
310 this.encryption5250 = encryption5250;
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
311 }
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
312
119
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
313 public String getLibrary() {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
314 return this.library;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
315 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
316
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
317 public void setLibrary(String library) {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
318 this.library = library;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
319 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
320
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
321 public String getInitialMenu() {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
322 return this.initialMenu;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
323 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
324
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
325 public void setInitialMenu(String initialMenu) {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
326 this.initialMenu = initialMenu;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
327 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
328
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
329 public String getProgram() {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
330 return this.program;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
331 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
332
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
333 public void setProgram(String program) {
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
334 this.program = program;
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
335 }
6969d6cebcd7 add more 5250 config items
Carl Byington <carl@five-ten-sg.com>
parents: 88
diff changeset
336
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
337 @Override
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
338 public ContentValues getValues() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
339 ContentValues values = new ContentValues();
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
340 values.put(HostDatabase.FIELD_HOST_NICKNAME, nickname);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
341 values.put(HostDatabase.FIELD_HOST_PROTOCOL, protocol);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
342 values.put(HostDatabase.FIELD_HOST_USERNAME, username);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
343 values.put(HostDatabase.FIELD_HOST_HOSTNAME, hostname);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
344 values.put(HostDatabase.FIELD_HOST_PORT, port);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
345 values.put(HostDatabase.FIELD_HOST_HOSTKEYALGO, hostKeyAlgo);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
346 values.put(HostDatabase.FIELD_HOST_HOSTKEY, hostKey);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
347 values.put(HostDatabase.FIELD_HOST_LASTCONNECT, lastConnect);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
348 values.put(HostDatabase.FIELD_HOST_COLOR, color);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
349 values.put(HostDatabase.FIELD_HOST_USEKEYS, Boolean.toString(useKeys));
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
350 values.put(HostDatabase.FIELD_HOST_USEAUTHAGENT, useAuthAgent);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
351 values.put(HostDatabase.FIELD_HOST_POSTLOGIN, postLogin);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
352 values.put(HostDatabase.FIELD_HOST_PUBKEYID, pubkeyId);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
353 values.put(HostDatabase.FIELD_HOST_WANTSESSION, Boolean.toString(wantSession));
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
354 values.put(HostDatabase.FIELD_HOST_DELKEY, delKey);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
355 values.put(HostDatabase.FIELD_HOST_FONTSIZE, fontSize);
238
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
356 values.put(HostDatabase.FIELD_HOST_FIXEDSIZE, Boolean.toString(fixedSize));
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
357 values.put(HostDatabase.FIELD_HOST_FIXEDWIDTH, fixedWidth);
bd803721f94a remove unused update preference; add host preference for fixed screen size
Carl Byington <carl@five-ten-sg.com>
parents: 188
diff changeset
358 values.put(HostDatabase.FIELD_HOST_FIXEDHEIGHT, fixedHeight);
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
359 values.put(HostDatabase.FIELD_HOST_COMPRESSION, Boolean.toString(compression));
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
360 values.put(HostDatabase.FIELD_HOST_HTTPPROXY, httpproxy);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
361 values.put(HostDatabase.FIELD_HOST_ENCODING, encoding);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
362 values.put(HostDatabase.FIELD_HOST_STAYCONNECTED, stayConnected);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
363 values.put(HostDatabase.FIELD_HOST_WANTX11FORWARD, wantX11Forward);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
364 values.put(HostDatabase.FIELD_HOST_X11HOST, x11Host);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
365 values.put(HostDatabase.FIELD_HOST_X11PORT, x11Port);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
366 values.put(HostDatabase.FIELD_HOST_MONITOR, monitor);
63
07c7055cc124 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
367 values.put(HostDatabase.FIELD_HOST_EMULATION, hostemulation);
61
ce8f13242339 add 5250 config entries
Carl Byington <carl@five-ten-sg.com>
parents: 0
diff changeset
368 values.put(HostDatabase.FIELD_HOST_ENCRYPTION5250, encryption5250);
123
446dbcf606eb add more 5250 config items; ignore drawing outside the screen
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
369 values.put(HostDatabase.FIELD_HOST_LIBRARY5250, library);
446dbcf606eb add more 5250 config items; ignore drawing outside the screen
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
370 values.put(HostDatabase.FIELD_HOST_MENU5250, initialMenu);
446dbcf606eb add more 5250 config items; ignore drawing outside the screen
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
371 values.put(HostDatabase.FIELD_HOST_PROGRAM5250, program);
0
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
372 return values;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
373 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
374
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
375 @Override
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
376 public boolean equals(Object o) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
377 if (o == null || !(o instanceof HostBean))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
378 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
379
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
380 HostBean host = (HostBean)o;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
381
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
382 if (id != -1 && host.getId() != -1)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
383 return host.getId() == id;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
384
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
385 if (nickname == null) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
386 if (host.getNickname() != null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
387 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
388 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
389 else if (!nickname.equals(host.getNickname()))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
390 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
391
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
392 if (protocol == null) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
393 if (host.getProtocol() != null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
394 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
395 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
396 else if (!protocol.equals(host.getProtocol()))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
397 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
398
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
399 if (username == null) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
400 if (host.getUsername() != null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
401 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
402 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
403 else if (!username.equals(host.getUsername()))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
404 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
405
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
406 if (hostname == null) {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
407 if (host.getHostname() != null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
408 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
409 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
410 else if (!hostname.equals(host.getHostname()))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
411 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
412
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
413 if (port != host.getPort())
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
414 return false;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
415
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
416 return true;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
417 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
418
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
419 @Override
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
420 public int hashCode() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
421 int hash = 7;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
422
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
423 if (id != -1)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
424 return (int)id;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
425
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
426 hash = 31 * hash + (null == nickname ? 0 : nickname.hashCode());
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
427 hash = 31 * hash + (null == protocol ? 0 : protocol.hashCode());
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
428 hash = 31 * hash + (null == username ? 0 : username.hashCode());
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
429 hash = 31 * hash + (null == hostname ? 0 : hostname.hashCode());
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
430 hash = 31 * hash + port;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
431 return hash;
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
432 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
433
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
434 /**
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
435 * @return URI identifying this HostBean
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
436 */
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
437 public Uri getUri() {
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
438 StringBuilder sb = new StringBuilder();
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
439 sb.append(protocol)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
440 .append("://");
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
441
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
442 if (username != null)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
443 sb.append(Uri.encode(username))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
444 .append('@');
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
445
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
446 sb.append(Uri.encode(hostname))
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
447 .append(':')
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
448 .append(port)
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
449 .append("/#")
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
450 .append(nickname);
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
451 return Uri.parse(sb.toString());
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
452 }
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
453
0ce5cc452d02 initial version
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
454 }