]> Dogcows Code - chaz/tint2/blobdiff - src/tint2conf/main.c
cleanup
[chaz/tint2] / src / tint2conf / main.c
index cf27bb9c79a1729c6909c500e83678a4b387f0df..8193a73a7e7b3c4f0674993b86a728a97952bbf4 100644 (file)
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 
-#include "../version.h"
+#ifdef HAVE_VERSION_H
+  #include "version.h"
+#endif
 #include "common.h"
 #include "theme_view.h"
+#include "properties.h"
 
 #define SNAPSHOT_TICK 190
 
@@ -103,8 +106,8 @@ static const char *global_ui =
        "    <toolitem action='ViewApply'/>"
        "  </toolbar>"
        "  <popup  name='ThemePopup'>"
-       "    <menuitem action='EditRefresh'/>"
        "    <menuitem action='ThemeProperties'/>"
+       "    <menuitem action='EditRefresh'/>"
        "    <menuitem action='ViewApply'/>"
        "    <separator/>"
        "    <menuitem action='ThemeDelete'/>"
@@ -188,7 +191,7 @@ static void menuAbout()
 {
        const char *authors[] = { "Thierry Lorthiois <lorthiois@bbsoft.fr>", "Andreas Fink <andreas.fink85@googlemail.com>", "Christian Ruppert <Spooky85@gmail.com> (Build system)", "Euan Freeman <euan04@gmail.com> (tintwizard)\n  See http://code.google.com/p/tintwizard/", NULL };
 
-       gtk_show_about_dialog(g_window, "name", g_get_application_name( ),
+       gtk_show_about_dialog(GTK_WINDOW(g_window), "name", g_get_application_name( ),
                                                                "comments", _("Theming tool for tint2 panel"),
                                                                "version", VERSION_STRING,
                                                                "copyright", _("Copyright 2009 tint2 team\nTint2 License GNU GPL version 2\nTintwizard License GNU GPL version 3"),
@@ -207,7 +210,7 @@ static void menuAdd()
        GtkFileChooser *chooser;
        GtkFileFilter *filter;
 
-       dialog = gtk_file_chooser_dialog_new(_("Add a theme"), g_window, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, NULL);
+       dialog = gtk_file_chooser_dialog_new(_("Add a theme"), GTK_WINDOW(g_window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, NULL);
        chooser = GTK_FILE_CHOOSER(dialog);
 
        gtk_file_chooser_set_current_folder(chooser, g_get_home_dir());
@@ -242,7 +245,7 @@ static void menuAdd()
                        gchar *message;
                        message = g_strdup_printf(_("Couldn't add duplicate theme\n\'%s\'."), pt1);
 
-                       GtkWidget *w = gtk_message_dialog_new(g_window, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, message, NULL);
+                       GtkWidget *w = gtk_message_dialog_new(GTK_WINDOW(g_window), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, message, NULL);
                        g_signal_connect_swapped(w, "response", G_CALLBACK(gtk_widget_destroy), w);
                        gtk_widget_show(w);
                        g_free(message);
@@ -278,7 +281,7 @@ static void menuSaveAs ()
 
        sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view));
        if (!gtk_tree_selection_get_selected(GTK_TREE_SELECTION(sel), &model, &iter)) {
-               GtkWidget *w = gtk_message_dialog_new(g_window, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Select the theme to be saved."), NULL);
+               GtkWidget *w = gtk_message_dialog_new(GTK_WINDOW(g_window), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Select the theme to be saved."));
                g_signal_connect_swapped(w, "response", G_CALLBACK(gtk_widget_destroy), w);
                gtk_widget_show(w);
                return;
@@ -288,7 +291,7 @@ static void menuSaveAs ()
        pt1 = strrchr (file, '/');
        if (pt1) pt1++;
 
-       dialog = gtk_file_chooser_dialog_new(_("Save theme as"), g_window, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
+       dialog = gtk_file_chooser_dialog_new(_("Save theme as"), GTK_WINDOW(g_window), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
        chooser = GTK_FILE_CHOOSER(dialog);
 
        gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
@@ -337,6 +340,12 @@ static void menuProperties()
        sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view));
        if (gtk_tree_selection_get_selected(GTK_TREE_SELECTION(sel), &model, &iter)) {
                gtk_tree_model_get(model, &iter, COL_THEME_FILE, &file,  -1);
+/*
+               GtkWidget *prop;
+               prop = create_properties();
+               gtk_window_present(GTK_WINDOW(prop));
+               //printf("menuProperties : fin\n");
+*/             
 
                cmd = g_strdup_printf("%s \'%s\' &", g_cmd_property, file);
                printf("cmd %s\n", cmd);
@@ -344,6 +353,7 @@ static void menuProperties()
 
                g_free(cmd);
                g_free(file);
+               
        }
 }
 
@@ -577,7 +587,7 @@ void read_config()
        }
        g_width = 500;
        g_height = 350;
-       g_cmd_property = g_strdup("python /usr/bin/tintwizard.py");
+       g_cmd_property = g_strconcat( "python ", INSTALL_PREFIX, "/bin/tintwizard.py", (void*)0 );
 
        // load config
        path = g_build_filename (g_get_user_config_dir(), "tint2", "tint2confrc", NULL);
This page took 0.02401 seconds and 4 git commands to generate.