diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-13 16:54:17 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-13 16:54:17 +0530 |
commit | 90eac02d6a2bb8e9ed66841c684d22b5eef0f8df (patch) | |
tree | 175213805f22e2875ac9736b87eb2b63f494ce7d | |
parent | 02eeaed537b42066b2a5098aa398eeca6539d259 (diff) |
set gobject props in setupDocView too
Change-Id: Ie31515197081ec3379912d30c99032e22c6106c2
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx index 9aa54fa46778..a3e8650c4263 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx @@ -165,7 +165,6 @@ static void initWindow(GtvApplicationWindow* window) // Fill our comments sidebar gboolean bTiledAnnotations; g_object_get(G_OBJECT(window->lokdocview), "tiled-annotations", &bTiledAnnotations, nullptr); - // comments api implemented only for writer, calc as of now if (!bTiledAnnotations && pDocument) { window->commentssidebar = gtv_comments_sidebar_new(); @@ -292,25 +291,32 @@ createRenderingArgsJSON(const GtvRenderingArgs* pRenderingArgs) return aStream.str(); } -static void setupDocView(LOKDocView* pDocView) +static void setupDocView(GtvApplicationWindow* window) { + GtvApplicationWindowPrivate* priv = getPrivate(window); + g_object_set(G_OBJECT(window->lokdocview), + "doc-password", TRUE, + "doc-password-to-modify", TRUE, + "tiled-annotations", priv->m_pRenderingArgs->m_bEnableTiledAnnotations, + nullptr); + #if GLIB_CHECK_VERSION(2,40,0) - g_assert_nonnull(pDocView); + g_assert_nonnull(window->lokdocview); #endif - g_signal_connect(pDocView, "edit-changed", G_CALLBACK(LOKDocViewSigHandlers::editChanged), nullptr); - g_signal_connect(pDocView, "command-changed", G_CALLBACK(LOKDocViewSigHandlers::commandChanged), nullptr); - g_signal_connect(pDocView, "command-result", G_CALLBACK(LOKDocViewSigHandlers::commandResult), nullptr); - g_signal_connect(pDocView, "search-not-found", G_CALLBACK(LOKDocViewSigHandlers::searchNotFound), nullptr); - g_signal_connect(pDocView, "search-result-count", G_CALLBACK(LOKDocViewSigHandlers::searchResultCount), nullptr); - g_signal_connect(pDocView, "part-changed", G_CALLBACK(LOKDocViewSigHandlers::partChanged), nullptr); - g_signal_connect(pDocView, "hyperlink-clicked", G_CALLBACK(LOKDocViewSigHandlers::hyperlinkClicked), nullptr); - g_signal_connect(pDocView, "cursor-changed", G_CALLBACK(LOKDocViewSigHandlers::cursorChanged), nullptr); - g_signal_connect(pDocView, "address-changed", G_CALLBACK(LOKDocViewSigHandlers::addressChanged), nullptr); - g_signal_connect(pDocView, "formula-changed", G_CALLBACK(LOKDocViewSigHandlers::formulaChanged), nullptr); - g_signal_connect(pDocView, "password-required", G_CALLBACK(LOKDocViewSigHandlers::passwordRequired), nullptr); - g_signal_connect(pDocView, "comment", G_CALLBACK(LOKDocViewSigHandlers::comment), nullptr); - - g_signal_connect(pDocView, "configure-event", G_CALLBACK(LOKDocViewSigHandlers::configureEvent), nullptr); + g_signal_connect(window->lokdocview, "edit-changed", G_CALLBACK(LOKDocViewSigHandlers::editChanged), nullptr); + g_signal_connect(window->lokdocview, "command-changed", G_CALLBACK(LOKDocViewSigHandlers::commandChanged), nullptr); + g_signal_connect(window->lokdocview, "command-result", G_CALLBACK(LOKDocViewSigHandlers::commandResult), nullptr); + g_signal_connect(window->lokdocview, "search-not-found", G_CALLBACK(LOKDocViewSigHandlers::searchNotFound), nullptr); + g_signal_connect(window->lokdocview, "search-result-count", G_CALLBACK(LOKDocViewSigHandlers::searchResultCount), nullptr); + g_signal_connect(window->lokdocview, "part-changed", G_CALLBACK(LOKDocViewSigHandlers::partChanged), nullptr); + g_signal_connect(window->lokdocview, "hyperlink-clicked", G_CALLBACK(LOKDocViewSigHandlers::hyperlinkClicked), nullptr); + g_signal_connect(window->lokdocview, "cursor-changed", G_CALLBACK(LOKDocViewSigHandlers::cursorChanged), nullptr); + g_signal_connect(window->lokdocview, "address-changed", G_CALLBACK(LOKDocViewSigHandlers::addressChanged), nullptr); + g_signal_connect(window->lokdocview, "formula-changed", G_CALLBACK(LOKDocViewSigHandlers::formulaChanged), nullptr); + g_signal_connect(window->lokdocview, "password-required", G_CALLBACK(LOKDocViewSigHandlers::passwordRequired), nullptr); + g_signal_connect(window->lokdocview, "comment", G_CALLBACK(LOKDocViewSigHandlers::comment), nullptr); + + g_signal_connect(window->lokdocview, "configure-event", G_CALLBACK(LOKDocViewSigHandlers::configureEvent), nullptr); } void @@ -322,10 +328,8 @@ gtv_application_window_create_view_from_window(GtvApplicationWindow* window) GtvApplicationWindow* newWindow = GTV_APPLICATION_WINDOW(gtv_application_window_new(GTK_APPLICATION(app))); const std::string aArguments = createRenderingArgsJSON(priv->m_pRenderingArgs); newWindow->lokdocview = lok_doc_view_new_from_widget(LOK_DOC_VIEW(window->lokdocview), aArguments.c_str()); - setupDocView(LOK_DOC_VIEW(newWindow->lokdocview)); + setupDocView(newWindow); - gboolean bTiledAnnotations; - g_object_get(G_OBJECT(window->lokdocview), "tiled-annotations", &bTiledAnnotations, nullptr); gtk_container_add(GTK_CONTAINER(newWindow->scrolledwindow), newWindow->lokdocview); gtk_widget_show_all(newWindow->scrolledwindow); gtk_window_present(GTK_WINDOW(newWindow)); @@ -347,12 +351,8 @@ gtv_application_window_load_document(GtvApplicationWindow* window, priv->m_pRenderingArgs->m_aUserProfile.empty() ? nullptr : priv->m_pRenderingArgs->m_aUserProfile.c_str(), nullptr, nullptr); gtk_container_add(GTK_CONTAINER(window->scrolledwindow), window->lokdocview); - g_object_set(G_OBJECT(window->lokdocview), - "doc-password", TRUE, - "doc-password-to-modify", TRUE, - "tiled-annotations", priv->m_pRenderingArgs->m_bEnableTiledAnnotations, - nullptr); - setupDocView(LOK_DOC_VIEW(window->lokdocview)); + + setupDocView(window); // Create argument JSON const std::string aArguments = createRenderingArgsJSON(priv->m_pRenderingArgs); |