Mercurial > gftp.yaz
diff src/gtk/chmod_dialog.c @ 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 | 8b1883341c6f |
children | c8ec7877432e |
line wrap: on
line diff
--- a/src/gtk/chmod_dialog.c Wed Sep 11 10:26:13 2002 +0000 +++ b/src/gtk/chmod_dialog.c Mon Sep 16 12:27:50 2002 +0000 @@ -30,6 +30,22 @@ static sigjmp_buf chmodenvir; static int mode; +#if !(GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2) +static void +chmod_action (GtkWidget * widget, gint response, gpointer wdata) +{ + switch (response) + { + case GTK_RESPONSE_OK: + dochmod (widget, wdata); + /* no break */ + default: + gtk_widget_destroy (widget); + } +} +#endif + + void chmod_dialog (gpointer data) { @@ -44,18 +60,32 @@ wdata->request->chmod != NULL)) return; +#if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 dialog = gtk_dialog_new (); gtk_window_set_title (GTK_WINDOW (dialog), _("Chmod")); - gtk_window_set_wmclass (GTK_WINDOW(dialog), "Chmod", "gFTP"); - gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 10); gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5); gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->action_area), TRUE); +#else + dialog = gtk_dialog_new_with_buttons (_("Chmod"), NULL, 0, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + NULL); +#endif + gtk_window_set_wmclass (GTK_WINDOW(dialog), "Chmod", "gFTP"); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); - gtk_signal_connect_object (GTK_OBJECT (dialog), "delete_event", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (dialog)); + gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5); + gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 10); + gtk_widget_realize (dialog); + + if (gftp_icon != NULL) + { + gdk_window_set_icon (dialog->window, NULL, gftp_icon->pixmap, + gftp_icon->bitmap); + gdk_window_set_icon_name (dialog->window, _("gFTP Icon")); + } tempwid = gtk_label_new (_("You can now adjust the attributes of your file(s)\nNote: Not all ftp servers support the chmod feature")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), tempwid, FALSE, @@ -147,7 +177,8 @@ gtk_box_pack_start (GTK_BOX (vbox), ox, FALSE, FALSE, 0); gtk_widget_show (ox); - tempwid = gtk_button_new_with_label (_("Change")); +#if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 + tempwid = gtk_button_new_with_label (_("OK")); GTK_WIDGET_SET_FLAGS (tempwid, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), tempwid, TRUE, TRUE, 0); @@ -167,6 +198,10 @@ GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (dialog)); gtk_widget_show (tempwid); +#else + g_signal_connect (GTK_OBJECT (dialog), "response", + G_CALLBACK (chmod_action), wdata); +#endif if (IS_ONE_SELECTED (wdata)) {