[Libreoffice-commits] core.git: libreofficekit/qa

Miklos Vajna vmiklos at collabora.co.uk
Fri Jan 8 09:00:12 PST 2016


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 13e0ec9f38736557d9b4737298ca9a858919e6e3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jan 8 17:38:23 2016 +0100

    gtktiledviewer: hide new view button when it's not supposed to work
    
    Change-Id: I91003540f994eeaab78bc66ed6e0df9e9f59ee4b

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 7c2cc56..3c8f781 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -1058,11 +1058,15 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
     gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pEnableEditing, -1);
     g_signal_connect(G_OBJECT(pEnableEditing), "toggled", G_CALLBACK(toggleEditing), nullptr);
 
-    GtkToolItem* pNewViewButton = gtk_tool_button_new( nullptr, nullptr);
-    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pNewViewButton), "view-continuous-symbolic");
-    gtk_tool_item_set_tooltip_text(pNewViewButton, "New View");
-    gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pNewViewButton, -1);
-    g_signal_connect(G_OBJECT(pNewViewButton), "clicked", G_CALLBACK(createView), nullptr);
+    static bool bViewCallback = getenv("LOK_VIEW_CALLBACK");
+    if (bViewCallback)
+    {
+        GtkToolItem* pNewViewButton = gtk_tool_button_new( nullptr, nullptr);
+        gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pNewViewButton), "view-continuous-symbolic");
+        gtk_tool_item_set_tooltip_text(pNewViewButton, "New View");
+        gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pNewViewButton, -1);
+        g_signal_connect(G_OBJECT(pNewViewButton), "clicked", G_CALLBACK(createView), nullptr);
+    }
     gtk_box_pack_start(GTK_BOX(rWindow.m_pVBox), pUpperToolbar, FALSE, FALSE, 0 ); // Adds to top.
 
     // Lower toolbar.


More information about the Libreoffice-commits mailing list