[gnome-notes/wip/igaldino/new-note-title: 7/10] main-toolbar: Update note title
- From: Isaque Galdino de Araujo <igaldino src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-notes/wip/igaldino/new-note-title: 7/10] main-toolbar: Update note title
- Date: Thu, 1 Aug 2019 20:15:40 +0000 (UTC)
commit d6656afd6cddb6c6091d64085179bb48dbede260
Author: Isaque Galdino <igaldino gmail com>
Date: Sun Jun 9 21:56:40 2019 -0300
main-toolbar: Update note title
data/resources/main-toolbar.ui | 1 +
src/bjb-main-toolbar.c | 9 +++++++++
src/libbiji/biji-note-obj.c | 1 +
3 files changed, 11 insertions(+)
---
diff --git a/data/resources/main-toolbar.ui b/data/resources/main-toolbar.ui
index 811ba6b..eea8d52 100644
--- a/data/resources/main-toolbar.ui
+++ b/data/resources/main-toolbar.ui
@@ -436,6 +436,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max-width-chars">60</property>
+ <signal name="changed" handler="on_title_changed" swapped="yes"/>
</object>
</interface>
diff --git a/src/bjb-main-toolbar.c b/src/bjb-main-toolbar.c
index 2bb281d..d89475d 100644
--- a/src/bjb-main-toolbar.c
+++ b/src/bjb-main-toolbar.c
@@ -435,6 +435,13 @@ on_last_updated_cb (BijiItem *note,
gtk_label_set_text (GTK_LABEL (self->last_update_item), label);
}
+static void
+on_title_changed (BjbMainToolbar *self,
+ GtkEntry *title)
+{
+ biji_note_obj_set_title (self->note, gtk_entry_get_text (title));
+}
+
static void
populate_bar_for_note_view (BjbMainToolbar *self)
{
@@ -811,6 +818,8 @@ bjb_main_toolbar_class_init (BjbMainToolbarClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_view_mode_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_empty_clicked_callback);
gtk_widget_class_bind_template_callback (widget_class, on_color_button_clicked);
+
+ gtk_widget_class_bind_template_callback (widget_class, on_title_changed);
}
BjbMainToolbar *
diff --git a/src/libbiji/biji-note-obj.c b/src/libbiji/biji-note-obj.c
index 9099077..9bdb1a0 100644
--- a/src/libbiji/biji-note-obj.c
+++ b/src/libbiji/biji-note-obj.c
@@ -319,6 +319,7 @@ biji_note_obj_set_title (BijiNoteObj *note, const gchar *proposed_title)
/* Emit signal even if initial title, just to let know */
biji_note_id_set_title (priv->id, title);
+ biji_note_obj_save_note (note);
g_signal_emit (G_OBJECT (note), biji_obj_signals[NOTE_RENAMED], 0);
retval = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]