~ubuntu-branches/ubuntu/trusty/eiciel/trusty-proposed

« back to all changes in this revision

Viewing changes to src/eiciel_main_window.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2010-06-04 02:38:02 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100604023802-jp2v6c9uviiioc5z
* New upstream release.
* debian/patches/02-gio.patch
  - Removed, merged upstream.
* debian/patches/03-no-libgnomeui.patch
  - Removed, merged upstream.
* debian/patches/01-fix-gettext-translations.patch
  - Fix gettext translations by using dgettext and specifying the correct
    domainname.
* debian/patches/02-de-po.patch
  - Update and complete German translation.
* debian/rules
  - Remove de.gmo on clean and rebuild it on build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    Eiciel - GNOME editor of ACL file permissions.
3
 
    Copyright (C) 2004-2005 Roger Ferrer Ib��ez
 
3
    Copyright (C) 2004-2010 Roger Ferrer Ib��ez
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
14
14
 
15
15
    You should have received a copy of the GNU General Public License
16
16
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,  USA
18
18
*/
19
19
#ifndef EICIEL_MAIN_WINDOW_HPP
20
20
#define EICIEL_MAIN_WINDOW_HPP
22
22
#include <config.hpp>
23
23
#include <string>
24
24
#include <gtkmm.h>
25
 
#include "llista_acl.hpp"
26
 
#include "llista_participant.hpp"
27
 
#include "eiciel_main_controler.hpp"
28
 
#include "tipus_element_acl.hpp"
 
25
#include "acl_list.hpp"
 
26
#include "participant_list.hpp"
 
27
#include "eiciel_main_controller.hpp"
 
28
#include "acl_element_kind.hpp"
29
29
#include <gettext.h>
30
30
 
31
31
using namespace std;
32
32
 
33
 
class EicielMainControler;
 
33
class EicielMainController;
34
34
 
