1
/* Copyright (C) 2005-2006 sgop@users.sourceforge.net
2
* This is free software distributed under the terms of the
3
* GNU Public License. See the file COPYING for details.
6
* $Date: 2008/05/23 14:54:28 $
19
#include "preferences.h"
23
static const char* GtkResource =
25
" fg[NORMAL] = { 0, 0.5, 1.0 }"NL
26
" fg[PRELIGHT] = { 0.8, 0.6, 0.4 }"NL
29
"widget \"*EventLabel*\" style \"event\""NL;
31
static const char* Folder = NULL;
33
static GOptionEntry Options[] = {
34
{ "folder", 'f', 0, G_OPTION_ARG_STRING, &Folder, "Inspect folder", "dir" },
35
/* { "mount", 'm', 0, G_OPTION_ARG_NONE, &AllowLeaveDevice, "Descend directories on other filesystems", NULL }, */
36
/* { "reportedsize", 'r', 0, G_OPTION_ARG_NONE, &ReportedSize, "Don't show disk size of files but reported size", NULL }, */
37
{ NULL, 0, 0, 0, NULL, NULL, NULL }
40
static gboolean on_load() {
41
if (Folder) gui_tree_load_and_display(Folder);
45
int main (int argc, char *argv[]) {
46
GOptionContext* context = g_option_context_new("- Graphical Disk Map");
49
bindtextdomain(GETTEXT_PACKAGE, GDMAP_LOCALE_DIR);
50
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
51
textdomain(GETTEXT_PACKAGE);
53
g_option_context_set_ignore_unknown_options(context, FALSE);
54
g_option_context_set_help_enabled(context, TRUE);
55
g_option_context_add_main_entries(context, Options, NULL);
56
if (!g_option_context_parse(context, &argc, &argv, &error)) {
57
g_warning(error->message);
58
g_option_context_free(context);
61
g_option_context_free(context);
64
gtk_init(&argc, &argv);
66
gtk_rc_parse_string(GtkResource);
68
gui_create_main_win();
73
g_idle_add((GSourceFunc)on_load, NULL);