Rename edit window to detail window

It won't function as an edit window much longer.
This commit is contained in:
Tom Willemsen 2012-10-23 01:49:27 +02:00
parent ca2dd74798
commit 4d3bb22d33
6 changed files with 36 additions and 35 deletions

View file

@ -3,7 +3,7 @@ bin_PROGRAMS = eye-on-manga
eye_on_manga_SOURCES = \ eye_on_manga_SOURCES = \
data.c data.h \ data.c data.h \
eom.c eom.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-main-window.c eom-main-window.h \
eom-new-item-dialog.c eom-new-item-dialog.h \ eom-new-item-dialog.c eom-new-item-dialog.h \
interface.c interface.h interface.c interface.h

View file

@ -1,4 +1,4 @@
#include "eom-edit-window.h" #include "eom-detail-window.h"
#include <hildon/hildon.h> #include <hildon/hildon.h>
#include <limits.h> #include <limits.h>
@ -16,19 +16,20 @@ enum {
}; };
static GtkWidget *create_volume_button(gchar*, GtkTable*, int, int); static GtkWidget *create_volume_button(gchar*, GtkTable*, int, int);
static void eom_edit_window_class_init(EomEditWindowClass*); static void eom_detail_window_class_init(EomDetailWindowClass*);
static void eom_edit_window_init(EomEditWindow *self); static void eom_detail_window_init(EomDetailWindow *self);
static void finalize(GObject*); static void finalize(GObject*);
static void get_property(GObject*, guint, GValue*, GParamSpec*); static void get_property(GObject*, guint, GValue*, GParamSpec*);
static void on_volume_read_toggled(GtkToggleButton*, gpointer); static void on_volume_read_toggled(GtkToggleButton*, gpointer);
static void on_volume_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*); 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 * GtkWidget *
eom_edit_window_new(gint manga_id) eom_detail_window_new(gint manga_id)
{ {
return g_object_new(EOM_TYPE_EDIT_WINDOW, return g_object_new(EOM_TYPE_EDIT_WINDOW,
"manga-id", manga_id, "manga-id", manga_id,
@ -54,7 +55,7 @@ create_volume_button(gchar* text, GtkTable* table, int column, int row)
} }
static void static void
eom_edit_window_class_init(EomEditWindowClass *klass) eom_detail_window_class_init(EomDetailWindowClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
GParamSpec *pspec; GParamSpec *pspec;
@ -71,7 +72,7 @@ eom_edit_window_class_init(EomEditWindowClass *klass)
} }
static void static void
eom_edit_window_init(EomEditWindow *self) eom_detail_window_init(EomDetailWindow *self)
{ {
GtkWidget *panarea; GtkWidget *panarea;
GtkWidget *table; GtkWidget *table;
@ -133,18 +134,18 @@ eom_edit_window_init(EomEditWindow *self)
static void static void
finalize(GObject *object) finalize(GObject *object)
{ {
EomEditWindow *self = EOM_EDIT_WINDOW(object); EomDetailWindow *self = EOM_DETAIL_WINDOW(object);
g_free(self->manga); 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 static void
get_property(GObject *object, guint property_id, GValue *value, get_property(GObject *object, guint property_id, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
EomEditWindow *self = EOM_EDIT_WINDOW(object); EomDetailWindow *self = EOM_DETAIL_WINDOW(object);
switch (property_id) { switch (property_id) {
case EOM_EDIT_PROP_CID: case EOM_EDIT_PROP_CID:
@ -159,7 +160,7 @@ get_property(GObject *object, guint property_id, GValue *value,
static void static void
on_volume_read_toggled(GtkToggleButton *togglebutton, gpointer user_data) 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); gboolean active = gtk_toggle_button_get_active(togglebutton);
gint volume = atoi(gtk_button_get_label(GTK_BUTTON(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 static void
on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data) 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); gboolean active = gtk_toggle_button_get_active(togglebutton);
gint volume = atoi(gtk_button_get_label(GTK_BUTTON(togglebutton))); gint volume = atoi(gtk_button_get_label(GTK_BUTTON(togglebutton)));
gchar *txt; gchar *txt;
@ -205,7 +206,7 @@ on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data)
} }
static void static void
set_manga_id(EomEditWindow *self, gint manga_id) set_manga_id(EomDetailWindow *self, gint manga_id)
{ {
GtkWidget *bbox; GtkWidget *bbox;
GtkWidget *clabel, *rlabel; GtkWidget *clabel, *rlabel;
@ -283,7 +284,7 @@ static void
set_property(GObject *object, guint property_id, const GValue *value, set_property(GObject *object, guint property_id, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
EomEditWindow *self = EOM_EDIT_WINDOW(object); EomDetailWindow *self = EOM_DETAIL_WINDOW(object);
gint manga_id = g_value_get_int(value); gint manga_id = g_value_get_int(value);
switch (property_id) { switch (property_id) {

View file

@ -1,5 +1,5 @@
#ifndef __EOM_EDIT_WINDOW_H__ #ifndef __EOM_DETAIL_WINDOW_H__
#define __EOM_EDIT_WINDOW_H__ #define __EOM_DETAIL_WINDOW_H__
#include <hildon/hildon-stackable-window.h> #include <hildon/hildon-stackable-window.h>
@ -8,17 +8,17 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define EOM_TYPE_EDIT_WINDOW \ #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), \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
EOM_TYPE_EDIT_WINDOW, \ EOM_TYPE_EDIT_WINDOW, \
EomEditWindow)) EomDetailWindow))
#define EOM_EDIT_WINDOW_CLASS(klass) \ #define EOM_DETAIL_WINDOW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \ (G_TYPE_CHECK_CLASS_CAST ((klass), \
EOM_TYPE_EDIT_WINDOW, \ EOM_TYPE_EDIT_WINDOW, \
EomEditWindowClass)) EomDetailWindowClass))
#define EOM_IS_EDIT_WINDOW(obj) \ #define EOM_IS_EDIT_WINDOW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
@ -28,15 +28,15 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
EOM_TYPE_EDIT_WINDOW)) EOM_TYPE_EDIT_WINDOW))
#define EOM_EDIT_WINDOW_GET_CLASS(obj) \ #define EOM_DETAIL_WINDOW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
EOM_TYPE_EDIT_WINDOW, \ EOM_TYPE_EDIT_WINDOW, \
EomEditWindowClass)) EomDetailWindowClass))
typedef struct typedef struct
{ {
HildonStackableWindowClass parent_class; HildonStackableWindowClass parent_class;
} EomEditWindowClass; } EomDetailWindowClass;
typedef struct typedef struct
{ {
@ -48,11 +48,11 @@ typedef struct
GtkWidget *volsbox; GtkWidget *volsbox;
Manga *manga; Manga *manga;
} EomEditWindow; } EomDetailWindow;
GType eom_edit_window_get_type(void); GType eom_detail_window_get_type(void);
GtkWidget *eom_edit_window_new(gint); GtkWidget *eom_detail_window_new(gint);
G_END_DECLS G_END_DECLS
#endif /* __EOM_EDIT_WINDOW_H__ */ #endif /* __EOM_DETAIL_WINDOW_H__ */

