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
|
122
|
24 static char *gftp_sort_columns[] = { N_("none"), N_("file"), N_("size"),
|
|
25 N_("user"), N_("group"),
|
|
26 N_("datetime"), N_("attribs"), NULL };
|
|
27
|
|
28 static char *gftp_sort_direction[] = { N_("descending"), N_("ascending"), NULL };
|
|
29
|
|
30 static float gftp_maxkbs = 0.0;
|
|
31
|
|
32 gftp_config_vars gftp_global_config_vars[] =
|
|
33 {
|
136
|
34 {"", N_("General"), gftp_option_type_notebook, NULL, NULL, 0, NULL, GFTP_PORT_GTK, NULL},
|
122
|
35
|
|
36 {"view_program", N_("View program:"), gftp_option_type_text, "", NULL, 0,
|
|
37 N_("The default program used to view files. If this is blank, the internal file viewer will be used"),
|
|
38 GFTP_PORT_GTK, NULL},
|
|
39 {"edit_program", N_("Edit program:"), gftp_option_type_text, "", NULL, 0,
|
|
40 N_("The default program used to edit files."), GFTP_PORT_GTK, NULL},
|
|
41 {"startup_directory", N_("Startup Directory:"),
|
|
42 gftp_option_type_text, "", NULL, 0,
|
|
43 N_("The default directory gFTP will go to on startup"), GFTP_PORT_ALL, NULL},
|
|
44 {"max_log_window_size", N_("Max Log Window Size:"),
|
|
45 gftp_option_type_int, 0, NULL, 0,
|
|
46 N_("The maximum size of the log window in bytes for the GTK+ port"),
|
|
47 GFTP_PORT_GTK, NULL},
|
184
|
48 {"remote_charsets", N_("Remote Character Sets:"),
|
|
49 gftp_option_type_text, "", NULL, 0,
|
185
|
50 N_("This is a comma separated list of charsets to try to convert the remote messages to the current locale"),
|
184
|
51 GFTP_PORT_ALL, NULL},
|
1
|
52
|
122
|
53 {"append_transfers", N_("Append file transfers"),
|
|
54 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
|
|
55 N_("Append new file transfers onto existing ones"), GFTP_PORT_GTK, NULL},
|
|
56 {"one_transfer", N_("Do one transfer at a time"),
|
|
57 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
|
|
58 N_("Do only one transfer at a time?"), GFTP_PORT_GTK, NULL},
|
|
59 {"overwrite_default", N_("Overwrite by Default"),
|
|
60 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
|
|
61 N_("Overwrite files by default or set to resume file transfers"),
|
|
62 GFTP_PORT_GTK, NULL},
|
182
|
63 {"preserve_permissions", N_("Preserve file permissions"),
|
|
64 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
|
|
65 N_("Preserve file permissions of transfered files"), GFTP_PORT_ALL,
|
|
66 NULL},
|
122
|
67 {"refresh_files", N_("Refresh after each file transfer"),
|
|
68 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
|
|
69 N_("Refresh the listbox after each file is transfered"), GFTP_PORT_GTK,
|
|
70 NULL},
|
|
71 {"sort_dirs_first", N_("Sort directories first"),
|
|
72 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
|
|
73 N_("Put the directories first then the files"), GFTP_PORT_ALL, NULL},
|
|
74 {"show_hidden_files", N_("Show hidden files"),
|
|
75 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
|
|
76 N_("Show hidden files in the listboxes"), GFTP_PORT_ALL, NULL},
|
1
|
77
|
122
|
78 {"", N_("Network"), gftp_option_type_notebook, NULL, NULL, 0,
|
|
79 NULL, GFTP_PORT_GTK, NULL},
|
|
80 {"network_timeout", N_("Network timeout:"),
|
|
81 gftp_option_type_int, GINT_TO_POINTER(60), NULL, 0,
|
|
82 N_("The timeout waiting for network input/output. This is NOT an idle timeout."),
|
|
83 GFTP_PORT_ALL, NULL},
|
|
84 {"retries", N_("Connect retries:"),
|
|
85 gftp_option_type_int, GINT_TO_POINTER(3), NULL, 0,
|
|
86 N_("The number of auto-retries to do. Set this to 0 to retry indefinately"),
|
|
87 GFTP_PORT_ALL, NULL},
|
|
88 {"sleep_time", N_("Retry sleep time:"),
|
|
89 gftp_option_type_int, GINT_TO_POINTER(30), NULL, 0,
|
|
90 N_("The number of seconds to wait between retries"), GFTP_PORT_ALL, NULL},
|
|
91 {"maxkbs", N_("Max KB/S:"),
|
|
92 gftp_option_type_float, &gftp_maxkbs, NULL, 0,
|
|
93 N_("The maximum KB/s a file transfer can get. (Set to 0 to disable)"),
|
|
94 GFTP_PORT_ALL, NULL},
|
1
|
95
|
136
|
96 {"default_protocol", N_("Default Protocol:"),
|
125
|
97 gftp_option_type_textcombo, "FTP", NULL, 0,
|
|
98 N_("This specifies the default protocol to use"), GFTP_PORT_ALL, NULL},
|
|
99
|
122
|
100 {"list_dblclk_action", "",
|
|
101 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0,
|
|
102 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},
|
|
103 {"listbox_local_width", "",
|
|
104 gftp_option_type_int, GINT_TO_POINTER(302), NULL, 0,
|
|
105 N_("The default width of the local files listbox"), 0, NULL},
|
|
106 {"listbox_remote_width", "",
|
|
107 gftp_option_type_int, GINT_TO_POINTER(302), NULL, 0,
|
|
108 N_("The default width of the remote files listbox"), 0, NULL},
|
|
109 {"listbox_file_height", "",
|
|
110 gftp_option_type_int, GINT_TO_POINTER(265), NULL, 0,
|
|
111 N_("The default height of the local/remote files listboxes"), 0, NULL},
|
|
112 {"transfer_height", "",
|
|
113 gftp_option_type_int, GINT_TO_POINTER(80), NULL, 0,
|
|
114 N_("The default height of the transfer listbox"), 0, NULL},
|
|
115 {"log_height", "",
|
|
116 gftp_option_type_int, GINT_TO_POINTER(105), NULL, 0,
|
|
117 N_("The default height of the logging window"), 0, NULL},
|
|
118 {"file_trans_column", "",
|
|
119 gftp_option_type_int, GINT_TO_POINTER(100), NULL, 0,
|
|
120 N_("The width of the filename column in the transfer window. Set this to 0 to have this column automagically resize."), 0, NULL},
|
|
121
|
|
122 {"local_sortcol", "",
|
|
123 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_columns, 0,
|
|
124 N_("The default column to sort by"), GFTP_PORT_TEXT, NULL},
|
|
125 {"local_sortasds", "",
|
|
126 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_direction, 0,
|
|
127 N_("Sort ascending or descending"), GFTP_PORT_TEXT, NULL},
|
|
128 {"remote_sortcol", "",
|
|
129 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_columns, 0,
|
|
130 N_("The default column to sort by"), GFTP_PORT_TEXT, NULL},
|
|
131 {"remote_sortasds", "",
|
|
132 gftp_option_type_intcombo, GINT_TO_POINTER(1), gftp_sort_direction, 0,
|
|
133 N_("Sort ascending or descending"), GFTP_PORT_TEXT, NULL},
|
37
|
134
|
122
|
135 {"local_file_width", "",
|
|
136 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0,
|
|
137 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},
|
|
138 {"local_size_width", "",
|
|
139 gftp_option_type_int, GINT_TO_POINTER(85), NULL, 0,
|
|
140 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},
|
|
141 {"local_user_width", "",
|
|
142 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0,
|
|
143 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},
|
|
144 {"local_group_width", "",
|
|
145 gftp_option_type_int, GINT_TO_POINTER(76), NULL, 0,
|
|
146 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},
|
|
147 {"local_date_width", "",
|
|
148 gftp_option_type_int, GINT_TO_POINTER(120), NULL, 0,
|
|
149 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},
|
|
150 {"local_attribs_width", "",
|
|
151 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0,
|
|
152 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},
|
|
153 {"remote_file_width", "",
|
|
154 gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0,
|
|
155 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},
|
|
156 {"remote_size_width", "",
|
|
157 gftp_option_type_int, GINT_TO_POINTER(85), NULL, 0,
|
|
158 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},
|
|
159 {"remote_user_width", "",
|
|
160 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0,
|
|
161 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},
|
|
162 {"remote_group_width", "",
|
|
163 gftp_option_type_int, GINT_TO_POINTER(76), NULL, 0,
|
|
164 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},
|
|
165 {"remote_date_width", "",
|
|
166 gftp_option_type_int, GINT_TO_POINTER(120), NULL, 0,
|
|
167 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},
|
|
168 {"remote_attribs_width", "",
|
|
169 gftp_option_type_int, GINT_TO_POINTER(75), NULL, 0,
|
|
170 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},
|
|
171 {"send_color", "",
|
|
172 gftp_option_type_color, "0:8600:0", NULL, 0,
|
|
173 N_("The color of the commands that are sent to the server"), 0, NULL},
|
|
174 {"recv_color", "",
|
|
175 gftp_option_type_color, "0:0:ffff", NULL, 0,
|
|
176 N_("The color of the commands that are received from the server"), 0, NULL},
|
|
177 {"error_color", "",
|
|
178 gftp_option_type_color, "ffff:0:0", NULL, 0,
|
|
179 N_("The color of the error messages"), 0, NULL},
|
|
180 {"misc_color", "",
|
|
181 gftp_option_type_color, "a000:8d00:4600", NULL, 0,
|
162
|
182 N_("The color of the rest of the log messages"), 0, NULL},
|
|
183 {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL}
|
122
|
184 };
|
1
|
185
|
122
|
186 supported_gftp_protocols gftp_protocols[] =
|
|
187 {
|
|
188 {N_("FTP"), rfc959_init, rfc959_register_module, "ftp", 1},
|
|
189 {N_("HTTP"), rfc2068_init, rfc2068_register_module, "http", 1},
|
169
|
190 #ifdef USE_SSL
|
168
|
191 {N_("HTTPS"), https_init, https_register_module, "https", 1},
|
169
|
192 #else
|
|
193 {N_("HTTPS"), https_init, https_register_module, "https", 0},
|
|
194 #endif
|
122
|
195 {N_("Local"), local_init, local_register_module, "file", 1},
|
|
196 {N_("SSH2"), sshv2_init, sshv2_register_module, "ssh2", 1},
|
|
197 {N_("Bookmark"), bookmark_init, bookmark_register_module, "bookmark", 0},
|
|
198 {NULL, NULL, NULL, NULL, 0}
|
|
199 };
|
|
200
|
|
201 GHashTable * gftp_global_options_htable = NULL,
|
|
202 * gftp_config_list_htable = NULL,
|
|
203 * gftp_bookmarks_htable = NULL;
|
|
204
|
|
205 char gftp_version[] = "gFTP " VERSION;
|
|
206
|
|
207 GList * gftp_file_transfers = NULL,
|
|
208 * gftp_file_transfer_logs = NULL,
|
|
209 * gftp_options_list = NULL;
|
1
|
210
|
122
|
211 gftp_bookmarks_var * gftp_bookmarks = NULL;
|
1
|
212
|
122
|
213 FILE * gftp_logfd = NULL;
|
1
|
214
|
201
|
215 int gftp_configuration_changed = 0;
|
|
216
|