
2004-02-27 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpfiledialog.[ch]: new widget swallowing most of file-dialog-utils.[ch]'s functionality. * app/widgets/widgets-types.h: added "gpointer callback_data" to GimpItemFactorySetupFunc so the setup_funcs can create items in the same context as the item factory's default items. * app/widgets/gimpmenufactory.c (gimp_menu_factory_menu_new): pass "callback_data" to setup_func(). * app/gui/file-open-menu.[ch] * app/gui/file-save-menu.[ch]: use the passed callback_data when creating the menus and attach the file_proc to the menu items using g_object_set_data(). * app/gui/file-commands.[ch]: merged separate file type callbacks for open and save dialogs into one callback which simply calls gimp_file_dialog_set_file_proc(). * app/gui/file-dialog-utils.[ch]: removed file_dialog_new() and file_dialog_set_proc(). * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch]: use the new widget and removed global variables except the dialog pointer itself. * app/gui/image-menu.[ch] * app/gui/tool-options-menu.[ch] * app/gui/toolbox-menu.[ch]: changed accordingly.
74 lines
2.3 KiB
C
74 lines
2.3 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995, 1996, 1997 Spencer Kimball and Peter Mattis
|
|
* Copyright (C) 1997 Josh MacDonald
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
#include "gui-types.h"
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "plug-in/plug-in-proc.h"
|
|
|
|
#include "widgets/gimpdialogfactory.h"
|
|
#include "widgets/gimpfiledialog.h"
|
|
#include "widgets/gimpitemfactory.h"
|
|
#include "widgets/gimpmenufactory.h"
|
|
|
|
#include "file-dialog-utils.h"
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
void
|
|
file_dialog_show (GtkWidget *filesel,
|
|
GtkWidget *parent)
|
|
{
|
|
gimp_item_factories_set_sensitive ("<Toolbox>", "/File/Open...", FALSE);
|
|
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Open...", FALSE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", FALSE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", FALSE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", FALSE);
|
|
|
|
gtk_window_set_screen (GTK_WINDOW (filesel),
|
|
gtk_widget_get_screen (parent));
|
|
|
|
gtk_widget_grab_focus (GTK_FILE_SELECTION (filesel)->selection_entry);
|
|
gtk_window_present (GTK_WINDOW (filesel));
|
|
}
|
|
|
|
void
|
|
file_dialog_hide (GtkWidget *filesel)
|
|
{
|
|
gtk_widget_hide (filesel);
|
|
|
|
gimp_item_factories_set_sensitive ("<Toolbox>", "/File/Open...", TRUE);
|
|
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Open...", TRUE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", TRUE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", TRUE);
|
|
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", TRUE);
|
|
}
|