Rename Search dialog as Replace dialog.

parent 40077162
...@@ -18,13 +18,13 @@ libdialogs_la_SOURCES = \ ...@@ -18,13 +18,13 @@ libdialogs_la_SOURCES = \
gedit-close-confirmation-dialog.h \ gedit-close-confirmation-dialog.h \
gedit-encodings-dialog.c \ gedit-encodings-dialog.c \
gedit-encodings-dialog.h \ gedit-encodings-dialog.h \
gedit-search-dialog.h \ gedit-replace-dialog.h \
gedit-search-dialog.c gedit-replace-dialog.c
ui_DATA = \ ui_DATA = \
gedit-encodings-dialog.ui \ gedit-encodings-dialog.ui \
gedit-preferences-dialog.ui \ gedit-preferences-dialog.ui \
gedit-search-dialog.ui gedit-replace-dialog.ui
EXTRA_DIST = $(ui_DATA) EXTRA_DIST = $(ui_DATA)
......
/* /*
* gedit-search-dialog.c * gedit-replace-dialog.c
* This file is part of gedit * This file is part of gedit
* *
* Copyright (C) 2005 Paolo Maggi * Copyright (C) 2005 Paolo Maggi
...@@ -36,17 +36,17 @@ ...@@ -36,17 +36,17 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "gedit-search-dialog.h" #include "gedit-replace-dialog.h"
#include "gedit-history-entry.h" #include "gedit-history-entry.h"
#include "gedit-utils.h" #include "gedit-utils.h"
#include "gedit-marshal.h" #include "gedit-marshal.h"
#include "gedit-dirs.h" #include "gedit-dirs.h"
#define GEDIT_SEARCH_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ #define GEDIT_REPLACE_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GEDIT_TYPE_SEARCH_DIALOG, \ GEDIT_TYPE_REPLACE_DIALOG, \
GeditSearchDialogPrivate)) GeditReplaceDialogPrivate))
struct _GeditSearchDialogPrivate struct _GeditReplaceDialogPrivate
{ {
GtkWidget *table; GtkWidget *table;
GtkWidget *search_label; GtkWidget *search_label;
...@@ -66,13 +66,13 @@ struct _GeditSearchDialogPrivate ...@@ -66,13 +66,13 @@ struct _GeditSearchDialogPrivate
gboolean ui_error; gboolean ui_error;
}; };
G_DEFINE_TYPE(GeditSearchDialog, gedit_search_dialog, GTK_TYPE_DIALOG) G_DEFINE_TYPE(GeditReplaceDialog, gedit_replace_dialog, GTK_TYPE_DIALOG)
void void
gedit_search_dialog_present_with_time (GeditSearchDialog *dialog, gedit_replace_dialog_present_with_time (GeditReplaceDialog *dialog,
guint32 timestamp) guint32 timestamp)
{ {
g_return_if_fail (GEDIT_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_REPLACE_DIALOG (dialog));
gtk_window_present_with_time (GTK_WINDOW (dialog), timestamp); gtk_window_present_with_time (GTK_WINDOW (dialog), timestamp);
...@@ -80,11 +80,11 @@ gedit_search_dialog_present_with_time (GeditSearchDialog *dialog, ...@@ -80,11 +80,11 @@ gedit_search_dialog_present_with_time (GeditSearchDialog *dialog,
} }
static void static void
gedit_search_dialog_class_init (GeditSearchDialogClass *klass) gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (object_class, sizeof (GeditSearchDialogPrivate)); g_type_class_add_private (object_class, sizeof (GeditReplaceDialogPrivate));
} }
static void static void
...@@ -124,8 +124,8 @@ insert_text_handler (GtkEditable *editable, ...@@ -124,8 +124,8 @@ insert_text_handler (GtkEditable *editable,
} }
static void static void
search_text_entry_changed (GtkEditable *editable, search_text_entry_changed (GtkEditable *editable,
GeditSearchDialog *dialog) GeditReplaceDialog *dialog)
{ {
const gchar *search_string; const gchar *search_string;
...@@ -135,32 +135,32 @@ search_text_entry_changed (GtkEditable *editable, ...@@ -135,32 +135,32 @@ search_text_entry_changed (GtkEditable *editable,
if (*search_string != '\0') if (*search_string != '\0')
{ {
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_FIND_RESPONSE, TRUE); GEDIT_REPLACE_DIALOG_FIND_RESPONSE, TRUE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, TRUE); GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE, TRUE);
} }
else else
{ {
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_FIND_RESPONSE, FALSE); GEDIT_REPLACE_DIALOG_FIND_RESPONSE, FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, FALSE); GEDIT_REPLACE_DIALOG_REPLACE_RESPONSE, FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, FALSE); GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE, FALSE);
} }
} }
static void static void
response_handler (GeditSearchDialog *dialog, response_handler (GeditReplaceDialog *dialog,
gint response_id, gint response_id,
gpointer data) gpointer data)
{ {
const gchar *str; const gchar *str;
switch (response_id) switch (response_id)
{ {
case GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE: case GEDIT_REPLACE_DIALOG_REPLACE_RESPONSE:
case GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE: case GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE:
str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry)); str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry));
if (*str != '\0') if (*str != '\0')
{ {
...@@ -174,7 +174,7 @@ response_handler (GeditSearchDialog *dialog, ...@@ -174,7 +174,7 @@ response_handler (GeditSearchDialog *dialog,
g_free (text); g_free (text);
} }
/* fall through, so that we also save the find entry */ /* fall through, so that we also save the find entry */
case GEDIT_SEARCH_DIALOG_FIND_RESPONSE: case GEDIT_REPLACE_DIALOG_FIND_RESPONSE:
str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry)); str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry));
if (*str != '\0') if (*str != '\0')
{ {
...@@ -191,18 +191,18 @@ response_handler (GeditSearchDialog *dialog, ...@@ -191,18 +191,18 @@ response_handler (GeditSearchDialog *dialog,
} }
static void static void
gedit_search_dialog_init (GeditSearchDialog *dlg) gedit_replace_dialog_init (GeditReplaceDialog *dlg)
{ {
GtkWidget *content; GtkWidget *content;
GtkWidget *error_widget; GtkWidget *error_widget;
gboolean ret; gboolean ret;
gchar *file; gchar *file;
gchar *root_objects[] = { gchar *root_objects[] = {
"search_dialog_content", "replace_dialog_content",
NULL NULL
}; };
dlg->priv = GEDIT_SEARCH_DIALOG_GET_PRIVATE (dlg); dlg->priv = GEDIT_REPLACE_DIALOG_GET_PRIVATE (dlg);
gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE); gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE); gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
...@@ -221,11 +221,11 @@ gedit_search_dialog_init (GeditSearchDialog *dlg) ...@@ -221,11 +221,11 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))),
6); 6);
file = gedit_dirs_get_ui_file ("gedit-search-dialog.ui"); file = gedit_dirs_get_ui_file ("gedit-replace-dialog.ui");
ret = gedit_utils_get_ui_objects (file, ret = gedit_utils_get_ui_objects (file,
root_objects, root_objects,
&error_widget, &error_widget,
"search_dialog_content", &content, "replace_dialog_content", &content,
"table", &dlg->priv->table, "table", &dlg->priv->table,
"search_label", &dlg->priv->search_label, "search_label", &dlg->priv->search_label,
"replace_with_label", &dlg->priv->replace_label, "replace_with_label", &dlg->priv->replace_label,
...@@ -294,29 +294,29 @@ gedit_search_dialog_init (GeditSearchDialog *dlg) ...@@ -294,29 +294,29 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
gtk_dialog_add_action_widget (GTK_DIALOG (dlg), gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
dlg->priv->replace_all_button, dlg->priv->replace_all_button,
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE); GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE);
gtk_dialog_add_action_widget (GTK_DIALOG (dlg), gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
dlg->priv->replace_button, dlg->priv->replace_button,
GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE); GEDIT_REPLACE_DIALOG_REPLACE_RESPONSE);
gtk_dialog_add_action_widget (GTK_DIALOG (dlg), gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
dlg->priv->find_button, dlg->priv->find_button,
GEDIT_SEARCH_DIALOG_FIND_RESPONSE); GEDIT_REPLACE_DIALOG_FIND_RESPONSE);
g_object_set (G_OBJECT (dlg->priv->find_button), g_object_set (G_OBJECT (dlg->priv->find_button),
"can-default", TRUE, "can-default", TRUE,
NULL); NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dlg), gtk_dialog_set_default_response (GTK_DIALOG (dlg),
GEDIT_SEARCH_DIALOG_FIND_RESPONSE); GEDIT_REPLACE_DIALOG_FIND_RESPONSE);
/* insensitive by default */ /* insensitive by default */
gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg),
GEDIT_SEARCH_DIALOG_FIND_RESPONSE, GEDIT_REPLACE_DIALOG_FIND_RESPONSE,
FALSE); FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg),
GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, GEDIT_REPLACE_DIALOG_REPLACE_RESPONSE,
FALSE); FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg),
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE,
FALSE); FALSE);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
...@@ -346,11 +346,11 @@ gedit_search_dialog_init (GeditSearchDialog *dlg) ...@@ -346,11 +346,11 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
} }
GtkWidget * GtkWidget *
gedit_search_dialog_new (GtkWindow *parent) gedit_replace_dialog_new (GtkWindow *parent)
{ {
GeditSearchDialog *dlg; GeditReplaceDialog *dlg;
dlg = g_object_new (GEDIT_TYPE_SEARCH_DIALOG, dlg = g_object_new (GEDIT_TYPE_REPLACE_DIALOG,
NULL); NULL);
if (parent != NULL) if (parent != NULL)
...@@ -366,21 +366,21 @@ gedit_search_dialog_new (GtkWindow *parent) ...@@ -366,21 +366,21 @@ gedit_search_dialog_new (GtkWindow *parent)
} }
void void
gedit_search_dialog_set_search_text (GeditSearchDialog *dialog, gedit_replace_dialog_set_search_text (GeditReplaceDialog *dialog,
const gchar *text) const gchar *text)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
g_return_if_fail (text != NULL); g_return_if_fail (text != NULL);
gtk_entry_set_text (GTK_ENTRY (dialog->priv->search_text_entry), gtk_entry_set_text (GTK_ENTRY (dialog->priv->search_text_entry),
text); text);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_FIND_RESPONSE, GEDIT_REPLACE_DIALOG_FIND_RESPONSE,
(text != '\0')); (text != '\0'));
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE,
(text != '\0')); (text != '\0'));
} }
...@@ -388,18 +388,18 @@ gedit_search_dialog_set_search_text (GeditSearchDialog *dialog, ...@@ -388,18 +388,18 @@ gedit_search_dialog_set_search_text (GeditSearchDialog *dialog,
* The text must be unescaped before searching. * The text must be unescaped before searching.
*/ */
const gchar * const gchar *
gedit_search_dialog_get_search_text (GeditSearchDialog *dialog) gedit_replace_dialog_get_search_text (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), NULL); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), NULL);
return gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry)); return gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry));
} }
void void
gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog, gedit_replace_dialog_set_replace_text (GeditReplaceDialog *dialog,
const gchar *text) const gchar *text)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
g_return_if_fail (text != NULL); g_return_if_fail (text != NULL);
gtk_entry_set_text (GTK_ENTRY (dialog->priv->replace_text_entry), gtk_entry_set_text (GTK_ENTRY (dialog->priv->replace_text_entry),
...@@ -407,81 +407,81 @@ gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog, ...@@ -407,81 +407,81 @@ gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog,
} }
const gchar * const gchar *
gedit_search_dialog_get_replace_text (GeditSearchDialog *dialog) gedit_replace_dialog_get_replace_text (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), NULL); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), NULL);
return gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry)); return gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry));
} }
void void
gedit_search_dialog_set_match_case (GeditSearchDialog *dialog, gedit_replace_dialog_set_match_case (GeditReplaceDialog *dialog,
gboolean match_case) gboolean match_case)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton),
match_case); match_case);
} }
gboolean gboolean
gedit_search_dialog_get_match_case (GeditSearchDialog *dialog) gedit_replace_dialog_get_match_case (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), FALSE);
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton)); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton));
} }
void void
gedit_search_dialog_set_entire_word (GeditSearchDialog *dialog, gedit_replace_dialog_set_entire_word (GeditReplaceDialog *dialog,
gboolean entire_word) gboolean entire_word)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton),
entire_word); entire_word);
} }
gboolean gboolean
gedit_search_dialog_get_entire_word (GeditSearchDialog *dialog) gedit_replace_dialog_get_entire_word (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), FALSE);
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton)); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton));
} }
void void
gedit_search_dialog_set_backwards (GeditSearchDialog *dialog, gedit_replace_dialog_set_backwards (GeditReplaceDialog *dialog,
gboolean backwards) gboolean backwards)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton),
backwards); backwards);
} }
gboolean gboolean
gedit_search_dialog_get_backwards (GeditSearchDialog *dialog) gedit_replace_dialog_get_backwards (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), FALSE);
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton)); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton));
} }
void void
gedit_search_dialog_set_wrap_around (GeditSearchDialog *dialog, gedit_replace_dialog_set_wrap_around (GeditReplaceDialog *dialog,
gboolean wrap_around) gboolean wrap_around)
{ {
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); g_return_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton),
wrap_around); wrap_around);
} }
gboolean gboolean
gedit_search_dialog_get_wrap_around (GeditSearchDialog *dialog) gedit_replace_dialog_get_wrap_around (GeditReplaceDialog *dialog)
{ {
g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); g_return_val_if_fail (GEDIT_IS_REPLACE_DIALOG (dialog), FALSE);
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton)); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton));
} }
......
/* /*
* gedit-search-dialog.h * gedit-replace-dialog.h
* This file is part of gedit * This file is part of gedit
* *
* Copyright (C) 2005 Paolo Maggi * Copyright (C) 2005 Paolo Maggi
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
* $Id$ * $Id$
*/ */
#ifndef __GEDIT_SEARCH_DIALOG_H__ #ifndef __GEDIT_REPLACE_DIALOG_H__
#define __GEDIT_SEARCH_DIALOG_H__ #define __GEDIT_REPLACE_DIALOG_H__
#include <gtk/gtk.h> #include <gtk/gtk.h>
...@@ -38,83 +38,83 @@ G_BEGIN_DECLS ...@@ -38,83 +38,83 @@ G_BEGIN_DECLS
/* /*
* Type checking and casting macros * Type checking and casting macros
*/ */
#define GEDIT_TYPE_SEARCH_DIALOG (gedit_search_dialog_get_type()) #define GEDIT_TYPE_REPLACE_DIALOG (gedit_replace_dialog_get_type())
#define GEDIT_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialog)) #define GEDIT_REPLACE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_REPLACE_DIALOG, GeditReplaceDialog))
#define GEDIT_SEARCH_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialog const)) #define GEDIT_REPLACE_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_REPLACE_DIALOG, GeditReplaceDialog const))
#define GEDIT_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialogClass)) #define GEDIT_REPLACE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_REPLACE_DIALOG, GeditReplaceDialogClass))
#define GEDIT_IS_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_SEARCH_DIALOG)) #define GEDIT_IS_REPLACE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_REPLACE_DIALOG))
#define GEDIT_IS_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SEARCH_DIALOG)) #define GEDIT_IS_REPLACE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_REPLACE_DIALOG))
#define GEDIT_SEARCH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialogClass)) #define GEDIT_REPLACE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_REPLACE_DIALOG, GeditReplaceDialogClass))
/* Private structure type */ /* Private structure type */
typedef struct _GeditSearchDialogPrivate GeditSearchDialogPrivate; typedef struct _GeditReplaceDialogPrivate GeditReplaceDialogPrivate;
/* /*
* Main object structure * Main object structure
*/ */
typedef struct _GeditSearchDialog GeditSearchDialog; typedef struct _GeditReplaceDialog GeditReplaceDialog;
struct _GeditSearchDialog struct _GeditReplaceDialog
{ {
GtkDialog dialog; GtkDialog dialog;
/*< private > */ /*< private > */
GeditSearchDialogPrivate *priv; GeditReplaceDialogPrivate *priv;
}; };
/* /*
* Class definition * Class definition
*/ */
typedef struct _GeditSearchDialogClass GeditSearchDialogClass; typedef struct _GeditReplaceDialogClass GeditReplaceDialogClass;
struct _GeditSearchDialogClass struct _GeditReplaceDialogClass
{ {
GtkDialogClass parent_class; GtkDialogClass parent_class;
}; };
enum enum
{ {
GEDIT_SEARCH_DIALOG_FIND_RESPONSE = 100, GEDIT_REPLACE_DIALOG_FIND_RESPONSE = 100,
GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, GEDIT_REPLACE_DIALOG_REPLACE_RESPONSE,
GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE GEDIT_REPLACE_DIALOG_REPLACE_ALL_RESPONSE
}; };
/* /*
* Public methods * Public methods
*/ */
GType gedit_search_dialog_get_type (void) G_GNUC_CONST; GType gedit_replace_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *gedit_search_dialog_new (GtkWindow *parent); GtkWidget *gedit_replace_dialog_new (GtkWindow *parent);
void gedit_search_dialog_present_with_time (GeditSearchDialog *dialog, void gedit_replace_dialog_present_with_time (GeditReplaceDialog *dialog,
guint32 timestamp); guint32 timestamp);
void gedit_search_dialog_set_search_text (GeditSearchDialog *dialog, void gedit_replace_dialog_set_search_text (GeditReplaceDialog *dialog,
const gchar *text); const gchar *text);
const gchar *gedit_search_dialog_get_search_text (GeditSearchDialog *dialog); const gchar *gedit_replace_dialog_get_search_text (GeditReplaceDialog *dialog);
void gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog, void gedit_replace_dialog_set_replace_text (GeditReplaceDialog *dialog,
const gchar *text); const gchar *text);
const gchar *gedit_search_dialog_get_replace_text (GeditSearchDialog *dialog); const gchar *gedit_replace_dialog_get_replace_text (GeditReplaceDialog *dialog);
void gedit_search_dialog_set_match_case (GeditSearchDialog *dialog, void gedit_replace_dialog_set_match_case (GeditReplaceDialog *dialog,
gboolean match_case); gboolean match_case);
gboolean gedit_search_dialog_get_match_case (GeditSearchDialog *dialog); gboolean gedit_replace_dialog_get_match_case (GeditReplaceDialog *dialog);
void gedit_search_dialog_set_entire_word (GeditSearchDialog *dialog, void gedit_replace_dialog_set_entire_word (GeditReplaceDialog *dialog,
gboolean entire_word); gboolean entire_word);
gboolean gedit_search_dialog_get_entire_word (GeditSearchDialog *dialog); gboolean gedit_replace_dialog_get_entire_word (GeditReplaceDialog *dialog);
void gedit_search_dialog_set_backwards (GeditSearchDialog *dialog, void gedit_replace_dialog_set_backwards (GeditReplaceDialog *dialog,
gboolean backwards); gboolean backwards);
gboolean gedit_search_dialog_get_backwards (GeditSearchDialog *dialog); gboolean gedit_replace_dialog_get_backwards (GeditReplaceDialog *dialog);
void gedit_search_dialog_set_wrap_around (GeditSearchDialog *dialog, void gedit_replace_dialog_set_wrap_around (GeditReplaceDialog *dialog,
gboolean wrap_around); gboolean wrap_around);
gboolean gedit_search_dialog_get_wrap_around (GeditSearchDialog *dialog); gboolean gedit_replace_dialog_get_wrap_around (GeditReplaceDialog *dialog);
G_END_DECLS G_END_DECLS
#endif /* __GEDIT_SEARCH_DIALOG_H__ */ #endif /* __GEDIT_REPLACE_DIALOG_H__ */
/* ex:ts=8:noet: */ /* ex:ts=8:noet: */
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
#include "gedit-window.h" #include "gedit-window.h"
#include "gedit-window-private.h" #include "gedit-window-private.h"
#include "gedit-utils.h" #include "gedit-utils.h"
#include "dialogs/gedit-search-dialog.h" #include "dialogs/gedit-replace-dialog.h"
#define GEDIT_SEARCH_DIALOG_KEY "gedit-search-dialog-key" #define GEDIT_REPLACE_DIALOG_KEY "gedit-replace-dialog-key"
#define GEDIT_LAST_SEARCH_DATA_KEY "gedit-last-search-data-key" #define GEDIT_LAST_SEARCH_DATA_KEY "gedit-last-search-data-key"
typedef struct _LastSearchData LastSearchData; typedef struct _LastSearchData LastSearchData;
...@@ -64,7 +64,7 @@ last_search_data_free (LastSearchData *data) ...@@ -64,7 +64,7 @@ last_search_data_free (LastSearchData *data)
} }
static void static void
last_search_data_restore_position (GeditSearchDialog *dlg) last_search_data_restore_position (GeditReplaceDialog *dlg)