diff options
author | rootavish <[email protected]> | 2014-07-20 16:08:07 +0530 |
---|---|---|
committer | rootavish <[email protected]> | 2014-07-20 16:08:07 +0530 |
commit | 4a3ac19d1365cb87a31eecea4759484673fad667 (patch) | |
tree | 3aeb0f092e04fc18445ced4757d1944352cb636a /shell/ev-window.c | |
parent | e0535b0e61cc56ec62d32518c03a42836f5256e6 (diff) | |
download | atril-4a3ac19d1365cb87a31eecea4759484673fad667.tar.bz2 atril-4a3ac19d1365cb87a31eecea4759484673fad667.tar.xz |
Active properties dialog, other actions
Properties dialog for epub documents, will some basic properties.
Also set toolbar and menu sensitivity for the actions available in epub, will add more(find) once I write the module. Also inverted colors needs to be done with CSS or the like.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r-- | shell/ev-window.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c index 5c18b28c..3fcf3786 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -408,7 +408,9 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) if (has_document && EV_IS_SELECTION (document)) { can_get_text = TRUE; } - + else if (has_document && document->iswebdocument) { + can_get_text = TRUE; + } if (has_pages && EV_IS_DOCUMENT_FIND (document)) { can_find = TRUE; } @@ -447,18 +449,20 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) ev_window_set_action_sensitive (ev_window, "EditSelectAll", has_pages && can_get_text); ev_window_set_action_sensitive (ev_window, "EditFind", can_find); ev_window_set_action_sensitive (ev_window, "Slash", can_find); - ev_window_set_action_sensitive (ev_window, "EditRotateLeft", has_pages); - ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages); + ev_window_set_action_sensitive (ev_window, "EditRotateLeft", has_pages && !(document->iswebdocument)); + ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages && !(document->iswebdocument)); /* View menu */ - ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages); - ev_window_set_action_sensitive (ev_window, "ViewDual", has_pages); - ev_window_set_action_sensitive (ev_window, "ViewBestFit", has_pages); + /*If it has pages it is a document, so our check for a webdocument lead to a crash. We need to switch these off since more than one + *webview is hard to manage */ + ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages && !(document->iswebdocument)); + ev_window_set_action_sensitive (ev_window, "ViewDual", has_pages && !(document->iswebdocument)); + ev_window_set_action_sensitive (ev_window, "ViewBestFit", has_pages && !(document->iswebdocument)); ev_window_set_action_sensitive (ev_window, "ViewPageWidth", has_pages); ev_window_set_action_sensitive (ev_window, "ViewReload", has_pages); - ev_window_set_action_sensitive (ev_window, "ViewAutoscroll", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewAutoscroll", has_pages && !(document->iswebdocument)); ev_window_set_action_sensitive (ev_window, "ViewInvertedColors", has_pages); - ev_window_set_action_sensitive (ev_window, "ViewExpandWindow", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewExpandWindow", has_pages && !(document->iswebdocument)); /* Toolbar-specific actions: */ ev_window_set_action_sensitive (ev_window, PAGE_SELECTOR_ACTION, has_pages); @@ -499,6 +503,11 @@ ev_window_update_actions (EvWindow *ev_window) has_pages && ev_view_get_has_selection (view)); } + else if(webview) { + ev_window_set_action_sensitive (ev_window, "EditCopy", + has_pages && + ev_web_view_get_has_selection (webview)); + } ev_window_set_action_sensitive (ev_window, "EditFindNext", has_pages && can_find_in_page); ev_window_set_action_sensitive (ev_window, "EditFindPrevious", |