Commit d627cc01 authored by Paolo Maggi's avatar Paolo Maggi Committed by Paolo Maggi

-DGEDIT_UI_DIR and -DGEDIT_GLADE_DIR added to INCLUDES, ui_DATA defined,

2001-11-26  Paolo Maggi  <maggi@athena.polito.it>

	* Makefile.am: -DGEDIT_UI_DIR and -DGEDIT_GLADE_DIR added to INCLUDES,
	ui_DATA defined, added gedit-print.c and gedit-print.h to gedit2_SOURCES

	* bonobo-mdi.c (app_create): removed old commented code

	* gedit-commands.[ch] (gedit_cmd_file_print): new function
	  (gedit_cmd_file_print_preview): ditto
          (gedit_cmd_settings_preferences): ditto

	* gedit-file.c	(gedit_file_save_as_ok_button_clicked_handler): typo

	* gedit-mdi.c (gedit_mdi_init): removed old commented code, search
	gedit-ui.xml in the rigth location

	* gedit-menus.c: added FilePrint, FilePrintPreview and SettingsPreferences to
	gedit_verbs []

	* gedit-prefs.[ch]: added two new preferences, i.e. use_default_font and use_default_colors

        * dialogs/Makefile.am: -DGEDIT_UI_DIR and -DGEDIT_GLADE_DIR added to INCLUDES,
	added gedit-preferences-dialog.[ch] to libdialogs_a_SOURCES

	* dialogs/gedit-dialog-goto-line.c (dialog_goto_line_get_dialog): search glade file in the rigth location

	* dialogs/gedit-dialog-uri.c (dialog_open_uri_get_dialog): ditto

	* dialogs/gedit-dialog-replace.c (dialog_replace_get_dialog): ditto
	  (gedit_dialog_replace): close window only when "replace all" or "close" button is pressed

	* gedit-print.[ch]
	* dialogs/gedit-preferences.glade2
	* src/dialogs/gedit-preferences-dialog.[ch]: new files
