diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-26 14:00:22 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-27 11:16:12 +0200 |
commit | c9483451aaeea5c47726336c7b465c7618e1d37e (patch) | |
tree | ed321622b03190a482fee81b100a27fdf827a9e7 /sw/source/ui/dbui | |
parent | b3a8056a499ca2a5cb809fcec52aebddd4e17f23 (diff) |
convert mailmerge select page to .ui
Change-Id: I34f527ff8e1e9819f4e6ac728efa1e31f8bc3d48
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.cxx | 85 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.hrc | 31 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.hxx | 22 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.src | 99 |
4 files changed, 50 insertions, 187 deletions
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index c8551a5ef25c..de3b9599e43a 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -33,7 +33,6 @@ #include <mmconfigitem.hxx> #include <dbui.hrc> -#include <mmdocselectpage.hrc> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include <com/sun/star/ui/dialogs/XFilePicker.hpp> @@ -44,54 +43,50 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace svt; -SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent ) : - svt::OWizardPage(_pParent, SW_RES(DLG_MM_DOCSELECT_PAGE)), -#ifdef _MSC_VER -#pragma warning (disable : 4355) -#endif - m_aHeaderFI(this, SW_RES( FI_HEADER ) ), - m_aHowToFT (this, SW_RES( FT_HOWTO )), - m_aCurrentDocRB (this, SW_RES( RB_CURRENTDOC )), - m_aNewDocRB (this, SW_RES( RB_NEWDOC )), - m_aLoadDocRB (this, SW_RES( RB_LOADDOC )), - m_aLoadTemplateRB (this, SW_RES( RB_LOADTEMPLATE )), - m_aRecentDocRB (this, SW_RES( RB_RECENTDOC )), - m_aBrowseDocPB (this, SW_RES( PB_LOADDOC )), - m_aBrowseTemplatePB (this, SW_RES( PB_BROWSETEMPLATE )), - m_aRecentDocLB (this, SW_RES( LB_RECENTDOC )), -#ifdef _MSC_VER -#pragma warning (default : 4355) -#endif - m_pWizard(_pParent) +SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(SwMailMergeWizard* pParent) + : svt::OWizardPage(pParent, "MMSelectPage", + "modules/swriter/ui/mmselectpage.ui") + , m_pWizard(pParent) { - FreeResource(); - - m_aCurrentDocRB.Check(); - DocSelectHdl(&m_aNewDocRB); + get(m_pCurrentDocRB, "currentdoc"); + get(m_pNewDocRB, "newdoc"); + get(m_pLoadDocRB, "loaddoc"); + get(m_pLoadTemplateRB, "template"); + get(m_pRecentDocRB, "recentdoc"); + get(m_pBrowseDocPB, "browsedoc"); + get(m_pBrowseTemplatePB, "browsetemplate"); + get(m_pRecentDocLB, "recentdoclb"); + + m_pCurrentDocRB->Check(); + DocSelectHdl(m_pNewDocRB); Link aDocSelectLink = LINK(this, SwMailMergeDocSelectPage, DocSelectHdl); - m_aCurrentDocRB.SetClickHdl(aDocSelectLink); - m_aNewDocRB.SetClickHdl(aDocSelectLink); - m_aLoadDocRB.SetClickHdl(aDocSelectLink); - m_aLoadTemplateRB.SetClickHdl(aDocSelectLink); - m_aRecentDocRB.SetClickHdl(aDocSelectLink); + m_pCurrentDocRB->SetClickHdl(aDocSelectLink); + m_pNewDocRB->SetClickHdl(aDocSelectLink); + m_pLoadDocRB->SetClickHdl(aDocSelectLink); + m_pLoadTemplateRB->SetClickHdl(aDocSelectLink); + m_pRecentDocRB->SetClickHdl(aDocSelectLink); Link aFileSelectHdl = LINK(this, SwMailMergeDocSelectPage, FileSelectHdl); - m_aBrowseDocPB.SetClickHdl(aFileSelectHdl); - m_aBrowseTemplatePB.SetClickHdl(aFileSelectHdl); + m_pBrowseDocPB->SetClickHdl(aFileSelectHdl); + m_pBrowseTemplatePB->SetClickHdl(aFileSelectHdl); const uno::Sequence< OUString >& rDocs = m_pWizard->GetConfigItem().GetSavedDocuments(); for(sal_Int32 nDoc = 0; nDoc < rDocs.getLength(); ++nDoc) { //insert in reverse order - m_aRecentDocLB.InsertEntry(rDocs[nDoc], 0); + m_pRecentDocLB->InsertEntry(rDocs[nDoc], 0); } - m_aRecentDocLB.SelectEntryPos(0); + m_pRecentDocLB->SelectEntryPos(0); if(!rDocs.getLength()) { - m_aRecentDocRB.Enable(sal_False); + m_pRecentDocRB->Enable(sal_False); } + + //Temp hack until all pages are converted to .ui and wizard + //base class adapted + SetSizePixel(LogicToPixel(Size(260 , 250), MapMode(MAP_APPFONT))); } SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage() @@ -100,7 +95,7 @@ SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage() IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) { - m_aRecentDocLB.Enable(&m_aRecentDocRB == pButton); + m_pRecentDocLB->Enable(m_pRecentDocRB == pButton); m_pWizard->UpdateRoadmap(); m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE)); @@ -110,11 +105,11 @@ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) { - bool bTemplate = &m_aBrowseTemplatePB == pButton; + bool bTemplate = m_pBrowseTemplatePB == pButton; if(bTemplate) { - m_aLoadTemplateRB.Check(); + m_pLoadTemplateRB->Check(); SfxNewFileDialog* pNewFileDlg = new SfxNewFileDialog(this, 0); sal_uInt16 nRet = pNewFileDlg->Execute(); if(RET_TEMPLATE_LOAD == nRet) @@ -124,7 +119,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) delete pNewFileDlg; } else - m_aLoadDocRB.Check(); + m_pLoadDocRB->Check(); if(!bTemplate) { @@ -172,15 +167,15 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageRea if(bNext || _eReason == ::svt::WizardTypes::eValidate ) { OUString sReloadDocument; - bReturn = m_aCurrentDocRB.IsChecked() || - m_aNewDocRB.IsChecked() || - (!(sReloadDocument = m_sLoadFileName).isEmpty() && m_aLoadDocRB.IsChecked() )|| - (!(sReloadDocument = m_sLoadTemplateName).isEmpty() && m_aLoadTemplateRB.IsChecked())|| - (m_aRecentDocRB.IsChecked() && !(sReloadDocument = m_aRecentDocLB.GetSelectEntry()).isEmpty()); + bReturn = m_pCurrentDocRB->IsChecked() || + m_pNewDocRB->IsChecked() || + (!(sReloadDocument = m_sLoadFileName).isEmpty() && m_pLoadDocRB->IsChecked() )|| + (!(sReloadDocument = m_sLoadTemplateName).isEmpty() && m_pLoadTemplateRB->IsChecked())|| + (m_pRecentDocRB->IsChecked() && !(sReloadDocument = m_pRecentDocLB->GetSelectEntry()).isEmpty()); if( _eReason == ::svt::WizardTypes::eValidate ) - m_pWizard->SetDocumentLoad(!m_aCurrentDocRB.IsChecked()); + m_pWizard->SetDocumentLoad(!m_pCurrentDocRB->IsChecked()); - if(bNext && !m_aCurrentDocRB.IsChecked()) + if(bNext && !m_pCurrentDocRB->IsChecked()) { if(!sReloadDocument.isEmpty()) m_pWizard->SetReloadDocument( sReloadDocument ); diff --git a/sw/source/ui/dbui/mmdocselectpage.hrc b/sw/source/ui/dbui/mmdocselectpage.hrc deleted file mode 100644 index 88077ebb8599..000000000000 --- a/sw/source/ui/dbui/mmdocselectpage.hrc +++ /dev/null @@ -1,31 +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_HOWTO 1 -#define RB_CURRENTDOC 2 -#define RB_NEWDOC 3 -#define RB_LOADDOC 4 -#define PB_LOADDOC 5 -#define RB_LOADTEMPLATE 6 -#define PB_BROWSETEMPLATE 7 -#define RB_RECENTDOC 8 -#define LB_RECENTDOC 9 -#define FI_HEADER 10 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx index cc81c02c3dbe..a10064ba8642 100644 --- a/sw/source/ui/dbui/mmdocselectpage.hxx +++ b/sw/source/ui/dbui/mmdocselectpage.hxx @@ -28,21 +28,19 @@ class SwMailMergeWizard; class SwMailMergeDocSelectPage : public svt::OWizardPage { - SwBoldFixedInfo m_aHeaderFI; - FixedInfo m_aHowToFT; - RadioButton m_aCurrentDocRB; - RadioButton m_aNewDocRB; - RadioButton m_aLoadDocRB; - RadioButton m_aLoadTemplateRB; - RadioButton m_aRecentDocRB; + RadioButton* m_pCurrentDocRB; + RadioButton* m_pNewDocRB; + RadioButton* m_pLoadDocRB; + RadioButton* m_pLoadTemplateRB; + RadioButton* m_pRecentDocRB; - PushButton m_aBrowseDocPB; - PushButton m_aBrowseTemplatePB; + PushButton* m_pBrowseDocPB; + PushButton* m_pBrowseTemplatePB; - ListBox m_aRecentDocLB; + ListBox* m_pRecentDocLB; - String m_sLoadFileName; - String m_sLoadTemplateName; + OUString m_sLoadFileName; + OUString m_sLoadTemplateName; SwMailMergeWizard* m_pWizard; diff --git a/sw/source/ui/dbui/mmdocselectpage.src b/sw/source/ui/dbui/mmdocselectpage.src deleted file mode 100644 index d69abe80d7ff..000000000000 --- a/sw/source/ui/dbui/mmdocselectpage.src +++ /dev/null @@ -1,99 +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 <mmdocselectpage.hrc> -#include <dbui.hrc> -#include <helpid.h> -TabPage DLG_MM_DOCSELECT_PAGE -{ - HelpID = HID_MM_DOCSELECTPAGE ; - Size = MAP_APPFONT ( 260 , 250 ) ; - Hide = TRUE ; - - FixedText FI_HEADER - { - Pos = MAP_APPFONT ( 6 , 8 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Select starting document for the mail merge"; - }; - FixedText FT_HOWTO - { - Pos = MAP_APPFONT ( 6 , 27 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Select the document upon which to base the mail merge document"; - }; - RadioButton RB_CURRENTDOC - { - HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_CURRENTDOC"; - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 190 , 10 ) ; - Text[ en-US ] = "Use the current ~document"; - }; - RadioButton RB_NEWDOC - { - HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_NEWDOC"; - Pos = MAP_APPFONT ( 12 , 66 ) ; - Size = MAP_APPFONT ( 190 , 10 ) ; - Text[ en-US ] = "Create a ne~w document"; - }; - RadioButton RB_LOADDOC - { - HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADDOC"; - Pos = MAP_APPFONT ( 12 , 84) ; - Size = MAP_APPFONT ( 190 , 10 ) ; - Text[ en-US ] = "Start from ~existing document"; - }; - PushButton PB_LOADDOC - { - HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_LOADDOC"; - Pos = MAP_APPFONT ( 204 , 80) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text[ en-US ] = "B~rowse..."; - }; - RadioButton RB_LOADTEMPLATE - { - HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADTEMPLATE"; - Pos = MAP_APPFONT ( 12 , 103 ) ; - Size = MAP_APPFONT ( 190 , 10 ) ; - Text[ en-US ] = "Start from a t~emplate"; - }; - PushButton PB_BROWSETEMPLATE - { - HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_BROWSETEMPLATE"; - Pos = MAP_APPFONT ( 204 , 99 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text[ en-US ] = "B~rowse..."; - }; - RadioButton RB_RECENTDOC - { - HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_RECENTDOC"; - Pos = MAP_APPFONT ( 12 , 120) ; - Size = MAP_APPFONT ( 190 , 10 ) ; - Text[ en-US ] = "Start fro~m a recently saved starting document"; - }; - ListBox LB_RECENTDOC - { - HelpID = "sw:ListBox:DLG_MM_DOCSELECT_PAGE:LB_RECENTDOC"; - Pos = MAP_APPFONT ( 20 , 134 ) ; - Size = MAP_APPFONT ( 180 , 50 ) ; - DropDown = TRUE; - Border = TRUE; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |