mirror of https://github.com/GNOME/gimp.git
changed file_open_location_dialog_show() to
2004-09-09 Michael Natterer <mitch@gimp.org> * app/gui/file-open-location-dialog.[ch]: changed file_open_location_dialog_show() to file_open_location_dialog_new() and return the dialog. * app/gui/dialogs.c * app/gui/dialogs-constructors.[ch]: added a constructor for it and let the dialog factory manage it entirely. * app/actions/file-commands.c (file_open_location_dialog_cmd_callback): use the dialog factory to create it.
This commit is contained in:
parent
abf395c0cd
commit
ff6ee61780
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2004-09-09 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/gui/file-open-location-dialog.[ch]: changed
|
||||
file_open_location_dialog_show() to
|
||||
file_open_location_dialog_new() and return the dialog.
|
||||
|
||||
* app/gui/dialogs.c
|
||||
* app/gui/dialogs-constructors.[ch]: added a constructor for it
|
||||
and let the dialog factory manage it entirely.
|
||||
|
||||
* app/actions/file-commands.c
|
||||
(file_open_location_dialog_cmd_callback): use the dialog factory
|
||||
to create it.
|
||||
|
||||
2004-09-09 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpdialogfactory.c
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "file/file-save.h"
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
@ -46,8 +47,8 @@
|
|||
|
||||
#include "menus/menus.h"
|
||||
|
||||
#include "gui/dialogs.h"
|
||||
#include "gui/file-open-dialog.h"
|
||||
#include "gui/file-open-location-dialog.h"
|
||||
#include "gui/file-save-dialog.h"
|
||||
|
||||
#include "actions.h"
|
||||
|
@ -99,12 +100,12 @@ void
|
|||
file_open_location_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GtkWidget *widget;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
file_open_location_dialog_show (gimp, widget);
|
||||
gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-open-location-dialog", -1, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#include "dialogs.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "file-new-dialog.h"
|
||||
#include "file-open-location-dialog.h"
|
||||
#include "module-browser.h"
|
||||
#include "preferences-dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
@ -113,6 +114,14 @@ dialogs_file_new_new (GimpDialogFactory *factory,
|
|||
return file_new_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size)
|
||||
{
|
||||
return file_open_location_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_preferences_get (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
GtkWidget * dialogs_file_new_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
|
|
|
@ -43,8 +43,6 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
|
|||
/* foreign toplevels without constructor */
|
||||
{ "gimp-file-open-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
{ "gimp-file-open-location-dialog",
|
||||
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
||||
{ "gimp-file-save-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
|
||||
|
@ -92,7 +90,9 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
|
|||
NULL, 0, FALSE, TRUE, FALSE, FALSE },
|
||||
|
||||
/* ordinary toplevels */
|
||||
{ "gimp-file-new-dialog", dialogs_file_new_new,
|
||||
{ "gimp-file-new-dialog", dialogs_file_new_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
{ "gimp-file-open-location-dialog", dialogs_file_open_location_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
|
||||
/* singleton toplevels */
|
||||
|
|
|
@ -34,12 +34,10 @@
|
|||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpcontainerentry.h"
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpprogressbox.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "dialogs.h"
|
||||
#include "file-open-location-dialog.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
@ -57,9 +55,8 @@ static gboolean file_open_location_completion (GtkEntryCompletion *completion,
|
|||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
file_open_location_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent)
|
||||
GtkWidget *
|
||||
file_open_location_dialog_new (Gimp *gimp)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *hbox;
|
||||
|
@ -69,12 +66,11 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
GtkWidget *entry;
|
||||
GtkEntryCompletion *completion;
|
||||
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
|
||||
dialog = gimp_dialog_new (_("Open Location"),
|
||||
"gimp-file-open-location",
|
||||
parent, 0,
|
||||
NULL, 0,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_FILE_OPEN_LOCATION,
|
||||
|
||||
|
@ -83,9 +79,6 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
|
||||
NULL);
|
||||
|
||||
gimp_dialog_factory_add_foreign (global_dialog_factory,
|
||||
"gimp-file-open-location-dialog", dialog);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (file_open_location_response),
|
||||
gimp);
|
||||
|
@ -127,9 +120,12 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
|
||||
g_object_set_data (G_OBJECT (dialog), "location-entry", entry);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
file_open_location_response (GtkDialog *dialog,
|
||||
gint response_id,
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
#define __FILE_OPEN_LOCATION_DIALOG_H__
|
||||
|
||||
|
||||
void file_open_location_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent);
|
||||
GtkWidget * file_open_location_dialog_new (Gimp *gimp);
|
||||
|
||||
|
||||
#endif /* __FILE_OPEN_LOCATION_DIALOG_H__ */
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#include "dialogs.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "file-new-dialog.h"
|
||||
#include "file-open-location-dialog.h"
|
||||
#include "module-browser.h"
|
||||
#include "preferences-dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
@ -113,6 +114,14 @@ dialogs_file_new_new (GimpDialogFactory *factory,
|
|||
return file_new_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size)
|
||||
{
|
||||
return file_open_location_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_preferences_get (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
GtkWidget * dialogs_file_new_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
|
|
|
@ -43,8 +43,6 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
|
|||
/* foreign toplevels without constructor */
|
||||
{ "gimp-file-open-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
{ "gimp-file-open-location-dialog",
|
||||
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
||||
{ "gimp-file-save-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
|
||||
|
@ -92,7 +90,9 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
|
|||
NULL, 0, FALSE, TRUE, FALSE, FALSE },
|
||||
|
||||
/* ordinary toplevels */
|
||||
{ "gimp-file-new-dialog", dialogs_file_new_new,
|
||||
{ "gimp-file-new-dialog", dialogs_file_new_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
{ "gimp-file-open-location-dialog", dialogs_file_open_location_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
|
||||
/* singleton toplevels */
|
||||
|
|
|
@ -34,12 +34,10 @@
|
|||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpcontainerentry.h"
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpprogressbox.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "dialogs.h"
|
||||
#include "file-open-location-dialog.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
@ -57,9 +55,8 @@ static gboolean file_open_location_completion (GtkEntryCompletion *completion,
|
|||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
file_open_location_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent)
|
||||
GtkWidget *
|
||||
file_open_location_dialog_new (Gimp *gimp)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *hbox;
|
||||
|
@ -69,12 +66,11 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
GtkWidget *entry;
|
||||
GtkEntryCompletion *completion;
|
||||
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
|
||||
dialog = gimp_dialog_new (_("Open Location"),
|
||||
"gimp-file-open-location",
|
||||
parent, 0,
|
||||
NULL, 0,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_FILE_OPEN_LOCATION,
|
||||
|
||||
|
@ -83,9 +79,6 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
|
||||
NULL);
|
||||
|
||||
gimp_dialog_factory_add_foreign (global_dialog_factory,
|
||||
"gimp-file-open-location-dialog", dialog);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (file_open_location_response),
|
||||
gimp);
|
||||
|
@ -127,9 +120,12 @@ file_open_location_dialog_show (Gimp *gimp,
|
|||
|
||||
g_object_set_data (G_OBJECT (dialog), "location-entry", entry);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
file_open_location_response (GtkDialog *dialog,
|
||||
gint response_id,
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
#define __FILE_OPEN_LOCATION_DIALOG_H__
|
||||
|
||||
|
||||
void file_open_location_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent);
|
||||
GtkWidget * file_open_location_dialog_new (Gimp *gimp);
|
||||
|
||||
|
||||
#endif /* __FILE_OPEN_LOCATION_DIALOG_H__ */
|
||||
|
|
Loading…
Reference in New Issue