[gnome-games/sudoku-vala] sudoku: Always save notes when editor closes
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/sudoku-vala] sudoku: Always save notes when editor closes
- Date: Mon, 19 Dec 2011 10:45:45 +0000 (UTC)
commit 94adbe97cfdb006effa5358d01d036d814bd7d9c
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date: Tue Jul 12 18:53:53 2011 +0200
sudoku: Always save notes when editor closes
gnome-sudoku/src/sudoku-view.vala | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gnome-sudoku/src/sudoku-view.vala b/gnome-sudoku/src/sudoku-view.vala
index 01160f8..b0399a2 100644
--- a/gnome-sudoku/src/sudoku-view.vala
+++ b/gnome-sudoku/src/sudoku-view.vala
@@ -180,19 +180,11 @@ private class SudokuCellView : Gtk.DrawingArea
popup.add (entry);
entry.focus_out_event.connect (() => {
- editing_notes = false;
- hide_popup ();
+ hide_note_editor (entry, top);
return true;
});
- entry.activate.connect (() => {
- editing_notes = false;
- if (top == 0)
- top_notes = entry.get_text ();
- else
- bottom_notes = entry.get_text ();
- hide_popup ();
- });
+ entry.activate.connect (() => { hide_note_editor (entry, top); });
int x, y, height;
@@ -202,6 +194,16 @@ private class SudokuCellView : Gtk.DrawingArea
popup.move (x, y + top * (get_allocated_height () - height));
}
+ private void hide_note_editor (Gtk.Entry entry, int top)
+ {
+ editing_notes = false;
+ if (top == 0)
+ top_notes = entry.get_text ();
+ else
+ bottom_notes = entry.get_text ();
+ hide_popup ();
+ }
+
private bool focus_out_cb (Gtk.Widget widget, Gdk.EventFocus event)
{
if (editing_notes) return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]