remove old capplets that are now subsumed in the appearance capplet from
2007-09-30 Jens Granseuer <jensgr@gmx.net> * capplets/background: * capplets/font: * capplets/theme-switcher: * capplets/ui-properties: remove old capplets that are now subsumed in the appearance capplet from the repository svn path=/trunk/; revision=8145
|
@ -1,53 +0,0 @@
|
|||
# This is used in GNOMECC_CAPPLETS_CFLAGS
|
||||
cappletname = background
|
||||
|
||||
WALLPAPER_DATADIR = $(datadir)/gnome-background-properties
|
||||
|
||||
INCLUDES = \
|
||||
$(GNOMECC_CAPPLETS_CFLAGS) \
|
||||
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\"" \
|
||||
-DWALLPAPER_DATADIR=\""$(WALLPAPER_DATADIR)"\"
|
||||
|
||||
bin_PROGRAMS = gnome-background-properties
|
||||
|
||||
noinst_LTLIBRARIES = libgnomewp.la
|
||||
|
||||
gnome_background_properties_LDADD = \
|
||||
$(GNOMECC_CAPPLETS_LIBS) \
|
||||
libgnomewp.la
|
||||
|
||||
gnome_background_properties_SOURCES = \
|
||||
gnome-wp-capplet.c gnome-wp-capplet.h \
|
||||
gnome-wp-info.c gnome-wp-info.h
|
||||
|
||||
libgnomewp_la_SOURCES = \
|
||||
gnome-wp-item.c gnome-wp-item.h \
|
||||
gnome-wp-utils.c gnome-wp-utils.h \
|
||||
gnome-wp-xml.c gnome-wp-xml.h
|
||||
|
||||
libgnomewp_la_LIBADD = \
|
||||
$(GNOMECC_CAPPLETS_LIBS)
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
desktop_in_files = background.desktop.in
|
||||
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
gladedir = $(pkgdatadir)/glade
|
||||
glade_DATA = gnome-background-properties.glade
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(WALLPAPER_DATADIR)
|
||||
|
||||
EXTRA_DIST = \
|
||||
background.desktop.in.in \
|
||||
$(glade_DATA)
|
||||
|
||||
CLEANFILES = \
|
||||
$(desktop_in_files) $(desktop_DATA)
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
Makefile.in
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
_Name=Desktop Background
|
||||
_Comment=Change your Desktop Background settings
|
||||
Exec=gnome-background-properties %F
|
||||
Icon=preferences-desktop-wallpaper
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Settings;DesktopSettings;
|
||||
OnlyShowIn=GNOME;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=gnome-control-center
|
||||
X-GNOME-Bugzilla-Component=background
|
||||
X-GNOME-Bugzilla-Version=@VERSION@
|
|
@ -1,541 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<widget class="GtkDialog" id="gnome_wp_properties">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Desktop Background Preferences</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="default_width">360</property>
|
||||
<property name="default_height">418</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="icon_name">preferences-desktop-wallpaper</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="helpbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-11</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-apply</property>
|
||||
<property name="icon_size">4</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label10">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Finish</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="border_width">12</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Desktop _Wallpaper</b></property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">wp_tree</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="wp_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="wp_tree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="fixed_height_mode">False</property>
|
||||
<property name="hover_selection">False</property>
|
||||
<property name="hover_expand">False</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Style:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="style_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="items"></property>
|
||||
<property name="add_tearoffs">False</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="rem_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Remove</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="add_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Add Wallpaper</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>_Desktop Colors</b></property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">color_menu</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox5">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="color_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="items"></property>
|
||||
<property name="add_tearoffs">False</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkColorButton" id="pcpicker">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="use_alpha">False</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<accessibility>
|
||||
<atkproperty name="AtkObject::accessible_description" translatable="yes">Open a dialog to specify the color</atkproperty>
|
||||
</accessibility>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkColorButton" id="scpicker">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="use_alpha">False</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<accessibility>
|
||||
<atkproperty name="AtkObject::accessible_description" translatable="yes">Open a dialog to specify the color</atkproperty>
|
||||
</accessibility>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GNOME_WP_CAPPLET_H_
|
||||
#define _GNOME_WP_CAPPLET_H_
|
||||
|
||||
#include <config.h>
|
||||
#include <gnome.h>
|
||||
#include <glib.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-utils.h>
|
||||
#include <libgnomeui/gnome-thumbnail.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
typedef struct _GnomeWPCapplet GnomeWPCapplet;
|
||||
|
||||
#include "gnome-wp-info.h"
|
||||
#include "gnome-wp-item.h"
|
||||
#include "gnome-wp-utils.h"
|
||||
#include "gnome-wp-xml.h"
|
||||
|
||||
struct _GnomeWPCapplet {
|
||||
GtkWidget * window;
|
||||
|
||||
/* List of files passed to command line */
|
||||
GSList * uri_list;
|
||||
|
||||
/* The Tree View */
|
||||
GtkWidget * treeview;
|
||||
GtkTreeModel * model;
|
||||
|
||||
/* Option Menu for Scaling Options */
|
||||
GtkWidget * wp_opts;
|
||||
GtkWidget * rm_button;
|
||||
|
||||
/* Widgets for Color Options */
|
||||
GtkWidget * color_opt;
|
||||
GtkWidget * pc_picker;
|
||||
GtkWidget * sc_picker;
|
||||
|
||||
/* GConf Client */
|
||||
GConfClient * client;
|
||||
|
||||
/* Thumbnailing and Icon Theme stuff */
|
||||
GnomeThumbnailFactory * thumbs;
|
||||
|
||||
/* Hash Table of Wallpapers */
|
||||
GHashTable * wphash;
|
||||
|
||||
/* File Chooser Dialog */
|
||||
GtkWidget * filesel;
|
||||
GtkWidget * image;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
GNOME_WP_SHADE_TYPE_SOLID,
|
||||
GNOME_WP_SHADE_TYPE_HORIZ,
|
||||
GNOME_WP_SHADE_TYPE_VERT
|
||||
} GnomeWPShadeType;
|
||||
|
||||
typedef enum {
|
||||
GNOME_WP_SCALE_TYPE_CENTERED,
|
||||
GNOME_WP_SCALE_TYPE_STRETCHED,
|
||||
GNOME_WP_SCALE_TYPE_SCALED,
|
||||
GNOME_WP_SCALE_TYPE_ZOOM,
|
||||
GNOME_WP_SCALE_TYPE_TILED
|
||||
} GnomeWPScaleType;
|
||||
|
||||
void gnome_wp_main_quit (GnomeWPCapplet * capplet);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gnome.h>
|
||||
#include "gnome-wp-info.h"
|
||||
|
||||
GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
|
||||
GnomeThumbnailFactory * thumbs) {
|
||||
GnomeWPInfo * new;
|
||||
GnomeVFSFileInfo * info;
|
||||
GnomeVFSResult result;
|
||||
gchar * escaped_path;
|
||||
|
||||
info = gnome_vfs_file_info_new ();
|
||||
escaped_path = gnome_vfs_escape_path_string (uri);
|
||||
|
||||
result = gnome_vfs_get_file_info (escaped_path, info,
|
||||
GNOME_VFS_FILE_INFO_DEFAULT |
|
||||
GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
|
||||
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||
if (info == NULL || info->mime_type == NULL || result != GNOME_VFS_OK) {
|
||||
if (!strcmp (uri, "(none)")) {
|
||||
new = g_new0 (GnomeWPInfo, 1);
|
||||
|
||||
new->mime_type = g_strdup ("image/x-no-data");
|
||||
new->uri = g_strdup (uri);
|
||||
new->name = g_strdup (_("No Wallpaper"));
|
||||
new->size = 0;
|
||||
} else {
|
||||
new = NULL;
|
||||
}
|
||||
} else {
|
||||
new = g_new0 (GnomeWPInfo, 1);
|
||||
|
||||
new->uri = g_strdup (uri);
|
||||
|
||||
new->thumburi = gnome_thumbnail_factory_lookup (thumbs,
|
||||
escaped_path,
|
||||
info->mtime);
|
||||
new->name = g_strdup (info->name);
|
||||
new->mime_type = g_strdup (info->mime_type);
|
||||
|
||||
new->size = info->size;
|
||||
new->mtime = info->mtime;
|
||||
}
|
||||
g_free (escaped_path);
|
||||
gnome_vfs_file_info_unref (info);
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
GnomeWPInfo * gnome_wp_info_dup (const GnomeWPInfo * info) {
|
||||
GnomeWPInfo * new;
|
||||
|
||||
if (info == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new = g_new0 (GnomeWPInfo, 1);
|
||||
|
||||
new->uri = g_strdup (info->uri);
|
||||
new->thumburi = g_strdup (info->uri);
|
||||
|
||||
new->name = g_strdup (info->name);
|
||||
new->mime_type = g_strdup (info->mime_type);
|
||||
|
||||
new->size = info->size;
|
||||
new->mtime = info->mtime;
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
void gnome_wp_info_free (GnomeWPInfo * info) {
|
||||
if (info == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (info->uri);
|
||||
g_free (info->thumburi);
|
||||
g_free (info->name);
|
||||
g_free (info->mime_type);
|
||||
|
||||
info = NULL;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GNOME_WP_INFO_H_
|
||||
#define _GNOME_WP_INFO_H_
|
||||
|
||||
#include <glib.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libgnomeui/gnome-thumbnail.h>
|
||||
|
||||
typedef struct _GnomeWPInfo GnomeWPInfo;
|
||||
|
||||
struct _GnomeWPInfo {
|
||||
gchar * uri;
|
||||
gchar * thumburi;
|
||||
gchar * name;
|
||||
gchar * mime_type;
|
||||
|
||||
GnomeVFSFileSize size;
|
||||
|
||||
time_t mtime;
|
||||
};
|
||||
|
||||
GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
|
||||
GnomeThumbnailFactory * thumbs);
|
||||
GnomeWPInfo * gnome_wp_info_dup (const GnomeWPInfo * info);
|
||||
void gnome_wp_info_free (GnomeWPInfo * info);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,385 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <gnome.h>
|
||||
#include <string.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
||||
|
||||
#include "gnome-wp-item.h"
|
||||
#include "gnome-wp-utils.h"
|
||||
|
||||
GnomeWPItem * gnome_wp_item_new (const gchar * filename,
|
||||
GHashTable * wallpapers,
|
||||
GnomeThumbnailFactory * thumbnails) {
|
||||
GnomeWPItem * item = NULL;
|
||||
GdkColor color1, color2;
|
||||
GConfClient * client;
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
|
||||
item = g_new0 (GnomeWPItem, 1);
|
||||
|
||||
item->filename = gnome_vfs_unescape_string_for_display (filename);
|
||||
|
||||
item->fileinfo = gnome_wp_info_new (item->filename, thumbnails);
|
||||
|
||||
item->shade_type = gconf_client_get_string (client, WP_SHADING_KEY, NULL);
|
||||
item->pri_color = gconf_client_get_string (client, WP_PCOLOR_KEY, NULL);
|
||||
item->sec_color = gconf_client_get_string (client, WP_SCOLOR_KEY, NULL);
|
||||
|
||||
gdk_color_parse (item->pri_color, &color1);
|
||||
gdk_color_parse (item->sec_color, &color2);
|
||||
|
||||
item->pcolor = gdk_color_copy (&color1);
|
||||
item->scolor = gdk_color_copy (&color2);
|
||||
|
||||
if (item->fileinfo != NULL &&
|
||||
!strncmp (item->fileinfo->mime_type, "image/", strlen ("image/"))) {
|
||||
if (item->name == NULL) {
|
||||
if (g_utf8_validate (item->fileinfo->name, -1, NULL))
|
||||
item->name = g_strdup (item->fileinfo->name);
|
||||
else
|
||||
item->name = g_filename_to_utf8 (item->fileinfo->name, -1, NULL,
|
||||
NULL, NULL);
|
||||
}
|
||||
item->options = gconf_client_get_string (client, WP_OPTIONS_KEY, NULL);
|
||||
|
||||
if (!strcmp (item->options, "none")) {
|
||||
item->options = g_strdup ("scaled");
|
||||
}
|
||||
gnome_wp_item_update_description (item);
|
||||
|
||||
g_hash_table_insert (wallpapers, item->filename, item);
|
||||
} else {
|
||||
gnome_wp_item_free (item);
|
||||
item = NULL;
|
||||
}
|
||||
|
||||
g_object_unref (client);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void gnome_wp_item_free (GnomeWPItem * item) {
|
||||
if (item == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (item->name);
|
||||
g_free (item->filename);
|
||||
g_free (item->description);
|
||||
g_free (item->imguri);
|
||||
g_free (item->options);
|
||||
g_free (item->shade_type);
|
||||
|
||||
g_free (item->pri_color);
|
||||
g_free (item->sec_color);
|
||||
|
||||
if (item->pcolor != NULL)
|
||||
gdk_color_free (item->pcolor);
|
||||
|
||||
if (item->scolor != NULL)
|
||||
gdk_color_free (item->scolor);
|
||||
|
||||
gnome_wp_info_free (item->fileinfo);
|
||||
gnome_wp_info_free (item->uriinfo);
|
||||
|
||||
gtk_tree_row_reference_free (item->rowref);
|
||||
|
||||
item = NULL;
|
||||
}
|
||||
|
||||
GnomeWPItem * gnome_wp_item_dup (GnomeWPItem * item) {
|
||||
GnomeWPItem * new_item;
|
||||
GdkColor color1, color2;
|
||||
|
||||
if (item == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new_item = g_new0 (GnomeWPItem, 1);
|
||||
|
||||
new_item->name = g_strdup (item->name);
|
||||
new_item->filename = g_strdup (item->filename);
|
||||
new_item->description = g_strdup (item->description);
|
||||
new_item->imguri = g_strdup (item->imguri);
|
||||
new_item->options = g_strdup (item->options);
|
||||
new_item->shade_type = g_strdup (item->shade_type);
|
||||
|
||||
new_item->pri_color = g_strdup (item->pri_color);
|
||||
new_item->sec_color = g_strdup (item->sec_color);
|
||||
|
||||
gdk_color_parse (item->pri_color, &color1);
|
||||
gdk_color_parse (item->sec_color, &color2);
|
||||
|
||||
item->pcolor = gdk_color_copy (&color1);
|
||||
item->scolor = gdk_color_copy (&color2);
|
||||
|
||||
new_item->fileinfo = gnome_wp_info_dup (item->fileinfo);
|
||||
new_item->uriinfo = gnome_wp_info_dup (item->uriinfo);
|
||||
|
||||
new_item->rowref = gtk_tree_row_reference_copy (item->rowref);
|
||||
|
||||
new_item->deleted = item->deleted;
|
||||
new_item->width = item->width;
|
||||
new_item->height = item->height;
|
||||
|
||||
return new_item;
|
||||
}
|
||||
|
||||
static void collect_save_options (GdkPixbuf * pixbuf,
|
||||
gchar *** keys,
|
||||
gchar *** vals,
|
||||
gint width,
|
||||
gint height) {
|
||||
gchar ** options;
|
||||
gint n, count;
|
||||
|
||||
count = 0;
|
||||
|
||||
options = g_object_get_qdata (G_OBJECT (pixbuf),
|
||||
g_quark_from_static_string ("gdk_pixbuf_options"));
|
||||
if (options) {
|
||||
for (n = 0; options[2 * n]; n++) {
|
||||
++count;
|
||||
|
||||
*keys = g_realloc (*keys, sizeof (gchar *) * (count + 1));
|
||||
*vals = g_realloc (*vals, sizeof (gchar *) * (count + 1));
|
||||
|
||||
(*keys)[count - 1] = g_strdup (options[2 * n]);
|
||||
(*vals)[count - 1] = g_strdup (options[2 * n + 1]);
|
||||
|
||||
(*keys)[count] = NULL;
|
||||
(*vals)[count] = NULL;
|
||||
}
|
||||
}
|
||||
++count;
|
||||
|
||||
*keys = g_realloc (*keys, sizeof (gchar *) * (count + 1));
|
||||
*vals = g_realloc (*vals, sizeof (gchar *) * (count + 1));
|
||||
|
||||
(*keys)[count - 1] = g_strdup ("tEXt::Thumb::Image::Width");
|
||||
(*vals)[count - 1] = g_strdup_printf ("%d", width);
|
||||
|
||||
(*keys)[count] = NULL;
|
||||
(*vals)[count] = NULL;
|
||||
|
||||
++count;
|
||||
|
||||
*keys = g_realloc (*keys, sizeof (gchar *) * (count + 1));
|
||||
*vals = g_realloc (*vals, sizeof (gchar *) * (count + 1));
|
||||
|
||||
(*keys)[count - 1] = g_strdup ("tEXt::Thumb::Image::Height");
|
||||
(*vals)[count - 1] = g_strdup_printf ("%d", height);
|
||||
|
||||
(*keys)[count] = NULL;
|
||||
(*vals)[count] = NULL;
|
||||
}
|
||||
|
||||
#define LIST_IMAGE_WIDTH 64
|
||||
|
||||
GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
|
||||
GnomeThumbnailFactory * thumbs) {
|
||||
GdkPixbuf * pixbuf, * bgpixbuf;
|
||||
GdkPixbuf * scaled = NULL;
|
||||
gint sw, sh, bw, bh, pw, ph, tw, th;
|
||||
gdouble ratio;
|
||||
|
||||
sw = sh = bw = bh = pw = ph = tw = th = 0;
|
||||
|
||||
/*
|
||||
Get the size of the screen and calculate our aspect ratio divisor
|
||||
We do this, so that images are thumbnailed as they would look on
|
||||
the screen in reality
|
||||
*/
|
||||
sw = gdk_screen_get_width (gdk_screen_get_default ());
|
||||
sh = gdk_screen_get_height (gdk_screen_get_default ());
|
||||
ratio = (gdouble) sw / (gdouble) LIST_IMAGE_WIDTH;
|
||||
bw = sw / ratio;
|
||||
bh = sh / ratio;
|
||||
|
||||
/*
|
||||
Create the pixbuf for the background colors, which will show up for
|
||||
oddly sized images, smaller images that are centered, or alpha images
|
||||
*/
|
||||
if (!strcmp (item->shade_type, "solid")) {
|
||||
bgpixbuf = gnome_wp_pixbuf_new_solid (item->pcolor, bw, bh);
|
||||
} else if (!strcmp (item->shade_type, "vertical-gradient")) {
|
||||
bgpixbuf = gnome_wp_pixbuf_new_gradient (GTK_ORIENTATION_VERTICAL,
|
||||
item->pcolor, item->scolor,
|
||||
bw, bh);
|
||||
} else {
|
||||
bgpixbuf = gnome_wp_pixbuf_new_gradient (GTK_ORIENTATION_HORIZONTAL,
|
||||
item->pcolor, item->scolor,
|
||||
bw, bh);
|
||||
}
|
||||
|
||||
/*
|
||||
Load up the thumbnail image using the thumbnail spec
|
||||
If the image doesn't exist, we create it
|
||||
If we are creating the thumbnail for "No Wallpaper", then we just copy
|
||||
the background colors pixbuf we created above, here
|
||||
*/
|
||||
pixbuf = NULL;
|
||||
if (!strcmp (item->filename, "(none)")) {
|
||||
return bgpixbuf;
|
||||
} else {
|
||||
gchar * escaped_path, * thumbnail_filename;
|
||||
|
||||
escaped_path = gnome_vfs_escape_path_string (item->filename);
|
||||
thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs,
|
||||
escaped_path,
|
||||
item->fileinfo->mtime);
|
||||
|
||||
if (thumbnail_filename == NULL) {
|
||||
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbs,
|
||||
escaped_path,
|
||||
item->fileinfo->mime_type);
|
||||
gnome_thumbnail_factory_save_thumbnail (thumbs, pixbuf,
|
||||
escaped_path,
|
||||
item->fileinfo->mtime);
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = NULL;
|
||||
|
||||
thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs,
|
||||
escaped_path,
|
||||
item->fileinfo->mtime);
|
||||
}
|
||||
|
||||
if (thumbnail_filename != NULL) {
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (thumbnail_filename, NULL);
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
g_free (item->fileinfo->thumburi);
|
||||
item->fileinfo->thumburi = thumbnail_filename;
|
||||
thumbnail_filename = NULL;
|
||||
}
|
||||
|
||||
g_free (thumbnail_filename);
|
||||
}
|
||||
|
||||
g_free (escaped_path);
|
||||
}
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
const gchar * w_val, * h_val;
|
||||
|
||||
w_val = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width");
|
||||
h_val = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height");
|
||||
if (item->width <= 0 || item->height <= 0) {
|
||||
if (w_val && h_val) {
|
||||
item->width = atoi (w_val);
|
||||
item->height = atoi (h_val);
|
||||
} else {
|
||||
gchar ** keys = NULL;
|
||||
gchar ** vals = NULL;
|
||||
|
||||
gdk_pixbuf_get_file_info (item->filename,
|
||||
&item->width, &item->height);
|
||||
collect_save_options (pixbuf, &keys, &vals, item->width, item->height);
|
||||
gdk_pixbuf_savev (pixbuf, item->fileinfo->thumburi, "png",
|
||||
keys, vals, NULL);
|
||||
|
||||
g_strfreev (keys);
|
||||
g_strfreev (vals);
|
||||
}
|
||||
}
|
||||
|
||||
pw = gdk_pixbuf_get_width (pixbuf);
|
||||
ph = gdk_pixbuf_get_height (pixbuf);
|
||||
|
||||
if (item->width <= bw && item->height <= bh)
|
||||
ratio = 1.0;
|
||||
|
||||
tw = item->width / ratio;
|
||||
th = item->height / ratio;
|
||||
|
||||
if (!strcmp (item->options, "wallpaper")) {
|
||||
scaled = gnome_wp_pixbuf_tile (pixbuf, bgpixbuf, tw, th);
|
||||
} else if (!strcmp (item->options, "centered")) {
|
||||
scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th);
|
||||
} else if (!strcmp (item->options, "stretched")) {
|
||||
scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, bw, bh);
|
||||
} else if (!strcmp (item->options, "scaled")) {
|
||||
if ((gdouble) ph * (gdouble) bw > (gdouble) pw * (gdouble) bh) {
|
||||
tw = 0.5 + (gdouble) pw * (gdouble) bh / (gdouble) ph;
|
||||
th = bh;
|
||||
} else {
|
||||
th = 0.5 + (gdouble) ph * (gdouble) bw / (gdouble) pw;
|
||||
tw = bw;
|
||||
}
|
||||
scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th);
|
||||
} else if (!strcmp (item->options, "zoom")) {
|
||||
if ((gdouble) ph * (gdouble) bw < (gdouble) pw * (gdouble) bh) {
|
||||
tw = 0.5 + (gdouble) pw * (gdouble) bh / (gdouble) ph;
|
||||
th = bh;
|
||||
} else {
|
||||
th = 0.5 + (gdouble) ph * (gdouble) bw / (gdouble) pw;
|
||||
tw = bw;
|
||||
}
|
||||
scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th);
|
||||
}
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
g_object_unref (bgpixbuf);
|
||||
|
||||
return scaled;
|
||||
}
|
||||
|
||||
void gnome_wp_item_update_description (GnomeWPItem * item) {
|
||||
g_free (item->description);
|
||||
|
||||
if (!strcmp (item->filename, "(none)")) {
|
||||
item->description = g_strdup_printf ("<b>%s</b>", item->name);
|
||||
} else {
|
||||
gchar * info;
|
||||
|
||||
/*
|
||||
Translators: This message is used to render the type and size of the
|
||||
background images in gnome-background-properites. The first "%s" will
|
||||
be replaced by the image type, and the two "%d %s"s will be replaced
|
||||
with the images' dimensions. For example, in US English, this may be
|
||||
displayed as "JPEG Image, 1600 pixels x 1200 pixels".
|
||||
|
||||
Do not translate the "background size|" type. Remove it from the
|
||||
translation.
|
||||
*/
|
||||
info = g_strdup_printf (Q_("background size|%s, %d %s x %d %s"),
|
||||
gnome_vfs_mime_get_description (item->fileinfo->mime_type),
|
||||
item->width,
|
||||
ngettext ("pixel", "pixels", item->width),
|
||||
item->height,
|
||||
ngettext ("pixel", "pixels", item->height));
|
||||
|
||||
item->description = g_markup_printf_escaped ("<b>%s</b>\n"
|
||||
"%s",
|
||||
item->name,
|
||||
info);
|
||||
|
||||
g_free (info);
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtktreeview.h>
|
||||
#include <libgnomeui/gnome-thumbnail.h>
|
||||
#include <gnome-wp-info.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
|
||||
#ifndef _GNOME_WP_ITEM_H_
|
||||
#define _GNOME_WP_ITEM_H_
|
||||
|
||||
typedef struct _GnomeWPItem GnomeWPItem;
|
||||
|
||||
struct _GnomeWPItem {
|
||||
gchar * name;
|
||||
gchar * filename;
|
||||
gchar * description;
|
||||
gchar * imguri;
|
||||
gchar * options;
|
||||
gchar * shade_type;
|
||||
gchar * pri_color;
|
||||
gchar * sec_color;
|
||||
|
||||
/* Where the Item is in the List */
|
||||
GtkTreeRowReference * rowref;
|
||||
|
||||
/* Real colors */
|
||||
GdkColor * pcolor;
|
||||
GdkColor * scolor;
|
||||
|
||||
GnomeWPInfo * fileinfo;
|
||||
GnomeWPInfo * uriinfo;
|
||||
|
||||
/* Did the user remove us? */
|
||||
gboolean deleted;
|
||||
|
||||
/* Width and Height of the original image */
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
GnomeWPItem * gnome_wp_item_new (const gchar * filename,
|
||||
GHashTable * wallpapers,
|
||||
GnomeThumbnailFactory * thumbnails);
|
||||
void gnome_wp_item_free (GnomeWPItem * item);
|
||||
GnomeWPItem * gnome_wp_item_dup (GnomeWPItem * item);
|
||||
GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
|
||||
GnomeThumbnailFactory * thumbs);
|
||||
void gnome_wp_item_update_description (GnomeWPItem * item);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,198 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gnome-wp-utils.h"
|
||||
#include <string.h>
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation,
|
||||
GdkColor * c1,
|
||||
GdkColor * c2,
|
||||
gint width, gint height) {
|
||||
GdkPixbuf * pixbuf;
|
||||
gint i, j;
|
||||
gint dr, dg, db;
|
||||
gint gs1;
|
||||
gint vc = ((orientation == GTK_ORIENTATION_HORIZONTAL) || (c1 == c2));
|
||||
guchar * b, * row, * d;
|
||||
int rowstride;
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
d = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
||||
dr = c2->red - c1->red;
|
||||
dg = c2->green - c1->green;
|
||||
db = c2->blue - c1->blue;
|
||||
|
||||
gs1 = (orientation == GTK_ORIENTATION_VERTICAL) ? height - 1 : width - 1;
|
||||
|
||||
row = g_new (unsigned char, rowstride);
|
||||
|
||||
if (vc) {
|
||||
b = row;
|
||||
for (j = 0; j < width; j++) {
|
||||
*b++ = (c1->red + (j * dr) / gs1) >> 8;
|
||||
*b++ = (c1->green + (j * dg) / gs1) >> 8;
|
||||
*b++ = (c1->blue + (j * db) / gs1) >> 8;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
if (!vc) {
|
||||
unsigned char cr, cg, cb;
|
||||
cr = (c1->red + (i * dr) / gs1) >> 8;
|
||||
cg = (c1->green + (i * dg) / gs1) >> 8;
|
||||
cb = (c1->blue + (i * db) / gs1) >> 8;
|
||||
b = row;
|
||||
for (j = 0; j < width; j++) {
|
||||
*b++ = cr;
|
||||
*b++ = cg;
|
||||
*b++ = cb;
|
||||
}
|
||||
}
|
||||
memcpy (d, row, width * 3);
|
||||
d += rowstride;
|
||||
}
|
||||
g_free (row);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_new_solid (GdkColor * color,
|
||||
gint width, gint height) {
|
||||
GdkPixbuf * pixbuf;
|
||||
gint j, rowstride;
|
||||
guchar * b, * d, * row;
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
d = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
||||
row = g_new (unsigned char, rowstride);
|
||||
|
||||
b = row;
|
||||
for (j = 0; j < width; j++) {
|
||||
*b++ = color->red >> 8;
|
||||
*b++ = color->green >> 8;
|
||||
*b++ = color->blue >> 8;
|
||||
}
|
||||
|
||||
for (j = 0; j < height; j++) {
|
||||
memcpy (d, row, width * 3);
|
||||
d += rowstride;
|
||||
}
|
||||
|
||||
g_free (row);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
|
||||
GdkPixbuf * dest_pixbuf,
|
||||
gint scaled_width,
|
||||
gint scaled_height) {
|
||||
GdkPixbuf * tmpbuf;
|
||||
gdouble cx, cy;
|
||||
gint dwidth, dheight;
|
||||
gint swidth, sheight;
|
||||
guint alpha = 255;
|
||||
|
||||
if (dest_pixbuf == NULL) {
|
||||
return gdk_pixbuf_copy (src_pixbuf);
|
||||
}
|
||||
|
||||
tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height,
|
||||
GDK_INTERP_BILINEAR);
|
||||
|
||||
swidth = gdk_pixbuf_get_width (tmpbuf);
|
||||
sheight = gdk_pixbuf_get_height (tmpbuf);
|
||||
|
||||
dwidth = gdk_pixbuf_get_width (dest_pixbuf);
|
||||
dheight = gdk_pixbuf_get_height (dest_pixbuf);
|
||||
|
||||
for (cy = 0; cy < dheight; cy += sheight) {
|
||||
for (cx = 0; cx < dwidth; cx += swidth) {
|
||||
gdk_pixbuf_composite (tmpbuf, dest_pixbuf, cx, cy,
|
||||
MIN (swidth, dwidth - cx),
|
||||
MIN (sheight, dheight - cy),
|
||||
cx, cy, 1.0, 1.0,
|
||||
GDK_INTERP_BILINEAR, alpha);
|
||||
}
|
||||
}
|
||||
g_object_unref (tmpbuf);
|
||||
|
||||
return gdk_pixbuf_copy (dest_pixbuf);
|
||||
}
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf,
|
||||
GdkPixbuf * dest_pixbuf,
|
||||
gint scaled_width,
|
||||
gint scaled_height) {
|
||||
GdkPixbuf * tmpbuf;
|
||||
gint ox, oy, cx, cy;
|
||||
gint dwidth, dheight;
|
||||
gint swidth, sheight;
|
||||
gint cwidth, cheight;
|
||||
guint alpha = 255;
|
||||
|
||||
if (dest_pixbuf == NULL) {
|
||||
return gdk_pixbuf_copy (src_pixbuf);
|
||||
}
|
||||
|
||||
ox = cx = oy = cy = 0;
|
||||
|
||||
tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height,
|
||||
GDK_INTERP_BILINEAR);
|
||||
|
||||
swidth = gdk_pixbuf_get_width (tmpbuf);
|
||||
sheight = gdk_pixbuf_get_height (tmpbuf);
|
||||
|
||||
dwidth = gdk_pixbuf_get_width (dest_pixbuf);
|
||||
dheight = gdk_pixbuf_get_height (dest_pixbuf);
|
||||
|
||||
if (dwidth > swidth) {
|
||||
ox = (dwidth - swidth) / 2;
|
||||
cx = 0;
|
||||
cwidth = swidth;
|
||||
} else {
|
||||
cx = (swidth - dwidth) / 2;
|
||||
oy = 0;
|
||||
cwidth = dwidth;
|
||||
}
|
||||
|
||||
if (dheight > sheight) {
|
||||
oy = ((dheight - sheight) / 2);
|
||||
cy = 0;
|
||||
cheight = sheight;
|
||||
} else {
|
||||
cy = (sheight - dheight) / 2;
|
||||
oy = 0;
|
||||
cheight = dheight;
|
||||
}
|
||||
|
||||
gdk_pixbuf_composite (tmpbuf, dest_pixbuf, ox, oy,
|
||||
cwidth, cheight,
|
||||
ox - cx, oy - cy, 1.0, 1.0,
|
||||
GDK_INTERP_BILINEAR, alpha);
|
||||
|
||||
g_object_unref (tmpbuf);
|
||||
return gdk_pixbuf_copy (dest_pixbuf);
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GNOME_WP_UTILS_H_
|
||||
#define _GNOME_WP_UTILS_H_
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define WP_PATH_KEY "/desktop/gnome/background"
|
||||
#define WP_FILE_KEY WP_PATH_KEY "/picture_filename"
|
||||
#define WP_OPTIONS_KEY WP_PATH_KEY "/picture_options"
|
||||
#define WP_SHADING_KEY WP_PATH_KEY "/color_shading_type"
|
||||
#define WP_PCOLOR_KEY WP_PATH_KEY "/primary_color"
|
||||
#define WP_SCOLOR_KEY WP_PATH_KEY "/secondary_color"
|
||||
#define WP_KEYBOARD_PATH "/desktop/gnome/peripherals/keyboard"
|
||||
#define WP_DELAY_KEY WP_KEYBOARD_PATH "/delay"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation,
|
||||
GdkColor * c1,
|
||||
GdkColor * c2,
|
||||
gint width, gint height);
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_new_solid (GdkColor * color,
|
||||
gint width, gint height);
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
|
||||
GdkPixbuf * dest_pixbuf,
|
||||
gint scaled_width,
|
||||
gint scaled_height);
|
||||
|
||||
GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf,
|
||||
GdkPixbuf * dest_pixbuf,
|
||||
gint scaled_width,
|
||||
gint scaled_height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
|
@ -1,407 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gnome-wp-capplet.h"
|
||||
|
||||
static gboolean gnome_wp_xml_get_bool (const xmlNode * parent,
|
||||
const gchar * prop_name) {
|
||||
xmlChar * prop;
|
||||
gboolean ret_val = FALSE;
|
||||
|
||||
g_return_val_if_fail (parent != NULL, FALSE);
|
||||
g_return_val_if_fail (prop_name != NULL, FALSE);
|
||||
|
||||
prop = xmlGetProp ((xmlNode *) parent, (xmlChar*)prop_name);
|
||||
if (prop != NULL) {
|
||||
if (!g_strcasecmp ((gchar *)prop, "true") || !g_strcasecmp ((gchar *)prop, "1")) {
|
||||
ret_val = TRUE;
|
||||
} else {
|
||||
ret_val = FALSE;
|
||||
}
|
||||
g_free (prop);
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
static void gnome_wp_xml_set_bool (const xmlNode * parent,
|
||||
const xmlChar * prop_name, gboolean value) {
|
||||
g_return_if_fail (parent != NULL);
|
||||
g_return_if_fail (prop_name != NULL);
|
||||
|
||||
if (value) {
|
||||
xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"true");
|
||||
} else {
|
||||
xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"false");
|
||||
}
|
||||
}
|
||||
|
||||
static void gnome_wp_load_legacy (GnomeWPCapplet * capplet) {
|
||||
FILE * fp;
|
||||
gchar * foo, * filename;
|
||||
|
||||
filename = g_build_filename (g_get_home_dir (), ".gnome2",
|
||||
"wallpapers.list", NULL);
|
||||
|
||||
if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
|
||||
if ((fp = fopen (filename, "r")) != NULL) {
|
||||
foo = (gchar *) g_malloc (sizeof (gchar) * 4096);
|
||||
while (fgets (foo, 4096, fp)) {
|
||||
GnomeWPItem * item;
|
||||
|
||||
if (foo[strlen (foo) - 1] == '\n') {
|
||||
foo[strlen (foo) - 1] = '\0';
|
||||
}
|
||||
|
||||
item = g_hash_table_lookup (capplet->wphash, foo);
|
||||
if (item != NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!g_file_test (foo, G_FILE_TEST_EXISTS)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
item = gnome_wp_item_new (foo, capplet->wphash, capplet->thumbs);
|
||||
if (item != NULL && item->fileinfo == NULL) {
|
||||
gnome_wp_item_free (item);
|
||||
}
|
||||
}
|
||||
fclose (fp);
|
||||
g_free (foo);
|
||||
}
|
||||
}
|
||||
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
||||
const gchar * filename) {
|
||||
xmlDoc * wplist;
|
||||
xmlNode * root, * list, * wpa;
|
||||
xmlChar * nodelang;
|
||||
const gchar * const * syslangs;
|
||||
GdkColor color1, color2;
|
||||
GnomeWPItem * item;
|
||||
gint i;
|
||||
|
||||
#if GLIB_CHECK_VERSION (2, 6, 0)
|
||||
syslangs = g_get_language_names ();
|
||||
#endif
|
||||
|
||||
wplist = xmlParseFile (filename);
|
||||
|
||||
if (!wplist)
|
||||
return;
|
||||
|
||||
root = xmlDocGetRootElement (wplist);
|
||||
|
||||
for (list = root->children; list != NULL; list = list->next) {
|
||||
if (!strcmp ((gchar *)list->name, "wallpaper")) {
|
||||
GnomeWPItem * wp;
|
||||
|
||||
wp = g_new0 (GnomeWPItem, 1);
|
||||
|
||||
wp->deleted = gnome_wp_xml_get_bool (list, "deleted");
|
||||
|
||||
for (wpa = list->children; wpa != NULL; wpa = wpa->next) {
|
||||
if (!strcmp ((gchar *)wpa->name, "filename")) {
|
||||
if (wpa->last != NULL && wpa->last->content != NULL) {
|
||||
const char * none = "(none)";
|
||||
gchar *content = g_strstrip ((gchar *)wpa->last->content);
|
||||
|
||||
if (!strncmp (content, none, strlen (none)))
|
||||
wp->filename = g_strdup (content);
|
||||
else if (g_utf8_validate (content, -1, NULL) &&
|
||||
g_file_test (content, G_FILE_TEST_EXISTS))
|
||||
wp->filename = g_strdup (content);
|
||||
else
|
||||
wp->filename = g_filename_from_utf8 (content, -1, NULL, NULL, NULL);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "name")) {
|
||||
if (wpa->last != NULL && wpa->last->content != NULL) {
|
||||
nodelang = xmlNodeGetLang (wpa->last);
|
||||
|
||||
if (wp->name == NULL && nodelang == NULL) {
|
||||
wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
} else {
|
||||
for (i = 0; syslangs[i] != NULL; i++) {
|
||||
if (!strcmp (syslangs[i], (gchar *)nodelang)) {
|
||||
g_free (wp->name);
|
||||
wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xmlFree (nodelang);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "imguri")) {
|
||||
if (wpa->last != NULL) {
|
||||
wp->imguri = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "options")) {
|
||||
if (wpa->last != NULL) {
|
||||
wp->options = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
} else {
|
||||
wp->options = gconf_client_get_string (capplet->client,
|
||||
WP_OPTIONS_KEY, NULL);
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "shade_type")) {
|
||||
if (wpa->last != NULL) {
|
||||
wp->shade_type = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "pcolor")) {
|
||||
if (wpa->last != NULL) {
|
||||
wp->pri_color = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "scolor")) {
|
||||
if (wpa->last != NULL) {
|
||||
wp->sec_color = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
||||
}
|
||||
} else if (!strcmp ((gchar *)wpa->name, "text")) {
|
||||
/* Do nothing here, libxml2 is being weird */
|
||||
} else {
|
||||
g_warning ("Unknown Tag: %s\n", wpa->name);
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we don't already have this one and that filename exists */
|
||||
if (wp->filename != NULL) {
|
||||
item = g_hash_table_lookup (capplet->wphash, wp->filename);
|
||||
|
||||
if (item != NULL) {
|
||||
gnome_wp_item_free (wp);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
gnome_wp_item_free (wp);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Verify the colors and alloc some GdkColors here */
|
||||
if (wp->shade_type == NULL) {
|
||||
wp->shade_type = gconf_client_get_string (capplet->client,
|
||||
WP_SHADING_KEY, NULL);
|
||||
}
|
||||
if (wp->pri_color == NULL) {
|
||||
wp->pri_color = gconf_client_get_string (capplet->client,
|
||||
WP_PCOLOR_KEY, NULL);
|
||||
}
|
||||
if (wp->sec_color == NULL) {
|
||||
wp->sec_color = gconf_client_get_string (capplet->client,
|
||||
WP_SCOLOR_KEY, NULL);
|
||||
}
|
||||
gdk_color_parse (wp->pri_color, &color1);
|
||||
gdk_color_parse (wp->sec_color, &color2);
|
||||
|
||||
wp->pcolor = gdk_color_copy (&color1);
|
||||
wp->scolor = gdk_color_copy (&color2);
|
||||
|
||||
if ((wp->filename != NULL &&
|
||||
g_file_test (wp->filename, G_FILE_TEST_EXISTS)) ||
|
||||
!strcmp (wp->filename, "(none)")) {
|
||||
wp->fileinfo = gnome_wp_info_new (wp->filename, capplet->thumbs);
|
||||
|
||||
if (wp->name == NULL || !strcmp (wp->filename, "(none)")) {
|
||||
wp->name = g_strdup (wp->fileinfo->name);
|
||||
}
|
||||
|
||||
gnome_wp_item_update_description (wp);
|
||||
g_hash_table_insert (capplet->wphash, wp->filename, wp);
|
||||
} else {
|
||||
gnome_wp_item_free (wp);
|
||||
}
|
||||
}
|
||||
}
|
||||
xmlFreeDoc (wplist);
|
||||
}
|
||||
|
||||
static void gnome_wp_file_changed (GnomeVFSMonitorHandle * handle,
|
||||
const gchar * monitor_uri,
|
||||
const gchar * info_uri,
|
||||
GnomeVFSMonitorEventType event_type,
|
||||
GnomeWPCapplet * capplet) {
|
||||
gchar * filename;
|
||||
|
||||
switch (event_type) {
|
||||
case GNOME_VFS_MONITOR_EVENT_CHANGED:
|
||||
case GNOME_VFS_MONITOR_EVENT_CREATED:
|
||||
filename = gnome_vfs_get_local_path_from_uri (info_uri);
|
||||
gnome_wp_xml_load_xml (capplet, filename);
|
||||
g_free (filename);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void gnome_wp_xml_load_list (GnomeWPCapplet * capplet) {
|
||||
GnomeVFSMonitorHandle * handle;
|
||||
GList * list, * l;
|
||||
gchar * wpdbfile, * xdgdirslist;
|
||||
gchar ** xdgdirs;
|
||||
gint i;
|
||||
|
||||
wpdbfile = g_build_filename (g_get_home_dir (),
|
||||
".gnome2",
|
||||
"backgrounds.xml",
|
||||
NULL);
|
||||
|
||||
if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) {
|
||||
gnome_wp_xml_load_xml (capplet, wpdbfile);
|
||||
} else {
|
||||
g_free (wpdbfile);
|
||||
wpdbfile = g_build_filename (g_get_home_dir (),
|
||||
".gnome2",
|
||||
"wp-list.xml",
|
||||
NULL);
|
||||
if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) {
|
||||
gnome_wp_xml_load_xml (capplet, wpdbfile);
|
||||
}
|
||||
}
|
||||
g_free (wpdbfile);
|
||||
|
||||
xdgdirslist = g_strdup (g_getenv ("XDG_DATA_DIRS"));
|
||||
if (xdgdirslist == NULL || strlen (xdgdirslist) == 0)
|
||||
xdgdirslist = g_strdup ("/usr/local/share:/usr/share");
|
||||
|
||||
xdgdirs = g_strsplit (xdgdirslist, ":", -1);
|
||||
for (i = 0; xdgdirs && xdgdirs[i]; i++) {
|
||||
gchar * datadir;
|
||||
|
||||
datadir = g_build_filename (xdgdirs[i], "gnome-background-properties",
|
||||
NULL);
|
||||
if (g_file_test (datadir, G_FILE_TEST_IS_DIR)) {
|
||||
gnome_vfs_directory_list_load (&list, datadir,
|
||||
GNOME_VFS_FILE_INFO_DEFAULT |
|
||||
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||
|
||||
for (l = list; l != NULL; l = l->next) {
|
||||
GnomeVFSFileInfo * info = l->data;
|
||||
|
||||
if (strcmp (".", info->name) != 0 && strcmp ("..", info->name) != 0) {
|
||||
gchar * filename;
|
||||
|
||||
filename = g_build_filename (datadir, info->name, NULL);
|
||||
gnome_wp_xml_load_xml (capplet, filename);
|
||||
g_free (filename);
|
||||
}
|
||||
}
|
||||
gnome_vfs_file_info_list_free (list);
|
||||
|
||||
gnome_vfs_monitor_add (&handle, datadir, GNOME_VFS_MONITOR_DIRECTORY,
|
||||
(GnomeVFSMonitorCallback) gnome_wp_file_changed,
|
||||
capplet);
|
||||
}
|
||||
g_free (datadir);
|
||||
}
|
||||
g_strfreev (xdgdirs);
|
||||
g_free (xdgdirslist);
|
||||
|
||||
if (g_file_test (WALLPAPER_DATADIR, G_FILE_TEST_IS_DIR)) {
|
||||
gnome_vfs_directory_list_load (&list, WALLPAPER_DATADIR,
|
||||
GNOME_VFS_FILE_INFO_DEFAULT |
|
||||
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||
|
||||
for (l = list; l != NULL; l = l->next) {
|
||||
GnomeVFSFileInfo * info = l->data;
|
||||
|
||||
if (strcmp (".", info->name) != 0 && strcmp ("..", info->name) != 0) {
|
||||
gchar * filename;
|
||||
|
||||
filename = g_build_filename (WALLPAPER_DATADIR, info->name, NULL);
|
||||
gnome_wp_xml_load_xml (capplet, filename);
|
||||
g_free (filename);
|
||||
}
|
||||
}
|
||||
gnome_vfs_file_info_list_free (list);
|
||||
|
||||
gnome_vfs_monitor_add (&handle, WALLPAPER_DATADIR, GNOME_VFS_MONITOR_DIRECTORY,
|
||||
(GnomeVFSMonitorCallback) gnome_wp_file_changed,
|
||||
capplet);
|
||||
}
|
||||
|
||||
gnome_wp_load_legacy (capplet);
|
||||
}
|
||||
|
||||
static void gnome_wp_list_flatten (const gchar * key, GnomeWPItem * item,
|
||||
GSList ** list) {
|
||||
g_return_if_fail (key != NULL);
|
||||
g_return_if_fail (item != NULL);
|
||||
|
||||
*list = g_slist_prepend (*list, item);
|
||||
}
|
||||
|
||||
void gnome_wp_xml_save_list (GnomeWPCapplet * capplet) {
|
||||
xmlDoc * wplist;
|
||||
xmlNode * root, * wallpaper, * item;
|
||||
GSList * list = NULL;
|
||||
gchar * wpfile;
|
||||
|
||||
g_hash_table_foreach_remove (capplet->wphash,
|
||||
(GHRFunc) gnome_wp_list_flatten, &list);
|
||||
g_hash_table_destroy (capplet->wphash);
|
||||
list = g_slist_reverse (list);
|
||||
|
||||
wpfile = g_build_filename (g_get_home_dir (),
|
||||
"/.gnome2",
|
||||
"backgrounds.xml",
|
||||
NULL);
|
||||
|
||||
xmlKeepBlanksDefault (0);
|
||||
|
||||
wplist = xmlNewDoc ((xmlChar *)"1.0");
|
||||
xmlCreateIntSubset (wplist, (xmlChar *)"wallpapers", NULL, (xmlChar *)"gnome-wp-list.dtd");
|
||||
root = xmlNewNode (NULL, (xmlChar *)"wallpapers");
|
||||
xmlDocSetRootElement (wplist, root);
|
||||
|
||||
while (list != NULL) {
|
||||
GnomeWPItem * wpitem = list->data;
|
||||
const char * none = "(none)";
|
||||
gchar * filename;
|
||||
|
||||
if (!strncmp (wpitem->filename, none, strlen (none)) ||
|
||||
(g_utf8_validate (wpitem->filename, -1, NULL) &&
|
||||
g_file_test (wpitem->filename, G_FILE_TEST_EXISTS)))
|
||||
filename = g_strdup (wpitem->filename);
|
||||
else
|
||||
filename = g_filename_to_utf8 (wpitem->filename, -1, NULL, NULL, NULL);
|
||||
|
||||
wallpaper = xmlNewChild (root, NULL, (xmlChar *)"wallpaper", NULL);
|
||||
gnome_wp_xml_set_bool (wallpaper, (xmlChar *)"deleted", wpitem->deleted);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"name", (xmlChar *)wpitem->name);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"filename", (xmlChar *)filename);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"options", (xmlChar *)wpitem->options);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"shade_type", (xmlChar *)wpitem->shade_type);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"pcolor", (xmlChar *)wpitem->pri_color);
|
||||
item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"scolor", (xmlChar *)wpitem->sec_color);
|
||||
g_free (filename);
|
||||
|
||||
list = g_slist_remove (list, wpitem);
|
||||
gnome_wp_item_free (wpitem);
|
||||
}
|
||||
xmlSaveFormatFile (wpfile, wplist, 1);
|
||||
xmlFreeDoc (wplist);
|
||||
g_free (wpfile);
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Authors: Rodney Dawes <dobey@ximian.com>
|
||||
*
|
||||
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GNOME_WP_XML_H_
|
||||
#define _GNOME_WP_XML_H_
|
||||
|
||||
void gnome_wp_xml_load_list (GnomeWPCapplet * capplet);
|
||||
void gnome_wp_xml_save_list (GnomeWPCapplet * capplet);
|
||||
|
||||
#endif
|
||||
|
|
@ -1991,6 +1991,17 @@ gnome_theme_init (gboolean *monitor_not_added)
|
|||
top_theme_dir_string = g_build_filename (INSTALL_PREFIX, "share", "icons", NULL);
|
||||
}
|
||||
top_theme_dir_uri = gnome_vfs_uri_new (top_theme_dir_string);
|
||||
|
||||
#ifdef XCURSOR_ICONDIR
|
||||
/* if there's a separate xcursors dir, add that as well */
|
||||
if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) &&
|
||||
strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) {
|
||||
top_theme_dir_uri = gnome_vfs_uri_new (XCURSOR_ICONDIR);
|
||||
if (gnome_vfs_uri_exists (top_theme_dir_uri))
|
||||
result = add_top_icon_theme_dir_monitor (top_theme_dir_uri, &real_monitor_not_added, 1, NULL);
|
||||
gnome_vfs_uri_unref (top_theme_dir_uri);
|
||||
}
|
||||
#endif
|
||||
g_free (top_theme_dir_string);
|
||||
|
||||
if (!gnome_vfs_uri_exists (top_theme_dir_uri))
|
||||
|
|
|
@ -1,344 +0,0 @@
|
|||
2007-04-27 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
|
||||
* font-properties.desktop.in.in: renamed Bugzilla product.
|
||||
|
||||
2007-04-08 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
Patch by: Kristof Vansant <de_lupus@pandora.be>
|
||||
|
||||
* font-properties.glade: don't require gnome glade lib
|
||||
|
||||
2007-01-07 Thomas Wood <thos@gnome.org>
|
||||
|
||||
Based on patch by: Gabor Kelemen <kelemeng@gnome.hu>
|
||||
|
||||
* main.c: (application_font_to_gconf): Fixes bug 335963 ("Font may be
|
||||
too large" dialog unclear).
|
||||
|
||||
2006-06-06 Sergey Udaltsov <svu@gnome.org>
|
||||
|
||||
* Makefile.am: added $(GNOMECC_CAPPLETS_LIBS)
|
||||
|
||||
2006-02-17 Rodrigo Moya <rodrigo@novell.com>
|
||||
|
||||
Fixes #327021
|
||||
|
||||
* main.c (setup_dialog): don't unref the GladeXML structure, it's
|
||||
needed in the callbacks.
|
||||
|
||||
2005-11-14 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* main.c: (setup_font_sample): Fix compiler warnings.
|
||||
|
||||
2005-05-22 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* font-properties.glade:
|
||||
* main.c: (application_font_to_gconf), (application_font_changed),
|
||||
(setup_dialog), (cb_show_details), (main):
|
||||
port of the font capplet to gtk_font_button and some cleanup,
|
||||
patch from paolo borelli <pborelli@katamail.com> (Closes: #160016).
|
||||
|
||||
2005-01-02 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* font-properties.glade:
|
||||
patch from Heikki Paajanen <hepaajan@iki.fi> (based on the patch
|
||||
from Andrew Johnson <acjgenius@earthlink.net>)
|
||||
to not set "close" as the default button (Closes: #98202).
|
||||
|
||||
2004-11-09 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* Makefile.am: install .desktop file in $(datadir)/applications.
|
||||
|
||||
* font-properties.desktop.in: add OnlyShowIn=GNOME;
|
||||
|
||||
2004-10-14 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.8.1
|
||||
|
||||
2004-08-20 Frederic Crozat <fcrozat@mandrakesoft.com>
|
||||
|
||||
* main.c: (setup_dialog):
|
||||
Use themed iconf for WM hint.
|
||||
|
||||
2004-05-17 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=142190
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=142191
|
||||
* font-properties.glade : fix conflicting mnemonics
|
||||
|
||||
2004-04-15 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.1
|
||||
|
||||
2004-04-01 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0.3
|
||||
|
||||
2004-03-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0.1
|
||||
|
||||
2004-03-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0
|
||||
|
||||
2004-03-11 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.4
|
||||
|
||||
2004-02-16 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=134446
|
||||
* font-properties.glade : removed space
|
||||
|
||||
2004-02-13 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.3
|
||||
|
||||
2004-02-12 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* main.c: (cb_dialog_response), (cb_details_response): Update help
|
||||
link to point to user-guide.xml
|
||||
|
||||
2004-01-14 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.2
|
||||
|
||||
2003-12-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.1.1
|
||||
|
||||
2003-12-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.1
|
||||
|
||||
2003-11-06 Padraig O'Briain <padraig.obriain@sun.com>
|
||||
|
||||
* font-properties.glade: Correct mnemonic widget for Window title font.
|
||||
Move declaration of GnomeFontPicker for applications to immediately
|
||||
after declaration of the label. This fixes bug #125689.
|
||||
|
||||
2003-10-28 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.0
|
||||
|
||||
2003-10-28 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=116710
|
||||
* main.c (cb_show_details) : be smarter about selecting a maximum
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=115435
|
||||
* font-properties.glade : some of the UI review changes.
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=124513
|
||||
* main.c (setup_font_sample) : merge in patch to allocate black and
|
||||
white correctly on TruColor displays.
|
||||
|
||||
2003-10-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=106489
|
||||
* main.c (dpi_load) : add some protection again invalid dpi in the
|
||||
case of gconf failure.
|
||||
|
||||
2003-08-01 Dennis Cranston <dennis_cranston at yahoo com>
|
||||
|
||||
* font-properties.glade: Patch to fix spacing between action
|
||||
area and vbox of preferences dialog.
|
||||
|
||||
Sat Aug 2 01:16:16 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* main.c (application_font_to_gconf): Warn when a font larger than
|
||||
31 points is selected, #97653.
|
||||
|
||||
2003-07-17 Dennis Cranston <dennis_cranston at yahoo com>
|
||||
|
||||
* font-properties.glade: Some HIGification of the dialog.
|
||||
Fixes some of ui-review bug #98922.
|
||||
|
||||
2003-07-07 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.4
|
||||
|
||||
2003-06-24 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.3
|
||||
|
||||
2003-05-07 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.1
|
||||
|
||||
Wed Jan 15 12:50:34 2003 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* main.c (cb_details_response): run "nautilus --no-desktop
|
||||
fonts:///" if button pressed.
|
||||
|
||||
(cb_show_details): show a 'Go to font folder' button if fonts:///
|
||||
exists.
|
||||
|
||||
Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* Release 2.2.0.1
|
||||
|
||||
Tue Jan 21 01:15:14 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* Release 2.2.0
|
||||
|
||||
Thu Jan 16 02:41:09 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* Release 2.1.7
|
||||
|
||||
2003-01-10 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.6
|
||||
|
||||
2002-12-18 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.5
|
||||
|
||||
2002-11-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.3
|
||||
|
||||
2002-11-13 Pasupathi Duraisamy <pasupathi.duraisamy@wipro.com>
|
||||
|
||||
* main.c: Added the "desktop_font" key directory to the list
|
||||
of directories GConfClient will watch for changes.
|
||||
Fixes Bug #94766.
|
||||
|
||||
2002-11-02 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.2
|
||||
|
||||
Fri Nov 1 18:21:22 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* main.c: remove the duplicate #defined key.
|
||||
|
||||
2002-10-21 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.1
|
||||
|
||||
2002-10-16 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=95807
|
||||
From sylvain_pasche@yahoo.fr
|
||||
* main.c (open_pattern) : Add a safety check.
|
||||
|
||||
2002-10-01 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.0.1
|
||||
|
||||
2002-08-21 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.0
|
||||
|
||||
2002-08-19 Ross Burton <ross@burtonini.com>
|
||||
|
||||
* font-properties.desktop.in: Fix the desktop file so that it
|
||||
validates.
|
||||
|
||||
2002-08-19 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* font-properties.glade :
|
||||
* main.c: (setup_dialog): merge in owen's patch to configure the
|
||||
window title font and the font to use for terminals. This patch
|
||||
uses a metacity specific key for the window title. Owen ? Seth ?
|
||||
Can you folk choose please.
|
||||
|
||||
2002-06-24 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* font-properties.glade:
|
||||
* main.c: (setup_dialog):
|
||||
|
||||
Add a font picker for controlling the window title font (and size).
|
||||
Set border widths nicely so things align.
|
||||
|
||||
2002-07-24 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): dist the pixel icons
|
||||
|
||||
2002-07-02 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=85629
|
||||
* font-properties.glade : Make wider to avoid clipping.
|
||||
|
||||
2002-06-27 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=86593
|
||||
* main.c (setup_dialog) : watch for missing icons
|
||||
|
||||
2002-06-17 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.0.0
|
||||
|
||||
2002-05-28 Satyajit Kanungo <satyajit.kanungo@wipro.com>
|
||||
|
||||
* main.c : Changed the help file link
|
||||
to get the help document from user-guide.
|
||||
|
||||
2002-05-26 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* main.c (cb_dialog_response) : improve handling of help failures.
|
||||
|
||||
Sun May 26 11:38:48 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* main.c (main): use APPID instead of argv[0]
|
||||
|
||||
Fri May 10 19:00:25 2002 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* main.c (DESKTOP_FONT_NAME_KEY): get it to use the right key.
|
||||
|
||||
2002-05-08 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* main.c (cb_dialog_response) : new.
|
||||
(setup_dialog) : support help.
|
||||
|
||||
2002-04-27 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* font-properties.desktop.in:
|
||||
|
||||
Tweak categories and comment a little.
|
||||
|
||||
* font-properties.glade:
|
||||
|
||||
Change labels to be a little more descriptive,
|
||||
force dialogue to be a little larger.
|
||||
|
||||
2002-04-26 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* Makefile.am:
|
||||
* font-properties.glade:
|
||||
* main.c: (create_dialog), (setup_dialog), (main):
|
||||
|
||||
Bring back in sync with the merged theme/font dialog.
|
||||
|
||||
Wed Apr 10 18:03:00 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* font-properties.desktop.in (Exec): s/gnome2/gnome
|
||||
|
||||
2002-03-27 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* main.c (response_cb): No responses here
|
||||
(font_capplet_custom_toggled): New signal handler
|
||||
(font_capplet_font_set): Ditto
|
||||
(font_capplet_value_notify): Ditto
|
||||
(setup_dialog): Removed peditor stuff, as I do not know, how to
|
||||
mix it with NULL == unset, string == set
|
||||
(main): Get GConfClient and activate directory
|
||||
|
||||
* font-properties.glade: Reverted to original version,
|
||||
added label telling about applying
|
||||
|
||||
2002-03-17 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* font-properties.glade:
|
||||
* main.c: (setup_dialog):
|
||||
|
||||
2002-02-27 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* main.c: s/PACKAGE/GETTEXT_PACKAGE/g
|
||||
|
||||
2002-02-18 Gediminas Paulauskas <menesis@delfi.lt>
|
||||
|
||||
* ChangeLog: added
|
||||
* main.c: correct i18n
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# This is used in GNOMECC_CAPPLETS_CFLAGS
|
||||
cappletname = font
|
||||
|
||||
bin_PROGRAMS = gnome-font-properties
|
||||
|
||||
gnome_font_properties_LDADD = \
|
||||
$(top_builddir)/capplets/common/libcommon.la \
|
||||
$(FONT_CAPPLET_LIBS) \
|
||||
$(GNOMECC_CAPPLETS_LIBS)
|
||||
|
||||
gnome_font_properties_SOURCES = \
|
||||
main.c
|
||||
gnome_font_properties_LDFLAGS = -export-dynamic
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
pixmapdir = $(pkgdatadir)/pixmaps
|
||||
pixmap_DATA = \
|
||||
subpixel-rgb.png \
|
||||
subpixel-bgr.png \
|
||||
subpixel-vrgb.png \
|
||||
subpixel-vbgr.png
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
Desktop_in_files = font-properties.desktop.in
|
||||
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
gladedir = $(pkgdatadir)/glade
|
||||
glade_DATA = font-properties.glade
|
||||
|
||||
INCLUDES = $(FONT_CAPPLET_CFLAGS) \
|
||||
$(GNOMECC_CAPPLETS_CFLAGS) \
|
||||
-DGLADEDIR=\""$(gladedir)"\" \
|
||||
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DPIXMAPDIR=\""$(pixmapdir)"\" \
|
||||
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\""
|
||||
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
|
||||
EXTRA_DIST = $(glade_DATA) $(pixmap_DATA)
|
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
_Name=Font
|
||||
_Comment=Select fonts for the desktop
|
||||
Exec=gnome-font-properties
|
||||
Icon=gnome-settings-font
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Settings;DesktopSettings;
|
||||
OnlyShowIn=GNOME;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=gnome-control-center
|
||||
X-GNOME-Bugzilla-Component=font properties
|
||||
X-GNOME-Bugzilla-Version=@VERSION@
|
1020
capplets/font/main.c
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 138 B |
|
@ -1,66 +0,0 @@
|
|||
# This is used in GNOMECC_CAPPLETS_CFLAGS
|
||||
cappletname = theme
|
||||
|
||||
bin_PROGRAMS = gnome-theme-manager
|
||||
|
||||
pixmapdir = $(pkgdatadir)/pixmaps
|
||||
pixmap_DATA = \
|
||||
theme-thumbnailing.png
|
||||
|
||||
gnome_theme_manager_LDADD = \
|
||||
$(GNOMECC_CAPPLETS_LIBS) \
|
||||
$(METACITY_LIBS) \
|
||||
$(top_builddir)/libwindow-settings/libgnome-window-settings.la \
|
||||
$(top_builddir)/capplets/common/libcommon.la
|
||||
|
||||
gnome_theme_manager_SOURCES = \
|
||||
gnome-theme-save.c \
|
||||
gnome-theme-save.h \
|
||||
gnome-theme-manager.c \
|
||||
gnome-theme-manager.h \
|
||||
gnome-theme-details.c \
|
||||
gnome-theme-details.h \
|
||||
gnome-theme-installer.c \
|
||||
gnome-theme-installer.h
|
||||
|
||||
gnome_theme_manager_LDFLAGS = -export-dynamic
|
||||
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
xml_in_files = gnome-theme-package.xml.in
|
||||
xml_files = $(xml_in_files:.xml.in=.xml)
|
||||
|
||||
@INTLTOOL_XML_RULE@
|
||||
|
||||
mimedir = $(datadir)/mime/packages
|
||||
mime_DATA = $(xml_files)
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
Desktop_in_files = gtk-theme-selector.desktop.in \
|
||||
gnome-theme-installer.desktop.in
|
||||
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
gladedir = $(pkgdatadir)/glade
|
||||
glade_DATA = theme-properties.glade
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(METACITY_CFLAGS) \
|
||||
$(GNOMECC_CAPPLETS_CFLAGS) \
|
||||
-DGLADEDIR=\""$(gladedir)"\" \
|
||||
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\""
|
||||
|
||||
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) $(xml_files)
|
||||
EXTRA_DIST = $(glade_DATA) gnome-theme-save-data.c $(pixmap_DATA) $(xml_in_files)
|
||||
|
||||
install-data-hook:
|
||||
if ENABLE_UPDATE_MIMEDB
|
||||
$(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime"
|
||||
endif
|
||||
|
||||
uninstall-hook:
|
||||
if ENABLE_UPDATE_MIMEDB
|
||||
$(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime"
|
||||
endif
|
|
@ -1,17 +0,0 @@
|
|||
Left TODO:
|
||||
|
||||
* Change custom theme text to indicate what themes are being used.
|
||||
- requires breaking string freeze
|
||||
|
||||
* Sanity check saving. In particular, \n needs escaping.
|
||||
|
||||
* Fix the collation of the Details dialog. Seems to be going on theme
|
||||
name, not readable name.
|
||||
|
||||
* When saving a theme that started as an initial custom theme, kill
|
||||
that from the list.
|
||||
|
||||
* Have the 'set Background' button do something.
|
||||
|
||||
* make sure that installing themes go to the right place.
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
|
@ -1,9 +0,0 @@
|
|||
#ifndef __GNOME_THEME_DETAILS_H__
|
||||
#define __GNOME_THEME_DETAILS_H__
|
||||
|
||||
void gnome_theme_details_init (void);
|
||||
void gnome_theme_details_show (void);
|
||||
void gnome_theme_details_reread_themes_from_disk (void);
|
||||
void gnome_theme_details_update_from_gconf (void);
|
||||
|
||||
#endif /* __GNOME_THEME_DETAILS_H__ */
|
|
@ -1,712 +0,0 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <libwindow-settings/gnome-wm-manager.h>
|
||||
#include "gnome-theme-installer.h"
|
||||
#include "gnome-theme-details.h"
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <glade/glade.h>
|
||||
#include <libgnomevfs/gnome-vfs-async-ops.h>
|
||||
#include <libgnomevfs/gnome-vfs-ops.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnome-theme-info.h"
|
||||
#include "capplet-util.h"
|
||||
#include "activate-settings-daemon.h"
|
||||
#include "gconf-property-editor.h"
|
||||
#include "file-transfer-dialog.h"
|
||||
#include "gnome-theme-installer.h"
|
||||
#include "gnome-theme-manager.h"
|
||||
|
||||
enum {
|
||||
THEME_INVALID,
|
||||
THEME_ICON,
|
||||
THEME_GNOME,
|
||||
THEME_GTK,
|
||||
THEME_ENGINE,
|
||||
THEME_METACITY
|
||||
};
|
||||
|
||||
enum {
|
||||
TARGZ,
|
||||
TARBZ,
|
||||
DIRECTORY
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
gint theme_type;
|
||||
gint filetype;
|
||||
gchar *theme_name;
|
||||
gchar *filename;
|
||||
gchar *target_dir;
|
||||
gchar *theme_tmp_dir;
|
||||
gchar *target_tmp_dir;
|
||||
gchar *user_message;
|
||||
} theme_properties;
|
||||
|
||||
|
||||
static void
|
||||
theme_properties_free (theme_properties *tp)
|
||||
{
|
||||
g_free (tp->filename);
|
||||
g_free (tp->target_dir);
|
||||
g_free (tp->theme_tmp_dir);
|
||||
g_free (tp->target_tmp_dir);
|
||||
g_free (tp->user_message);
|
||||
g_free (tp->theme_name);
|
||||
g_free (tp);
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_tmp_dir(theme_properties *theme_props)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
if (gnome_vfs_remove_directory (theme_props->target_tmp_dir) == GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY) {
|
||||
list = g_list_prepend (NULL, gnome_vfs_uri_new (theme_props->target_tmp_dir));
|
||||
gnome_vfs_xfer_delete_list (list, GNOME_VFS_XFER_RECURSIVE,
|
||||
GNOME_VFS_XFER_ERROR_MODE_ABORT, NULL, NULL);
|
||||
gnome_vfs_uri_list_free(list);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
file_theme_type(gchar *dir)
|
||||
{
|
||||
gchar *file_contents = NULL;
|
||||
gchar *filename = NULL;
|
||||
gint file_size;
|
||||
GPatternSpec *pattern = NULL;
|
||||
char *uri = NULL;
|
||||
GnomeVFSURI *src_uri = NULL;
|
||||
|
||||
if (!dir) return THEME_INVALID;
|
||||
|
||||
filename = g_strdup_printf ("%s/index.theme",dir);
|
||||
src_uri = gnome_vfs_uri_new (filename);
|
||||
if (gnome_vfs_uri_exists(src_uri)) {
|
||||
uri = gnome_vfs_get_uri_from_local_path (filename);
|
||||
gnome_vfs_read_entire_file (uri,&file_size,&file_contents);
|
||||
|
||||
pattern = g_pattern_spec_new ("*[Icon Theme]*");
|
||||
if (g_pattern_match_string(pattern,file_contents)) {
|
||||
g_free (filename);
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
return THEME_ICON;
|
||||
}
|
||||
|
||||
pattern = g_pattern_spec_new ("*[X-GNOME-Metatheme]*");
|
||||
if (g_pattern_match_string(pattern,file_contents)) {
|
||||
g_free (filename);
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
return THEME_GNOME;
|
||||
}
|
||||
}
|
||||
g_free (filename);
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
|
||||
filename = g_strdup_printf ("%s/gtk-2.0/gtkrc",dir);
|
||||
src_uri = gnome_vfs_uri_new (filename);
|
||||
g_free (filename);
|
||||
if (gnome_vfs_uri_exists(src_uri)) {
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
return THEME_GTK;
|
||||
}
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
|
||||
filename = g_strdup_printf ("%s/metacity-1/metacity-theme-1.xml",dir);
|
||||
src_uri = gnome_vfs_uri_new (filename);
|
||||
g_free (filename);
|
||||
if (gnome_vfs_uri_exists (src_uri)) {
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
return THEME_METACITY;
|
||||
}
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
|
||||
|
||||
filename = g_strdup_printf ("%s/configure.in",dir);
|
||||
src_uri = gnome_vfs_uri_new (filename);
|
||||
g_free (filename);
|
||||
if (gnome_vfs_uri_exists (src_uri)) {
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
return THEME_ENGINE;
|
||||
}
|
||||
gnome_vfs_uri_unref (src_uri);
|
||||
|
||||
return THEME_INVALID;
|
||||
}
|
||||
|
||||
static void
|
||||
transfer_cancel_cb (GtkWidget *dlg, gchar *path)
|
||||
{
|
||||
gnome_vfs_unlink (path);
|
||||
g_free (path);
|
||||
gtk_widget_destroy (dlg);
|
||||
}
|
||||
|
||||
static void
|
||||
missing_utility_message_dialog (gchar *utility)
|
||||
{
|
||||
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
|
||||
_("Can not install theme. \nThe %s utility is not installed."), utility);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
extract_files_error_dialog (void)
|
||||
{
|
||||
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
|
||||
_("Can not install theme. \nThere was a problem while extracting the theme"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
/* this works around problems when doing fork/exec in a threaded app
|
||||
* with some locks being held/waited on in different threads.
|
||||
*
|
||||
* we do the idle callback so that the async xfer has finished and
|
||||
* cleaned up its vfs job. otherwise it seems the slave thread gets
|
||||
* woken up and it removes itself from the job queue before it is
|
||||
* supposed to. very strange.
|
||||
*
|
||||
* see bugzilla.gnome.org #86141 for details
|
||||
*/
|
||||
static gchar*
|
||||
transfer_done_targz_idle_cb (gpointer data)
|
||||
{
|
||||
int status;
|
||||
gchar *command, *filename, *gzip, *tar;
|
||||
theme_properties *theme_props = data;
|
||||
gchar *top_level_dir = NULL;
|
||||
|
||||
if (!(gzip = g_find_program_in_path("gzip"))) {
|
||||
missing_utility_message_dialog ("gzip");
|
||||
return NULL;
|
||||
}
|
||||
if (!(tar = g_find_program_in_path("tar"))) {
|
||||
missing_utility_message_dialog ("tar");
|
||||
g_free(gzip);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
filename = g_shell_quote(theme_props->filename);
|
||||
|
||||
command = g_strdup_printf ("sh -c '%s -d -c < \"%s\" | %s ft - | head -n 1'", gzip, filename, tar);
|
||||
if (!g_spawn_command_line_sync (command, &top_level_dir, NULL, &status, NULL) || status != 0)
|
||||
{
|
||||
extract_files_error_dialog ();
|
||||
g_free (top_level_dir);
|
||||
g_free (command);
|
||||
g_free (gzip);
|
||||
g_free (tar);
|
||||
g_free (filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* this should be something more clever and nonblocking */
|
||||
command = g_strdup_printf ("sh -c 'cd \"%s\"; %s -d -c < \"%s\" | %s xf - '",
|
||||
theme_props->target_tmp_dir, gzip, filename, tar);
|
||||
g_free(filename);
|
||||
if (g_spawn_command_line_sync (command, NULL, NULL, &status, NULL) && status == 0) {
|
||||
g_free (command);
|
||||
g_free (gzip);
|
||||
g_free (tar);
|
||||
return top_level_dir;
|
||||
} else {
|
||||
extract_files_error_dialog ();
|
||||
g_free (command);
|
||||
g_free (gzip);
|
||||
g_free (tar);
|
||||
g_free (top_level_dir);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* this works around problems when doing fork/exec in a threaded app
|
||||
* with some locks being held/waited on in different threads.
|
||||
*
|
||||
* we do the idle callback so that the async xfer has finished and
|
||||
* cleaned up its vfs job. otherwise it seems the slave thread gets
|
||||
* woken up and it removes itself from the job queue before it is
|
||||
* supposed to. very strange.
|
||||
*
|
||||
* see bugzilla.gnome.org #86141 for details
|
||||
*/
|
||||
static gchar*
|
||||
transfer_done_tarbz2_idle_cb (gpointer data)
|
||||
{
|
||||
int status;
|
||||
gchar *command, *filename, *bzip2, *tar;
|
||||
theme_properties *theme_props = data;
|
||||
gchar *top_level_dir = NULL;
|
||||
|
||||
if (!(bzip2 = g_find_program_in_path("bzip2")))
|
||||
{
|
||||
missing_utility_message_dialog ("bzip2");
|
||||
return NULL;
|
||||
}
|
||||
if (!(tar = g_find_program_in_path("tar"))) {
|
||||
missing_utility_message_dialog ("tar");
|
||||
g_free(bzip2);
|
||||
return NULL;
|
||||
}
|
||||
filename = g_shell_quote(theme_props->filename);
|
||||
|
||||
command = g_strdup_printf ("sh -c '%s -d -c < \"%s\" | %s ft - | head -n 1'", bzip2, filename, tar);
|
||||
if (!g_spawn_command_line_sync (command, &top_level_dir, NULL, &status, NULL) || status != 0)
|
||||
{
|
||||
extract_files_error_dialog ();
|
||||
g_free (top_level_dir);
|
||||
g_free (command);
|
||||
g_free (bzip2);
|
||||
g_free (tar);
|
||||
g_free (filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* this should be something more clever and nonblocking */
|
||||
command = g_strdup_printf ("sh -c 'cd \"%s\"; %s -d -c < \"%s\" | %s xf - '",
|
||||
theme_props->target_tmp_dir, bzip2, filename, tar);
|
||||
g_free (filename);
|
||||
if (g_spawn_command_line_sync (command, NULL, NULL, &status, NULL) && status == 0) {
|
||||
g_free (bzip2);
|
||||
g_free (tar);
|
||||
g_free (command);
|
||||
return top_level_dir;
|
||||
} else {
|
||||
extract_files_error_dialog ();
|
||||
g_free (bzip2);
|
||||
g_free (tar);
|
||||
g_free (command);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
transfer_done_cb (GtkWidget *dlg, gchar *path)
|
||||
{
|
||||
GtkWidget *dialog, *apply_button;
|
||||
gchar **dir;
|
||||
int theme_type, xfer_options;
|
||||
theme_properties *theme_props;
|
||||
GnomeVFSURI *theme_source_dir, *theme_dest_dir;
|
||||
|
||||
/* XXX: path should be on the local filesystem by now? */
|
||||
|
||||
if (dlg)
|
||||
gtk_widget_destroy (dlg);
|
||||
|
||||
theme_props = g_new0 (theme_properties,1);
|
||||
|
||||
theme_props->target_tmp_dir = g_strdup_printf ("%s/.themes/.theme-%u",
|
||||
g_get_home_dir(),
|
||||
g_random_int());
|
||||
|
||||
|
||||
if (g_str_has_suffix (path, ".tar.gz") || g_str_has_suffix (path, ".tgz") || g_str_has_suffix(path, ".gtp"))
|
||||
theme_props->filetype=TARGZ;
|
||||
else if (g_str_has_suffix (path, ".tar.bz2"))
|
||||
theme_props->filetype=TARBZ;
|
||||
else if (g_file_test (path, G_FILE_TEST_IS_DIR))
|
||||
theme_props->filetype=DIRECTORY;
|
||||
else {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("This theme is not in a supported format."));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ((gnome_vfs_make_directory(theme_props->target_tmp_dir,0700)) != GNOME_VFS_OK) {
|
||||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Failed to create temporary directory"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Uncompress the file in the temp directory */
|
||||
theme_props->filename=g_strdup(path);
|
||||
|
||||
if (theme_props->filetype == TARBZ)
|
||||
{
|
||||
theme_props->theme_tmp_dir = transfer_done_tarbz2_idle_cb(theme_props);
|
||||
if (!theme_props->theme_tmp_dir)
|
||||
{
|
||||
cleanup_tmp_dir (theme_props);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (theme_props->filetype == TARGZ)
|
||||
{
|
||||
theme_props->theme_tmp_dir = transfer_done_targz_idle_cb(theme_props);
|
||||
if (!theme_props->theme_tmp_dir)
|
||||
{
|
||||
cleanup_tmp_dir (theme_props);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (theme_props->filetype == DIRECTORY)
|
||||
{
|
||||
theme_props->theme_name = g_path_get_basename (path);
|
||||
theme_props->theme_tmp_dir = g_strdup (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create a full path for theme_tmp_dir */
|
||||
dir = g_strsplit(g_strchomp(theme_props->theme_tmp_dir),"/",0);
|
||||
theme_props->theme_name = g_strdup (dir[0]);
|
||||
g_strfreev (dir);
|
||||
g_free (theme_props->theme_tmp_dir);
|
||||
theme_props->theme_tmp_dir=g_build_filename(theme_props->target_tmp_dir,theme_props->theme_name,NULL);
|
||||
}
|
||||
|
||||
|
||||
/* What type of theme it is ? */
|
||||
theme_type = file_theme_type(theme_props->theme_tmp_dir);
|
||||
gnome_vfs_unlink (theme_props->filename);
|
||||
if (theme_type == THEME_ICON) {
|
||||
theme_props->target_dir=g_strdup_printf("%s/.icons/%s",g_get_home_dir(), theme_props->theme_name);
|
||||
} else if (theme_type == THEME_GNOME) {
|
||||
theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name);
|
||||
theme_props->user_message=g_strdup_printf(_("GNOME Theme %s correctly installed"), theme_props->theme_name);
|
||||
} else if (theme_type == THEME_METACITY) {
|
||||
theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name);
|
||||
} else if (theme_type == THEME_GTK) {
|
||||
theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name);
|
||||
} else if (theme_type == THEME_ENGINE) {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("The theme is an engine. You need to compile the theme."));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
cleanup_tmp_dir(theme_props);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
} else {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("The file format is invalid"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
|
||||
/* see if there is an icon theme lurking in this package */
|
||||
if (theme_type == THEME_GNOME)
|
||||
{
|
||||
gchar *path = g_strconcat (theme_props->theme_tmp_dir, "/icons", NULL);
|
||||
if (g_file_test (path, G_FILE_TEST_EXISTS)
|
||||
&& (file_theme_type (path) == THEME_ICON))
|
||||
{
|
||||
gchar *new_path =
|
||||
g_strdup_printf("%s/.icons/%s", g_get_home_dir(), theme_props->theme_name);
|
||||
/* XXX: make some noise if we couldn't install it? */
|
||||
gnome_vfs_move (path, new_path, FALSE);
|
||||
g_free (new_path);
|
||||
}
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
/* Move the Dir to the target dir */
|
||||
theme_source_dir = gnome_vfs_uri_new (theme_props->theme_tmp_dir);
|
||||
theme_dest_dir = gnome_vfs_uri_new (theme_props->target_dir);
|
||||
|
||||
xfer_options = GNOME_VFS_XFER_DELETE_ITEMS | GNOME_VFS_XFER_RECURSIVE;
|
||||
if (theme_props->filetype != DIRECTORY)
|
||||
xfer_options = xfer_options | GNOME_VFS_XFER_REMOVESOURCE;
|
||||
|
||||
if (gnome_vfs_xfer_uri (theme_source_dir,theme_dest_dir, xfer_options,
|
||||
GNOME_VFS_XFER_ERROR_MODE_ABORT,
|
||||
GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
|
||||
NULL,NULL) != GNOME_VFS_OK) {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Installation Failed"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
cleanup_tmp_dir(theme_props);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
} else {
|
||||
/* Ask to apply theme (if we can) */
|
||||
if (theme_type == THEME_GTK || theme_type == THEME_METACITY || theme_type == THEME_ICON)
|
||||
{
|
||||
/* TODO: currently cannot apply "gnome themes" */
|
||||
gchar* str;
|
||||
|
||||
str = g_strdup_printf(_("The theme \"%s\" has been installed."), theme_props->theme_name);
|
||||
theme_props->user_message=g_strdup_printf("<span weight=\"bold\" size=\"larger\">%s</span>", str);
|
||||
g_free(str);
|
||||
|
||||
dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, theme_props->user_message );
|
||||
|
||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG (dialog), _("Would you like to apply it now, or keep your current theme?"));
|
||||
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Keep Current Theme"), GTK_RESPONSE_CLOSE);
|
||||
|
||||
apply_button = gtk_button_new_with_label (_("Apply New Theme"));
|
||||
gtk_button_set_image (GTK_BUTTON (apply_button), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON));
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), apply_button, GTK_RESPONSE_APPLY);
|
||||
GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_show (apply_button);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
|
||||
|
||||
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_APPLY)
|
||||
{
|
||||
/* apply theme here! */
|
||||
GConfClient * gconf_client;
|
||||
gconf_client = gconf_client_get_default ();
|
||||
switch (theme_type)
|
||||
{
|
||||
case THEME_GTK: gconf_client_set_string (gconf_client, GTK_THEME_KEY, theme_props->theme_name, NULL); break;
|
||||
case THEME_METACITY: gconf_client_set_string (gconf_client, METACITY_THEME_KEY, theme_props->theme_name, NULL); break;
|
||||
case THEME_ICON: gconf_client_set_string (gconf_client, ICON_THEME_KEY, theme_props->theme_name, NULL); break;
|
||||
}
|
||||
|
||||
g_object_unref (gconf_client);
|
||||
}
|
||||
} else
|
||||
{
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
theme_props->user_message );
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
}
|
||||
gtk_widget_destroy (dialog);
|
||||
cleanup_tmp_dir (theme_props);
|
||||
theme_properties_free (theme_props);
|
||||
return;
|
||||
}
|
||||
theme_properties_free (theme_props);
|
||||
}
|
||||
|
||||
void
|
||||
gnome_theme_install_from_uri (gchar * theme_filename, GtkWindow *parent)
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
gchar *filename, *path, *base;
|
||||
GList *src, *target;
|
||||
GnomeVFSURI *src_uri;
|
||||
gchar *temppath;
|
||||
|
||||
|
||||
if (theme_filename == NULL || strlen (theme_filename) <= 0) {
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("No theme file location specified to install"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
return;
|
||||
}
|
||||
|
||||
filename = g_strdup (theme_filename);
|
||||
|
||||
if (filename == NULL) {
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("The theme file location specified to install is invalid"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
return;
|
||||
}
|
||||
|
||||
/* see if someone dropped a directory */
|
||||
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
transfer_done_cb (NULL, filename);
|
||||
return;
|
||||
}
|
||||
|
||||
src_uri = gnome_vfs_uri_new (filename);
|
||||
base = gnome_vfs_uri_extract_short_name (src_uri);
|
||||
src = g_list_append (NULL, src_uri);
|
||||
/* we can't tell if this is an icon theme yet, so just make a
|
||||
* temporary copy in .themes */
|
||||
path = g_build_filename (g_get_home_dir (), ".themes", NULL);
|
||||
|
||||
if (access (path, X_OK | W_OK) != 0) {
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Insufficient permissions to install the theme in:\n%s"), path);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
|
||||
while(TRUE) {
|
||||
gchar *file_tmp;
|
||||
GtkWidget *dialog;
|
||||
|
||||
if (g_str_has_suffix (base, ".tar.gz") || g_str_has_suffix (base, ".tgz") || g_str_has_suffix(base, ".gtp"))
|
||||
file_tmp = g_strdup_printf("gnome-theme-%d.gtp", rand ());
|
||||
else if (g_str_has_suffix (base, ".tar.bz2"))
|
||||
file_tmp = g_strdup_printf("gnome-theme-%d.tar.bz2", rand ());
|
||||
else {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("The file format is invalid."));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
|
||||
path = g_build_filename (g_get_home_dir (), ".themes", file_tmp, NULL);
|
||||
|
||||
g_free(file_tmp);
|
||||
if (!gnome_vfs_uri_exists (gnome_vfs_uri_new (path)))
|
||||
break;
|
||||
}
|
||||
|
||||
/* To avoid the copy of /root/.themes to /root/.themes/.themes
|
||||
* which causes an infinite loop. The user asks to transfer the all
|
||||
* contents of a folder, to a folder under itseld. So ignore the
|
||||
* situation.
|
||||
*/
|
||||
temppath = g_build_filename (filename, ".themes", NULL);
|
||||
if (!strcmp(temppath, path)) {
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("%s is the path where the theme files will be installed. This can not be selected as the source location"), filename);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
g_free (base);
|
||||
g_free (filename);
|
||||
g_free(temppath);
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
g_free(temppath);
|
||||
|
||||
|
||||
|
||||
target = g_list_append (NULL, gnome_vfs_uri_new (path));
|
||||
|
||||
dlg = file_transfer_dialog_new_with_parent (parent);
|
||||
file_transfer_dialog_wrap_async_xfer (FILE_TRANSFER_DIALOG (dlg),
|
||||
src, target,
|
||||
GNOME_VFS_XFER_RECURSIVE,
|
||||
GNOME_VFS_XFER_ERROR_MODE_QUERY,
|
||||
GNOME_VFS_XFER_OVERWRITE_MODE_QUERY,
|
||||
GNOME_VFS_PRIORITY_DEFAULT);
|
||||
gnome_vfs_uri_list_unref (src);
|
||||
gnome_vfs_uri_list_unref (target);
|
||||
g_free (base);
|
||||
g_free (filename);
|
||||
g_signal_connect (G_OBJECT (dlg), "cancel",
|
||||
G_CALLBACK (transfer_cancel_cb), path);
|
||||
g_signal_connect (G_OBJECT (dlg), "done",
|
||||
G_CALLBACK (transfer_done_cb), path);
|
||||
gtk_widget_show (dlg);
|
||||
}
|
||||
|
||||
void
|
||||
gnome_theme_installer_run_cb (GtkWidget *button,
|
||||
GtkWindow *parent_window)
|
||||
{
|
||||
gnome_theme_installer_run (parent_window, NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnome_theme_installer_run (GtkWindow *parent, gchar *filename)
|
||||
{
|
||||
static gboolean running_theme_install = FALSE;
|
||||
GtkWidget *dialog;
|
||||
static char old_folder[1024] = "";
|
||||
gchar *filename_selected, *folder;
|
||||
GtkFileFilter *filter;
|
||||
|
||||
if (filename == NULL)
|
||||
filename = old_folder;
|
||||
|
||||
if (running_theme_install)
|
||||
return;
|
||||
|
||||
running_theme_install = TRUE;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new (_("Select Theme"), parent, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
|
||||
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_set_name (filter, _("Theme Packages"));
|
||||
gtk_file_filter_add_mime_type (filter, "application/x-bzip-compressed-tar");
|
||||
gtk_file_filter_add_mime_type (filter, "application/x-compressed-tar");
|
||||
gtk_file_filter_add_mime_type (filter, "application/x-gnome-theme-package");
|
||||
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_set_name (filter, _("All Files"));
|
||||
gtk_file_filter_add_pattern(filter, "*");
|
||||
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
|
||||
if (strcmp (old_folder, ""))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), old_folder);
|
||||
|
||||
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
filename_selected = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
gnome_theme_install_from_uri (filename_selected, parent);
|
||||
g_free (filename_selected);
|
||||
}
|
||||
|
||||
|
||||
folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
|
||||
g_strlcpy (old_folder, folder, 255);
|
||||
g_free (folder);
|
||||
|
||||
gnome_theme_details_reread_themes_from_disk();
|
||||
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
running_theme_install = FALSE;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
_Name=Theme Installer
|
||||
_Comment=Installs themes packages for various parts of the desktop
|
||||
Exec=gnome-theme-manager -i %u
|
||||
Icon=gnome-settings-theme
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=application/x-gnome-theme-package;
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;
|
||||
# we don't want to show this at all in the menus
|
||||
OnlyShowIn=;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=gnome-control-center
|
||||
X-GNOME-Bugzilla-Component=theme-manager
|
||||
X-GNOME-Bugzilla-Version=@VERSION@
|
|
@ -1,32 +0,0 @@
|
|||
/* gnome-theme-installer.h
|
||||
* Copyright (C) 2002 Jonathan Blandford
|
||||
*
|
||||
* Written by: Jonathan Blandford <jrb@gnome.org>
|
||||
*
|
||||
* 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 GNOME_THEME_INSTALLER_H
|
||||
#define GNOME_THEME_INSTALLER_H
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void gnome_theme_install_from_uri (gchar * filename, GtkWindow *parent);
|
||||
|
||||
void gnome_theme_installer_run (GtkWindow *parent, gchar *filename);
|
||||
void gnome_theme_installer_run_cb (GtkWidget *button, GtkWindow *parent_window);
|
||||
|
||||
#endif /* GNOME_THEME_INSTALLER_H */
|
|
@ -1,86 +0,0 @@
|
|||
#ifndef __GNOME_THEME_MANAGER_H__
|
||||
#define __GNOME_THEME_MANAGER_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
|
||||
#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme"
|
||||
#define ICON_THEME_KEY "/desktop/gnome/interface/icon_theme"
|
||||
#define FONT_KEY "/desktop/gnome/interface/font_name"
|
||||
#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font"
|
||||
#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name"
|
||||
#define BACKGROUND_KEY "/desktop/gnome/background/picture_filename"
|
||||
#define LOCKDOWN_KEY "/desktop/gnome/lockdown/disable_theme_settings"
|
||||
#define COLOR_SCHEME_KEY "/desktop/gnome/interface/gtk_color_scheme"
|
||||
|
||||
#define METACITY_THEME_DIR "/apps/metacity/general"
|
||||
#define METACITY_THEME_KEY METACITY_THEME_DIR "/theme"
|
||||
|
||||
extern const char *meta_theme_default_name;
|
||||
extern const char *gtk_theme_default_name;
|
||||
extern const char *window_theme_default_name;
|
||||
extern const char *icon_theme_default_name;
|
||||
|
||||
|
||||
/* Drag and drop info */
|
||||
enum
|
||||
{
|
||||
TARGET_URI_LIST,
|
||||
TARGET_NS_URL
|
||||
};
|
||||
|
||||
/* model info */
|
||||
enum
|
||||
{
|
||||
THEME_NAME_COLUMN,
|
||||
THEME_ID_COLUMN,
|
||||
THEME_FLAG_COLUMN,
|
||||
N_COLUMNS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
THEME_FLAG_DEFAULT = 1 << 0,
|
||||
THEME_FLAG_CUSTOM = 1 << 1
|
||||
};
|
||||
|
||||
extern GtkTargetEntry drop_types[];
|
||||
extern gint n_drop_types;
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
GladeXML *gnome_theme_manager_get_theme_dialog (void);
|
||||
gint gnome_theme_manager_sort_func (const gchar *a_str,
|
||||
const gchar *b_str,
|
||||
guint a_flag,
|
||||
guint b_flag);
|
||||
void gnome_theme_manager_show_manage_themes (GtkWidget *button,
|
||||
gpointer data);
|
||||
void gnome_theme_manager_icon_show_manage_themes (GtkWidget *button,
|
||||
gpointer data);
|
||||
void gnome_theme_manager_window_show_manage_themes (GtkWidget *button,
|
||||
gpointer data);
|
||||
gboolean gnome_theme_manager_drag_motion_cb (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time,
|
||||
gpointer data);
|
||||
void gnome_theme_manager_drag_leave_cb (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
guint time,
|
||||
gpointer data);
|
||||
void gnome_theme_manager_drag_data_received_cb (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void free_all (gpointer, ...);
|
||||
|
||||
#endif /* __GNOME_THEME_MANAGER_H__ */
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-gnome-theme-package">
|
||||
<sub-class-of type="application/x-compressed-tar"/>
|
||||
<_comment>Gnome Theme Package</_comment>
|
||||
<glob pattern="*.gtp"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
static const gchar *theme_header =
|
||||
"[Desktop Entry]\n\
|
||||
Name=%s\n\
|
||||
Type=X-GNOME-Metatheme\n\
|
||||
Comment=%s\n\
|
||||
Encoding=UTF-8\n\
|
||||
\n\
|
||||
[X-GNOME-Metatheme]\n\
|
||||
";
|
|
@ -1,361 +0,0 @@
|
|||
#include "gnome-theme-info.h"
|
||||
#include "gnome-theme-save.h"
|
||||
#include "gnome-theme-manager.h"
|
||||
#include "capplet-util.h"
|
||||
#include <libgnomevfs/gnome-vfs-ops.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
#include "gnome-theme-save-data.c"
|
||||
|
||||
static GQuark error_quark;
|
||||
enum
|
||||
{
|
||||
INVALID_THEME_NAME
|
||||
};
|
||||
|
||||
/* taken from gnome-desktop-item.c */
|
||||
static char *
|
||||
escape_string_and_dup (const char *s)
|
||||
{
|
||||
char *return_value, *p;
|
||||
const char *q;
|
||||
int len = 0;
|
||||
|
||||
if (s == NULL)
|
||||
return g_strdup("");
|
||||
|
||||
q = s;
|
||||
while (*q)
|
||||
{
|
||||
len++;
|
||||
if (strchr ("\n\r\t\\", *q) != NULL)
|
||||
len++;
|
||||
q++;
|
||||
}
|
||||
return_value = p = (char *) g_malloc (len + 1);
|
||||
do
|
||||
{
|
||||
switch (*s)
|
||||
{
|
||||
case '\t':
|
||||
*p++ = '\\';
|
||||
*p++ = 't';
|
||||
break;
|
||||
case '\n':
|
||||
*p++ = '\\';
|
||||
*p++ = 'n';
|
||||
break;
|
||||
case '\r':
|
||||
*p++ = '\\';
|
||||
*p++ = 'r';
|
||||
break;
|
||||
case '\\':
|
||||
*p++ = '\\';
|
||||
*p++ = '\\';
|
||||
break;
|
||||
default:
|
||||
*p++ = *s;
|
||||
}
|
||||
}
|
||||
while (*s++);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_theme_name (const gchar *theme_name,
|
||||
GError **error)
|
||||
{
|
||||
if (theme_name == NULL)
|
||||
{
|
||||
g_set_error (error,
|
||||
error_quark,
|
||||
INVALID_THEME_NAME,
|
||||
_("Theme name must be present"));
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gchar*
|
||||
str_remove_slash (const gchar *src)
|
||||
{
|
||||
const gchar *i;
|
||||
gchar *rtn;
|
||||
gint len = 0;
|
||||
i = src;
|
||||
|
||||
while (*i)
|
||||
{
|
||||
if (*i != '/')
|
||||
len++;
|
||||
i++;
|
||||
}
|
||||
|
||||
rtn = (gchar *) g_malloc (len + 1);
|
||||
while (*src)
|
||||
{
|
||||
if (*src != '/')
|
||||
{
|
||||
*rtn = *src;
|
||||
rtn++;
|
||||
}
|
||||
src++;
|
||||
}
|
||||
*rtn = '\0';
|
||||
return rtn - len;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
setup_directory_structure (const gchar *theme_name,
|
||||
GError **error)
|
||||
{
|
||||
gchar *dir, *theme_name_dir;
|
||||
GnomeVFSURI *uri;
|
||||
|
||||
theme_name_dir = str_remove_slash (theme_name);
|
||||
|
||||
dir = g_build_filename (g_get_home_dir (), ".themes", NULL);
|
||||
uri = gnome_vfs_uri_new (dir);
|
||||
if (!gnome_vfs_uri_exists (uri))
|
||||
gnome_vfs_make_directory_for_uri (uri, 0775);
|
||||
gnome_vfs_uri_unref (uri);
|
||||
g_free (dir);
|
||||
|
||||
dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, NULL);
|
||||
uri = gnome_vfs_uri_new (dir);
|
||||
if (!gnome_vfs_uri_exists (uri))
|
||||
gnome_vfs_make_directory_for_uri (uri, 0775);
|
||||
gnome_vfs_uri_unref (uri);
|
||||
g_free (dir);
|
||||
|
||||
dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme", NULL);
|
||||
uri = gnome_vfs_uri_new (dir);
|
||||
|
||||
if (gnome_vfs_uri_exists (uri))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
gint response;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_OK_CANCEL,
|
||||
_("The theme already exists. Would you like to replace it?"));
|
||||
response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
if (response == GTK_RESPONSE_CANCEL)
|
||||
{
|
||||
gnome_vfs_uri_unref (uri);
|
||||
g_free (dir);
|
||||
g_free (theme_name_dir);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gnome_vfs_uri_unref (uri);
|
||||
g_free (dir);
|
||||
g_free (theme_name_dir);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
write_theme_to_disk (GnomeThemeMetaInfo *meta_theme_info,
|
||||
const gchar *theme_name,
|
||||
const gchar *theme_description,
|
||||
gboolean save_background,
|
||||
GError **error)
|
||||
{
|
||||
gchar *dir, *theme_name_dir;
|
||||
GnomeVFSURI *uri;
|
||||
GnomeVFSURI *target_uri;
|
||||
GnomeVFSHandle *handle = NULL;
|
||||
GnomeVFSFileSize bytes_written;
|
||||
gchar *str, *current_background;
|
||||
GConfClient *client;
|
||||
|
||||
theme_name_dir = str_remove_slash (theme_name);
|
||||
dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme~", NULL);
|
||||
g_free (theme_name_dir);
|
||||
|
||||
uri = gnome_vfs_uri_new (dir);
|
||||
dir [strlen (dir) - 1] = '\000';
|
||||
target_uri = gnome_vfs_uri_new (dir);
|
||||
g_free (dir);
|
||||
gnome_vfs_create_uri (&handle, uri, GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_WRITE, FALSE, 0644);
|
||||
|
||||
gnome_vfs_truncate_handle (handle, 0);
|
||||
|
||||
/* start making the theme file */
|
||||
str = g_strdup_printf (theme_header, theme_name, theme_description);
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
g_free (str);
|
||||
|
||||
str = g_strdup_printf ("GtkTheme=%s\n", meta_theme_info->gtk_theme_name);
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
g_free (str);
|
||||
|
||||
if (meta_theme_info->gtk_color_scheme)
|
||||
{
|
||||
gchar *a, *tmp;
|
||||
tmp = g_strdup (meta_theme_info->gtk_color_scheme);
|
||||
for (a = tmp; *a != '\0'; a++)
|
||||
if (*a == '\n')
|
||||
*a = ',';
|
||||
str = g_strdup_printf ("GtkColorScheme=%s\n", tmp);
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
g_free (str);
|
||||
g_free (tmp);
|
||||
}
|
||||
|
||||
str = g_strdup_printf ("MetacityTheme=%s\n", meta_theme_info->metacity_theme_name);
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
g_free (str);
|
||||
|
||||
str = g_strdup_printf ("IconTheme=%s\n", meta_theme_info->icon_theme_name);
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
g_free (str);
|
||||
|
||||
if (save_background)
|
||||
{
|
||||
client = gconf_client_get_default ();
|
||||
current_background = gconf_client_get_string (client, BACKGROUND_KEY, NULL);
|
||||
str = g_strdup_printf ("BackgroundImage=%s\n", current_background);
|
||||
|
||||
gnome_vfs_write (handle, str, strlen (str), &bytes_written);
|
||||
|
||||
g_object_unref (client);
|
||||
g_free (current_background);
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
gnome_vfs_close (handle);
|
||||
|
||||
|
||||
gnome_vfs_move_uri (uri, target_uri, TRUE);
|
||||
gnome_vfs_uri_unref (uri);
|
||||
gnome_vfs_uri_unref (target_uri);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
save_theme_to_disk (GnomeThemeMetaInfo *meta_theme_info,
|
||||
const gchar *theme_name,
|
||||
const gchar *theme_description,
|
||||
gboolean save_background,
|
||||
GError **error)
|
||||
{
|
||||
if (! check_theme_name (theme_name, error))
|
||||
return FALSE;
|
||||
|
||||
if (! setup_directory_structure (theme_name, error))
|
||||
return FALSE;
|
||||
|
||||
if (! write_theme_to_disk (meta_theme_info, theme_name, theme_description, save_background, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
save_dialog_response (GtkWidget *save_dialog,
|
||||
gint response_id,
|
||||
gpointer data)
|
||||
{
|
||||
GnomeThemeMetaInfo *meta_theme_info;
|
||||
char *theme_description = NULL;
|
||||
char *theme_name = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
GladeXML *dialog;
|
||||
GtkWidget *entry;
|
||||
GtkWidget *text_view;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start_iter;
|
||||
GtkTextIter end_iter;
|
||||
gchar *buffer_text;
|
||||
gboolean save_background;
|
||||
|
||||
dialog = gnome_theme_manager_get_theme_dialog ();
|
||||
entry = WID ("save_dialog_entry");
|
||||
theme_name = escape_string_and_dup (gtk_entry_get_text (GTK_ENTRY (entry)));
|
||||
|
||||
text_view = WID ("save_dialog_textview");
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
gtk_text_buffer_get_start_iter (buffer, &start_iter);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
||||
buffer_text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
||||
theme_description = escape_string_and_dup (buffer_text);
|
||||
g_free (buffer_text);
|
||||
meta_theme_info = (GnomeThemeMetaInfo *) g_object_get_data (G_OBJECT (save_dialog), "meta-theme-info");
|
||||
save_background = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("save_background_checkbutton")));
|
||||
if (! save_theme_to_disk (meta_theme_info, theme_name, theme_description, save_background, &error))
|
||||
{
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
g_clear_error (&error);
|
||||
gtk_widget_hide (save_dialog);
|
||||
g_free (theme_name);
|
||||
g_free (theme_description);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
entry_text_changed (GtkEditable *editable,
|
||||
gpointer data)
|
||||
{
|
||||
GladeXML *dialog = (GladeXML *) data;
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (editable));
|
||||
if (text != NULL && text[0] != '\000')
|
||||
gtk_widget_set_sensitive (WID ("save_dialog_save_button"), TRUE);
|
||||
else
|
||||
gtk_widget_set_sensitive (WID ("save_dialog_save_button"), FALSE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnome_theme_save_show_dialog (GtkWidget *parent,
|
||||
GnomeThemeMetaInfo *meta_theme_info)
|
||||
{
|
||||
static GtkWidget *save_dialog = NULL;
|
||||
GladeXML *dialog;
|
||||
GtkWidget *entry;
|
||||
GtkWidget *text_view;
|
||||
GtkTextBuffer *text_buffer;
|
||||
|
||||
dialog = gnome_theme_manager_get_theme_dialog ();
|
||||
entry = WID ("save_dialog_entry");
|
||||
text_view = WID ("save_dialog_textview");
|
||||
|
||||
if (save_dialog == NULL)
|
||||
{
|
||||
save_dialog = WID ("save_dialog");
|
||||
g_assert (save_dialog);
|
||||
|
||||
g_signal_connect (G_OBJECT (save_dialog), "response", G_CALLBACK (save_dialog_response), NULL);
|
||||
g_signal_connect (G_OBJECT (save_dialog), "delete-event", G_CALLBACK (gtk_true), NULL);
|
||||
g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (entry_text_changed), dialog);
|
||||
|
||||
error_quark = g_quark_from_string ("gnome-theme-save");
|
||||
gtk_widget_set_size_request (text_view, 300, 100);
|
||||
}
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
entry_text_changed (GTK_EDITABLE (entry), dialog);
|
||||
gtk_widget_grab_focus (entry);
|
||||
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
gtk_text_buffer_set_text (text_buffer, "", strlen (""));
|
||||
g_object_set_data (G_OBJECT (save_dialog), "meta-theme-info", meta_theme_info);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (save_dialog), GTK_WINDOW (parent));
|
||||
gtk_widget_show (save_dialog);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef __GNOME_THEME_SAVE_H__
|
||||
#define __GNOME_THEME_SAVE_H__
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gnome-theme-info.h"
|
||||
|
||||
void gnome_theme_save_show_dialog (GtkWidget *parent,
|
||||
GnomeThemeMetaInfo *meta_theme_info);
|
||||
|
||||
|
||||
#endif /* __GNOME_THEME_SAVE_H__ */
|
Before Width: | Height: | Size: 527 B |
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
_Name=Theme
|
||||
_Comment=Select themes for various parts of the desktop
|
||||
Exec=gnome-theme-manager
|
||||
Icon=gnome-settings-theme
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Settings;DesktopSettings;
|
||||
OnlyShowIn=GNOME;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=gnome-control-center
|
||||
X-GNOME-Bugzilla-Component=theme-manager
|
||||
X-GNOME-Bugzilla-Version=@VERSION@
|
|
@ -1,47 +0,0 @@
|
|||
<gconfschemafile>
|
||||
<schemalist>
|
||||
<schema>
|
||||
<key>/schemas/apps/gtk-theme-switcher/auto</key>
|
||||
<applyto>/apps/gtk-theme-switcher/auto</applyto>
|
||||
<owner>gtk-theme-switcher</owner>
|
||||
<type>bool</type>
|
||||
<default>true</default>
|
||||
<locale name="C">
|
||||
<short>Auto-preview</short>
|
||||
<long>Whether to automatically preview selected themes</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/apps/gtk-theme-switcher/theme</key>
|
||||
<applyto>/apps/gtk-theme-switcher/theme</applyto>
|
||||
<owner>gtk-theme-switcher</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>Current theme</short>
|
||||
<long>The last set theme</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/apps/gtk-theme-switcher/font</key>
|
||||
<applyto>/apps/gtk-theme-switcher/font</applyto>
|
||||
<owner>gtk-theme-switcher</owner>
|
||||
<type>string</type>
|
||||
<locale name="C">
|
||||
<short>Current theme</short>
|
||||
<long>The last set theme</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/apps/gtk-theme-switcher/use_theme_font</key>
|
||||
<applyto>/apps/gtk-theme-switcher/use_theme_font</applyto>
|
||||
<owner>gtk-theme-switcher</owner>
|
||||
<type>bool</type>
|
||||
<default>false</default>
|
||||
<locale name="C">
|
||||
<short>Use custom font</short>
|
||||
<long>Whether to use the custom specified font</long>
|
||||
</locale>
|
||||
</schema>
|
||||
</schemalist>
|
||||
</gconfschemafile>
|
Before Width: | Height: | Size: 527 B |
Before Width: | Height: | Size: 2 KiB |
|
@ -1,374 +0,0 @@
|
|||
2007-04-27 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
|
||||
* gnome-ui-properties.desktop.in.in: renamed Bugzilla product.
|
||||
|
||||
2007-02-08 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* gnome-ui-properties.glade: change "Editable menu accelerators" to
|
||||
"Editable menu shortcut keys" as per the style guide (Closes: #337624)
|
||||
|
||||
2007-01-31 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* gnome-ui-properties.c: (main): don't leak the references to the glade
|
||||
dialog and GnomeProgram
|
||||
|
||||
2006-08-07 Rodrigo Moya <rodrigo@novell.com>
|
||||
|
||||
Fixes #348844
|
||||
|
||||
* gnome-ui-properties.desktop.in.in: fixed GNOME Bugzilla strings.
|
||||
|
||||
2006-07-23 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* gnome-ui-properties.desktop.in.in: don't list the Application
|
||||
category, patch by Vincent Fretin <vincent.fretin@gmail.com>
|
||||
(Closes: #344321)
|
||||
|
||||
2005-07-24 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* gnome-ui-properties.glade: set the "is_important" property for one
|
||||
of the buttons, so the label is showed for the "Text beside icons" mode
|
||||
(Closes: #308845).
|
||||
|
||||
2005-01-13 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* gnome-ui-properties.c: (setup_dialog):
|
||||
* gnome-ui-properties.glade:
|
||||
patch from Christian - Manny Calavera - Neumair <chris@gnome-de.org>,
|
||||
add an option in the UI to activate menus accelators changes
|
||||
(Closes: #148013).
|
||||
|
||||
2005-01-02 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* gnome-ui-properties.glade:
|
||||
patch from Heikki Paajanen <hepaajan@iki.fi> (based on the patch
|
||||
from Andrew Johnson <acjgenius@earthlink.net>)
|
||||
to not set "close" as the default button (Closes: #98202).
|
||||
|
||||
2004-11-09 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* Makefile.am: install .desktop file in $(datadir)/applications
|
||||
|
||||
* gnome-ui-properties.desktop.in: add OnlyShowIn=GNOME;
|
||||
|
||||
2004-10-14 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.8.1
|
||||
|
||||
2004-08-20 Frederic Crozat <fcrozat@mandrakesoft.com>
|
||||
|
||||
* gnome-ui-properties.c: (setup_dialog):
|
||||
Use themed icon for window hint.
|
||||
|
||||
2004-04-15 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.1
|
||||
|
||||
2004-04-01 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0.3
|
||||
|
||||
2004-03-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0.1
|
||||
|
||||
2004-03-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.6.0
|
||||
|
||||
2004-03-11 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.4
|
||||
|
||||
2004-02-13 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.3
|
||||
|
||||
2004-02-12 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* gnome-ui-properties.c: (dialog_button_clicked_cb): Update help link
|
||||
to point to user-guide.xml
|
||||
|
||||
2004-01-14 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.2
|
||||
|
||||
2003-12-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.1.1
|
||||
|
||||
2003-12-30 Rodney Dawes <dobey@ximian.com>
|
||||
|
||||
* gnome-ui-properties.glade: Fix border width of example toolbar,
|
||||
fixes #130064
|
||||
|
||||
2003-12-30 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.1
|
||||
|
||||
2003-10-28 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.5.0
|
||||
|
||||
2003-08-01 Dennis Cranston <dennis_cranston at yahoo com>
|
||||
|
||||
* gnome-ui-properties.glade: Patch to fix spacing between action
|
||||
area and vbox of preferences dialog.
|
||||
|
||||
2003-07-18 Dennis Cranston <dennis_cranston at yahoo com>
|
||||
|
||||
* gnome-ui-properties.c, gnome-ui-properties.glade:
|
||||
Apply patch from Christian - Manny Calavera - Neumair
|
||||
<chris@gnome-de.org> for ui-review bug # 99537.
|
||||
|
||||
2003-07-11 Dennis Cranston <dennis_cranston at yahoo com>
|
||||
|
||||
* gnome-ui-properties.glade: UI-Review fixes for bug
|
||||
report #99537.
|
||||
|
||||
2003-07-07 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.4
|
||||
|
||||
2003-06-24 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.3
|
||||
|
||||
2003-05-07 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.3.1
|
||||
|
||||
2003-05-05 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c: Fix for both-horiz property
|
||||
with eggtoolbar and bonobo. Fixes bug #104979.
|
||||
|
||||
Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* Release 2.2.0.1
|
||||
|
||||
Tue Jan 21 01:15:14 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* Release 2.2.0
|
||||
|
||||
Thu Jan 16 02:41:09 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* Release 2.1.7
|
||||
|
||||
2003-01-10 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.6
|
||||
|
||||
2002-12-18 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.5
|
||||
|
||||
2002-11-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.3
|
||||
|
||||
2002-11-02 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.2
|
||||
|
||||
2002-10-21 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.1
|
||||
|
||||
2002-10-01 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.0.1
|
||||
|
||||
2002-10-01 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.glade : avoid conflicting mnemonics
|
||||
* gnome-ui-properties.c (set_have_icons) : the menus no longer have
|
||||
images, silence the warnings.
|
||||
|
||||
2002-09-10 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=76419
|
||||
* gnome-ui-properties.glade : tweak layout slightly
|
||||
|
||||
2002-08-23 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.glade : Priority text was a bonobo-ism.
|
||||
This is really 'text beside icon'
|
||||
|
||||
2002-08-21 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.1.0
|
||||
|
||||
2002-08-19 Ross Burton <ross@burtonini.com>
|
||||
|
||||
* behavior.desktop.in: Fix the desktop file so that it validates.
|
||||
|
||||
2002-07-17 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.glade : Use stock names
|
||||
and a 2nd menu item, as per ui-review
|
||||
|
||||
2002-06-17 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* Release 2.0.0
|
||||
|
||||
2002-05-29 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=82802
|
||||
* gnome-ui-properties.c (setup_dialog) : disable resize.
|
||||
|
||||
2002-05-28 Satyajit Kanungo <satyajit.kanungo@wipro.com>
|
||||
|
||||
* gnome-ui-properties.c : Changed the help file link
|
||||
to get the help document from user-guide.
|
||||
|
||||
2002-05-26 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c (dialog_button_clicked_cb) : Improve handling
|
||||
of help failures.
|
||||
|
||||
Sun May 26 11:37:08 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c (main): use APPID instead of argv[0]
|
||||
|
||||
2002-05-14 Michael Meeks <michael@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c
|
||||
(toolbar_to_widget, set_toolbar_style): tolerate
|
||||
bogus values sanely.
|
||||
Update string to describe bonobo priority text
|
||||
|
||||
2002-05-09 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.glade : add a help button.
|
||||
* gnome-ui-properties.c (dialog_button_clicked_cb) : ditto.
|
||||
|
||||
2002-05-06 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* ui-properties.glade.h: remove unused file
|
||||
|
||||
2002-05-06 Anders Carlsson <andersca@gnu.org>
|
||||
|
||||
* gnome-ui-properties.c: (create_dialog):
|
||||
Fix the support for both_horiz as the toolbar style.
|
||||
|
||||
* gnome-ui-properties.glade:
|
||||
Re-add all option menu items; Somehow they got lost.
|
||||
|
||||
2002-04-29 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* ui-properties.glade: Remove translatable="yes" for a wrong case.
|
||||
|
||||
2002-04-25 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* behavior.desktop.in:
|
||||
|
||||
Move out of advanced, add nicer tooltip (still crummy, but better).
|
||||
|
||||
2002-04-25 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c (set_toolbar_style) : Add GTK_TOOLBAR_BOTH_HORIZ
|
||||
|
||||
2002-04-10 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-ui-properties.glade:
|
||||
|
||||
Change "Menu items have icons" to "Menu items can have icons"
|
||||
|
||||
2002-04-02 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c (setup_dialog) : suppress warnings.
|
||||
|
||||
2002-04-10 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-ui-properties.c: (create_dialog):
|
||||
* gnome-ui-properties.glade:
|
||||
* ui-properties.glade:
|
||||
|
||||
Somebody started rennaming the glade file but didn't follow
|
||||
through. Fixing the build by finishing the change.
|
||||
|
||||
2002-03-21 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c (toolbar_to_widget): Check GConf value type
|
||||
|
||||
2002-03-21 Dave Camp <dave@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c: (show_handlebar), (set_toolbar_style),
|
||||
(toolbar_style_cb), (set_have_icons): New functions.
|
||||
(toolbar_detachable_cb): Call show_handlebar.
|
||||
(menus_have_icons_cb): Call set_have_icons.
|
||||
(setup_dialog): Connect to the style peditor's value_changed signal,
|
||||
and set the initial states of the example widgets.
|
||||
|
||||
2002-03-19 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c (*_to/from_widget): Convert to new signature.
|
||||
|
||||
2002-02-27 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* main.c: s/PACKAGE/GETTEXT_PACKAGE/g
|
||||
* gnome-ui-properties.c: Same here.
|
||||
|
||||
2002-02-10 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c (main): Create changeset.
|
||||
|
||||
2002-02-10 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* Make dialog Apply/Close.
|
||||
|
||||
2002-02-04 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* gnome-ui-properties.c (dialog_button_clicked_cb): Use GtkDialog
|
||||
|
||||
2002-02-01 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* behavior-capplet.png:
|
||||
|
||||
Change to Jimmac's alternate behavior icon.
|
||||
|
||||
Mon Jan 28 22:18:34 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c (create_dialog): install globally
|
||||
|
||||
Mon Jan 28 22:09:30 2002 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gnome-ui-properties.c: completely rethink this dialog
|
||||
|
||||
2002-01-27 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* behavior.desktop.in:
|
||||
|
||||
Add Categories field.
|
||||
|
||||
2002-01-14 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* Makefile.am: Update
|
||||
|
||||
* main.c (main): Remove Ximian archiver stuff
|
||||
|
||||
2002-01-14 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* Gnome 2 port. (Settings only halfway work right now.)
|
||||
|
||||
2001-09-29 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* prefs-widget.c (prefs_widget_set_arg): Register
|
||||
callbacks after loading the preferences; otherwise they will
|
||||
get triggered unnecessarily.
|
||||
(selected_cb): Only trigger a change if there really was one.
|
||||
Fixes bug #9161.
|
||||
|
||||
2001-07-27 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* RELEASE : 1.5.2
|
||||
|
||||
2001-07-20 Chema Celorio <chema@celorio.com>
|
||||
|
||||
* RELEASE : 1.5.0
|
||||
|
||||
2001-07-19 Chema Celorio <chema@celorio.com>
|
||||
|
||||
* Makefile.am (cappletname): distcheck fixes
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# This is used in GNOMECC_CAPPLETS_CFLAGS
|
||||
cappletname = ui
|
||||
|
||||
bin_PROGRAMS = gnome-ui-properties
|
||||
|
||||
gnome_ui_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS)
|
||||
gnome_ui_properties_SOURCES = \
|
||||
gnome-ui-properties.c
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
Desktop_in_files = gnome-ui-properties.desktop.in
|
||||
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
Gladedir = $(pkgdatadir)/glade
|
||||
Glade_DATA = gnome-ui-properties.glade
|
||||
|
||||
INCLUDES = \
|
||||
$(GNOMECC_CAPPLETS_CFLAGS) \
|
||||
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
|
||||
-DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\""
|
||||
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
|
||||
EXTRA_DIST = $(Glade_DATA)
|
|
@ -1,313 +0,0 @@
|
|||
/* gnome-ui-properties.c
|
||||
* Copyright (C) 2002 Jonathan Blandford
|
||||
*
|
||||
* Written by: Jonathan Blandford <jrb@gnome.org>
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
#include "capplet-util.h"
|
||||
#include "gconf-property-editor.h"
|
||||
|
||||
enum
|
||||
{
|
||||
RESPONSE_APPLY = 1,
|
||||
RESPONSE_CLOSE
|
||||
};
|
||||
|
||||
static GConfEnumStringPair toolbar_style_enums[] = {
|
||||
{ 0, "both" },
|
||||
{ 1, "both-horiz" },
|
||||
{ 2, "icons" },
|
||||
{ 3, "text" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static GConfValue *
|
||||
toolbar_from_widget (GConfPropertyEditor *peditor, GConfValue *value)
|
||||
{
|
||||
GConfValue *new_value;
|
||||
|
||||
new_value = gconf_value_new (GCONF_VALUE_STRING);
|
||||
gconf_value_set_string (new_value,
|
||||
gconf_enum_to_string (toolbar_style_enums, gconf_value_get_int (value)));
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
static GConfValue *
|
||||
toolbar_to_widget (GConfPropertyEditor *peditor, GConfValue *value)
|
||||
{
|
||||
GConfValue *new_value;
|
||||
const gchar *str;
|
||||
gint val = 2;
|
||||
|
||||
str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL;
|
||||
new_value = gconf_value_new (GCONF_VALUE_INT);
|
||||
if (!gconf_string_to_enum (toolbar_style_enums, str, &val))
|
||||
val = 0;
|
||||
gconf_value_set_int (new_value, val);
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_HELP)
|
||||
capplet_help (GTK_WINDOW (dialog),
|
||||
"user-guide.xml",
|
||||
"goscustuserinter-2");
|
||||
else
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
static GladeXML *
|
||||
create_dialog (void)
|
||||
{
|
||||
GladeXML *dialog;
|
||||
|
||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-ui-properties.glade", "gnome_ui_properties_dialog", NULL);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
show_handlebar (GladeXML *dialog, gboolean show)
|
||||
{
|
||||
GtkWidget *handlebox;
|
||||
GtkWidget *toolbar;
|
||||
GtkWidget *align;
|
||||
|
||||
handlebox = WID ("toolbar_handlebox");
|
||||
toolbar = WID ("toolbar_toolbar");
|
||||
align = WID ("toolbar_align");
|
||||
|
||||
g_object_ref (handlebox);
|
||||
g_object_ref (toolbar);
|
||||
|
||||
if (GTK_BIN (align)->child)
|
||||
gtk_container_remove (GTK_CONTAINER (align), GTK_BIN (align)->child);
|
||||
if (GTK_BIN (handlebox)->child)
|
||||
gtk_container_remove (GTK_CONTAINER (handlebox), GTK_BIN (handlebox)->child);
|
||||
if (show)
|
||||
{
|
||||
gtk_container_add (GTK_CONTAINER (align), handlebox);
|
||||
gtk_container_add (GTK_CONTAINER (handlebox), toolbar);
|
||||
g_object_unref (handlebox);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_container_add (GTK_CONTAINER (align), toolbar);
|
||||
}
|
||||
g_object_unref (toolbar);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
set_toolbar_style (GladeXML *dialog, const char *value)
|
||||
{
|
||||
static const GtkToolbarStyle gtk_toolbar_styles[] =
|
||||
{ GTK_TOOLBAR_BOTH, GTK_TOOLBAR_BOTH_HORIZ, GTK_TOOLBAR_ICONS, GTK_TOOLBAR_TEXT };
|
||||
|
||||
int enum_val;
|
||||
|
||||
if (!gconf_string_to_enum (toolbar_style_enums, value, &enum_val))
|
||||
enum_val = 0;
|
||||
|
||||
gtk_toolbar_set_style (GTK_TOOLBAR (WID("toolbar_toolbar")),
|
||||
gtk_toolbar_styles[enum_val]);
|
||||
}
|
||||
|
||||
static void
|
||||
toolbar_detachable_cb (GConfPropertyEditor *peditor,
|
||||
gchar *key,
|
||||
GConfValue *value,
|
||||
GladeXML *dialog)
|
||||
{
|
||||
show_handlebar (dialog, gconf_value_get_bool (value));
|
||||
}
|
||||
|
||||
static void
|
||||
toolbar_style_cb (GConfPropertyEditor *peditor,
|
||||
gchar *key,
|
||||
GConfValue *value,
|
||||
GladeXML *dialog)
|
||||
{
|
||||
set_toolbar_style (dialog, gconf_value_get_string (value));
|
||||
}
|
||||
|
||||
static void
|
||||
set_have_icons (GladeXML *dialog, gboolean value)
|
||||
{
|
||||
static char *menu_item_names[] =
|
||||
{
|
||||
"menu_item_1",
|
||||
"menu_item_2",
|
||||
"menu_item_3",
|
||||
"menu_item_4",
|
||||
"menu_item_5",
|
||||
"cut1",
|
||||
"copy1",
|
||||
"paste1",
|
||||
NULL
|
||||
};
|
||||
|
||||
char **name;
|
||||
|
||||
for (name = menu_item_names; *name != NULL; name++)
|
||||
{
|
||||
GtkImageMenuItem *item = GTK_IMAGE_MENU_ITEM (WID (*name));
|
||||
GtkWidget *image;
|
||||
if (value)
|
||||
{
|
||||
image = g_object_get_data (G_OBJECT (item), "image");
|
||||
if (image)
|
||||
{
|
||||
gtk_image_menu_item_set_image (item, image);
|
||||
g_object_unref (image);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image = gtk_image_menu_item_get_image (item);
|
||||
g_object_set_data (G_OBJECT (item), "image", image);
|
||||
g_object_ref (image);
|
||||
gtk_image_menu_item_set_image (item, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
menus_have_icons_cb (GConfPropertyEditor *peditor,
|
||||
gchar *key,
|
||||
GConfValue *value,
|
||||
GladeXML *dialog)
|
||||
{
|
||||
set_have_icons (dialog, gconf_value_get_bool (value));
|
||||
}
|
||||
|
||||
static gint
|
||||
button_press_blocker (GtkWidget *toolbar,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GObject *peditor;
|
||||
char *toolbar_style;
|
||||
GConfClient *client = gconf_client_get_default ();
|
||||
|
||||
peditor = gconf_peditor_new_boolean
|
||||
(changeset, "/desktop/gnome/interface/toolbar_detachable", WID ("detachable_toolbars_toggle"), NULL);
|
||||
g_signal_connect (peditor,
|
||||
"value_changed",
|
||||
G_CALLBACK (toolbar_detachable_cb), dialog);
|
||||
|
||||
peditor = gconf_peditor_new_boolean
|
||||
(changeset, "/desktop/gnome/interface/can_change_accels", WID ("menu_accel_toggle"), NULL);
|
||||
|
||||
peditor = gconf_peditor_new_boolean
|
||||
(changeset, "/desktop/gnome/interface/menus_have_icons", WID ("menu_icons_toggle"), NULL);
|
||||
g_signal_connect (peditor,
|
||||
"value_changed",
|
||||
G_CALLBACK (menus_have_icons_cb), dialog);
|
||||
|
||||
set_have_icons (dialog,
|
||||
gconf_client_get_bool (client,
|
||||
"/desktop/gnome/interface/menus_have_icons",
|
||||
NULL));
|
||||
|
||||
peditor = gconf_peditor_new_select_menu
|
||||
(changeset, "/desktop/gnome/interface/toolbar_style", WID ("toolbar_style_omenu"),
|
||||
"conv-to-widget-cb", toolbar_to_widget,
|
||||
"conv-from-widget-cb", toolbar_from_widget,
|
||||
NULL);
|
||||
g_signal_connect (peditor,
|
||||
"value_changed",
|
||||
G_CALLBACK (toolbar_style_cb), dialog);
|
||||
|
||||
widget = WID ("toolbar_handlebox");
|
||||
g_signal_connect (G_OBJECT (widget),
|
||||
"button_press_event",
|
||||
G_CALLBACK (button_press_blocker), NULL);
|
||||
|
||||
widget = WID ("gnome_ui_properties_dialog");
|
||||
g_signal_connect (G_OBJECT (widget),
|
||||
"response",
|
||||
G_CALLBACK (dialog_button_clicked_cb), changeset);
|
||||
|
||||
show_handlebar (dialog,
|
||||
gconf_client_get_bool (client,
|
||||
"/desktop/gnome/interface/toolbar_detachable",
|
||||
NULL));
|
||||
|
||||
toolbar_style = gconf_client_get_string (client,
|
||||
"/desktop/gnome/interface/toolbar_style",
|
||||
NULL);
|
||||
g_object_unref (client);
|
||||
|
||||
set_toolbar_style (dialog, toolbar_style);
|
||||
|
||||
g_free (toolbar_style);
|
||||
|
||||
gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
|
||||
capplet_set_icon (widget, "gnome-settings-ui-behavior");
|
||||
gtk_widget_show_all (widget);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GnomeProgram *program;
|
||||
GConfClient *client;
|
||||
GConfChangeSet *changeset = NULL;
|
||||
GladeXML *dialog;
|
||||
|
||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
|
||||
program = gnome_program_init ("gnome-ui-properties", VERSION,
|
||||
LIBGNOMEUI_MODULE, argc, argv,
|
||||
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
||||
NULL);
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
g_object_unref (client);
|
||||
dialog = create_dialog ();
|
||||
setup_dialog (dialog, changeset);
|
||||
gtk_main ();
|
||||
|
||||
g_object_unref (dialog);
|
||||
g_object_unref (program);
|
||||
return 0;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
_Name=Menus & Toolbars
|
||||
_Comment=Customize the appearance of toolbars and menubars in applications
|
||||
Exec=gnome-ui-properties
|
||||
Icon=gnome-settings-ui-behavior
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Settings;DesktopSettings;
|
||||
OnlyShowIn=GNOME;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=gnome-control-center
|
||||
X-GNOME-Bugzilla-Component=other capplets
|
||||
X-GNOME-Bugzilla-Version=@VERSION@
|
|
@ -1,709 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkDialog" id="gnome_ui_properties_dialog">
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Menu and Toolbar Preferences</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="default_width">400</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="helpbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-11</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="closebutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">2</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox2">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">18</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Behavior and Appearance</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label10">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"> </property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="menu_icons_toggle">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Show _icons in menus</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="menu_accel_toggle">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Editable menu shortcut keys</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="detachable_toolbars_toggle">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Detachable toolbars</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">12</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Toolbar _button labels:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">toolbar_style_omenu</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkOptionMenu" id="toolbar_style_omenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="history">0</property>
|
||||
|
||||
<child internal-child="menu">
|
||||
<widget class="GtkMenu" id="convertwidget1">
|
||||
<property name="visible">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="convertwidget2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Text below icons</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="convertwidget3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Text beside icons</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="convertwidget4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Icons only</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="text_only1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Text only</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_text_only1_activate" last_modification_time="Mon, 06 May 2002 07:03:54 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox5">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Preview</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"> </property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuBar" id="menubar1">
|
||||
<property name="visible">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="File Menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_File</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="File Menu_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_item_1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_New</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu_item_1_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image59">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_item_2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Open</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu_item_2_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image60">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-open</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_item_3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Save</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image61">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="separator3">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_item_4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Print</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image62">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-print</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="separator4">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_item_5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Quit</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image63">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-quit</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="edit1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Edit</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_edit1_activate" last_modification_time="Thu, 18 Jul 2002 03:49:33 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="edit1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="cut1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">C_ut</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_cut1_activate" last_modification_time="Thu, 18 Jul 2002 03:49:33 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image64">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-cut</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="copy1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Copy</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_copy1_activate" last_modification_time="Thu, 18 Jul 2002 03:49:33 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image65">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-copy</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="paste1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Paste</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_paste1_activate" last_modification_time="Thu, 18 Jul 2002 03:49:33 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image66">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-paste</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="toolbar_align">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHandleBox" id="toolbar_handlebox">
|
||||
<property name="visible">True</property>
|
||||
<property name="shadow_type">GTK_SHADOW_OUT</property>
|
||||
<property name="handle_position">GTK_POS_LEFT</property>
|
||||
<property name="snap_edge">GTK_POS_TOP</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolbar" id="toolbar_toolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
|
||||
<property name="tooltips">True</property>
|
||||
<property name="show_arrow">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="button7">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">New File</property>
|
||||
<property name="stock_id">gtk-new</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="button8">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Open File</property>
|
||||
<property name="stock_id">gtk-open</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="save_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Save File</property>
|
||||
<property name="stock_id">gtk-save</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
Before Width: | Height: | Size: 771 B |
|
@ -1,156 +0,0 @@
|
|||
/* -*- mode: c; style: linux -*- */
|
||||
|
||||
/* preferences.h
|
||||
* Copyright (C) 2000 Helix Code, Inc.
|
||||
*
|
||||
* Written by Bradford Hovinen <hovinen@helixcode.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, 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 __PREFERENCES_H
|
||||
#define __PREFERENCES_H
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#define PREFERENCES(obj) GTK_CHECK_CAST (obj, preferences_get_type (), Preferences)
|
||||
#define PREFERENCES_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, preferences_get_type (), PreferencesClass)
|
||||
#define IS_PREFERENCES(obj) GTK_CHECK_TYPE (obj, preferences_get_type ())
|
||||
|
||||
typedef struct _Preferences Preferences;
|
||||
typedef struct _PreferencesClass PreferencesClass;
|
||||
|
||||
struct _Preferences
|
||||
{
|
||||
GtkObject object;
|
||||
|
||||
gint frozen;
|
||||
guint timeout_id;
|
||||
|
||||
struct {
|
||||
enum { DEFAULT, SPREAD, EDGE, START, END } dialog_buttons_style;
|
||||
gboolean dialog_icons;
|
||||
gboolean dialog_centered;
|
||||
GtkWindowPosition dialog_position;
|
||||
GtkWindowType dialog_type;
|
||||
gboolean menus_show_icons;
|
||||
gboolean menus_have_tearoff;
|
||||
gboolean toolbar_labels;
|
||||
gboolean toolbar_detachable;
|
||||
gboolean toolbar_relief;
|
||||
gboolean toolbar_separator;
|
||||
gboolean toolbar_popup;
|
||||
gboolean menubar_detachable;
|
||||
gboolean menubar_relief;
|
||||
gboolean statusbar_meter_on_right;
|
||||
gboolean statusbar_is_interactive;
|
||||
GnomeMDIMode mdi_mode;
|
||||
GtkPositionType mdi_tab_pos;
|
||||
} gnome_prefs;
|
||||
};
|
||||
|
||||
struct _PreferencesClass
|
||||
{
|
||||
GtkObjectClass klass;
|
||||
};
|
||||
|
||||
GType preferences_get_type (void);
|
||||
|
||||
GtkObject *preferences_new (void);
|
||||
GtkObject *preferences_clone (Preferences *prefs);
|
||||
void preferences_destroy (GtkObject *object);
|
||||
|
||||
void preferences_load (Preferences *prefs);
|
||||
void preferences_save (Preferences *prefs);
|
||||
void preferences_changed (Preferences *prefs);
|
||||
void preferences_apply_now (Preferences *prefs);
|
||||
|
||||
void preferences_freeze (Preferences *prefs);
|
||||
void preferences_thaw (Preferences *prefs);
|
||||
|
||||
/* get/set functions. It's really stupid that we need these */
|
||||
|
||||
int preferences_get_menubar_detachable (Preferences *prefs);
|
||||
int preferences_get_menubar_relief (Preferences *prefs);
|
||||
int preferences_get_menus_have_tearoff (Preferences *prefs);
|
||||
int preferences_get_menus_have_icons (Preferences *prefs);
|
||||
|
||||
int preferences_get_statusbar_is_interactive (Preferences *prefs);
|
||||
int preferences_get_statusbar_meter_on_left (Preferences *prefs);
|
||||
int preferences_get_statusbar_meter_on_right (Preferences *prefs);
|
||||
|
||||
int preferences_get_toolbar_detachable (Preferences *prefs);
|
||||
int preferences_get_toolbar_relief (Preferences *prefs);
|
||||
int preferences_get_toolbar_icons_only (Preferences *prefs);
|
||||
int preferences_get_toolbar_text_below (Preferences *prefs);
|
||||
|
||||
int preferences_get_dialog_icons (Preferences *prefs);
|
||||
int preferences_get_dialog_centered (Preferences *prefs);
|
||||
|
||||
GtkWindowPosition preferences_get_dialog_position (Preferences *prefs);
|
||||
GtkWindowType preferences_get_dialog_type (Preferences *prefs);
|
||||
int preferences_get_dialog_buttons_style (Preferences *prefs);
|
||||
|
||||
GnomeMDIMode preferences_get_mdi_mode (Preferences *prefs);
|
||||
GtkPositionType preferences_get_mdi_tab_pos (Preferences *prefs);
|
||||
|
||||
#if 0
|
||||
int preferences_get_property_box_buttons_ok (Preferences *prefs);
|
||||
int preferences_get_property_box_buttons_apply (Preferences *prefs);
|
||||
int preferences_get_property_box_buttons_close (Preferences *prefs);
|
||||
int preferences_get_property_box_buttons_help (Preferences *prefs);
|
||||
int preferences_get_disable_imlib_cache (Preferences *prefs);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void preferences_set_menubar_detachable (Preferences *prefs, int i);
|
||||
void preferences_set_menubar_relief (Preferences *prefs, int i);
|
||||
void preferences_set_menus_have_tearoff (Preferences *prefs, int i);
|
||||
void preferences_set_menus_have_icons (Preferences *prefs, int i);
|
||||
|
||||
void preferences_set_statusbar_is_interactive (Preferences *prefs, int i);
|
||||
void preferences_set_statusbar_meter_on_left (Preferences *prefs, int i);
|
||||
void preferences_set_statusbar_meter_on_right (Preferences *prefs, int i);
|
||||
|
||||
void preferences_set_toolbar_detachable (Preferences *prefs, int i);
|
||||
void preferences_set_toolbar_relief (Preferences *prefs, int i);
|
||||
void preferences_set_toolbar_icons_only (Preferences *prefs, int i);
|
||||
void preferences_set_toolbar_text_below (Preferences *prefs, int i);
|
||||
|
||||
void preferences_set_dialog_icons (Preferences *prefs, int i);
|
||||
void preferences_set_dialog_centered (Preferences *prefs, int i);
|
||||
|
||||
void preferences_set_dialog_position (Preferences *prefs, int i);
|
||||
void preferences_set_dialog_type (Preferences *prefs, int i);
|
||||
void preferences_set_dialog_buttons_style (Preferences *prefs, int i);
|
||||
|
||||
void preferences_set_mdi_mode (Preferences *prefs, int i);
|
||||
void preferences_set_mdi_tab_pos (Preferences *prefs, int i);
|
||||
|
||||
#if 0
|
||||
void preferences_set_property_box_buttons_ok (Preferences *prefs, int i);
|
||||
void preferences_set_property_box_buttons_apply (Preferences *prefs, int i);
|
||||
void preferences_set_property_box_buttons_close (Preferences *prefs, int i);
|
||||
void preferences_set_property_box_buttons_help (Preferences *prefs, int i);
|
||||
void preferences_set_disable_imlib_cache (Preferences *prefs, int i);
|
||||
#endif
|
||||
|
||||
#endif /* __PREFERENCES_H */
|