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

Caolán McNamara caolanm at redhat.com
Fri Apr 26 08:11:12 PDT 2013


 helpcontent2                                   |    2 
 sw/UIConfig_swriter.mk                         |    1 
 sw/inc/helpid.h                                |    1 
 sw/source/ui/inc/misc.hrc                      |    1 
 sw/source/ui/misc/glossary.cxx                 |   79 +++-----
 sw/source/ui/misc/glossary.hrc                 |   44 ----
 sw/source/ui/misc/glossary.src                 |   89 ---------
 sw/uiconfig/swriter/ui/renameautotextdialog.ui |  240 +++++++++++++++++++++++++
 8 files changed, 275 insertions(+), 182 deletions(-)

New commits:
commit 1e197c5a41e45f0d0ae211518aee93339392973c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 26 15:37:22 2013 +0100

    convert autotext rename dialog to .ui
    
    Change-Id: I8cf878de00ede3c25163526a6863ec734b9815a9

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 2341919..2486c93 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -97,6 +97,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/previewzoomdialog \
 	sw/uiconfig/swriter/ui/printoptionspage \
 	sw/uiconfig/swriter/ui/printeroptions \
+	sw/uiconfig/swriter/ui/renameautotextdialog \
 	sw/uiconfig/swriter/ui/renameobjectdialog \
 	sw/uiconfig/swriter/ui/rowheight \
 	sw/uiconfig/swriter/ui/sortdialog \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index ab344ca..4a3473c 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -309,7 +309,6 @@
 #define HID_EDIT_FORMULA                                        "SW_HID_EDIT_FORMULA"
 #define HID_INSERT_FILE                                         "SW_HID_INSERT_FILE"
 #define HID_FORMAT_PAGE                                         "SW_HID_FORMAT_PAGE"
-#define HID_RENAME_GLOSSARY                                     "SW_HID_RENAME_GLOSSARY"
 #define HID_CONFIG_MENU                                         "SW_HID_CONFIG_MENU"
 #define HID_NAVIGATION_PI                                       "SW_HID_NAVIGATION_PI"
 #define HID_ENVELOP_PRINT                                       "SW_HID_ENVELOP_PRINT"
diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc
index c8a4f7d..aa37171a 100644
--- a/sw/source/ui/inc/misc.hrc
+++ b/sw/source/ui/inc/misc.hrc
@@ -26,7 +26,6 @@
 #define DLG_INSERT_BOOKMARK         (RC_MISC_BEGIN + 17)
 #define DLG_NUM_NAMES               (RC_MISC_BEGIN + 18)
 #define DLG_SORTING                 (RC_MISC_BEGIN + 19)
-#define DLG_RENAME_GLOS             (RC_MISC_BEGIN + 25)
 
 #define DLG_TAB_OUTLINE             (RC_MISC_BEGIN + 31)
 
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 1e275db..3494051 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -64,7 +64,6 @@
 #include <swerror.h>
 #include <globals.hrc>
 #include <misc.hrc>
-#include <glossary.hrc>
 #include <swmodule.hxx>
 #include <sfx2/filedlghelper.hxx>
 
@@ -116,17 +115,11 @@ struct GroupUserData
 ------------------------------------------------------------------------*/
 class SwNewGlosNameDlg : public ModalDialog
 {
-    FixedText       aNNFT;
-    Edit            aNewName;
-    FixedText       aNSFT;
-    NoSpaceEdit     aNewShort;
-    OKButton        aOk;
-    CancelButton    aCancel;
-    FixedText       aONFT;
-    Edit            aOldName;
-    FixedText       aOSFT;
-    Edit            aOldShort;
-    FixedLine       aFL;
+    Edit*        m_pNewName;
+    NoSpaceEdit* m_pNewShort;
+    OKButton*    m_pOk;
+    Edit*        m_pOldName;
+    Edit*        m_pOldShort;
 
 protected:
     DECL_LINK( Modify, Edit * );
@@ -137,34 +130,28 @@ public:
                       const String& rOldName,
                       const String& rOldShort );
 
-    String GetNewName()  const { return aNewName.GetText(); }
-    String GetNewShort() const { return aNewShort.GetText(); }
+    String GetNewName()  const { return m_pNewName->GetText(); }
+    String GetNewShort() const { return m_pNewShort->GetText(); }
 };
 
 SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
                             const String& rOldName,
-                            const String& rOldShort ) :
-    ModalDialog( pParent, SW_RES( DLG_RENAME_GLOS ) ),
-    aNNFT   (this, SW_RES( FT_NN    )),
-    aNewName(this, SW_RES( ED_NN    )),
-    aNSFT   (this, SW_RES( FT_NS    )),
-    aNewShort(this,SW_RES( ED_NS    )),
-    aOk     (this, SW_RES( BT_OKNEW)),
-    aCancel (this, SW_RES( BT_CANCEL)),
-    aONFT   (this, SW_RES( FT_ON    )),
-    aOldName(this, SW_RES( ED_ON    )),
-    aOSFT   (this, SW_RES( FT_OS    )),
-    aOldShort(this,SW_RES( ED_OS    )),
-    aFL    (this, SW_RES( FL_NN    ))
-
+                            const String& rOldShort )
+    : ModalDialog(pParent, "RenameAutoTextDialog",
+        "modules/swriter/ui/renameautotextdialog.ui")
 {
-    FreeResource();
-    aOldName.SetText( rOldName );
-    aOldShort.SetText( rOldShort );
-    aNewName.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
-    aNewShort.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
-    aOk.SetClickHdl(LINK(this, SwNewGlosNameDlg, Rename ));
-    aNewName.GrabFocus();
+    get(m_pNewName, "newname");
+    get(m_pNewShort, "newsc");
+    get(m_pOk, "ok");
+    get(m_pOldName, "oldname");
+    get(m_pOldShort, "oldsc");
+
+    m_pOldName->SetText( rOldName );
+    m_pOldShort->SetText( rOldShort );
+    m_pNewName->SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
+    m_pNewShort->SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
+    m_pOk->SetClickHdl(LINK(this, SwNewGlosNameDlg, Rename ));
+    m_pNewName->GrabFocus();
 }
 
 /*------------------------------------------------------------------------
@@ -794,28 +781,28 @@ IMPL_LINK_NOARG_INLINE_END(SwGlossaryDlg, EditHdl)
 ------------------------------------------------------------------------*/
 IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox )
 {
-    OUString aName(aNewName.GetText());
+    OUString aName(m_pNewName->GetText());
     SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent();
 
-    if( pBox == &aNewName )
-        aNewShort.SetText( lcl_GetValidShortCut( aName ) );
+    if (pBox == m_pNewName)
+        m_pNewShort->SetText( lcl_GetValidShortCut( aName ) );
 
-    sal_Bool bEnable = !aName.isEmpty() && !aNewShort.GetText().isEmpty() &&
-        (!pDlg->DoesBlockExist(aName, aNewShort.GetText())
-            || aName == aOldName.GetText());
-    aOk.Enable(bEnable);
+    sal_Bool bEnable = !aName.isEmpty() && !m_pNewShort->GetText().isEmpty() &&
+        (!pDlg->DoesBlockExist(aName, m_pNewShort->GetText())
+            || aName == m_pOldName->GetText());
+    m_pOk->Enable(bEnable);
     return 0;
 }
 
 IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename)
 {
     SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent();
-    OUString sNew = GetAppCharClass().uppercase(aNewShort.GetText());
-    if( pDlg->pGlossaryHdl->HasShortName(aNewShort.GetText())
-        && sNew != aOldShort.GetText() )
+    OUString sNew = GetAppCharClass().uppercase(m_pNewShort->GetText());
+    if( pDlg->pGlossaryHdl->HasShortName(m_pNewShort->GetText())
+        && sNew != m_pOldShort->GetText() )
     {
         InfoBox(this, SW_RES(MSG_DOUBLE_SHORTNAME)).Execute();
-        aNewShort.GrabFocus();
+        m_pNewShort->GrabFocus();
     }
     else
         EndDialog(sal_True);
diff --git a/sw/source/ui/misc/glossary.hrc b/sw/source/ui/misc/glossary.hrc
deleted file mode 100644
index a322001..0000000
--- a/sw/source/ui/misc/glossary.hrc
+++ /dev/null
@@ -1,44 +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 .
- */
-
-// Box library text blocks
-#define FL_EDIT                         1
-
-#define PB_NEW              10
-#define PB_DELETE           11
-
-#define BT_OK               100
-
-// both
-#define LB_BIB              80
-
-// Dialog name changing
-#define   FT_ON              1
-#define   FT_OS              2
-#define   FT_NN              3
-#define   FT_NS              4
-#define   ED_ON              5
-#define   ED_OS              6
-#define   ED_NN              7
-#define   ED_NS              8
-#define   FL_NN              9
-#define   BT_CANCEL         10
-#define   BT_OKNEW          11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index cec19cc..020f03e 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -18,7 +18,6 @@
  */
 
 #include "misc.hrc"
-#include "glossary.hrc"
 #include "cmdid.h"
 #include "helpid.h"
 #include "access.hrc"
@@ -45,94 +44,6 @@ String STR_GLOSSARY
 {
     Text [ en-US ] = "AutoText :" ;
 };
-ModalDialog DLG_RENAME_GLOS
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 287 , 47 ) ;
-    Moveable = TRUE ;
-    HelpID = HID_RENAME_GLOSSARY ;
-    OKButton BT_OKNEW
-    {
-        Disable = TRUE ;
-        Pos = MAP_APPFONT ( 231 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        DefButton = TRUE ;
-        TabStop = TRUE ;
-    };
-    CancelButton BT_CANCEL
-    {
-        Pos = MAP_APPFONT ( 231 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_ON
-    {
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 30 , 8 ) ;
-        Text [ en-US ] = "Na~me" ;
-    };
-    Edit ED_ON
-    {
-        HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_ON";
-        ReadOnly = TRUE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 44 , 12 ) ;
-        Size = MAP_APPFONT ( 100 , 12 ) ;
-        Left = TRUE ;
-    };
-    FixedText FT_OS
-    {
-        Pos = MAP_APPFONT ( 147 , 14 ) ;
-        Size = MAP_APPFONT ( 52 , 8 ) ;
-        Text [ en-US ] = "Short~cut" ;
-    };
-    Edit ED_OS
-    {
-        HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_OS";
-        ReadOnly = TRUE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 200 , 12 ) ;
-        Size = MAP_APPFONT ( 21 , 12 ) ;
-        Left = TRUE ;
-    };
-    FixedText FT_NN
-    {
-        Pos = MAP_APPFONT ( 12 , 29 ) ;
-        Size = MAP_APPFONT ( 30 , 8 ) ;
-        Text [ en-US ] = "~New" ;
-    };
-    Edit ED_NN
-    {
-        HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_NN";
-        TabStop = TRUE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 44 , 27 ) ;
-        Size = MAP_APPFONT ( 100 , 12 ) ;
-        Left = TRUE ;
-    };
-    FixedText FT_NS
-    {
-        Pos = MAP_APPFONT ( 147 , 29 ) ;
-        Size = MAP_APPFONT ( 52 , 8 ) ;
-        Text [ en-US ] = "~Shortcut" ;
-    };
-    Edit ED_NS
-    {
-        HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_NS";
-        TabStop = TRUE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 200 , 27 ) ;
-        Size = MAP_APPFONT ( 21 , 12 ) ;
-        Left = TRUE ;
-    };
-    FixedLine FL_NN
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 219 , 8 ) ;
-    };
-    Text [ en-US ] = "Rename AutoText" ;
-};
 String STR_SAVE_GLOSSARY
 {
     Text[ en-US ] = "Save AutoText";
diff --git a/sw/uiconfig/swriter/ui/renameautotextdialog.ui b/sw/uiconfig/swriter/ui/renameautotextdialog.ui
new file mode 100644
index 0000000..fda9dd7
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/renameautotextdialog.ui
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkDialog" id="RenameAutoTextDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Rename 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="sensitive">False</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>
+          </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="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="column_spacing">18</property>
+            <child>
+              <object class="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">12</property>
+                <child>
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="double_buffered">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Na_me</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">oldname</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="double_buffered">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">_New</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">newname</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkEntry" id="oldname">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">●</property>
+                    <property name="width_chars">32</property>
+                    <property name="invisible_char_set">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkEntry" id="newname">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="max_length">60</property>
+                    <property name="invisible_char">●</property>
+                    <property name="width_chars">32</property>
+                    <property name="invisible_char_set">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">12</property>
+                <child>
+                  <object class="GtkLabel" id="label4">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="double_buffered">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Short_cut</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">oldsc</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label5">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="double_buffered">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">_Shortcut</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">newsc</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkEntry" id="oldsc">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">●</property>
+                    <property name="width_chars">6</property>
+                    <property name="invisible_char_set">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="swlo-NoSpaceEdit" id="newsc">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">●</property>
+                    <property name="width_chars">6</property>
+                    <property name="invisible_char_set">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </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-widgets>
+  </object>
+</interface>
commit e5a7632a89f5e2daa28a65cbf00b12a94e7996b3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 26 15:59:06 2013 +0100

    Updated core
    Project: help  8f801b3f17f4d9ce1bb0fdce61e2ec35f6ab0538

diff --git a/helpcontent2 b/helpcontent2
index 5770cef..8f801b3 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 5770cefc9216a002005b0ae5442cd9163cfc6195
+Subproject commit 8f801b3f17f4d9ce1bb0fdce61e2ec35f6ab0538


More information about the Libreoffice-commits mailing list