From 4d3bb22d33ea44aaacb8b45163ecb2cac3703d50 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 23 Oct 2012 01:49:27 +0200 Subject: [PATCH] Rename edit window to detail window It won't function as an edit window much longer. --- src/Makefile.am | 2 +- ...{eom-edit-window.c => eom-detail-window.c} | 31 ++++++++++--------- ...{eom-edit-window.h => eom-detail-window.h} | 28 ++++++++--------- src/eom-main-window.c | 2 +- src/interface.c | 6 ++-- src/interface.h | 2 +- 6 files changed, 36 insertions(+), 35 deletions(-) rename src/{eom-edit-window.c => eom-detail-window.c} (91%) rename src/{eom-edit-window.h => eom-detail-window.h} (64%) diff --git a/src/Makefile.am b/src/Makefile.am index 18afa27..4fdcd55 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = eye-on-manga eye_on_manga_SOURCES = \ data.c data.h \ eom.c eom.h \ - eom-edit-window.c eom-edit-window.h \ + eom-detail-window.c eom-detail-window.h \ eom-main-window.c eom-main-window.h \ eom-new-item-dialog.c eom-new-item-dialog.h \ interface.c interface.h diff --git a/src/eom-edit-window.c b/src/eom-detail-window.c similarity index 91% rename from src/eom-edit-window.c rename to src/eom-detail-window.c index 1a11cb1..8426831 100644 --- a/src/eom-edit-window.c +++ b/src/eom-detail-window.c @@ -1,4 +1,4 @@ -#include "eom-edit-window.h" +#include "eom-detail-window.h" #include #include @@ -16,19 +16,20 @@ enum { }; static GtkWidget *create_volume_button(gchar*, GtkTable*, int, int); -static void eom_edit_window_class_init(EomEditWindowClass*); -static void eom_edit_window_init(EomEditWindow *self); +static void eom_detail_window_class_init(EomDetailWindowClass*); +static void eom_detail_window_init(EomDetailWindow *self); static void finalize(GObject*); static void get_property(GObject*, guint, GValue*, GParamSpec*); static void on_volume_read_toggled(GtkToggleButton*, gpointer); static void on_volume_toggled(GtkToggleButton*, gpointer); -static void set_manga_id(EomEditWindow*, gint); +static void set_manga_id(EomDetailWindow*, gint); static void set_property(GObject*, guint, const GValue*, GParamSpec*); -G_DEFINE_TYPE(EomEditWindow, eom_edit_window, HILDON_TYPE_STACKABLE_WINDOW) +G_DEFINE_TYPE(EomDetailWindow, eom_detail_window, + HILDON_TYPE_STACKABLE_WINDOW) GtkWidget * -eom_edit_window_new(gint manga_id) +eom_detail_window_new(gint manga_id) { return g_object_new(EOM_TYPE_EDIT_WINDOW, "manga-id", manga_id, @@ -54,7 +55,7 @@ create_volume_button(gchar* text, GtkTable* table, int column, int row) } static void -eom_edit_window_class_init(EomEditWindowClass *klass) +eom_detail_window_class_init(EomDetailWindowClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GParamSpec *pspec; @@ -71,7 +72,7 @@ eom_edit_window_class_init(EomEditWindowClass *klass) } static void -eom_edit_window_init(EomEditWindow *self) +eom_detail_window_init(EomDetailWindow *self) { GtkWidget *panarea; GtkWidget *table; @@ -133,18 +134,18 @@ eom_edit_window_init(EomEditWindow *self) static void finalize(GObject *object) { - EomEditWindow *self = EOM_EDIT_WINDOW(object); + EomDetailWindow *self = EOM_DETAIL_WINDOW(object); g_free(self->manga); - G_OBJECT_CLASS(eom_edit_window_parent_class)->finalize(object); + G_OBJECT_CLASS(eom_detail_window_parent_class)->finalize(object); } static void get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - EomEditWindow *self = EOM_EDIT_WINDOW(object); + EomDetailWindow *self = EOM_DETAIL_WINDOW(object); switch (property_id) { case EOM_EDIT_PROP_CID: @@ -159,7 +160,7 @@ get_property(GObject *object, guint property_id, GValue *value, static void on_volume_read_toggled(GtkToggleButton *togglebutton, gpointer user_data) { - EomEditWindow *self = (EomEditWindow *)user_data; + EomDetailWindow *self = (EomDetailWindow *)user_data; gboolean active = gtk_toggle_button_get_active(togglebutton); gint volume = atoi(gtk_button_get_label(GTK_BUTTON(togglebutton))); @@ -170,7 +171,7 @@ on_volume_read_toggled(GtkToggleButton *togglebutton, gpointer user_data) static void on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data) { - EomEditWindow *self = (EomEditWindow *)user_data; + EomDetailWindow *self = (EomDetailWindow *)user_data; gboolean active = gtk_toggle_button_get_active(togglebutton); gint volume = atoi(gtk_button_get_label(GTK_BUTTON(togglebutton))); gchar *txt; @@ -205,7 +206,7 @@ on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data) } static void -set_manga_id(EomEditWindow *self, gint manga_id) +set_manga_id(EomDetailWindow *self, gint manga_id) { GtkWidget *bbox; GtkWidget *clabel, *rlabel; @@ -283,7 +284,7 @@ static void set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { - EomEditWindow *self = EOM_EDIT_WINDOW(object); + EomDetailWindow *self = EOM_DETAIL_WINDOW(object); gint manga_id = g_value_get_int(value); switch (property_id) { diff --git a/src/eom-edit-window.h b/src/eom-detail-window.h similarity index 64% rename from src/eom-edit-window.h rename to src/eom-detail-window.h index 52cf886..0230438 100644 --- a/src/eom-edit-window.h +++ b/src/eom-detail-window.h @@ -1,5 +1,5 @@ -#ifndef __EOM_EDIT_WINDOW_H__ -#define __EOM_EDIT_WINDOW_H__ +#ifndef __EOM_DETAIL_WINDOW_H__ +#define __EOM_DETAIL_WINDOW_H__ #include @@ -8,17 +8,17 @@ G_BEGIN_DECLS #define EOM_TYPE_EDIT_WINDOW \ - (eom_edit_window_get_type()) + (eom_detail_window_get_type()) -#define EOM_EDIT_WINDOW(obj) \ +#define EOM_DETAIL_WINDOW(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EOM_TYPE_EDIT_WINDOW, \ - EomEditWindow)) + EomDetailWindow)) -#define EOM_EDIT_WINDOW_CLASS(klass) \ +#define EOM_DETAIL_WINDOW_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EOM_TYPE_EDIT_WINDOW, \ - EomEditWindowClass)) + EomDetailWindowClass)) #define EOM_IS_EDIT_WINDOW(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ @@ -28,15 +28,15 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EOM_TYPE_EDIT_WINDOW)) -#define EOM_EDIT_WINDOW_GET_CLASS(obj) \ +#define EOM_DETAIL_WINDOW_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EOM_TYPE_EDIT_WINDOW, \ - EomEditWindowClass)) + EomDetailWindowClass)) typedef struct { HildonStackableWindowClass parent_class; -} EomEditWindowClass; +} EomDetailWindowClass; typedef struct { @@ -48,11 +48,11 @@ typedef struct GtkWidget *volsbox; Manga *manga; -} EomEditWindow; +} EomDetailWindow; -GType eom_edit_window_get_type(void); -GtkWidget *eom_edit_window_new(gint); +GType eom_detail_window_get_type(void); +GtkWidget *eom_detail_window_new(gint); G_END_DECLS -#endif /* __EOM_EDIT_WINDOW_H__ */ +#endif /* __EOM_DETAIL_WINDOW_H__ */ diff --git a/src/eom-main-window.c b/src/eom-main-window.c index 1183972..67d0429 100644 --- a/src/eom-main-window.c +++ b/src/eom-main-window.c @@ -274,7 +274,7 @@ on_row_activated(GtkWidget *treeview, GtkTreePath *path, return; gtk_tree_model_get(model, &iter, COL_ID, &id, -1); - window = interface_show_edit_window(id); + window = interface_show_detail_window(id); g_signal_connect(window, "delete-event", G_CALLBACK(on_edit_closed), self); } diff --git a/src/interface.c b/src/interface.c index aa8b5b3..4483c07 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,7 +1,7 @@ #include #include "interface.h" #include "eom-main-window.h" -#include "eom-edit-window.h" +#include "eom-detail-window.h" #include "eom-new-item-dialog.h" #include "data.h" @@ -15,11 +15,11 @@ void interface_show_main_window(void) eom_main_window_load(EOM_MAIN_WINDOW(window)); } -GtkWidget *interface_show_edit_window(gint manga_id) +GtkWidget *interface_show_detail_window(gint manga_id) { GtkWidget *window; - window = eom_edit_window_new(manga_id); + window = eom_detail_window_new(manga_id); gtk_widget_show_all(window); return window; diff --git a/src/interface.h b/src/interface.h index a62e34a..a49519d 100644 --- a/src/interface.h +++ b/src/interface.h @@ -1,5 +1,5 @@ #include void interface_show_main_window(void); -GtkWidget *interface_show_edit_window(gint manga_id); +GtkWidget *interface_show_detail_window(gint manga_id); GtkWidget *interface_show_new_item_dialog(GtkWindow *window);