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
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
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
20
20
#include <config.hpp>
26
26
#include <gio/gio.h>
27
27
#include <gettext.h>
29
#include "eiciel_main_controler.hpp"
29
#include "eiciel_main_controller.hpp"
30
30
#include "eiciel_main_window.hpp"
31
31
#include "eiciel_nautilus_page.hpp"
33
33
#ifdef ENABLE_USER_XATTR
34
#include "eiciel_xattr_controler.hpp"
34
#include "eiciel_xattr_controller.hpp"
35
35
#include "eiciel_xattr_window.hpp"
74
// Aquesta funci� retorna una GList amb les
75
// p�gines que proporcionarem a Nautilus
74
// Returns a GList wit the pages we're going to provide
76
76
static GList* nautilus_get_property_pages (NautilusPropertyPageProvider *provider,
82
82
NautilusPropertyPage *real_page;
83
83
NautilusFileInfo* file;
85
// Obtenim la informaci� dels fitxers i comprovem que nom�s s'ha
85
// Check that only one file has been selected
87
86
if (!files || files->next != NULL)
91
90
file = (NautilusFileInfo*)files->data;
93
// Ara obtenim la URI de Nautilus
92
// Get the uri from nautilus
94
93
uri = nautilus_file_info_get_uri (file);
101
GFile *guri = g_file_new_for_uri (uri);
100
GFile* guri = g_file_new_for_uri(uri);
103
// i comprovem que �s local
104
if (!g_file_has_uri_scheme (guri, "file"))
102
// and check that it is local
103
if (!g_file_has_uri_scheme(guri, "file"))
106
g_object_unref (guri);
105
g_object_unref(guri);
110
// Si �s local obtenim el path del fitxer
111
local_file = g_file_get_path (guri);
112
g_object_unref (guri);
109
// if local, get the path of the file
110
local_file = g_file_get_path(guri);
111
g_object_unref(guri);
114
// Alguns fitxers son locals pero no corresponen a un fitxer real
113
// Well, some files are local but do not have a real file behind them
115
114
if (local_file == NULL)
120
// Inicialitzem gtkmm
121
// TODO - �?�? Preguntar a la gent de gtkmm
120
// TODO: Is this correct ? (it works, though)
122
121
Gtk::Main::init_gtkmm_internals();
124
// Ara creem el controlador i la vista
125
EicielMainControler* main_controler = new EicielMainControler();
126
EicielWindow* eiciel_window = Gtk::manage(new EicielWindow(main_controler));
128
main_controler->obreFitxer(std::string(local_file));
123
// Now create the controller and the view
124
EicielMainController* main_controller = new EicielMainController();
125
EicielWindow* eiciel_window = Gtk::manage(new EicielWindow(main_controller));
127
main_controller->open_file(std::string(local_file));
130
if (!main_controler->fitxerObert())
129
if (!main_controller->opened_file())
132
131
delete eiciel_window;
136
eiciel_window->show_all();
138
135
real_page = nautilus_property_page_new
139
136
("EicielPropertyPage::property_page",
140
137
gtk_label_new (_("Access Control List")),
142
139
pages = g_list_append (pages, real_page);
142
// Likewise for user_xattr
145
143
#ifdef ENABLE_USER_XATTR
146
EicielXAttrControler* xattr_controler = new EicielXAttrControler();
147
EicielXAttrWindow* xattr_window = Gtk::manage(new EicielXAttrWindow(xattr_controler));
149
xattr_controler->obrirFitxer(std::string(local_file));
151
if (!xattr_controler->fitxerObert())
144
EicielXAttrController* xattr_controller = new EicielXAttrController();
145
EicielXAttrWindow* xattr_window = Gtk::manage(new EicielXAttrWindow(xattr_controller));
147
xattr_controller->open_file(std::string(local_file));
149
if (!xattr_controller->opened_file())
153
151
delete xattr_window;
157
xattr_window->show_all();
159
155
real_page = nautilus_property_page_new
160
156
("EicielPropertyPage::property_page",
161
157
gtk_label_new (_("Extended user attributes")),
207
* Rutines que cridar� el loader de nautilus
203
* Routines called by the Nautilus loader
209
205
extern void nautilus_module_initialize (GTypeModule *module)
211
// g_print ("Inicialitzant la pagina de propietats de Eiciel\n");
207
// g_print ("Initializing Eiciel property page\n");
212
208
nautilus_eiciel_register_type(module);
213
// g_print ("Inicialitzacio realitzada\n");
209
// g_print ("Initialization done\n");
214
210
#ifdef ENABLE_NLS
215
211
setlocale(LC_ALL, "");
216
212
bindtextdomain("eiciel", DATADIR "/locale");
218
// Volem les traduccions en UTF-8 (independentment del
219
// format usat per a traduir)
214
// We want translations in UTF-8, regardless
215
// of the actual encoding used for translation
220
216
bind_textdomain_codeset ("eiciel", "UTF-8");
224
220
/* Perform module-specific shutdown. */
225
221
extern void nautilus_module_shutdown (void)
227
// g_print ("Finalitzant la pagina de propietats de Eiciel\n");
223
// g_print ("Ending Eiciel property page\n");
230
226
/* List all the extension types. */