From 8a45361b4f6fd8613a78011f5421091a18781773 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 21 Oct 2010 21:00:26 +0200 Subject: [PATCH] Changed name from Collections to Eye on Manga --- src/.#eom.h | 1 + src/Makefile | 12 +- src/c-edit-window.h | 59 ------ src/c-main-window.h | 70 ------- src/c-new-item-dialog.h | 60 ------ src/collections.h | 2 - src/data.c | 182 +++++++++--------- src/data.h | 14 +- src/{c-edit-window.c => eom-edit-window.c} | 84 ++++---- src/eom-edit-window.h | 59 ++++++ src/{c-main-window.c => eom-main-window.c} | 113 +++++------ src/eom-main-window.h | 70 +++++++ ...ew-item-dialog.c => eom-new-item-dialog.c} | 16 +- src/eom-new-item-dialog.h | 60 ++++++ src/{collections.c => eom.c} | 14 +- src/eom.h | 2 + src/eye-on-manga | Bin 0 -> 29086 bytes src/interface.c | 14 +- src/interface.h | 1 + 19 files changed, 419 insertions(+), 414 deletions(-) create mode 120000 src/.#eom.h delete mode 100644 src/c-edit-window.h delete mode 100644 src/c-main-window.h delete mode 100644 src/c-new-item-dialog.h delete mode 100644 src/collections.h rename src/{c-edit-window.c => eom-edit-window.c} (59%) create mode 100644 src/eom-edit-window.h rename src/{c-main-window.c => eom-main-window.c} (72%) create mode 100644 src/eom-main-window.h rename src/{c-new-item-dialog.c => eom-new-item-dialog.c} (70%) create mode 100644 src/eom-new-item-dialog.h rename src/{collections.c => eom.c} (53%) create mode 100644 src/eom.h create mode 100755 src/eye-on-manga diff --git a/src/.#eom.h b/src/.#eom.h new file mode 120000 index 0000000..0b869d0 --- /dev/null +++ b/src/.#eom.h @@ -0,0 +1 @@ +tom@tom-laptop.14670:1287677918 \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index fdd6c2d..8b0c154 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,15 +1,15 @@ CFLAGS=`pkg-config hildon-1 sqlite3 --cflags --libs` all: - $(CC) -Wall -Wextra -pedantic \ - collections.c \ + $(CC) -Wall -pedantic \ + eom.c \ interface.c \ - c-main-window.c \ - c-edit-window.c \ - c-new-item-dialog.c \ + eom-main-window.c \ + eom-edit-window.c \ + eom-new-item-dialog.c \ data.c \ $(CFLAGS) \ - -o collections + -o eye-on-manga .PHONY: check-syntax check-syntax: diff --git a/src/c-edit-window.h b/src/c-edit-window.h deleted file mode 100644 index e63d30e..0000000 --- a/src/c-edit-window.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __C_EDIT_WINDOW_H__ -#define __C_EDIT_WINDOW_H__ - -#include - -G_BEGIN_DECLS - -#define C_TYPE_EDIT_WINDOW \ - (c_edit_window_get_type()) - -#define C_EDIT_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - C_TYPE_EDIT_WINDOW, \ - CEditWindow)) - -#define C_EDIT_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - C_TYPE_EDIT_WINDOW, \ - CEditWindowClass)) - -#define C_IS_EDIT_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - C_TYPE_EDIT_WINDOW)) - -#define C_IS_EDIT_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - C_TYPE_EDIT_WINDOW)) - -#define C_EDIT_WINDOW_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - C_TYPE_EDIT_WINDOW, \ - CEditWindowClass)) - -typedef struct _CEditWindow CEditWindow; -typedef struct _CEditWindowClass CEditWindowClass; - -struct _CEditWindowClass -{ - HildonStackableWindowClass parent_class; -}; - -struct _CEditWindow -{ - HildonStackableWindow parent; - - GtkWidget *name_label; - GtkWidget *have_label; - GtkWidget *total_label; - - gint collection_id; -}; - -GType c_edit_window_get_type(void); - -GtkWidget *c_edit_window_new(gint collection_id); - -G_END_DECLS - -#endif /* __C_EDIT_WINDOW_H__ */ diff --git a/src/c-main-window.h b/src/c-main-window.h deleted file mode 100644 index 2b9ea1c..0000000 --- a/src/c-main-window.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef __C_MAIN_WINDOW_H__ -#define __C_MAIN_WINDOW_H__ - -#include - -G_BEGIN_DECLS - -#define C_TYPE_MAIN_WINDOW \ - (c_main_window_get_type()) - -#define C_MAIN_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - C_TYPE_MAIN_WINDOW, \ - CMainWindow)) - -#define C_MAIN_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - C_TYPE_MAIN_WINDOW, \ - CMainWindowClass)) - -#define C_IS_MAIN_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - C_TYPE_MAIN_WINDOW)) - -#define C_IS_MAIN_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - C_TYPE_MAIN_WINDOW)) - -#define C_MAIN_WINDOW_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - C_TYPE_MAIN_WINDOW, \ - CMainWindowClass)) - -typedef struct _CMainWindow CMainWindow; -typedef struct _CMainWindowClass CMainWindowClass; - -struct _CMainWindowClass -{ - HildonStackableWindowClass parent_class; -}; - -struct _CMainWindow -{ - HildonStackableWindow parent; - - GtkTreeIter iter; - GtkListStore *store; - GtkTreeSelection *selection; - - GtkWidget *add_button; - GtkWidget *remove_button; - GtkWidget *edit_button; -}; - -GType c_main_window_get_type(void); - -GtkWidget *c_main_window_new(void); - -void c_main_window_load(CMainWindow *self); -void c_main_window_add_line(CMainWindow *window, - gint id, - const gchar *name, - gint current_qty, - gint total_qty); -void c_main_window_set_no_select(CMainWindow *self); -void c_main_window_set_has_select(CMainWindow *self); - -G_END_DECLS - -#endif /* __C_MAIN_WINDOW_H__ */ diff --git a/src/c-new-item-dialog.h b/src/c-new-item-dialog.h deleted file mode 100644 index 2d83f71..0000000 --- a/src/c-new-item-dialog.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __C_NEW_ITEM_DIALOG_H__ -#define __C_NEW_ITEM_DIALOG_H__ - -#include - -G_BEGIN_DECLS - -#define C_TYPE_NEW_ITEM_DIALOG \ - (c_new_item_dialog_get_type()) - -#define C_NEW_ITEM_DIALOG(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - C_TYPE_NEW_ITEM_DIALOG, \ - CNewItemDialog)) - -#define C_NEW_ITEM_DIALOG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - C_TYPE_NEW_ITEM_DIALOG, \ - CNewItemDialogClass)) - -#define C_IS_NEW_ITEM_DIALOG(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - C_TYPE_NEW_ITEM_DIALOG)) - -#define C_IS_NEW_ITEM_DIALOG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - C_TYPE_NEW_ITEM_DIALOG)) - -#define C_NEW_ITEM_DIALOG_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - C_TYPE_NEW_ITEM_DIALOG, \ - CNewItemDialogClass)) - -typedef struct _CNewItemDialog CNewItemDialog; -typedef struct _CNewItemDialogClass CNewItemDialogClass; - -struct _CNewItemDialogClass -{ - GtkDialogClass parent_class; -}; - -struct _CNewItemDialog -{ - GtkDialog parent; - - GtkWidget *name_entry; - GtkWidget *qty_entry; -}; - -GType c_new_item_dialog_get_type(void); - -GtkWidget *c_new_item_dialog_new(void); - -const gchar *c_new_item_dialog_get_name(CNewItemDialog *dialog); - -gint c_new_item_dialog_get_total_qty(CNewItemDialog *dialog); - -G_END_DECLS - -#endif /* __C_NEW_ITEM_DIALOG_H__ */ diff --git a/src/collections.h b/src/collections.h deleted file mode 100644 index b3f9240..0000000 --- a/src/collections.h +++ /dev/null @@ -1,2 +0,0 @@ -gchar *collections_get_data_file(void); -gchar *collections_get_config_dir(void); diff --git a/src/data.c b/src/data.c index e3c0703..55fea88 100644 --- a/src/data.c +++ b/src/data.c @@ -6,41 +6,41 @@ #include #include #include -#include "collections.h" +#include "eom.h" -static gboolean data_check_and_create_database(gchar *data_file); -static gint data_create_new_database(const gchar *filename); -static struct collection *data_get_collection_from_stmt(sqlite3_stmt *stmt); +static gboolean data_check_and_create_database(gchar *data_file); +static gint data_create_new_database(const gchar *filename); +static Manga *data_get_manga_from_statement(sqlite3_stmt *stmt); -GList *data_get_series(void) +GList *data_get_manga(void) { - sqlite3 *database; + sqlite3 *database; sqlite3_stmt *statement; - gchar *data_file; - GList *list = NULL; + gchar *data_file; + GList *list = NULL; - data_file = collections_get_data_file(); + data_file = eom_get_data_file(); if (data_check_and_create_database(data_file)) { if (sqlite3_open(data_file, &database) == SQLITE_OK) { - int res; - const char *sqlStatement = - " SELECT id, " - " name, " + int res; + const char *sql = + " SELECT id, " + " name, " " current_qty, " - " total_qty " - " FROM collection " - " ORDER BY name " - " COLLATE NOCASE "; + " total_qty " + " FROM manga " + " ORDER BY name " + " COLLATE NOCASE "; res = sqlite3_prepare_v2(database, - sqlStatement, - strlen(sqlStatement), + sql, + strlen(sql), &statement, NULL); if (res == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { - struct collection *col = data_get_collection_from_stmt(statement); - list = g_list_append(list, (gpointer)col); + Manga *manga = data_get_manga_from_statement(statement); + list = g_list_append(list, (gpointer)manga); } } else @@ -54,30 +54,30 @@ GList *data_get_series(void) return list; } -struct collection *data_get_series_by_id(gint collection_id) +Manga *data_get_manga_by_id(gint manga_id) { - sqlite3 *database; - sqlite3_stmt *statement; - gchar *data_file; - struct collection *col = NULL; + sqlite3 *database; + sqlite3_stmt *statement; + gchar *data_file; + Manga *manga = NULL; - data_file = collections_get_data_file(); + data_file = eom_get_data_file(); if (data_check_and_create_database(data_file)) { if (sqlite3_open(data_file, &database) == SQLITE_OK) { - int res; + int res; const char *sql = g_strdup_printf( - " SELECT id, " - " name, " + " SELECT id, " + " name, " " current_qty, " - " total_qty " - " FROM collection " - " WHERE id = %d ", collection_id); + " total_qty " + " FROM manga " + " WHERE id = %d ", manga_id); res = sqlite3_prepare_v2(database, sql, strlen(sql), &statement, NULL); if (res == SQLITE_OK) { if (sqlite3_step(statement) == SQLITE_ROW) { - col = data_get_collection_from_stmt(statement); + manga = data_get_manga_from_statement(statement); } } sqlite3_finalize(statement); @@ -85,27 +85,27 @@ struct collection *data_get_series_by_id(gint collection_id) sqlite3_close(database); } - return col; + return manga; } -gint *data_get_items_by_collection_id(gint collection_id) +gint *data_get_volumes_by_manga_id(gint manga_id) { - gint count; - gint *volumes; - sqlite3 *database; + gint count; + gint *volumes; + sqlite3 *database; sqlite3_stmt *statement; - gchar *data_file; + gchar *data_file; - data_file = collections_get_data_file(); + data_file = eom_get_data_file(); count = 0; if (data_check_and_create_database(data_file)) { if (sqlite3_open(data_file, &database) == SQLITE_OK) { int res; const char *sql = g_strdup_printf( - " SELECT COUNT(id) " - " FROM items " - " WHERE collection_id = %d ", collection_id); + " SELECT COUNT(number) " + " FROM volume " + " WHERE collection_id = %d ", manga_id); res = sqlite3_prepare_v2(database, sql, strlen(sql), &statement, NULL); if (res == SQLITE_OK) { @@ -117,9 +117,9 @@ gint *data_get_items_by_collection_id(gint collection_id) if (count > 0) { sql = g_strdup_printf( - " SELECT id " - " FROM items " - " WHERE collection_id = %d ", collection_id); + " SELECT number " + " FROM volume " + " WHERE collection_id = %d ", manga_id); res = sqlite3_prepare_v2(database, sql, strlen(sql), &statement, NULL); if (res == SQLITE_OK) { @@ -136,26 +136,26 @@ gint *data_get_items_by_collection_id(gint collection_id) return volumes; } -gboolean data_add_series(gchar *name, gint total_qty) +gboolean data_add_manga(gchar *name, gint total_qty) { - sqlite3 *database; + sqlite3 *database; sqlite3_stmt *statement; - gchar *data_file; - gboolean result; + gchar *data_file; + gboolean result; result = FALSE; - data_file = collections_get_data_file(); + data_file = eom_get_data_file(); if (data_check_and_create_database(data_file)) { if (sqlite3_open(data_file, &database) == SQLITE_OK) { - int res; - const char *sqlStatement = - g_strdup_printf("INSERT INTO collection (name, current_qty, total_qty) " - " VALUES ('%s', 0, %d)", name, total_qty); + int res; + const char *sql = g_strdup_printf( + " INSERT INTO manga (name, current_qty, total_qty) " + " VALUES ('%s', 0, %d)", name, total_qty); res = sqlite3_prepare_v2(database, - sqlStatement, - strlen(sqlStatement), + sql, + strlen(sql), &statement, NULL); if (res == SQLITE_OK) { if (sqlite3_step(statement) == SQLITE_DONE) @@ -169,27 +169,27 @@ gboolean data_add_series(gchar *name, gint total_qty) return result; } -gboolean data_add_to_series(gint collection_id, gint count) +gboolean data_add_to_manga(gint manga_id, gint count) { - sqlite3 *database; + sqlite3 *database; sqlite3_stmt *statement; - gchar *data_file; - gboolean result; + gchar *data_file; + gboolean result; - data_file = collections_get_data_file(); + data_file = eom_get_data_file(); result = FALSE; if (data_check_and_create_database(data_file)) { if (sqlite3_open(data_file, &database) == SQLITE_OK) { - int res; - const char *sqlStatement = - g_strdup_printf("UPDATE collection " - " SET current_qty = current_qty + %d " - " WHERE id = %d", count, collection_id); + int res; + const char *sql = g_strdup_printf( + " UPDATE manga " + " SET current_qty = current_qty + %d " + " WHERE id = %d", count, manga_id); res = sqlite3_prepare_v2(database, - sqlStatement, - strlen(sqlStatement), + sql, + strlen(sql), &statement, NULL); if (res == SQLITE_OK) { if (sqlite3_step(statement) == SQLITE_DONE) @@ -220,8 +220,8 @@ static gint data_create_new_database(const gchar *filename) char *zErrMsg = 0; int rc; - if (access(collections_get_config_dir(), R_OK) == -1) { - if (mkdir(collections_get_config_dir(), S_IRWXU) == -1) + if (access(eom_get_config_dir(), R_OK) == -1) { + if (mkdir(eom_get_config_dir(), S_IRWXU) == -1) g_printerr("Can't create directory: %s\n", strerror(errno)); } @@ -235,30 +235,30 @@ static gint data_create_new_database(const gchar *filename) } /* Create collections table */ - rc = sqlite3_exec(db, "CREATE TABLE collection(" + rc = sqlite3_exec(db, "CREATE TABLE manga(" "id INTEGER PRIMARY KEY," "name VARCHAR(100)," "current_qty INTEGER," "total_qty INTEGER" ")", NULL, NULL, &zErrMsg); if (rc != SQLITE_OK) { - g_printerr("Can't create collection table: %s\n", zErrMsg); + g_printerr("Can't create manga table: %s\n", zErrMsg); sqlite3_free(zErrMsg); sqlite3_close(db); return -1; } /* Create items table */ - rc = sqlite3_exec(db, "CREATE TABLE item(" - "collection_id INTEGER," - "id INTEGER," - "title VARCHAR(100)," - "PRIMARY KEY(collection_id, id)," - "FOREIGN KEY(collection_id)" - " REFERENCES collection(id)" - ")", NULL, NULL, &zErrMsg); + rc = sqlite3_exec(db, + " CREATE TABLE volume( " + " collection_id INTEGER, " + " id INTEGER, " + " PRIMARY KEY(collection_id, id), " + " FOREIGN KEY(collection_id) " + " REFERENCES collection(id)) ", + NULL, NULL, &zErrMsg); if (rc != SQLITE_OK) { - g_printerr("Can't create item table: %s\n", zErrMsg); + g_printerr("Can't create volume table: %s\n", zErrMsg); sqlite3_free(zErrMsg); sqlite3_close(db); return -1; @@ -268,15 +268,15 @@ static gint data_create_new_database(const gchar *filename) return 0; } -static struct collection *data_get_collection_from_stmt(sqlite3_stmt *stmt) +static Manga *data_get_manga_from_statement(sqlite3_stmt *stmt) { - struct collection *collection = - (struct collection *)malloc(sizeof(struct collection)); + Manga *manga = + (Manga *)malloc(sizeof(Manga)); - collection->id = sqlite3_column_int(stmt, 0); - collection->name = g_strdup(sqlite3_column_text(stmt, 1)); - collection->current_qty = sqlite3_column_int(stmt, 2); - collection->total_qty = sqlite3_column_int(stmt, 3); + manga->id = sqlite3_column_int(stmt, 0); + manga->name = g_strdup(sqlite3_column_text(stmt, 1)); + manga->current_qty = sqlite3_column_int(stmt, 2); + manga->total_qty = sqlite3_column_int(stmt, 3); - return collection; + return manga; } diff --git a/src/data.h b/src/data.h index c97e228..2152da0 100644 --- a/src/data.h +++ b/src/data.h @@ -1,6 +1,8 @@ #include -struct collection +typedef struct _manga Manga; + +struct _manga { int id; int current_qty; @@ -8,8 +10,8 @@ struct collection char *name; }; -GList *data_get_series(void); -struct collection *data_get_series_by_id(gint collection_id); -gint *data_get_items_by_collection_id(gint collection_id); -gboolean data_add_series(gchar *name, gint total_qty); -gboolean data_add_to_series(gint id, gint count); +GList *data_get_manga(void); +Manga *data_get_manga_by_id(gint manga_id); +gint *data_get_volumes_by_manga_id(gint manga_id); +gboolean data_add_manga(gchar *name, gint total_qty); +gboolean data_add_to_manga(gint id, gint count); diff --git a/src/c-edit-window.c b/src/eom-edit-window.c similarity index 59% rename from src/c-edit-window.c rename to src/eom-edit-window.c index 999daf7..6776569 100644 --- a/src/c-edit-window.c +++ b/src/eom-edit-window.c @@ -1,35 +1,35 @@ -#include "c-edit-window.h" +#include "eom-edit-window.h" #include #include #include "data.h" enum { - C_EDIT_PROP_0, - C_EDIT_PROP_CID + EOM_EDIT_PROP_0, + EOM_EDIT_PROP_CID }; -static void c_edit_window_set_collection_id(CEditWindow *self, - gint collection_id); +static void eom_edit_window_set_manga_id(EomEditWindow *self, + gint manga_id); -G_DEFINE_TYPE(CEditWindow, c_edit_window, HILDON_TYPE_STACKABLE_WINDOW) +G_DEFINE_TYPE(EomEditWindow, eom_edit_window, HILDON_TYPE_STACKABLE_WINDOW) -GtkWidget *c_edit_window_new(gint collection_id) +GtkWidget *eom_edit_window_new(gint manga_id) { - g_print("1: %d\n", collection_id); - return g_object_new(C_TYPE_EDIT_WINDOW, "collection-id", collection_id, NULL); + g_print("1: %d\n", manga_id); + return g_object_new(EOM_TYPE_EDIT_WINDOW, "manga-id", manga_id, NULL); } -static void c_edit_window_set_property(GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) +static void eom_edit_window_set_property(GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { - CEditWindow *self = C_EDIT_WINDOW(object); + EomEditWindow *self = EOM_EDIT_WINDOW(object); switch (property_id) { - case C_EDIT_PROP_CID: + case EOM_EDIT_PROP_CID: g_print("2: %d\n", g_value_get_int(value)); - self->collection_id = g_value_get_int(value); + self->manga_id = g_value_get_int(value); break; default: /* We don't have any other properties */ @@ -38,16 +38,16 @@ static void c_edit_window_set_property(GObject *object, } } -static void c_edit_window_get_property(GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) +static void eom_edit_window_get_property(GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { - CEditWindow *self = C_EDIT_WINDOW(object); + EomEditWindow *self = EOM_EDIT_WINDOW(object); switch (property_id) { - case C_EDIT_PROP_CID: - g_value_set_int(value, self->collection_id); + case EOM_EDIT_PROP_CID: + g_value_set_int(value, self->manga_id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); @@ -55,27 +55,27 @@ static void c_edit_window_get_property(GObject *object, } } -static void c_edit_window_class_init(CEditWindowClass *klass) +static void eom_edit_window_class_init(EomEditWindowClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GParamSpec *pspec; - gobject_class->set_property = c_edit_window_set_property; - gobject_class->get_property = c_edit_window_get_property; + gobject_class->set_property = eom_edit_window_set_property; + gobject_class->get_property = eom_edit_window_get_property; - pspec = g_param_spec_int("collection-id", - "ID for the collection", - "Set the collection-id", + pspec = g_param_spec_int("manga-id", + "ID of the manga", + "Set the manga-id", 0, INT_MAX, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE); g_object_class_install_property(gobject_class, - C_EDIT_PROP_CID, + EOM_EDIT_PROP_CID, pspec); } -static void c_edit_window_init(CEditWindow *self) +static void eom_edit_window_init(EomEditWindow *self) { GtkWidget *pannablearea; GtkWidget *table; @@ -84,7 +84,7 @@ static void c_edit_window_init(CEditWindow *self) GtkWidget *totalclabel; GtkWidget *vbox; - g_print("3: %d\n", self->collection_id); + g_print("3: %d\n", self->manga_id); pannablearea = hildon_pannable_area_new(); g_object_set(G_OBJECT(pannablearea), @@ -131,20 +131,20 @@ static void c_edit_window_init(CEditWindow *self) GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); } -static void c_edit_window_set_collection_id(CEditWindow *self, - gint collection_id) +static void eom_edit_window_set_manga_id(EomEditWindow *self, + gint manga_id) { - struct collection *col; - gint *items; + Manga *manga; + gint *volumes; - col = data_get_series_by_id(collection_id); - items = data_get_items_by_collection_id(collection_id); + manga = data_get_manga_by_id(manga_id); + volumes = data_get_volumes_by_manga_id(manga_id); - gtk_label_set_text(GTK_LABEL(self->name_label), col->name); + gtk_label_set_text(GTK_LABEL(self->name_label), manga->name); gtk_label_set_text(GTK_LABEL(self->have_label), - g_strdup_printf("%d", col->current_qty)); + g_strdup_printf("%d", manga->current_qty)); gtk_label_set_text(GTK_LABEL(self->total_label), - g_strdup_printf("%d", col->total_qty)); + g_strdup_printf("%d", manga->total_qty)); - g_free(col); + g_free(manga); } diff --git a/src/eom-edit-window.h b/src/eom-edit-window.h new file mode 100644 index 0000000..cecc7fb --- /dev/null +++ b/src/eom-edit-window.h @@ -0,0 +1,59 @@ +#ifndef __EOM_EDIT_WINDOW_H__ +#define __EOM_EDIT_WINDOW_H__ + +#include + +G_BEGIN_DECLS + +#define EOM_TYPE_EDIT_WINDOW \ + (eom_edit_window_get_type()) + +#define EOM_EDIT_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + EOM_TYPE_EDIT_WINDOW, \ + EomEditWindow)) + +#define EOM_EDIT_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + EOM_TYPE_EDIT_WINDOW, \ + EomEditWindowClass)) + +#define EOM_IS_EDIT_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + EOM_TYPE_EDIT_WINDOW)) + +#define EOM_IS_EDIT_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + EOM_TYPE_EDIT_WINDOW)) + +#define EOM_EDIT_WINDOW_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + EOM_TYPE_EDIT_WINDOW, \ + EomEditWindowClass)) + +typedef struct _EomEditWindow EomEditWindow; +typedef struct _EomEditWindowClass EomEditWindowClass; + +struct _EomEditWindowClass +{ + HildonStackableWindowClass parent_class; +}; + +struct _EomEditWindow +{ + HildonStackableWindow parent; + + GtkWidget *name_label; + GtkWidget *have_label; + GtkWidget *total_label; + + gint manga_id; +}; + +GType eom_edit_window_get_type(void); + +GtkWidget *eom_edit_window_new(gint manga_id); + +G_END_DECLS + +#endif /* __EOM_EDIT_WINDOW_H__ */ diff --git a/src/c-main-window.c b/src/eom-main-window.c similarity index 72% rename from src/c-main-window.c rename to src/eom-main-window.c index e1487dc..8bd96e4 100644 --- a/src/c-main-window.c +++ b/src/eom-main-window.c @@ -1,13 +1,13 @@ -#include "c-main-window.h" +#include "eom-main-window.h" #include #include #include #include -#include "c-new-item-dialog.h" +#include "eom-new-item-dialog.h" #include "data.h" #include "interface.h" -G_DEFINE_TYPE(CMainWindow, c_main_window, HILDON_TYPE_STACKABLE_WINDOW) +G_DEFINE_TYPE(EomMainWindow, eom_main_window, HILDON_TYPE_STACKABLE_WINDOW) enum { COL_ID = 0, @@ -17,44 +17,45 @@ enum { NUM_COLS }; -static void c_main_window_add_menu(CMainWindow *window); -static void c_main_window_on_new(GtkWidget *widget, GtkWindow *window); -static void c_main_window_on_selection_changed(GtkTreeSelection *selection, - gpointer user_data); -static void c_main_window_on_add_clicked(GtkWidget *widget, gpointer user_data); -static void c_main_window_on_remove_clicked(GtkWidget *widget, +static void eom_main_window_add_menu(EomMainWindow *window); +static void eom_main_window_on_new(GtkWidget *widget, GtkWindow *window); +static void eom_main_window_on_selection_changed(GtkTreeSelection *selection, + gpointer user_data); +static void eom_main_window_on_add_clicked(GtkWidget *widget, + gpointer user_data); +static void eom_main_window_on_remove_clicked(GtkWidget *widget, + gpointer user_data); +static void eom_main_window_on_edit_clicked(GtkWidget *widget, gpointer user_data); -static void c_main_window_on_edit_clicked(GtkWidget *widget, - gpointer user_data); -GtkWidget *c_main_window_new(void) +GtkWidget *eom_main_window_new(void) { - return g_object_new(C_TYPE_MAIN_WINDOW, NULL); + return g_object_new(EOM_TYPE_MAIN_WINDOW, NULL); } -void c_main_window_load(CMainWindow *self) +void eom_main_window_load(EomMainWindow *self) { GList *list; gtk_list_store_clear(self->store); - list = data_get_series(); + list = data_get_manga(); while (list) { - struct collection *col = list->data; - c_main_window_add_line(self, col->id, col->name, - col->current_qty, col->total_qty); + Manga *manga = list->data; + eom_main_window_add_line(self, manga->id, manga->name, + manga->current_qty, manga->total_qty); list = g_list_next(list); } g_list_free_1(list); } -void c_main_window_add_line(CMainWindow *window, - gint id, - const gchar *name, - gint current_qty, - gint total_qty) +void eom_main_window_add_line(EomMainWindow *window, + gint id, + const gchar *name, + gint current_qty, + gint total_qty) { gtk_list_store_append(window->store, &window->iter); gtk_list_store_set(window ->store, &window->iter, @@ -65,7 +66,7 @@ void c_main_window_add_line(CMainWindow *window, -1); } -void c_main_window_set_no_select(CMainWindow *self) +void eom_main_window_set_no_select(EomMainWindow *self) { if (GTK_IS_WIDGET(self->add_button)) gtk_widget_set_sensitive(GTK_WIDGET(self->add_button), FALSE); @@ -73,7 +74,7 @@ void c_main_window_set_no_select(CMainWindow *self) gtk_widget_set_sensitive(GTK_WIDGET(self->remove_button), FALSE); } -void c_main_window_set_has_select(CMainWindow *self) +void eom_main_window_set_has_select(EomMainWindow *self) { if (GTK_IS_WIDGET(self->add_button)) gtk_widget_set_sensitive(GTK_WIDGET(self->add_button), TRUE); @@ -81,10 +82,10 @@ void c_main_window_set_has_select(CMainWindow *self) gtk_widget_set_sensitive(GTK_WIDGET(self->remove_button), TRUE); } -static void c_main_window_class_init(CMainWindowClass *class) +static void eom_main_window_class_init(EomMainWindowClass *class) {} -static void c_main_window_init(CMainWindow *window) +static void eom_main_window_init(EomMainWindow *window) { GtkCellRenderer *renderer; GtkWidget *view; @@ -96,7 +97,7 @@ static void c_main_window_init(CMainWindow *window) index = -1; - c_main_window_add_menu(window); + eom_main_window_add_menu(window); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(window, "delete-event", G_CALLBACK(gtk_main_quit), NULL); @@ -121,7 +122,7 @@ static void c_main_window_init(CMainWindow *window) window->selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); g_signal_connect(window->selection, "changed", - G_CALLBACK(c_main_window_on_selection_changed), + G_CALLBACK(eom_main_window_on_selection_changed), (gpointer)window); renderer = gtk_cell_renderer_text_new(); @@ -173,7 +174,7 @@ static void c_main_window_init(CMainWindow *window) "Add", NULL); g_signal_connect(window->add_button, "clicked", - G_CALLBACK(c_main_window_on_add_clicked), + G_CALLBACK(eom_main_window_on_add_clicked), (gpointer)window); gtk_box_pack_start(GTK_BOX(hbuttonbox), window->add_button, FALSE, FALSE, 0); @@ -184,7 +185,7 @@ static void c_main_window_init(CMainWindow *window) "Edit", NULL); g_signal_connect(window->edit_button, "clicked", - G_CALLBACK(c_main_window_on_edit_clicked), + G_CALLBACK(eom_main_window_on_edit_clicked), (gpointer)window); gtk_box_pack_start(GTK_BOX(hbuttonbox), window->edit_button, FALSE, FALSE, 0); @@ -195,17 +196,17 @@ static void c_main_window_init(CMainWindow *window) "Remove", NULL); g_signal_connect(window->remove_button, "clicked", - G_CALLBACK(c_main_window_on_remove_clicked), + G_CALLBACK(eom_main_window_on_remove_clicked), (gpointer)window); gtk_box_pack_start(GTK_BOX(hbuttonbox), window->remove_button, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); - c_main_window_set_no_select(window); + eom_main_window_set_no_select(window); } -static void c_main_window_add_menu(CMainWindow *window) +static void eom_main_window_add_menu(EomMainWindow *window) { GtkWidget *appmenu; GtkWidget *new_button; @@ -213,10 +214,10 @@ static void c_main_window_add_menu(CMainWindow *window) appmenu = hildon_app_menu_new(); new_button = hildon_gtk_button_new(HILDON_SIZE_AUTO); - gtk_button_set_label(GTK_BUTTON(new_button), "New Item"); + gtk_button_set_label(GTK_BUTTON(new_button), "New Manga"); g_signal_connect_after(new_button, "clicked", - G_CALLBACK(c_main_window_on_new), + G_CALLBACK(eom_main_window_on_new), GTK_WINDOW(window)); hildon_app_menu_append(HILDON_APP_MENU(appmenu), GTK_BUTTON(new_button)); @@ -226,7 +227,7 @@ static void c_main_window_add_menu(CMainWindow *window) HILDON_APP_MENU(appmenu)); } -static void c_main_window_on_new(GtkWidget *widget, GtkWindow *window) +static void eom_main_window_on_new(GtkWidget *widget, GtkWindow *window) { GtkWidget *dialog; gint result; @@ -239,42 +240,42 @@ static void c_main_window_on_new(GtkWidget *widget, GtkWindow *window) if (result == GTK_RESPONSE_OK) { const gchar *tmp; - tmp = c_new_item_dialog_get_name(C_NEW_ITEM_DIALOG(dialog)); + tmp = eom_new_item_dialog_get_name(EOM_NEW_ITEM_DIALOG(dialog)); name = (gchar *)malloc(strlen(tmp) + 1); strcpy(name, tmp); strcat(name, "\0"); - total_qty = c_new_item_dialog_get_total_qty(C_NEW_ITEM_DIALOG(dialog)); + total_qty = eom_new_item_dialog_get_total_qty(EOM_NEW_ITEM_DIALOG(dialog)); gtk_widget_destroy(dialog); } if (name != NULL) { - if (data_add_series(name, total_qty)) - c_main_window_load(C_MAIN_WINDOW(window)); + if (data_add_manga(name, total_qty)) + eom_main_window_load(EOM_MAIN_WINDOW(window)); } } -static void c_main_window_on_selection_changed(GtkTreeSelection *selection, +static void eom_main_window_on_selection_changed(GtkTreeSelection *selection, gpointer user_data) { gint count; - CMainWindow *self = (CMainWindow *)user_data; + EomMainWindow *self = (EomMainWindow *)user_data; count = gtk_tree_selection_count_selected_rows(selection); if (count == 0) - c_main_window_set_no_select(self); + eom_main_window_set_no_select(self); else - c_main_window_set_has_select(self); + eom_main_window_set_has_select(self); } -static void c_main_window_on_add_clicked(GtkWidget *widget, gpointer user_data) +static void eom_main_window_on_add_clicked(GtkWidget *widget, gpointer user_data) { - CMainWindow *self; + EomMainWindow *self; gint count; - self = (CMainWindow *)user_data; + self = (EomMainWindow *)user_data; count = gtk_tree_selection_count_selected_rows(self->selection); if (count > 0) { @@ -286,7 +287,7 @@ static void c_main_window_on_add_clicked(GtkWidget *widget, gpointer user_data) gtk_tree_model_get(model, &self->iter, COL_ID, &id, -1); gtk_tree_model_get(model, &self->iter, COL_CURRENT, ¤t_count, -1); - if (data_add_to_series(id, 1)) + if (data_add_to_manga(id, 1)) gtk_list_store_set(GTK_LIST_STORE(self->store), &self->iter, COL_CURRENT, current_count + 1, -1); @@ -294,13 +295,13 @@ static void c_main_window_on_add_clicked(GtkWidget *widget, gpointer user_data) } } -static void c_main_window_on_remove_clicked(GtkWidget *widget, +static void eom_main_window_on_remove_clicked(GtkWidget *widget, gpointer user_data) { - CMainWindow *self; + EomMainWindow *self; gint count; - self = (CMainWindow *)user_data; + self = (EomMainWindow *)user_data; count = gtk_tree_selection_count_selected_rows(self->selection); if (count > 0) { @@ -313,19 +314,19 @@ static void c_main_window_on_remove_clicked(GtkWidget *widget, gtk_tree_model_get(model, &self->iter, COL_ID, &id, -1); gtk_tree_model_get(model, &self->iter, COL_CURRENT, ¤t_count, -1); - if (current_count > 0 && data_add_to_series(id, -1)) + if (current_count > 0 && data_add_to_manga(id, -1)) gtk_list_store_set(GTK_LIST_STORE(self->store), &self->iter, COL_CURRENT, current_count - 1, -1); } } } -static void c_main_window_on_edit_clicked(GtkWidget *widget, +static void eom_main_window_on_edit_clicked(GtkWidget *widget, gpointer user_data) { - CMainWindow *self; + EomMainWindow *self; - self = (CMainWindow *)user_data; + self = (EomMainWindow *)user_data; /* TODO: Place more code here */ interface_show_edit_window(); diff --git a/src/eom-main-window.h b/src/eom-main-window.h new file mode 100644 index 0000000..fe82c70 --- /dev/null +++ b/src/eom-main-window.h @@ -0,0 +1,70 @@ +#ifndef __EOM_MAIN_WINDOW_H__ +#define __EOM_MAIN_WINDOW_H__ + +#include + +G_BEGIN_DECLS + +#define EOM_TYPE_MAIN_WINDOW \ + (eom_main_window_get_type()) + +#define EOM_MAIN_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + EOM_TYPE_MAIN_WINDOW, \ + EomMainWindow)) + +#define EOM_MAIN_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + EOM_TYPE_MAIN_WINDOW, \ + EomMainWindowClass)) + +#define EOM_IS_MAIN_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + EOM_TYPE_MAIN_WINDOW)) + +#define EOM_IS_MAIN_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + EOM_TYPE_MAIN_WINDOW)) + +#define EOM_MAIN_WINDOW_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + EOM_TYPE_MAIN_WINDOW, \ + EomMainWindowClass)) + +typedef struct _EomMainWindow EomMainWindow; +typedef struct _EomMainWindowClass EomMainWindowClass; + +struct _EomMainWindowClass +{ + HildonStackableWindowClass parent_class; +}; + +struct _EomMainWindow +{ + HildonStackableWindow parent; + + GtkTreeIter iter; + GtkListStore *store; + GtkTreeSelection *selection; + + GtkWidget *add_button; + GtkWidget *remove_button; + GtkWidget *edit_button; +}; + +GType eom_main_window_get_type(void); + +GtkWidget *eom_main_window_new(void); + +void eom_main_window_load(EomMainWindow *self); +void eom_main_window_add_line(EomMainWindow *window, + gint id, + const gchar *name, + gint current_qty, + gint total_qty); +void eom_main_window_set_no_select(EomMainWindow *self); +void eom_main_window_set_has_select(EomMainWindow *self); + +G_END_DECLS + +#endif /* __EOM_MAIN_WINDOW_H__ */ diff --git a/src/c-new-item-dialog.c b/src/eom-new-item-dialog.c similarity index 70% rename from src/c-new-item-dialog.c rename to src/eom-new-item-dialog.c index 76b0686..aa8c169 100644 --- a/src/c-new-item-dialog.c +++ b/src/eom-new-item-dialog.c @@ -1,29 +1,29 @@ -#include "c-new-item-dialog.h" +#include "eom-new-item-dialog.h" #include #include #include -G_DEFINE_TYPE(CNewItemDialog, c_new_item_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE(EomNewItemDialog, eom_new_item_dialog, GTK_TYPE_DIALOG) -GtkWidget *c_new_item_dialog_new(void) +GtkWidget *eom_new_item_dialog_new(void) { - return g_object_new(C_TYPE_NEW_ITEM_DIALOG, NULL); + return g_object_new(EOM_TYPE_NEW_ITEM_DIALOG, NULL); } -const gchar *c_new_item_dialog_get_name(CNewItemDialog *dialog) +const gchar *eom_new_item_dialog_get_name(EomNewItemDialog *dialog) { return hildon_entry_get_text(HILDON_ENTRY(dialog->name_entry)); } -gint c_new_item_dialog_get_total_qty(CNewItemDialog *dialog) +gint eom_new_item_dialog_get_total_qty(EomNewItemDialog *dialog) { return atoi(hildon_entry_get_text(HILDON_ENTRY(dialog->qty_entry))); } -static void c_new_item_dialog_class_init(CNewItemDialogClass *class) +static void eom_new_item_dialog_class_init(EomNewItemDialogClass *class) {} -static void c_new_item_dialog_init(CNewItemDialog *dialog) +static void eom_new_item_dialog_init(EomNewItemDialog *dialog) { GtkWidget *content_area; GtkWidget *hbox; diff --git a/src/eom-new-item-dialog.h b/src/eom-new-item-dialog.h new file mode 100644 index 0000000..b77a93f --- /dev/null +++ b/src/eom-new-item-dialog.h @@ -0,0 +1,60 @@ +#ifndef __EOM_NEW_ITEM_DIALOG_H__ +#define __EOM_NEW_ITEM_DIALOG_H__ + +#include + +G_BEGIN_DECLS + +#define EOM_TYPE_NEW_ITEM_DIALOG \ + (eom_new_item_dialog_get_type()) + +#define EOM_NEW_ITEM_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + EOM_TYPE_NEW_ITEM_DIALOG, \ + EomNewItemDialog)) + +#define EOM_NEW_ITEM_DIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + EOM_TYPE_NEW_ITEM_DIALOG, \ + EomNewItemDialogClass)) + +#define EOM_IS_NEW_ITEM_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + EOM_TYPE_NEW_ITEM_DIALOG)) + +#define EOM_IS_NEW_ITEM_DIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + EOM_TYPE_NEW_ITEM_DIALOG)) + +#define EOM_NEW_ITEM_DIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + EOM_TYPE_NEW_ITEM_DIALOG, \ + EomNewItemDialogClass)) + +typedef struct _EomNewItemDialog EomNewItemDialog; +typedef struct _EomNewItemDialogClass EomNewItemDialogClass; + +struct _EomNewItemDialogClass +{ + GtkDialogClass parent_class; +}; + +struct _EomNewItemDialog +{ + GtkDialog parent; + + GtkWidget *name_entry; + GtkWidget *qty_entry; +}; + +GType eom_new_item_dialog_get_type(void); + +GtkWidget *eom_new_item_dialog_new(void); + +const gchar *eom_new_item_dialog_get_name(EomNewItemDialog *dialog); + +gint eom_new_item_dialog_get_total_qty(EomNewItemDialog *dialog); + +G_END_DECLS + +#endif /* __EOM_NEW_ITEM_DIALOG_H__ */ diff --git a/src/collections.c b/src/eom.c similarity index 53% rename from src/collections.c rename to src/eom.c index 56c75b7..1b4a12e 100644 --- a/src/collections.c +++ b/src/eom.c @@ -1,26 +1,26 @@ #include #include #include "interface.h" -#include "collections.h" +#include "eom.h" -gchar *collections_get_data_file(void) +gchar *eom_get_data_file(void) { static gchar *filedir = NULL; if (filedir == NULL) { - filedir = g_strdup_printf("%s/collections.db", - collections_get_config_dir()); + filedir = g_strdup_printf("%s/eye-on-manga.db", + eom_get_config_dir()); } return filedir; } -gchar *collections_get_config_dir(void) +gchar *eom_get_config_dir(void) { static gchar *filedir = NULL; if (filedir == NULL) { - filedir = g_strdup_printf("%s/.collections", getenv("HOME")); + filedir = g_strdup_printf("%s/.eom", getenv("HOME")); } return filedir; @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) { hildon_gtk_init(&argc, &argv); - g_set_application_name("Collections"); + g_set_application_name("Eye on Manga"); interface_show_main_window(); diff --git a/src/eom.h b/src/eom.h new file mode 100644 index 0000000..155cd60 --- /dev/null +++ b/src/eom.h @@ -0,0 +1,2 @@ +gchar *eom_get_data_file(void); +gchar *eom_get_config_dir(void); diff --git a/src/eye-on-manga b/src/eye-on-manga new file mode 100755 index 0000000000000000000000000000000000000000..a5c5b9ae4b2bfb2cb768bf03b63af387582e2549 GIT binary patch literal 29086 zcmcJ23wT^rx%Nt$$^ZcZ7A%*e)6zmJZAeSOS}vxSffjn1rY*E0Oee{-lQhYM$xLZI zps}Uc7|MyI9;+g>1rY_LR*qst2`xgoX|0GLr~#}0j;#_fLexsm`+n$>dQ%BLf9E-fl5GVUlg!wgY)Ye{G_@=wgQC6i6q9A(PQf0)zE`*4b7 zliNUp)Q#Uv!;wmmh9QkWBO^Xj5@LEkFcZtzHj^BvYmi!I8N*~`kPS3Gz$$fv79`Z%7M$ln<)&;67lH=KmSM zKf8Q(+lhrs znCEz0jKtr&l)eo1Bwk)n|Lp>NuC{lZ);|?Fk9H*1|1bfL4?%I_Z;KO+S%lxje?AKT z;J6t6Af6@&zCliWfKI`23li}s2=oXeU+DmH;*r{(o zX!%r?w^H#pw48FVep>6FrtP1h_V|OApP=O@tNuH+{=HiMgyLq!v(&!dQv1K8t^zBjlA1nP~#k&=kK~5ffRo*Eo?-vzUYB^((`aPiX+@$!23|<^hBeDDv zrSDWcU-5RuNyY0G-=KH_a@PNX;#w`=uDC^Uxyt9__xoDz;$yGc!{K4-FBdN-hR_g> zrONLqtxvm?{}`or_P;{)bL}lw{Tr43H(KA>^G(I?X!*BQ9`*ya|4*&|pyHzu2Rs(5 zJTsL(iF2eMrR5w4h&p_X5WdZaHZD6i1=T)bYYc(d03fYQ7E_z5k) zUFADd?LR{4Z_x5b6@NtQJ9|~CKCXZLm(r)Sy>BXR*ZMzF?EL?%;sx*v_1UKWnV|Fs zw0y0@THdC(SIh5Id<^;#k9&~V-iH*IBPTvt^{Z3)MyNecQGA{1*QWKyX*`_)KCFMf zw)ZD3=Ul|&N-e)iv5V)d;s|J1f34y%%5Sgo|Am%s*76T2{<`8b74K5~Vdb|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I|^>|$ek&%L9X4Tu)Z!9!}A{O-Pf3an3Etoueu!c|Sbw+jv^>0jHwtd`h=%hY(Tlj!_K_?d zEOd6vxAagH|H9Ih7vPCLwG7tv?HW8OyO6p)l?!Wdugl=;2YJoe-9+)OLJaRJP;nSw z0w3j1u)AW~z~k=BF`kX-UYUbJt&m`7BOHn9-3@WxM=K{!5OxWK~se zw@2Ma+^?3mO(h=Ia=%k&aC6^n>A?DUzG zbsRY9o~sby2pgpr?%V52`CfKVr)Iegt^KP09^ymotR7q55=&xF^`WiUK>@s?I6Ok2*Hs_N9h8y3KEpV_-y-NeH{J zbBlT1UE3)wdl{>psCRCRvx5br>^<%MuWdM&$!6@Lux=pk$82sD#bS%_>LNEC4vJ6u zg1;4@Eb{gsC)uFwxrf}jx}JYifNm(9qVp`T`sdDBtLet-z7n#zxP%e^E`p147K^Qq z$i}@TSTG5~m$KP5U)gevVbaI$^W+iSy`3xqqd$w^_0JiAT;?^qH~Nr&+#tAtv)u?f z&krKPpuMrx7davA$T_6t{r(&XcbQxuoOYgn^G_%gECdQXDv`^6gKH7|wF`7ieIwgCSSo}TwC5HS>-^n33CQ;v^qJrmTQRc5BWc8Qpd=hDXIQnZR z`*vGv467%*T*Mm6k50eC=EsuX%20x^P{Oa!HqKMIah;@oFBY!B4fPBDoJ3)#)t=2J)pJ@()?4$ocCDnqkNS#!miU zaBx$a{6U%ji$8>sv$U?7*~g9mxI{i3x$* literal 0 HcmV?d00001 diff --git a/src/interface.c b/src/interface.c index 9d1b0f1..af07d7a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,18 +1,18 @@ #include #include "interface.h" -#include "c-main-window.h" -#include "c-edit-window.h" -#include "c-new-item-dialog.h" +#include "eom-main-window.h" +#include "eom-edit-window.h" +#include "eom-new-item-dialog.h" #include "data.h" void interface_show_main_window(void) { GtkWidget *window; - window = c_main_window_new(); + window = eom_main_window_new(); gtk_widget_show_all(window); - c_main_window_load(C_MAIN_WINDOW(window)); + eom_main_window_load(EOM_MAIN_WINDOW(window)); } void interface_show_edit_window(void) @@ -22,7 +22,7 @@ void interface_show_edit_window(void) stack = hildon_window_stack_get_default(); - window = c_edit_window_new(1); + window = eom_edit_window_new(1); hildon_window_stack_push(stack, HILDON_STACKABLE_WINDOW(window), NULL); gtk_widget_show_all(window); } @@ -31,7 +31,7 @@ GtkWidget *interface_show_new_item_dialog(GtkWindow *window) { GtkWidget *dialog; - dialog = c_new_item_dialog_new(); + dialog = eom_new_item_dialog_new(); gtk_widget_show_all(dialog); gtk_window_set_transient_for(GTK_WINDOW(dialog), window); diff --git a/src/interface.h b/src/interface.h index 0bd37ad..1832b05 100644 --- a/src/interface.h +++ b/src/interface.h @@ -1,4 +1,5 @@ #include void interface_show_main_window(void); +void interface_show_edit_window(void); GtkWidget *interface_show_new_item_dialog(GtkWindow *window);