]> Dogcows Code - chaz/tint2/blob - src/tint2conf/main.c
fixed systray crash by mart1987
[chaz/tint2] / src / tint2conf / main.c
1 /**************************************************************************
2 *
3 * Tint2conf
4 *
5 * Copyright (C) 2009 Thierry lorthiois (lorthiois@bbsoft.fr)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 **************************************************************************/
19
20 #include <stdio.h>
21 #include <locale.h>
22 #include <gtk/gtk.h>
23 #include <glib.h>
24 #include <glib/gstdio.h>
25 #include <glib/gi18n.h>
26
27
28 // need GTK+-2.4 ou plus
29
30 #define LONG_VERSION_STRING "0.2"
31
32 static GtkUIManager *myUIManager = NULL;
33
34 static const char *fallback_ui_file =
35 "<ui>"
36 " <menubar name='MenuBar'>"
37 " <menu action='ThemeMenu'>"
38 " </menu>"
39 " </menubar>"
40 " <toolbar name='ToolBar'>"
41 " <toolitem action='ViewApply'/>"
42 " </toolbar>"
43 "</ui>";
44
45
46 static void about( GtkWindow * parent )
47 {
48 const char *authors[] = { "Thierry Lorthiois", "Christian Ruppert (Build system)", NULL };
49
50 const char *website_url = "http://code.google.com/p/tint2/";
51
52 gtk_show_about_dialog( parent, "name", g_get_application_name( ),
53 "comments", _( "Theming tool for tint2 panel" ),
54 "version", LONG_VERSION_STRING,
55 "website", website_url, "website-label", website_url,
56 "copyright", _( "Copyright 2009 Thierry Lorthiois" ),
57 "logo-icon-name", "",
58 #ifdef SHOW_LICENSE
59 "license", LICENSE, "wrap-license", TRUE,
60 #endif
61 "authors", authors,
62 /* Translators: translate "translator-credits" as
63 your name to have it appear in the credits in the "About"
64 dialog */
65 "translator-credits", _( "translator-credits" ),
66 NULL );
67 }
68
69
70 static void destroy( GtkWidget *widget, gpointer data )
71 {
72 gtk_main_quit ();
73 }
74
75
76 int main (int argc, char ** argv)
77 {
78 /*
79 bindtextdomain( domain, LOCALEDIR );
80 bind_textdomain_codeset( domain, "UTF-8" );
81 textdomain( domain );
82 */
83
84 setlocale( LC_ALL, "" );
85 gtk_init (&argc, &argv);
86 g_thread_init( NULL );
87
88 GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
89 gtk_window_set_title(GTK_WINDOW(window), "Tint2 theme");
90 gtk_window_set_default_size(GTK_WINDOW(window), 600, 350);
91
92 // define GUI action
93 myUIManager = gtk_ui_manager_new ( );
94 GtkActionGroup *action_group;
95
96 //actions_init ( myUIManager, cbdata );
97 gtk_ui_manager_add_ui_from_string ( myUIManager, fallback_ui_file, -1, NULL );
98 gtk_ui_manager_ensure_update ( myUIManager );
99
100 // XDG specification
101 char *dir = g_build_filename (g_get_user_config_dir(), "tint2", NULL);
102 if (!g_file_test (dir, G_FILE_TEST_IS_DIR)) g_mkdir(dir, 0777);
103 //window.view.set_dir(dir);
104 //window.view.load_dir();
105 g_free(dir);
106
107 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL);
108 // rig up idle/thread routines
109 //Glib::Thread::create(sigc::mem_fun(window.view, &Thumbview::load_cache_images), true);
110 //Glib::Thread::create(sigc::mem_fun(window.view, &Thumbview::create_cache_images), true);
111
112 gtk_widget_show (window);
113 gtk_main ();
114
115 return 0;
116 }
117
This page took 0.042669 seconds and 5 git commands to generate.