parent 0d595154
......@@ -86,3 +86,4 @@ Configuration:
Compiler: ${CC}
"
2001-11-26 Paolo Maggi <maggi@athena.polito.it>
* Makefile.am: -DGEDIT_UI_DIR and -DGEDIT_GLADE_DIR added to INCLUDES,
ui_DATA defined, added gedit-print.c and gedit-print.h to gedit2_SOURCES
* bonobo-mdi.c (app_create): removed old commented code
* gedit-commands.[ch] (gedit_cmd_file_print): new function
(gedit_cmd_file_print_preview): ditto
(gedit_cmd_settings_preferences): ditto
* gedit-file.c (gedit_file_save_as_ok_button_clicked_handler): typo
* gedit-mdi.c (gedit_mdi_init): removed old commented code, search
gedit-ui.xml in the rigth location
* gedit-menus.c: added FilePrint, FilePrintPreview and SettingsPreferences to
gedit_verbs []
* gedit-prefs.[ch]: added two new preferences, i.e. use_default_font and use_default_colors
* dialogs/Makefile.am: -DGEDIT_UI_DIR and -DGEDIT_GLADE_DIR added to INCLUDES,
added gedit-preferences-dialog.[ch] to libdialogs_a_SOURCES
* dialogs/gedit-dialog-goto-line.c (dialog_goto_line_get_dialog): search glade file in the rigth location
* dialogs/gedit-dialog-uri.c (dialog_open_uri_get_dialog): ditto
* dialogs/gedit-dialog-replace.c (dialog_replace_get_dialog): ditto
(gedit_dialog_replace): close window only when "replace all" or "close" button is pressed
* gedit-print.[ch]
* dialogs/gedit-preferences.glade2
* src/dialogs/gedit-preferences-dialog.[ch]: new files
2001-11-23 Paolo Maggi <maggi@athena.polito.it>
* gedit-commands.[ch] (gedit_cmd_search_replace): new function
......
......@@ -3,14 +3,17 @@ SUBDIRS= dialogs
bin_PROGRAMS = gedit2
uidir = $(datadir)/gedit2/ui/
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/dialogs \
$(GEDIT_CFLAGS) \
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" \
-DGEDIT_LOCALEDIR=\""$(datadir)/locale"\"
-DGEDIT_LOCALEDIR=\""$(datadir)/locale"\" \
-DGEDIT_UI_DIR=\""$(datadir)/gedit2/ui/"\" \
-DGEDIT_GLADEDIR=\""$(datadir)/gedit2/glade/"\"
CFLAGS = -g -O2 -Wall
......@@ -45,6 +48,8 @@ gedit2_SOURCES = \
gedit-recent.c \
gedit-undo-manager.h \
gedit-undo-manager.c \
gedit-print.h \
gedit-print.c \
bonobo-mdi-child.c \
bonobo-mdi-child.h \
bonobo-mdi.c \
......@@ -52,7 +57,8 @@ gedit2_SOURCES = \
gnome-vfs-helpers.c \
gnome-vfs-helpers.h
# FIXME
EXTRA_DIST = gedit-ui.xml
ui_DATA = gedit-ui.xml
EXTRA_DIST = $(ui_DATA)
......@@ -1201,15 +1201,8 @@ static void app_create (BonoboMDI *mdi, gchar *layout_string)
else
if (mdi->priv->ui_file_name)
{
/* FIXME */
bonobo_ui_util_set_ui (ui_component, "", mdi->priv->ui_file_name,
mdi->priv->mdi_name, NULL);
/*
bonobo_ui_util_set_ui (ui_component, "/opt/gedit2/src", mdi->priv->ui_file_name,
mdi->priv->mdi_name);
*/
}
if (mdi->priv->verbs)
......
......@@ -40,7 +40,7 @@
#define BONOBO_MDI_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), BONOBO_TYPE_MDI, BonoboMDIClass))
typedef enum {
BONOBO_MDI_NOTEBOOK,
BONOBO_MDI_NOTEBOOK = 0,
BONOBO_MDI_TOPLEVEL,
BONOBO_MDI_MODAL,
BONOBO_MDI_DEFAULT_MODE = 42
......
gladedir = $(datadir)/gedit/glade/
gladedir = $(datadir)/gedit2/glade/
INCLUDES = \
-I$(top_srcdir)/src \
$(GEDIT_CFLAGS) \
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\"
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" \
-DGEDIT_GLADEDIR=\""$(datadir)/gedit2/glade/"\"
noinst_LIBRARIES = libdialogs.a
......@@ -11,12 +13,15 @@ libdialogs_a_SOURCES = \
gedit-dialog-uri.c \
gedit-dialog-goto-line.c \
gedit-dialog-replace.c \
gedit-preferences-dialog.h \
gedit-preferences-dialog.c \
gedit-dialogs.h
glade_DATA = \
uri.glade2 \
goto-line.glade2 \
replace.glade2
replace.glade2 \
gedit-preferences.glade2
EXTRA_DIST = $(glade_DATA)
......@@ -58,8 +58,7 @@ dialog_goto_line_get_dialog (void)
if (dialog != NULL)
return dialog;
/* FIXME */
gui = glade_xml_new ( /*GEDIT_GLADEDIR */ "./dialogs/goto-line.glade2",
gui = glade_xml_new (GEDIT_GLADEDIR "goto-line.glade2",
"goto_line_dialog_content", NULL);
if (!gui) {
......
......@@ -83,8 +83,7 @@ dialog_replace_get_dialog (void)
return dialog;
}
/* FIXME */
gui = glade_xml_new ( /*GEDIT_GLADEDIR */ "./dialogs/replace.glade2",
gui = glade_xml_new ( GEDIT_GLADEDIR "replace.glade2",
"replace_dialog_content", NULL);
if (!gui) {
......@@ -161,8 +160,7 @@ dialog_find_get_dialog (void)
return dialog;
}
/* FIXME */
gui = glade_xml_new ( /*GEDIT_GLADEDIR */ "./dialogs/replace.glade2",
gui = glade_xml_new (GEDIT_GLADEDIR "replace.glade2",
"replace_dialog_content", NULL);
if (!gui) {
......@@ -214,7 +212,7 @@ dialog_find_get_dialog (void)
content, FALSE, FALSE, 0);
gtk_dialog_set_default_response (GTK_DIALOG (dialog->dialog),
GTK_RESPONSE_OK);
GEDIT_RESPONSE_FIND);
g_object_unref (G_OBJECT (gui));
......@@ -271,24 +269,31 @@ gedit_dialog_replace (void)
gtk_widget_grab_focus (dialog->search_entry);
response = gtk_dialog_run (GTK_DIALOG (dialog->dialog));
switch (response) {
case GEDIT_RESPONSE_FIND:
replace_dlg_find_button_pressed (dialog);
break;
case GEDIT_RESPONSE_REPLACE:
replace_dlg_replace_button_pressed (dialog);
break;
case GEDIT_RESPONSE_REPLACE_ALL:
replace_dlg_replace_all_button_pressed (dialog);
break;
default:
gtk_widget_hide (dialog->dialog);
}
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->dialog),
GEDIT_RESPONSE_REPLACE, FALSE);
do
{
response = gtk_dialog_run (GTK_DIALOG (dialog->dialog));
switch (response) {
case GEDIT_RESPONSE_FIND:
replace_dlg_find_button_pressed (dialog);
break;
case GEDIT_RESPONSE_REPLACE:
replace_dlg_replace_button_pressed (dialog);
break;
case GEDIT_RESPONSE_REPLACE_ALL:
replace_dlg_replace_all_button_pressed (dialog);
break;
default:
gtk_widget_hide (dialog->dialog);
}
} while (GTK_WIDGET_VISIBLE (dialog->dialog));
}
static void
......@@ -303,14 +308,12 @@ static void
replace_dlg_find_button_pressed (GeditDialogReplace *dialog)
{
/* FIXME */
gtk_widget_hide (dialog->dialog);
}
static void
replace_dlg_replace_button_pressed (GeditDialogReplace *dialog)
{
/* FIXME */
gtk_widget_hide (dialog->dialog);
}
static void
......
......@@ -58,8 +58,7 @@ dialog_open_uri_get_dialog (void)
if (dialog != NULL)
return dialog;
/* FIXME */
gui = glade_xml_new ( /*GEDIT_GLADEDIR */ "./dialogs/uri.glade2",
gui = glade_xml_new (GEDIT_GLADEDIR "uri.glade2",
"open_uri_dialog_content", NULL);
if (!gui) {
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gedit-preferences-dialog.h
* This file is part of gedit
*
* Copyright (C) 2001 Paolo Maggi
*
* 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.
*/
/*
* Modified by the gedit Team, 1998-2001. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __GEDIT_PREFERENCES_DIALOG_H__
#define __GEDIT_PREFERENCES_DIALOG_H__
#include <gtk/gtk.h>
#define GEDIT_TYPE_PREFERENCES_DIALOG (gedit_preferences_dialog_get_type ())
#define GEDIT_PREFERENCES_DIALOG(obj) (GTK_CHECK_CAST ((obj), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialog))
#define GEDIT_PREFERENCES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialogClass))
#define GEDIT_IS_PREFERENCES_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GEDIT_TYPE_PREFERENCES_DIALOG))
#define GEDIT_IS_PREFERENCES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PREFERENCES_DIALOG))
#define GEDIT_PREFERENCES_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialogClass))
typedef struct _GeditPreferencesDialog GeditPreferencesDialog;
typedef struct _GeditPreferencesDialogClass GeditPreferencesDialogClass;
typedef struct _GeditPreferencesDialogPrivate GeditPreferencesDialogPrivate;
struct _GeditPreferencesDialog
{
GtkDialog parent_instance;
GeditPreferencesDialogPrivate *priv;
};
struct _GeditPreferencesDialogClass
{
GtkDialogClass parent_class;
};
GtkType gedit_preferences_dialog_get_type (void) G_GNUC_CONST;
GtkWidget* gedit_preferences_dialog_new (GtkWindow *parent);
#endif /* __GEDIT_PREFERENCES_DIALOG_H__ */
This diff is collapsed.
......@@ -42,7 +42,9 @@
#include "gedit-debug.h"
#include "gedit-view.h"
#include "gedit-file.h"
#include "gedit-print.h"
#include "dialogs/gedit-dialogs.h"
#include "dialogs/gedit-preferences-dialog.h"
void
gedit_cmd_file_new (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
......@@ -122,6 +124,34 @@ gedit_cmd_file_open_uri (BonoboUIComponent *uic, gpointer user_data, const gchar
gedit_dialog_open_uri ();
}
void
gedit_cmd_file_print (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
{
GeditMDIChild *active_child;
gedit_debug (DEBUG_COMMANDS, "");
active_child = GEDIT_MDI_CHILD (bonobo_mdi_get_active_child (BONOBO_MDI (gedit_mdi)));
if (active_child == NULL)
return;
gedit_print (active_child);
}
void
gedit_cmd_file_print_preview (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
{
GeditMDIChild *active_child;
gedit_debug (DEBUG_COMMANDS, "");
active_child = GEDIT_MDI_CHILD (bonobo_mdi_get_active_child (BONOBO_MDI (gedit_mdi)));
if (active_child == NULL)
return;
gedit_print_preview (active_child);
}
void
gedit_cmd_file_close (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
{
......@@ -266,6 +296,19 @@ gedit_cmd_search_goto_line (BonoboUIComponent *uic, gpointer user_data, const gc
gedit_dialog_goto_line ();
}
void
gedit_cmd_settings_preferences (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
{
GtkWidget *dlg;
dlg = gedit_preferences_dialog_new (
GTK_WINDOW (bonobo_mdi_get_active_window (BONOBO_MDI (gedit_mdi))));
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
}
void
gedit_cmd_help_about (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
{
......
......@@ -40,6 +40,9 @@ void gedit_cmd_file_save_as (BonoboUIComponent *uic, gpointer user_data, con
void gedit_cmd_file_save_all (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_revert (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_open_uri (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_print (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_print_preview
(BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_close (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_close_all (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_file_exit (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
......@@ -56,6 +59,8 @@ void gedit_cmd_search_find (BonoboUIComponent *uic, gpointer user_data, con
void gedit_cmd_search_replace (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_search_goto_line (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_settings_preferences (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
void gedit_cmd_help_about (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname);
#endif /* __GEDIT_COMMANDS_H__ */
......@@ -655,7 +655,7 @@ gedit_file_save_as_ok_button_clicked_handler (GtkWidget *widget, GeditMDIChild *
file_name);
gtk_dialog_add_button (GTK_DIALOG (msgbox),
_("Replace"),
_("_Replace"),
GTK_RESPONSE_YES);
gtk_dialog_set_default_response (GTK_DIALOG (msgbox), GTK_RESPONSE_CANCEL);
......
......@@ -131,18 +131,10 @@ gedit_mdi_init (GeditMDI *mdi)
/* FIXME */
gedit_debug (DEBUG_MDI, "------ %s\n",
bonobo_ui_util_get_ui_fname ("", "./gedit-ui.xml"));
bonobo_ui_util_get_ui_fname ("", GEDIT_UI_DIR "gedit-ui.xml"));
bonobo_mdi_set_ui_template_file (BONOBO_MDI (mdi), "./gedit-ui.xml", gedit_verbs);
bonobo_mdi_set_ui_template_file (BONOBO_MDI (mdi), GEDIT_UI_DIR "gedit-ui.xml", gedit_verbs);
/*
bonobo_mdi_set_ui_template_file (BONOBO_MDI (mdi), "gedit-ui.xml", gedit_verbs);
*/
#if 0
/* FIXME */
bonobo_mdi_set_child_menu_path (BONOBO_MDI (mdi), GNOME_MENU_FILE_STRING);
#endif
bonobo_mdi_set_child_list_path (BONOBO_MDI (mdi), "/menu/Documents/");
bonobo_mdi_set_mode (BONOBO_MDI (mdi), settings->mdi_mode);
......
......@@ -44,6 +44,8 @@ BonoboUIVerb gedit_verbs [] = {
BONOBO_UI_VERB ("FileSaveAll", gedit_cmd_file_save_all),
BONOBO_UI_VERB ("FileRevert", gedit_cmd_file_revert),
BONOBO_UI_VERB ("FileOpenURI", gedit_cmd_file_open_uri),
BONOBO_UI_VERB ("FilePrint", gedit_cmd_file_print),
BONOBO_UI_VERB ("FilePrintPreview", gedit_cmd_file_print_preview),
BONOBO_UI_VERB ("FileClose", gedit_cmd_file_close),
BONOBO_UI_VERB ("FileCloseAll", gedit_cmd_file_close_all),
BONOBO_UI_VERB ("FileExit", gedit_cmd_file_exit),
......@@ -57,6 +59,7 @@ BonoboUIVerb gedit_verbs [] = {
BONOBO_UI_VERB ("SearchFind", gedit_cmd_search_find),
BONOBO_UI_VERB ("SearchReplace", gedit_cmd_search_replace),
BONOBO_UI_VERB ("SearchGoToLine", gedit_cmd_search_goto_line),
BONOBO_UI_VERB ("SettingsPreferences", gedit_cmd_settings_preferences),
BONOBO_UI_VERB ("About", gedit_cmd_help_about),
BONOBO_UI_VERB_END
......
......@@ -79,6 +79,9 @@ gedit_prefs_save_settings (void)
gnome_config_set_int ("undo_levels", (gint) settings->undo_levels);
gnome_config_set_int ("tab_size", (gint) settings->tab_size);
gnome_config_set_bool ("use_default_font", settings->use_default_font);
gnome_config_set_bool ("use_default_colors", settings->use_default_colors);
gnome_config_set_int ("bgr", settings->bg[0]);
gnome_config_set_int ("bgg", settings->bg[1]);
gnome_config_set_int ("bgb", settings->bg[2]);
......@@ -157,6 +160,9 @@ gedit_prefs_load_settings (void)
settings->undo_levels = gnome_config_get_int ("undo_levels=25");
settings->tab_size = gnome_config_get_int ("tab_size=8");
settings->use_default_font = gnome_config_get_bool ("use_default_font=TRUE");
settings->use_default_colors = gnome_config_get_bool ("use_default_colors=TRUE");
settings->bg[0] = gnome_config_get_int ("bgr=65535");
settings->bg[1] = gnome_config_get_int ("bgg=65535");
settings->bg[2] = gnome_config_get_int ("bgb=65535");
......
......@@ -61,12 +61,14 @@ struct _GeditPreferences
/* gboolean use_fontset;
*/
gint use_default_font;
gchar *font;
gint splitscreen;
gint mdi_mode;
gint mdi_mode;
gint use_default_colors;
guint16 bg[3];
guint16 fg[3];
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gedit-print.c
* This file is part of gedit
*
* Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi
*
* 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.
*/
/*
* Modified by the gedit Team, 1998-2001. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*/
#include "gedit-print.h"
#include "gedit-debug.h"
#if 0
static void gedit_print_real (gboolean preview);
static gboolean gedit_print_run_dialog (/*PrintJobInfo *pji*/);
/**
* gedit_print_run_dialog:
* @pji:
*
* Run the print dialog
*
* Return Value: TRUE if the printing was canceled by the user
**/
static gboolean
gedit_print_run_dialog (/*PrintJobInfo *pji*/)
{
GtkWidget *dialog;
guint start_pos;
guint end_pos;
gint selection_flag;
/*
if (!gedit_view_get_selection (pji->view, &start_pos, &end_pos))
selection_flag = GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE;
else*/
selection_flag = GNOME_PRINT_RANGE_SELECTION;
dialog = gnome_print_dialog_new ((const char *) _("Print Document"),
GNOME_PRINT_DIALOG_RANGE);
gnome_print_dialog_construct_range_page ( GNOME_PRINT_DIALOG (dialog),
GNOME_PRINT_RANGE_ALL |
GNOME_PRINT_RANGE_RANGE |
selection_flag,
1, /*pji->pages*/5, "A",
_("Pages"));
gtk_dialog_run (GTK_DIALOG (dialog));
switch (gnome_dialog_run (GNOME_DIALOG (dialog))) {
case GNOME_PRINT_PRINT:
break;
case GNOME_PRINT_PREVIEW:
pji->preview = TRUE;
break;
case -1:
return TRUE;
default:
gnome_dialog_close (GNOME_DIALOG (dialog));
return TRUE;
}
pji->printer = gnome_print_dialog_get_printer (GNOME_PRINT_DIALOG (dialog));
/* If preview, do not set the printer so that the print button in the preview
* window will pop another print dialog */
if (pji->printer && !pji->preview)
gnome_print_master_set_printer (pji->master, pji->printer);
pji->range = gnome_print_dialog_get_range_page (
GNOME_PRINT_DIALOG (dialog),
&pji->page_first,
&pji->page_last);
if (pji->range == GNOME_PRINT_RANGE_SELECTION)
gedit_print_range_is_selection (pji, start_pos, end_pos);
gtk_widget_destroy (dialog);
return FALSE;
}
gedit_print_run_dialog (pji);
#endif
/**
* gedit_print_real:
* @preview:
*
* The main printing function
**/
static void
gedit_print_real (gboolean preview)
{
#if 0
PrintJobInfo *pji;
gboolean cancel = FALSE;
gedit_debug (DEBUG_PRINT, "");
if (!gedit_print_verify_fonts ())
return;
pji = gedit_print_job_info_new ();
pji->preview = preview;
if (!pji->preview)
cancel = gedit_print_run_dialog (pji);
/* The canceled button on the dialog was clicked */
if (cancel) {
gedit_print_job_info_destroy (pji);
return;
}
gedit_print_document (pji);
/* The printing was canceled while in progress */
if (pji->canceled) {
gedit_print_job_info_destroy (pji);
return;
}
if (pji->preview)
gedit_print_preview_real (pji);
else
gnome_print_master_print (pji->master);
gedit_print_job_info_destroy (pji);
#endif
}
void
gedit_print (GeditMDIChild* active_child)
{
gedit_debug (DEBUG_PRINT, "");
</