Kaydet (Commit) 1e197c5a authored tarafından Caolán McNamara's avatar Caolán McNamara

convert autotext rename dialog to .ui

Change-Id: I8cf878de00ede3c25163526a6863ec734b9815a9
üst e5a7632a
...@@ -97,6 +97,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -97,6 +97,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/previewzoomdialog \ sw/uiconfig/swriter/ui/previewzoomdialog \
sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/printeroptions \ sw/uiconfig/swriter/ui/printeroptions \
sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/renameobjectdialog \
sw/uiconfig/swriter/ui/rowheight \ sw/uiconfig/swriter/ui/rowheight \
sw/uiconfig/swriter/ui/sortdialog \ sw/uiconfig/swriter/ui/sortdialog \
......
...@@ -309,7 +309,6 @@ ...@@ -309,7 +309,6 @@
#define HID_EDIT_FORMULA "SW_HID_EDIT_FORMULA" #define HID_EDIT_FORMULA "SW_HID_EDIT_FORMULA"
#define HID_INSERT_FILE "SW_HID_INSERT_FILE" #define HID_INSERT_FILE "SW_HID_INSERT_FILE"
#define HID_FORMAT_PAGE "SW_HID_FORMAT_PAGE" #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_CONFIG_MENU "SW_HID_CONFIG_MENU"
#define HID_NAVIGATION_PI "SW_HID_NAVIGATION_PI" #define HID_NAVIGATION_PI "SW_HID_NAVIGATION_PI"
#define HID_ENVELOP_PRINT "SW_HID_ENVELOP_PRINT" #define HID_ENVELOP_PRINT "SW_HID_ENVELOP_PRINT"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define DLG_INSERT_BOOKMARK (RC_MISC_BEGIN + 17) #define DLG_INSERT_BOOKMARK (RC_MISC_BEGIN + 17)
#define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18)
#define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_SORTING (RC_MISC_BEGIN + 19)
#define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25)
#define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31) #define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31)
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#include <swerror.h> #include <swerror.h>
#include <globals.hrc> #include <globals.hrc>
#include <misc.hrc> #include <misc.hrc>
#include <glossary.hrc>
#include <swmodule.hxx> #include <swmodule.hxx>
#include <sfx2/filedlghelper.hxx> #include <sfx2/filedlghelper.hxx>
...@@ -116,17 +115,11 @@ struct GroupUserData ...@@ -116,17 +115,11 @@ struct GroupUserData
------------------------------------------------------------------------*/ ------------------------------------------------------------------------*/
class SwNewGlosNameDlg : public ModalDialog class SwNewGlosNameDlg : public ModalDialog
{ {
FixedText aNNFT; Edit* m_pNewName;
Edit aNewName; NoSpaceEdit* m_pNewShort;
FixedText aNSFT; OKButton* m_pOk;
NoSpaceEdit aNewShort; Edit* m_pOldName;
OKButton aOk; Edit* m_pOldShort;
CancelButton aCancel;
FixedText aONFT;
Edit aOldName;
FixedText aOSFT;
Edit aOldShort;
FixedLine aFL;
protected: protected:
DECL_LINK( Modify, Edit * ); DECL_LINK( Modify, Edit * );
...@@ -137,34 +130,28 @@ public: ...@@ -137,34 +130,28 @@ public:
const String& rOldName, const String& rOldName,
const String& rOldShort ); const String& rOldShort );
String GetNewName() const { return aNewName.GetText(); } String GetNewName() const { return m_pNewName->GetText(); }
String GetNewShort() const { return aNewShort.GetText(); } String GetNewShort() const { return m_pNewShort->GetText(); }
}; };
SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent, SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
const String& rOldName, const String& rOldName,
const String& rOldShort ) : const String& rOldShort )
ModalDialog( pParent, SW_RES( DLG_RENAME_GLOS ) ), : ModalDialog(pParent, "RenameAutoTextDialog",
aNNFT (this, SW_RES( FT_NN )), "modules/swriter/ui/renameautotextdialog.ui")
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 ))
{ {
FreeResource(); get(m_pNewName, "newname");
aOldName.SetText( rOldName ); get(m_pNewShort, "newsc");
aOldShort.SetText( rOldShort ); get(m_pOk, "ok");
aNewName.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify )); get(m_pOldName, "oldname");
aNewShort.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify )); get(m_pOldShort, "oldsc");
aOk.SetClickHdl(LINK(this, SwNewGlosNameDlg, Rename ));
aNewName.GrabFocus(); 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) ...@@ -794,28 +781,28 @@ IMPL_LINK_NOARG_INLINE_END(SwGlossaryDlg, EditHdl)
------------------------------------------------------------------------*/ ------------------------------------------------------------------------*/
IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox )
{ {
OUString aName(aNewName.GetText()); OUString aName(m_pNewName->GetText());
SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent(); SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent();
if( pBox == &aNewName ) if (pBox == m_pNewName)
aNewShort.SetText( lcl_GetValidShortCut( aName ) ); m_pNewShort->SetText( lcl_GetValidShortCut( aName ) );
sal_Bool bEnable = !aName.isEmpty() && !aNewShort.GetText().isEmpty() && sal_Bool bEnable = !aName.isEmpty() && !m_pNewShort->GetText().isEmpty() &&
(!pDlg->DoesBlockExist(aName, aNewShort.GetText()) (!pDlg->DoesBlockExist(aName, m_pNewShort->GetText())
|| aName == aOldName.GetText()); || aName == m_pOldName->GetText());
aOk.Enable(bEnable); m_pOk->Enable(bEnable);
return 0; return 0;
} }
IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename) IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename)
{ {
SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent(); SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent();
OUString sNew = GetAppCharClass().uppercase(aNewShort.GetText()); OUString sNew = GetAppCharClass().uppercase(m_pNewShort->GetText());
if( pDlg->pGlossaryHdl->HasShortName(aNewShort.GetText()) if( pDlg->pGlossaryHdl->HasShortName(m_pNewShort->GetText())
&& sNew != aOldShort.GetText() ) && sNew != m_pOldShort->GetText() )
{ {
InfoBox(this, SW_RES(MSG_DOUBLE_SHORTNAME)).Execute(); InfoBox(this, SW_RES(MSG_DOUBLE_SHORTNAME)).Execute();
aNewShort.GrabFocus(); m_pNewShort->GrabFocus();
} }
else else
EndDialog(sal_True); EndDialog(sal_True);
......
/* -*- 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: */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include "misc.hrc" #include "misc.hrc"
#include "glossary.hrc"
#include "cmdid.h" #include "cmdid.h"
#include "helpid.h" #include "helpid.h"
#include "access.hrc" #include "access.hrc"
...@@ -45,94 +44,6 @@ String STR_GLOSSARY ...@@ -45,94 +44,6 @@ String STR_GLOSSARY
{ {
Text [ en-US ] = "AutoText :" ; 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 String STR_SAVE_GLOSSARY
{ {
Text[ en-US ] = "Save AutoText"; Text[ en-US ] = "Save AutoText";
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment