summaryrefslogtreecommitdiff
path: root/src/logdiag.c
blob: 99aa8de2431b00e6ec42e05248ab12b763bd5564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * logdiag.c -- logdiag main source file.
 *
 * This file is a part of logdiag.
 * Copyright Přemysl Janouch 2010 - 2011. All rights reserved.
 *
 * See the file LICENSE for licensing information.
 *
 */

#include <gtk/gtk.h>
#include <locale.h>

#include "config.h"

#include "ld-window-main.h"


int
main (int argc, char *argv[])
{
	GtkWidget *window;
	GError *error;
#ifdef _WIN32
	gchar *install_dir;

	install_dir = g_win32_get_package_installation_directory_of_module (NULL);
	if (install_dir)
	{
		g_chdir (install_dir);
		g_free (install_dir);
	}
#endif

	setlocale (LC_ALL, "");

	bindtextdomain (GETTEXT_DOMAIN, GETTEXT_DIRNAME);
	bind_textdomain_codeset (GETTEXT_DOMAIN, "UTF-8");
	textdomain (GETTEXT_DOMAIN);

	error = NULL;
	gtk_init_with_args (&argc, &argv,
		N_("[FILE] - Schematic editor"), NULL, GETTEXT_DOMAIN, &error);
	if (error)
	{
		g_warning ("%s", error->message);
		g_error_free (error);
		return 1;
	}

	/* TODO: Open the file in the parameter, if present. */
	gtk_window_set_default_icon_name (PROJECT_NAME);
	window = ld_window_main_new ();
	gtk_main ();

	return 0;
}