summaryrefslogtreecommitdiffstats
path: root/src/gui-gtk/main.c
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-02-09 15:05:54 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-09 15:05:54 +0100
commitd40146089b5957184af45de3cb91c4feed7ebd16 (patch)
treee96797ab2e9924ca047cf14a8567d1daaaedd452 /src/gui-gtk/main.c
parent869c7956a12db570eab547d9adc5a6a90365bfe4 (diff)
downloadabrt-d40146089b5957184af45de3cb91c4feed7ebd16.tar.gz
abrt-d40146089b5957184af45de3cb91c4feed7ebd16.tar.xz
abrt-d40146089b5957184af45de3cb91c4feed7ebd16.zip
abrt-gtk: beginning of C rewrite of GUI
Diffstat (limited to 'src/gui-gtk/main.c')
-rw-r--r--src/gui-gtk/main.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
new file mode 100644
index 00000000..66fee821
--- /dev/null
+++ b/src/gui-gtk/main.c
@@ -0,0 +1,63 @@
+#include <gtk/gtk.h>
+
+#include "abrtlib.h"
+#include "abrt-gtk.h"
+
+
+
+int main(int argc, char **argv)
+{
+ /* I18n */
+ setlocale(LC_ALL, "");
+ char *path = ".";
+
+ //int optflags = 0;
+ int opt;
+ while ((opt = getopt(argc, argv, "c:d:v")) != -1)
+ {
+ switch (opt)
+ {
+ case 'c':
+ VERB1 log("Loading settings from '%s'", optarg);
+ //load_conf_file(optarg, settings, /*skip key w/o values:*/ true);
+ VERB3 log("Loaded '%s'", optarg);
+ break;
+ case 'd':
+ path = optarg;
+ break;
+ case 'v':
+ g_verbose++;
+ break;
+ default:
+ /* Careful: the string below contains tabs, dont replace with spaces */
+ error_msg_and_die(
+ "Usage: abrt-gtk -c CONFFILE -d DIR [-v]"
+ "\n"
+ "\nReport a crash to Bugzilla"
+ "\n"
+ "\nOptions:"
+ "\n -c FILE Configuration file (may be given many times)"
+ "\n -d DIR Crash dump directory"
+ "\n -v Verbose"
+ "\n -s Log to syslog"
+ );
+ }
+ }
+
+ if (argc > 1)
+ path = argv[1];
+
+ gtk_init(&argc, &argv);
+
+ /* Prevent zombies when we spawn wizard */
+ signal(SIGCHLD, SIG_IGN);
+
+ GtkWidget *main_window = main_window_create();
+ dump_list_hydrate(path);
+ gtk_widget_show_all(main_window);
+
+ /* Enter main loop */
+ gtk_main();
+
+ return 0;
+}