Exemple #1
0
        public NotebookMenuItem(Note note, Notebook notebook) :
            base(notebook == null ? Catalog.GetString("No notebook") : notebook.Name)
        {
            this.note     = note;
            this.notebook = notebook;

            if (notebook == null)
            {
                // This is for the "No notebook" menu item

                // Check to see if the specified note belongs
                // to a notebook.  If so, don't activate the
                // radio button.
                if (NotebookManager.GetNotebookFromNote(note) == null)
                {
                    Active = true;
                }
            }
            else if (notebook.ContainsNote(note))
            {
                Active = true;
            }

            Activated += OnActivated;
        }
Exemple #2
0
        public override void OnNoteOpened()
        {
            if (menu == null)
            {
                menu = new Gtk.Menu();
                menu.ShowAll();
            }

            if (toolButton == null)
            {
                InitializeToolButton();

                // Disable the notebook button if this note is a template note
                Tag templateTag = TagManager.GetOrCreateSystemTag(TagManager.TemplateNoteSystemTag);
                if (Note.ContainsTag(templateTag) == true)
                {
                    toolButton.Sensitive = false;

                    // Also prevent notebook templates from being deleted
                    if (NotebookManager.GetNotebookFromNote(Note) != null)
                    {
                        Note.Window.DeleteButton.Sensitive = false;
                    }
                }
            }
        }
Exemple #3
0
 private void UpdateButtonSensitivity(bool isTemplate)
 {
     if (toolButton != null)
     {
         toolButton.Sensitive = !isTemplate;
     }
     if (Note.HasWindow)
     {
         Note.Window.DeleteButton.Sensitive = !isTemplate || NotebookManager.GetNotebookFromNote(Note) == null;
     }
 }
Exemple #4
0
        void UpdateNotebookButtonLabel()
        {
            Notebook currentNotebook = NotebookManager.GetNotebookFromNote(Note);

            UpdateNotebookButtonLabel(currentNotebook);
        }