[gnote] Make speial notebook uneditable
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Make speial notebook uneditable
- Date: Thu, 30 Dec 2010 20:44:57 +0000 (UTC)
commit a32ee029479715bf538fd6f08e329a47e9d74544
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date: Wed Dec 29 23:09:52 2010 +0200
Make speial notebook uneditable
Switch editable property on selection change depending on selected notebook.
Fixes Bug 624072.
src/recentchanges.cpp | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 5cbc284..2162e14 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -1362,11 +1362,22 @@ namespace gnote {
if (notebook->get_tag()) {
m_selected_tags.insert(notebook->get_tag());
}
+ bool allow_edit = false;
if (std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
am["DeleteNotebookAction"]->set_sensitive(false);
}
else {
am["DeleteNotebookAction"]->set_sensitive(true);
+ allow_edit = true;
+ }
+
+ Glib::ListHandle<Gtk::CellRenderer*> renderers = m_notebooksTree->get_column(0)->get_cell_renderers();
+ for (Glib::ListHandle<Gtk::CellRenderer*>::iterator renderer = renderers.begin();
+ renderer != renderers.end(); ++renderer) {
+ Gtk::CellRendererText *text_rederer = dynamic_cast<Gtk::CellRendererText*>(*renderer);
+ if (text_rederer) {
+ text_rederer->property_editable() = allow_edit;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]