source: src/main.vala @ 8884b7871bd5444d3a505a7d2b9075a69deae9ed

Revision 8884b7871bd5444d3a505a7d2b9075a69deae9ed, 1.7 KB checked in by Matias De la Puente <mfpuente.ar@…>, 3 years ago (diff)

Add document preferences action

  • Property mode set to 100644
Line 
1/* main.vala
2 *
3 * Copyright (C) 2010  Matias De la Puente
4 *
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 3 of the License, or
8 * (at your option) any later version.
9 *
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 *      Matias De la Puente <mfpuente.ar@gmail.com>
20 */
21using I4uc;
22
23void main (string[] args)
24{
25        Gtk.init (ref args);
26       
27        load_settings ();
28       
29        var main_window_view = new MainWindowView ();
30        main_window_view.show_all ();
31       
32        var document_page_view_factory = new DocumentPageViewFactory (main_window_view.pages_panel);
33        var document_preferences_page_view_factory = new DocumentPreferencesPageViewFactory (main_window_view.pages_panel);
34       
35        var main_window_presenter = new MainWindowPresenter (main_window_view);
36        var documents_presenter = new DocumentsPresenter (main_window_view.documents_view, document_page_view_factory, document_preferences_page_view_factory);
37       
38        Gtk.main ();
39        I4uc.Settings.instance.save ();
40}
41
42void load_settings ()
43{
44        var settings_folder = Path.build_filename (Environment.get_home_dir (), ".i4uc");
45        if (!FileUtils.test (settings_folder, FileTest.EXISTS))
46                DirUtils.create (settings_folder, 0755);
47        var settings_filename = Path.build_filename (settings_folder, "i4ucrc");
48        I4uc.Settings.instance.open (settings_filename);
49}
Note: See TracBrowser for help on using the repository browser.