Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2006-12-03 20:54:44 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-12-03 20:54:44 (GMT)
commit8ac50cf59cc976bd26bcb5575a4443d0319463ba (patch)
treed787ffcfb6f70d73c714e02433d08e8b44b70c1e /shell
parent4094f85bec2a1f27274e42411555fc1ede846775 (diff)
Move screensaver handling to application. No more message on startup.
2006-12-03 Nickolay V. Shmyrev <nshmyrev@yandex.ru> * cut-n-paste/totem-screensaver/totem-scrsaver.c: (screensaver_init_dbus), (totem_scrsaver_new), (totem_scrsaver_init): * cut-n-paste/totem-screensaver/totem-scrsaver.h: * shell/ev-application.c: (ev_application_register_service), (ev_application_screensaver_enable), (ev_application_screensaver_disable): * shell/ev-application.h: * shell/ev-window.c: (ev_window_run_presentation), (ev_window_stop_presentation), (build_comments_string), (ev_window_init): Move screensaver handling to application. No more message on startup.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-application.c15
-rw-r--r--shell/ev-application.h6
-rw-r--r--shell/ev-window.c17
3 files changed, 23 insertions, 15 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 7f912f2..aee7390 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -109,7 +109,9 @@ ev_application_register_service (EvApplication *application)
dbus_g_connection_register_g_object (connection,
"/org/gnome/evince/Evince",
G_OBJECT (application));
-
+
+ application->scr_saver = totem_scrsaver_new (connection);
+
return TRUE;
}
#endif /* ENABLE_DBUS */
@@ -551,3 +553,14 @@ const gchar* ev_application_get_chooser_uri (EvApplication *application)
return application->last_chooser_uri;
}
+void ev_application_screensaver_enable (EvApplication *application)
+{
+ if (application->scr_saver)
+ totem_scrsaver_enable (application->scr_saver);
+}
+
+void ev_application_screensaver_disable (EvApplication *application)
+{
+ if (application->scr_saver)
+ totem_scrsaver_disable (application->scr_saver);
+}
diff --git a/shell/ev-application.h b/shell/ev-application.h
index 4f3ce7e..53e97c2 100644
--- a/shell/ev-application.h
+++ b/shell/ev-application.h
@@ -32,6 +32,7 @@
#ifndef HAVE_GTK_RECENT
#include "egg-recent-model.h"
#endif
+#include "totem-scrsaver.h"
G_BEGIN_DECLS
@@ -58,6 +59,8 @@ struct _EvApplication {
#ifndef HAVE_GTK_RECENT
EggRecentModel *recent_model;
#endif
+
+ TotemScrsaver *scr_saver;
gchar *last_chooser_uri;
};
@@ -103,7 +106,8 @@ EggRecentModel *ev_application_get_recent_model (EvApplication *applicati
void ev_application_set_chooser_uri (EvApplication *application,
const gchar *uri);
const gchar *ev_application_get_chooser_uri (EvApplication *application);
-
+void ev_application_screensaver_enable (EvApplication *application);
+void ev_application_screensaver_disable (EvApplication *application);
G_END_DECLS
#endif /* !EV_APPLICATION_H */
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 7ece884..271cfe2 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -91,8 +91,6 @@
#include <libgnomevfs/gnome-vfs-utils.h>
#include <gconf/gconf-client.h>
-#include "totem-scrsaver.h"
-
#include <string.h>
typedef enum {
@@ -153,9 +151,6 @@ struct _EvWindowPrivate {
GtkWidget *fullscreen_popup;
guint fullscreen_timeout_id;
- /* Screensaver */
- TotemScrsaver *screensaver;
-
/* Popup link */
GtkWidget *view_popup;
EvLink *link;
@@ -2557,8 +2552,8 @@ ev_window_run_presentation (EvWindow *window)
window);
fullscreen_set_timeout (window);
- totem_scrsaver_disable (window->priv->screensaver);
-
+ ev_application_screensaver_disable (EV_APP);
+
if (!ev_window_is_empty (window))
ev_metadata_manager_set_boolean (window->priv->uri, "presentation", TRUE);
}
@@ -2585,7 +2580,7 @@ ev_window_stop_presentation (EvWindow *window)
window);
fullscreen_clear_timeout (window);
- totem_scrsaver_enable (window->priv->screensaver);
+ ev_application_screensaver_enable (EV_APP);
if (!ev_window_is_empty (window))
ev_metadata_manager_set_boolean (window->priv->uri, "presentation", FALSE);
@@ -3128,7 +3123,7 @@ build_comments_string (void)
"Using poppler %s (%s)"),
version, backend_name);
#else
- return g_strdup_printf (_("Document Viewer."));
+ return g_strdup_printf (_("Document Viewer"));
#endif
}
@@ -4652,10 +4647,6 @@ ev_window_init (EvWindow *ev_window)
G_CALLBACK (drag_data_received_cb),
ev_window);
- /* Screensaver */
-
- ev_window->priv->screensaver = totem_scrsaver_new ();
-
/* Set it user interface params */
ev_window_setup_recent (ev_window);