aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-02-25 09:18:57 -0500
committerMichael Terry <mike@mterry.name>2011-02-25 09:18:57 -0500
commit2a6b56d0f00d2e23ca48687fe1c81d4e88be3b28 (patch)
treee1bfcbc4f9eb2ad22841abb797e2e57f308d5870
parent350271ee98b2ae288f9f1dde5eaea635e9dff3b7 (diff)
downloadayatana-indicator-datetime-2a6b56d0f00d2e23ca48687fe1c81d4e88be3b28.tar.gz
ayatana-indicator-datetime-2a6b56d0f00d2e23ca48687fe1c81d4e88be3b28.tar.bz2
ayatana-indicator-datetime-2a6b56d0f00d2e23ca48687fe1c81d4e88be3b28.zip
remove week-start preference
-rw-r--r--data/com.canonical.indicator.datetime.gschema.xml12
-rw-r--r--data/datetime-dialog.ui61
-rw-r--r--src/datetime-prefs.c49
-rw-r--r--src/settings-shared.h1
-rw-r--r--src/utils.c11
-rw-r--r--src/utils.h1
6 files changed, 0 insertions, 135 deletions
diff --git a/data/com.canonical.indicator.datetime.gschema.xml b/data/com.canonical.indicator.datetime.gschema.xml
index 5361896..b33f34e 100644
--- a/data/com.canonical.indicator.datetime.gschema.xml
+++ b/data/com.canonical.indicator.datetime.gschema.xml
@@ -5,11 +5,6 @@
<value nick="24-hour" value="2" />
<value nick="custom" value="3" />
</enum>
- <enum id="week-start-enum">
- <value nick="locale-default" value="0" />
- <value nick="sunday" value="1" />
- <value nick="monday" value="2" />
- </enum>
<schema id="com.canonical.indicator.datetime" path="/com/canonical/indicator/datetime/" gettext-domain="indicator-datetime">
<key name="show-clock" type="b">
<default>true</default>
@@ -83,13 +78,6 @@
Shows the week numbers in the monthly calendar in indicator-datetime's menu.
</description>
</key>
- <key name="week-start" enum="week-start-enum">
- <default>'locale-default'</default>
- <summary>When the week starts</summary>
- <description>
- Controls whether weeks in the calendar are shown to start on Sunday or Monday.
- </description>
- </key>
<key name="show-events" type="b">
<default>true</default>
<summary>Show events in the indicator</summary>
diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui
index b8d0777..35cb172 100644
--- a/data/datetime-dialog.ui
+++ b/data/datetime-dialog.ui
@@ -597,67 +597,6 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Week begins on:</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkRadioButton" id="startOnSundayRadio">
- <property name="label" translatable="yes">S_unday</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="startOnMondayRadio">
- <property name="label" translatable="yes">Monda_y</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">startOnSundayRadio</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
</object>
</child>
</object>
diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c
index fbadd27..e69d58b 100644
--- a/src/datetime-prefs.c
+++ b/src/datetime-prefs.c
@@ -86,45 +86,6 @@ bind_hours_get (GValue * value, GVariant * variant, gpointer user_data)
return TRUE;
}
-/* Turns the boolean property into a string gsettings */
-static GVariant *
-bind_week_start_set (const GValue * value, const GVariantType * type, gpointer user_data)
-{
- const gchar * output = NULL;
- gboolean is_sunday_button = (gboolean)GPOINTER_TO_INT(user_data);
-
- if (g_value_get_boolean(value)) {
- /* Only do anything if we're setting active = true */
- output = is_sunday_button ? "sunday" : "monday";
- } else {
- return NULL;
- }
-
- return g_variant_new_string (output);
-}
-
-/* Turns a string gsettings into a boolean property */
-static gboolean
-bind_week_start_get (GValue * value, GVariant * variant, gpointer user_data)
-{
- const gchar * str = g_variant_get_string(variant, NULL);
- gboolean output = FALSE;
- gboolean is_sunday_button = (gboolean)GPOINTER_TO_INT(user_data);
-
- if (g_strcmp0(str, "locale-default") == 0) {
- output = (is_sunday_button == is_locale_week_start_sunday ());
- } else if (g_strcmp0(str, "sunday") == 0) {
- output = is_sunday_button;
- } else if (g_strcmp0(str, "monday") == 0) {
- output = !is_sunday_button;
- } else {
- return FALSE;
- }
-
- g_value_set_boolean (value, output);
- return TRUE;
-}
-
static void
widget_dependency_cb (GtkWidget * parent, GParamSpec *pspec, GtkWidget * dependent)
{
@@ -527,16 +488,6 @@ create_dialog (void)
"active", G_SETTINGS_BIND_DEFAULT);
g_settings_bind (conf, SETTINGS_SHOW_WEEK_NUMBERS_S, WIG ("includeWeekNumbersCheck"),
"active", G_SETTINGS_BIND_DEFAULT);
- g_settings_bind_with_mapping (conf, SETTINGS_WEEK_START_S,
- WIG ("startOnSundayRadio"), "active",
- G_SETTINGS_BIND_DEFAULT,
- bind_week_start_get, bind_week_start_set,
- GINT_TO_POINTER(TRUE), NULL);
- g_settings_bind_with_mapping (conf, SETTINGS_WEEK_START_S,
- WIG ("startOnMondayRadio"), "active",
- G_SETTINGS_BIND_DEFAULT,
- bind_week_start_get, bind_week_start_set,
- GINT_TO_POINTER(FALSE), NULL);
g_settings_bind (conf, SETTINGS_SHOW_EVENTS_S, WIG ("showEventsCheck"),
"active", G_SETTINGS_BIND_DEFAULT);
g_settings_bind (conf, SETTINGS_SHOW_LOCATIONS_S, WIG ("showLocationsCheck"),
diff --git a/src/settings-shared.h b/src/settings-shared.h
index a4fac24..df2260e 100644
--- a/src/settings-shared.h
+++ b/src/settings-shared.h
@@ -31,7 +31,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define SETTINGS_CUSTOM_TIME_FORMAT_S "custom-time-format"
#define SETTINGS_SHOW_CALENDAR_S "show-calendar"
#define SETTINGS_SHOW_WEEK_NUMBERS_S "show-week-numbers"
-#define SETTINGS_WEEK_START_S "week-start"
#define SETTINGS_SHOW_EVENTS_S "show-events"
#define SETTINGS_SHOW_LOCATIONS_S "show-locations"
#define SETTINGS_LOCATIONS_S "locations"
diff --git a/src/utils.c b/src/utils.c
index 20ae958..7471926 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -50,17 +50,6 @@ is_locale_12h (void)
return TRUE;
}
-/* Check the system locale setting to see if the week starts on Sunday or Monday */
-gboolean
-is_locale_week_start_sunday (void)
-{
- const char * week_1stday = nl_langinfo (_NL_TIME_WEEK_1STDAY);
-
- /* This appears to be a special value that libc uses for Sunday, it's not
- really a string */
- return (GPOINTER_TO_INT (week_1stday) == 19971130);
-}
-
void
split_settings_location (const gchar * location, gchar ** zone, gchar ** name)
{
diff --git a/src/utils.h b/src/utils.h
index 3dc8df1..5f7842c 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -28,7 +28,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
G_BEGIN_DECLS
gboolean is_locale_12h (void);
-gboolean is_locale_week_start_sunday (void);
void split_settings_location (const gchar * location, gchar ** zone, gchar ** name);
gchar * generate_format_string_full (gboolean show_day, gboolean show_date);
gchar * generate_format_string_at_time (GDateTime * time);