Commit f1ed1187 authored by Jim Krehl's avatar Jim Krehl
Browse files

hooked status and system visible gconf key

svn path=/branches/version-2/; revision=184
parent ba242338
......@@ -60,6 +60,8 @@
#define LOCKDOWN_GCONF_DIR "/desktop/gnome/applications/main-menu/lock-down"
#define MORE_LINK_VIS_GCONF_KEY LOCKDOWN_GCONF_DIR "/application_browser_link_visible"
#define SEARCH_VIS_GCONF_KEY LOCKDOWN_GCONF_DIR "/search_area_visible"
#define STATUS_VIS_GCONF_KEY LOCKDOWN_GCONF_DIR "/status_area_visible"
#define SYSTEM_VIS_GCONF_KEY LOCKDOWN_GCONF_DIR "/system_area_visible"
G_DEFINE_TYPE (MainMenuUI, main_menu_ui, G_TYPE_OBJECT)
......@@ -95,10 +97,15 @@ typedef struct {
gint max_total_items;
GtkWidget *status_section;
GtkWidget *system_section;
guint search_cmd_gconf_mntr_id;
guint current_page_gconf_mntr_id;
guint more_link_vis_gconf_mntr_id;
guint search_vis_gconf_mntr_id;
guint status_vis_gconf_mntr_id;
guint system_vis_gconf_mntr_id;
gboolean ptr_is_grabbed;
gboolean kbd_is_grabbed;
......@@ -315,10 +322,15 @@ main_menu_ui_init (MainMenuUI *this)
priv->max_total_items = 8;
priv->status_section = NULL;
priv->system_section = NULL;
priv->search_cmd_gconf_mntr_id = 0;
priv->current_page_gconf_mntr_id = 0;
priv->more_link_vis_gconf_mntr_id = 0;
priv->search_vis_gconf_mntr_id = 0;
priv->status_vis_gconf_mntr_id = 0;
priv->system_vis_gconf_mntr_id = 0;
priv->ptr_is_grabbed = FALSE;
priv->kbd_is_grabbed = FALSE;
......@@ -346,6 +358,8 @@ main_menu_ui_finalize (GObject *g_obj)
libslab_gconf_notify_remove (priv->current_page_gconf_mntr_id);
libslab_gconf_notify_remove (priv->more_link_vis_gconf_mntr_id);
libslab_gconf_notify_remove (priv->search_vis_gconf_mntr_id);
libslab_gconf_notify_remove (priv->status_vis_gconf_mntr_id);
libslab_gconf_notify_remove (priv->system_vis_gconf_mntr_id);
G_OBJECT_CLASS (main_menu_ui_parent_class)->finalize (g_obj);
}
......@@ -568,6 +582,9 @@ create_system_section (MainMenuUI *this)
g_signal_connect (
G_OBJECT (priv->sys_table), "notify::" TILE_TABLE_TILES_PROP,
G_CALLBACK (tile_table_notify_cb), this);
priv->system_section = glade_xml_get_widget (
priv->main_menu_xml, "slab-system-section");
}
static void
......@@ -607,6 +624,9 @@ create_status_section (MainMenuUI *this)
gtk_container_add (ctnr, tile);
gtk_widget_show_all (GTK_WIDGET (ctnr));
priv->status_section = glade_xml_get_widget (
priv->main_menu_xml, "slab-status-section");
}
static void
......@@ -757,6 +777,10 @@ setup_lock_down (MainMenuUI *this)
MORE_LINK_VIS_GCONF_KEY, lockdown_notify_cb, this);
priv->search_vis_gconf_mntr_id = libslab_gconf_notify_add (
SEARCH_VIS_GCONF_KEY, lockdown_notify_cb, this);
priv->status_vis_gconf_mntr_id = libslab_gconf_notify_add (
STATUS_VIS_GCONF_KEY, lockdown_notify_cb, this);
priv->system_vis_gconf_mntr_id = libslab_gconf_notify_add (
SYSTEM_VIS_GCONF_KEY, lockdown_notify_cb, this);
}
static void
......@@ -1066,11 +1090,15 @@ apply_lockdown_settings (MainMenuUI *this)
MainMenuUIPrivate *priv = PRIVATE (this);
gboolean more_link_visible;
gboolean status_area_visible;
gboolean system_area_visible;
gint i;
more_link_visible = GPOINTER_TO_INT (libslab_get_gconf_value (MORE_LINK_VIS_GCONF_KEY));
more_link_visible = GPOINTER_TO_INT (libslab_get_gconf_value (MORE_LINK_VIS_GCONF_KEY));
status_area_visible = GPOINTER_TO_INT (libslab_get_gconf_value (STATUS_VIS_GCONF_KEY));
system_area_visible = GPOINTER_TO_INT (libslab_get_gconf_value (SYSTEM_VIS_GCONF_KEY));
for (i = 0; i < 3; ++i)
if (more_link_visible)
......@@ -1079,6 +1107,16 @@ apply_lockdown_settings (MainMenuUI *this)
gtk_widget_hide (priv->more_sections [i]);
set_search_section_visible (this);
if (status_area_visible)
gtk_widget_show (priv->status_section);
else
gtk_widget_hide (priv->status_section);
if (system_area_visible)
gtk_widget_show (priv->system_section);
else
gtk_widget_hide (priv->system_section);
}
static void
......
......@@ -878,89 +878,38 @@
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="slab-side-system-label">
<widget class="GtkVBox" id="slab-system-section">
<property name="visible">True</property>
<property name="label" translatable="yes">System</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</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="GtkAlignment" id="system-item-table-container">
<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>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table8">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">1</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<property name="spacing">6</property>
<child>
<widget class="GtkAlignment" id="hard-drive-status-container">
<widget class="GtkLabel" id="slab-side-system-label">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="label" translatable="yes">System</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</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>
<placeholder/>
</child>
<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="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="network-status-container">
<widget class="GtkAlignment" id="system-item-table-container">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
......@@ -976,11 +925,9 @@
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
......@@ -988,27 +935,98 @@
<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="GtkLabel" id="slab-side-status-label">
<widget class="GtkVBox" id="slab-status-section">
<property name="visible">True</property>
<property name="label" translatable="yes">Status</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</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>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="slab-side-status-label">
<property name="visible">True</property>
<property name="label" translatable="yes">Status</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</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="vbox52">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkAlignment" id="hard-drive-status-container">
<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>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="network-status-container">
<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>
<placeholder/>
</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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment