[epiphany] Rename EphyHistoryWindow to EphyHistoryDialog



commit 17ac264643b4ea3f1ad15e60632e40be197b32cb
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Jan 16 19:25:48 2017 -0600

    Rename EphyHistoryWindow to EphyHistoryDialog

 TODO                                               |    1 -
 src/Makefile.am                                    |    4 +-
 ...ephy-history-window.c => ephy-history-dialog.c} |  106 ++++++++++----------
 ...ephy-history-window.h => ephy-history-dialog.h} |    6 +-
 src/ephy-shell.c                                   |   20 ++--
 src/ephy-shell.h                                   |    2 +-
 src/resources/gtk/history-dialog.ui                |    2 +-
 src/window-commands.c                              |   12 +-
 8 files changed, 76 insertions(+), 77 deletions(-)
---
diff --git a/TODO b/TODO
index acfe9b6..840022f 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,5 @@
 Some TODO items, in no particular order:
 
-- Rename EphyHistoryWindow -> EphyHistoryDialog
 - Rename all classes that lack the Ephy namespace
 - Use g_signal_emit instead of g_signal_emit_by_name
 - Use GDK_EVENT_PROPAGATE/GDK_EVENT_STOP.
diff --git a/src/Makefile.am b/src/Makefile.am
index 1f0d1f5..d860d82 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,8 +48,8 @@ libephymain_la_SOURCES = \
        ephy-encoding-row.h                     \
        ephy-header-bar.c                       \
        ephy-header-bar.h                       \
-       ephy-history-window.c                   \
-       ephy-history-window.h                   \
+       ephy-history-dialog.c                   \
+       ephy-history-dialog.h                   \
        ephy-link.c                             \
        ephy-link.h                             \
        ephy-location-controller.c              \
diff --git a/src/ephy-history-window.c b/src/ephy-history-dialog.c
similarity index 89%
rename from src/ephy-history-window.c
rename to src/ephy-history-dialog.c
index 4bc4094..5295322 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-dialog.c
@@ -21,7 +21,7 @@
  */
 
 #include "config.h"
-#include "ephy-history-window.h"
+#include "ephy-history-dialog.h"
 
 #include "ephy-debug.h"
 #include "ephy-gui.h"
@@ -41,7 +41,7 @@
 /* 3/5 of gdkframeclockidle.c's FRAME_INTERVAL (16667 microsecs) */
 #define GTK_TREE_VIEW_TIME_MS_PER_IDLE 10
 
