[referencer] Adding "Notes" functionality

John Spray jcspray at icculus.org
Wed May 7 17:40:18 EDT 2008


On Wed, 2008-05-07 at 14:08 -0400, Charlotte Curtis wrote:
> I *think* I've managed to fix the things that you suggested.  The only
> thing I can't get to work is saving the preferred size of the notes
> pane (the VBox doesn't seem to emit a configure event - I guess maybe
> I could change it so that when the program is quit the preference is
> updated, but it'd be nice to get it to work the "right" way).

I've changed that to use signal_size_allocate of the docview widget in
the top pane, and set up the size using the set_position method of the
vpaned.  Using set_size_request on the notes pane doesn't work because
the size request is a persistent minimum, so next time you start the
program you can't make it any smaller.

I also set the shadow property on the scrolledwindow and italicised the
name of the document in the label.

I see you're setting the label's width in characters to be the width of
the window divided by 10: that's not very flexible.  I've changed that
to not specify a static width, instead setting the expand and fill
arguments to true when packing it into the hbox.  This also allows the
ellipsizing to do its magic (the static width was overriding it).

The "static Document *doc" in updateNotesPane is initialised to
docview_->getSelectedDoc: it seems to me it ought to be NULL initially
so I've changed that.

I've added a function onNotesChanged which sets the dirty flag on the
library when notes are edited: otherwise if a note is written and
referencer is closed without changing the document selection the user is
not prompted to save.

Minor bug to deal with somewhere down the line is that the document
title doesn't get updated in the notes label when it is edited without
changing selection.  Document objects don't currently publish a
"something about me changed" signal, so there's no particularly neat way
of doing this right now.

By the way... this one would have confused the translators! :-)

@@ -954,7 +985,7 @@ bool RefWindow::ensureSaved ()
                        Gtk::BUTTONS_NONE,
                        true);
 
-               dialog.add_button (_("Close _without Saving"), Gtk::RESPONSE_CLOSE);
+               dialog.add_button (_("ensureSavedlose _without Saving"), Gtk::RESPONSE_CLOSE);
                dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
                dialog.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);

Regards,
John




More information about the referencer mailing list