diff options
author | Aditya Dewan <iit2015097@iiita.ac.in> | 2017-07-15 21:47:14 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-08-17 13:10:30 +0200 |
commit | d64a7f4ba80fa2a0a0ad2bddc6906ab6b78a23c8 (patch) | |
tree | 8269f9ab235c5a4b31ede606bc64b0b474591102 /libreofficekit/qa/gtktiledviewer | |
parent | ea43e0e3ceec30336273da0fb3d47c24073cffd2 (diff) |
implementing callback for ruler invalidation
adding commands to fetch and changee ruler state
'.uno:RulerState' and '.uno:RulerStateChange'
Change-Id: I66107039a7ae5893691feb45c8ab2e4aa476ea76
Reviewed-on: https://gerrit.libreoffice.org/40727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'libreofficekit/qa/gtktiledviewer')
4 files changed, 25 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx index 0da85fd89e65..f94ef776b6d2 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx @@ -103,6 +103,7 @@ gtv_main_toolbar_init(GtvMainToolbar* toolbar) gtk_builder_add_callback_symbol(builder.get(), "doCopy", G_CALLBACK(doCopy)); gtk_builder_add_callback_symbol(builder.get(), "doPaste", G_CALLBACK(doPaste)); gtk_builder_add_callback_symbol(builder.get(), "createView", G_CALLBACK(createView)); + gtk_builder_add_callback_symbol(builder.get(), "getRulerState", G_CALLBACK(getRulerState)); gtk_builder_add_callback_symbol(builder.get(), "unoCommandDebugger", G_CALLBACK(unoCommandDebugger)); gtk_builder_add_callback_symbol(builder.get(), "toggleEditing", G_CALLBACK(toggleEditing)); gtk_builder_add_callback_symbol(builder.get(), "changePartMode", G_CALLBACK(changePartMode)); diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx index 3c9ee3e405f2..9e0b575dcdd5 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx @@ -133,6 +133,14 @@ void createView(GtkWidget* pButton, gpointer /*pItem*/) gtv_application_window_create_view_from_window(GTV_APPLICATION_WINDOW(window)); } +void getRulerState(GtkWidget* pButton, gpointer /*pItem*/) +{ + const std::string type = ".uno:RulerState"; + GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(pButton)); + LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(window->lokdocview)); + pDocument->pClass->getCommandValues(pDocument, type.c_str()); +} + static void removeUnoParam(GtkWidget* pWidget, gpointer userdata) { GtkWidget* pParamAreaBox = GTK_WIDGET(userdata); diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx index a19a7b5cd744..2f9948fe61d7 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx @@ -20,6 +20,8 @@ void doPaste(GtkWidget* pButton, gpointer /*pItem*/); void createView(GtkWidget* pButton, gpointer /*pItem*/); +void getRulerState(GtkWidget* pButton, gpointer /*pItem*/); + void unoCommandDebugger(GtkWidget* pButton, gpointer /* pItem */); void toggleEditing(GtkWidget* pButton, gpointer /*pItem*/); diff --git a/libreofficekit/qa/gtktiledviewer/gtv.ui b/libreofficekit/qa/gtktiledviewer/gtv.ui index e27f79714a4b..eacec33b2d1b 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv.ui +++ b/libreofficekit/qa/gtktiledviewer/gtv.ui @@ -486,6 +486,20 @@ <property name="homogeneous">True</property> </packing> </child> + <child> + <object class="GtkToolButton" id="btn_rulerstate"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">.uno:UpdateRuler</property> + <property name="use_underline">True</property> + <property name="icon_name">text-x-generic</property> + <signal name="clicked" handler="getRulerState" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> </object> <object class="GtkToolbar" id="toolbar2"> <property name="visible">True</property> |