4
* Project: GGZ GTK Client
5
* $Id: main.c,v 1.42 2003/01/12 12:27:43 dr_maux Exp $
7
* This is the main program body for the GGZ client
9
* Copyright (C) 2000-2002 Justin Zaun.
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, write to the Free Software
23
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
28
#include <ggz.h> /* libggz */
46
#include "ggzclient.h"
53
static void init_debug(void)
55
char *default_file, *debug_file, **debug_types;
58
/* Inititialze debugging */
59
default_file = g_strjoin("/", getenv("HOME"), ".ggz/ggz-gtk.debug", NULL);
60
debug_file = ggzcore_conf_read_string("Debug", "FILE", default_file);
63
ggzcore_conf_read_list("Debug", "Types", &num_types, (char***)&debug_types);
64
ggz_debug_init((const char**)debug_types, debug_file);
67
for (i = 0; i < num_types; i++)
68
ggz_free(debug_types[i]);
69
ggz_free(debug_types);
74
int main (int argc, char *argv[])
77
char *global_conf, *user_conf, *init_version;
80
bindtextdomain("ggz-gtk", PACKAGE_LOCALE_DIR);
81
textdomain("ggz-gtk");
82
setlocale(LC_ALL, "");
85
/*global_conf = "/etc/ggz/ggz.conf";*/
86
/* We don't support this quite yet */
88
user_conf = g_strdup_printf("%s/.ggz/ggz-gtk.rc", getenv("HOME"));
89
ggzcore_conf_initialize(global_conf, user_conf);
92
opt.flags = GGZ_OPT_PARSER | GGZ_OPT_MODULES;
100
server_profiles_load();
102
gtk_init(&argc, &argv);
105
init_version = ggzcore_conf_read_string("INIT", "VERSION", VERSION);
106
if (ggzcore_conf_read_int("INIT", "FIRST", 0) == 0 ||
107
strcmp(init_version, VERSION) !=0 )
109
first_create_or_raise();
111
win_main = create_win_main();
112
ggz_sensitivity_init();
113
gtk_widget_show(win_main);
114
login_create_or_raise();
116
ggz_free(init_version);
121
server_profiles_cleanup();
122
chat_lists_cleanup();
126
ggz_debug_cleanup(GGZ_CHECK_MEM);