Diff of /trunk/src/notes.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 302 by harbaum, Fri Aug 27 12:04:34 2010 UTC revision 303 by harbaum, Tue Sep 14 09:28:57 2010 UTC
# Line 563  static gboolean focus_in(GtkWidget *widg Line 563  static gboolean focus_in(GtkWidget *widg
563  }  }
564  #endif  #endif
565    
566    #ifndef FREMANTLE
567  static gboolean focus_out(GtkWidget *widget, GdkEventFocus *event,  static gboolean focus_out(GtkWidget *widget, GdkEventFocus *event,
568                           gpointer data) {                           gpointer data) {
569    cache_context_t *context = (cache_context_t*)data;    cache_context_t *context = (cache_context_t*)data;
# Line 574  static gboolean focus_out(GtkWidget *wid Line 575  static gboolean focus_out(GtkWidget *wid
575    
576    return FALSE;    return FALSE;
577  }  }
578    #else
579    static void coo_changed(GtkWidget *widget, gpointer data) {
580      notes_save((cache_context_t*)data);
581    }
582    #endif
583    
584  GtkWidget *cache_notes(cache_context_t *context) {  GtkWidget *cache_notes(cache_context_t *context) {
585    cache_t *cache = context->cache;    cache_t *cache = context->cache;
# Line 639  GtkWidget *cache_notes(cache_context_t * Line 645  GtkWidget *cache_notes(cache_context_t *
645      preset_coordinate_picker(context->appdata,      preset_coordinate_picker(context->appdata,
646                               context->notes.latw, context->notes.lonw);                               context->notes.latw, context->notes.lonw);
647    
648      /* on fremantle we react on "changed" event instead since this */
649      /* means that editing is done */
650    #ifdef FREMANTLE
651      g_signal_connect(G_OBJECT(context->notes.latw), "changed",
652                       G_CALLBACK(coo_changed), context);
653      g_signal_connect(G_OBJECT(context->notes.lonw), "changed",
654                       G_CALLBACK(coo_changed), context);
655    #else
656    g_signal_connect(G_OBJECT(context->notes.latw), "focus-out-event",    g_signal_connect(G_OBJECT(context->notes.latw), "focus-out-event",
657                     G_CALLBACK(focus_out), context);                     G_CALLBACK(focus_out), context);
658    g_signal_connect(G_OBJECT(context->notes.lonw), "focus-out-event",    g_signal_connect(G_OBJECT(context->notes.lonw), "focus-out-event",
659                     G_CALLBACK(focus_out), context);                     G_CALLBACK(focus_out), context);
660    #endif
661    
662    GtkWidget *ihbox = gtk_hbox_new(FALSE, 0);    GtkWidget *ihbox = gtk_hbox_new(FALSE, 0);
663    
# Line 742  GtkWidget *cache_notes(cache_context_t * Line 756  GtkWidget *cache_notes(cache_context_t *
756    return vbox;    return vbox;
757  }  }
758    
759    void notes_logged(cache_context_t *context) {
760    
761      /* if you log it, you sure also found it */
762      check_button_set_active(context->notes.foundw, TRUE);
763      check_button_set_active(context->notes.loggedw, TRUE);
764    
765      gtk_widget_set_sensitive(context->notes.foundw, FALSE);
766      gtk_widget_set_sensitive(context->notes.loggedw, TRUE);
767    
768      ftime_update(context->notes.foundw, context, TRUE);
769    }
770    
771  void notes_free(notes_t *notes) {  void notes_free(notes_t *notes) {
772    if(notes) {    if(notes) {
773      if(notes->text) xmlFree(notes->text);      if(notes->text) xmlFree(notes->text);

Legend:
Removed from v.302  
changed lines
  Added in v.303