2007-10-08 [paul] 3.0.2cvs32
[claws.git] / src / prefs_themes.c
index d65db8915d448db9ecf852f6b1f74323a0fcfa4a..9b80474a7fa18f4bd1c2984422cdbae3bf1ff71a 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2003-2006 Hiroyuki Yamamoto & the Sylpheed-Claws team
+ * Copyright (C) 2003-2007 Hiroyuki Yamamoto & the Claws Mail team
  *
  * 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
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -245,7 +245,8 @@ static void prefs_themes_foreach_file(const gchar *dirname, const FileFunc func,
                (*func)(fullentry, data);
                
                g_free(fullentry);
-       }       
+       }
+       closedir(dp);
 }
 
 static gboolean prefs_themes_is_system_theme(const gchar *dirname)
@@ -444,7 +445,7 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
        tmp = g_path_get_basename(theme_str);
 
        if (IS_SYSTEM_THEME(theme_str)) {
-               if (getuid() != 0) {
+               if (!superuser_p()) {
                        alertpanel_error(_("Only root can remove system themes"));
                        return;
                }
@@ -517,7 +518,7 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
                if (G_ALERTALTERNATE != val)
                        goto end_inst;
        }
-       if (getuid() == 0) {
+       if (superuser_p ()) {
                val = alertpanel(alert_title,
                                 _("Do you want to install theme for all users?"),
                                 GTK_STOCK_NO, GTK_STOCK_YES, NULL);
@@ -535,7 +536,7 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
        }
        g_free(alert_title);
        if (cinfo->dest == NULL) {
-               cinfo->dest = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, RC_DIR,
+               cinfo->dest = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, get_rc_dir(),
                                          G_DIR_SEPARATOR_S, PIXMAP_THEME_DIR, G_DIR_SEPARATOR_S,
                                          themename, NULL);
        }
@@ -703,7 +704,7 @@ static void prefs_themes_get_theme_info(ThemesData *tdata)
        
        if (IS_INTERNAL_THEME(path)) {
                info->name = g_strdup(_("Default internal theme"));
-               info->author = g_strdup(_("The Sylpheed-Claws Team"));
+               info->author = g_strdup(_("The Claws Mail Team"));
                info->url = g_strdup(HOMEPAGE_URI);
                info->status = g_strdup_printf(_("Internal theme has %d icons"), N_STOCK_PIXMAPS);
        }
@@ -729,7 +730,7 @@ static void prefs_themes_get_theme_info(ThemesData *tdata)
 
                info->status = prefs_themes_get_theme_stats(path);
                if (info->status == NULL) {
-                       info->status = g_strdup(_("Error: can't get theme status"));
+                       info->status = g_strdup(_("Error: couldn't get theme status"));
                }
        }
 
@@ -837,12 +838,7 @@ static void prefs_themes_create_widget(PrefsPage *page, GtkWindow *window, gpoin
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
        gtk_widget_show (vbox1);
 
-       PACK_FRAME (vbox1, frame1, _("Selector"));
-
-       vbox2 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame1), vbox2);
+       vbox2 = gtkut_get_options_frame(vbox1, &frame1, _("Selector"));
 
        hbox3 = gtk_hbox_new (FALSE, 5);
        gtk_widget_show (hbox3);
@@ -986,8 +982,7 @@ static void prefs_themes_create_widget(PrefsPage *page, GtkWindow *window, gpoin
        gtk_container_add (GTK_CONTAINER (frame_buttons), hbuttonbox1);
        gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 5);
        gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_START);
-       gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 5);
-       gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox1), 5, 0);
+       gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 5);
 
        btn_use = gtk_button_new_with_label (_("Use this"));
        gtk_widget_show (btn_use);