diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-25 16:44:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-25 17:06:53 +0100 |
commit | bb0b3df6774ffd5333d2413c056540fbcbdc052a (patch) | |
tree | a6d4a9e3cb93f2f28fc7162ad2e7da432fe277b3 | |
parent | 29cdabb8532c4da0b89a82f9d4e2bb9ee6851621 (diff) |
convert auto abstract dialog to .ui
Change-Id: Iaed5429c61c5655d81d0010c4b56e8889aa5f29b
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/source/ui/dialog/abstract.cxx | 32 | ||||
-rw-r--r-- | sw/source/ui/dialog/abstract.hrc | 30 | ||||
-rw-r--r-- | sw/source/ui/dialog/abstract.src | 110 | ||||
-rw-r--r-- | sw/source/ui/inc/abstract.hxx | 20 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/abstractdialog.ui | 218 |
8 files changed, 229 insertions, 184 deletions
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<sal_uInt8>(m_pLevelNF->GetValue() - 1); } sal_uInt8 SwInsertAbstractDlg::GetPara() const { - return (sal_uInt8) aParaNF.GetValue(); + return static_cast<sal_uInt8>(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 <sfx2/basedlgs.hxx> -#include <vcl/fixed.hxx> - #include <vcl/field.hxx> -#include <vcl/button.hxx> - -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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">5</property> + <property name="value">3</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">1</property> + <property name="upper">5</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkDialog" id="AbstractDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Create AutoAbstract</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="frame1"> + <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="hexpand">True</property> + <property name="vexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">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="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Included outline levels</property> + <property name="use_underline">True</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="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Paragraphs per level</property> + <property name="use_underline">True</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="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">The abstract contains the selected number of paragraphs from the included outline levels.</property> + <property name="use_underline">True</property> + <property name="wrap">True</property> + <property name="max_width_chars">52</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="outlines"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="halign">end</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment1</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="GtkSpinButton" id="paras"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="halign">end</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment2</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> + </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">Properties</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> |