comparison src/gtk/gftp-gtk.h @ 19:3b2dcdefc7e9

2002-09-15 Brian Masney <masneyb@gftp.org> * lib/gftp.h (struct gftp_transfer) - changed the type of numfiles and numdirs from unsigned long to long. This must be a signed field. This is a bug I introduced a few days ago. * lib/local.c (local_put_file) - remove the + off of the ab mode to fdopen. This is also a bug I introduced a few days ago. * src/gtk/transfer.c (gftp_gtk_calc_kbs) - make sure that the variable difftime isn't a negative number when computing the KB/s * src/gtk/menu-items.c (save_directory_listing) - remove casts to GTK_OBJECT for the str variable * src/gtk/gftp-gtk.c - use GTK_STOCK_* icons in place of left.xpm, right.xpm, up.xpm, down.xpm and stop.xpm in GTK+ 2.0 port * src/gtk/bookmarks.c - show GTK_STOCK_* icons on the popup menu * src/gtk/bookmarks.c, src/gtk/chmod_dialog.c, src/gtk/menu-items.c, src/gtk/misc-gtk.c, src/gtk/options_dialog.c and src/gtk/view_dialog.c - use gtk_dialog_new_with_buttons in GTK+ 2.0 port to create the dialog. Also, associate gFTP icon with this dialog * src/gtk/misc-gtk.c - changed the interface of MakeEditDialog and MakeYesNoDialog. In the GTK+ 2.0 port, I now use stock icons in the dialog buttons.
author masneyb
date Mon, 16 Sep 2002 12:27:50 +0000
parents 83090328581e
children c8ec7877432e
comparison
equal deleted inserted replaced
18:6b2e606554aa 19:3b2dcdefc7e9
31 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 31 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
32 #define gtk_widget_set_size_request(widget, width, height) \ 32 #define gtk_widget_set_size_request(widget, width, height) \
33 gtk_widget_set_usize (widget, width, height) 33 gtk_widget_set_usize (widget, width, height)
34 #endif 34 #endif
35 35
36 /* These 2 defines are for creating menu items with stock icons in GTK+ 2.0.
37 If we are using version 1.2, it will disable the stock items since it's not
38 supported */
39
40 #if GTK_MAJOR_VERSION < 2
41 #define MS_(a) NULL
42 #define MN_(a) a
43 #else
44 #define MS_(a) "<StockItem>",a
45 #define MN_(a) a,NULL
46 #endif
47
48 /* These are used for the MakeEditDialog function. I have these types to make
49 it easier for creating dialogs with GTK+ 1.2 and GTK+ 2.0 */
50
51 typedef enum gftp_dialog_button_tag
52 {
53 gftp_dialog_button_create,
54 gftp_dialog_button_change,
55 gftp_dialog_button_connect,
56 gftp_dialog_button_rename,
57 gftp_dialog_button_ok
58 } gftp_dialog_button;
59
36 typedef struct gftp_window_data_tag 60 typedef struct gftp_window_data_tag
37 { 61 {
38 GtkWidget *combo, /* Entry widget/history for the user to enter 62 GtkWidget *combo, /* Entry widget/history for the user to enter
39 a directory */ 63 a directory */
40 *hoststxt, /* Show which directory we're in */ 64 *hoststxt, /* Show which directory we're in */
63 } gftp_graphic; 87 } gftp_graphic;
64 88
65 89
66 typedef struct gftp_dialog_data_tag 90 typedef struct gftp_dialog_data_tag
67 { 91 {
68 GtkWidget * dialog, /* Pointer to the dialog */ 92 GtkWidget * dialog,
69 * checkbox, /* Pointer to the checkbox widget */ 93 * checkbox,
70 * edit; /* Pointer to the edit widget */ 94 * edit;
71 GList * all_buttons; /* All the buttons of this dialog */ 95
72 gpointer data; /* Data pointer we'll pass to the function */ 96 void (*yesfunc) ();
97 gpointer yespointer;
98
99 void (*nofunc) ();
100 gpointer nopointer;
73 } gftp_dialog_data; 101 } gftp_dialog_data;
74 102
75 103
76 typedef struct gftp_viewedit_data_tag 104 typedef struct gftp_viewedit_data_tag
77 { 105 {
115 extern int local_start, remote_start, trans_start, log_start, tools_start; 143 extern int local_start, remote_start, trans_start, log_start, tools_start;
116 extern GHashTable * graphic_hash_table; 144 extern GHashTable * graphic_hash_table;
117 extern GtkItemFactoryEntry * menus; 145 extern GtkItemFactoryEntry * menus;
118 extern GtkItemFactory * factory; 146 extern GtkItemFactory * factory;
119 extern pthread_mutex_t transfer_mutex, log_mutex; 147 extern pthread_mutex_t transfer_mutex, log_mutex;
148 extern gftp_graphic * gftp_icon;
120 149
121 /* bookmarks.c */ 150 /* bookmarks.c */
122 void run_bookmark ( gpointer data ); 151 void run_bookmark ( gpointer data );
123 152
124 void add_bookmark ( gpointer data ); 153 void add_bookmark ( gpointer data );
273 gftp_file * fle ); 302 gftp_file * fle );
274 303
275 void MakeEditDialog ( char *diagtxt, 304 void MakeEditDialog ( char *diagtxt,
276 char *infotxt, 305 char *infotxt,
277 char *deftext, 306 char *deftext,
278 int edit_shown, 307 int passwd_item,
279 int erase, 308 char *checktext,
280 char *checktext, 309 gftp_dialog_button okbutton,
281 char *oktxt,
282 void (*okfunc) (), 310 void (*okfunc) (),
283 void *okptr, 311 void *okptr,
284 char *canceltxt,
285 void (*cancelfunc) (), 312 void (*cancelfunc) (),
286 void *cancelptr ); 313 void *cancelptr );
287 314
288 void MakeYesNoDialog ( char *diagtxt, 315 void MakeYesNoDialog ( char *diagtxt,
289 char *infotxt, 316 char *infotxt,
290 int erase, 317 void (*yesfunc) (),
291 int num, 318 gpointer yespointer,
292 ... ); 319 void (*nofunc) (),
320 gpointer nopointer );
293 321
294 void update_directory_download_progress ( gftp_transfer * transfer ); 322 void update_directory_download_progress ( gftp_transfer * transfer );
295 323
296 void *generic_thread ( void * (*func) 324 void *generic_thread ( void * (*func)
297 (void *), 325 (void *),