#define HOURS_GCONF_KEY "/apps/Maemo/sadba/timed_inhibit_hours"
#define MINUTES_GCONF_KEY "/apps/Maemo/sadba/timed_inhibit_minutes"
+#define BANNER_DURATION 5000 // in milliseconds
#define INHIBIT_MSG_INTERVAL 30 // in seconds
#define GETTEXT_DOM "status-area-displayblanking-applet"
HD_STATUS_PLUGIN_ITEM (priv->plugin), NULL);
}
-static gboolean
-on_inhibit_timeout (DisplayBlankingStatusPluginPrivate *priv)
+static void
+inhibit_display_blanking (DisplayBlankingStatusPluginPrivate *priv)
{
dbus_bool_t ok = dbus_connection_send (priv->dbus_conn, priv->dbus_msg,
NULL);
g_assert (ok == TRUE);
+}
+
+static gboolean
+on_inhibit_timeout (DisplayBlankingStatusPluginPrivate *priv)
+{
+ inhibit_display_blanking (priv);
return TRUE;
}
GtkWidget *banner = hildon_banner_show_information (
priv->timed_inhibit_button, NULL,
_ ("Display blanking inhibition disabled"));
- hildon_banner_set_timeout (HILDON_BANNER (banner), 5000);
+ hildon_banner_set_timeout (HILDON_BANNER (banner), BANNER_DURATION);
return FALSE;
}
static void
enable_inhibition (DisplayBlankingStatusPluginPrivate *priv)
{
+ inhibit_display_blanking (priv);
+
g_assert (priv->inhibit_timer_id == 0);
priv->inhibit_timer_id = g_timeout_add_seconds (INHIBIT_MSG_INTERVAL,
(GSourceFunc) on_inhibit_timeout, priv);