Mercurial > gftp.yaz
annotate lib/options.h @ 992:9c583f570950 default tip
more character set conversion on remote file names.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 15 Sep 2010 11:42:57 +0900 |
parents | 63555c9744c2 |
children |
rev | line source |
---|---|
1 | 1 /*****************************************************************************/ |
2 /* options.h - the global variables for the program */ | |
122 | 3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */ |
1 | 4 /* */ |
5 /* This program is free software; you can redistribute it and/or modify */ | |
6 /* it under the terms of the GNU General Public License as published by */ | |
7 /* the Free Software Foundation; either version 2 of the License, or */ | |
8 /* (at your option) any later version. */ | |
9 /* */ | |
10 /* This program is distributed in the hope that it will be useful, */ | |
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | |
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | |
13 /* GNU General Public License for more details. */ | |
14 /* */ | |
15 /* You should have received a copy of the GNU General Public License */ | |
16 /* along with this program; if not, write to the Free Software */ | |
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */ | |
18 /*****************************************************************************/ | |
19 | |
33 | 20 /* $Id$ */ |
21 | |
1 | 22 #include "gftp.h" |
23 | |
765 | 24 typedef /*@null@*/ char *gftp_sort_columns_tag; |
25 static gftp_sort_columns_tag gftp_sort_columns[] = { N_("none"), N_("file"), | |
26 N_("size"), N_("user"), | |
27 N_("group"), | |
28 N_("datetime"), | |
29 N_("attribs"), NULL }; | |
122 | 30 |
765 | 31 typedef /*@null@*/ char *gftp_sort_direction_tag; |
32 static gftp_sort_direction_tag gftp_sort_direction[] = { N_("descending"), | |
33 N_("ascending"), | |
34 NULL }; | |
122 | 35 |
36 static float gftp_maxkbs = 0.0; | |
37 | |
38 gftp_config_vars gftp_global_config_vars[] = | |
39 { | |
227 | 40 {"", N_("General"), gftp_option_type_notebook, NULL, NULL, |
41 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL}, | |
122 | 42 |
43 {"view_program", N_("View program:"), gftp_option_type_text, "", NULL, 0, | |
44 N_("The default program used to view files. If this is blank, the internal file viewer will be used"), | |
45 GFTP_PORT_GTK, NULL}, | |
46 {"edit_program", N_("Edit program:"), gftp_option_type_text, "", NULL, 0, | |
47 N_("The default program used to edit files."), GFTP_PORT_GTK, NULL}, | |
48 {"max_log_window_size", N_("Max Log Window Size:"), | |
49 gftp_option_type_int, 0, NULL, 0, | |
50 N_("The maximum size of the log window in bytes for the GTK+ port"), | |
51 GFTP_PORT_GTK, NULL}, | |
988
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
52 |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
53 /* charsets */ |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
54 {"default_charset", N_("Default Character Set:"), |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
55 gftp_option_type_text, "", NULL, 0, |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
56 N_("This is the default charset to try to convert the remote messages to the current locale"), |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
57 GFTP_PORT_ALL, NULL}, |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
58 |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
59 #if 0 |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
60 {"remote_charset", N_("Remote Character Set:"), |
227 | 61 gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK, |
988
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
62 N_("This is the site specific charset to try to convert the remote messages to the current locale"), |
184 | 63 GFTP_PORT_ALL, NULL}, |
988
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
64 #endif |
63555c9744c2
remote charset should be specified by each bookmark entry.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
863
diff
changeset
|
65 |
473 | 66 {"remote_lc_time", N_("Remote LC_TIME:"), |
67 gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
68 N_("This is the value of LC_TIME for the remote site. This is so that dates can be parsed properly in the directory listings."), | |
69 GFTP_PORT_ALL, NULL}, | |
222 | 70 {"cache_ttl", N_("Cache TTL:"), |
227 | 71 gftp_option_type_int, GINT_TO_POINTER(3600), NULL, |
72 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
222 | 73 N_("The number of seconds to keep cache entries before they expire."), |
74 GFTP_PORT_ALL, NULL}, | |
1 | 75 |
122 | 76 {"append_transfers", N_("Append file transfers"), |
77 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0, | |
78 N_("Append new file transfers onto existing ones"), GFTP_PORT_GTK, NULL}, | |
79 {"one_transfer", N_("Do one transfer at a time"), | |
80 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, | |
81 N_("Do only one transfer at a time?"), GFTP_PORT_GTK, NULL}, | |
82 {"overwrite_default", N_("Overwrite by Default"), | |
227 | 83 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, |
84 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 85 N_("Overwrite files by default or set to resume file transfers"), |
86 GFTP_PORT_GTK, NULL}, | |
182 | 87 {"preserve_permissions", N_("Preserve file permissions"), |
227 | 88 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, |
89 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
182 | 90 N_("Preserve file permissions of transfered files"), GFTP_PORT_ALL, |
91 NULL}, | |
560 | 92 {"preserve_time", N_("Preserve file time"), |
93 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, | |
94 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
95 N_("Preserve file times of transfered files"), GFTP_PORT_ALL, | |
96 NULL}, | |
122 | 97 {"refresh_files", N_("Refresh after each file transfer"), |
227 | 98 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, |
99 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 100 N_("Refresh the listbox after each file is transfered"), GFTP_PORT_GTK, |
101 NULL}, | |
102 {"sort_dirs_first", N_("Sort directories first"), | |
227 | 103 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, |
104 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 105 N_("Put the directories first then the files"), GFTP_PORT_ALL, NULL}, |
106 {"show_hidden_files", N_("Show hidden files"), | |
227 | 107 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, |
108 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 109 N_("Show hidden files in the listboxes"), GFTP_PORT_ALL, NULL}, |
320 | 110 {"show_trans_in_title", N_("Show transfer status in title"), |
430 | 111 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, |
320 | 112 N_("Show the file transfer status in the titlebar"), GFTP_PORT_GTK, NULL}, |
433 | 113 {"start_transfers", N_("Start file transfers"), |
114 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0, | |
115 N_("Automatically start the file transfers when they get queued"), | |
116 GFTP_PORT_GTK, NULL}, | |
341 | 117 {"cmd_in_gui", N_("Allow manual commands in GUI"), |
118 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, | |
808 | 119 N_("Allow entering manual commands in the GUI (functions like the text port)"), |
120 GFTP_PORT_GTK, NULL}, | |
121 {"remember_last_directory", N_("Remember last directory"), | |
122 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, | |
123 N_("Save the last local and remote directory when the application is closed"), | |
124 GFTP_PORT_GTK, NULL}, | |
863 | 125 {"connect_to_remote_on_startup", N_("Connect to remote server on startup"), |
126 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, | |
127 N_("Automatically connect to the remote server when the application is started."), | |
128 GFTP_PORT_GTK, NULL}, | |
1 | 129 |
227 | 130 {"", N_("Network"), gftp_option_type_notebook, NULL, NULL, |
131 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL}, | |
122 | 132 {"network_timeout", N_("Network timeout:"), |
227 | 133 gftp_option_type_int, GINT_TO_POINTER(60), NULL, |
134 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 135 N_("The timeout waiting for network input/output. This is NOT an idle timeout."), |
136 GFTP_PORT_ALL, NULL}, | |
137 {"retries", N_("Connect retries:"), | |
227 | 138 gftp_option_type_int, GINT_TO_POINTER(3), NULL, |
139 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
561 | 140 N_("The number of auto-retries to do. Set this to 0 to retry indefinitely"), |
122 | 141 GFTP_PORT_ALL, NULL}, |
142 {"sleep_time", N_("Retry sleep time:"), | |
227 | 143 gftp_option_type_int, GINT_TO_POINTER(30), NULL, |
144 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 145 N_("The number of seconds to wait between retries"), GFTP_PORT_ALL, NULL}, |
146 {"maxkbs", N_("Max KB/S:"), | |
227 | 147 gftp_option_type_float, &gftp_maxkbs, NULL, |
148 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
122 | 149 N_("The maximum KB/s a file transfer can get. (Set to 0 to disable)"), |
150 GFTP_PORT_ALL, NULL}, | |
527 | 151 {"trans_blksize", N_("Transfer Block Size:"), |
152 gftp_option_type_int, GINT_TO_POINTER(20480), NULL, | |
153 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
154 N_("The block size that is used when transfering files. This should be a multiple of 1024."), | |
155 GFTP_PORT_ALL, NULL}, | |
1 | 156 |
136 | 157 {"default_protocol", N_("Default Protocol:"), |
125 | 158 gftp_option_type_textcombo, "FTP", NULL, 0, |
159 N_("This specifies the default protocol to use"), GFTP_PORT_ALL, NULL}, | |
313 | 160 #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR) |
161 {"enable_ipv6", N_("Enable IPv6 support"), | |
162 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, | |
163 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, | |
164 N_("Enable IPv6 support"), GFTP_PORT_ALL, NULL}, | |
165 #endif | |
125 | 166 |
122 | 167 {"list_dblclk_action", "", |
168 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0, | |
169 N_("This defines what will happen when you double click a file in the file listboxes. 0=View file 1=Edit file 2=Transfer file"), 0, NULL}, | |
170 {"listbox_local_width", "", | |
171 gftp_option_type_int, GINT_TO_POINTER(302), NULL, 0, | |
172 N_("The default width of the local files listbox"), 0, NULL}, | |
173 {"listbox_remote_width", "", | |
174 gftp_option_type_int, GINT_TO_POINTER(302), NULL, 0, | |
175 N_("The default width of the remote files listbox"), 0, NULL}, | |
176 {"listbox_file_height", "", | |
177 gftp_option_type_int, GINT_TO_POINTER(265), NULL, 0, | |
178 N_("The default height of the local/remote files listboxes"), 0, NULL}, | |
179 {"transfer_height", "", | |
180 gftp_option_type_int, GINT_TO_POINTER(80), NULL, 0, | |
181 N_("The default height of the transfer listbox"), 0, NULL}, | |
182 {"log_height", "", | |
183 gftp_option_type_int, GINT_TO_POINTER(105), NULL, 0, | |
184 N_("The default height of the logging window"), 0, NULL}, | |
185 {"file_trans_column", "", | |
186 gftp_option_type_int, GINT_TO_POINTER(100), NULL, 0, | |
187 N_("The width of the filename column in the transfer window. Set this to 0 to have this column automagically resize."), 0, NULL}, | |
188 | |
616 | 189 {"host_value", "", gftp_option_type_text, "", NULL, 0, NULL, 0, NULL}, |
190 {"port_value", "", gftp_option_type_text, "", NULL, 0, NULL, 0, NULL}, | |
191 {"user_value", "", gftp_option_type_text, "", NULL, 0, NULL, 0, NULL}, | |
192 | |
792 | 193 {"local_startup_directory", "", gftp_option_type_text, "", NULL, 0, NULL, |
194 0, NULL}, | |
195 {"remote_startup_directory", "", gftp_option_type_text, "", NULL, 0, NULL, | |
196 0, NULL}, | |
197 | |
122 | 198 {"local_sortcol", "", |
199 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_columns, 0, | |
200 N_("The default column to sort by"), GFTP_PORT_TEXT, NULL}, | |
201 {"local_sortasds", "", | |
202 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_direction, 0, | |
203 N_("Sort ascending or descending"), GFTP_PORT_TEXT, NULL}, | |
204 {"remote_sortcol", "", | |
205 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_columns, 0, | |
206 N_("The default column to sort by"), GFTP_PORT_TEXT, NULL}, | |
207 {"remote_sortasds", "", | |
208 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_direction, 0, | |
209 N_("Sort ascending or descending"), GFTP_PORT_TEXT, NULL}, | |
37 | 210 |
122 | 211 {"local_file_width", "", |
212 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0, | |
213 N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
214 {"local_size_width", "", | |
215 gftp_option_type_int, GINT_TO_POINTER(85), NULL, 0, | |
216 N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
217 {"local_user_width", "", | |
218 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0, | |
219 N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
220 {"local_group_width", "", | |
221 gftp_option_type_int, GINT_TO_POINTER(76), NULL, 0, | |
222 N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
223 {"local_date_width", "", | |
224 gftp_option_type_int, GINT_TO_POINTER(120), NULL, 0, | |
225 N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
226 {"local_attribs_width", "", | |
227 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0, | |
228 N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
229 {"remote_file_width", "", | |
230 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0, | |
231 N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
232 {"remote_size_width", "", | |
233 gftp_option_type_int, GINT_TO_POINTER(85), NULL, 0, | |
234 N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
235 {"remote_user_width", "", | |
236 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0, | |
237 N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
238 {"remote_group_width", "", | |
239 gftp_option_type_int, GINT_TO_POINTER(76), NULL, 0, | |
240 N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
241 {"remote_date_width", "", | |
242 gftp_option_type_int, GINT_TO_POINTER(120), NULL, 0, | |
243 N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
244 {"remote_attribs_width", "", | |
245 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0, | |
246 N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), 0, NULL}, | |
247 {"send_color", "", | |
248 gftp_option_type_color, "0:8600:0", NULL, 0, | |
249 N_("The color of the commands that are sent to the server"), 0, NULL}, | |
250 {"recv_color", "", | |
251 gftp_option_type_color, "0:0:ffff", NULL, 0, | |
252 N_("The color of the commands that are received from the server"), 0, NULL}, | |
253 {"error_color", "", | |
254 gftp_option_type_color, "ffff:0:0", NULL, 0, | |
255 N_("The color of the error messages"), 0, NULL}, | |
256 {"misc_color", "", | |
257 gftp_option_type_color, "a000:8d00:4600", NULL, 0, | |
162 | 258 N_("The color of the rest of the log messages"), 0, NULL}, |
259 {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL} | |
122 | 260 }; |
1 | 261 |
122 | 262 supported_gftp_protocols gftp_protocols[] = |
263 { | |
542 | 264 {N_("FTP"), rfc959_init, rfc959_register_module, "ftp", 21, 1, 1}, |
389 | 265 |
266 #ifdef USE_SSL | |
542 | 267 {N_("FTPS"), ftps_init, ftps_register_module, "ftps", 21, 1, 1}, |
389 | 268 #else |
542 | 269 {N_("FTPS"), ftps_init, ftps_register_module, "ftps", 21, 0, 1}, |
389 | 270 #endif |
271 | |
542 | 272 {N_("HTTP"), rfc2068_init, rfc2068_register_module, "http", 80, 1, 1}, |
389 | 273 |
169 | 274 #ifdef USE_SSL |
542 | 275 {N_("HTTPS"), https_init, https_register_module, "https", 443, 1, 1}, |
169 | 276 #else |
542 | 277 {N_("HTTPS"), https_init, https_register_module, "https", 443, 0, 1}, |
169 | 278 #endif |
389 | 279 |
542 | 280 {N_("Local"), local_init, local_register_module, "file", 0, 1, 0}, |
389 | 281 |
542 | 282 {N_("SSH2"), sshv2_init, sshv2_register_module, "ssh2", 22, 1, 1}, |
389 | 283 |
542 | 284 {N_("Bookmark"), bookmark_init, bookmark_register_module, "bookmark", 0, 0, 0}, |
661 | 285 {N_("FSP"), fsp_init, fsp_register_module, "fsp", 21, 1, 1}, |
542 | 286 {NULL, NULL, NULL, NULL, 0, 0, 0} |
122 | 287 }; |
288 | |
289 GHashTable * gftp_global_options_htable = NULL, | |
290 * gftp_config_list_htable = NULL, | |
291 * gftp_bookmarks_htable = NULL; | |
292 | |
293 char gftp_version[] = "gFTP " VERSION; | |
294 | |
295 GList * gftp_file_transfers = NULL, | |
296 * gftp_file_transfer_logs = NULL, | |
297 * gftp_options_list = NULL; | |
1 | 298 |
122 | 299 gftp_bookmarks_var * gftp_bookmarks = NULL; |
1 | 300 |
765 | 301 /*@null@*/ FILE * gftp_logfd = NULL; |
1 | 302 |
201 | 303 int gftp_configuration_changed = 0; |
304 |