Added font capplet.
2002-02-10 Richard Hestilow <hestilow@ximian.com> * Added font capplet.
This commit is contained in:
parent
94370f5702
commit
c6e987d38b
10 changed files with 176 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2002-02-10 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* Added font capplet.
|
||||
|
||||
2002-02-07 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Added "ko" back, after converting
|
||||
|
|
|
@ -2,6 +2,6 @@ always_built_SUBDIRS = \
|
|||
common default-applications desktop-links \
|
||||
background keyboard mouse sound \
|
||||
file-types theme-switcher ui-properties \
|
||||
screensaver
|
||||
screensaver font
|
||||
|
||||
SUBDIRS = $(always_built_SUBDIRS)
|
||||
|
|
6
capplets/font/.cvsignore
Normal file
6
capplets/font/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
gnome2-font-properties
|
||||
font-properties.desktop
|
19
capplets/font/Makefile.am
Normal file
19
capplets/font/Makefile.am
Normal file
|
@ -0,0 +1,19 @@
|
|||
bin_PROGRAMS = gnome2-font-properties
|
||||
|
||||
gnome2_font_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS)
|
||||
gnome2_font_properties_SOURCES = \
|
||||
main.c
|
||||
gnome2_font_properties_LDFLAGS = -export-dynamic
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
desktopdir = $(GNOMECC_DESKTOP_DIR)
|
||||
Desktop_in_files = font-properties.desktop.in
|
||||
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
gladedir = $(GNOMECC_GLADE_DIR)
|
||||
glade_DATA = font-properties.glade
|
||||
|
||||
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS)
|
||||
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
|
||||
EXTRA_DIST = $(Desktop_in_files) $(glade_DATA)
|
8
capplets/font/font-properties.desktop.in
Normal file
8
capplets/font/font-properties.desktop.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
_Name=Font
|
||||
_Comment=Select which font to use
|
||||
Exec=gnome2-font-properties
|
||||
Icon=gnome-fontsel.png
|
||||
Terminal=0
|
||||
Type=Application
|
||||
Categories=Application;Settings;
|
62
capplets/font/font-properties.glade
Normal file
62
capplets/font/font-properties.glade
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "../glade-2.0.dtd" >
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="window1">
|
||||
<property name="title" translatable="yes">Font properties</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="destroy" handler="gtk_main_quit" />
|
||||
<signal name="response" handler="response_cb" />
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="custom_check">
|
||||
<property name="label" translatable="yes">Use a custom font.</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GnomeFontPicker" id="font_picker">
|
||||
<property name="mode">font-info</property>
|
||||
<property name="use-font-in-label">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="buttonbox1">
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<property name="label">gtk-apply</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="use_underline">yes</property>
|
||||
<property name="response_id">1</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button2">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="use_underline">yes</property>
|
||||
<property name="response_id">2</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
69
capplets/font/main.c
Normal file
69
capplets/font/main.c
Normal file
|
@ -0,0 +1,69 @@
|
|||
#include <gnome.h>
|
||||
#include <glade/glade.h>
|
||||
#include <config.h>
|
||||
|
||||
#include "gconf-property-editor.h"
|
||||
|
||||
static GladeXML *xml;
|
||||
static GConfChangeSet *changeset;
|
||||
|
||||
|
||||
#define WID(w) (glade_xml_get_widget (xml, (w)))
|
||||
|
||||
enum
|
||||
{
|
||||
RESPONSE_APPLY = 1,
|
||||
RESPONSE_CLOSE
|
||||
};
|
||||
|
||||
void
|
||||
response_cb (GtkDialog *dialog, gint r, gpointer data)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case RESPONSE_APPLY:
|
||||
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
|
||||
|
||||
/* We may want to revert to the default schema-ed value */
|
||||
if (!gconf_client_get_bool (gconf_client_get_default (), "/desktop/gnome/interface/use_custom_font", NULL))
|
||||
{
|
||||
g_print ("Unsetting\n");
|
||||
gconf_client_unset (gconf_client_get_default (), "/desktop/gnome/interface/font_name", NULL);
|
||||
}
|
||||
|
||||
break;
|
||||
case RESPONSE_CLOSE:
|
||||
gtk_main_quit ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dialog (void)
|
||||
{
|
||||
GObject *peditor;
|
||||
|
||||
peditor = gconf_peditor_new_boolean (changeset, "/desktop/gnome/interface/use_custom_font", WID ("custom_check"), NULL);
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("font_picker"));
|
||||
peditor = gconf_peditor_new_font (changeset, "/desktop/gnome/interface/font_name", WID ("font_picker"), NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gnome_program_init ("gnome2-font-properties", VERSION,
|
||||
LIBGNOMEUI_MODULE, argc, argv, NULL);
|
||||
|
||||
xml = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/font-properties.glade", NULL, NULL);
|
||||
|
||||
changeset = gconf_change_set_new ();
|
||||
setup_dialog ();
|
||||
|
||||
glade_xml_signal_autoconnect (xml);
|
||||
gtk_main ();
|
||||
|
||||
gconf_change_set_unref (changeset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -169,6 +169,7 @@ capplets/desktop-links/Makefile
|
|||
capplets/desktop-links/Sawfish/Makefile
|
||||
capplets/file-types/Makefile
|
||||
capplets/file-types/libuuid/Makefile
|
||||
capplets/font/Makefile
|
||||
capplets/keyboard/Makefile
|
||||
capplets/mouse/Makefile
|
||||
capplets/screensaver/Makefile
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2002-02-10 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* gnome-settings-xsettings.c: Added font setting.
|
||||
|
||||
2002-02-04 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* gnome-settings-locate-pointer.c (locate_pointer_expose): Return
|
||||
|
|
|
@ -58,6 +58,8 @@ static TranslationEntry translations [] = {
|
|||
translate_string_string },
|
||||
{ "/desktop/gnome/interface/gtk_theme", "Net/ThemeName", GCONF_VALUE_STRING,
|
||||
translate_string_string },
|
||||
{ "/desktop/gnome/interface/font_name", "Gtk/FontName", GCONF_VALUE_STRING,
|
||||
translate_string_string }
|
||||
};
|
||||
|
||||
static TranslationEntry*
|
||||
|
|
Loading…
Add table
Reference in a new issue