View file

@ -274,7 +274,7 @@ on_row_activated(GtkWidget *treeview, GtkTreePath *path,
return; return;
gtk_tree_model_get(model, &iter, COL_ID, &id, -1); 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), g_signal_connect(window, "delete-event", G_CALLBACK(on_edit_closed),
self); self);
} }

View file

@ -1,7 +1,7 @@
#include <hildon/hildon.h> #include <hildon/hildon.h>
#include "interface.h" #include "interface.h"
#include "eom-main-window.h" #include "eom-main-window.h"
#include "eom-edit-window.h" #include "eom-detail-window.h"
#include "eom-new-item-dialog.h" #include "eom-new-item-dialog.h"
#include "data.h" #include "data.h"
@ -15,11 +15,11 @@ void interface_show_main_window(void)
eom_main_window_load(EOM_MAIN_WINDOW(window)); 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; GtkWidget *window;
window = eom_edit_window_new(manga_id); window = eom_detail_window_new(manga_id);
gtk_widget_show_all(window); gtk_widget_show_all(window);
return window; return window;

View file

@ -1,5 +1,5 @@
#include <gtk/gtkwindow.h> #include <gtk/gtkwindow.h>
void interface_show_main_window(void); 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); GtkWidget *interface_show_new_item_dialog(GtkWindow *window);