2
Eiciel - GNOME editor of ACL file permissions.
3
Copyright (C) 2004-2005 Roger Ferrer Ibáñez
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
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
20
#include "eiciel_xattr_controler.hpp"
22
EicielXAttrControler::EicielXAttrControler()
23
: gestorXAttr(NULL), finestra(NULL), _fitxerObert(false)
27
void EicielXAttrControler::obrirFitxer(const Glib::ustring& nomFitxer) throw (GestorXAttrException)
29
if (gestorXAttr != NULL)
36
gestorXAttr = new GestorXAttr(nomFitxer);
39
finestra->activacio(true);
43
finestra->ompleAtributs(gestorXAttr->donarLlistaAtributs());
45
catch (GestorXAttrException e)
50
finestra->activacio(false);
54
void EicielXAttrControler::eliminarAtribut(const Glib::ustring& nomAtrib) throw (GestorXAttrException)
56
gestorXAttr->eliminarAtribut(nomAtrib);
59
void EicielXAttrControler::afegirAtribut(const Glib::ustring& nomAtrib, const Glib::ustring& valorAtrib) throw (GestorXAttrException)
61
gestorXAttr->afegirAtribut(nomAtrib, valorAtrib);
64
void EicielXAttrControler::actualitzarValorAtribut(const Glib::ustring& nomAtrib, const Glib::ustring& valorNouAtrib) throw (GestorXAttrException)
66
gestorXAttr->afegirAtribut(nomAtrib, valorNouAtrib);
69
void EicielXAttrControler::modificarNomAtribut(const Glib::ustring& nomAnticAtribut, const Glib::ustring& nomNouAtribut) throw (GestorXAttrException)
71
gestorXAttr->canviarNomAtribut(nomAnticAtribut, nomNouAtribut);
74
void EicielXAttrControler::comprovarEditable()
77
* Comprovem que es el propietari o root
79
uid_t real_user = getuid();
80
if ((real_user != 0) && (real_user != gestorXAttr->donarUidPropietari()))
82
finestra->establirNomesLectura(true);
86
finestra->establirNomesLectura(false);