Changeset 2fc76a3e73eaa0277b5429316ba365bb6629ee99


Ignore:
Timestamp:
29/10/10 23:42:15 (3 years ago)
Author:
Matias De la Puente <mfpuente.ar@…>
Children:
6ceb9b5221dc4152dd38147e3c863ac3b8af1f3e
Parents:
15ee35d7152e4a03ef7bfe10e7b6c6f293f4533a
git-author:
Matias De la Puente <mfpuente.ar@…> (29/10/10 10:00:30)
git-committer:
Matias De la Puente <mfpuente.ar@…> (29/10/10 23:42:15)
Message:

Bind properties in GtkFrontend?.DocumentsView?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gtkfrontend/documentsview.vala

    rdfe49c7 r2fc76a3  
    3131        private ActionGroup _action_group; 
    3232         
    33         public bool save_sensitive 
    34         { 
    35                 set { _action_group.get_action ("SaveDocumentAction").sensitive = value; } 
    36                 get { return _action_group.get_action ("SaveDocumentAction").sensitive; } 
    37         } 
    38          
    39         public bool save_as_sensitive 
    40         { 
    41                 set { _action_group.get_action ("SaveAsDocumentAction").sensitive = value; } 
    42                 get { return _action_group.get_action ("SaveAsDocumentAction").sensitive; } 
    43         } 
    44          
    45         public bool print_sensitive 
    46         { 
    47                 set { _action_group.get_action ("PrintDocumentAction").sensitive = value; } 
    48                 get { return _action_group.get_action ("PrintDocumentAction").sensitive; } 
    49         } 
    50          
    51         public bool undo_sensitive 
    52         { 
    53                 set { _action_group.get_action ("UndoDocumentAction").sensitive = value; } 
    54                 get { return _action_group.get_action ("UndoDocumentAction").sensitive; } 
    55         } 
    56          
    57         public bool redo_sensitive 
    58         { 
    59                 set { _action_group.get_action ("RedoDocumentAction").sensitive = value; } 
    60                 get { return _action_group.get_action ("RedoDocumentAction").sensitive; } 
    61         } 
    62          
    63         public bool cut_sensitive 
    64         { 
    65                 set { _action_group.get_action ("CutDocumentAction").sensitive = value; } 
    66                 get { return _action_group.get_action ("CutDocumentAction").sensitive; } 
    67         } 
    68          
    69         public bool copy_sensitive 
    70         { 
    71                 set { _action_group.get_action ("CopyDocumentAction").sensitive = value; } 
    72                 get { return _action_group.get_action ("CopyDocumentAction").sensitive; } 
    73         } 
    74          
    75         public bool paste_sensitive 
    76         { 
    77                 set { _action_group.get_action ("PasteDocumentAction").sensitive = value; } 
    78                 get { return _action_group.get_action ("PasteDocumentAction").sensitive; } 
    79         } 
    80          
    81         public bool search_sensitive 
    82         { 
    83                 set { _action_group.get_action ("SearchDocumentAction").sensitive = value; } 
    84                 get { return _action_group.get_action ("SearchDocumentAction").sensitive; } 
    85         } 
    86          
    87         public bool save_all_sensitive 
    88         { 
    89                 set { _action_group.get_action ("SaveAllDocumentsAction").sensitive = value; } 
    90                 get { return _action_group.get_action ("SaveAllDocumentsAction").sensitive; } 
    91         } 
    92          
    93         public bool close_all_sensitive 
    94         { 
    95                 set { _action_group.get_action ("CloseAllDocumentsAction").sensitive = value; } 
    96                 get { return _action_group.get_action ("CloseAllDocumentsAction").sensitive; } 
    97         } 
     33        public bool save_sensitive { set; get; } 
     34        public bool save_as_sensitive { set; get; } 
     35        public bool print_sensitive { set; get; } 
     36        public bool undo_sensitive { set; get; } 
     37        public bool redo_sensitive { set; get; } 
     38        public bool cut_sensitive { set; get; } 
     39        public bool copy_sensitive { set; get; } 
     40        public bool paste_sensitive { set; get; } 
     41        public bool search_sensitive { set; get; } 
     42        public bool save_all_sensitive { set; get; } 
     43        public bool close_all_sensitive { set; get; } 
    9844         
    9945        public I4uc.Core.PagesPanel pages_panel { get { return _pages_panel; } } 
     
    10147        public I4uc.Core.DocumentPreferencesPageView preferences_page_view { get { return _preferences_page_view; } } 
    10248         
    103         public bool syntax_highlight_menu_sensitive 
    104         { 
    105                 set { _action_group.get_action ("SyntaxHighlightMenuAction").sensitive = value; } 
    106                 get { return _action_group.get_action ("SyntaxHighlightMenuAction").sensitive; } 
    107         } 
     49        public bool syntax_highlight_menu_sensitive { set; get; } 
    10850         
    10951        public DocumentsView (UIManager ui_manager, PagesPanel pages_panel, PagesPanel side_panel) 
     
    15496                 
    15597                _side_panel.add_page (_preferences_page_view); 
     98                 
     99                //Bind properties 
     100                this.bind_property ("save-sensitive", _action_group.get_action ("SaveDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     101                this.bind_property ("save-as-sensitive", _action_group.get_action ("SaveAsDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     102                this.bind_property ("print-sensitive", _action_group.get_action ("PrintDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     103                this.bind_property ("undo-sensitive", _action_group.get_action ("UndoDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     104                this.bind_property ("redo-sensitive", _action_group.get_action ("RedoDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     105                this.bind_property ("cut-sensitive", _action_group.get_action ("CutDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     106                this.bind_property ("copy-sensitive", _action_group.get_action ("CopyDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     107                this.bind_property ("paste-sensitive", _action_group.get_action ("PasteDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     108                this.bind_property ("search-sensitive", _action_group.get_action ("SearchDocumentAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     109                this.bind_property ("save-all-sensitive", _action_group.get_action ("SaveAllDocumentsAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     110                this.bind_property ("close-all-sensitive", _action_group.get_action ("CloseAllDocumentsAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
     111                this.bind_property ("syntax-highlight-menu-sensitive", _action_group.get_action ("SyntaxHighlightMenuAction"), "sensitive", BindingFlags.BIDIRECTIONAL); 
    156112                 
    157113                //Signals 
Note: See TracChangeset for help on using the changeset viewer.