summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-03 08:45:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-03 09:04:50 +0100
commit58fe754c70b64ee5152197b24c3e0cf92d4122ed (patch)
treebd40b9cb89618f2f735af55b05fd21088c6242ea /sw
parent8b90ad8af9d72937109ded62609731033558dd84 (diff)
convert select index dialog to .ui
Change-Id: I49a3d67e9c22c1608354b732f8aee27afcf15885
Diffstat (limited to 'sw')
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/index.hrc2
-rw-r--r--sw/inc/swabstdlg.hxx3
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx17
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx3
-rw-r--r--sw/source/ui/inc/multmrk.hxx13
-rw-r--r--sw/source/ui/index/multmrk.cxx37
-rw-r--r--sw/source/ui/index/multmrk.hrc27
-rw-r--r--sw/source/ui/index/multmrk.src82
-rw-r--r--sw/source/ui/shells/textidx.cxx3
-rw-r--r--sw/uiconfig/swriter/ui/selectindexdialog.ui131
12 files changed, 157 insertions, 163 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 148ad76a8cc7..e2c30a59e296 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -103,7 +103,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/globdoc/globdoc.src \
sw/source/ui/index/cnttab.src \
sw/source/ui/index/idxmrk.src \
- sw/source/ui/index/multmrk.src \
sw/source/ui/lingu/olmenu.src \
sw/source/ui/misc/glossary.src \
sw/source/ui/misc/numberingtypelistbox.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index ceb96115808d..d50ba65346b5 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -166,6 +166,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/savelabeldialog \
sw/uiconfig/swriter/ui/sectionpage \
sw/uiconfig/swriter/ui/selectautotextdialog \
+ sw/uiconfig/swriter/ui/selectindexdialog \
sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sidebarwrap \
sw/uiconfig/swriter/ui/sortdialog \
diff --git a/sw/inc/index.hrc b/sw/inc/index.hrc
index d9fad1461667..bdb77968a19e 100644
--- a/sw/inc/index.hrc
+++ b/sw/inc/index.hrc
@@ -26,8 +26,6 @@
#include "rcid.hrc"
-#define DLG_MULTMRK (RC_INDEX_BEGIN + 5)
-
#define STR_TITLE (RC_INDEX_BEGIN + 6)
#define STR_ALPHA (RC_INDEX_BEGIN + 7)
#define STR_LEVEL (RC_INDEX_BEGIN + 8)
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index b2a5fbb2b342..aa1d02bd54e0 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -424,8 +424,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ) = 0;
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent) = 0;
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent) = 0;
- virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
- Window* pParent, SwTOXMgr &rTOXMgr ) = 0;
+ virtual VclAbstractDialog* CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr) = 0;
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index e07cc8b483c2..cd2d333f2931 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1023,21 +1023,10 @@ AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailM
return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
}
-VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId,
- Window* pParent, SwTOXMgr &rTOXMgr )
+VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr)
{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_MULTMRK :
- pDlg = new SwMultiTOXMarkDlg( pParent, rTOXMgr );
- break;
- default:
- break;
- }
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
+ Dialog* pDlg = new SwMultiTOXMarkDlg(pParent, rTOXMgr);
+ return new VclAbstractDialog_Impl(pDlg);
}
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 77aa49c5c2f9..a0b113c20ca9 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -469,8 +469,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 );
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent);
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent);
- virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
- Window* pParent, SwTOXMgr &rTOXMgr );
+ virtual VclAbstractDialog* CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr);
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/inc/multmrk.hxx b/sw/source/ui/inc/multmrk.hxx
index 13e5ab98609e..e30292d60f92 100644
--- a/sw/source/ui/inc/multmrk.hxx
+++ b/sw/source/ui/inc/multmrk.hxx
@@ -37,15 +37,10 @@ class SwMultiTOXMarkDlg : public SvxStandardDialog
{
DECL_LINK( SelectHdl, ListBox * );
- FixedLine aTOXFL;
- FixedText aEntryFT;
- FixedInfo aTextFT;
- FixedText aTOXFT;
- ListBox aTOXLB;
- OKButton aOkBT;
- CancelButton aCancelBT;
-
- SwTOXMgr &rMgr;
+ FixedText* m_pTextFT;
+ ListBox* m_pTOXLB;
+
+ SwTOXMgr& rMgr;
sal_uInt16 nPos;
void Apply();
diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx
index f5a30c558753..6959487a008f 100644
--- a/sw/source/ui/index/multmrk.cxx
+++ b/sw/source/ui/index/multmrk.cxx
@@ -23,41 +23,34 @@
#include "toxmgr.hxx"
#include "index.hrc"
-#include "multmrk.hrc"
-SwMultiTOXMarkDlg::SwMultiTOXMarkDlg( Window* pParent, SwTOXMgr& rTOXMgr ) :
-
- SvxStandardDialog(pParent, SW_RES(DLG_MULTMRK)),
-
- aTOXFL(this, SW_RES(FL_TOX)),
- aEntryFT(this, SW_RES(FT_ENTRY)),
- aTextFT(this, SW_RES(FT_TEXT)),
- aTOXFT(this, SW_RES(FT_TOX)),
- aTOXLB(this, SW_RES(LB_TOX)),
- aOkBT(this, SW_RES(OK_BT)),
- aCancelBT(this, SW_RES(CANCEL_BT)),
- rMgr( rTOXMgr ),
- nPos(0)
+SwMultiTOXMarkDlg::SwMultiTOXMarkDlg(Window* pParent, SwTOXMgr& rTOXMgr)
+ : SvxStandardDialog(pParent, "SelectIndexDialog",
+ "modules/swriter/ui/selectindexdialog.ui")
+ , rMgr(rTOXMgr)
+ , nPos(0)
{
- aTOXLB.SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
+ get(m_pTextFT, "type");
+ get(m_pTOXLB, "treeview");
+ m_pTOXLB->set_height_request(m_pTOXLB->GetTextHeight() * 10);
+ m_pTOXLB->set_width_request(m_pTOXLB->approximate_char_width() * 25);
+
+ m_pTOXLB->SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
sal_uInt16 nSize = rMgr.GetTOXMarkCount();
for(sal_uInt16 i=0; i < nSize; ++i)
- aTOXLB.InsertEntry(rMgr.GetTOXMark(i)->GetText());
+ m_pTOXLB->InsertEntry(rMgr.GetTOXMark(i)->GetText());
- aTOXLB.SelectEntryPos(0);
- aTextFT.SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
-
- FreeResource();
+ m_pTOXLB->SelectEntryPos(0);
+ m_pTextFT->SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
}
-
IMPL_LINK_INLINE_START( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
{
if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
{ SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos());
- aTextFT.SetText(pMark->GetTOXType()->GetTypeName());
+ m_pTextFT->SetText(pMark->GetTOXType()->GetTypeName());
nPos = pBox->GetSelectEntryPos();
}
return 0;
diff --git a/sw/source/ui/index/multmrk.hrc b/sw/source/ui/index/multmrk.hrc
deleted file mode 100644
index 949f850dd299..000000000000
--- a/sw/source/ui/index/multmrk.hrc
+++ /dev/null
@@ -1,27 +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 FT_ENTRY 1
-#define FT_TOX 2
-#define OK_BT 3
-#define LB_TOX 4
-#define FT_TEXT 5
-#define FL_TOX 6
-#define CANCEL_BT 7
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/multmrk.src b/sw/source/ui/index/multmrk.src
deleted file mode 100644
index d79e9426dd2d..000000000000
--- a/sw/source/ui/index/multmrk.src
+++ /dev/null
@@ -1,82 +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 "index.hrc"
-#include "multmrk.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_MULTMRK
-{
- HelpID = CMD_FN_EDIT_IDX_ENTRY_DLG ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 220 , 95 ) ;
- Text [ en-US ] = "Index Markings" ;
- Moveable = TRUE ;
- FixedLine FL_TOX
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 153 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- FixedText FT_ENTRY
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Index" ;
- Left = TRUE ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 53 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Left = TRUE ;
- };
- FixedText FT_TOX
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Entry" ;
- Left = TRUE ;
- };
- ListBox LB_TOX
- {
- HelpID = "sw:ListBox:DLG_MULTMRK:LB_TOX";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 37 ) ;
- Size = MAP_APPFONT ( 100 , 49 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- };
- OKButton OK_BT
- {
- Pos = MAP_APPFONT ( 165 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton CANCEL_BT
- {
- Pos = MAP_APPFONT ( 165 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index 8c7af10769ee..4ceb302e907f 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -85,8 +85,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{ // Several marks, which should it be?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
- VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK,
- pMDI, aMgr);
+ VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg(pMDI, aMgr);
OSL_ENSURE(pMultDlg, "Dialogdiet fail!");
nRet = pMultDlg->Execute();
delete pMultDlg;
diff --git a/sw/uiconfig/swriter/ui/selectindexdialog.ui b/sw/uiconfig/swriter/ui/selectindexdialog.ui
new file mode 100644
index 000000000000..482ea0cd1b72
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/selectindexdialog.ui
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="SelectIndexDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Index Markings</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>
+ </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="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="type">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">treeview:border</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">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">Selection</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-widgets>
+ </object>
+</interface>