r1264@localhost: muntyan | 2005-12-04 05:42:19 -0600

More dialogs
master
Yevgen Muntyan 2005-12-04 17:43:33 +00:00
parent 213f56a1eb
commit e20f0ef89e
3 changed files with 16 additions and 6 deletions

View File

@ -599,6 +599,7 @@ save_as_dialog (GtkWidget *parent,
GtkWidget *dialog = NULL;
GtkEntry *entry = NULL;
char *fullname = NULL;
gboolean first_time = TRUE;
g_return_val_if_fail (dirname != NULL, NULL);
@ -620,12 +621,17 @@ save_as_dialog (GtkWidget *parent,
entry = moo_glade_xml_get_widget (xml, "entry");
}
if (!first_time)
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK)
goto out;
text = gtk_entry_get_text (entry);
}
first_time = FALSE;
if (!text[0])
{
g_critical ("%s: ooops", G_STRLOC);

View File

@ -141,7 +141,7 @@ moo_position_window (GtkWidget *window,
{
if (GTK_WIDGET_TOPLEVEL (parent))
{
gdk_window_get_origin (parent->window, &x, &y);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER_ON_PARENT);
}
else
{
@ -149,11 +149,10 @@ moo_position_window (GtkWidget *window,
gdk_window_get_origin (parent_window, &x, &y);
x += parent->allocation.x;
y += parent->allocation.y;
x += parent->allocation.width / 2;
y += parent->allocation.height / 2;
at_coords = TRUE;
}
x += parent->allocation.width / 2;
y += parent->allocation.height / 2;
at_coords = TRUE;
}
if (at_mouse)
@ -165,6 +164,7 @@ moo_position_window (GtkWidget *window,
GdkPoint *coord = g_new (GdkPoint, 1);
coord->x = x;
coord->y = y;
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_NONE);
g_object_set_data_full (G_OBJECT (window), "moo-coords", coord, g_free);
g_signal_connect (window, "realize",
G_CALLBACK (position_window),

View File

@ -2778,6 +2778,7 @@ static void file_view_delete_selected (MooFileView *fileview)
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
"%s", message);
moo_position_window (dialog, GTK_WIDGET (fileview), FALSE, FALSE, 0, 0);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@ -2803,10 +2804,13 @@ static void file_view_delete_selected (MooFileView *fileview)
"Could not delete %s '%s'",
MOO_FILE_IS_DIR (l->data) ? "folder" : "file",
path);
moo_position_window (dialog, GTK_WIDGET (fileview), FALSE, FALSE, 0, 0);
if (error)
{
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", error->message);
"%s", error->message);
g_error_free (error);
}