1999-03-15 Federico Mena Quintero <federico@nuclecu.unam.mx>

* boxes.c (symlink_dialog): Put this inside an "#ifndef
	HAVE_GNOME" since we now provide a nicer version of the dialog.

	* wtools.c (real_input_dialog_help): Removed un-needed #ifdef.

1999-03-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdialogs.c (symlink_dialog): Finished implementing the new
	symlink dialog.
This commit is contained in:
Miguel de Icaza 1999-03-16 20:46:47 +00:00
parent 7a96008267
commit 7313fee0b0
5 changed files with 48 additions and 16 deletions

View File

@ -1,5 +1,8 @@
1999-03-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdialogs.c (symlink_dialog): Finished implementing the new
symlink dialog.
* gdesktop.c (icon_event): I'm an idiot. Someone teach me boolean
logic again. Fixed edit-on-release for icons.

View File

@ -8,6 +8,7 @@
#include "filegui.h"
#include "fileopctx.h"
#include "eregex.h"
#include "main.h"
#include "../vfs/vfs.h"
enum {
@ -975,44 +976,70 @@ symlink_dialog (char *existing, char *new, char **ret_existing, char **ret_new)
{
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *w;
GtkWidget *entry1, *entry2;
WPanel *panel;
int ret;
g_return_if_fail (existing != NULL);
g_return_if_fail (new != NULL);
g_return_if_fail (ret_existing != NULL);
g_return_if_fail (ret_new != NULL);
/* Create the dialog */
dialog = gnome_dialog_new (_("Symbolic Link"),
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL);
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
panel = cpanel;
if (!is_a_desktop_panel (panel))
gnome_dialog_set_parent (GNOME_DIALOG (dialog), panel->xwindow);
/* File symlink will point to */
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new (_("File symlink will point to:")),
FALSE, FALSE, 0);
w = gtk_label_new (_("Existing filename (filename symlink will point to):"));
gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
entry1 = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry1), existing);
gtk_box_pack_start (GTK_BOX (vbox), entry1, FALSE, FALSE, 0);
gnome_dialog_editable_enters (GNOME_DIALOG (dialog), GTK_EDITABLE (entry1));
/* Name of symlink */
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new (_("Symlink name:")),
FALSE, FALSE, 0);
w = gtk_label_new (_("Symbolic link filename:"));
gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
entry2 = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry2), new);
gtk_box_pack_start (GTK_BOX (vbox), entry2, FALSE, FALSE, 0);
gnome_dialog_editable_enters (GNOME_DIALOG (dialog), GTK_EDITABLE (entry2));
gtk_widget_grab_focus (entry2);
/* Run */
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);
ret = gnome_dialog_run (GNOME_DIALOG (dialog));
if (ret != 0) {
*ret_existing = NULL;
*ret_new = NULL;
} else {
*ret_existing = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry1)));
*ret_new = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry2)));
}
gtk_widget_destroy (dialog);
}

View File

@ -1,5 +1,10 @@
1999-03-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
* boxes.c (symlink_dialog): Put this inside an "#ifndef
HAVE_GNOME" since we now provide a nicer version of the dialog.
* wtools.c (real_input_dialog_help): Removed un-needed #ifdef.
* cmd.c (edit_symlink_cmd): Generate the title of the dialog after
we have computed the source filename.
(edit_symlink_cmd): Use g_strdup_printf() instead of g_strconcat()

View File

@ -769,14 +769,14 @@ cd_dialog (void)
return 0;
}
#ifndef HAVE_GNOME
void
symlink_dialog (char *existing, char *new, char **ret_existing,
char **ret_new)
symlink_dialog (char *existing, char *new, char **ret_existing, char **ret_new)
{
QuickDialog Quick_input;
QuickWidget quick_widgets [] = {
#undef INPUT_INDEX
#if defined(HAVE_TK) || defined(HAVE_GNOME)
#if defined(HAVE_TK)
#define INPUT_INDEX 2
{ quick_button, 0, 1, 0, 1, _("&Cancel"), 0, B_CANCEL, 0, 0,
XV_WLAY_DONTCARE, "cancel" },
@ -811,6 +811,7 @@ symlink_dialog (char *existing, char *new, char **ret_existing,
*ret_existing = NULL;
}
}
#endif
#ifdef WITH_BACKGROUND
#define B_STOP B_USER+1

View File

@ -575,11 +575,7 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
/* we need a unique name for tkname because widget.c:history_tool()
needs a unique name for each dialog - using the header is ideal */
#ifdef HAVE_GNOME
strncpy (tk_name + 4, header, 59);
#else
strncpy (tk_name + 3, header, 60);
#endif
tk_name[63] = '\0';
quick_widgets[2].tkname = tk_name;