Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fun.git;a=commitdiff;h=b3a5ed2b979e8ac5824e26a3d0f334e401b3cf51

commit b3a5ed2b979e8ac5824e26a3d0f334e401b3cf51
Author: Priyank <[EMAIL PROTECTED]>
Date:   Sun Nov 18 15:48:24 2007 +0530

fun.c: added fun_glade_init()
* fun_glade_init(): initializes libglade and fun.glade's widgets
* main(): if dbus initialization fails, return with an error. do the same for 
fun_glade_init().

diff --git a/src/fun.c b/src/fun.c
index 5b0cfe8..28b7a68 100644
--- a/src/fun.c
+++ b/src/fun.c
@@ -27,11 +27,28 @@

#include "fun.h"
#include "fun-config.h"
+#include "fun-messages.h"
+
+GladeXML *xml = NULL;
+
+static gboolean
+fun_glade_init (void)
+{
+       char *path = NULL;
+       gboolean ret = FALSE;
+
+       path = g_strdup_printf ("%s/share/fun/fun.glade", PREFIX);
+       if ((xml=glade_xml_new(path,NULL,"UTF-8")))
+               ret = TRUE;
+       g_free (path);
+
+       return ret;
+}

int
main (int argc, char **argv)
{
-       /* set locale */
+       /* set the locale */
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -42,13 +59,23 @@ main (int argc, char **argv)

/* initialize dbus and exit if init fails */
if (fun_dbus_init() == FALSE)
-               return 1;
+       {
+               fun_error (_("Error"), _("Failed to initialize dbus 
subsystem"));
+               return -1;
+       }
/* initialize fun configuration */
fun_config_init ();
/* initialize fun user interface */
+       if (!fun_glade_init())
+       {
+               fun_error (_("Errir"), _("Failed to initialize interface"));
+               return -1;
+       }
fun_ui_init ();

+       /* run the gtk+ main loop */
gtk_main ();
+
fun_ui_cleanup ();

return 0;
diff --git a/src/fun.h b/src/fun.h
index 8f73854..a52238b 100644
--- a/src/fun.h
+++ b/src/fun.h
@@ -8,6 +8,7 @@
#include <locale.h>
#include <libintl.h>
#include <gtk/gtk.h>
+#include <glade/glade.h>

#define _(string) gettext (string)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to