/* Copyright (C) 2000,2001,2002 Manuel Amador (Rudd-O)
   This file is part of Directory administrator.

   Directory administrator is free software; you can redistribute it 
   and/or modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.

   Directory administrator is distributed in the hope that it will be 
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with Directory administrator; if not, send e-mail to amador@alomega.com 
*/


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

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

#include <gnome.h>

#include <errno.h>
#include <lber.h>
#include <ldap.h>

#include "interface.h"
#include "appsupport.h"

#include "appglobals.h"
#include "prefs.h"
#include "appfunctions.h"
#include "users.h"
#include "test.c"

int
main (int argc, char *argv[])
{	
  GtkWidget *mainwindow, *about;

  // diradmin_user * fuck = NULL;

//  int ldap_error_definition; ///temp definition


//  g_thread_init(NULL);
  gnome_init ("directory-administrator", VERSION, argc, argv);
  /*
   * 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.
   */


  load_prefs ();

  /*
   * this is test code only for testing the application profile building stuff.  shouldn't be here for long
   * this defines a temporarydefault profile
   */

/*  current_connection_profile = connection_profile_duplicate(
     g_list_first(connection_profile_list)->data );
  g_assert(current_connection_profile);
  ldap_error_definition = connection_profile_connect(current_connection_profile);

  gtk_widget_show(create_messagebox_with_message(ldap_err2string(ldap_error_definition)));

*/

  /* end test code - you can safely comment this later */

  mainwindow = create_mainwindow ();
  app = mainwindow;
  cached_dir_entries = NULL;
  gtk_widget_show (mainwindow);
//  fuckyou ();


  /* first time run? */
  if (g_list_length (connection_profile_list) < 1)
    {
      about = create_druid_firsttime ();
      gtk_widget_show (about);
    }

else if (g_list_length (connection_profile_list) == 1)
	{
	  gtk_toggle_button_set_active ((GtkToggleButton*)lookup_widget(app,"button_connect"), TRUE);
//      app_interactive_connect();
	}

  gtk_main ();
  save_prefs ();
  return 0;
}


syntax highlighted by Code2HTML, v. 0.9.1