From bb0b3df6774ffd5333d2413c056540fbcbdc052a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 25 Apr 2013 16:44:12 +0100 Subject: convert auto abstract dialog to .ui Change-Id: Iaed5429c61c5655d81d0010c4b56e8889aa5f29b --- sw/AllLangResTarget_sw.mk | 1 - sw/UIConfig_swriter.mk | 1 + sw/inc/helpid.h | 1 - sw/source/ui/dialog/abstract.cxx | 32 +---- sw/source/ui/dialog/abstract.hrc | 30 ----- sw/source/ui/dialog/abstract.src | 110 ---------------- sw/source/ui/inc/abstract.hxx | 20 +-- sw/uiconfig/swriter/ui/abstractdialog.ui | 218 +++++++++++++++++++++++++++++++ 8 files changed, 229 insertions(+), 184 deletions(-) delete mode 100644 sw/source/ui/dialog/abstract.hrc delete mode 100644 sw/source/ui/dialog/abstract.src create mode 100644 sw/uiconfig/swriter/ui/abstractdialog.ui diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 921d60811256..922d85b36fb1 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -93,7 +93,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/dbui/mmoutputtypepage.src \ sw/source/ui/dbui/mmpreparemergepage.src \ sw/source/ui/dbui/selectdbtabledialog.src \ - sw/source/ui/dialog/abstract.src \ sw/source/ui/dialog/dialog.src \ sw/source/ui/dialog/regionsw.src \ sw/source/ui/dochdl/dochdl.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 0343d215e0b7..6af0654eed87 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swriter,\ )) $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ + sw/uiconfig/swriter/ui/abstractdialog \ sw/uiconfig/swriter/ui/asciifilterdialog \ sw/uiconfig/swriter/ui/autoformattable \ sw/uiconfig/swriter/ui/autotext \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index f5095ba562df..85b6d8190b2d 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -65,7 +65,6 @@ #define HID_VS_NUM "SW_HID_VS_NUM" #define HID_VS_BULLET "SW_HID_VS_BULLET" #define HID_VS_NUMBMP "SW_HID_VS_NUMBMP" -#define HID_INSERT_ABSTRACT "SW_HID_INSERT_ABSTRACT" #define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1" #define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2" #define HID_NAVI_TBX3 "SW_HID_NAVI_TBX3" diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx index 822aa2a3a519..8b18722fb888 100644 --- a/sw/source/ui/dialog/abstract.cxx +++ b/sw/source/ui/dialog/abstract.cxx @@ -22,41 +22,23 @@ #include "dialog.hrc" #include "abstract.hxx" -#include "abstract.hrc" - -SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) : - SfxModalDialog(pParent, SW_RES(DLG_INSERT_ABSTRACT)), - aFL (this, SW_RES(FL_1 )), - aLevelFT(this, SW_RES(FT_LEVEL )), - aLevelNF(this, SW_RES(NF_LEVEL )), - aParaFT (this, SW_RES(FT_PARA )), - aParaNF (this, SW_RES(NF_PARA )), - aDescFT (this, SW_RES(FT_DESC )), - aOkPB (this, SW_RES(PB_OK )), - aCancelPB (this, SW_RES(PB_CANCEL )), - aHelpPB (this, SW_RES(PB_HELP )) -{ - FreeResource(); -} - -SwInsertAbstractDlg::~SwInsertAbstractDlg() +SwInsertAbstractDlg::SwInsertAbstractDlg(Window* pParent) + : SfxModalDialog(pParent, "AbstractDialog", + "modules/swriter/ui/abstractdialog.ui") { + get(m_pLevelNF, "outlines"); + get(m_pParaNF, "paras"); } sal_uInt8 SwInsertAbstractDlg::GetLevel() const { - return static_cast< sal_uInt8 >(aLevelNF.GetValue() - 1); + return static_cast(m_pLevelNF->GetValue() - 1); } sal_uInt8 SwInsertAbstractDlg::GetPara() const { - return (sal_uInt8) aParaNF.GetValue(); + return static_cast(m_pParaNF->GetValue()); } - - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.hrc b/sw/source/ui/dialog/abstract.hrc deleted file mode 100644 index b2d24bfe27b6..000000000000 --- a/sw/source/ui/dialog/abstract.hrc +++ /dev/null @@ -1,30 +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 . - */ - -#define FL_1 1 -#define FT_PARA 2 -#define NF_PARA 3 -#define FT_LEVEL 4 -#define NF_LEVEL 5 -#define FT_DESC 6 -#define PB_OK 7 -#define PB_CANCEL 8 -#define PB_HELP 9 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src deleted file mode 100644 index b2341a3cdadc..000000000000 --- a/sw/source/ui/dialog/abstract.src +++ /dev/null @@ -1,110 +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 "dialog.hrc" -#include "helpid.h" -#include "abstract.hrc" - -ModalDialog DLG_INSERT_ABSTRACT -{ - HelpID = HID_INSERT_ABSTRACT ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 239 , 68 ) ; - Moveable = TRUE ; - FixedLine FL_1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "Properties" ; - }; - FixedText FT_LEVEL - { - Pos = MAP_APPFONT ( 12 , 12 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Included outline levels" ; - }; - NumericField NF_LEVEL - { - HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_LEVEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 153 , 12 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 5 ; - Value = 3 ; - First = 1 ; - Last = 5 ; - }; - FixedText FT_PARA - { - Pos = MAP_APPFONT ( 12 , 27 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Paragraphs per level" ; - }; - NumericField NF_PARA - { - HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_PARA"; - Border = TRUE ; - Pos = MAP_APPFONT ( 153 , 27 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 5 ; - Value = 1 ; - First = 1 ; - Last = 5 ; - }; - FixedText FT_DESC - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 165 , 16 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "The abstract contains the selected number of paragraphs from the included outline levels." ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 186 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 186 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 186 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - Text [ en-US ] = "Create AutoAbstract" ; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/abstract.hxx b/sw/source/ui/inc/abstract.hxx index 7591a12db244..e69cd1fed502 100644 --- a/sw/source/ui/inc/abstract.hxx +++ b/sw/source/ui/inc/abstract.hxx @@ -21,29 +21,17 @@ #include -#include - #include -#include - -class SwInsertAbstractDlg : public SfxModalDialog +class SwInsertAbstractDlg : public SfxModalDialog { - FixedLine aFL; - FixedText aLevelFT; - NumericField aLevelNF; - FixedText aParaFT; - NumericField aParaNF; - FixedText aDescFT; - OKButton aOkPB; - CancelButton aCancelPB; - HelpButton aHelpPB; + NumericField* m_pLevelNF; + NumericField* m_pParaNF; protected: public: SwInsertAbstractDlg( Window* pParent ); - ~SwInsertAbstractDlg(); sal_uInt8 GetLevel() const; sal_uInt8 GetPara() const; @@ -51,6 +39,4 @@ public: #endif - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/abstractdialog.ui b/sw/uiconfig/swriter/ui/abstractdialog.ui new file mode 100644 index 000000000000..b3b4ea64c588 --- /dev/null +++ b/sw/uiconfig/swriter/ui/abstractdialog.ui @@ -0,0 +1,218 @@ + + + + + 1 + 5 + 3 + 1 + 10 + + + 1 + 5 + 1 + 1 + 10 + + + False + 6 + Create AutoAbstract + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 6 + 12 + + + True + False + True + 0 + Included outline levels + True + + + 0 + 0 + 1 + 1 + + + + + True + False + True + 0 + Paragraphs per level + True + + + 0 + 1 + 1 + 1 + + + + + True + False + True + 0 + The abstract contains the selected number of paragraphs from the included outline levels. + True + True + 52 + + + 0 + 2 + 2 + 1 + + + + + True + True + end + + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + True + True + end + + True + adjustment2 + + + 1 + 1 + 1 + 1 + + + + + + + + + True + False + Properties + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit