[Libreoffice-commits] core.git: sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

Caolán McNamara caolanm at redhat.com
Sat Aug 17 06:54:36 PDT 2013


 sw/AllLangResTarget_sw.mk                      |    1 
 sw/UIConfig_swriter.mk                         |    1 
 sw/inc/helpid.h                                |    1 
 sw/source/ui/utlui/gloslst.cxx                 |   31 ++----
 sw/source/ui/utlui/gloslst.hrc                 |   31 ------
 sw/source/ui/utlui/gloslst.src                 |   71 --------------
 sw/uiconfig/swriter/ui/selectautotextdialog.ui |  122 +++++++++++++++++++++++++
 7 files changed, 135 insertions(+), 123 deletions(-)

New commits:
commit f201d069cc7126da92b203c38479f1b4510d4e50
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Aug 17 14:53:43 2013 +0100

    convert select autotext group to .ui
    
    Change-Id: I2be99d22d30b5a09ee0b0920a63852ca6783cc0a

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 775b558..6317b49 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -131,7 +131,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/table/tabledlg.src \
     sw/source/ui/uiview/view.src \
     sw/source/ui/utlui/attrdesc.src \
-    sw/source/ui/utlui/gloslst.src \
     sw/source/ui/utlui/initui.src \
     sw/source/ui/utlui/navipi.src \
     sw/source/ui/utlui/poolfmt.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 4a2209a..907c251 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -147,6 +147,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/saveashtmldialog \
 	sw/uiconfig/swriter/ui/savelabeldialog \
 	sw/uiconfig/swriter/ui/sectionpage \
+	sw/uiconfig/swriter/ui/selectautotextdialog \
 	sw/uiconfig/swriter/ui/sidebarpage \
 	sw/uiconfig/swriter/ui/sidebarwrap \
 	sw/uiconfig/swriter/ui/sortdialog \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index a55b714..01bdcbb 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -56,7 +56,6 @@
 
 #define HID_INSERT_CHART                                        "SW_HID_INSERT_CHART"
 #define HID_NAVIGATOR_TREELIST                                  "SW_HID_NAVIGATOR_TREELIST"
-#define HID_DLG_GLOSS_DECIDE                                    "SW_HID_DLG_GLOSS_DECIDE"
 #define HID_NAVIGATOR_TOOLBOX                                   "SW_HID_NAVIGATOR_TOOLBOX"
 #define HID_NAVIGATOR_LISTBOX                                   "SW_HID_NAVIGATOR_LISTBOX"
 #define HID_VS_SINGLENUM                                        "SW_HID_VS_SINGLENUM"
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index eab56d3..9290720 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -37,8 +37,6 @@
 #include <vector>
 
 #include <utlui.hrc>
-#include <gloslst.hrc>
-
 
 #define STRING_DELIM (char)0x0A
 #define GLOS_TIMEOUT 30000   // update every 30 seconds
@@ -54,31 +52,26 @@ struct TripleString
 
 class SwGlossDecideDlg : public ModalDialog
 {
-    OKButton        aOk;
-    CancelButton    aCancel;
-    HelpButton      aHelp;
-    ListBox         aListLB;
-    FixedLine       aFL;
+    OKButton* m_pOk;
+    ListBox*  m_pListLB;
 
     DECL_LINK(DoubleClickHdl, void*);
     DECL_LINK(SelectHdl, void*);
 
     public:
         SwGlossDecideDlg(Window* pParent);
-    ListBox&    GetListBox() {return aListLB;}
+    ListBox&    GetListBox() {return *m_pListLB;}
 };
 
-SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) :
-    ModalDialog(pParent, SW_RES(DLG_GLOSSARY_DECIDE_DLG)),
-    aOk(this,       SW_RES(PB_OK)),
-    aCancel(this,   SW_RES(PB_CANCEL)),
-    aHelp(this,     SW_RES(PB_HELP)),
-    aListLB(this,   SW_RES(LB_LIST)),
-    aFL(this,    SW_RES(FL_GLOSS))
+SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent)
+    : ModalDialog(pParent, "SelectAutoTextDialog",
+        "modules/swriter/ui/selectautotextdialog.ui")
 {
-    FreeResource();
-    aListLB.SetDoubleClickHdl(LINK(this, SwGlossDecideDlg, DoubleClickHdl));
-    aListLB.SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl));
+    get(m_pOk, "ok");
+    get(m_pListLB, "treeview");
+    m_pListLB->set_height_request(m_pListLB->GetTextHeight() * 10);
+    m_pListLB->SetDoubleClickHdl(LINK(this, SwGlossDecideDlg, DoubleClickHdl));
+    m_pListLB->SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl));
 }
 
 IMPL_LINK_NOARG(SwGlossDecideDlg, DoubleClickHdl)
@@ -89,7 +82,7 @@ IMPL_LINK_NOARG(SwGlossDecideDlg, DoubleClickHdl)
 
 IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl)
 {
-    aOk.Enable(LISTBOX_ENTRY_NOTFOUND != aListLB.GetSelectEntryPos());
+    m_pOk->Enable(LISTBOX_ENTRY_NOTFOUND != m_pListLB->GetSelectEntryPos());
     return 0;
 }
 
diff --git a/sw/source/ui/utlui/gloslst.hrc b/sw/source/ui/utlui/gloslst.hrc
deleted file mode 100644
index 8e70ed0..0000000
--- a/sw/source/ui/utlui/gloslst.hrc
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _INITUI_HRC
-#define _INITUI_HRC
-
-#define FL_GLOSS                                                                1
-#define PB_OK                                   2
-#define PB_HELP                                 3
-#define PB_CANCEL                               4
-#define LB_LIST                                 5
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/gloslst.src b/sw/source/ui/utlui/gloslst.src
deleted file mode 100644
index 330d613..0000000
--- a/sw/source/ui/utlui/gloslst.src
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "globals.hrc"
-#include "utlui.hrc"
-#include "helpid.h"
-#include "gloslst.hrc"
-
-ModalDialog DLG_GLOSSARY_DECIDE_DLG
-{
-    HelpID = HID_DLG_GLOSS_DECIDE ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 161 , 67 ) ;
-    Text [ en-US ] = "Select AutoText:" ;
-    Moveable = TRUE ;
-    FixedLine FL_GLOSS
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 93 , 8 ) ;
-        Text [ en-US ] = "AutoText - Group" ;
-    };
-    OKButton PB_OK
-    {
-        Pos = MAP_APPFONT ( 105 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Group = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton PB_CANCEL
-    {
-        Pos = MAP_APPFONT ( 105 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    HelpButton PB_HELP
-    {
-        Pos = MAP_APPFONT ( 105 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    ListBox LB_LIST
-    {
-        HelpID = "sw:ListBox:DLG_GLOSSARY_DECIDE_DLG:LB_LIST";
-        Pos = MAP_APPFONT ( 12 , 15 ) ;
-        Size = MAP_APPFONT ( 81 , 40 ) ;
-        TabStop = TRUE ;
-        Border = TRUE ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/swriter/ui/selectautotextdialog.ui b/sw/uiconfig/swriter/ui/selectautotextdialog.ui
new file mode 100644
index 0000000..255996c
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/selectautotextdialog.ui
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="SelectAutoTextDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Select AutoText:</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="frame">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkTreeView" id="treeview:border">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection1"/>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">AutoText - Group</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list