-struct _EphyHistoryWindow {
+struct _EphyHistoryDialog {
   GtkDialog parent_instance;
 
   EphyHistoryService *history_service;
@@ -70,7 +70,7 @@ struct _EphyHistoryWindow {
   GtkWidget *confirmation_dialog;
 };
 
-G_DEFINE_TYPE (EphyHistoryWindow, ephy_history_window, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE (EphyHistoryDialog, ephy_history_dialog, GTK_TYPE_DIALOG)
 
 enum {
   PROP_0,
@@ -84,10 +84,10 @@ typedef enum {
   COLUMN_DATE,
   COLUMN_NAME,
   COLUMN_LOCATION
-} EphyHistoryWindowColumns;
+} EphyHistoryDialogColumns;
 
 static gboolean
-add_urls_source (EphyHistoryWindow *self)
+add_urls_source (EphyHistoryDialog *self)
 {
   EphyHistoryURL *url;
   GTimer *timer;
@@ -127,7 +127,7 @@ on_find_urls_cb (gpointer service,
                  gpointer result_data,
                  gpointer user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
   GtkTreeViewColumn *column;
 
   if (success != TRUE)
@@ -147,7 +147,7 @@ on_find_urls_cb (gpointer service,
 }
 
 static GList *
-substrings_filter (EphyHistoryWindow *self)
+substrings_filter (EphyHistoryDialog *self)
 {
   char **tokens, **p;
   GList *substrings = NULL;
@@ -167,7 +167,7 @@ substrings_filter (EphyHistoryWindow *self)
 }
 
 static void
-remove_pending_sorter_source (EphyHistoryWindow *self)
+remove_pending_sorter_source (EphyHistoryDialog *self)
 {
   if (self->sorter_source != 0) {
     g_source_remove (self->sorter_source);
@@ -181,7 +181,7 @@ remove_pending_sorter_source (EphyHistoryWindow *self)
 }
 
 static void
-filter_now (EphyHistoryWindow *self)
+filter_now (EphyHistoryDialog *self)
 {
   gint64 from, to;
   GList *substrings;
@@ -219,7 +219,7 @@ filter_now (EphyHistoryWindow *self)
 static void
 confirmation_dialog_response_cb (GtkWidget         *dialog,
                                  int                response,
-                                 EphyHistoryWindow *self)
+                                 EphyHistoryDialog *self)
 {
   gtk_widget_destroy (dialog);
 
@@ -231,7 +231,7 @@ confirmation_dialog_response_cb (GtkWidget         *dialog,
 }
 
 static GtkWidget *
-confirmation_dialog_construct (EphyHistoryWindow *self)
+confirmation_dialog_construct (EphyHistoryDialog *self)
 {
   GtkWidget *dialog, *button;
 
@@ -268,7 +268,7 @@ forget_all (GSimpleAction *action,
             GVariant      *parameter,
             gpointer       user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
 
   if (self->confirmation_dialog == NULL) {
     GtkWidget **confirmation_dialog;
@@ -283,7 +283,7 @@ forget_all (GSimpleAction *action,
 }
 
 static GtkWidget *
-get_target_window (EphyHistoryWindow *self)
+get_target_window (EphyHistoryDialog *self)
 {
     return GTK_WIDGET (gtk_application_get_active_window (GTK_APPLICATION (ephy_shell_get_default ())));
 }
@@ -294,7 +294,7 @@ on_browse_history_deleted_cb (gpointer service,
                               gpointer result_data,
                               gpointer user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
 
   if (success != TRUE)
     return;
@@ -332,7 +332,7 @@ get_selection_foreach (GtkTreeModel *model,
 }
 
 static GList *
-get_selection (EphyHistoryWindow *self)
+get_selection (EphyHistoryDialog *self)
 {
   GList *list = NULL;
 
@@ -344,7 +344,7 @@ get_selection (EphyHistoryWindow *self)
 }
 
 static void
-delete_selected (EphyHistoryWindow *self)
+delete_selected (EphyHistoryDialog *self)
 {
   GList *selected;
 
@@ -358,7 +358,7 @@ open_selection (GSimpleAction *action,
                 GVariant      *parameter,
                 gpointer       user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
   EphyWindow *window;
   GList *selection;
   GList *l;
@@ -383,7 +383,7 @@ copy_url (GSimpleAction *action,
           GVariant      *parameter,
           gpointer       user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
   GList *selection;
 
   selection = get_selection (self);
@@ -402,7 +402,7 @@ forget (GSimpleAction *action,
         GVariant      *parameter,
         gpointer       user_data)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (user_data);
 
   delete_selected (self);
 }
@@ -410,7 +410,7 @@ forget (GSimpleAction *action,
 static gboolean
 on_treeview_key_press_event (GtkWidget         *widget,
                              GdkEventKey       *event,
-                             EphyHistoryWindow *self)
+                             EphyHistoryDialog *self)
 {
   if (event->keyval == GDK_KEY_Delete || event->keyval == GDK_KEY_KP_Delete) {
     delete_selected (self);
@@ -435,7 +435,7 @@ update_popup_menu_actions (GActionGroup *action_group,
 static gboolean
 on_treeview_button_press_event (GtkWidget         *widget,
                                 GdkEventButton    *event,
-                                EphyHistoryWindow *self)
+                                EphyHistoryDialog *self)
 {
   if (event->button == 3) {
     int n;
@@ -460,7 +460,7 @@ static void
 on_treeview_row_activated (GtkTreeView       *view,
                            GtkTreePath       *path,
                            GtkTreeViewColumn *col,
-                           EphyHistoryWindow *self)
+                           EphyHistoryDialog *self)
 {
   EphyWindow *window;
   EphyHistoryURL *url;
@@ -479,7 +479,7 @@ on_treeview_row_activated (GtkTreeView       *view,
 
 static void
 on_search_entry_changed (GtkSearchEntry    *entry,
-                         EphyHistoryWindow *self)
+                         EphyHistoryDialog *self)
 {
   const char *text;
 
@@ -493,7 +493,7 @@ on_search_entry_changed (GtkSearchEntry    *entry,
 static gboolean
 on_search_key_press_event (GtkWidget        *widget,
                           GdkEventKey       *event,
-                          EphyHistoryWindow *self)
+                          EphyHistoryDialog *self)
 {
   if (event->keyval == GDK_KEY_Escape) {
     g_signal_emit_by_name (self, "close", NULL);
@@ -519,7 +519,7 @@ update_selection_actions (GActionGroup *action_group,
 
 static void
 on_treeview_selection_changed (GtkTreeSelection  *selection,
-                               EphyHistoryWindow *self)
+                               EphyHistoryDialog *self)
 {
   update_selection_actions (self->action_group,
                             gtk_tree_selection_count_selected_rows (selection) > 0);
@@ -527,7 +527,7 @@ on_treeview_selection_changed (GtkTreeSelection  *selection,
 
 static void
 on_treeview_column_clicked_event (GtkTreeViewColumn *column,
-                                  EphyHistoryWindow *self)
+                                  EphyHistoryDialog *self)
 {
   GtkTreeViewColumn *previous_sortby;
   gint new_sort_column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (column), "column"));
@@ -549,7 +549,7 @@ on_treeview_column_clicked_event (GtkTreeViewColumn *column,
 
 static gboolean
 on_urls_visited_cb (EphyHistoryService *service,
-                    EphyHistoryWindow  *self)
+                    EphyHistoryDialog  *self)
 {
   filter_now (self);
 
@@ -557,7 +557,7 @@ on_urls_visited_cb (EphyHistoryService *service,
 }
 
 static void
-set_history_service (EphyHistoryWindow  *self,
+set_history_service (EphyHistoryDialog  *self,
                      EphyHistoryService *history_service)
 {
   if (history_service == self->history_service)
@@ -581,12 +581,12 @@ set_history_service (EphyHistoryWindow  *self,
 }
 
 static void
-ephy_history_window_set_property (GObject      *object,
+ephy_history_dialog_set_property (GObject      *object,
                                   guint         prop_id,
                                   const GValue *value,
                                   GParamSpec   *pspec)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (object);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (object);
 
   switch (prop_id) {
     case PROP_HISTORY_SERVICE:
@@ -599,12 +599,12 @@ ephy_history_window_set_property (GObject      *object,
 }
 
 static void
-ephy_history_window_get_property (GObject    *object,
+ephy_history_dialog_get_property (GObject    *object,
                                   guint       prop_id,
                                   GValue     *value,
                                   GParamSpec *pspec)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (object);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (object);
 
   switch (prop_id) {
     case PROP_HISTORY_SERVICE:
@@ -617,9 +617,9 @@ ephy_history_window_get_property (GObject    *object,
 }
 
 static void
-ephy_history_window_dispose (GObject *object)
+ephy_history_dialog_dispose (GObject *object)
 {
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (object);
+  EphyHistoryDialog *self = EPHY_HISTORY_DIALOG (object);
 
   g_free (self->search_text);
   self->search_text = NULL;
@@ -637,18 +637,18 @@ ephy_history_window_dispose (GObject *object)
 
   remove_pending_sorter_source (self);
 
-  G_OBJECT_CLASS (ephy_history_window_parent_class)->dispose (object);
+  G_OBJECT_CLASS (ephy_history_dialog_parent_class)->dispose (object);
 }
 
 static void
-ephy_history_window_class_init (EphyHistoryWindowClass *klass)
+ephy_history_dialog_class_init (EphyHistoryDialogClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->set_property = ephy_history_window_set_property;
-  object_class->get_property = ephy_history_window_get_property;
-  object_class->dispose = ephy_history_window_dispose;
+  object_class->set_property = ephy_history_dialog_set_property;
+  object_class->get_property = ephy_history_dialog_get_property;
+  object_class->dispose = ephy_history_dialog_dispose;
 
   obj_properties[PROP_HISTORY_SERVICE] =
     g_param_spec_object ("history-service",
@@ -661,15 +661,15 @@ ephy_history_window_class_init (EphyHistoryWindowClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class,
                                                "/org/gnome/epiphany/gtk/history-dialog.ui");
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, liststore);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, treeview);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, tree_selection);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, date_column);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, name_column);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, location_column);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, date_renderer);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, location_renderer);
-  gtk_widget_class_bind_template_child (widget_class, EphyHistoryWindow, treeview_popup_menu_model);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, liststore);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, treeview);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, tree_selection);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, date_column);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, name_column);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, location_column);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, date_renderer);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, location_renderer);
+  gtk_widget_class_bind_template_child (widget_class, EphyHistoryDialog, treeview_popup_menu_model);
 
   gtk_widget_class_bind_template_callback (widget_class, on_treeview_row_activated);
   gtk_widget_class_bind_template_callback (widget_class, on_treeview_key_press_event);
@@ -727,13 +727,13 @@ convert_location_data_func (GtkTreeViewColumn *column,
 }
 
 GtkWidget *
-ephy_history_window_new (EphyHistoryService *history_service)
+ephy_history_dialog_new (EphyHistoryService *history_service)
 {
-  EphyHistoryWindow *self;
+  EphyHistoryDialog *self;
 
   g_return_val_if_fail (history_service != NULL, NULL);
 
-  self = g_object_new (EPHY_TYPE_HISTORY_WINDOW,
+  self = g_object_new (EPHY_TYPE_HISTORY_DIALOG,
                        "use-header-bar", TRUE,
                        "history-service", history_service,
                        NULL);
@@ -742,7 +742,7 @@ ephy_history_window_new (EphyHistoryService *history_service)
 }
 
 static GActionGroup *
-create_action_group (EphyHistoryWindow *self)
+create_action_group (EphyHistoryDialog *self)
 {
   const GActionEntry entries[] = {
     { "open-selection", open_selection },
@@ -759,7 +759,7 @@ create_action_group (EphyHistoryWindow *self)
 }
 
 static void
-ephy_history_window_init (EphyHistoryWindow *self)
+ephy_history_dialog_init (EphyHistoryDialog *self)
 {
   gtk_widget_init_template (GTK_WIDGET (self));
 
diff --git a/src/ephy-history-window.h b/src/ephy-history-dialog.h
similarity index 81%
rename from src/ephy-history-window.h
rename to src/ephy-history-dialog.h
index f7fe6df..d32ba79 100644
--- a/src/ephy-history-window.h
+++ b/src/ephy-history-dialog.h
@@ -26,10 +26,10 @@
 
 G_BEGIN_DECLS
 
-#define EPHY_TYPE_HISTORY_WINDOW (ephy_history_window_get_type ())
+#define EPHY_TYPE_HISTORY_DIALOG (ephy_history_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (EphyHistoryWindow, ephy_history_window, EPHY, HISTORY_WINDOW, GtkDialog)
+G_DECLARE_FINAL_TYPE (EphyHistoryDialog, ephy_history_dialog, EPHY, HISTORY_DIALOG, GtkDialog)
 
-GtkWidget      *ephy_history_window_new        (EphyHistoryService *history_service);
+GtkWidget      *ephy_history_dialog_new        (EphyHistoryService *history_service);
 
 G_END_DECLS
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index c2cd61c..57c6a66 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -30,7 +30,7 @@
 #include "ephy-file-helpers.h"
 #include "ephy-gui.h"
 #include "ephy-header-bar.h"
-#include "ephy-history-window.h"
+#include "ephy-history-dialog.h"
 #include "ephy-lockdown.h"
 #include "ephy-prefs.h"
 #include "ephy-session.h"
@@ -62,7 +62,7 @@ struct _EphyShell {
   GObject *lockdown;
   EphyBookmarksManager *bookmarks_manager;
   GNetworkMonitor *network_monitor;
-  GtkWidget *history_window;
+  GtkWidget *history_dialog;
   GObject *prefs_dialog;
   EphyShellStartupContext *local_startup_context;
   EphyShellStartupContext *remote_startup_context;
@@ -643,7 +643,7 @@ ephy_shell_dispose (GObject *object)
 
   g_clear_object (&shell->session);
   g_clear_object (&shell->lockdown);
-  g_clear_pointer (&shell->history_window, gtk_widget_destroy);
+  g_clear_pointer (&shell->history_dialog, gtk_widget_destroy);
   g_clear_object (&shell->prefs_dialog);
   g_clear_object (&shell->network_monitor);
 #ifdef ENABLE_SYNC
@@ -847,29 +847,29 @@ ephy_shell_get_net_monitor (EphyShell *shell)
 }
 
 /**
- * ephy_shell_get_history_window:
+ * ephy_shell_get_history_dialog:
  *
  * Return value: (transfer none):
  **/
 GtkWidget *
-ephy_shell_get_history_window (EphyShell *shell)
+ephy_shell_get_history_dialog (EphyShell *shell)
 {
   EphyEmbedShell *embed_shell;
   EphyHistoryService *service;
 
   embed_shell = ephy_embed_shell_get_default ();
 
-  if (shell->history_window == NULL) {
+  if (shell->history_dialog == NULL) {
     service = EPHY_HISTORY_SERVICE
                 (ephy_embed_shell_get_global_history_service (embed_shell));
-    shell->history_window = ephy_history_window_new (service);
-    g_signal_connect (shell->history_window,
+    shell->history_dialog = ephy_history_dialog_new (service);
+    g_signal_connect (shell->history_dialog,
                       "destroy",
                       G_CALLBACK (gtk_widget_destroyed),
-                      &shell->history_window);
+                      &shell->history_dialog);
   }
 
-  return shell->history_window;
+  return shell->history_dialog;
 }
 
 /**
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index 7cbe0ee..9e86fa6 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -109,7 +109,7 @@ EphyBookmarksManager *ephy_shell_get_bookmarks_manager   (EphyShell *shell);
 EphySyncService *ephy_shell_get_sync_service             (EphyShell *shell);
 #endif
 
-GtkWidget       *ephy_shell_get_history_window           (EphyShell *shell);
+GtkWidget       *ephy_shell_get_history_dialog           (EphyShell *shell);
 
 GObject         *ephy_shell_get_prefs_dialog             (EphyShell *shell);
 
diff --git a/src/resources/gtk/history-dialog.ui b/src/resources/gtk/history-dialog.ui
index e269c35..e9f57f4 100644
--- a/src/resources/gtk/history-dialog.ui
+++ b/src/resources/gtk/history-dialog.ui
@@ -27,7 +27,7 @@
       </item>
     </section>
   </menu>
-  <template class="EphyHistoryWindow" parent="GtkDialog">
+  <template class="EphyHistoryDialog" parent="GtkDialog">
     <property name="height_request">500</property>
     <property name="modal">True</property>
     <property name="window_position">center</property>
diff --git a/src/window-commands.c b/src/window-commands.c
index 5559841..d92af68 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -42,7 +42,7 @@
 #include "ephy-find-toolbar.h"
 #include "ephy-gui.h"
 #include "ephy-header-bar.h"
-#include "ephy-history-window.h"
+#include "ephy-history-dialog.h"
 #include "ephy-link.h"
 #include "ephy-location-entry.h"
 #include "ephy-notebook.h"
@@ -500,14 +500,14 @@ window_cmd_show_history (GSimpleAction *action,
                          GVariant      *parameter,
                          gpointer       user_data)
 {
-  GtkWidget *hwindow;
+  GtkWidget *dialog;
 
-  hwindow = ephy_shell_get_history_window (ephy_shell_get_default ());
+  dialog = ephy_shell_get_history_dialog (ephy_shell_get_default ());
 
-  if (GTK_WINDOW (user_data) != gtk_window_get_transient_for (GTK_WINDOW (hwindow)))
-    gtk_window_set_transient_for (GTK_WINDOW (hwindow),
+  if (GTK_WINDOW (user_data) != gtk_window_get_transient_for (GTK_WINDOW (dialog)))
+    gtk_window_set_transient_for (GTK_WINDOW (dialog),
                                   GTK_WINDOW (user_data));
-  gtk_window_present (GTK_WINDOW (hwindow));
+  gtk_window_present (GTK_WINDOW (dialog));
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]