summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorrootavish <[email protected]>2014-07-26 12:26:32 +0530
committerrootavish <[email protected]>2014-07-26 12:26:32 +0530
commit57a3618d9254364157a12df39caebbf9247d5aca (patch)
tree3cf1198144056d5d0f2c49486047f0da74ac9fbe /shell/ev-window.c
parentd4ea4f2056a2863c7a37ad83e73bb63301de5022 (diff)
downloadatril-57a3618d9254364157a12df39caebbf9247d5aca.tar.bz2
atril-57a3618d9254364157a12df39caebbf9247d5aca.tar.xz
Reading epub documents possible
Alebit with a bit of bugs as far as navigation etc. are possible, we can read an epub document in Atril. The document will be displayed with thumbnails, and all keyboard shortcuts work. Menu options, the ones that I have currently added do work. I Will now move on to features such as inverted colors, document index, etc, most of which should be simple to add. Also made changes so that the presentation view does not fire up while displaying an epub document. Also added the feature to copy text to clipboard using the Atril menu.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 89b64307..a59658f3 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1021,8 +1021,7 @@ update_document_mode (EvWindow *window, EvDocumentMode mode)
if (mode == EV_DOCUMENT_MODE_PRESENTATION) {
if (window->priv->document) {
if (window->priv->document->iswebdocument) {
- ev_window_warning_message(window,_("Cannot enter presentation mode with ePub documents\
- use fullscreen mode instead."));
+ ev_window_warning_message(window,_("Cannot enter presentation mode with ePub documents use fullscreen mode instead."));
return;
}
}
@@ -3797,9 +3796,12 @@ static void
ev_window_cmd_edit_copy (GtkAction *action, EvWindow *ev_window)
{
g_return_if_fail (EV_IS_WINDOW (ev_window));
- if ( ev_window->priv->document->iswebdocument == TRUE ) return;
- ev_view_copy (EV_VIEW (ev_window->priv->view));
+ if (ev_window->priv->document->iswebdocument) {
+ ev_web_view_copy(EV_WEB_VIEW(ev_window->priv->webview));
+ } else {
+ ev_view_copy (EV_VIEW (ev_window->priv->view));
+ }
}
static void
@@ -3986,7 +3988,11 @@ ev_window_run_presentation (EvWindow *window)
if (EV_WINDOW_IS_PRESENTATION (window))
return;
-
+
+ if (window->priv->document->iswebdocument) {
+ ev_window_warning_message(window,_("Presentation mode is not supported for ePub documents"));
+ return;
+ }
if (ev_document_model_get_fullscreen (window->priv->model)) {
ev_window_stop_fullscreen (window, FALSE);
fullscreen_window = FALSE;
@@ -7180,9 +7186,13 @@ ev_window_init (EvWindow *ev_window)
ev_window->priv->view = ev_view_new ();
-#ifdef ENABLE_EPUB
+#ifdef ENABLE_EPUB /*The webview, we won't add it now but it will replace the atril-view if a web(epub) document is encountered.*/
ev_window->priv->webview = ev_web_view_new();
ev_web_view_set_model(EV_WEB_VIEW(ev_window->priv->webview),ev_window->priv->model);
+
+ g_signal_connect_object (ev_window->priv->webview,"selection-changed",
+ G_CALLBACK(web_view_selection_changed_cb),
+ ev_window, 0);
#endif
ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view), PAGE_CACHE_SIZE);
ev_view_set_model (EV_VIEW (ev_window->priv->view), ev_window->priv->model);