/* * gpe-info * * Copyright (C) 2004-2006 Florian Boor * * This program 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 of the License, or (at your option) any later version. * * main module */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "modules/sysinfo.h" #include #include #include #include #include #define _(x) gettext(x) GtkWidget *mainw; /* for some dialogs */ struct gpe_icon my_icons[] = { { "save" }, { "cancel" }, { "exit" }, { "icon", PREFIX "/share/pixmaps/gpe-config-sysinfo.png" }, { NULL, NULL } }; static char *tabs[] = {"global","hardware","battery","storage","network","syslog"}; static int num_tabs = sizeof(tabs) / sizeof(char*); static struct { GtkWidget *w; GtkWidget *applet; GtkWidget *vbox; GtkWidget *viewport; GtkWidget *dismiss; }self; static void usage() { int i; fprintf(stderr,_("usage: gpe-info [page]\n")); fprintf(stderr,_(" Where page may be \"global\" (default)\n")); for (i=1;i 2) { usage(); exit(1); } if (argc == 2) { nrtab = -1; for (i = 0;i < num_tabs;i++) if (!strcmp(argv[1],tabs[i])) { nrtab = i; break; } if (nrtab < 0) { usage(); exit(1); } } if (gpe_application_init (&argc, &argv) == FALSE) exit (1); if (gpe_load_icons (my_icons) == FALSE) exit (1); initwindow(); self.vbox = gtk_vbox_new(FALSE,0); gtk_widget_show(self.vbox); gtk_container_add(GTK_CONTAINER(self.w),self.vbox); gpe_set_window_icon(self.w,"icon"); gtk_widget_show(self.w); make_container(nrtab); gtk_main(); gtk_exit(0); } int main(int argc, char **argv) { setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain (PACKAGE); signal(SIGINT,Sysinfo_Free_Objects); signal(SIGTERM,Sysinfo_Free_Objects); main_one(argc,argv); return 0; }