diary r95 - in trunk: . src src/links
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: diary r95 - in trunk: . src src/links
- Date: Wed, 22 Oct 2008 16:48:40 +0000 (UTC)
Author: pwithnall
Date: Wed Oct 22 16:48:40 2008
New Revision: 95
URL: http://svn.gnome.org/viewvc/diary?rev=95&view=rev
Log:
2008-10-22 Philip Withnall <philip tecnocode co uk>
* src/add-link-dialog.c (almanah_add_link_dialog_new):
* src/interface.c (almanah_get_interface_filename),
(almanah_create_interface), (almanah_interface_embolden_label),
(almanah_interface_error), (almanah_calendar_month_changed_cb):
* src/interface.h:
* src/link.c (almanah_link_view):
* src/links/file.c (file_view):
* src/links/note.c (note_view):
* src/links/uri.c (uri_view):
* src/main-window.c (almanah_main_window_new),
(save_current_entry), (add_link_to_current_entry),
(remove_link_from_current_entry), (mw_delete_event_cb),
(mw_print_activate_cb), (mw_quit_activate_cb),
(mw_search_activate_cb), (mw_preferences_activate_cb),
(mw_about_activate_cb), (mw_calendar_day_selected_cb):
* src/main.c (storage_manager_disconnected_cb), (almanah_quit),
(main):
* src/main.h:
* src/preferences-dialog.c (almanah_preferences_dialog_new),
(pd_key_combo_changed_cb), (pd_new_key_button_clicked_cb):
* src/printing.c (print_entry), (paginate_cb), (draw_page_cb),
(create_custom_widget_cb), (custom_widget_apply_cb),
(almanah_print_entries):
* src/printing.h:
* src/search-dialog.c (almanah_search_dialog_new),
(sd_search_button_clicked_cb), (select_date):
* src/storage-manager.c (get_encryption_key),
(almanah_storage_manager_query),
(almanah_storage_manager_query_async): Rewrite the API to
consistently
use the "almanah" namespace, rather than "diary".
Modified:
trunk/ChangeLog
trunk/src/add-link-dialog.c
trunk/src/interface.c
trunk/src/interface.h
trunk/src/link.c
trunk/src/links/file.c
trunk/src/links/note.c
trunk/src/links/uri.c
trunk/src/main-window.c
trunk/src/main.c
trunk/src/main.h
trunk/src/preferences-dialog.c
trunk/src/printing.c
trunk/src/printing.h
trunk/src/search-dialog.c
trunk/src/storage-manager.c
Modified: trunk/src/add-link-dialog.c
==============================================================================
--- trunk/src/add-link-dialog.c (original)
+++ trunk/src/add-link-dialog.c Wed Oct 22 16:48:40 2008
@@ -82,7 +82,7 @@
AlmanahAddLinkDialog *add_link_dialog;
AlmanahAddLinkDialogPrivate *priv;
GError *error = NULL;
- const gchar *interface_filename = diary_get_interface_filename ();
+ const gchar *interface_filename = almanah_get_interface_filename ();
const gchar *object_names[] = {
"dry_add_link_dialog",
"dry_ald_type_store",
Modified: trunk/src/interface.c
==============================================================================
--- trunk/src/interface.c (original)
+++ trunk/src/interface.c Wed Oct 22 16:48:40 2008
@@ -1,20 +1,20 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -29,7 +29,7 @@
#include "interface.h"
const gchar *
-diary_get_interface_filename (void)
+almanah_get_interface_filename (void)
{
if (g_file_test ("./data/almanah.ui", G_FILE_TEST_EXISTS) == TRUE)
return "./data/almanah.ui";
@@ -38,18 +38,18 @@
}
GtkWidget *
-diary_create_interface (void)
+almanah_create_interface (void)
{
- diary->main_window = GTK_WIDGET (almanah_main_window_new ());
- diary->add_link_dialog = GTK_WIDGET (almanah_add_link_dialog_new ());
- diary->search_dialog = GTK_WIDGET (almanah_search_dialog_new ());
- diary->preferences_dialog = GTK_WIDGET (almanah_preferences_dialog_new ());
+ almanah->main_window = GTK_WIDGET (almanah_main_window_new ());
+ almanah->add_link_dialog = GTK_WIDGET (almanah_add_link_dialog_new ());
+ almanah->search_dialog = GTK_WIDGET (almanah_search_dialog_new ());
+ almanah->preferences_dialog = GTK_WIDGET (almanah_preferences_dialog_new ());
- return diary->main_window;
+ return almanah->main_window;
}
void
-diary_interface_embolden_label (GtkLabel *label)
+almanah_interface_embolden_label (GtkLabel *label)
{
gchar *markup;
@@ -59,7 +59,7 @@
}
/**
- * diary_interface_error:
+ * almanah_interface_error:
* @message: Error message
* @parent_window: The error dialog's parent window
*
@@ -67,7 +67,7 @@
* the console.
**/
void
-diary_interface_error (const gchar *message, GtkWidget *parent_window)
+almanah_interface_error (const gchar *message, GtkWidget *parent_window)
{
GtkWidget *dialog;
@@ -85,7 +85,7 @@
/* TODO: This exists so that different calendars can be highlighted according to which days have entries
* (i.e. the ones on the print dialogue). This should eventually be replaced by a custom calendar widget. */
void
-diary_calendar_month_changed_cb (GtkCalendar *calendar, gpointer user_data)
+almanah_calendar_month_changed_cb (GtkCalendar *calendar, gpointer user_data)
{
/* Mark the days on the calendar which have diary entries */
guint i, year, month;
@@ -93,7 +93,7 @@
gtk_calendar_get_date (calendar, &year, &month, NULL);
month++;
- days = almanah_storage_manager_get_month_marked_days (diary->storage_manager, year, month);
+ days = almanah_storage_manager_get_month_marked_days (almanah->storage_manager, year, month);
/* TODO: Don't like hard-coding the array length here */
gtk_calendar_clear_marks (calendar);
Modified: trunk/src/interface.h
==============================================================================
--- trunk/src/interface.h (original)
+++ trunk/src/interface.h Wed Oct 22 16:48:40 2008
@@ -1,35 +1,35 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
-#ifndef DIARY_INTERFACE_H
-#define DIARY_INTERFACE_H
+#ifndef ALMANAH_INTERFACE_H
+#define ALMANAH_INTERFACE_H
G_BEGIN_DECLS
-const gchar *diary_get_interface_filename (void);
-GtkWidget *diary_create_interface (void);
-void diary_interface_embolden_label (GtkLabel *label);
-void diary_interface_error (const gchar *message, GtkWidget *parent_window);
-void diary_calendar_month_changed_cb (GtkCalendar *calendar, gpointer user_data);
+const gchar *almanah_get_interface_filename (void);
+GtkWidget *almanah_create_interface (void);
+void almanah_interface_embolden_label (GtkLabel *label);
+void almanah_interface_error (const gchar *message, GtkWidget *parent_window);
+void almanah_calendar_month_changed_cb (GtkCalendar *calendar, gpointer user_data);
G_END_DECLS
-#endif /* DIARY_INTERFACE_H */
+#endif /* ALMANAH_INTERFACE_H */
Modified: trunk/src/link.c
==============================================================================
--- trunk/src/link.c (original)
+++ trunk/src/link.c Wed Oct 22 16:48:40 2008
@@ -226,7 +226,7 @@
AlmanahLinkClass *klass = ALMANAH_LINK_GET_CLASS (self);
g_assert (klass->view != NULL);
- if (diary->debug)
+ if (almanah->debug)
g_debug ("Viewing %s link ('%s', '%s')", klass->type_id, self->priv->value, self->priv->value2);
return klass->view (self);
Modified: trunk/src/links/file.c
==============================================================================
--- trunk/src/links/file.c (original)
+++ trunk/src/links/file.c Wed Oct 22 16:48:40 2008
@@ -77,7 +77,7 @@
if (g_app_info_launch_default_for_uri (value, NULL, NULL) == FALSE) {
g_free (value);
- diary_interface_error (_("Due to an unknown error the file cannot be opened."), diary->main_window);
+ almanah_interface_error (_("Due to an unknown error the file cannot be opened."), almanah->main_window);
return FALSE;
}
Modified: trunk/src/links/note.c
==============================================================================
--- trunk/src/links/note.c (original)
+++ trunk/src/links/note.c Wed Oct 22 16:48:40 2008
@@ -74,7 +74,7 @@
note_view (AlmanahLink *link)
{
gchar *value = almanah_link_get_value (link);
- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (diary->main_window),
+ GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (almanah->main_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
Modified: trunk/src/links/uri.c
==============================================================================
--- trunk/src/links/uri.c (original)
+++ trunk/src/links/uri.c Wed Oct 22 16:48:40 2008
@@ -75,7 +75,7 @@
{
gchar *value = almanah_link_get_value (link);
if (g_app_info_launch_default_for_uri (value, NULL, NULL) == FALSE) {
- diary_interface_error (_("Due to an unknown error the URI cannot be opened."), diary->main_window);
+ almanah_interface_error (_("Due to an unknown error the URI cannot be opened."), almanah->main_window);
g_free (value);
return FALSE;
}
Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c (original)
+++ trunk/src/main-window.c Wed Oct 22 16:48:40 2008
@@ -118,7 +118,7 @@
AlmanahMainWindow *main_window;
AlmanahMainWindowPrivate *priv;
GError *error = NULL;
- const gchar *interface_filename = diary_get_interface_filename ();
+ const gchar *interface_filename = almanah_get_interface_filename ();
const gchar *object_names[] = {
"dry_main_window",
"dry_mw_link_store",
@@ -193,7 +193,7 @@
/* Set up spell checking */
if (gtkspell_new_attach (priv->entry_view, NULL, &error) == FALSE) {
gchar *error_message = g_strdup_printf (_("The spelling checker could not be initialized: %s"), error->message);
- diary_interface_error (error_message, NULL);
+ almanah_interface_error (error_message, NULL);
g_free (error_message);
g_error_free (error);
}
@@ -216,7 +216,7 @@
g_signal_connect (priv->underline_action, "toggled", G_CALLBACK (mw_underline_toggled_cb), main_window);
/* Select the current day and month */
- diary_calendar_month_changed_cb (priv->calendar, NULL);
+ almanah_calendar_month_changed_cb (priv->calendar, NULL);
mw_calendar_day_selected_cb (priv->calendar, main_window);
/* Set up the treeview */
@@ -224,8 +224,8 @@
gtk_tree_view_column_set_cell_data_func (priv->link_value_column, GTK_CELL_RENDERER (priv->link_value_renderer), mw_links_value_data_cb, NULL, NULL);
/* Prettify the UI */
- diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_calendar_label")));
- diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_attached_links_label")));
+ almanah_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_calendar_label")));
+ almanah_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_attached_links_label")));
g_object_unref (builder);
@@ -254,7 +254,7 @@
almanah_entry_get_date (priv->current_entry, &date);
editability = almanah_entry_get_editability (priv->current_entry);
- entry_exists = almanah_storage_manager_entry_exists (diary->storage_manager, &date);
+ entry_exists = almanah_storage_manager_entry_exists (almanah->storage_manager, &date);
entry_is_empty = almanah_entry_is_empty (priv->current_entry);
editability = almanah_entry_get_editability (priv->current_entry);
@@ -319,7 +319,7 @@
}
/* Store the entry! */
- almanah_storage_manager_set_entry (diary->storage_manager, priv->current_entry);
+ almanah_storage_manager_set_entry (almanah->storage_manager, priv->current_entry);
/* Mark the day on the calendar if the entry was non-empty (and deleted)
* and update the state of the add link button. */
@@ -349,12 +349,12 @@
g_assert (gtk_text_buffer_get_char_count (priv->entry_buffer) != 0);
/* Ensure that something is selected and its widgets displayed */
- gtk_widget_show_all (diary->add_link_dialog);
+ gtk_widget_show_all (almanah->add_link_dialog);
- if (gtk_dialog_run (GTK_DIALOG (diary->add_link_dialog)) == GTK_RESPONSE_OK) {
+ if (gtk_dialog_run (GTK_DIALOG (almanah->add_link_dialog)) == GTK_RESPONSE_OK) {
guint year, month, day;
GDate date;
- AlmanahLink *link = almanah_add_link_dialog_get_link (ALMANAH_ADD_LINK_DIALOG (diary->add_link_dialog));
+ AlmanahLink *link = almanah_add_link_dialog_get_link (ALMANAH_ADD_LINK_DIALOG (almanah->add_link_dialog));
if (link == NULL)
return;
@@ -365,7 +365,7 @@
month++;
g_date_set_dmy (&date, day, month, year);
- almanah_storage_manager_add_entry_link (diary->storage_manager, &date, link);
+ almanah_storage_manager_add_entry_link (almanah->storage_manager, &date, link);
/* Add to the treeview */
gtk_list_store_append (priv->link_store, &iter);
@@ -401,7 +401,7 @@
gtk_tree_model_get (model, &iter, 0, &link_type, -1);
/* Remove it from the DB */
- almanah_storage_manager_remove_entry_link (diary->storage_manager, &date, link_type);
+ almanah_storage_manager_remove_entry_link (almanah->storage_manager, &date, link_type);
/* Remove it from the treeview */
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
@@ -537,7 +537,7 @@
mw_delete_event_cb (GtkWindow *window, gpointer user_data)
{
save_current_entry (ALMANAH_MAIN_WINDOW (window));
- diary_quit ();
+ almanah_quit ();
return TRUE;
}
@@ -545,14 +545,14 @@
void
mw_print_activate_cb (GtkAction *action, gpointer user_data)
{
- diary_print_entries ();
+ almanah_print_entries ();
}
void
mw_quit_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
{
save_current_entry (main_window);
- diary_quit ();
+ almanah_quit ();
}
void
@@ -585,15 +585,15 @@
void
mw_search_activate_cb (GtkAction *action, gpointer user_data)
{
- gtk_widget_show_all (diary->search_dialog);
- gtk_dialog_run (GTK_DIALOG (diary->search_dialog));
+ gtk_widget_show_all (almanah->search_dialog);
+ gtk_dialog_run (GTK_DIALOG (almanah->search_dialog));
}
void
mw_preferences_activate_cb (GtkAction *action, gpointer user_data)
{
- gtk_widget_show_all (diary->preferences_dialog);
- gtk_dialog_run (GTK_DIALOG (diary->preferences_dialog));
+ gtk_widget_show_all (almanah->preferences_dialog);
+ gtk_dialog_run (GTK_DIALOG (almanah->preferences_dialog));
}
static void
@@ -661,7 +661,7 @@
_(license_parts[2]),
NULL);
- almanah_storage_manager_get_statistics (diary->storage_manager, &entry_count, &link_count);
+ almanah_storage_manager_get_statistics (almanah->storage_manager, &entry_count, &link_count);
description = g_strdup_printf (_("A helpful diary keeper, storing %u entries and %u links."),
entry_count,
link_count);
@@ -730,12 +730,12 @@
/* Translators: This is a strftime()-format string for the date displayed at the top of the main window. */
g_date_strftime (calendar_string, sizeof (calendar_string), _("%A, %e %B %Y"), &calendar_date);
gtk_label_set_markup (priv->date_label, calendar_string);
- diary_interface_embolden_label (priv->date_label);
+ almanah_interface_embolden_label (priv->date_label);
/* Update the entry */
if (priv->current_entry != NULL)
g_object_unref (priv->current_entry);
- priv->current_entry = almanah_storage_manager_get_entry (diary->storage_manager, &calendar_date);
+ priv->current_entry = almanah_storage_manager_get_entry (almanah->storage_manager, &calendar_date);
if (priv->current_entry == NULL)
priv->current_entry = almanah_entry_new (&calendar_date);
@@ -756,7 +756,7 @@
gtk_text_buffer_set_text (priv->entry_buffer, "", 0);
if (almanah_entry_get_content (priv->current_entry, priv->entry_buffer, &error) == FALSE) {
gchar *error_message = g_strdup_printf (_("The entry content could not be loaded: %s"), error->message);
- diary_interface_error (error_message, NULL);
+ almanah_interface_error (error_message, NULL);
g_free (error_message);
g_error_free (error);
@@ -781,7 +781,7 @@
#endif /* ENABLE_SPELL_CHECKING */
/* List the entry's links */
- links = almanah_storage_manager_get_entry_links (diary->storage_manager, &calendar_date);
+ links = almanah_storage_manager_get_entry_links (almanah->storage_manager, &calendar_date);
i = 0;
while (links[i] != NULL) {
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Wed Oct 22 16:48:40 2008
@@ -1,20 +1,20 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -32,11 +32,11 @@
static void
storage_manager_disconnected_cb (AlmanahStorageManager *self, gpointer user_data)
{
- g_object_unref (diary->storage_manager);
+ g_object_unref (almanah->storage_manager);
#ifdef ENABLE_ENCRYPTION
- g_object_unref (diary->gconf_client);
+ g_object_unref (almanah->gconf_client);
#endif /* ENABLE_ENCRYPTION */
- g_free (diary);
+ g_free (almanah);
if (gtk_main_level () > 0)
gtk_main_quit ();
@@ -45,26 +45,26 @@
}
void
-diary_quit (void)
+almanah_quit (void)
{
GError *error = NULL;
- g_signal_connect (diary->storage_manager, "disconnected", G_CALLBACK (storage_manager_disconnected_cb), NULL);
- if (almanah_storage_manager_disconnect (diary->storage_manager, &error) == FALSE) {
- diary_interface_error (error->message, diary->main_window);
+ g_signal_connect (almanah->storage_manager, "disconnected", G_CALLBACK (storage_manager_disconnected_cb), NULL);
+ if (almanah_storage_manager_disconnect (almanah->storage_manager, &error) == FALSE) {
+ almanah_interface_error (error->message, almanah->main_window);
}
- gtk_widget_destroy (diary->add_link_dialog);
- gtk_widget_destroy (diary->search_dialog);
- gtk_widget_destroy (diary->preferences_dialog);
- gtk_widget_destroy (diary->main_window);
+ gtk_widget_destroy (almanah->add_link_dialog);
+ gtk_widget_destroy (almanah->search_dialog);
+ gtk_widget_destroy (almanah->preferences_dialog);
+ gtk_widget_destroy (almanah->main_window);
/* Quitting is actually done in storage_manager_disconnected_cb, which is called once
* the storage manager has encrypted the DB and disconnected from it.
* Unless, that is, disconnection failed. */
if (error != NULL) {
g_error_free (error);
- storage_manager_disconnected_cb (diary->storage_manager, NULL);
+ storage_manager_disconnected_cb (almanah->storage_manager, NULL);
}
}
@@ -114,12 +114,12 @@
g_option_context_free (context);
/* Setup */
- diary = g_new (Diary, 1);
- diary->debug = debug;
+ almanah = g_new (Almanah, 1);
+ almanah->debug = debug;
#ifdef ENABLE_ENCRYPTION
/* Open GConf */
- diary->gconf_client = gconf_client_get_default ();
+ almanah->gconf_client = gconf_client_get_default ();
#endif /* ENABLE_ENCRYPTION */
/* Ensure the DB directory exists */
@@ -128,17 +128,17 @@
/* Open the DB */
db_filename = g_build_filename (g_get_user_data_dir (), "diary.db", NULL);
- diary->storage_manager = almanah_storage_manager_new (db_filename);
+ almanah->storage_manager = almanah_storage_manager_new (db_filename);
g_free (db_filename);
- if (almanah_storage_manager_connect (diary->storage_manager, &error) == FALSE) {
- diary_interface_error (error->message, NULL);
- diary_quit ();
+ if (almanah_storage_manager_connect (almanah->storage_manager, &error) == FALSE) {
+ almanah_interface_error (error->message, NULL);
+ almanah_quit ();
}
/* Create and show the interface */
- diary_create_interface ();
- gtk_widget_show_all (diary->main_window);
+ almanah_create_interface ();
+ gtk_widget_show_all (almanah->main_window);
gtk_main ();
return 0;
Modified: trunk/src/main.h
==============================================================================
--- trunk/src/main.h (original)
+++ trunk/src/main.h Wed Oct 22 16:48:40 2008
@@ -1,20 +1,20 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -26,8 +26,8 @@
#include "storage-manager.h"
-#ifndef DIARY_MAIN_H
-#define DIARY_MAIN_H
+#ifndef ALMANAH_MAIN_H
+#define ALMANAH_MAIN_H
#ifdef ENABLE_ENCRYPTION
#define ENCRYPTION_KEY_GCONF_PATH "/apps/almanah/encryption_key"
@@ -46,15 +46,13 @@
GtkWidget *search_dialog;
GtkWidget *preferences_dialog;
- GdkAtom native_serialisation_atom;
-
gboolean debug;
-} Diary;
+} Almanah;
-Diary *diary;
+Almanah *almanah;
-void diary_quit (void);
+void almanah_quit (void);
G_END_DECLS
-#endif /* DIARY_MAIN_H */
+#endif /* ALMANAH_MAIN_H */
Modified: trunk/src/preferences-dialog.c
==============================================================================
--- trunk/src/preferences-dialog.c (original)
+++ trunk/src/preferences-dialog.c Wed Oct 22 16:48:40 2008
@@ -105,7 +105,7 @@
AlmanahPreferencesDialog *preferences_dialog;
AlmanahPreferencesDialogPrivate *priv;
GError *error = NULL;
- const gchar *interface_filename = diary_get_interface_filename ();
+ const gchar *interface_filename = almanah_get_interface_filename ();
const gchar *object_names[] = {
"dry_preferences_dialog",
NULL
@@ -145,7 +145,7 @@
/* Grab our child widgets */
table = GTK_TABLE (gtk_builder_get_object (builder, "dry_pd_table"));
label = gtk_label_new (_("Encryption Key"));
- diary_interface_embolden_label (GTK_LABEL (label));
+ almanah_interface_embolden_label (GTK_LABEL (label));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (table, label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
@@ -156,7 +156,7 @@
gtk_table_attach_defaults (table, GTK_WIDGET (priv->key_combo), 2, 3, 1, 2);
/* Set the selected key combo value */
- key = gconf_client_get_string (diary->gconf_client, ENCRYPTION_KEY_GCONF_PATH, NULL);
+ key = gconf_client_get_string (almanah->gconf_client, ENCRYPTION_KEY_GCONF_PATH, NULL);
if (*key == '\0') {
g_free (key);
key = NULL;
@@ -189,9 +189,9 @@
if (key == NULL)
key = "";
- if (gconf_client_set_string (diary->gconf_client, ENCRYPTION_KEY_GCONF_PATH, key, &error) == FALSE) {
+ if (gconf_client_set_string (almanah->gconf_client, ENCRYPTION_KEY_GCONF_PATH, key, &error) == FALSE) {
gchar *error_message = g_strdup_printf (_("There was an error saving the encryption key: %s"), error->message);
- diary_interface_error (error_message, GTK_WIDGET (preferences_dialog));
+ almanah_interface_error (error_message, GTK_WIDGET (preferences_dialog));
g_free (error_message);
g_error_free (error);
}
@@ -206,7 +206,7 @@
if (g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error) == FALSE) {
gchar *error_message = g_strdup_printf (_("There was an error opening Seahorse: %s"), error->message);
- diary_interface_error (error_message, GTK_WIDGET (preferences_dialog));
+ almanah_interface_error (error_message, GTK_WIDGET (preferences_dialog));
g_free (error_message);
g_error_free (error);
}
Modified: trunk/src/printing.c
==============================================================================
--- trunk/src/printing.c (original)
+++ trunk/src/printing.c Wed Oct 22 16:48:40 2008
@@ -1,20 +1,20 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
@@ -39,7 +39,7 @@
guint current_line;
gboolean paginated;
gdouble y;
-} DiaryPrintOperation;
+} AlmanahPrintOperation;
/* Adapted from code in GtkSourceView's gtksourceprintcompositor.c, previously LGPL >= 2.1
* Copyright (C) 2000, 2001 Chema Celorio
@@ -234,7 +234,7 @@
/* TRUE if the entry was printed OK on the current page, FALSE if it needs to be moved to a new page/is split across pages */
static gboolean
-print_entry (GtkPrintOperation *operation, GtkPrintContext *context, DiaryPrintOperation *diary_operation)
+print_entry (GtkPrintOperation *operation, GtkPrintContext *context, AlmanahPrintOperation *almanah_operation)
{
AlmanahEntry *entry;
gchar title[100], *title_markup;
@@ -246,20 +246,20 @@
gdouble title_y = 0, entry_y;
cairo_t *cr = NULL;
- if (diary_operation->current_line == 0) {
+ if (almanah_operation->current_line == 0) {
/* Set up the title layout */
title_layout = gtk_print_context_create_pango_layout (context);
pango_layout_set_width (title_layout, gtk_print_context_get_width (context) * PANGO_SCALE);
/* Translators: This is a strftime()-format string for the date displayed above each printed entry. */
- g_date_strftime (title, sizeof (title), _("%A, %e %B %Y"), diary_operation->current_date);
+ g_date_strftime (title, sizeof (title), _("%A, %e %B %Y"), almanah_operation->current_date);
title_markup = g_strdup_printf ("<b>%s</b>", title);
pango_layout_set_markup (title_layout, title_markup, -1);
g_free (title_markup);
- title_y = diary_operation->y;
+ title_y = almanah_operation->y;
pango_layout_get_pixel_size (title_layout, NULL, &height);
- diary_operation->y += height + TITLE_MARGIN_BOTTOM;
+ almanah_operation->y += height + TITLE_MARGIN_BOTTOM;
}
/* Set up the entry layout */
@@ -267,7 +267,7 @@
pango_layout_set_width (entry_layout, gtk_print_context_get_width (context) * PANGO_SCALE);
pango_layout_set_ellipsize (entry_layout, PANGO_ELLIPSIZE_NONE);
- entry = almanah_storage_manager_get_entry (diary->storage_manager, diary_operation->current_date);
+ entry = almanah_storage_manager_get_entry (almanah->storage_manager, almanah_operation->current_date);
if (entry == NULL || almanah_entry_is_empty (entry)) {
gchar *entry_text = g_strdup_printf ("<i>%s</i>", _("No entry for this date."));
@@ -275,9 +275,9 @@
} else {
GtkTextIter start, end;
- gtk_text_buffer_set_text (diary_operation->buffer, "", 0);
- if (almanah_entry_get_content (entry, diary_operation->buffer, NULL) == TRUE) {
- gtk_text_buffer_get_bounds (diary_operation->buffer, &start, &end);
+ gtk_text_buffer_set_text (almanah_operation->buffer, "", 0);
+ if (almanah_entry_get_content (entry, almanah_operation->buffer, NULL) == TRUE) {
+ gtk_text_buffer_get_bounds (almanah_operation->buffer, &start, &end);
lay_out_entry (entry_layout, &start, &end);
}
}
@@ -286,34 +286,34 @@
g_object_unref (entry);
/* Check we're not orphaning things */
- entry_line = pango_layout_get_line_readonly (entry_layout, MIN (pango_layout_get_line_count (entry_layout), diary_operation->current_line + MAX_ORPHANS) - 1);
+ entry_line = pango_layout_get_line_readonly (entry_layout, MIN (pango_layout_get_line_count (entry_layout), almanah_operation->current_line + MAX_ORPHANS) - 1);
pango_layout_line_get_pixel_extents (entry_line, NULL, &logical_extents);
- if (diary_operation->y + (MIN (pango_layout_get_line_count (entry_layout), MAX_ORPHANS) * logical_extents.height) > gtk_print_context_get_height (context)) {
+ if (almanah_operation->y + (MIN (pango_layout_get_line_count (entry_layout), MAX_ORPHANS) * logical_extents.height) > gtk_print_context_get_height (context)) {
/* Not enough space on the page to contain the title and orphaned lines */
if (title_layout != NULL)
g_object_unref (title_layout);
g_object_unref (entry_layout);
- diary_operation->current_line = 0;
+ almanah_operation->current_line = 0;
return FALSE;
}
- if (diary_operation->paginated == TRUE) {
+ if (almanah_operation->paginated == TRUE) {
cr = gtk_print_context_get_cairo_context (context);
- if (diary_operation->current_line == 0) {
+ if (almanah_operation->current_line == 0) {
/* Draw the title */
cairo_move_to (cr, 0, title_y);
pango_cairo_show_layout (cr, title_layout);
}
}
- entry_y = diary_operation->y;
+ entry_y = almanah_operation->y;
/* Draw the lines in the entry */
- for (i = diary_operation->current_line; i < pango_layout_get_line_count (entry_layout); i++) {
+ for (i = almanah_operation->current_line; i < pango_layout_get_line_count (entry_layout); i++) {
entry_line = pango_layout_get_line_readonly (entry_layout, i);
pango_layout_line_get_pixel_extents (entry_line, NULL, &logical_extents);
@@ -324,12 +324,12 @@
g_object_unref (title_layout);
g_object_unref (entry_layout);
- diary_operation->current_line = i;
+ almanah_operation->current_line = i;
return FALSE;
}
- if (diary_operation->paginated == TRUE) {
+ if (almanah_operation->paginated == TRUE) {
/* Draw the entry line */
cairo_move_to (cr, 0, entry_y);
pango_cairo_show_layout_line (cr, entry_line);
@@ -340,27 +340,27 @@
/* Add the entry's height to the amount printed for this page */
pango_layout_get_pixel_size (entry_layout, NULL, &height);
- diary_operation->y = entry_y + ENTRY_MARGIN_BOTTOM;
+ almanah_operation->y = entry_y + ENTRY_MARGIN_BOTTOM;
if (title_layout != NULL)
g_object_unref (title_layout);
g_object_unref (entry_layout);
- diary_operation->current_line = 0;
+ almanah_operation->current_line = 0;
return TRUE;
}
static gboolean
-paginate_cb (GtkPrintOperation *operation, GtkPrintContext *context, DiaryPrintOperation *diary_operation)
+paginate_cb (GtkPrintOperation *operation, GtkPrintContext *context, AlmanahPrintOperation *almanah_operation)
{
/* Calculate the number of pages by laying everything out :( */
- while (g_date_compare (diary_operation->current_date, diary_operation->end_date) <= 0 &&
- print_entry (operation, context, diary_operation) == TRUE) {
- g_date_add_days (diary_operation->current_date, 1);
+ while (g_date_compare (almanah_operation->current_date, almanah_operation->end_date) <= 0 &&
+ print_entry (operation, context, almanah_operation) == TRUE) {
+ g_date_add_days (almanah_operation->current_date, 1);
}
- if (g_date_compare (diary_operation->current_date, diary_operation->end_date) > 0) {
+ if (g_date_compare (almanah_operation->current_date, almanah_operation->end_date) > 0) {
/* We're done paginating */
return TRUE;
} else {
@@ -369,51 +369,51 @@
g_object_get (operation, "n-pages", &pages, NULL);
gtk_print_operation_set_n_pages (operation, pages + 1);
- diary_operation->y = 0;
+ almanah_operation->y = 0;
return FALSE;
}
}
static void
-draw_page_cb (GtkPrintOperation *operation, GtkPrintContext *context, gint page_number, DiaryPrintOperation *diary_operation)
+draw_page_cb (GtkPrintOperation *operation, GtkPrintContext *context, gint page_number, AlmanahPrintOperation *almanah_operation)
{
- if (diary_operation->paginated == FALSE) {
+ if (almanah_operation->paginated == FALSE) {
/* Reset things before we start printing */
- diary_operation->paginated = TRUE;
- diary_operation->current_line = 0;
- g_date_set_dmy (diary_operation->current_date,
- g_date_get_day (diary_operation->start_date),
- g_date_get_month (diary_operation->start_date),
- g_date_get_year (diary_operation->start_date));
+ almanah_operation->paginated = TRUE;
+ almanah_operation->current_line = 0;
+ g_date_set_dmy (almanah_operation->current_date,
+ g_date_get_day (almanah_operation->start_date),
+ g_date_get_month (almanah_operation->start_date),
+ g_date_get_year (almanah_operation->start_date));
}
- diary_operation->y = 0;
-
- while (g_date_compare (diary_operation->current_date, diary_operation->end_date) <= 0 &&
- print_entry (operation, context, diary_operation) == TRUE) {
- g_date_add_days (diary_operation->current_date, 1);
+ almanah_operation->y = 0;
+
+ while (g_date_compare (almanah_operation->current_date, almanah_operation->end_date) <= 0 &&
+ print_entry (operation, context, almanah_operation) == TRUE) {
+ g_date_add_days (almanah_operation->current_date, 1);
}
}
static GtkWidget *
-create_custom_widget_cb (GtkPrintOperation *operation, DiaryPrintOperation *diary_operation)
+create_custom_widget_cb (GtkPrintOperation *operation, AlmanahPrintOperation *almanah_operation)
{
GtkWidget *start_calendar, *end_calendar;
GtkLabel *start_label, *end_label;
GtkTable *table;
start_calendar = gtk_calendar_new ();
- g_signal_connect (start_calendar, "month-changed", G_CALLBACK (diary_calendar_month_changed_cb), NULL);
+ g_signal_connect (start_calendar, "month-changed", G_CALLBACK (almanah_calendar_month_changed_cb), NULL);
end_calendar = gtk_calendar_new ();
- g_signal_connect (end_calendar, "month-changed", G_CALLBACK (diary_calendar_month_changed_cb), NULL);
+ g_signal_connect (end_calendar, "month-changed", G_CALLBACK (almanah_calendar_month_changed_cb), NULL);
start_label = GTK_LABEL (gtk_label_new (NULL));
gtk_label_set_markup (start_label, _("Start Date"));
- diary_interface_embolden_label (start_label);
+ almanah_interface_embolden_label (start_label);
end_label = GTK_LABEL (gtk_label_new (NULL));
gtk_label_set_markup (end_label, _("End Date"));
- diary_interface_embolden_label (end_label);
+ almanah_interface_embolden_label (end_label);
table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
gtk_table_attach (table, start_calendar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5);
@@ -421,64 +421,64 @@
gtk_table_attach (table, GTK_WIDGET (start_label), 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
gtk_table_attach (table, GTK_WIDGET (end_label), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
- diary_operation->start_calendar = GTK_CALENDAR (start_calendar);
- diary_operation->end_calendar = GTK_CALENDAR (end_calendar);
+ almanah_operation->start_calendar = GTK_CALENDAR (start_calendar);
+ almanah_operation->end_calendar = GTK_CALENDAR (end_calendar);
gtk_widget_show_all (GTK_WIDGET (table));
/* Make sure they have the dates with entries marked */
- diary_calendar_month_changed_cb (GTK_CALENDAR (start_calendar), NULL);
- diary_calendar_month_changed_cb (GTK_CALENDAR (end_calendar), NULL);
+ almanah_calendar_month_changed_cb (GTK_CALENDAR (start_calendar), NULL);
+ almanah_calendar_month_changed_cb (GTK_CALENDAR (end_calendar), NULL);
return GTK_WIDGET (table);
}
static void
-custom_widget_apply_cb (GtkPrintOperation *operation, GtkWidget *widget, DiaryPrintOperation *diary_operation)
+custom_widget_apply_cb (GtkPrintOperation *operation, GtkWidget *widget, AlmanahPrintOperation *almanah_operation)
{
guint year, month, day;
/* Start date */
- gtk_calendar_get_date (diary_operation->start_calendar, &year, &month, &day);
- diary_operation->start_date = g_date_new_dmy (day, month + 1, year);
+ gtk_calendar_get_date (almanah_operation->start_calendar, &year, &month, &day);
+ almanah_operation->start_date = g_date_new_dmy (day, month + 1, year);
/* End date */
- gtk_calendar_get_date (diary_operation->end_calendar, &year, &month, &day);
- diary_operation->end_date = g_date_new_dmy (day, month + 1, year);
+ gtk_calendar_get_date (almanah_operation->end_calendar, &year, &month, &day);
+ almanah_operation->end_date = g_date_new_dmy (day, month + 1, year);
/* Ensure they're in order */
- if (g_date_compare (diary_operation->start_date, diary_operation->end_date) > 0) {
+ if (g_date_compare (almanah_operation->start_date, almanah_operation->end_date) > 0) {
GDate *temp;
- temp = diary_operation->start_date;
- diary_operation->start_date = diary_operation->end_date;
- diary_operation->end_date = temp;
+ temp = almanah_operation->start_date;
+ almanah_operation->start_date = almanah_operation->end_date;
+ almanah_operation->end_date = temp;
}
- diary_operation->current_date = g_memdup (diary_operation->start_date, sizeof (*(diary_operation->start_date)));
+ almanah_operation->current_date = g_memdup (almanah_operation->start_date, sizeof (*(almanah_operation->start_date)));
}
void
-diary_print_entries (void)
+almanah_print_entries (void)
{
GtkPrintOperation *operation;
GtkPrintOperationResult res;
static GtkPrintSettings *settings;
- DiaryPrintOperation diary_operation;
+ AlmanahPrintOperation almanah_operation;
operation = gtk_print_operation_new ();
- diary_operation.current_date = NULL;
- diary_operation.paginated = FALSE;
- diary_operation.y = 0;
- diary_operation.current_line = 0;
+ almanah_operation.current_date = NULL;
+ almanah_operation.paginated = FALSE;
+ almanah_operation.y = 0;
+ almanah_operation.current_line = 0;
- diary_operation.buffer = gtk_text_buffer_new (NULL);
- gtk_text_buffer_create_tag (diary_operation.buffer, "bold",
+ almanah_operation.buffer = gtk_text_buffer_new (NULL);
+ gtk_text_buffer_create_tag (almanah_operation.buffer, "bold",
"weight", PANGO_WEIGHT_BOLD,
NULL);
- gtk_text_buffer_create_tag (diary_operation.buffer, "italic",
+ gtk_text_buffer_create_tag (almanah_operation.buffer, "italic",
"style", PANGO_STYLE_ITALIC,
NULL);
- gtk_text_buffer_create_tag (diary_operation.buffer, "underline",
+ gtk_text_buffer_create_tag (almanah_operation.buffer, "underline",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
@@ -487,13 +487,13 @@
gtk_print_operation_set_n_pages (operation, 1);
- g_signal_connect (operation, "paginate", G_CALLBACK (paginate_cb), &diary_operation);
- g_signal_connect (operation, "draw-page", G_CALLBACK (draw_page_cb), &diary_operation);
- g_signal_connect (operation, "create-custom-widget", G_CALLBACK (create_custom_widget_cb), &diary_operation);
- g_signal_connect (operation, "custom-widget-apply", G_CALLBACK (custom_widget_apply_cb), &diary_operation);
+ g_signal_connect (operation, "paginate", G_CALLBACK (paginate_cb), &almanah_operation);
+ g_signal_connect (operation, "draw-page", G_CALLBACK (draw_page_cb), &almanah_operation);
+ g_signal_connect (operation, "create-custom-widget", G_CALLBACK (create_custom_widget_cb), &almanah_operation);
+ g_signal_connect (operation, "custom-widget-apply", G_CALLBACK (custom_widget_apply_cb), &almanah_operation);
res = gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
- GTK_WINDOW (diary->main_window), NULL);
+ GTK_WINDOW (almanah->main_window), NULL);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY) {
if (settings != NULL)
@@ -501,11 +501,11 @@
settings = g_object_ref (gtk_print_operation_get_print_settings (operation));
}
- if (diary_operation.current_date != NULL) {
- g_object_unref (diary_operation.buffer);
- g_date_free (diary_operation.current_date);
- g_date_free (diary_operation.start_date);
- g_date_free (diary_operation.end_date);
+ if (almanah_operation.current_date != NULL) {
+ g_object_unref (almanah_operation.buffer);
+ g_date_free (almanah_operation.current_date);
+ g_date_free (almanah_operation.start_date);
+ g_date_free (almanah_operation.end_date);
}
g_object_unref (operation);
}
Modified: trunk/src/printing.h
==============================================================================
--- trunk/src/printing.h (original)
+++ trunk/src/printing.h Wed Oct 22 16:48:40 2008
@@ -1,31 +1,31 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * Diary
+ * Almanah
* Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
*
- * Diary is free software: you can redistribute it and/or modify
+ * Almanah is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Diary is distributed in the hope that it will be useful,
+ * Almanah is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Diary. If not, see <http://www.gnu.org/licenses/>.
+ * along with Almanah. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
-#ifndef DIARY_PRINTING_H
-#define DIARY_PRINTING_H
+#ifndef ALMANAH_PRINTING_H
+#define ALMANAH_PRINTING_H
G_BEGIN_DECLS
-void diary_print_entries (void);
+void almanah_print_entries (void);
G_END_DECLS
-#endif /* !DIARY_PRINTING_H */
+#endif /* !ALMANAH_PRINTING_H */
Modified: trunk/src/search-dialog.c
==============================================================================
--- trunk/src/search-dialog.c (original)
+++ trunk/src/search-dialog.c Wed Oct 22 16:48:40 2008
@@ -64,7 +64,7 @@
AlmanahSearchDialog *search_dialog;
AlmanahSearchDialogPrivate *priv;
GError *error = NULL;
- const gchar *interface_filename = diary_get_interface_filename ();
+ const gchar *interface_filename = almanah_get_interface_filename ();
const gchar *object_names[] = {
"dry_search_dialog",
"dry_sd_search_button_image",
@@ -113,7 +113,7 @@
gtk_widget_grab_default (GTK_WIDGET (gtk_builder_get_object (builder, "dry_sd_search_button")));
/* Prettify the UI */
- diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_sd_results_label")));
+ almanah_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_sd_results_label")));
g_object_unref (builder);
@@ -144,7 +144,7 @@
GtkTreeIter iter;
AlmanahSearchDialogPrivate *priv = search_dialog->priv;
- result_count = almanah_storage_manager_search_entries (diary->storage_manager,
+ result_count = almanah_storage_manager_search_entries (almanah->storage_manager,
gtk_entry_get_text (priv->sd_search_entry), &results);
for (i = 0; i < result_count; i++) {
@@ -178,7 +178,7 @@
-1);
g_date_set_dmy (&date, day, month, year);
- almanah_main_window_select_date (ALMANAH_MAIN_WINDOW (diary->main_window), &date);
+ almanah_main_window_select_date (ALMANAH_MAIN_WINDOW (almanah->main_window), &date);
}
void
Modified: trunk/src/storage-manager.c
==============================================================================
--- trunk/src/storage-manager.c (original)
+++ trunk/src/storage-manager.c Wed Oct 22 16:48:40 2008
@@ -408,7 +408,7 @@
guint i;
gchar *encryption_key;
- encryption_key = gconf_client_get_string (diary->gconf_client, ENCRYPTION_KEY_GCONF_PATH, NULL);
+ encryption_key = gconf_client_get_string (almanah->gconf_client, ENCRYPTION_KEY_GCONF_PATH, NULL);
if (encryption_key == NULL || encryption_key[0] == '\0') {
g_free (encryption_key);
return NULL;
@@ -545,7 +545,7 @@
results = g_slice_new (AlmanahQueryResults);
- if (diary->debug)
+ if (almanah->debug)
g_debug ("Database query: %s", new_query);
if (sqlite3_get_table (priv->connection, new_query, &(results->data), &(results->rows), &(results->columns), NULL) != SQLITE_OK) {
g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_RUNNING_QUERY,
@@ -579,7 +579,7 @@
new_query = sqlite3_vmprintf (query, params);
va_end (params);
- if (diary->debug)
+ if (almanah->debug)
g_debug ("Database query: %s", new_query);
if (sqlite3_exec (priv->connection, new_query, callback, user_data, NULL) != SQLITE_OK) {
g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_RUNNING_QUERY,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]