22
22
#include <config.hpp>
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>
31
31
using namespace std;
33
class EicielMainControler;
33
class EicielMainController;
35
35
class EicielWindow : public Gtk::VBox
38
EicielWindow(EicielMainControler* cont);
38
EicielWindow(EicielMainController* cont);
39
39
virtual ~EicielWindow();
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();
51
void inicialitzar(string s);
54
void activacio(bool b);
56
void establirNomesLectura(bool b);
58
void mostrarAdmiracio(bool b);
59
void seleccionarACL(string s, TipusElement e);
60
void canviMostrarSystem();
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();
51
void initialize(string s);
54
void set_active(bool b);
56
void set_readonly(bool b);
58
void show_exclamation_mark(bool b);
59
void choose_acl(string s, ElementKind e);
60
void toggle_system_show();
62
Glib::ustring last_error();
65
Gtk::VBox zona_principal;
67
Glib::RefPtr<Gtk::ListStore> refLlistaACL;
68
Gtk::ScrolledWindow contenidorVistaLlistaACL;
69
Gtk::TreeView vistaLlistaACL;
71
Glib::RefPtr<Gtk::ListStore> refLlistaParticipants;
72
Gtk::ScrolledWindow contenidorVistaLlistaParticipants;
73
Gtk::TreeView vistaLlistaParticipants;
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;
82
Gtk::HBox botonera_mig;
83
Gtk::Button afegirACL;
84
Gtk::Button eliminarACL;
86
Glib::RefPtr<Gdk::Pixbuf> iconaUsuari;
87
Glib::RefPtr<Gdk::Pixbuf> iconaGrup;
88
Glib::RefPtr<Gdk::Pixbuf> iconaAltres;
89
Glib::RefPtr<Gdk::Pixbuf> iconaMascara;
91
Glib::RefPtr<Gdk::Pixbuf> iconaUsuariACL;
92
Glib::RefPtr<Gdk::Pixbuf> iconaGrupACL;
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;
101
Gtk::Frame marc_superior;
102
Gtk::VBox zona_superior;
103
Gtk::Frame marc_inferior;
104
Gtk::VBox zona_inferior;
106
Gtk::Label llegendaInferior;
108
ModelLlistaACL modelLlistaACL;
109
ModelLlistaParticipant modelLlistaParticipant;
111
Glib::RefPtr<Gtk::UIManager> gestorUI;
113
bool modeNomesLectura;
115
EicielMainControler* controlador;
117
set<string> llistaUsuaris;
118
set<string> llistaGrups;
122
void canviDeSeleccioACL();
123
void hiHaSeleccioACL();
124
void noHiHaSeleccioACL();
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);
137
void emplenarParticipants(set<string>* participants,
67
Glib::RefPtr<Gtk::ListStore> _ref_acl_list;
68
Gtk::ScrolledWindow _listview_acl_container;
69
Gtk::TreeView _listview_acl;
71
Glib::RefPtr<Gtk::ListStore> _ref_participants_list;
72
Gtk::ScrolledWindow _listview_participants_container;
73
Gtk::TreeView _listview_participants;
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;
82
Gtk::HBox _middle_button_group;
83
Gtk::Button _b_add_acl;
84
Gtk::Button _b_remove_acl;
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;
91
Glib::RefPtr<Gdk::Pixbuf> _user_icon_acl;
92
Glib::RefPtr<Gdk::Pixbuf> _group_icon_acl;
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;
101
Gtk::Frame _top_frame;
103
Gtk::Frame _bottom_frame;
104
Gtk::VBox _bottom_area;
106
Gtk::Image _warning_icon;
107
Gtk::Label _bottom_label;
109
ACLListModel _acl_list_model;
110
ModelLlistaParticipant _participant_list_model;
112
RecursionPolicyModel _recursion_policy_model;
113
Glib::RefPtr<Gtk::ListStore> _recursion_policy_list;
114
Glib::RefPtr<Gtk::ListStore> _dummy_recursion_policy_list;
116
Glib::RefPtr<Gtk::UIManager> _ref_ui_manager;
120
EicielMainController* _controller;
122
set<string> _users_list;
123
set<string> _groups_list;
126
void there_is_no_file();
127
void acl_selection_change();
128
void there_is_acl_selection();
129
void there_is_no_acl_selection();
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);
143
void fill_participants(set<string>* participants,
139
145
Glib::RefPtr<Gdk::Pixbuf> iconaNormal,
140
146
Glib::RefPtr<Gdk::Pixbuf> iconaDefecte);
143
void dobleClicLlistaParticipants(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
144
void dobleClicLlistaACL(const Gtk::TreeModel::Path& p, Gtk::TreeViewColumn* c);
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);
153
bool acl_selection_function(const Glib::RefPtr<Gtk::TreeModel>& model,
148
154
const Gtk::TreeModel::Path& path, bool);
150
void establirValorDragAndDrop(const Glib::RefPtr<Gdk::DragContext>&,
156
void acl_cell_data_func(Gtk::CellRenderer*, const Gtk::TreeModel::iterator&);
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);
155
void iniciDragAndDrop(const Glib::RefPtr<Gdk::DragContext>&);
157
void canviarTipusParticipant();
163
void start_drag_and_drop(const Glib::RefPtr<Gdk::DragContext>&);
165
void change_participant_kind();
167
void recursion_policy_change(const Glib::ustring& path_string, const Glib::ustring& new_text);