mirror of https://github.com/GNOME/gimp.git
removed function file_open_dialog_show() and changed internal function
2004-09-13 Michael Natterer <mitch@gimp.org> * app/dialogs/file-open-dialog.[ch]: removed function file_open_dialog_show() and changed internal function file_open_dialog_create() to file_open_dialog_new(). * app/dialogs/dialogs.c * app/dialogs/dialogs-constructors.[ch]: made it completely managed by the dialog factory. * app/actions/file-commands.c: create it using the dialog factory.
This commit is contained in:
parent
a7e5ebef55
commit
593e98c6de
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2004-09-13 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/dialogs/file-open-dialog.[ch]: removed function
|
||||
file_open_dialog_show() and changed internal function
|
||||
file_open_dialog_create() to file_open_dialog_new().
|
||||
|
||||
* app/dialogs/dialogs.c
|
||||
* app/dialogs/dialogs-constructors.[ch]: made it completely
|
||||
managed by the dialog factory.
|
||||
|
||||
* app/actions/file-commands.c: create it using the dialog factory.
|
||||
|
||||
2004-09-13 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* configure.in
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpfiledialog.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
@ -48,7 +49,6 @@
|
|||
#include "menus/menus.h"
|
||||
|
||||
#include "dialogs/dialogs.h"
|
||||
#include "dialogs/file-open-dialog.h"
|
||||
#include "dialogs/file-save-dialog.h"
|
||||
|
||||
#include "actions.h"
|
||||
|
@ -76,24 +76,41 @@ void
|
|||
file_open_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GtkWidget *widget;
|
||||
return_if_no_gimp (gimp, data);
|
||||
GtkWidget *dialog;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
file_open_dialog_show (gimp, NULL, NULL, widget);
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-open-dialog", -1, FALSE);
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (dialog), NULL, NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
file_open_from_image_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GtkWidget *widget;
|
||||
return_if_no_gimp (gimp, data);
|
||||
GtkWidget *dialog;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
file_open_dialog_show (gimp, action_data_get_image (data), NULL, widget);
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-open-dialog", -1, FALSE);
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (dialog),
|
||||
action_data_get_image (data), NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -311,7 +328,18 @@ file_file_open_dialog (Gimp *gimp,
|
|||
const gchar *uri,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
file_open_dialog_show (gimp, NULL, uri, parent);
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (parent),
|
||||
"gimp-file-open-dialog", -1, FALSE);
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (dialog), NULL, uri);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
#include "about-dialog.h"
|
||||
#include "dialogs.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "file-open-dialog.h"
|
||||
#include "file-open-location-dialog.h"
|
||||
#include "image-new-dialog.h"
|
||||
#include "module-dialog.h"
|
||||
|
@ -114,6 +115,14 @@ dialogs_image_new_new (GimpDialogFactory *factory,
|
|||
return image_new_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_file_open_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size)
|
||||
{
|
||||
return file_open_dialog_new (context->gimp);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
GtkWidget * dialogs_image_new_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_file_open_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
GtkWidget * dialogs_file_open_location_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint preview_size);
|
||||
|
|
|
@ -41,8 +41,6 @@ GimpDialogFactory *global_toolbox_factory = NULL;
|
|||
static const GimpDialogFactoryEntry toplevel_entries[] =
|
||||
{
|
||||
/* foreign toplevels without constructor */
|
||||
{ "gimp-file-open-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
{ "gimp-file-save-dialog",
|
||||
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
||||
|
||||
|
@ -92,6 +90,8 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
|
|||
/* ordinary toplevels */
|
||||
{ "gimp-image-new-dialog", dialogs_image_new_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
{ "gimp-file-open-dialog", dialogs_file_open_new,
|
||||
0, TRUE, TRUE, TRUE, FALSE },
|
||||
{ "gimp-file-open-location-dialog", dialogs_file_open_location_new,
|
||||
0, FALSE, TRUE, FALSE, FALSE },
|
||||
|
||||
|
|
|
@ -34,11 +34,9 @@
|
|||
#include "file/file-open.h"
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpfiledialog.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "dialogs.h"
|
||||
#include "file-open-dialog.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
@ -46,53 +44,20 @@
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static GtkWidget * file_open_dialog_create (Gimp *gimp);
|
||||
static void file_open_dialog_response (GtkWidget *open_dialog,
|
||||
gint response_id,
|
||||
Gimp *gimp);
|
||||
static gboolean file_open_dialog_open_image (GtkWidget *open_dialog,
|
||||
Gimp *gimp,
|
||||
const gchar *uri,
|
||||
const gchar *entered_filename,
|
||||
PlugInProcDef *load_proc);
|
||||
|
||||
|
||||
/* private variables */
|
||||
|
||||
static GtkWidget *fileload = NULL;
|
||||
static void file_open_dialog_response (GtkWidget *open_dialog,
|
||||
gint response_id,
|
||||
Gimp *gimp);
|
||||
static gboolean file_open_dialog_open_image (GtkWidget *open_dialog,
|
||||
Gimp *gimp,
|
||||
const gchar *uri,
|
||||
const gchar *entered_filename,
|
||||
PlugInProcDef *load_proc);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
file_open_dialog_show (Gimp *gimp,
|
||||
GimpImage *gimage,
|
||||
const gchar *uri,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage));
|
||||
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
|
||||
|
||||
if (! fileload)
|
||||
fileload = file_open_dialog_create (gimp);
|
||||
|
||||
gimp_file_dialog_set_sensitive (GIMP_FILE_DIALOG (fileload), TRUE);
|
||||
|
||||
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (fileload), gimage, uri);
|
||||
|
||||
if (parent)
|
||||
gtk_window_set_screen (GTK_WINDOW (fileload),
|
||||
gtk_widget_get_screen (parent));
|
||||
|
||||
gtk_window_present (GTK_WINDOW (fileload));
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static GtkWidget *
|
||||
file_open_dialog_create (Gimp *gimp)
|
||||
GtkWidget *
|
||||
file_open_dialog_new (Gimp *gimp)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
@ -104,9 +69,6 @@ file_open_dialog_create (Gimp *gimp)
|
|||
|
||||
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), TRUE);
|
||||
|
||||
gimp_dialog_factory_add_foreign (global_dialog_factory,
|
||||
"gimp-file-open-dialog", dialog);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (file_open_dialog_response),
|
||||
gimp);
|
||||
|
@ -114,6 +76,9 @@ file_open_dialog_create (Gimp *gimp)
|
|||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
file_open_dialog_response (GtkWidget *open_dialog,
|
||||
gint response_id,
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
#define __FILE_OPEN_DIALOG_H__
|
||||
|
||||
|
||||
void file_open_dialog_show (Gimp *gimp,
|
||||
GimpImage *gimage,
|
||||
const gchar *uri,
|
||||
GtkWidget *parent);
|
||||
GtkWidget * file_open_dialog_new (Gimp *gimp);
|
||||
|
||||
|
||||
#endif /* __FILE_OPEN_DIALOG_H__ */
|
||||
|
|
Loading…
Reference in New Issue