/*
 * Initial main.c file generated by Glade. Edit as required.
 * Glade will not overwrite this file.
 */

/**
 * Author: Saravana Krishnan Kannan
 * Date: Sometime around 24-April-2004!
 * Description: This file contains the main() which reads the config file and
 * initialises the GTK+ library.
 **/

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gtk/gtk.h>

#include "interface.h"
#include "support.h"
#include "conf.h"

GtkWidget *w_main;

int
main (int argc, char *argv[])
{

#ifdef ENABLE_NLS
  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  textdomain (GETTEXT_PACKAGE);
#endif

  gtk_set_locale ();
  gtk_init (&argc, &argv);

  add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");

  /* Read the config file from the current directory. */
  if(read_config("scmon.conf"))
  {
   /* If that fails, then try opening the one in ~/.scmon/scmon.conf */
   printf("Trying to open ~/.scmon/scmon.conf ...\n");
   if(read_config("~/.scmon/scmon.conf"))
   {
    /* If nothing works, then quit! */
    printf("I'm not able to find any config file. I give up!\n");
    exit(1);
   }
   printf("Found alternate config file at ~/.scmon/scmon.conf\n");
  }
  
  /*
   * The following code was added by Glade to create one of each component
   * (except popup menus), just so that you see something after building
   * the project. Delete any components that you don't want shown initially.
   */
  w_main = create_w_main ();
  gtk_widget_show (w_main);

  gtk_main ();
  return 0;
}

