diff options
-rw-r--r-- | TODO | 74 | ||||
-rw-r--r-- | settings/Makefile.am | 9 | ||||
-rw-r--r-- | settings/Makefile.in | 111 | ||||
-rw-r--r-- | settings/gnome-uri.c | 130 | ||||
-rw-r--r-- | settings/gnome-uri.h | 12 | ||||
-rw-r--r-- | settings/looknfeel.c | 364 | ||||
-rw-r--r-- | settings/looknfeel.h | 33 | ||||
-rw-r--r-- | settings/session.c | 183 | ||||
-rw-r--r-- | settings/settings.h | 31 | ||||
-rw-r--r-- | settings/xfce-session-settings.desktop | 6 | ||||
-rwxr-xr-x | settings/xfsm-install-theme | 101 | ||||
-rw-r--r-- | xfce4-session/xfsm-startup.c | 2 |
12 files changed, 785 insertions, 271 deletions
@@ -1,82 +1,8 @@ * run SmDiscardCommand when necessary (e.g. pending clients do not fire up, or we reach another checkpoint/shutdown) - * add a SaveYourself timeout, so bogus clients do not prevent the desktop - from shutdown [Initial code exists in manager.c SEE BELOW] - * Multiscreen support is missing (e.g. with the logout screen) - * Save to XML instead of this binary format. * Honor SmRestartStyleHint * Add APM support (separate SM client) - * Use GScanner to parse splash.theme files?! * Add an option to disable Autostart by xfce4-session - * Fix "Autostart" with default.session [no problem] * Add configure options to make packagers life easier regarding the "shutdown/reboot" thing (see the Mail from Marcel Pol on 20031120) [partly done] - * Remember last selected "Logout action" and make that the default for - the next session. - * Use full display string as session identifier instead of hostname only. - - * Add option to disable binding of a TCP/IP socket with ICE (see Moritz - mail on 20031211). [DONE] - * Fix the problem with xfce4-session not working on Solaris 9! [DONE] - * Move "setenv()" from manager.c to libxfce4util as xfce_setenv() [DONE] - * An error leads to a session close on Linux when running several xterms - as reported by Olivier. - * shutdown.allow method does not work! - -Freezes in Shutdown Screen: ---------------------------- - - * Select "poweroff" from the option menu, click outside the dialog -> frozen! - * Sole solution for now: get rid of the option menu and use radio buttons or - something else that does not create new toplevel windows. - - -Solution for the TIMEOUT in SAVEYOURSELF problem: -------------------------------------------------- - - * Handle the interacting clients first - * Then wait some period of time (e.g. 5-10 seconds) and if some clients - haven't finished the SAVE YOURSELF phase during that time, display a - window with a the list of "sucking" clients and a button "Terminate". - Pressing terminate will terminate the session regardless of the state - of the given clients. In addition to the window there should be a timer - that counts from 60 to 0 seconds and once 0 is reached the session is - automatically terminated. - - -IRC Log of Olivier and another Linux user with the xterm problem: ------------------------------------------------------------------ -<thomas_adam> ~/.xsession-errors report failings... -<ofourdan> sorry... -<ofourdan> what errors? -<thomas_adam> Client 0x3735252653653536738 lost connection to ICE_socket -<thomas_adam> that's repeated for the other xterm (there were two in the session I saved) -<thomas_adam> and then I just get flung back to the VT -<ofourdan> I think I had such a problem already and reported to benny -<ofourdan> no core, just the session dies -<thomas_adam> ah right -<thomas_adam> yup -<thomas_adam> so a work in progress then? :) -<ofourdan> dunno, cuz he didn't take it into account -<ofourdan> afaik -<thomas_adam> oh, :) -<ofourdan> he can't reproduce the problem -<ofourdan> do you run linux. -<ofourdan> what xfree ? -<ofourdan> does it fail with xterm? -<thomas_adam> Debain Unstable -<thomas_adam> XFree86 4.2.1.1 -<thomas_adam> If I clear ~/.xfce/session -<thomas_adam> and start from scratch... -<ofourdan> what if you run another type of terminal, like gnome-terminal or rxvt instead of xterm? -<thomas_adam> yeah... -<thomas_adam> if I open say rxvt or xterm or both, and save them... -<thomas_adam> log back in, the session is restored fine.... -<ofourdan> no, no, no xterm at all -<thomas_adam> I have tried that.... -<thomas_adam> I'm getting to my point :) -<ofourdan> well, I'll try to ping benny agin on that, it's definitely a show stopper -<thomas_adam> one save and one restore of that session works fine... -<thomas_adam> any subsequent restores of that session cause it to keel over and die. - diff --git a/settings/Makefile.am b/settings/Makefile.am index 32cd5223..619dbc53 100644 --- a/settings/Makefile.am +++ b/settings/Makefile.am @@ -8,18 +8,25 @@ session_settings_la_LDFLAGS = \ -module session_settings_la_SOURCES = \ + gnome-uri.c \ + gnome-uri.h \ + looknfeel.c \ + looknfeel.h \ session-icon.h \ session.c \ ../xfce4-session/xfsm-splash-theme.c session_settings_la_CFLAGS = \ @XFCE_MCS_MANAGER_CFLAGS@ \ - -DPACKAGE_LOCALE_DIR=\"$(localedir)\" + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ + -DXFSM_INSTALL_THEME=\"$(libexecdir)/xfsm-install-theme\" session-icon.h: $(srcdir)/session.png gdk-pixbuf-csource --raw --build-list \ session_icon_data $(srcdir)/session.png > session-icon.h +libexec_SCRIPTS = xfsm-install-theme + noinst_DATA = \ session-icon.h diff --git a/settings/Makefile.in b/settings/Makefile.in index bc4422da..de040476 100644 --- a/settings/Makefile.in +++ b/settings/Makefile.in @@ -15,6 +15,7 @@ @SET_MAKE@ + SOURCES = $(session_settings_la_SOURCES) srcdir = @srcdir@ @@ -49,17 +50,23 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -am__installdirs = $(DESTDIR)$(sessiondir) $(DESTDIR)$(appsdir) +am__installdirs = $(DESTDIR)$(sessiondir) $(DESTDIR)$(libexecdir) $(DESTDIR)$(appsdir) sessionLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(session_LTLIBRARIES) session_settings_la_LIBADD = -am_session_settings_la_OBJECTS = session_settings_la-session.lo \ +am_session_settings_la_OBJECTS = session_settings_la-gnome-uri.lo \ + session_settings_la-looknfeel.lo \ + session_settings_la-session.lo \ session_settings_la-xfsm-splash-theme.lo session_settings_la_OBJECTS = $(am_session_settings_la_OBJECTS) +libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(libexec_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/session_settings_la-session.Plo \ +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/session_settings_la-gnome-uri.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/session_settings_la-looknfeel.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/session_settings_la-session.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/session_settings_la-xfsm-splash-theme.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -224,14 +231,20 @@ session_settings_la_LDFLAGS = \ -module session_settings_la_SOURCES = \ + gnome-uri.c \ + gnome-uri.h \ + looknfeel.c \ + looknfeel.h \ session-icon.h \ session.c \ ../xfce4-session/xfsm-splash-theme.c session_settings_la_CFLAGS = \ @XFCE_MCS_MANAGER_CFLAGS@ \ - -DPACKAGE_LOCALE_DIR=\"$(localedir)\" + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ + -DXFSM_INSTALL_THEME=\"$(libexecdir)/xfsm-install-theme\" +libexec_SCRIPTS = xfsm-install-theme noinst_DATA = \ session-icon.h @@ -303,6 +316,25 @@ clean-sessionLTLIBRARIES: done session_settings.la: $(session_settings_la_OBJECTS) $(session_settings_la_DEPENDENCIES) $(LINK) -rpath $(sessiondir) $(session_settings_la_LDFLAGS) $(session_settings_la_OBJECTS) $(session_settings_la_LIBADD) $(LIBS) +install-libexecSCRIPTS: $(libexec_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkdir_p) $(DESTDIR)$(libexecdir) + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f"; \ + $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f; \ + else :; fi; \ + done + +uninstall-libexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ + rm -f $(DESTDIR)$(libexecdir)/$$f; \ + done mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -310,6 +342,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_settings_la-gnome-uri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_settings_la-looknfeel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_settings_la-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_settings_la-xfsm-splash-theme.Plo@am__quote@ @@ -337,6 +371,54 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +session_settings_la-gnome-uri.o: gnome-uri.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-gnome-uri.o -MD -MP -MF "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" -c -o session_settings_la-gnome-uri.o `test -f 'gnome-uri.c' || echo '$(srcdir)/'`gnome-uri.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" "$(DEPDIR)/session_settings_la-gnome-uri.Po"; else rm -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gnome-uri.c' object='session_settings_la-gnome-uri.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-gnome-uri.Po' tmpdepfile='$(DEPDIR)/session_settings_la-gnome-uri.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-gnome-uri.o `test -f 'gnome-uri.c' || echo '$(srcdir)/'`gnome-uri.c + +session_settings_la-gnome-uri.obj: gnome-uri.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-gnome-uri.obj -MD -MP -MF "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" -c -o session_settings_la-gnome-uri.obj `if test -f 'gnome-uri.c'; then $(CYGPATH_W) 'gnome-uri.c'; else $(CYGPATH_W) '$(srcdir)/gnome-uri.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" "$(DEPDIR)/session_settings_la-gnome-uri.Po"; else rm -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gnome-uri.c' object='session_settings_la-gnome-uri.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-gnome-uri.Po' tmpdepfile='$(DEPDIR)/session_settings_la-gnome-uri.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-gnome-uri.obj `if test -f 'gnome-uri.c'; then $(CYGPATH_W) 'gnome-uri.c'; else $(CYGPATH_W) '$(srcdir)/gnome-uri.c'; fi` + +session_settings_la-gnome-uri.lo: gnome-uri.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-gnome-uri.lo -MD -MP -MF "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" -c -o session_settings_la-gnome-uri.lo `test -f 'gnome-uri.c' || echo '$(srcdir)/'`gnome-uri.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo" "$(DEPDIR)/session_settings_la-gnome-uri.Plo"; else rm -f "$(DEPDIR)/session_settings_la-gnome-uri.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gnome-uri.c' object='session_settings_la-gnome-uri.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-gnome-uri.Plo' tmpdepfile='$(DEPDIR)/session_settings_la-gnome-uri.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-gnome-uri.lo `test -f 'gnome-uri.c' || echo '$(srcdir)/'`gnome-uri.c + +session_settings_la-looknfeel.o: looknfeel.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-looknfeel.o -MD -MP -MF "$(DEPDIR)/session_settings_la-looknfeel.Tpo" -c -o session_settings_la-looknfeel.o `test -f 'looknfeel.c' || echo '$(srcdir)/'`looknfeel.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo" "$(DEPDIR)/session_settings_la-looknfeel.Po"; else rm -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='looknfeel.c' object='session_settings_la-looknfeel.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-looknfeel.Po' tmpdepfile='$(DEPDIR)/session_settings_la-looknfeel.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-looknfeel.o `test -f 'looknfeel.c' || echo '$(srcdir)/'`looknfeel.c + +session_settings_la-looknfeel.obj: looknfeel.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-looknfeel.obj -MD -MP -MF "$(DEPDIR)/session_settings_la-looknfeel.Tpo" -c -o session_settings_la-looknfeel.obj `if test -f 'looknfeel.c'; then $(CYGPATH_W) 'looknfeel.c'; else $(CYGPATH_W) '$(srcdir)/looknfeel.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo" "$(DEPDIR)/session_settings_la-looknfeel.Po"; else rm -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='looknfeel.c' object='session_settings_la-looknfeel.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-looknfeel.Po' tmpdepfile='$(DEPDIR)/session_settings_la-looknfeel.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-looknfeel.obj `if test -f 'looknfeel.c'; then $(CYGPATH_W) 'looknfeel.c'; else $(CYGPATH_W) '$(srcdir)/looknfeel.c'; fi` + +session_settings_la-looknfeel.lo: looknfeel.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-looknfeel.lo -MD -MP -MF "$(DEPDIR)/session_settings_la-looknfeel.Tpo" -c -o session_settings_la-looknfeel.lo `test -f 'looknfeel.c' || echo '$(srcdir)/'`looknfeel.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo" "$(DEPDIR)/session_settings_la-looknfeel.Plo"; else rm -f "$(DEPDIR)/session_settings_la-looknfeel.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='looknfeel.c' object='session_settings_la-looknfeel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/session_settings_la-looknfeel.Plo' tmpdepfile='$(DEPDIR)/session_settings_la-looknfeel.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -c -o session_settings_la-looknfeel.lo `test -f 'looknfeel.c' || echo '$(srcdir)/'`looknfeel.c + session_settings_la-session.o: session.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(session_settings_la_CFLAGS) $(CFLAGS) -MT session_settings_la-session.o -MD -MP -MF "$(DEPDIR)/session_settings_la-session.Tpo" -c -o session_settings_la-session.o `test -f 'session.c' || echo '$(srcdir)/'`session.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/session_settings_la-session.Tpo" "$(DEPDIR)/session_settings_la-session.Po"; else rm -f "$(DEPDIR)/session_settings_la-session.Tpo"; exit 1; fi @@ -487,9 +569,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) $(DATA) +all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(DATA) installdirs: - $(mkdir_p) $(DESTDIR)$(sessiondir) $(DESTDIR)$(appsdir) + $(mkdir_p) $(DESTDIR)$(sessiondir) $(DESTDIR)$(libexecdir) $(DESTDIR)$(appsdir) install: install-am install-exec: install-exec-am install-data: install-data-am @@ -537,7 +619,7 @@ info-am: install-data-am: install-appsDATA install-sessionLTLIBRARIES -install-exec-am: +install-exec-am: install-libexecSCRIPTS install-info: install-info-am @@ -564,7 +646,7 @@ ps: ps-am ps-am: uninstall-am: uninstall-appsDATA uninstall-info-am \ - uninstall-sessionLTLIBRARIES + uninstall-libexecSCRIPTS uninstall-sessionLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sessionLTLIBRARIES ctags distclean \ @@ -572,12 +654,13 @@ uninstall-am: uninstall-appsDATA uninstall-info-am \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-appsDATA install-data \ install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-sessionLTLIBRARIES \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-appsDATA uninstall-info-am \ + install-info-am install-libexecSCRIPTS install-man \ + install-sessionLTLIBRARIES install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-appsDATA \ + uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sessionLTLIBRARIES diff --git a/settings/gnome-uri.c b/settings/gnome-uri.c new file mode 100644 index 00000000..a35d7274 --- /dev/null +++ b/settings/gnome-uri.c @@ -0,0 +1,130 @@ +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_STRING_H +#include <string.h> +#endif + +#include <settings/gnome-uri.h> + +/*** the next three routines are taken straight from gnome-libs so that the + gtk-only version can receive drag and drops as well ***/ +/** + * gnome_uri_list_free_strings: + * @list: A GList returned by gnome_uri_list_extract_uris() or gnome_uri_list_extract_filenames() + * + * Releases all of the resources allocated by @list. + */ +void +gnome_uri_list_free_strings (GList * list) +{ + g_list_foreach (list, (GFunc) g_free, NULL); + g_list_free (list); +} + +/** + * gnome_uri_list_extract_uris: + * @uri_list: an uri-list in the standard format. + * + * Returns a GList containing strings allocated with g_malloc + * that have been splitted from @uri-list. + */ +GList * +gnome_uri_list_extract_uris (const gchar * uri_list) +{ + const gchar *p, *q; + gchar *retval; + GList *result = NULL; + + g_return_val_if_fail (uri_list != NULL, NULL); + + p = uri_list; + + /* We don't actually try to validate the URI according to RFC + * 2396, or even check for allowed characters - we just ignore + * comments and trim whitespace off the ends. We also + * allow LF delimination as well as the specified CRLF. + */ + while (p) + { + if (*p != '#') + { + while (g_ascii_isspace ((int) (*p))) + p++; + + q = p; + while (*q && (*q != '\n') && (*q != '\r')) + q++; + + if (q > p) + { + q--; + while (q > p && g_ascii_isspace ((int) (*q))) + q--; + + retval = (char *) g_malloc (q - p + 2); + strncpy (retval, p, q - p + 1); + retval[q - p + 1] = '\0'; + + result = g_list_prepend (result, retval); + } + } + p = strchr (p, '\n'); + if (p) + p++; + } + + return g_list_reverse (result); +} + + +/** + * gnome_uri_list_extract_filenames: + * @uri_list: an uri-list in the standard format + * + * Returns a GList containing strings allocated with g_malloc + * that contain the filenames in the uri-list. + * + * Note that unlike gnome_uri_list_extract_uris() function, this + * will discard any non-file uri from the result value. + */ +GList * +gnome_uri_list_extract_filenames (const gchar * uri_list) +{ + GList *tmp_list, *node, *result; + + g_return_val_if_fail (uri_list != NULL, NULL); + + result = gnome_uri_list_extract_uris (uri_list); + + tmp_list = result; + while (tmp_list) + { + gchar *s = (char *) tmp_list->data; + + node = tmp_list; + tmp_list = tmp_list->next; + + if (!strncmp (s, "file:", 5)) + { + /* added by Jasper Huijsmans + remove leading multiple slashes */ + if (!strncmp (s + 5, "///", 3)) + node->data = g_strdup (s + 7); + else + node->data = g_strdup (s + 5); + } + else + { + node->data = g_strdup (s); + } + g_free (s); + } + return result; +} + + + diff --git a/settings/gnome-uri.h b/settings/gnome-uri.h new file mode 100644 index 00000000..888915ec --- /dev/null +++ b/settings/gnome-uri.h @@ -0,0 +1,12 @@ +/* $Id$ */ + +#ifndef __GNOME_URI_H__ +#define __GNOME_URI_H__ + +#include <glib.h> + +void gnome_uri_list_free_strings (GList *list); +GList *gnome_uri_list_extract_uris (const gchar *uri_list); +GList *gnome_uri_list_extract_filenames (const gchar *uri_list); + +#endif /* !__GNOME_URI_H__ */ diff --git a/settings/looknfeel.c b/settings/looknfeel.c new file mode 100644 index 00000000..7c2448ba --- /dev/null +++ b/settings/looknfeel.c @@ -0,0 +1,364 @@ +/* $Id$ */ +/*- + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * 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, 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_STRING_H +#include <string.h> +#endif + +#include <libxfcegui4/libxfcegui4.h> + +#include <xfce4-session/xfsm-splash-theme.h> + +#include <settings/gnome-uri.h> +#include <settings/looknfeel.h> +#include <settings/settings.h> + + +enum +{ + TARGET_STRING, + TARGET_URI, +}; + + +enum +{ + PREVIEW_COLUMN, + TITLE_COLUMN, + NAME_COLUMN, + N_COLUMNS, +}; + + +static GtkTargetEntry targets[] = +{ + { "text/uri-list", 0, TARGET_URI }, + { "STRING", 0, TARGET_STRING }, +}; + +static gsize n_targets = sizeof (targets) / sizeof (*targets); +static GtkWidget *looknfeel_treeview; + + +static gboolean +looknfeel_load_theme_for_iter (GtkListStore *store, + GtkTreeIter *iter, + const gchar *name) +{ + XfsmSplashTheme *theme; + GdkPixbuf *preview; + gchar title[128]; + + theme = xfsm_splash_theme_load (name); + if (theme == NULL) + return FALSE; + + g_snprintf (title, 128, "<b>%s</b>\n<small><i>%s</i></small>", + xfsm_splash_theme_get_name (theme), + xfsm_splash_theme_get_description (theme)); + preview = xfsm_splash_theme_generate_preview (theme, 52, 43); + + gtk_list_store_set (store, iter, + PREVIEW_COLUMN, preview, + TITLE_COLUMN, title, + NAME_COLUMN, name, + -1); + + xfsm_splash_theme_destroy (theme); + g_object_unref (preview); + + return TRUE; +} + + +static GtkTreeModel* +looknfeel_load_themelist (void) +{ + GtkListStore *store; + GtkTreeIter iter; + gchar **themes; + gchar *name; + gchar *endp; + guint n; + + store = gtk_list_store_new (N_COLUMNS, + GDK_TYPE_PIXBUF, + G_TYPE_STRING, + G_TYPE_STRING); + + themes = xfce_resource_match (XFCE_RESOURCE_THEMES, "*/xfsm4/themerc", TRUE); + if (themes != NULL) + { + for (n = 0; themes[n] != NULL; ++n) + { + name = themes[n]; + endp = strchr (name, '/'); + + if (endp == NULL) + continue; + else + *endp = '\0'; + + gtk_list_store_append (store, &iter); + if (!looknfeel_load_theme_for_iter (store, &iter, name)) + gtk_list_store_remove (store, &iter); + } + + g_strfreev (themes); + } + + return GTK_TREE_MODEL (store); +} + + +static gboolean +looknfeel_find_theme (const gchar *theme_name, GtkTreeIter *iter) +{ + GtkTreeModel *model; + gboolean match; + gchar *name; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (looknfeel_treeview)); + + if (gtk_tree_model_get_iter_first (model, iter)) + { + do + { + gtk_tree_model_get (model, iter, NAME_COLUMN, &name, -1); + match = (strcmp (name, theme_name) == 0); + g_free (name); + + if (match) + return TRUE; + } + while (gtk_tree_model_iter_next (model, iter)); + } + + return FALSE; +} + + +static void +looknfeel_select_theme (const gchar *selected_theme) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (looknfeel_treeview)); + + if (looknfeel_find_theme (selected_theme, &iter)) + gtk_tree_selection_select_iter (selection, &iter); + else if (gtk_tree_model_get_iter_first (model, &iter)) + gtk_tree_selection_select_iter (selection, &iter); +} + + +static gboolean +looknfeel_reload_theme (const gchar *name) +{ + GtkListStore *store; + GtkTreeIter iter; + + store = GTK_LIST_STORE (gtk_tree_view_get_model ( + GTK_TREE_VIEW (looknfeel_treeview))); + + if (!looknfeel_find_theme (name, &iter)) + gtk_list_store_append (store, &iter); + + if (!looknfeel_load_theme_for_iter (store, &iter, name)) + { + gtk_list_store_remove (store, &iter); + return FALSE; + } + + return TRUE; +} + + +static gboolean +looknfeel_install_theme (const gchar *path) +{ + gchar *standard_output; + gchar *standard_error; + gint exit_status; + gboolean result; + gchar *target; + gchar *argv[4]; + + g_return_val_if_fail (path != NULL, FALSE); + + target = xfce_resource_save_location (XFCE_RESOURCE_THEMES, NULL, TRUE); + if (target == NULL) + { + g_warning ("Unable to determine save location for themes."); + return FALSE; + } + + argv[0] = XFSM_INSTALL_THEME; + argv[1] = (gchar *) path; + argv[2] = target; + argv[3] = NULL; + + result = g_spawn_sync (NULL, argv, NULL, 0, NULL, NULL, + &standard_output, &standard_error, + &exit_status, NULL); + + g_free (target); + + if (!result) + { + g_warning ("Unable to execute %s", XFSM_INSTALL_THEME); + return FALSE; + } + + g_strstrip (standard_output); + g_strstrip (standard_error); + + if (exit_status != 0) + { + g_warning ("%s failed: %s", XFSM_INSTALL_THEME, standard_error); + g_free (standard_output); + g_free (standard_error); + return FALSE; + } + + result = looknfeel_reload_theme (standard_output); + + g_free (standard_output); + g_free (standard_error); + return result; +} + + +static void +looknfeel_dropped (GtkWidget *treeview, GdkDragContext *context, + gint x, gint y, GtkSelectionData *data, + guint info, guint time, gpointer user_data) +{ + gboolean succeed = FALSE; + GList *fnames; + + fnames = gnome_uri_list_extract_filenames ((const gchar *) data->data); + if (fnames != NULL) + { + if (g_list_length (fnames) == 1) + { + succeed = TRUE; + + if (!looknfeel_install_theme ((const gchar *) fnames->data)) + succeed = FALSE; + } + + gnome_uri_list_free_strings (fnames); + } + + gtk_drag_finish (context, succeed, FALSE, time); +} + + +GtkWidget* +looknfeel_create (XfceRc *rc) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkWidget *frame; + GtkWidget *page; + GtkWidget *swin; + GtkWidget *vbox; + const gchar *theme; + + xfce_rc_set_group (rc, "Splash Theme"); + theme = xfce_rc_read_entry (rc, "Name", "Default"); + + page = gtk_vbox_new (FALSE, BORDER); + gtk_container_set_border_width (GTK_CONTAINER (page), BORDER); + + frame = xfce_framebox_new (_("Splash theme"), TRUE); + gtk_box_pack_start (GTK_BOX (page), frame, TRUE, TRUE, 0); + vbox = gtk_vbox_new (FALSE, 0); + xfce_framebox_add (XFCE_FRAMEBOX (frame), vbox); + + swin = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin), + GTK_POLICY_NEVER, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), + GTK_SHADOW_ETCHED_IN); + gtk_box_pack_start (GTK_BOX (vbox), swin, TRUE, TRUE, 0); + gtk_widget_show (swin); + + model = looknfeel_load_themelist (); + looknfeel_treeview = gtk_tree_view_new_with_model (model); + g_object_unref (G_OBJECT (model)); + looknfeel_select_theme (theme); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); + gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection), + GTK_SELECTION_SINGLE); + g_signal_connect (G_OBJECT (selection), "changed", + G_CALLBACK (config_store), NULL); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (looknfeel_treeview), FALSE); + gtk_tree_view_append_column (GTK_TREE_VIEW (looknfeel_treeview), + gtk_tree_view_column_new_with_attributes ("Preview", + gtk_cell_renderer_pixbuf_new (), "pixbuf", PREVIEW_COLUMN, NULL)); + gtk_tree_view_append_column (GTK_TREE_VIEW (looknfeel_treeview), + gtk_tree_view_column_new_with_attributes ("Description", + gtk_cell_renderer_text_new (), "markup", TITLE_COLUMN, NULL)); + gtk_container_add (GTK_CONTAINER (swin), looknfeel_treeview); + + /* Drag&Drop support */ + gtk_drag_dest_set (looknfeel_treeview, GTK_DEST_DEFAULT_ALL, targets, + n_targets, GDK_ACTION_COPY); + g_signal_connect (G_OBJECT (looknfeel_treeview), "drag_data_received", + G_CALLBACK (looknfeel_dropped), NULL); + + return page; +} + + +void +looknfeel_store (XfceRc *rc) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gchar *name; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + { + gtk_tree_model_get (model, &iter, NAME_COLUMN, &name, -1); + if (name != NULL) + { + xfce_rc_set_group (rc, "Splash Theme"); + xfce_rc_write_entry (rc, "Name", name); + g_free (name); + } + } +} + + + diff --git a/settings/looknfeel.h b/settings/looknfeel.h new file mode 100644 index 00000000..a518c487 --- /dev/null +++ b/settings/looknfeel.h @@ -0,0 +1,33 @@ +/* $Id$ */ +/*- + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * 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, 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __LOOKNFEEL_H__ +#define __LOOKNFEEL_H__ + +#include <gtk/gtk.h> + +#include <libxfce4util/libxfce4util.h> + + +GtkWidget *looknfeel_create (XfceRc *rc); +void looknfeel_store (XfceRc *rc); + +#endif /* !__LOOKNFEEL_H__ */ diff --git a/settings/session.c b/settings/session.c index 479fe8ff..46bbf6a9 100644 --- a/settings/session.c +++ b/settings/session.c @@ -38,23 +38,9 @@ #include <libxfcegui4/libxfcegui4.h> #include <xfce-mcs-manager/manager-plugin.h> -#include <xfce4-session/xfsm-splash-theme.h> +#include <settings/looknfeel.h> #include <settings/session-icon.h> - - -#define BORDER 6 - - -/* - Columns in the splash theme treeview - */ -enum -{ - PREVIEW_COLUMN, - TITLE_COLUMN, - NAME_COLUMN, - N_COLUMNS, -}; +#include <settings/settings.h> @@ -65,7 +51,6 @@ static GtkWidget *dialog = NULL; static GtkWidget *general_omenu; static GtkWidget *general_autosave; static GtkWidget *general_prompt; -static GtkWidget *looknfeel_treeview; static GtkWidget *advanced_kde; static GtkWidget *advanced_gnome; static GtkWidget *advanced_remote; @@ -84,14 +69,10 @@ config_open (gboolean readonly) } -static void +void config_store (void) { - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; gint history; - gchar *name; XfceRc *rc; g_return_if_fail (dialog != NULL); @@ -130,17 +111,7 @@ config_store (void) xfce_rc_write_int_entry (rc, "Timeout", 0); } - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gtk_tree_model_get (model, &iter, NAME_COLUMN, &name, -1); - if (name != NULL) - { - xfce_rc_set_group (rc, "Splash Theme"); - xfce_rc_write_entry (rc, "Name", name); - g_free (name); - } - } + looknfeel_store (rc); xfce_rc_close (rc); } @@ -219,152 +190,6 @@ general_create (XfceRc *rc) /* - Look and feel - */ -static GtkTreeModel* -looknfeel_load_themelist (void) -{ - XfsmSplashTheme *theme; - GtkListStore *store; - GtkTreeIter iter; - GdkPixbuf *preview; - gchar title[128]; - gchar **themes; - gchar *name; - gchar *endp; - guint n; - - store = gtk_list_store_new (N_COLUMNS, - GDK_TYPE_PIXBUF, - G_TYPE_STRING, - G_TYPE_STRING); - - themes = xfce_resource_match (XFCE_RESOURCE_THEMES, "*/xfsm4/themerc", TRUE); - for (n = 0; themes[n] != NULL; ++n) - { - name = themes[n]; - endp = strchr (name, '/'); - - if (endp == NULL) - continue; - else - *endp = '\0'; - - theme = xfsm_splash_theme_load (name); - if (theme == NULL) - continue; - - g_snprintf (title, 128, "<b>%s</b>\n<small><i>%s</i></small>", - xfsm_splash_theme_get_name (theme), - xfsm_splash_theme_get_description (theme)); - preview = xfsm_splash_theme_generate_preview (theme, 52, 43); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - PREVIEW_COLUMN, preview, - TITLE_COLUMN, title, - NAME_COLUMN, name, - -1); - - xfsm_splash_theme_destroy (theme); - g_object_unref (preview); - } - - return GTK_TREE_MODEL (store); -} - - -static void -looknfeel_select_theme (const gchar *selected_theme) -{ - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - gboolean match; - gchar *name; - - g_return_if_fail (dialog != NULL); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (looknfeel_treeview)); - - if (gtk_tree_model_get_iter_first (model, &iter)) - { - do - { - gtk_tree_model_get (model, &iter, NAME_COLUMN, &name, -1); - match = (strcmp (name, selected_theme) == 0); - g_free (name); - - if (match) - { - gtk_tree_selection_select_iter (selection, &iter); - return; - } - } - while (gtk_tree_model_iter_next (model, &iter)); - } - - if (gtk_tree_model_get_iter_first (model, &iter)) - gtk_tree_selection_select_iter (selection, &iter); -} - - -static GtkWidget* -looknfeel_create (XfceRc *rc) -{ - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkWidget *frame; - GtkWidget *page; - GtkWidget *swin; - GtkWidget *vbox; - const gchar *theme; - - xfce_rc_set_group (rc, "Splash Theme"); - theme = xfce_rc_read_entry (rc, "Name", "Default"); - - page = gtk_vbox_new (FALSE, BORDER); - gtk_container_set_border_width (GTK_CONTAINER (page), BORDER); - - frame = xfce_framebox_new (_("Splash theme"), TRUE); - gtk_box_pack_start (GTK_BOX (page), frame, TRUE, TRUE, 0); - vbox = gtk_vbox_new (FALSE, 0); - xfce_framebox_add (XFCE_FRAMEBOX (frame), vbox); - - swin = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin), - GTK_POLICY_NEVER, - GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), - GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start (GTK_BOX (vbox), swin, TRUE, TRUE, 0); - gtk_widget_show (swin); - - model = looknfeel_load_themelist (); - looknfeel_treeview = gtk_tree_view_new_with_model (model); - g_object_unref (G_OBJECT (model)); - looknfeel_select_theme (theme); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (looknfeel_treeview)); - gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection), - GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", - G_CALLBACK (config_store), NULL); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (looknfeel_treeview), FALSE); - gtk_tree_view_append_column (GTK_TREE_VIEW (looknfeel_treeview), - gtk_tree_view_column_new_with_attributes ("Preview", - gtk_cell_renderer_pixbuf_new (), "pixbuf", PREVIEW_COLUMN, NULL)); - gtk_tree_view_append_column (GTK_TREE_VIEW (looknfeel_treeview), - gtk_tree_view_column_new_with_attributes ("Description", - gtk_cell_renderer_text_new (), "markup", TITLE_COLUMN, NULL)); - gtk_container_add (GTK_CONTAINER (swin), looknfeel_treeview); - - return page; -} - - - -/* Advanced */ static GtkWidget* diff --git a/settings/settings.h b/settings/settings.h new file mode 100644 index 00000000..d85b6dae --- /dev/null +++ b/settings/settings.h @@ -0,0 +1,31 @@ +/* $Id$ */ +/*- + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * 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, 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SETTINGS_H__ +#define __SETTINGS_H__ + +/* default container border */ +#define BORDER 6 + + +void config_store (void); + +#endif /* !__SETTINGS_H__ */ diff --git a/settings/xfce-session-settings.desktop b/settings/xfce-session-settings.desktop index 15237bb2..37a0b30b 100644 --- a/settings/xfce-session-settings.desktop +++ b/settings/xfce-session-settings.desktop @@ -1,7 +1,9 @@ [Desktop Entry] Encoding=UTF-8 -Name=Xfce 4 Session Settings -Comment=Session Settings +Name=Xfce 4 Sessions and Startup Settings +Name[de]=Xfce 4 Sitzungs und Start Einstellungen +Comment=Session and Startup Settings +Comment[de]=Sitzungs und Start Einstellungen Exec=xfce-setting-show session Icon=xfce4-session Terminal=false diff --git a/settings/xfsm-install-theme b/settings/xfsm-install-theme new file mode 100755 index 00000000..2add0056 --- /dev/null +++ b/settings/xfsm-install-theme @@ -0,0 +1,101 @@ +#!/bin/sh +# +# Copyright (c) 2004 Benedikt Meurer <benny@xfce.org> +# All rights reserved. +# +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# + +leave() +{ + if test -d "${tmpdir}"; then + rm -rf "${tmpdir}" >/dev/null 2>&1 + fi + exit $1 +} + +if test $# -ne 2; then + echo "Usage: xfsm-install-theme <theme> <targetdir>" >&2 + exit 1 +fi + +tmpdir="" +themedir="${1}" +targetdir="${2}" + +# ensure the target directory exists +if test ! -d "${targetdir}"; then + mkdirhier "${targetdir}" >/dev/null 2>&1 + if test $? -ne 0; then + echo "Unable to create themes directory ${targetdir}." >&2 + exit 1 + fi +fi + +# if the source is a file, we expect it to be a tarball +if test -f "${themedir}"; then + tmpdir=`mktemp -d "/tmp/xfsm4-theme-XXXXXX"` || exit 1 + + if echo "${themedir}" | grep '\.tar\.gz$' >/dev/null 2>&1; then + tar xzf "${themedir}" -C "${tmpdir}" >/dev/null 2>&1 + if test $? -ne 0; then + echo "Unable to extract theme." 2>&2 + leave 1 + fi + else + echo "Not a splash theme file: ${themedir}." >&2 + leave 1 + fi + + themerc=`ls ${tmpdir}/*/xfsm4/themerc` || leave 1 + xfsm4dir=`dirname "${themerc}"` || leave 1 + topdir=`dirname "${xfsm4dir}"` || leave 1 + + if test ! -d "${topdir}" -o ! -d "${topdir}/xfsm4/"; then + echo "Invalid theme file format." >&2 + leave 1 + fi + + themedir="${topdir}" +fi + +# verify the theme content +if test -d "${themedir}"; then + if test ! -d "${themedir}/xfsm4/"; then + echo "No xfsm4 sub directory in theme." >&2 + leave 1 + fi + + if test ! -r "${themedir}/xfsm4/themerc"; then + echo "No themerc file in theme." >&2 + leave 1 + fi +fi + +# install the theme +themebase=`dirname "${themedir}"` +themename=`basename "${themedir}"` +(cd "${themebase}" \ + && tar cf - "${themename}/xfsm4/" \ + | (cd "${targetdir}" && tar xf -)) >/dev/null 2>&1 +if test $? -ne 0; then + echo "Unable to install the theme ${themename} from ${themebase} to ${targetdir}." + leave 1 +fi + +# tell the caller the name of the installed plugin +echo "${themename}" +leave 0 diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c index e8e88302..6e29acfe 100644 --- a/xfce4-session/xfsm-startup.c +++ b/xfce4-session/xfsm-startup.c @@ -113,7 +113,7 @@ figure_app_name (const gchar *program_path) return _("Starting the Panel"); else if (strcmp (prog, "xfdesktop") == 0) return _("Starting the Desktop Manager"); - else if (strcmp (prog, "xftasbar4") == 0) + else if (strcmp (prog, "xftaskbar4") == 0) return _("Starting the Taskbar"); else if (strcmp (prog, "xfwm4") == 0) return _("Starting the Window Manager"); |