Committed instant-apply patch sans background.
2002-02-11 Richard Hestilow <hestilow@ximian.com> * Committed instant-apply patch sans background.
This commit is contained in:
parent
95d4480dc2
commit
31ac49063f
20 changed files with 268 additions and 261 deletions
|
@ -1,3 +1,7 @@
|
|||
2002-02-11 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* Committed instant-apply patch sans background.
|
||||
|
||||
2002-02-11 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* control-center/Makefile.am: Move splashdir to gnomecc-2.
|
||||
|
|
|
@ -409,6 +409,7 @@ peditor_string_value_changed (GConfClient *client,
|
|||
GConfPropertyEditor *peditor)
|
||||
{
|
||||
GConfValue *value, *value_wid;
|
||||
const char *entry_current_text;
|
||||
|
||||
if (peditor->p->changeset != NULL)
|
||||
gconf_change_set_remove (peditor->p->changeset, peditor->p->key);
|
||||
|
@ -417,7 +418,10 @@ peditor_string_value_changed (GConfClient *client,
|
|||
|
||||
if (value != NULL) {
|
||||
value_wid = peditor->p->conv_to_widget_cb (value);
|
||||
gtk_entry_set_text (GTK_ENTRY (peditor->p->ui_control), gconf_value_get_string (value));
|
||||
entry_current_text = gtk_entry_get_text (GTK_ENTRY (peditor->p->ui_control));
|
||||
if (strcmp (entry_current_text, gconf_value_get_string (value)) != 0) {
|
||||
gtk_entry_set_text (GTK_ENTRY (peditor->p->ui_control), gconf_value_get_string (value_wid));
|
||||
}
|
||||
gconf_value_free (value_wid);
|
||||
}
|
||||
}
|
||||
|
@ -426,13 +430,17 @@ static void
|
|||
peditor_string_widget_changed (GConfPropertyEditor *peditor,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
GConfValue *value, *value_wid;
|
||||
|
||||
GConfValue *value, *value_wid;
|
||||
|
||||
if (!peditor->p->inited) return;
|
||||
|
||||
value_wid = gconf_value_new (GCONF_VALUE_STRING);
|
||||
|
||||
gconf_value_set_string (value_wid, gtk_entry_get_text (entry));
|
||||
value = peditor->p->conv_from_widget_cb (value_wid);
|
||||
|
||||
peditor_set_gconf_value (peditor, peditor->p->key, value);
|
||||
|
||||
g_signal_emit (peditor, peditor_signals[VALUE_CHANGED], 0, peditor->p->key, value);
|
||||
gconf_value_free (value_wid);
|
||||
gconf_value_free (value);
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
2002-02-11 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-default-applications-properties-structs.c:
|
||||
* gnome-default-applications-properties.c: (read_editor),
|
||||
(setup_peditors), (read_browser), (browser_setup_custom),
|
||||
(value_changed_cb), (dialog_response), (create_dialog):
|
||||
* gnome-default-applications-properties.glade:
|
||||
|
||||
Convert to instant apply, change to using property editors
|
||||
where convenient.
|
||||
|
||||
2002-02-10 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* Convert to apply/close, and commit a UI string
|
||||
|
|
|
@ -66,8 +66,9 @@ BrowserDescription possible_browsers[] =
|
|||
|
||||
HelpViewDescription possible_help_viewers[] =
|
||||
{
|
||||
{ "Gnome Help Browser", "yelp", FALSE, TRUE, FALSE },
|
||||
{ "Nautilus", "nautilus", FALSE, TRUE, FALSE }
|
||||
{ "Yelp Gnome Help Browser", "yelp", FALSE, TRUE, FALSE },
|
||||
{ "Gnome Help Browser", "gnome-help", FALSE, TRUE, FALSE },
|
||||
{ "Nautilus", "nautilus", FALSE, TRUE, FALSE }
|
||||
};
|
||||
|
||||
TerminalDescription possible_terminals[] =
|
||||
|
|
|
@ -117,10 +117,6 @@ read_editor (GConfClient *client,
|
|||
return;
|
||||
}
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_terminal_toggle")), needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_line_toggle")), accepts_lineno);
|
||||
gtk_entry_set_text (GTK_ENTRY (WID ("text_custom_command_entry")), editor);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (possible_editors); i++ ) {
|
||||
if (possible_editors[i].in_path == FALSE)
|
||||
continue;
|
||||
|
@ -141,21 +137,6 @@ read_editor (GConfClient *client,
|
|||
g_free (editor);
|
||||
}
|
||||
|
||||
static void
|
||||
write_editor (GladeXML *dialog)
|
||||
{
|
||||
const gchar *command = gtk_entry_get_text (GTK_ENTRY (WID ("text_custom_command_entry")));
|
||||
gboolean needs_term = GTK_TOGGLE_BUTTON (WID ("text_custom_terminal_toggle"))->active;
|
||||
gboolean accepts_lineno = GTK_TOGGLE_BUTTON (WID ("text_custom_line_toggle"))->active;
|
||||
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/editor/needs_term",
|
||||
needs_term, NULL);
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/editor/accepts_lineno",
|
||||
accepts_lineno, NULL);
|
||||
gconf_client_set_string (client, "/desktop/gnome/applications/editor/exec",
|
||||
command, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
text_setup_custom (GtkWidget *entry,
|
||||
GladeXML *dialog)
|
||||
|
@ -177,6 +158,39 @@ text_setup_custom (GtkWidget *entry,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
setup_peditors (GConfClient *client,
|
||||
GladeXML *dialog)
|
||||
{
|
||||
GConfChangeSet *changeset = NULL;
|
||||
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/editor/needs_term",
|
||||
WID ("text_custom_terminal_toggle"), NULL);
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/accepts_lineo",
|
||||
WID ("text_custom_line_toggle"), NULL);
|
||||
gconf_peditor_new_string (changeset, "/desktop/gnome/applications/editor/exec",
|
||||
WID ("text_custom_command_entry"), NULL);
|
||||
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/browser/needs_term",
|
||||
WID ("web_custom_terminal_toggle"), NULL);
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/browser/nremote",
|
||||
WID ("web_custom_remote_toggle"), NULL);
|
||||
gconf_peditor_new_string (changeset, "/desktop/gnome/applications/browser/exec",
|
||||
WID ("web_custom_command_entry"), NULL);
|
||||
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/help_viewer/needs_term",
|
||||
WID ("help_custom_terminal_toggle"), NULL);
|
||||
gconf_peditor_new_boolean (changeset, "/desktop/gnome/applications/help_viewer/accepts_lineno",
|
||||
WID ("help_custom_url_toggle"), NULL);
|
||||
gconf_peditor_new_string (changeset, "/desktop/gnome/applications/help_viewer/exec",
|
||||
WID ("help_custom_command_entry"), NULL);
|
||||
|
||||
gconf_peditor_new_string (changeset, "/desktop/gnome/applications/terminal/exec",
|
||||
WID ("terminal_custom_command_entry"), NULL);
|
||||
gconf_peditor_new_string (changeset, "/desktop/gnome/applications/terminal/exec_arg",
|
||||
WID ("terminal_custom_exec_entry"), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
read_browser (GConfClient *client,
|
||||
GladeXML *dialog)
|
||||
|
@ -201,10 +215,6 @@ read_browser (GConfClient *client,
|
|||
return;
|
||||
}
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("web_custom_terminal_toggle")), needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("web_custom_remote_toggle")), nremote);
|
||||
gtk_entry_set_text (GTK_ENTRY (WID ("web_custom_command_entry")), browser);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) {
|
||||
if (possible_browsers[i].in_path == FALSE)
|
||||
continue;
|
||||
|
@ -227,17 +237,6 @@ read_browser (GConfClient *client,
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
write_browser (GladeXML *dialog)
|
||||
{
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/browser/needs_term",
|
||||
GTK_TOGGLE_BUTTON (WID ("web_custom_terminal_toggle"))->active, NULL);
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/browser/nremote",
|
||||
GTK_TOGGLE_BUTTON (WID ("web_custom_remote_toggle"))->active, NULL);
|
||||
gconf_client_set_string (client, "/desktop/gnome/applications/browser/exec",
|
||||
gtk_entry_get_text (GTK_ENTRY (WID ("web_custom_command_entry"))), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
browser_setup_custom (GtkWidget *entry,
|
||||
GladeXML *dialog)
|
||||
|
@ -247,7 +246,7 @@ browser_setup_custom (GtkWidget *entry,
|
|||
|
||||
for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) {
|
||||
if (! strcmp (_(possible_browsers[i].name), browser)) {
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("web_custom_terminal_toggle")),
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("web_custom_terminal_toggle")),
|
||||
possible_browsers[i].needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("web_custom_remote_toggle")),
|
||||
possible_browsers[i].nremote);
|
||||
|
@ -307,17 +306,6 @@ read_help_viewer (GConfClient *client,
|
|||
g_free (help_viewer);
|
||||
}
|
||||
|
||||
static void
|
||||
write_help_viewer (GladeXML *dialog)
|
||||
{
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/help_viewer/needs_term",
|
||||
GTK_TOGGLE_BUTTON (WID ("help_custom_terminal_toggle"))->active, NULL);
|
||||
gconf_client_set_bool (client, "/desktop/gnome/applications/help_viewer/accepts_lineno",
|
||||
GTK_TOGGLE_BUTTON (WID ("help_custom_url_toggle"))->active, NULL);
|
||||
gconf_client_set_string (client, "/desktop/gnome/applications/help_viewer/exec",
|
||||
gtk_entry_get_text (GTK_ENTRY (WID ("help_custom_command_entry"))), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
help_setup_custom (GtkWidget *entry,
|
||||
GladeXML *dialog)
|
||||
|
@ -379,15 +367,6 @@ read_terminal (GConfClient *client,
|
|||
g_free (exec_arg);
|
||||
}
|
||||
|
||||
static void
|
||||
write_terminal (GladeXML *dialog)
|
||||
{
|
||||
gconf_client_set_string (client, "/desktop/gnome/applications/terminal/exec",
|
||||
gtk_entry_get_text (GTK_ENTRY (WID ("terminal_custom_command_entry"))), NULL);
|
||||
gconf_client_set_string (client, "/desktop/gnome/applications/terminal/exec_arg",
|
||||
gtk_entry_get_text (GTK_ENTRY (WID ("terminal_custom_exec_entry"))), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_setup_custom (GtkWidget *entry,
|
||||
GladeXML *dialog)
|
||||
|
@ -413,13 +392,9 @@ value_changed_cb (GConfClient *client,
|
|||
g_return_if_fail (key != NULL);
|
||||
|
||||
if (strncmp (key, "/desktop/gnome/applications/editor", strlen ("/desktop/gnome/applications/editor")) == 0) {
|
||||
read_editor (client, dialog);
|
||||
} else if (strncmp (key, "/desktop/gnome/applications/browser", strlen ("/desktop/gnome/applications/browser")) == 0) {
|
||||
read_browser (client, dialog);
|
||||
} else if (strncmp (key, "/desktop/gnome/applications/browser/exec", strlen ("/desktop/gnome/applications/browser/exec")) == 0) {
|
||||
} else if (strncmp (key, "/desktop/gnome/applications/help_viewer", strlen ("/desktop/gnome/applications/help_viewer")) == 0) {
|
||||
read_help_viewer (client, dialog);
|
||||
} else if (strncmp (key, "/desktop/gnome/applications/terminal", strlen ("/desktop/gnome/applications/terminal")) == 0) {
|
||||
read_terminal (client, dialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -431,11 +406,6 @@ dialog_response (GtkDialog *widget,
|
|||
|
||||
switch (response_id) {
|
||||
case 1: /* Apply */
|
||||
write_editor (dialog);
|
||||
write_browser (dialog);
|
||||
write_help_viewer (dialog);
|
||||
write_terminal (dialog);
|
||||
|
||||
break;
|
||||
case 2: /* Close */
|
||||
case -4: /* keyboard esc or WM close */
|
||||
|
@ -447,7 +417,6 @@ dialog_response (GtkDialog *widget,
|
|||
}
|
||||
|
||||
|
||||
|
||||
static GladeXML *
|
||||
create_dialog (GConfClient *client)
|
||||
{
|
||||
|
@ -515,6 +484,7 @@ create_dialog (GConfClient *client)
|
|||
g_signal_connect (G_OBJECT (WID ("web_custom_radio")),
|
||||
"toggled", (GCallback) generic_guard,
|
||||
WID ("web_custom_vbox"));
|
||||
setup_peditors (client, dialog);
|
||||
read_browser (client, dialog);
|
||||
|
||||
/* Help page */
|
||||
|
|
|
@ -23,18 +23,6 @@
|
|||
<property name="spacing">8</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button4">
|
||||
<property name="can_default">yes</property>
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="label" translatable="yes">gtk-apply</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="response_id">1</property>
|
||||
<property name="use_underline">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button5">
|
||||
<property name="can_default">yes</property>
|
||||
|
|
|
@ -84,6 +84,7 @@ rate_from_widget (GConfValue *value)
|
|||
|
||||
new_value = gconf_value_new (GCONF_VALUE_INT);
|
||||
gconf_value_set_int (new_value, rates[gconf_value_get_int (value)]);
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
|
@ -156,6 +157,31 @@ bell_to_widget (GConfValue *value)
|
|||
return new_value;
|
||||
}
|
||||
|
||||
|
||||
static GConfValue *
|
||||
blink_from_widget (GConfValue *value)
|
||||
{
|
||||
GConfValue *new_value;
|
||||
|
||||
new_value = gconf_value_new (GCONF_VALUE_INT);
|
||||
gconf_value_set_int (new_value, 2600 - (int) gconf_value_get_float (value));
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
static GConfValue *
|
||||
blink_to_widget (GConfValue *value)
|
||||
{
|
||||
GConfValue *new_value;
|
||||
gint current_rate;
|
||||
|
||||
current_rate = gconf_value_get_int (value);
|
||||
new_value = gconf_value_new (GCONF_VALUE_FLOAT);
|
||||
gconf_value_set_float (new_value, CLAMP (2600 - current_rate, 100, 2500));
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
static void
|
||||
bell_guard (GtkWidget *toggle,
|
||||
GladeXML *dialog)
|
||||
|
@ -181,9 +207,6 @@ dialog_response (GtkWidget *widget,
|
|||
{
|
||||
switch (response_id)
|
||||
{
|
||||
case RESPONSE_APPLY:
|
||||
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
|
||||
break;
|
||||
case RESPONSE_CLOSE:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
default:
|
||||
|
@ -220,13 +243,13 @@ setup_dialog (GladeXML *dialog,
|
|||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("repeat_table"));
|
||||
|
||||
gconf_peditor_new_select_menu
|
||||
(changeset, "/gnome/desktop/peripherals/keyboard/delay", WID ("repeat_delay_omenu"),
|
||||
(changeset, "/desktop/gnome/peripherals/keyboard/delay", WID ("repeat_delay_omenu"),
|
||||
"conv-to-widget-cb", delay_to_widget,
|
||||
"conv-from-widget-cb", delay_from_widget,
|
||||
NULL);
|
||||
|
||||
gconf_peditor_new_select_menu
|
||||
(changeset, "/gnome/desktop/peripherals/keyboard/rate", WID ("repeat_speed_omenu"),
|
||||
(changeset, "/desktop/gnome/peripherals/keyboard/rate", WID ("repeat_speed_omenu"),
|
||||
"conv-to-widget-cb", rate_to_widget,
|
||||
"conv-from-widget-cb", rate_from_widget,
|
||||
NULL);
|
||||
|
@ -235,14 +258,17 @@ setup_dialog (GladeXML *dialog,
|
|||
(changeset, "/desktop/gnome/interface/cursor_blink", WID ("cursor_toggle"), NULL);
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("cursor_hbox"));
|
||||
gconf_peditor_new_numeric_range
|
||||
(changeset, "/desktop/gnome/interface/cursor_blink_time", WID ("cursor_blink_time_scale"), NULL);
|
||||
(changeset, "/desktop/gnome/interface/cursor_blink_time", WID ("cursor_blink_time_scale"),
|
||||
"conv-to-widget-cb", blink_to_widget,
|
||||
"conv-from-widget-cb", blink_from_widget,
|
||||
NULL);
|
||||
|
||||
|
||||
peditor = gconf_peditor_new_boolean
|
||||
(changeset, "/desktop/gnome/peripherals/keyboard/click", WID ("volume_toggle"), NULL);
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("volume_hbox"));
|
||||
gconf_peditor_new_numeric_range
|
||||
(changeset, "/desktop/gnome/peripherals/keyboard/clickvolume", WID ("volume_scale"), NULL);
|
||||
(changeset, "/desktop/gnome/peripherals/keyboard/click_volume", WID ("volume_scale"), NULL);
|
||||
|
||||
g_signal_connect (G_OBJECT (WID ("bell_custom_radio")), "toggled", (GCallback) bell_guard, dialog);
|
||||
peditor = gconf_peditor_new_select_radio
|
||||
|
@ -310,13 +336,12 @@ main (int argc, char **argv)
|
|||
if (get_legacy) {
|
||||
get_legacy_settings ();
|
||||
} else {
|
||||
changeset = gconf_change_set_new ();
|
||||
changeset = NULL;
|
||||
dialog = create_dialog ();
|
||||
setup_dialog (dialog, changeset);
|
||||
|
||||
gtk_widget_show_all (WID ("keyboard_dialog"));
|
||||
gtk_main ();
|
||||
gconf_change_set_unref (changeset);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -24,19 +24,6 @@
|
|||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<property name="spacing">8</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<property name="can_default">yes</property>
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="label" translatable="yes">gtk-apply</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="response_id">1</property>
|
||||
<property name="use_underline">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button3">
|
||||
<property name="can_default">yes</property>
|
||||
|
@ -519,7 +506,8 @@
|
|||
<property name="value_pos">GTK_POS_TOP</property>
|
||||
<property name="digits">1</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">100 100 2500 200 200 200</property>
|
||||
<property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property>
|
||||
<property name="adjustment">1000 100 2500 200 200 0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -741,9 +729,10 @@
|
|||
<property name="can_focus">yes</property>
|
||||
<property name="draw_value">no</property>
|
||||
<property name="value_pos">GTK_POS_TOP</property>
|
||||
<property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property>
|
||||
<property name="digits">1</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">0 -100 100 20 20 20</property>
|
||||
<property name="adjustment">0 -100 100 20 20 0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -421,8 +421,10 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
|
|||
NULL);
|
||||
|
||||
gconf_peditor_new_numeric_range
|
||||
(changeset, "/desktop/gnome/peripherals/mouse/motion_threshold",
|
||||
WID ("sensitivity_scale"), NULL);
|
||||
(changeset, "/desktop/gnome/peripherals/mouse/motion_threshold", WID ("sensitivity_scale"),
|
||||
"conv-to-widget-cb", threshold_from_gconf,
|
||||
"conv-from-widget-cb", gconf_value_float_to_int,
|
||||
NULL);
|
||||
|
||||
/* DnD threshold */
|
||||
gconf_peditor_new_numeric_range
|
||||
|
@ -470,11 +472,8 @@ static void
|
|||
dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset)
|
||||
{
|
||||
switch (response_id) {
|
||||
case GTK_RESPONSE_APPLY:
|
||||
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
|
||||
break;
|
||||
|
||||
case GTK_RESPONSE_CLOSE:
|
||||
default:
|
||||
gtk_main_quit ();
|
||||
break;
|
||||
}
|
||||
|
@ -510,14 +509,13 @@ main (int argc, char **argv)
|
|||
if (get_legacy) {
|
||||
get_legacy_settings ();
|
||||
} else {
|
||||
changeset = gconf_change_set_new ();
|
||||
changeset = NULL;
|
||||
dialog = create_dialog ();
|
||||
load_pixbufs ();
|
||||
setup_dialog (dialog, changeset);
|
||||
|
||||
dialog_win = gtk_dialog_new_with_buttons
|
||||
(_("Mouse Properties"), NULL, -1,
|
||||
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
NULL);
|
||||
|
||||
|
@ -526,7 +524,6 @@ main (int argc, char **argv)
|
|||
gtk_widget_show_all (dialog_win);
|
||||
|
||||
gtk_main ();
|
||||
gconf_change_set_unref (changeset);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
<property name="digits">1</property>
|
||||
<property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">0.4 0.1 1.1 0.1 0.1 0.1</property>
|
||||
<property name="adjustment">0.4 0.1 1.0 0.1 0.1 0.0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -585,7 +585,7 @@
|
|||
<property name="value_pos">GTK_POS_TOP</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">1 1 10 1 1 1</property>
|
||||
<property name="adjustment">1 1 10 1 1 0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
|
@ -607,7 +607,7 @@
|
|||
<property name="value_pos">GTK_POS_RIGHT</property>
|
||||
<property name="digits">1</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="adjustment">1 1 10 1 1 1</property>
|
||||
<property name="adjustment">1 1 10 1 1 0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
|
@ -770,7 +770,7 @@
|
|||
<property name="digits">0</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property>
|
||||
<property name="adjustment">1 1 10 1 1 1</property>
|
||||
<property name="adjustment">1 1 10 1 1 0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2002-02-11 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* sound-properties-capplet.c: (setup_dialog),
|
||||
(dialog_button_clicked_cb), (main):
|
||||
|
||||
Convert to instant apply.
|
||||
|
||||
2002-02-04 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* sound-properties-capplet.c (create_dialog): Use g_object_set_data,
|
||||
|
|
|
@ -83,10 +83,10 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
|
|||
{
|
||||
GObject *peditor;
|
||||
|
||||
peditor = gconf_peditor_new_boolean (changeset, "/desktop/gnome/sound/enable_esd", WID ("enable_toggle"), NULL);
|
||||
peditor = gconf_peditor_new_boolean (NULL, "/desktop/gnome/sound/enable_esd", WID ("enable_toggle"), NULL);
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_toggle"));
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_vbox"));
|
||||
peditor = gconf_peditor_new_boolean (changeset, "/desktop/gnome/sound/event_sounds", WID ("events_toggle"), NULL);
|
||||
peditor = gconf_peditor_new_boolean (NULL, "/desktop/gnome/sound/event_sounds", WID ("events_toggle"), NULL);
|
||||
}
|
||||
|
||||
/* get_legacy_settings
|
||||
|
@ -114,10 +114,6 @@ static void
|
|||
dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset)
|
||||
{
|
||||
switch (response_id) {
|
||||
case GTK_RESPONSE_APPLY:
|
||||
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
|
||||
break;
|
||||
|
||||
case GTK_RESPONSE_CLOSE:
|
||||
gtk_main_quit ();
|
||||
break;
|
||||
|
@ -169,7 +165,6 @@ main (int argc, char **argv)
|
|||
|
||||
dialog_win = gtk_dialog_new_with_buttons
|
||||
(_("Sound properties"), NULL, -1,
|
||||
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
NULL);
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2002-02-11 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gtk-theme-selector.glade:
|
||||
* main.c: (call_apply), (response_cb), (main):
|
||||
|
||||
Convert to instant apply.
|
||||
|
||||
2002-02-04 Lauris Kaplinski <lauris@ximian.com>
|
||||
|
||||
* main.c (themes_list_refresh): Use g_path_get_basename
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
<widget class="GtkTreeView" id="tree1">
|
||||
<property name="headers_visible">no</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<signal name="cursor_changed" handler="call_apply" />
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -116,17 +118,8 @@
|
|||
|
||||
<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">
|
||||
<widget class="GtkButton" id="button1">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="use_underline">yes</property>
|
||||
|
|
|
@ -138,14 +138,18 @@ apply_cb (void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
call_apply (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
apply_cb ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
response_cb (GtkDialog *dialog, gint r, gpointer data)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case RESPONSE_APPLY:
|
||||
apply_cb ();
|
||||
break;
|
||||
case RESPONSE_CLOSE:
|
||||
gtk_main_quit ();
|
||||
break;
|
||||
|
@ -244,7 +248,7 @@ main (int argc, char **argv)
|
|||
|
||||
xml = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gtk-theme-selector.glade", NULL, NULL);
|
||||
setup_list ();
|
||||
|
||||
|
||||
auto_preview = gconf_client_get_bool (gconf_client_get_default (), "/apps/gtk-theme-selector/auto", NULL);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "check1")), auto_preview);
|
||||
|
||||
|
|
|
@ -75,9 +75,6 @@ dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *c
|
|||
{
|
||||
switch (response_id)
|
||||
{
|
||||
case RESPONSE_APPLY:
|
||||
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
|
||||
break;
|
||||
case RESPONSE_CLOSE:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
default:
|
||||
|
@ -125,7 +122,7 @@ int
|
|||
main (int argc, char **argv)
|
||||
{
|
||||
GConfClient *client;
|
||||
GConfChangeSet *changeset;
|
||||
GConfChangeSet *changeset = NULL;
|
||||
GladeXML *dialog;
|
||||
|
||||
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
||||
|
@ -137,7 +134,6 @@ main (int argc, char **argv)
|
|||
NULL);
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
changeset = gconf_change_set_new ();
|
||||
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
dialog = create_dialog ();
|
||||
|
@ -145,7 +141,5 @@ main (int argc, char **argv)
|
|||
|
||||
gtk_main ();
|
||||
|
||||
gconf_change_set_unref (changeset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -23,18 +23,6 @@
|
|||
<property name="spacing">8</property>
|
||||
<property name="visible">yes</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button10">
|
||||
<property name="can_default">yes</property>
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
<property name="label" translatable="yes">gtk-apply</property>
|
||||
<property name="use_stock">yes</property>
|
||||
<property name="response_id">1</property>
|
||||
<property name="use_underline">yes</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button12">
|
||||
<property name="can_default">yes</property>
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
|
||||
#include "applier.h"
|
||||
|
||||
#define MONITOR_CONTENTS_X 20
|
||||
#define MONITOR_CONTENTS_Y 10
|
||||
#define MONITOR_CONTENTS_WIDTH 157
|
||||
#define MONITOR_CONTENTS_HEIGHT 111
|
||||
#define MONITOR_CONTENTS_X 0
|
||||
#define MONITOR_CONTENTS_Y 0
|
||||
#define MONITOR_CONTENTS_WIDTH 51
|
||||
#define MONITOR_CONTENTS_HEIGHT 38
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
@ -390,21 +390,27 @@ bg_applier_apply_prefs (BGApplier *bg_applier,
|
|||
bg_applier->p->wallpaper_pixbuf = NULL;
|
||||
|
||||
if (new_prefs->wallpaper_enabled) {
|
||||
g_return_if_fail (new_prefs->wallpaper_filename != NULL);
|
||||
if (new_prefs->wallpaper_filename == NULL) {
|
||||
new_prefs->wallpaper_enabled = FALSE;
|
||||
} else {
|
||||
g_return_if_fail (new_prefs->wallpaper_filename != NULL);
|
||||
|
||||
bg_applier->p->wallpaper_pixbuf =
|
||||
gdk_pixbuf_new_from_file (new_prefs->wallpaper_filename, NULL);
|
||||
bg_applier->p->wallpaper_pixbuf =
|
||||
gdk_pixbuf_new_from_file (new_prefs->wallpaper_filename, NULL);
|
||||
|
||||
if (bg_applier->p->wallpaper_pixbuf == NULL) {
|
||||
g_warning (_("Could not load pixbuf \"%s\"; disabling wallpaper."),
|
||||
new_prefs->wallpaper_filename);
|
||||
new_prefs->wallpaper_enabled = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bg_applier->p->timeout)
|
||||
if (bg_applier->p->wallpaper_pixbuf == NULL) {
|
||||
g_warning (_("Could not load pixbuf \"%s\"; disabling wallpaper."),
|
||||
new_prefs->wallpaper_filename);
|
||||
new_prefs->wallpaper_enabled = FALSE;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bg_applier->p->timeout)
|
||||
g_source_remove (bg_applier->p->timeout);
|
||||
bg_applier->p->timeout = g_timeout_add (30000, (GSourceFunc) cleanup_cb, bg_applier);
|
||||
bg_applier->p->timeout = g_timeout_add (30000, (GSourceFunc) cleanup_cb, bg_applier);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -437,68 +443,15 @@ bg_applier_render_color_p (const BGApplier *bg_applier, const BGPreferences *pre
|
|||
GtkWidget *
|
||||
bg_applier_get_preview_widget (BGApplier *bg_applier)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixmap *pixmap;
|
||||
GdkBitmap *mask;
|
||||
GdkVisual *visual;
|
||||
GdkColormap *colormap;
|
||||
gchar *filename;
|
||||
GdkGC *gc;
|
||||
if (bg_applier->p->preview_widget == NULL) {
|
||||
GdkPixmap *pixmap;
|
||||
|
||||
g_return_val_if_fail (bg_applier != NULL, NULL);
|
||||
g_return_val_if_fail (IS_BG_APPLIER (bg_applier), NULL);
|
||||
/* fixme: What to do here? gdk does not export root_parent publicly (Lauris) */
|
||||
pixmap = gdk_pixmap_new (GDK_ROOT_PARENT(), 51, 38, -1);
|
||||
bg_applier->p->preview_widget = gtk_image_new_from_pixmap (pixmap, NULL);
|
||||
}
|
||||
|
||||
if (bg_applier->p->type != BG_APPLIER_PREVIEW)
|
||||
return NULL;
|
||||
|
||||
if (bg_applier->p->preview_widget != NULL)
|
||||
return bg_applier->p->preview_widget;
|
||||
|
||||
filename = gnome_pixmap_file ("monitor.png");
|
||||
visual = gdk_window_get_visual (GDK_ROOT_PARENT ());
|
||||
colormap = gdk_window_get_colormap (GDK_ROOT_PARENT ());
|
||||
|
||||
gtk_widget_push_visual (visual);
|
||||
gtk_widget_push_colormap (colormap);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
|
||||
if (pixbuf == NULL) return NULL;
|
||||
|
||||
pixmap = gdk_pixmap_new (GDK_ROOT_PARENT (),
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf),
|
||||
visual->depth);
|
||||
mask = gdk_pixmap_new (GDK_ROOT_PARENT (),
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf),
|
||||
1);
|
||||
|
||||
gc = gdk_gc_new (GDK_ROOT_PARENT ());
|
||||
|
||||
gdk_pixbuf_render_threshold_alpha (pixbuf, mask,
|
||||
0, 0, 0, 0,
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf),
|
||||
1);
|
||||
|
||||
gdk_gc_set_clip_mask (gc, mask);
|
||||
|
||||
gdk_pixbuf_render_to_drawable (pixbuf, pixmap, gc,
|
||||
0, 0, 0, 0,
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf),
|
||||
GDK_RGB_DITHER_MAX, 0, 0);
|
||||
|
||||
bg_applier->p->preview_widget = gtk_pixmap_new (pixmap, mask);
|
||||
gtk_widget_show (bg_applier->p->preview_widget);
|
||||
g_object_unref (G_OBJECT (pixbuf));
|
||||
g_free (filename);
|
||||
|
||||
gtk_widget_pop_visual ();
|
||||
gtk_widget_pop_colormap ();
|
||||
|
||||
return bg_applier->p->preview_widget;
|
||||
return bg_applier->p->preview_widget;
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
|
@ -521,6 +474,8 @@ draw_disabled_message (GtkWidget *widget)
|
|||
gint x, y, w, h;
|
||||
const char *disabled_string = _("Disabled");
|
||||
|
||||
printf ("disabled\n");
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_IMAGE (widget));
|
||||
|
||||
|
@ -851,7 +806,8 @@ create_pixmap (BGApplier *bg_applier, const BGPreferences *prefs)
|
|||
if (!GTK_WIDGET_REALIZED (bg_applier->p->preview_widget))
|
||||
gtk_widget_realize (bg_applier->p->preview_widget);
|
||||
|
||||
bg_applier->p->pixmap = GTK_PIXMAP (bg_applier->p->preview_widget)->pixmap;
|
||||
g_assert (gtk_image_get_storage_type (GTK_IMAGE(bg_applier->p->preview_widget)) == GTK_IMAGE_PIXMAP);
|
||||
gtk_image_get_pixmap (GTK_IMAGE (bg_applier->p->preview_widget), &bg_applier->p->pixmap, NULL);
|
||||
bg_applier->p->pixmap_is_set = TRUE;
|
||||
break;
|
||||
}
|
||||
|
@ -962,6 +918,8 @@ get_geometry (wallpaper_type_t wallpaper_type,
|
|||
src_geom->width = pwidth;
|
||||
src_geom->height = pheight;
|
||||
break;
|
||||
case WPTYPE_EMBOSSED:
|
||||
g_warning ("Embossing is not yet supported");
|
||||
default:
|
||||
g_error ("Bad wallpaper type");
|
||||
break;
|
||||
|
|
|
@ -41,6 +41,8 @@ static void bg_preferences_class_init (BGPreferencesClass *class);
|
|||
static void bg_preferences_finalize (GObject *object);
|
||||
|
||||
static GdkColor *read_color_from_string (const gchar *string);
|
||||
static orientation_t read_orientation_from_string (gchar *string);
|
||||
static wallpaper_type_t read_wptype_from_string (gchar *string);
|
||||
|
||||
GType
|
||||
bg_preferences_get_type (void)
|
||||
|
@ -173,22 +175,30 @@ bg_preferences_load (BGPreferences *prefs)
|
|||
|
||||
client = gconf_client_get_default ();
|
||||
|
||||
prefs->enabled = gconf_client_get_bool (client, "/desktop/gnome/background/enabled", &error);
|
||||
prefs->wallpaper_type = gconf_client_get_int (client, "/desktop/gnome/background/wallpaper-type", &error);
|
||||
prefs->wallpaper_filename = gconf_client_get_string (client, "/desktop/gnome/background/wallpaper-filename", &error);
|
||||
prefs->wallpaper_enabled = gconf_client_get_bool (client, "/desktop/gnome/background/wallpaper-enabled", &error);
|
||||
prefs->color1 = read_color_from_string (gconf_client_get_string (client, "/desktop/gnome/background/color1", &error));
|
||||
prefs->color2 = read_color_from_string (gconf_client_get_string (client, "/desktop/gnome/background/color2", &error));
|
||||
prefs->opacity = gconf_client_get_int (client, "/desktop/gnome/background/opacity", &error);
|
||||
prefs->enabled = gconf_client_get_bool (client, BG_PREFERENCES_DRAW_BACKGROUND, &error);
|
||||
prefs->wallpaper_filename = gconf_client_get_string (client, BG_PREFERENCES_PICTURE_FILENAME, &error);
|
||||
|
||||
prefs->color1 = read_color_from_string (gconf_client_get_string (client, BG_PREFERENCES_PRIMARY_COLOR, &error));
|
||||
prefs->color2 = read_color_from_string (gconf_client_get_string (client, BG_PREFERENCES_SECONDARY_COLOR, &error));
|
||||
|
||||
prefs->opacity = gconf_client_get_int (client, BG_PREFERENCES_PICTURE_OPACITY, &error);
|
||||
if (prefs->opacity >= 100 || prefs->opacity < 0)
|
||||
prefs->adjust_opacity = FALSE;
|
||||
|
||||
prefs->orientation = gconf_client_get_int (client, "/desktop/gnome/background/orientation", &error);
|
||||
|
||||
prefs->orientation = read_orientation_from_string (gconf_client_get_string (client, BG_PREFERENCES_COLOR_SHADING_TYPE, &error));
|
||||
if (prefs->orientation == ORIENTATION_SOLID)
|
||||
prefs->gradient_enabled = FALSE;
|
||||
else
|
||||
prefs->gradient_enabled = TRUE;
|
||||
|
||||
prefs->wallpaper_type = read_wptype_from_string (gconf_client_get_string (client, BG_PREFERENCES_PICTURE_OPTIONS, &error));
|
||||
|
||||
if (prefs->wallpaper_type == -1) {
|
||||
prefs->wallpaper_enabled = FALSE;
|
||||
prefs->wallpaper_type = WPTYPE_CENTERED;
|
||||
} else {
|
||||
prefs->wallpaper_enabled = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the event name given (the event being notification of a property having
|
||||
|
@ -205,10 +215,17 @@ bg_preferences_merge_entry (BGPreferences *prefs,
|
|||
g_return_if_fail (prefs != NULL);
|
||||
g_return_if_fail (IS_BG_PREFERENCES (prefs));
|
||||
|
||||
if (!strcmp (entry->key, "/desktop/gnome/background/wallpaper_type")) {
|
||||
prefs->wallpaper_type = gconf_value_get_int (value);
|
||||
if (!strcmp (entry->key, BG_PREFERENCES_PICTURE_OPTIONS)) {
|
||||
prefs->wallpaper_type = read_wptype_from_string (g_strdup (gconf_value_get_string (value)));
|
||||
if (prefs->wallpaper_type == -1) {
|
||||
prefs->wallpaper_enabled = FALSE;
|
||||
prefs->wallpaper_type = WPTYPE_CENTERED;
|
||||
} else {
|
||||
prefs->wallpaper_enabled = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/wallpaper-filename")) {
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_PICTURE_FILENAME)) {
|
||||
prefs->wallpaper_filename = g_strdup (gconf_value_get_string (value));
|
||||
|
||||
if (prefs->wallpaper_filename != NULL &&
|
||||
|
@ -218,27 +235,27 @@ bg_preferences_merge_entry (BGPreferences *prefs,
|
|||
else
|
||||
prefs->wallpaper_enabled = FALSE;
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/color1")) {
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_PRIMARY_COLOR)) {
|
||||
prefs->color1 = read_color_from_string (gconf_value_get_string (value));
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/color2")) {
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_SECONDARY_COLOR)) {
|
||||
prefs->color2 = read_color_from_string (gconf_value_get_string (value));
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/opacity")) {
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_PICTURE_OPACITY)) {
|
||||
prefs->opacity = gconf_value_get_int (value);
|
||||
|
||||
if (prefs->opacity >= 100)
|
||||
prefs->adjust_opacity = FALSE;
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/orientation")) {
|
||||
prefs->orientation = gconf_value_get_int (value);
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_COLOR_SHADING_TYPE)) {
|
||||
prefs->orientation = read_orientation_from_string (g_strdup (gconf_value_get_string (value)));
|
||||
|
||||
if (prefs->orientation == ORIENTATION_SOLID)
|
||||
prefs->gradient_enabled = FALSE;
|
||||
else
|
||||
prefs->gradient_enabled = TRUE;
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/wallpaper-enabled")) {
|
||||
else if (!strcmp (entry->key, BG_PREFERENCES_DRAW_BACKGROUND)) {
|
||||
if (gconf_value_get_bool (value) &&
|
||||
(prefs->wallpaper_filename != NULL) &&
|
||||
strcmp (prefs->wallpaper_filename, "") != 0 &&
|
||||
|
@ -246,14 +263,51 @@ bg_preferences_merge_entry (BGPreferences *prefs,
|
|||
prefs->wallpaper_enabled = TRUE;
|
||||
else
|
||||
prefs->wallpaper_enabled = FALSE;
|
||||
}
|
||||
else if (!strcmp (entry->key, "/desktop/gnome/background/wallpaper-type")) {
|
||||
prefs->wallpaper_type = gconf_value_get_int (value);
|
||||
} else {
|
||||
g_warning ("%s: Unknown property: %s", G_GNUC_FUNCTION, entry->key);
|
||||
g_warning ("%s: Unknown property: %s", __FUNCTION__, entry->key);
|
||||
}
|
||||
}
|
||||
|
||||
static wallpaper_type_t
|
||||
read_wptype_from_string (gchar *string)
|
||||
{
|
||||
wallpaper_type_t type = -1;
|
||||
|
||||
if (string) {
|
||||
if (!strncmp (string, "wallpaper", sizeof ("wallpaper"))) {
|
||||
type = WPTYPE_TILED;
|
||||
} else if (!strncmp (string, "centered", sizeof ("centered"))) {
|
||||
type = WPTYPE_CENTERED;
|
||||
} else if (!strncmp (string, "scaled", sizeof ("scaled"))) {
|
||||
type = WPTYPE_SCALED;
|
||||
} else if (!strncmp (string, "stretched", sizeof ("stretched"))) {
|
||||
type = WPTYPE_STRETCHED;
|
||||
} else if (!strncmp (string, "embossed", sizeof ("embossed"))) {
|
||||
type = WPTYPE_EMBOSSED;
|
||||
}
|
||||
g_free (string);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static orientation_t
|
||||
read_orientation_from_string (gchar *string)
|
||||
{
|
||||
orientation_t type = ORIENTATION_SOLID;
|
||||
|
||||
if (string) {
|
||||
if (!strncmp (string, "vertical-gradient", sizeof ("vertical-gradient"))) {
|
||||
type = ORIENTATION_VERT;
|
||||
} else if (!strncmp (string, "horizontal-gradient", sizeof ("horizontal-gradient"))) {
|
||||
type = ORIENTATION_HORIZ;
|
||||
}
|
||||
g_free (string);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static GdkColor *
|
||||
read_color_from_string (const gchar *string)
|
||||
{
|
||||
|
@ -267,7 +321,10 @@ read_color_from_string (const gchar *string)
|
|||
rgb = ((color->red >> 8) << 16) ||
|
||||
((color->green >> 8) << 8) ||
|
||||
(color->blue >> 8);
|
||||
#if 0
|
||||
/* fixme: I am not sure, but this can be accomplished otherwise */
|
||||
color->pixel = gdk_rgb_xpixel_from_rgb (rgb);
|
||||
#endif
|
||||
}
|
||||
|
||||
return color;
|
||||
|
|
|
@ -32,15 +32,26 @@
|
|||
#define BG_PREFERENCES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, bg_preferences_get_type (), BGPreferencesClass)
|
||||
#define IS_BG_PREFERENCES(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, bg_preferences_get_type ())
|
||||
|
||||
#define BG_PREFERENCES_DRAW_BACKGROUND "/desktop/gnome/background/draw_background"
|
||||
#define BG_PREFERENCES_PRIMARY_COLOR "/desktop/gnome/background/primary_color"
|
||||
#define BG_PREFERENCES_SECONDARY_COLOR "/desktop/gnome/background/secondary_color"
|
||||
#define BG_PREFERENCES_COLOR_SHADING_TYPE "/desktop/gnome/background/color_shading_type"
|
||||
#define BG_PREFERENCES_PICTURE_OPTIONS "/desktop/gnome/background/picture_options"
|
||||
#define BG_PREFERENCES_PICTURE_OPACITY "/desktop/gnome/background/picture_opacity"
|
||||
#define BG_PREFERENCES_PICTURE_FILENAME "/desktop/gnome/background/picture_filename"
|
||||
|
||||
|
||||
typedef struct _BGPreferences BGPreferences;
|
||||
typedef struct _BGPreferencesClass BGPreferencesClass;
|
||||
|
||||
typedef enum _orientation_t {
|
||||
ORIENTATION_SOLID, ORIENTATION_HORIZ, ORIENTATION_VERT
|
||||
ORIENTATION_SOLID = 0,
|
||||
ORIENTATION_HORIZ,
|
||||
ORIENTATION_VERT
|
||||
} orientation_t;
|
||||
|
||||
typedef enum _wallpaper_type_t {
|
||||
WPTYPE_TILED, WPTYPE_CENTERED, WPTYPE_SCALED,
|
||||
WPTYPE_TILED = 0, WPTYPE_CENTERED, WPTYPE_SCALED,
|
||||
WPTYPE_STRETCHED, WPTYPE_EMBOSSED
|
||||
} wallpaper_type_t;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue