1 /* This file is part of Beifahrer.
3 * Copyright (C) 2010 Philipp Zabel
5 * Beifahrer 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.
10 * Beifahrer 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 Beifahrer. If not, see <http://www.gnu.org/licenses/>.
21 public class BeifahrerProgram : Hildon.Program {
22 public const string BEIFAHRER_SERVICE = "org.maemo.beifahrer";
25 public static Orientation orientation;
28 Environment.set_application_name ("Beifahrer");
30 window = new QueryWindow ();
31 window.destroy.connect (Gtk.main_quit);
33 orientation = new Orientation ();
34 orientation.changed.connect (on_orientation_changed);
39 private void on_orientation_changed () {
40 if (orientation.portrait) {
41 Hildon.gtk_window_set_portrait_flags (window, PortraitFlags.REQUEST);
43 Hildon.gtk_window_set_portrait_flags (window, PortraitFlags.SUPPORT);
47 static int main (string[] args) {
50 Intl.setlocale (LocaleCategory.ALL, "");
51 Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
52 Intl.textdomain (Config.GETTEXT_PACKAGE);
54 var osso_context = new Osso.Context (BEIFAHRER_SERVICE, Config.VERSION, true, null);
55 if (osso_context == null) {
56 return Osso.Status.ERROR;
59 var app = new BeifahrerProgram ();