r2020 - in trunk/src/target/OM-2007/applications/openmoko-contacts: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Fri May 18 18:42:14 CEST 2007
Author: thomas
Date: 2007-05-18 18:42:12 +0200 (Fri, 18 May 2007)
New Revision: 2020
Modified:
trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-history.c
Log:
Patch by: Neil J Patel <njp at o-hand.com>
* src/contacts-callbacks-ui.c: (contacts_delete_cb):
* src/contacts-history.c: (contacts_history_refresh_ui):
- Replaces GtkDialog with MokoMessageDialog.
- Shows 'No communication history', when there is no
communication history.
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-05-18 15:16:09 UTC (rev 2019)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-05-18 16:42:12 UTC (rev 2020)
@@ -2,6 +2,18 @@
Patch by: Neil J Patel <njp at o-hand.com>
+ * src/contacts-callbacks-ui.c: (contacts_delete_cb):
+ * src/contacts-history.c: (contacts_history_refresh_ui):
+ - Replaces GtkDialog with MokoMessageDialog.
+ - Shows 'No communication history', when there is no
+ communication history.
+
+
+
+2007-05-18 Thomas Wood <thomas at openedhand.com>
+
+ Patch by: Neil J Patel <njp at o-hand.com>
+
* src/Makefile.am:
* src/contacts-callbacks-ui.c: (contacts_selection_cb):
* src/contacts-defs.h:
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c 2007-05-18 15:16:09 UTC (rev 2019)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c 2007-05-18 16:42:12 UTC (rev 2020)
@@ -34,6 +34,7 @@
#include "contacts-callbacks-ebook.h"
#include "contacts-main.h"
#include "contacts-history-view.h"
+#include "contacts-omoko.h"
void
contacts_chooser_add_cb (GtkWidget *button, ContactsData *data)
@@ -195,7 +196,7 @@
GtkWidget *dialog, *main_window;
gint result, count_selected;
EContact *contact;
- GList *widgets, *selected_paths, *current_path;
+ GList *selected_paths, *current_path;
GList *contact_list = NULL;
const gchar *name;
gchar *message = NULL;
@@ -241,14 +242,19 @@
main_window = data->ui->main_window;
- dialog = gtk_message_dialog_new (GTK_WINDOW (main_window),
- 0, GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_CANCEL,
- message);
- gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_DELETE,
- GTK_RESPONSE_YES, NULL);
+ main_window = data->ui->main_window;
+ dialog = moko_message_dialog_new ();
+
+ moko_message_dialog_set_message (MOKO_MESSAGE_DIALOG (dialog),
+ "%s", message);
+ moko_message_dialog_set_image_from_stock (MOKO_MESSAGE_DIALOG (dialog),
+ GTK_STOCK_DIALOG_QUESTION);
+
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_DELETE, GTK_RESPONSE_YES,
+ NULL);
- widgets = contacts_set_widgets_desensitive (main_window);
result = gtk_dialog_run (GTK_DIALOG (dialog));
switch (result) {
case GTK_RESPONSE_YES:
@@ -261,8 +267,6 @@
g_list_foreach (contact_list, (GFunc) g_free, NULL);
g_list_free (contact_list);
gtk_widget_destroy (dialog);
- contacts_set_widgets_sensitive (widgets);
- g_list_free (widgets);
}
void
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-history.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-history.c 2007-05-18 15:16:09 UTC (rev 2019)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-history.c 2007-05-18 16:42:12 UTC (rev 2020)
@@ -491,7 +491,6 @@
correspond to the the priv->uid
FIXME : MokoJournal should have a special function for this.
*/
- g_print ("%s\n", priv->uid);
gint len = moko_journal_get_nb_entries (priv->journal);
gint i;
for (i = 0; i < len; i++) {
@@ -507,6 +506,13 @@
/* Sort the list in order of time, most recent first */
children = g_list_sort (children, (GCompareFunc)_sort_by_date);
+ if (!children) {
+ GtkWidget *label = gtk_label_new ("No communication history");
+ gtk_box_pack_start (GTK_BOX (history), label, TRUE, TRUE, 0);
+ gtk_widget_show_all (GTK_WIDGET (history));
+ return;
+ }
+
/* Finally, go through the sorted list creating the widgets and adding them */
for (c = children; c != NULL; c = c->next) {
GtkWidget *preview = NULL;
More information about the commitlog
mailing list