1/* 2* Copyright (c) 2017-2018 Carlos Suárez (https://gitlab.com/bitseater) 3* 4* This program is free software; you can redistribute it and/or 5* modify it under the terms of the GNU General Public 6* License as published by the Free Software Foundation; either 7* version 3 of the License, or (at your option) any later version. 8* 9* This program is distributed in the hope that it will be useful, 10* but WITHOUT ANY WARRANTY; without even the implied warranty of 11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12* General Public License for more details. 13* 14* You should have received a copy of the GNU General Public 15* License along with this program; If not, see <http://www.gnu.org/licenses/>. 16* 17* Authored by: Carlos Suárez <bitseater@gmail.com> 18*/ 19namespace Meteo { 20 21 public class MeteoApp : Gtk.Application { 22 23 public MainWindow window; 24 25 public MeteoApp () { 26 application_id = "com.gitlab.bitseater.meteo"; 27 flags |= GLib.ApplicationFlags.FLAGS_NONE; 28 29 // Localization 30 string package_name = Constants.GETTEXT_PACKAGE; 31 Intl.setlocale (LocaleCategory.ALL, ""); 32 Intl.textdomain (package_name); 33 Intl.bindtextdomain (package_name, Constants.LOCALE_DIR); 34 Intl.bind_textdomain_codeset (package_name, "UTF-8"); 35 } 36 37 public override void activate () { 38 if (get_windows () == null) { 39 window = new MainWindow (this); 40 window.show_all (); 41 } else { 42 window.present (); 43 } 44 } 45 46 public static void main (string [] args) { 47 var app = new Meteo.MeteoApp (); 48 app.run (args); 49 } 50 } 51} 52