Rename lxappearance2 back to lxappearance.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Fri, 6 Aug 2010 08:16:18 +0000 (16:16 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Fri, 6 Aug 2010 08:16:18 +0000 (16:16 +0800)
Ready to replace the old lxappearance.

18 files changed:
Makefile.am
configure.ac
data/Makefile.am
data/lxappearance.desktop.in [new file with mode: 0644]
data/lxappearance2.desktop.in [deleted file]
data/ui/Makefile.am
scripts/install-icon-theme.sh [deleted file]
src/Makefile.am
src/color-scheme.c
src/cursor-theme.c
src/icon-theme.c
src/lxappearance.c [new file with mode: 0644]
src/lxappearance.h [new file with mode: 0644]
src/lxappearance2.c [deleted file]
src/lxappearance2.h [deleted file]
src/other.c
src/utils.c
src/widget-theme.c

index 470666d..01adef9 100644 (file)
@@ -2,16 +2,6 @@ NULL=
 
 SUBDIRS=src po data
 
-support_scriptdir=$(datadir)/lxappearance2
-support_script_DATA= \
-        scripts/install-icon-theme.sh \
-        $(NULL)
-
 EXTRA_DIST = \
-       $(support_script_DATA) \
        $(NULL)
 
-install-data-hook:
-       for script in $(DESTDIR)$(support_scriptdir)/*.sh; do \
-           chmod +x $$script; \
-       done
index 5948a6f..e08d0bc 100644 (file)
@@ -1,10 +1,10 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-prog_name = lxappearance2
+prog_name = lxappearance
 
 AC_PREREQ([2.63])
-AC_INIT([lxappearance2], [0.2.0], [http://lxde.org/])
+AC_INIT([lxappearance], [0.2.0], [http://lxde.org/])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
 AC_CONFIG_HEADERS([config.h])
@@ -68,7 +68,7 @@ do
     echo $lang >> $srcdir/po/LINGUAS
 done
 
-GETTEXT_PACKAGE=lxappearance2
+GETTEXT_PACKAGE="$prog_name"
 AC_SUBST(GETTEXT_PACKAGE)
 AM_GLIB_GNU_GETTEXT
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
@@ -94,7 +94,7 @@ if test x"$sysconfdir" != x'/etc'; then
     echo
 else
     echo
-    echo lxappearance2....................... : Version $VERSION
+    echo lxappearance....................... : Version $VERSION
     echo
     echo Enable debug....................: "$enable_debug"
     echo Prefix..........................: $prefix
@@ -103,6 +103,6 @@ else
     echo
     echo http://lxde.org/
     echo
-    echo "Ready to make lxappearance2. Type 'make' to continue."
+    echo "Ready to make lxappearance. Type 'make' to continue."
     echo
 fi
index 43245fa..f908e14 100644 (file)
@@ -6,7 +6,7 @@ SUBDIRS= \
 
 desktopdir=$(datadir)/applications
 desktop_in_files = \
-       lxappearance2.desktop.in \
+       lxappearance.desktop.in \
        $(NULL)
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
diff --git a/data/lxappearance.desktop.in b/data/lxappearance.desktop.in
new file mode 100644 (file)
index 0000000..39f22bf
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+_Name=Customize Look and Feel
+_GenericName=Customize Look and Feel
+_Comment=Customizes look and feel of your desktop and applications
+Icon=preferences-desktop-theme
+Exec=lxappearance
+StartupNotify=true
+Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings;
diff --git a/data/lxappearance2.desktop.in b/data/lxappearance2.desktop.in
deleted file mode 100644 (file)
index e17bf61..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Type=Application
-_Name=Customize Look and Feel
-_GenericName=Customize Look and Feel
-_Comment=Customizes look and feel of your desktop and applications
-Icon=preferences-desktop-theme
-Exec=lxappearance2
-StartupNotify=true
-Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings;
index 19ecc1a..f14c11f 100644 (file)
@@ -1,7 +1,7 @@
 NULL=
 
 # GtkBuilder UI definition files
-uidir=$(datadir)/lxappearance2/ui
+uidir=$(datadir)/lxappearance/ui
 ui_in_files= \
        about.glade \
        lxappearance.glade \
diff --git a/scripts/install-icon-theme.sh b/scripts/install-icon-theme.sh
deleted file mode 100755 (executable)
index a9f0e70..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-# Script used to install new icon theme.
-# Copyright (C) 2008 paulliu, pcman
-# License: GNU GPL
-
-# test argc
-if (test $# -ne 1)
-then
-  echo Usage: $0 compressed_file
-  exit
-fi
-
-# make temp dir
-THEME_DIR=$HOME/.icons
-mkdir -p $THEME_DIR
-TMPDIR=`mktemp -d $THEME_DIR/XXXXXXX`
-
-BASE=`basename $1`
-
-# decompress
-if [ `basename -- $BASE .tar.gz` != "$BASE" ]
-then
-        tar -C $TMPDIR -xzf $1
-elif [ `basename -- $BASE .tar.bz2` != "$BASE" ]
-then
-        tar -C $TMPDIR -xjf $1
-fi
-
-# install
-cd $TMPDIR
-DLIST=`find -name 'index.theme' -exec dirname {} \;`
-for DIR in $DLIST
-do
-    basename "$DIR"
-    mv -f "$DIR" "$THEME_DIR"
-done
-
-cd ..
-# clear temp dir
-rm -rf $TMPDIR
index e6101c7..3e3ec92 100644 (file)
@@ -2,15 +2,15 @@ NULL=
 
 AM_CPPFLAGS = \
        -I$(srcdir) \
-       -DPACKAGE_DATA_DIR=\""$(datadir)/lxappearance2"\" \
-       -DPACKAGE_UI_DIR=\""$(datadir)/lxappearance2/ui"\" \
+       -DPACKAGE_DATA_DIR=\""$(datadir)/lxappearance"\" \
+       -DPACKAGE_UI_DIR=\""$(datadir)/lxappearance/ui"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
        $(NULL)
 
-bin_PROGRAMS = lxappearance2
-lxappearance2_SOURCES = \
-       lxappearance2.c \
-       lxappearance2.h \
+bin_PROGRAMS = lxappearance
+lxappearance_SOURCES = \
+       lxappearance.c \
+       lxappearance.h \
        widget-theme.c \
        widget-theme.h \
        color-scheme.c \
@@ -25,12 +25,12 @@ lxappearance2_SOURCES = \
        utils.h \
        $(NULL)
 
-lxappearance2_CFLAGS = \
+lxappearance_CFLAGS = \
        $(GTK_CFLAGS) \
        -Werror-implicit-function-declaration \
        $(NULL)
 
-lxappearance2_LDADD = \
+lxappearance_LDADD = \
        $(GTK_LIBS) \
        $(INTLLIBS) \
        $(NULL)
index 846ecdd..77526a1 100644 (file)
@@ -17,7 +17,7 @@
 //      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 //      MA 02110-1301, USA.
 
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include "color-scheme.h"
 #include <string.h>
 
index 16f7d55..00031f0 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "cursor-theme.h"
 #include "icon-theme.h"
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include <gdk/gdkx.h>
 
 static void update_cursor_demo()
index 82225b6..16ff205 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "icon-theme.h"
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include <string.h>
 #include <unistd.h>
 #include "utils.h"
diff --git a/src/lxappearance.c b/src/lxappearance.c
new file mode 100644 (file)
index 0000000..1e2e397
--- /dev/null
@@ -0,0 +1,421 @@
+/*
+ *      lxappearance.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      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
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "lxappearance.h"
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <gdk/gdkx.h>
+#include <string.h>
+
+#include "widget-theme.h"
+#include "color-scheme.h"
+#include "icon-theme.h"
+#include "cursor-theme.h"
+#include "other.h"
+
+LXAppearance app = {0};
+
+Atom lxsession_atom = 0;
+static const char* lxsession_name = NULL;
+
+static void check_lxsession()
+{
+    lxsession_atom = XInternAtom( GDK_DISPLAY(), "_LXSESSION", True );
+    if( lxsession_atom != None )
+    {
+        XGrabServer( GDK_DISPLAY() );
+        if( XGetSelectionOwner( GDK_DISPLAY(), lxsession_atom ) )
+        {
+            app.use_lxsession = TRUE;
+            lxsession_name = g_getenv("DESKTOP_SESSION");
+        }
+        XUngrabServer( GDK_DISPLAY() );
+    }
+}
+
+static GOptionEntry option_entries[] =
+{
+    { NULL }
+};
+
+static void save_cursor_theme_name()
+{
+    char* dir_path;
+    if(!app.cursor_theme || !g_strcmp0(app.cursor_theme, "default"))
+        return;
+
+    dir_path = g_build_filename(g_get_home_dir(), ".icons/default", NULL);
+    if(0 == g_mkdir_with_parents(dir_path, 0700))
+    {
+        char* index_theme = g_build_filename(dir_path, "index.theme", NULL);
+        char* content = g_strdup_printf(
+            "# This file is written by LXAppearance. Do not edit."
+            "[Icon Theme]\n"
+            "Name=Default\n"
+            "Comment=Default Cursor Theme\n"
+            "Inherits=%s\n", app.cursor_theme);
+        g_file_set_contents(index_theme, content, -1, NULL);
+        g_free(content);
+        g_free(index_theme);
+    }
+    g_free(dir_path);
+
+    /*
+    dir_path = g_build_filename(g_get_home_dir(), ".Xdefaults", NULL);
+    Xcursor.theme: name
+    Xcursor.size: [size]
+    g_file_set_contents(dir_path, "", -1, NULL);
+    g_free(dir_path);
+    */
+}
+
+static void reload_all_programs()
+{
+    GdkEventClient event;
+    event.type = GDK_CLIENT_EVENT;
+    event.send_event = TRUE;
+    event.window = NULL;
+
+    if( app.use_lxsession )
+    {
+        event.message_type = gdk_atom_intern_static_string("_LXSESSION");
+        event.data.b[0] = 0;    /* LXS_RELOAD */
+    }
+    else
+    {
+        /* if( icon_only )
+            event.message_type = gdk_atom_intern("_GTK_LOAD_ICONTHEMES", FALSE);
+        */
+        event.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
+    }
+    event.data_format = 8;
+    gdk_event_send_clientmessage_toall((GdkEvent *)&event);
+}
+
+static const char* bool2str(gboolean val)
+{
+    return val ? "TRUE" : "FALSE";
+}
+
+static void lxappearance_save_gtkrc()
+{
+    static const char* tb_styles[]={
+        "GTK_TOOLBAR_ICONS",
+        "GTK_TOOLBAR_TEXT",
+        "GTK_TOOLBAR_BOTH",
+        "GTK_TOOLBAR_BOTH_HORIZ"
+    };
+    static const char* tb_icon_sizes[]={
+        "GTK_ICON_SIZE_INVALID",
+        "GTK_ICON_SIZE_MENU",
+        "GTK_ICON_SIZE_SMALL_TOOLBAR",
+        "GTK_ICON_SIZE_LARGE_TOOLBAR",
+        "GTK_ICON_SIZE_BUTTON",
+        "GTK_ICON_SIZE_DND",
+        "GTK_ICON_SIZE_DIALOG"
+    };
+
+    char* file_path = g_build_filename(g_get_home_dir(), ".gtkrc-2.0", NULL);
+    GString* content = g_string_sized_new(512);
+    g_string_append_printf(content,
+        "# DO NOT EDIT! This file will be overwritten by LXAppearance.\n"
+        "# Any customization should be done in ~/.gtkrc-2.0.mine instead.\n\n"
+        "gtk-theme-name=\"%s\"\n"
+        "gtk-icon-theme-name=\"%s\"\n"
+        "gtk-font-name=\"%s\"\n"
+        "gtk-toolbar-style=%s\n"
+        "gtk-toolbar-icon-size=%s\n"
+        "gtk-cursor-theme-name=\"%s\"\n"
+        "gtk-cursor-theme-size=%d\n"
+        "gtk-button-images=%s\n"
+        "gtk-menu-images=%s\n"
+#if GTK_CHECK_VERSION(2, 14, 0)
+        "gtk-enable-event-sounds=%s\n"
+        "gtk-enable-input-feedback-sounds=%s\n",
+#endif
+        app.widget_theme,
+        app.icon_theme,
+        app.default_font,
+        tb_styles[app.toolbar_style],
+        tb_icon_sizes[app.toolbar_icon_size],
+        app.cursor_theme,
+        app.cursor_theme_size,
+        bool2str(app.button_images),
+        bool2str(app.menu_images),
+#if GTK_CHECK_VERSION(2, 14, 0)
+        bool2str(app.enable_event_sound),
+        bool2str(app.enable_input_feedback)
+#endif
+        );
+
+    if(app.color_scheme)
+    {
+        char* escaped = g_strescape(app.color_scheme, NULL);
+        g_string_append_printf(content,
+            "gtk-color-scheme=\"\"\n",
+            escaped);
+        g_free(escaped);
+    }
+
+    g_string_append_printf(content,
+        "include \"%s/.gtkrc-2.0.mine\"\n",
+        g_get_home_dir());
+
+    g_file_set_contents(file_path, content->str, content->len, NULL);
+    g_string_free(content, TRUE);
+    g_free(file_path);
+}
+
+static void lxappearance_save_lxsession()
+{
+    char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
+    char* user_config_file = g_build_filename(g_get_user_config_dir(), rel_path, NULL);
+    char* buf;
+    int len;
+    GKeyFile* kf = g_key_file_new();
+
+    if(!g_key_file_load_from_file(kf, user_config_file, G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, NULL))
+    {
+        /* the user config file doesn't exist, create its parent dir */
+        len = strlen(user_config_file) - strlen("/desktop.conf");
+        user_config_file[len] = '\0';
+        g_debug("user_config_file = %s", user_config_file);
+        g_mkdir_with_parents(user_config_file, 0700);
+        user_config_file[len] = '/';
+
+        g_key_file_load_from_dirs(kf, rel_path, g_get_system_config_dirs(), NULL, G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
+    }
+
+    g_free(rel_path);
+
+    g_key_file_set_string( kf, "GTK", "sNet/ThemeName", app.widget_theme );
+    g_key_file_set_string( kf, "GTK", "sGtk/FontName", app.default_font );
+
+    g_key_file_set_string( kf, "GTK", "sGtk/ColorScheme", app.color_scheme ? app.color_scheme : "" );
+
+    g_key_file_set_string( kf, "GTK", "sNet/IconThemeName", app.icon_theme );
+
+    g_key_file_set_string( kf, "GTK", "sGtk/CursorThemeName", app.cursor_theme );
+    g_key_file_set_integer( kf, "GTK", "iGtk/CursorThemeSize", app.cursor_theme_size );
+    save_cursor_theme_name();
+
+    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarStyle", app.toolbar_style );
+    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarIconSize", app.toolbar_icon_size );
+
+    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarStyle", app.toolbar_style );
+    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarIconSize", app.toolbar_icon_size );
+
+    g_key_file_set_integer( kf, "GTK", "iGtk/ButtonImages", app.button_images );
+    g_key_file_set_integer( kf, "GTK", "iGtk/MenuImages", app.menu_images );
+
+#if GTK_CHECK_VERSION(2, 14, 0)
+    /* "Net/SoundThemeName\0"      "gtk-sound-theme-name\0" */
+    g_key_file_set_integer( kf, "GTK", "iNet/EnableEventSounds", app.enable_event_sound);
+    g_key_file_set_integer( kf, "GTK", "iNet/EnableInputFeedbackSounds", app.enable_input_feedback);
+#endif
+
+    buf = g_key_file_to_data( kf, &len, NULL );
+    g_key_file_free(kf);
+
+    g_file_set_contents(user_config_file, buf, len, NULL);
+    g_free(buf);
+    g_free(user_config_file);
+}
+
+static void on_dlg_response(GtkDialog* dlg, int res, gpointer user_data)
+{
+    switch(res)
+    {
+    case GTK_RESPONSE_APPLY:
+
+        if(app.use_lxsession)
+            lxappearance_save_lxsession();
+        else
+            lxappearance_save_gtkrc();
+
+        reload_all_programs();
+
+        app.changed = FALSE;
+        gtk_dialog_set_response_sensitive(app.dlg, GTK_RESPONSE_APPLY, FALSE);
+        break;
+    case 1: /* about dialog */
+        {
+            GtkBuilder* b = gtk_builder_new();
+            if(gtk_builder_add_from_file(b, PACKAGE_UI_DIR "/about.ui", NULL))
+            {
+                GtkWidget* dlg = GTK_WIDGET(gtk_builder_get_object(b, "dlg"));
+                gtk_dialog_run(dlg);
+                gtk_widget_destroy(dlg);
+            }
+            g_object_unref(b);
+        }
+        break;
+    default:
+        gtk_main_quit();
+    }
+}
+
+static void settings_init()
+{
+    GtkSettings* settings = gtk_settings_get_default();
+    g_object_get(settings,
+                "gtk-theme-name", &app.widget_theme,
+                "gtk-font-name", &app.default_font,
+                "gtk-icon-theme-name", &app.icon_theme,
+                "gtk-cursor-theme-name", &app.cursor_theme,
+                "gtk-cursor-theme-size", &app.cursor_theme_size,
+                "gtk-toolbar-style", &app.toolbar_style,
+                "gtk-toolbar-icon-size", &app.toolbar_icon_size,
+                "gtk-button-images", &app.button_images,
+                "gtk-menu-images", &app.menu_images,
+#if GTK_CHECK_VERSION(2, 14, 0)
+                "gtk-enable-event-sounds", &app.enable_event_sound,
+                "gtk-enable-input-feedback-sounds", &app.enable_input_feedback,
+#endif
+                NULL);
+    /* try to figure out cursor theme used. */
+    if(!app.cursor_theme || g_strcmp0(app.cursor_theme, "default") == 0)
+    {
+        /* get the real theme name from default. */
+        GKeyFile* kf = g_key_file_new();
+        char* fpath = g_build_filename(g_get_home_dir(), ".icons/default/index.theme", NULL);
+        gboolean ret = g_key_file_load_from_file(kf, fpath, 0, NULL);
+        g_free(fpath);
+
+        if(!ret)
+            ret = g_key_file_load_from_data_dirs(kf, "icons/default/index.theme", NULL, 0, NULL);
+
+        if(ret)
+        {
+            g_free(app.cursor_theme);
+            app.cursor_theme = g_key_file_get_string(kf, "Icon Theme", "Inherits", NULL);
+            g_debug("cursor theme name: %s", app.cursor_theme);
+        }
+        g_key_file_free(kf);
+    }
+
+    app.color_scheme_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+    /* try to load custom color scheme if available */
+    if(app.use_lxsession)
+    {
+        char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
+        char* user_config_file = g_build_filename(g_get_user_config_dir(), rel_path, NULL);
+        GKeyFile* kf = g_key_file_new();
+        if(g_key_file_load_from_file(kf, user_config_file, 0, NULL))
+            app.color_scheme = g_key_file_get_string(kf, "GTK", "sGtk/ColorScheme", NULL);
+        else if(g_key_file_load_from_dirs(kf, rel_path, g_get_system_config_dirs(), NULL, 0, NULL))
+            app.color_scheme = g_key_file_get_string(kf, "GTK", "sGtk/ColorScheme", NULL);
+        g_key_file_free(kf);
+        g_free(rel_path);
+        g_free(user_config_file);
+
+        if(app.color_scheme)
+        {
+            if(*app.color_scheme)
+                color_scheme_str_to_hash(app.color_scheme_hash, app.color_scheme);
+            else
+            {
+                g_free(app.color_scheme);
+                app.color_scheme = NULL;
+            }
+        }
+    }
+    else
+    {
+        char* gtkrc_file = g_build_filename(g_get_home_dir(), ".gtkrc-2.0", NULL);
+        gtkrc_file_get_color_scheme(gtkrc_file, app.color_scheme_hash);
+        g_free(gtkrc_file);
+        if(g_hash_table_size(app.color_scheme_hash) > 0)
+            app.color_scheme = color_scheme_hash_to_str(app.color_scheme_hash);
+    }
+}
+
+int main(int argc, char** argv)
+{
+    GError* err = NULL;
+    GtkBuilder* b;
+
+    /* gettext support */
+#ifdef ENABLE_NLS
+    bindtextdomain ( GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR );
+    bind_textdomain_codeset ( GETTEXT_PACKAGE, "UTF-8" );
+    textdomain ( GETTEXT_PACKAGE );
+#endif
+
+    /* initialize GTK+ and parse the command line arguments */
+    if( G_UNLIKELY( ! gtk_init_with_args( &argc, &argv, "", option_entries, GETTEXT_PACKAGE, &err ) ) )
+    {
+        g_print( "Error: %s\n", err->message );
+        return 1;
+    }
+
+    /* check if we're under LXSession */
+    check_lxsession();
+
+    /* create GUI here */
+    b = gtk_builder_new();
+    if(!gtk_builder_add_from_file(b, PACKAGE_UI_DIR "/lxappearance.ui", NULL))
+        return 1;
+
+    /* NOTE: GUI must be created prior to loading settings from GtkSettings object.
+     * Some properties of GtkSettings class are installed by some other gtk classes.
+     * For example, "gtk-menu-images" property is actually installed by initialization
+     * of GtkImageMenuItem class. If we load the GUI first, then when the menu items
+     * are created, this property gets correctly registered. So later it can be read. */
+
+    /* load config values */
+    settings_init();
+
+    app.dlg = GTK_WIDGET(gtk_builder_get_object(b, "dlg"));
+
+    widget_theme_init(b);
+    color_scheme_init(b);
+    icon_theme_init(b);
+    cursor_theme_init(b);
+    other_init(b);
+
+    g_signal_connect(app.dlg, "response", G_CALLBACK(on_dlg_response), NULL);
+
+    gtk_window_present(GTK_WINDOW(app.dlg));
+    g_object_unref(b);
+
+    gtk_main();
+
+    return 0;
+}
+
+void lxappearance_changed()
+{
+    if(!app.changed)
+    {
+        app.changed = TRUE;
+        gtk_dialog_set_response_sensitive(app.dlg, GTK_RESPONSE_APPLY, TRUE);
+    }
+}
diff --git a/src/lxappearance.h b/src/lxappearance.h
new file mode 100644 (file)
index 0000000..b1c3f60
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ *      lxappearance.h
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      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
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      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.
+ */
+
+#ifndef _LXAPPEARANCE_H_
+#define _LXAPPEARANCE_H_
+
+#include <gtk/gtk.h>
+
+typedef struct _LXAppearance    LXAppearance;
+struct _LXAppearance
+{
+    GtkWidget* dlg;
+    GtkWidget* notebook;
+
+    /* gtk theme */
+    GtkWidget* widget_theme_view;
+    GtkListStore* widget_theme_store;
+    GtkWidget* default_font_btn;
+
+    /* color scheme */
+    GtkWidget* color_table;
+    GtkWidget* custom_colors;
+    GtkWidget* no_custom_colors;
+    GHashTable* color_scheme_hash; /* the custom color scheme set by the user */
+    GHashTable* default_color_scheme_hash; /* default colors of current gtk theme */
+    gboolean color_scheme_supported; /* if color scheme is supported by current gtk theme */
+    /* color buttons in color scheme page. */
+    GtkWidget* color_btns[8]; /* FIXME: this value might be changed in the future */
+
+    /* icon theme */
+    GtkWidget* icon_theme_view;
+    GtkListStore* icon_theme_store;
+    GtkWidget* icon_theme_remove_btn;
+
+    /* cursor theme */
+    GtkWidget* cursor_theme_view;
+    GtkWidget* cursor_demo_view;
+    GtkListStore* cursor_theme_store;
+    GtkWidget* cursor_size_range;
+    GtkWidget* cursor_theme_remove_btn;
+
+    GSList* icon_themes; /* a list of IconTheme struct representing all icon and cursor themes */
+
+    /* toolbar style and icon size */
+    GtkWidget* tb_style_combo;
+    GtkWidget* tb_icon_size_combo;
+
+    GtkWidget* button_images_check;
+    GtkWidget* menu_images_check;
+
+    char* widget_theme;
+    char* default_font;
+    char* icon_theme;
+    char* cursor_theme;
+    int cursor_theme_size;
+    char* color_scheme;
+    int toolbar_style;
+    int toolbar_icon_size;
+
+    gboolean button_images;
+    gboolean menu_images;
+
+#if GTK_CHECK_VERSION(2, 14, 0)
+    GtkWidget* event_sound_check;
+    GtkWidget* input_feedback_check;
+    gboolean enable_event_sound;
+    gboolean enable_input_feedback;
+#endif
+
+    gboolean changed;
+    gboolean use_lxsession;
+};
+
+extern LXAppearance app;
+
+void lxappearance_changed();
+
+#endif
diff --git a/src/lxappearance2.c b/src/lxappearance2.c
deleted file mode 100644 (file)
index 216436e..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- *      lxappearance2.c
- *
- *      Copyright 2010 PCMan <pcman.tw@gmail.com>
- *
- *      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
- *      (at your option) any later version.
- *
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "lxappearance2.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include <X11/X.h>
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-#include <gdk/gdkx.h>
-#include <string.h>
-
-#include "widget-theme.h"
-#include "color-scheme.h"
-#include "icon-theme.h"
-#include "cursor-theme.h"
-#include "other.h"
-
-LXAppearance app = {0};
-
-Atom lxsession_atom = 0;
-static const char* lxsession_name = NULL;
-
-static void check_lxsession()
-{
-    lxsession_atom = XInternAtom( GDK_DISPLAY(), "_LXSESSION", True );
-    if( lxsession_atom != None )
-    {
-        XGrabServer( GDK_DISPLAY() );
-        if( XGetSelectionOwner( GDK_DISPLAY(), lxsession_atom ) )
-        {
-            app.use_lxsession = TRUE;
-            lxsession_name = g_getenv("DESKTOP_SESSION");
-        }
-        XUngrabServer( GDK_DISPLAY() );
-    }
-}
-
-static GOptionEntry option_entries[] =
-{
-    { NULL }
-};
-
-static void save_cursor_theme_name()
-{
-    char* dir_path;
-    if(!app.cursor_theme || !g_strcmp0(app.cursor_theme, "default"))
-        return;
-
-    dir_path = g_build_filename(g_get_home_dir(), ".icons/default", NULL);
-    if(0 == g_mkdir_with_parents(dir_path, 0700))
-    {
-        char* index_theme = g_build_filename(dir_path, "index.theme", NULL);
-        char* content = g_strdup_printf(
-            "# This file is written by LXAppearance. Do not edit."
-            "[Icon Theme]\n"
-            "Name=Default\n"
-            "Comment=Default Cursor Theme\n"
-            "Inherits=%s\n", app.cursor_theme);
-        g_file_set_contents(index_theme, content, -1, NULL);
-        g_free(content);
-        g_free(index_theme);
-    }
-    g_free(dir_path);
-
-    /*
-    dir_path = g_build_filename(g_get_home_dir(), ".Xdefaults", NULL);
-    Xcursor.theme: name
-    Xcursor.size: [size]
-    g_file_set_contents(dir_path, "", -1, NULL);
-    g_free(dir_path);
-    */
-}
-
-static void reload_all_programs()
-{
-    GdkEventClient event;
-    event.type = GDK_CLIENT_EVENT;
-    event.send_event = TRUE;
-    event.window = NULL;
-
-    if( app.use_lxsession )
-    {
-        event.message_type = gdk_atom_intern_static_string("_LXSESSION");
-        event.data.b[0] = 0;    /* LXS_RELOAD */
-    }
-    else
-    {
-        /* if( icon_only )
-            event.message_type = gdk_atom_intern("_GTK_LOAD_ICONTHEMES", FALSE);
-        */
-        event.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
-    }
-    event.data_format = 8;
-    gdk_event_send_clientmessage_toall((GdkEvent *)&event);
-}
-
-static const char* bool2str(gboolean val)
-{
-    return val ? "TRUE" : "FALSE";
-}
-
-static void lxappearance_save_gtkrc()
-{
-    static const char* tb_styles[]={
-        "GTK_TOOLBAR_ICONS",
-        "GTK_TOOLBAR_TEXT",
-        "GTK_TOOLBAR_BOTH",
-        "GTK_TOOLBAR_BOTH_HORIZ"
-    };
-    static const char* tb_icon_sizes[]={
-        "GTK_ICON_SIZE_INVALID",
-        "GTK_ICON_SIZE_MENU",
-        "GTK_ICON_SIZE_SMALL_TOOLBAR",
-        "GTK_ICON_SIZE_LARGE_TOOLBAR",
-        "GTK_ICON_SIZE_BUTTON",
-        "GTK_ICON_SIZE_DND",
-        "GTK_ICON_SIZE_DIALOG"
-    };
-
-    char* file_path = g_build_filename(g_get_home_dir(), ".gtkrc-2.0", NULL);
-    GString* content = g_string_sized_new(512);
-    g_string_append_printf(content,
-        "# DO NOT EDIT! This file will be overwritten by LXAppearance.\n"
-        "# Any customization should be done in ~/.gtkrc-2.0.mine instead.\n\n"
-        "gtk-theme-name=\"%s\"\n"
-        "gtk-icon-theme-name=\"%s\"\n"
-        "gtk-font-name=\"%s\"\n"
-        "gtk-toolbar-style=%s\n"
-        "gtk-toolbar-icon-size=%s\n"
-        "gtk-cursor-theme-name=\"%s\"\n"
-        "gtk-cursor-theme-size=%d\n"
-        "gtk-button-images=%s\n"
-        "gtk-menu-images=%s\n"
-#if GTK_CHECK_VERSION(2, 14, 0)
-        "gtk-enable-event-sounds=%s\n"
-        "gtk-enable-input-feedback-sounds=%s\n",
-#endif
-        app.widget_theme,
-        app.icon_theme,
-        app.default_font,
-        tb_styles[app.toolbar_style],
-        tb_icon_sizes[app.toolbar_icon_size],
-        app.cursor_theme,
-        app.cursor_theme_size,
-        bool2str(app.button_images),
-        bool2str(app.menu_images),
-#if GTK_CHECK_VERSION(2, 14, 0)
-        bool2str(app.enable_event_sound),
-        bool2str(app.enable_input_feedback)
-#endif
-        );
-
-    if(app.color_scheme)
-    {
-        char* escaped = g_strescape(app.color_scheme, NULL);
-        g_string_append_printf(content,
-            "gtk-color-scheme=\"\"\n",
-            escaped);
-        g_free(escaped);
-    }
-
-    g_string_append_printf(content,
-        "include \"%s/.gtkrc-2.0.mine\"\n",
-        g_get_home_dir());
-
-    g_file_set_contents(file_path, content->str, content->len, NULL);
-    g_string_free(content, TRUE);
-    g_free(file_path);
-}
-
-static void lxappearance_save_lxsession()
-{
-    char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
-    char* user_config_file = g_build_filename(g_get_user_config_dir(), rel_path, NULL);
-    char* buf;
-    int len;
-    GKeyFile* kf = g_key_file_new();
-
-    if(!g_key_file_load_from_file(kf, user_config_file, G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, NULL))
-    {
-        /* the user config file doesn't exist, create its parent dir */
-        len = strlen(user_config_file) - strlen("/desktop.conf");
-        user_config_file[len] = '\0';
-        g_debug("user_config_file = %s", user_config_file);
-        g_mkdir_with_parents(user_config_file, 0700);
-        user_config_file[len] = '/';
-
-        g_key_file_load_from_dirs(kf, rel_path, g_get_system_config_dirs(), NULL, G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
-    }
-
-    g_free(rel_path);
-
-    g_key_file_set_string( kf, "GTK", "sNet/ThemeName", app.widget_theme );
-    g_key_file_set_string( kf, "GTK", "sGtk/FontName", app.default_font );
-
-    g_key_file_set_string( kf, "GTK", "sGtk/ColorScheme", app.color_scheme ? app.color_scheme : "" );
-
-    g_key_file_set_string( kf, "GTK", "sNet/IconThemeName", app.icon_theme );
-
-    g_key_file_set_string( kf, "GTK", "sGtk/CursorThemeName", app.cursor_theme );
-    g_key_file_set_integer( kf, "GTK", "iGtk/CursorThemeSize", app.cursor_theme_size );
-    save_cursor_theme_name();
-
-    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarStyle", app.toolbar_style );
-    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarIconSize", app.toolbar_icon_size );
-
-    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarStyle", app.toolbar_style );
-    g_key_file_set_integer( kf, "GTK", "iGtk/ToolbarIconSize", app.toolbar_icon_size );
-
-    g_key_file_set_integer( kf, "GTK", "iGtk/ButtonImages", app.button_images );
-    g_key_file_set_integer( kf, "GTK", "iGtk/MenuImages", app.menu_images );
-
-#if GTK_CHECK_VERSION(2, 14, 0)
-    /* "Net/SoundThemeName\0"      "gtk-sound-theme-name\0" */
-    g_key_file_set_integer( kf, "GTK", "iNet/EnableEventSounds", app.enable_event_sound);
-    g_key_file_set_integer( kf, "GTK", "iNet/EnableInputFeedbackSounds", app.enable_input_feedback);
-#endif
-
-    buf = g_key_file_to_data( kf, &len, NULL );
-    g_key_file_free(kf);
-
-    g_file_set_contents(user_config_file, buf, len, NULL);
-    g_free(buf);
-    g_free(user_config_file);
-}
-
-static void on_dlg_response(GtkDialog* dlg, int res, gpointer user_data)
-{
-    switch(res)
-    {
-    case GTK_RESPONSE_APPLY:
-
-        if(app.use_lxsession)
-            lxappearance_save_lxsession();
-        else
-            lxappearance_save_gtkrc();
-
-        reload_all_programs();
-
-        app.changed = FALSE;
-        gtk_dialog_set_response_sensitive(app.dlg, GTK_RESPONSE_APPLY, FALSE);
-        break;
-    case 1: /* about dialog */
-        {
-            GtkBuilder* b = gtk_builder_new();
-            if(gtk_builder_add_from_file(b, PACKAGE_UI_DIR "/about.ui", NULL))
-            {
-                GtkWidget* dlg = GTK_WIDGET(gtk_builder_get_object(b, "dlg"));
-                gtk_dialog_run(dlg);
-                gtk_widget_destroy(dlg);
-            }
-            g_object_unref(b);
-        }
-        break;
-    default:
-        gtk_main_quit();
-    }
-}
-
-static void settings_init()
-{
-    GtkSettings* settings = gtk_settings_get_default();
-    g_object_get(settings,
-                "gtk-theme-name", &app.widget_theme,
-                "gtk-font-name", &app.default_font,
-                "gtk-icon-theme-name", &app.icon_theme,
-                "gtk-cursor-theme-name", &app.cursor_theme,
-                "gtk-cursor-theme-size", &app.cursor_theme_size,
-                "gtk-toolbar-style", &app.toolbar_style,
-                "gtk-toolbar-icon-size", &app.toolbar_icon_size,
-                "gtk-button-images", &app.button_images,
-                "gtk-menu-images", &app.menu_images,
-#if GTK_CHECK_VERSION(2, 14, 0)
-                "gtk-enable-event-sounds", &app.enable_event_sound,
-                "gtk-enable-input-feedback-sounds", &app.enable_input_feedback,
-#endif
-                NULL);
-    /* try to figure out cursor theme used. */
-    if(!app.cursor_theme || g_strcmp0(app.cursor_theme, "default") == 0)
-    {
-        /* get the real theme name from default. */
-        GKeyFile* kf = g_key_file_new();
-        char* fpath = g_build_filename(g_get_home_dir(), ".icons/default/index.theme", NULL);
-        gboolean ret = g_key_file_load_from_file(kf, fpath, 0, NULL);
-        g_free(fpath);
-
-        if(!ret)
-            ret = g_key_file_load_from_data_dirs(kf, "icons/default/index.theme", NULL, 0, NULL);
-
-        if(ret)
-        {
-            g_free(app.cursor_theme);
-            app.cursor_theme = g_key_file_get_string(kf, "Icon Theme", "Inherits", NULL);
-            g_debug("cursor theme name: %s", app.cursor_theme);
-        }
-        g_key_file_free(kf);
-    }
-
-    app.color_scheme_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
-    /* try to load custom color scheme if available */
-    if(app.use_lxsession)
-    {
-        char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
-        char* user_config_file = g_build_filename(g_get_user_config_dir(), rel_path, NULL);
-        GKeyFile* kf = g_key_file_new();
-        if(g_key_file_load_from_file(kf, user_config_file, 0, NULL))
-            app.color_scheme = g_key_file_get_string(kf, "GTK", "sGtk/ColorScheme", NULL);
-        else if(g_key_file_load_from_dirs(kf, rel_path, g_get_system_config_dirs(), NULL, 0, NULL))
-            app.color_scheme = g_key_file_get_string(kf, "GTK", "sGtk/ColorScheme", NULL);
-        g_key_file_free(kf);
-        g_free(rel_path);
-        g_free(user_config_file);
-
-        if(app.color_scheme)
-        {
-            if(*app.color_scheme)
-                color_scheme_str_to_hash(app.color_scheme_hash, app.color_scheme);
-            else
-            {
-                g_free(app.color_scheme);
-                app.color_scheme = NULL;
-            }
-        }
-    }
-    else
-    {
-        char* gtkrc_file = g_build_filename(g_get_home_dir(), ".gtkrc-2.0", NULL);
-        gtkrc_file_get_color_scheme(gtkrc_file, app.color_scheme_hash);
-        g_free(gtkrc_file);
-        if(g_hash_table_size(app.color_scheme_hash) > 0)
-            app.color_scheme = color_scheme_hash_to_str(app.color_scheme_hash);
-    }
-}
-
-int main(int argc, char** argv)
-{
-    GError* err = NULL;
-    GtkBuilder* b;
-
-    /* gettext support */
-#ifdef ENABLE_NLS
-    bindtextdomain ( GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR );
-    bind_textdomain_codeset ( GETTEXT_PACKAGE, "UTF-8" );
-    textdomain ( GETTEXT_PACKAGE );
-#endif
-
-    /* initialize GTK+ and parse the command line arguments */
-    if( G_UNLIKELY( ! gtk_init_with_args( &argc, &argv, "", option_entries, GETTEXT_PACKAGE, &err ) ) )
-    {
-        g_print( "Error: %s\n", err->message );
-        return 1;
-    }
-
-    /* check if we're under LXSession */
-    check_lxsession();
-
-    /* create GUI here */
-    b = gtk_builder_new();
-    if(!gtk_builder_add_from_file(b, PACKAGE_UI_DIR "/lxappearance.ui", NULL))
-        return 1;
-
-    /* NOTE: GUI must be created prior to loading settings from GtkSettings object.
-     * Some properties of GtkSettings class are installed by some other gtk classes.
-     * For example, "gtk-menu-images" property is actually installed by initialization
-     * of GtkImageMenuItem class. If we load the GUI first, then when the menu items
-     * are created, this property gets correctly registered. So later it can be read. */
-
-    /* load config values */
-    settings_init();
-
-    app.dlg = GTK_WIDGET(gtk_builder_get_object(b, "dlg"));
-
-    widget_theme_init(b);
-    color_scheme_init(b);
-    icon_theme_init(b);
-    cursor_theme_init(b);
-    other_init(b);
-
-    g_signal_connect(app.dlg, "response", G_CALLBACK(on_dlg_response), NULL);
-
-    gtk_window_present(GTK_WINDOW(app.dlg));
-    g_object_unref(b);
-
-    gtk_main();
-
-    return 0;
-}
-
-void lxappearance_changed()
-{
-    if(!app.changed)
-    {
-        app.changed = TRUE;
-        gtk_dialog_set_response_sensitive(app.dlg, GTK_RESPONSE_APPLY, TRUE);
-    }
-}
diff --git a/src/lxappearance2.h b/src/lxappearance2.h
deleted file mode 100644 (file)
index eb04256..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *      lxappearance2.h
- *
- *      Copyright 2010 PCMan <pcman.tw@gmail.com>
- *
- *      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
- *      (at your option) any later version.
- *
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      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.
- */
-
-#ifndef _LXAPPEARANCE2_H_
-#define _LXAPPEARANCE2_H_
-
-#include <gtk/gtk.h>
-
-typedef struct _LXAppearance    LXAppearance;
-struct _LXAppearance
-{
-    GtkWidget* dlg;
-    GtkWidget* notebook;
-
-    /* gtk theme */
-    GtkWidget* widget_theme_view;
-    GtkListStore* widget_theme_store;
-    GtkWidget* default_font_btn;
-
-    /* color scheme */
-    GtkWidget* color_table;
-    GtkWidget* custom_colors;
-    GtkWidget* no_custom_colors;
-    GHashTable* color_scheme_hash; /* the custom color scheme set by the user */
-    GHashTable* default_color_scheme_hash; /* default colors of current gtk theme */
-    gboolean color_scheme_supported; /* if color scheme is supported by current gtk theme */
-    /* color buttons in color scheme page. */
-    GtkWidget* color_btns[8]; /* FIXME: this value might be changed in the future */
-
-    /* icon theme */
-    GtkWidget* icon_theme_view;
-    GtkListStore* icon_theme_store;
-    GtkWidget* icon_theme_remove_btn;
-
-    /* cursor theme */
-    GtkWidget* cursor_theme_view;
-    GtkWidget* cursor_demo_view;
-    GtkListStore* cursor_theme_store;
-    GtkWidget* cursor_size_range;
-    GtkWidget* cursor_theme_remove_btn;
-
-    GSList* icon_themes; /* a list of IconTheme struct representing all icon and cursor themes */
-
-    /* toolbar style and icon size */
-    GtkWidget* tb_style_combo;
-    GtkWidget* tb_icon_size_combo;
-
-    GtkWidget* button_images_check;
-    GtkWidget* menu_images_check;
-
-    char* widget_theme;
-    char* default_font;
-    char* icon_theme;
-    char* cursor_theme;
-    int cursor_theme_size;
-    char* color_scheme;
-    int toolbar_style;
-    int toolbar_icon_size;
-
-    gboolean button_images;
-    gboolean menu_images;
-
-#if GTK_CHECK_VERSION(2, 14, 0)
-    GtkWidget* event_sound_check;
-    GtkWidget* input_feedback_check;
-    gboolean enable_event_sound;
-    gboolean enable_input_feedback;
-#endif
-
-    gboolean changed;
-    gboolean use_lxsession;
-};
-
-extern LXAppearance app;
-
-void lxappearance_changed();
-
-#endif
index e9c15f9..d0ac12e 100644 (file)
@@ -18,7 +18,7 @@
 //      MA 02110-1301, USA.
 
 
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include "other.h"
 #include <glib/gi18n.h>
 
index 90b13e1..24746c2 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "utils.h"
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include <glib/gi18n.h>
 #include <sys/types.h>
 #include <signal.h>
index 6e23747..423fae2 100644 (file)
@@ -19,7 +19,7 @@
  *      MA 02110-1301, USA.
  */
 
-#include "lxappearance2.h"
+#include "lxappearance.h"
 #include "widget-theme.h"
 #include "color-scheme.h"
 #include <string.h>