Remove silly tag dereferences suffix
[giggle.git] / src / giggle-main.c
blob6e0e3f52376b1a76ee1a58b446fdf0b67f6befdf
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * Copyright (C) 2007 Imendio AB
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (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 GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <config.h>
22 #include <glib/gi18n.h>
23 #include <gtk/gtkmain.h>
25 #include "giggle-window.h"
27 int
28 main (int argc, char **argv)
30 GtkWidget *window;
31 gchar *dir;
33 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
34 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
35 textdomain (GETTEXT_PACKAGE);
37 gtk_init (&argc, &argv);
39 g_set_application_name ("Giggle");
41 window = giggle_window_new ();
42 gtk_window_set_default_size (GTK_WINDOW (window), 700, 550);
43 g_signal_connect (window,
44 "destroy",
45 G_CALLBACK (gtk_main_quit),
46 NULL);
48 /* parse GIT_DIR into dir and unset it; if empty use the current_wd */
49 dir = g_strdup (g_getenv ("GIT_DIR"));
50 if (!dir || !*dir) {
51 g_free (dir);
52 dir = g_get_current_dir ();
54 g_unsetenv ("GIT_DIR");
56 if (giggle_git_test_dir (dir)) {
57 giggle_window_set_directory (GIGGLE_WINDOW (window), dir);
59 g_free (dir);
61 gtk_widget_show (window);
63 gtk_main ();
65 return 0;