35
35
class EicielWindow : public Gtk::VBox 
36
36
{
37
37
        public:
38
 
                EicielWindow(EicielMainControler* cont);
 
38
                EicielWindow(EicielMainController* cont);
39
39
                virtual ~EicielWindow();
40
40
 
41
 
                void afegeixNoSeleccionable(Glib::ustring titol, bool lectura, bool escriptura, bool execucio, TipusElement e,
42
 
                                bool efectiuLectura = true, bool efectiuEscriptura = true, bool efectiuExecucio = true);
43
 
                void afegeixSeleccionable(Glib::ustring titol, bool lectura, bool escriptura, bool execucio, TipusElement e,
44
 
                                bool efectiuLectura = true, bool efectiuEscriptura = true, bool efectiuExecucio = true);
45
 
                void buidaLlistaACL();
46
 
                void establirNomFitxer(string nomFitxer);
47
 
                void activarBotoDefaultACL(bool b);
48
 
                void hiHaDefaultACL(bool b);
49
 
                bool donaACLDefault();
50
 
 
51
 
        void inicialitzar(string s);
52
 
                bool fitxerObert();
53
 
 
54
 
                void activacio(bool b);
55
 
 
56
 
                void establirNomesLectura(bool b);
57
 
 
58
 
                void mostrarAdmiracio(bool b);
59
 
                void seleccionarACL(string s, TipusElement e);
60
 
                void canviMostrarSystem();
61
 
 
62
 
                Glib::ustring ultimError();
 
41
                void add_non_selectable(Glib::ustring titol, bool lectura, bool escriptura, bool execucio, ElementKind e,
 
42
                                bool efectiuLectura = true, bool efectiuEscriptura = true, bool efectiuExecucio = true);
 
43
                void add_selectable(Glib::ustring titol, bool lectura, bool escriptura, bool execucio, ElementKind e,
 
44
                                bool efectiuLectura = true, bool efectiuEscriptura = true, bool efectiuExecucio = true);
 
45
                void empty_acl_list();
 
46
                void set_filename(string filename);
 
47
                void enable_default_acl_button(bool b);
 
48
                void there_is_default_acl(bool b);
 
49
                bool give_default_acl();
 
50
 
 
51
        void initialize(string s);
 
52
                bool opened_file();
 
53
 
 
54
                void set_active(bool b);
 
55
 
 
56
                void set_readonly(bool b);
 
57
 
 
58
                void show_exclamation_mark(bool b);
 
59
                void choose_acl(string s, ElementKind e);
 
60
                void toggle_system_show();
 
61
 
 
62
                Glib::ustring last_error();
63
63
 
64
64
        private:
65
 
                Gtk::VBox zona_principal;
66
 
        
67
 
                Glib::RefPtr<Gtk::ListStore> refLlistaACL;
68
 
                Gtk::ScrolledWindow contenidorVistaLlistaACL;
69
 
                Gtk::TreeView vistaLlistaACL;
70
 
        
71
 
        Glib::RefPtr<Gtk::ListStore> refLlistaParticipants;
72
 
        Gtk::ScrolledWindow contenidorVistaLlistaParticipants;
73
 
        Gtk::TreeView vistaLlistaParticipants;
74
 
        
75
 
        Gtk::HBox selector_participant;
76
 
                Gtk::RadioButton ACLusuari;
77
 
                Gtk::RadioButton ACLgrup;
78
 
        Gtk::CheckButton aclDefault;
79
 
                Gtk::ToggleButton modificarACLDefault;
80
 
                Gtk::CheckButton mostrarSystem;
81
 
 
82
 
                Gtk::HBox botonera_mig;
83
 
                Gtk::Button afegirACL;
84
 
                Gtk::Button eliminarACL;
85
 
 
86
 
                Glib::RefPtr<Gdk::Pixbuf> iconaUsuari;
87
 
                Glib::RefPtr<Gdk::Pixbuf> iconaGrup;
88
 
                Glib::RefPtr<Gdk::Pixbuf> iconaAltres;
89
 
                Glib::RefPtr<Gdk::Pixbuf> iconaMascara;
90
 
 
91
 
                Glib::RefPtr<Gdk::Pixbuf> iconaUsuariACL;
92
 
                Glib::RefPtr<Gdk::Pixbuf> iconaGrupACL;
93
 
 
94
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultUsuari;
95
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultGrup;
96
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultAltres;
97
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultUsuariACL;
98
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultGrupACL;
99
 
                Glib::RefPtr<Gdk::Pixbuf> iconaDefaultMascara;
100
 
                
101
 
                Gtk::Frame marc_superior;
102
 
                Gtk::VBox zona_superior;
103
 
                Gtk::Frame marc_inferior;
104
 
                Gtk::VBox zona_inferior;
105
 
                
106
 
                Gtk::Label llegendaInferior;
107
 
 
108
 
                ModelLlistaACL modelLlistaACL;
109
 
        ModelLlistaParticipant modelLlistaParticipant;
110
 
 
111
 
                Glib::RefPtr<Gtk::UIManager> gestorUI;
112
 
 
113
 
                bool modeNomesLectura;
114
 
 
115
 
                EicielMainControler* controlador;
116
 
 
117
 
                set<string> llistaUsuaris;
118
 
                set<string> llistaGrups;
119
 
 
120
 
 
121
 
                void noHiHaFitxer();
122
 
                void canviDeSeleccioACL();
123
 
                void hiHaSeleccioACL();
124
 
                void noHiHaSeleccioACL();
125
 
 
126
 
                void canviDeSeleccioParticipant();
127
 
                void hiHaSeleccioParticipant();
128
 
                void noHiHaSeleccioParticipant();
129
 
                Glib::RefPtr<Gdk::Pixbuf> retornaIconaApropiada(TipusElement e);
130
 
                void afegeixElement(Glib::ustring titol, bool lectura, bool escriptura, bool execucio,
131
 
                                TipusElement e, Gtk::TreeModel::Row& row,
132
 
                                bool efectiuLectura, bool efectiuEscriptura, bool efectiuExecucio);
133
 
                void eliminarACLSeleccionada();
134
 
                void afegirParticipantSeleccionat();
135
 
                void canviPermisos(const Glib::ustring& cadena, TipusPermis p);
136
 
 
137
 
                void emplenarParticipants(set<string>* participants,
138
 
                                TipusElement tipus, 
 
65
                Gtk::VBox _main_area;
 
66
        
 
67
                Glib::RefPtr<Gtk::ListStore> _ref_acl_list;
 
68
                Gtk::ScrolledWindow _listview_acl_container;
 
69
                Gtk::TreeView _listview_acl;
 
70
        
 
71
        Glib::RefPtr<Gtk::ListStore> _ref_participants_list;
 
72
        Gtk::ScrolledWindow _listview_participants_container;
 
73
        Gtk::TreeView _listview_participants;
 
74
        
 
75
        Gtk::HBox _participant_chooser;
 
76
                Gtk::RadioButton _rb_acl_user;
 
77
                Gtk::RadioButton _rb_acl_group;
 
78
        Gtk::CheckButton _cb_acl_default;
 
79
                Gtk::ToggleButton _tb_modify_default_acl;
 
80
                Gtk::CheckButton _cb_show_system_participants;
 
81
 
 
82
                Gtk::HBox _middle_button_group;
 
83
                Gtk::Button _b_add_acl;
 
84
                Gtk::Button _b_remove_acl;
 
85
 
 
86
                Glib::RefPtr<Gdk::Pixbuf> _user_icon;
 
87
                Glib::RefPtr<Gdk::Pixbuf> _group_icon;
 
88
                Glib::RefPtr<Gdk::Pixbuf> _others_icon;
 
89
                Glib::RefPtr<Gdk::Pixbuf> _mask_icon;
 
90
 
 
91
                Glib::RefPtr<Gdk::Pixbuf> _user_icon_acl;
 
92
                Glib::RefPtr<Gdk::Pixbuf> _group_icon_acl;
 
93
 
 
94
                Glib::RefPtr<Gdk::Pixbuf> _default_user_icon;
 
95
                Glib::RefPtr<Gdk::Pixbuf> _default_group_icon;
 
96
                Glib::RefPtr<Gdk::Pixbuf> _default_others_icon;
 
97
                Glib::RefPtr<Gdk::Pixbuf> _default_user_icon_acl;
 
98
                Glib::RefPtr<Gdk::Pixbuf> _default_group_icon_acl;
 
99
                Glib::RefPtr<Gdk::Pixbuf> _default_mask_icon;
 
100
                
 
101
                Gtk::Frame _top_frame;
 
102
                Gtk::VBox _top_area;
 
103
                Gtk::Frame _bottom_frame;
 
104
                Gtk::VBox _bottom_area;
 
105
                
 
106
        Gtk::Image _warning_icon;
 
107
                Gtk::Label _bottom_label;
 
108
 
 
109
                ACLListModel _acl_list_model;
 
110
        ModelLlistaParticipant _participant_list_model;
 
111
 
 
112
        RecursionPolicyModel _recursion_policy_model;
 
113
        Glib::RefPtr<Gtk::ListStore> _recursion_policy_list;
 
114
        Glib::RefPtr<Gtk::ListStore> _dummy_recursion_policy_list;
 
115
 
 
116
                Glib::RefPtr<Gtk::UIManager> _ref_ui_manager;
 
117
 
 
118
                bool _readonly_mode;
 
119
 
 
120
                EicielMainController* _controller;
 
121
 
 
122
                set<string> _users_list;
 
123
                set<string> _groups_list;
 
124
 
 
125
 
 
126
                void there_is_no_file();
 
127
                void acl_selection_change();
 
128
                void there_is_acl_selection();
 
129
                void there_is_no_acl_selection();
 
130
 
 
131
                void change_participant_selection();
 
132
                void there_is_participant_selection();
 
133
                void there_is_no_participant_selection();
 
134
                Glib::RefPtr<Gdk::Pixbuf> get_proper_icon(ElementKind e);
 
135
                void add_element(Glib::ustring title, bool reading, bool writing, bool execution,
 
136
                                ElementKind e, Gtk::TreeModel::Row& row,
 
137
                                bool effective_reading, bool effective_writing, bool effective_execution,
 
138
                bool can_be_recursed);
 
139
                void remove_selected_acl();
 
140
                void add_selected_participant();
 
141
                void change_permissions(const Glib::ustring& cadena, PermissionKind p);
 
142
 
 
143
                void fill_participants(set<string>* participants,
 
144
                                ElementKind tipus, 
139
145
                                Glib::RefPtr<Gdk::Pixbuf> iconaNormal,
140
146
                                Glib::RefPtr<Gdk::Pixbuf> iconaDefecte);
141
147
 
142
148
 
143
 
                void dobleClicLlistaParticipants(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
144
 
                void dobleClicLlistaACL(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
145
 
 
146
 
 
147
 
                bool funcioSeleccioACL(const Glib::RefPtr<Gtk::TreeModel>& model,
 
149
                void participants_list_double_click(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
 
150
                void acl_list_double_click(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
 
151
 
 
152
 
 
153
                bool acl_selection_function(const Glib::RefPtr<Gtk::TreeModel>& model,
148
154
                                const Gtk::TreeModel::Path& path, bool);
149
155
 
150
 
                void establirValorDragAndDrop(const Glib::RefPtr<Gdk::DragContext>&, 
 
156
        void acl_cell_data_func(Gtk::CellRenderer*, const Gtk::TreeModel::iterator&);
 
157
 
 
158
                void set_value_drag_and_drop(const Glib::RefPtr<Gdk::DragContext>&, 
151
159
                                Gtk::SelectionData& selection_data, guint, guint);
152
 
                void rebreValorDragAndDrop(const Glib::RefPtr<Gdk::DragContext>& context, 
 
160
                void get_value_drag_and_drop(const Glib::RefPtr<Gdk::DragContext>& context, 
153
161
                                int, int, const Gtk::SelectionData& selection_data, guint, guint time);
154
162
 
155
 
                void iniciDragAndDrop(const Glib::RefPtr<Gdk::DragContext>&);
156
 
 
157
 
                void canviarTipusParticipant();
 
163
                void start_drag_and_drop(const Glib::RefPtr<Gdk::DragContext>&);
 
164
 
 
165
                void change_participant_kind();
 
166
 
 
167
        void recursion_policy_change(const Glib::ustring& path_string, const Glib::ustring& new_text);
 
168
        
158
169
};
159
170
 
160
171
#endif