don't use gimp_dialog_set_sensitive(); just make the entry not editable

2006-11-14  Sven Neumann  <sven@gimp.org>

	* app/dialogs/file-open-location-dialog.c: don't use
	gimp_dialog_set_sensitive(); just make the entry not editable and
	the dialog's OK button insensitive.

	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpwidgets-utils.[ch]: moved gimp_dialog_set_sensitive()
	implementation into gimp_file_dialog_set_sensitive().
This commit is contained in:
Sven Neumann 2006-11-14 13:46:43 +00:00 committed by Sven Neumann
parent d0da897849
commit da2253fce0
5 changed files with 39 additions and 37 deletions

View File

@ -1,3 +1,13 @@
2006-11-14 Sven Neumann <sven@gimp.org>
* app/dialogs/file-open-location-dialog.c: don't use
gimp_dialog_set_sensitive(); just make the entry not editable and
the dialog's OK button insensitive.
* app/widgets/gimpfiledialog.c
* app/widgets/gimpwidgets-utils.[ch]: moved gimp_dialog_set_sensitive()
implementation into gimp_file_dialog_set_sensitive().
2006-11-13 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.c: reduced the size of the side

View File

@ -39,7 +39,6 @@
#include "widgets/gimpcontainerentry.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpprogressbox.h"
#include "widgets/gimpwidgets-utils.h"
#include "file-open-location-dialog.h"
@ -162,10 +161,11 @@ file_open_location_response (GtkDialog *dialog,
return;
}
gimp_dialog_set_sensitive (dialog, FALSE);
entry = g_object_get_data (G_OBJECT (dialog), "location-entry");
gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, FALSE);
text = gtk_entry_get_text (GTK_ENTRY (entry));
if (text && strlen (text))
@ -229,7 +229,9 @@ file_open_location_response (GtkDialog *dialog,
text, error->message);
g_clear_error (&error);
gimp_dialog_set_sensitive (dialog, TRUE);
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, TRUE);
gtk_editable_set_editable (GTK_EDITABLE (entry), TRUE);
return;
}
}

View File

@ -49,7 +49,6 @@
#include "gimpview.h"
#include "gimpviewrendererimagefile.h"
#include "gimpthumbbox.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
@ -348,9 +347,31 @@ void
gimp_file_dialog_set_sensitive (GimpFileDialog *dialog,
gboolean sensitive)
{
GList *children;
GList *list;
g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog));
gimp_dialog_set_sensitive (GTK_DIALOG (dialog), sensitive);
children =
gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox));
for (list = children; list; list = g_list_next (list))
{
/* skip the last item (the action area) */
if (! g_list_next (list))
break;
gtk_widget_set_sensitive (list->data, sensitive);
}
g_list_free (children);
if (sensitive)
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GTK_RESPONSE_CANCEL, sensitive);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GTK_RESPONSE_OK, sensitive);
dialog->busy = ! sensitive;
dialog->canceled = FALSE;

View File

@ -885,34 +885,6 @@ gimp_window_set_transient_for (GtkWindow *window,
#endif
}
void
gimp_dialog_set_sensitive (GtkDialog *dialog,
gboolean sensitive)
{
GList *children;
GList *list;
g_return_if_fail (GTK_IS_DIALOG (dialog));
children = gtk_container_get_children (GTK_CONTAINER (dialog->vbox));
for (list = children; list; list = g_list_next (list))
{
/* skip the last item (the action area) */
if (! g_list_next (list))
break;
gtk_widget_set_sensitive (list->data, sensitive);
}
g_list_free (children);
if (sensitive)
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_CANCEL, sensitive);
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, sensitive);
}
gboolean
gimp_text_buffer_load (GtkTextBuffer *buffer,
const gchar *filename,

View File

@ -76,9 +76,6 @@ GdkNativeWindow gimp_window_get_native (GtkWindow *window);
void gimp_window_set_transient_for (GtkWindow *window,
guint32 parent_ID);
void gimp_dialog_set_sensitive (GtkDialog *dialog,
gboolean sensitive);
gboolean gimp_text_buffer_load (GtkTextBuffer *buffer,
const gchar *filename,
GError **error);