Commit ccf8ed69 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/widgets/Makefile.am app/widgets/widgets-types.h added new widget that

2004-07-16  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpfileprocview.[ch]: added new widget that offers
	a treeview on file procedures.

	* app/widgets/gimpfiledialog.[ch]: replaced the file type option
	menu with the new GimpFileProcView widget.
	(gimp_file_dialog_set_image): reset the file type to Automatic
	(fixes bug #141535).

	* app/actions/file-commands.c
	* app/gui/file-open-dialog.[ch]
	* app/gui/file-save-dialog.[ch]: changed accordingly.

	* plug-ins/common/bz2.c
	* plug-ins/common/gz.c: don't register "xcf.gz" and "xcf.bz2"
	extension. It's redundant and breaks the code that sets the
	extension from the selected file-type.

	* plug-ins/common/dicom.c: register a shorter menu label.

	* plug-ins/common/gbr.c
	* plug-ins/common/gih.c
	* plug-ins/common/pat.c
	* plug-ins/common/url.c: register stock icons.
parent 07b8bed2
2004-07-16 Sven Neumann <sven@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpfileprocview.[ch]: added new widget that offers
a treeview on file procedures.
* app/widgets/gimpfiledialog.[ch]: replaced the file type option
menu with the new GimpFileProcView widget.
(gimp_file_dialog_set_image): reset the file type to Automatic
(fixes bug #141535).
* app/actions/file-commands.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.[ch]: changed accordingly.
* plug-ins/common/bz2.c
* plug-ins/common/gz.c: don't register "xcf.gz" and "xcf.bz2"
extension. It's redundant and breaks the code that sets the
extension from the selected file-type.
* plug-ins/common/dicom.c: register a shorter menu label.
* plug-ins/common/gbr.c
* plug-ins/common/gih.c
* plug-ins/common/pat.c
* plug-ins/common/url.c: register stock icons.
2004-07-16 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/Lighting/lighting_main.c
* plug-ins/Lighting/lighting_main.h
* plug-ins/Lighting/lighting_preview.c
* plug-ins/Lighting/lighting_preview.h
* plug-ins/Lighting/lighting_main.[ch]
* plug-ins/Lighting/lighting_preview.[ch]
* plug-ins/Lighting/lighting_shade.c
* plug-ins/Lighting/lighting_ui.c: Made this plug-in support
multiple light sources; implemented three, architecture now
......@@ -24,7 +50,7 @@
* tools/pdbgen/pdb/image.pdb: removed redundant #includes.
* tools/pdbgen/pdb/plug_in.pdb: standardized "success" logic.
Consistetly fail if there is no currently queried plugin.
Consistently fail if there is no currently queried plugin.
* app/pdb/*.c: regenerated.
......
......@@ -79,7 +79,7 @@ file_open_cmd_callback (GtkAction *action,
return_if_no_gimp (gimp, data);
return_if_no_widget (widget, data);
file_open_dialog_show (gimp, NULL, NULL, global_menu_factory, widget);
file_open_dialog_show (gimp, NULL, NULL, widget);
}
void
......@@ -91,8 +91,7 @@ file_open_from_image_cmd_callback (GtkAction *action,
return_if_no_gimp (gimp, data);
return_if_no_widget (widget, data);
file_open_dialog_show (gimp, action_data_get_image (data),
NULL, global_menu_factory, widget);
file_open_dialog_show (gimp, action_data_get_image (data), NULL, widget);
}
void
......@@ -204,7 +203,7 @@ file_save_as_cmd_callback (GtkAction *action,
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
file_save_dialog_show (gdisp->gimage, global_menu_factory, gdisp->shell);
file_save_dialog_show (gdisp->gimage, gdisp->shell);
}
void
......@@ -214,8 +213,7 @@ file_save_a_copy_cmd_callback (GtkAction *action,
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
file_save_a_copy_dialog_show (gdisp->gimage, global_menu_factory,
gdisp->shell);
file_save_a_copy_dialog_show (gdisp->gimage, gdisp->shell);
}
void
......@@ -284,15 +282,15 @@ file_revert_cmd_callback (GtkAction *action,
"disconnect",
file_revert_confirm_callback,
gdisp->gimage);
g_free (text);
g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY,
query_box);
gtk_window_set_transient_for (GTK_WINDOW (query_box),
GTK_WINDOW (gdisp->shell));
gtk_widget_show (query_box);
}
}
......@@ -312,7 +310,7 @@ file_file_open_dialog (Gimp *gimp,
const gchar *uri,
GtkWidget *parent)
{
file_open_dialog_show (gimp, NULL, uri, global_menu_factory, parent);
file_open_dialog_show (gimp, NULL, uri, parent);
}
......
......@@ -36,7 +36,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmenufactory.h"
#include "dialogs.h"
#include "file-open-dialog.h"
......@@ -46,16 +45,15 @@
/* local function prototypes */
static GtkWidget * file_open_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory);
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);
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 */
......@@ -66,19 +64,17 @@ static GtkWidget *fileload = NULL;
/* public functions */
void
file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
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 (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! fileload)
fileload = file_open_dialog_create (gimp, menu_factory);
fileload = file_open_dialog_create (gimp);
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (fileload), gimage, uri);
......@@ -93,14 +89,12 @@ file_open_dialog_show (Gimp *gimp,
/* private functions */
static GtkWidget *
file_open_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory)
file_open_dialog_create (Gimp *gimp)
{
GtkWidget *dialog;
dialog = gimp_file_dialog_new (gimp, gimp->load_procs,
dialog = gimp_file_dialog_new (gimp,
GTK_FILE_CHOOSER_ACTION_OPEN,
menu_factory, "<Load>", "/file-open-popup",
_("Open Image"), "gimp-file-open",
GTK_STOCK_OPEN,
GIMP_HELP_FILE_OPEN);
......@@ -108,8 +102,7 @@ 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);
"gimp-file-open-dialog", dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (file_open_dialog_response),
......
......@@ -20,11 +20,10 @@
#define __FILE_OPEN_DIALOG_H__
void file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GtkWidget *parent);
#endif /* __FILE_OPEN_DIALOG_H__ */
......@@ -47,24 +47,23 @@
/* local function prototypes */
static GtkWidget * file_save_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory);
static void file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp);
static void file_save_overwrite (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename);
static void file_save_overwrite_callback (GtkWidget *widget,
gboolean overwrite,
gpointer data);
static gboolean file_save_dialog_save_image (GtkWidget *save_dialog,
GimpImage *gimage,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc,
gboolean set_image_clean);
static GtkWidget * file_save_dialog_create (Gimp *gimp);
static void file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp);
static void file_save_overwrite (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename);
static void file_save_overwrite_callback (GtkWidget *widget,
gboolean overwrite,
gpointer data);
static gboolean file_save_dialog_save_image (GtkWidget *save_dialog,
GimpImage *gimage,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc,
gboolean set_image_clean);
/* private variables */
......@@ -75,19 +74,17 @@ static GtkWidget *filesave = NULL;
/* public functions */
void
file_save_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! gimp_image_active_drawable (gimage))
return;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
filesave = file_save_dialog_create (gimage->gimp);
gtk_widget_set_sensitive (GTK_WIDGET (filesave), TRUE);
......@@ -106,19 +103,17 @@ file_save_dialog_show (GimpImage *gimage,
}
void
file_save_a_copy_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
file_save_a_copy_dialog_show (GimpImage *gimage,
GtkWidget *parent)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! gimp_image_active_drawable (gimage))
return;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
filesave = file_save_dialog_create (gimage->gimp);
gtk_widget_set_sensitive (GTK_WIDGET (filesave), TRUE);
......@@ -140,27 +135,24 @@ file_save_a_copy_dialog_show (GimpImage *gimage,
/* private functions */
static GtkWidget *
file_save_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory)
file_save_dialog_create (Gimp *gimp)
{
GtkWidget *save_dialog;
GtkWidget *dialog;
save_dialog = gimp_file_dialog_new (gimp, gimp->save_procs,
GTK_FILE_CHOOSER_ACTION_SAVE,
menu_factory, "<Save>", "/file-save-popup",
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
GIMP_HELP_FILE_SAVE);
dialog = gimp_file_dialog_new (gimp,
GTK_FILE_CHOOSER_ACTION_SAVE,
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
GIMP_HELP_FILE_SAVE);
gimp_dialog_factory_add_foreign (global_dialog_factory,
"gimp-file-save-dialog",
save_dialog);
"gimp-file-save-dialog", dialog);
g_signal_connect (save_dialog, "response",
g_signal_connect (dialog, "response",
G_CALLBACK (file_save_dialog_response),
gimp);
return save_dialog;
return dialog;
}
static void
......
......@@ -20,12 +20,10 @@
#define __FILE_SAVE_DIALOG_H__
void file_save_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_save_a_copy_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent);
void file_save_a_copy_dialog_show (GimpImage *gimage,
GtkWidget *parent);
#endif /* __FILE_SAVE_DIALOG_H__ */
......@@ -36,7 +36,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmenufactory.h"
#include "dialogs.h"
#include "file-open-dialog.h"
......@@ -46,16 +45,15 @@
/* local function prototypes */
static GtkWidget * file_open_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory);
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);
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 */
......@@ -66,19 +64,17 @@ static GtkWidget *fileload = NULL;
/* public functions */
void
file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
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 (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! fileload)
fileload = file_open_dialog_create (gimp, menu_factory);
fileload = file_open_dialog_create (gimp);
gimp_file_dialog_set_uri (GIMP_FILE_DIALOG (fileload), gimage, uri);
......@@ -93,14 +89,12 @@ file_open_dialog_show (Gimp *gimp,
/* private functions */
static GtkWidget *
file_open_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory)
file_open_dialog_create (Gimp *gimp)
{
GtkWidget *dialog;
dialog = gimp_file_dialog_new (gimp, gimp->load_procs,
dialog = gimp_file_dialog_new (gimp,
GTK_FILE_CHOOSER_ACTION_OPEN,
menu_factory, "<Load>", "/file-open-popup",
_("Open Image"), "gimp-file-open",
GTK_STOCK_OPEN,
GIMP_HELP_FILE_OPEN);
......@@ -108,8 +102,7 @@ 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);
"gimp-file-open-dialog", dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (file_open_dialog_response),
......
......@@ -20,11 +20,10 @@
#define __FILE_OPEN_DIALOG_H__
void file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_open_dialog_show (Gimp *gimp,
GimpImage *gimage,
const gchar *uri,
GtkWidget *parent);
#endif /* __FILE_OPEN_DIALOG_H__ */
......@@ -47,24 +47,23 @@
/* local function prototypes */
static GtkWidget * file_save_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory);
static void file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp);
static void file_save_overwrite (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename);
static void file_save_overwrite_callback (GtkWidget *widget,
gboolean overwrite,
gpointer data);
static gboolean file_save_dialog_save_image (GtkWidget *save_dialog,
GimpImage *gimage,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc,
gboolean set_image_clean);
static GtkWidget * file_save_dialog_create (Gimp *gimp);
static void file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp);
static void file_save_overwrite (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename);
static void file_save_overwrite_callback (GtkWidget *widget,
gboolean overwrite,
gpointer data);
static gboolean file_save_dialog_save_image (GtkWidget *save_dialog,
GimpImage *gimage,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc,
gboolean set_image_clean);
/* private variables */
......@@ -75,19 +74,17 @@ static GtkWidget *filesave = NULL;
/* public functions */
void
file_save_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! gimp_image_active_drawable (gimage))
return;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
filesave = file_save_dialog_create (gimage->gimp);
gtk_widget_set_sensitive (GTK_WIDGET (filesave), TRUE);
......@@ -106,19 +103,17 @@ file_save_dialog_show (GimpImage *gimage,
}
void
file_save_a_copy_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent)
file_save_a_copy_dialog_show (GimpImage *gimage,
GtkWidget *parent)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent));
if (! gimp_image_active_drawable (gimage))
return;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
filesave = file_save_dialog_create (gimage->gimp);
gtk_widget_set_sensitive (GTK_WIDGET (filesave), TRUE);
......@@ -140,27 +135,24 @@ file_save_a_copy_dialog_show (GimpImage *gimage,
/* private functions */
static GtkWidget *
file_save_dialog_create (Gimp *gimp,
GimpMenuFactory *menu_factory)
file_save_dialog_create (Gimp *gimp)
{
GtkWidget *save_dialog;
GtkWidget *dialog;
save_dialog = gimp_file_dialog_new (gimp, gimp->save_procs,
GTK_FILE_CHOOSER_ACTION_SAVE,
menu_factory, "<Save>", "/file-save-popup",
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
GIMP_HELP_FILE_SAVE);
dialog = gimp_file_dialog_new (gimp,
GTK_FILE_CHOOSER_ACTION_SAVE,
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
GIMP_HELP_FILE_SAVE);
gimp_dialog_factory_add_foreign (global_dialog_factory,
"gimp-file-save-dialog",
save_dialog);
"gimp-file-save-dialog", dialog);
g_signal_connect (save_dialog, "response",
g_signal_connect (dialog, "response",
G_CALLBACK (file_save_dialog_response),
gimp);
return save_dialog;
return dialog;
}
static void
......
......@@ -20,12 +20,10 @@
#define __FILE_SAVE_DIALOG_H__
void file_save_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_save_a_copy_dialog_show (GimpImage *gimage,
GimpMenuFactory *menu_factory,
GtkWidget *parent);
void file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent);
void file_save_a_copy_dialog_show (GimpImage *gimage,
GtkWidget *parent);
#endif /* __FILE_SAVE_DIALOG_H__ */
......@@ -131,6 +131,8 @@ libappwidgets_a_sources = \
gimpfgbgeditor.h \
gimpfiledialog.c \
gimpfiledialog.h \
gimpfileprocview.c \
gimpfileprocview.h \
gimpfontselect.c \
gimpfontselect.h \
gimpfontview.c \
......
......@@ -37,11 +37,11 @@
#include "file/file-utils.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "gimpfiledialog.h"
#include "gimpmenufactory.h"
#include "gimpfileprocview