From 49a58e6e735a90532720f74c8d255056cd018a1a Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 14 Dec 2017 20:28:39 +0530 Subject: lokdialog: If we already have the title, emit it during creation Some dialogs load the UI before we "Execute()" the dialog, or before the dialog fires the InitShow event. In those cases, the title event has already been fired and won't be fired after dialog is created. Make sure that we send the title for such dialogs. Change-Id: Ib66238298ad9b0dc85bd269aff37aeadf1fc82e4 (cherry picked from commit 10a88598a4233f2b24548571644a83dc9d20e15d) --- libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libreofficekit/qa') diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx index ffef18c8bdfa..5983b7f77e5b 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx @@ -315,6 +315,7 @@ void LOKDocViewSigHandlers::window(LOKDocView* pDocView, gchar* pPayload, gpoint { const std::string aType = aRoot.get("type"); const std::string aSize = aRoot.get("size"); + const std::string aTitle = aRoot.get("title", ""); std::vector aSizePoints = GtvHelpers::split(aSize, ", ", 2); if (aType == "dialog") @@ -326,6 +327,9 @@ void LOKDocViewSigHandlers::window(LOKDocView* pDocView, gchar* pPayload, gpoint g_signal_connect(pDialog, "destroy", G_CALLBACK(destroyLokDialog), window); g_signal_connect(pDialog, "delete-event", G_CALLBACK(deleteLokDialog), window); + if (!aTitle.empty()) + gtk_window_set_title(GTK_WINDOW(pDialog), aTitle.c_str()); + gtk_window_set_resizable(GTK_WINDOW(pDialog), false); gtk_widget_show_all(GTK_WIDGET(pDialog)); gtk_window_present(GTK_WINDOW(pDialog)); -- cgit