xref: /aoo41x/main/cui/source/dialogs/multipat.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_cui.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // include ---------------------------------------------------------------
32*cdf0e10cSrcweir #include <tools/debug.hxx>
33*cdf0e10cSrcweir #include <tools/urlobj.hxx>
34*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
35*cdf0e10cSrcweir #include <sfx2/filedlghelper.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include "multipat.hxx"
38*cdf0e10cSrcweir #include <dialmgr.hxx>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include "multipat.hrc"
41*cdf0e10cSrcweir #include <cuires.hrc>
42*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
43*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #include <unotools/localfilehelper.hxx>
48*cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir using namespace ::com::sun::star::lang;
51*cdf0e10cSrcweir using namespace ::com::sun::star::ui::dialogs;
52*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir // struct MultiPath_Impl -------------------------------------------------
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir struct MultiPath_Impl
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir 	sal_Bool	bEmptyAllowed;
59*cdf0e10cSrcweir 	sal_Bool	bIsClassPathMode;
60*cdf0e10cSrcweir     bool    bIsRadioButtonMode;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir     MultiPath_Impl( sal_Bool bAllowed ) :
63*cdf0e10cSrcweir         bEmptyAllowed( bAllowed ), bIsClassPathMode( sal_False ), bIsRadioButtonMode( false )  {}
64*cdf0e10cSrcweir };
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir // class SvxMultiPathDialog ----------------------------------------------
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir IMPL_LINK( SvxMultiPathDialog, SelectHdl_Impl, void *, EMPTYARG )
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir     sal_uLong nCount = pImpl->bIsRadioButtonMode ? aRadioLB.GetEntryCount() : aPathLB.GetEntryCount();
71*cdf0e10cSrcweir     bool bIsSelected = pImpl->bIsRadioButtonMode
72*cdf0e10cSrcweir         ? aRadioLB.FirstSelected() != NULL
73*cdf0e10cSrcweir         : aPathLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
74*cdf0e10cSrcweir     sal_Bool bEnable = ( pImpl->bEmptyAllowed || nCount > 1 );
75*cdf0e10cSrcweir     aDelBtn.Enable( bEnable && bIsSelected );
76*cdf0e10cSrcweir     return 0;
77*cdf0e10cSrcweir }
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir // -----------------------------------------------------------------------
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir IMPL_LINK( SvxMultiPathDialog, CheckHdl_Impl, svx::SvxRadioButtonListBox *, pBox )
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir     SvLBoxEntry* pEntry =
84*cdf0e10cSrcweir         pBox ? pBox->GetEntry( pBox->GetCurMousePoint() ) : aRadioLB.FirstSelected();
85*cdf0e10cSrcweir     if ( pEntry )
86*cdf0e10cSrcweir         aRadioLB.HandleEntryChecked( pEntry );
87*cdf0e10cSrcweir     return 0;
88*cdf0e10cSrcweir }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir // -----------------------------------------------------------------------
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir IMPL_LINK( SvxMultiPathDialog, AddHdl_Impl, PushButton *, EMPTYARG )
93*cdf0e10cSrcweir {
94*cdf0e10cSrcweir     rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
95*cdf0e10cSrcweir     Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
96*cdf0e10cSrcweir 	Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), UNO_QUERY );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	if ( xFolderPicker->execute() == ExecutableDialogResults::OK )
99*cdf0e10cSrcweir 	{
100*cdf0e10cSrcweir 		INetURLObject aPath( xFolderPicker->getDirectory() );
101*cdf0e10cSrcweir 		aPath.removeFinalSlash();
102*cdf0e10cSrcweir         String aURL = aPath.GetMainURL( INetURLObject::NO_DECODE );
103*cdf0e10cSrcweir         String sInsPath;
104*cdf0e10cSrcweir         ::utl::LocalFileHelper::ConvertURLToSystemPath( aURL, sInsPath );
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir         if ( pImpl->bIsRadioButtonMode )
107*cdf0e10cSrcweir         {
108*cdf0e10cSrcweir             sal_uLong nPos = aRadioLB.GetEntryPos( sInsPath, 1 );
109*cdf0e10cSrcweir             if ( 0xffffffff == nPos ) //See svtools/source/contnr/svtabbx.cxx SvTabListBox::GetEntryPos
110*cdf0e10cSrcweir             {
111*cdf0e10cSrcweir                 String sNewEntry( '\t' );
112*cdf0e10cSrcweir                 sNewEntry += sInsPath;
113*cdf0e10cSrcweir                 SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sNewEntry );
114*cdf0e10cSrcweir                 String* pData = new String( aURL );
115*cdf0e10cSrcweir                 pEntry->SetUserData( pData );
116*cdf0e10cSrcweir             }
117*cdf0e10cSrcweir             else
118*cdf0e10cSrcweir             {
119*cdf0e10cSrcweir                 String sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
120*cdf0e10cSrcweir                 sMsg.SearchAndReplaceAscii( "%1", sInsPath );
121*cdf0e10cSrcweir                 InfoBox( this, sMsg ).Execute();
122*cdf0e10cSrcweir             }
123*cdf0e10cSrcweir         }
124*cdf0e10cSrcweir         else
125*cdf0e10cSrcweir         {
126*cdf0e10cSrcweir             if ( LISTBOX_ENTRY_NOTFOUND != aPathLB.GetEntryPos( sInsPath ) )
127*cdf0e10cSrcweir             {
128*cdf0e10cSrcweir                 String sMsg( CUI_RES( RID_MULTIPATH_DBL_ERR ) );
129*cdf0e10cSrcweir                 sMsg.SearchAndReplaceAscii( "%1", sInsPath );
130*cdf0e10cSrcweir                 InfoBox( this, sMsg ).Execute();
131*cdf0e10cSrcweir             }
132*cdf0e10cSrcweir             else
133*cdf0e10cSrcweir             {
134*cdf0e10cSrcweir                 sal_uInt16 nPos = aPathLB.InsertEntry( sInsPath, LISTBOX_APPEND );
135*cdf0e10cSrcweir                 aPathLB.SetEntryData( nPos, (void*)new String( aURL ) );
136*cdf0e10cSrcweir             }
137*cdf0e10cSrcweir         }
138*cdf0e10cSrcweir         SelectHdl_Impl( NULL );
139*cdf0e10cSrcweir 	}
140*cdf0e10cSrcweir 	return 0;
141*cdf0e10cSrcweir }
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir // -----------------------------------------------------------------------
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir IMPL_LINK( SvxMultiPathDialog, DelHdl_Impl, PushButton *, EMPTYARG )
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir     if ( pImpl->bIsRadioButtonMode )
148*cdf0e10cSrcweir     {
149*cdf0e10cSrcweir         SvLBoxEntry* pEntry = aRadioLB.FirstSelected();
150*cdf0e10cSrcweir         delete (String*)pEntry->GetUserData();
151*cdf0e10cSrcweir         bool bChecked = aRadioLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED;
152*cdf0e10cSrcweir         sal_uLong nPos = aRadioLB.GetEntryPos( pEntry );
153*cdf0e10cSrcweir         aRadioLB.RemoveEntry( pEntry );
154*cdf0e10cSrcweir         sal_uLong nCnt = aRadioLB.GetEntryCount();
155*cdf0e10cSrcweir         if ( nCnt )
156*cdf0e10cSrcweir         {
157*cdf0e10cSrcweir             nCnt--;
158*cdf0e10cSrcweir             if ( nPos > nCnt )
159*cdf0e10cSrcweir                 nPos = nCnt;
160*cdf0e10cSrcweir             pEntry = aRadioLB.GetEntry( nPos );
161*cdf0e10cSrcweir             if ( bChecked )
162*cdf0e10cSrcweir             {
163*cdf0e10cSrcweir                 aRadioLB.SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
164*cdf0e10cSrcweir                 aRadioLB.HandleEntryChecked( pEntry );
165*cdf0e10cSrcweir             }
166*cdf0e10cSrcweir             else
167*cdf0e10cSrcweir                 aRadioLB.Select( pEntry );
168*cdf0e10cSrcweir         }
169*cdf0e10cSrcweir     }
170*cdf0e10cSrcweir     else
171*cdf0e10cSrcweir     {
172*cdf0e10cSrcweir         sal_uInt16 nPos = aPathLB.GetSelectEntryPos();
173*cdf0e10cSrcweir         aPathLB.RemoveEntry( nPos );
174*cdf0e10cSrcweir         sal_uInt16 nCnt = aPathLB.GetEntryCount();
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir         if ( nCnt )
177*cdf0e10cSrcweir         {
178*cdf0e10cSrcweir             nCnt--;
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir             if ( nPos > nCnt )
181*cdf0e10cSrcweir                 nPos = nCnt;
182*cdf0e10cSrcweir             aPathLB.SelectEntryPos( nPos );
183*cdf0e10cSrcweir         }
184*cdf0e10cSrcweir     }
185*cdf0e10cSrcweir     SelectHdl_Impl( NULL );
186*cdf0e10cSrcweir 	return 0;
187*cdf0e10cSrcweir }
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir // -----------------------------------------------------------------------
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir SvxMultiPathDialog::SvxMultiPathDialog( Window* pParent, sal_Bool bEmptyAllowed ) :
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 	ModalDialog( pParent, CUI_RES( RID_SVXDLG_MULTIPATH ) ),
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir     aPathFL     ( this, CUI_RES( FL_MULTIPATH) ),
196*cdf0e10cSrcweir     aPathLB     ( this, CUI_RES( LB_MULTIPATH ) ),
197*cdf0e10cSrcweir     aRadioLB    ( this, CUI_RES( LB_RADIOBUTTON ) ),
198*cdf0e10cSrcweir     aRadioFT    ( this, CUI_RES( FT_RADIOBUTTON ) ),
199*cdf0e10cSrcweir     aAddBtn     ( this, CUI_RES( BTN_ADD_MULTIPATH ) ),
200*cdf0e10cSrcweir 	aDelBtn		( this, CUI_RES( BTN_DEL_MULTIPATH ) ),
201*cdf0e10cSrcweir 	aOKBtn		( this, CUI_RES( BTN_MULTIPATH_OK ) ),
202*cdf0e10cSrcweir 	aCancelBtn	( this, CUI_RES( BTN_MULTIPATH_CANCEL ) ),
203*cdf0e10cSrcweir 	aHelpButton	( this, CUI_RES( BTN_MULTIPATH_HELP ) ),
204*cdf0e10cSrcweir 	pImpl		( new MultiPath_Impl( bEmptyAllowed ) )
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir {
207*cdf0e10cSrcweir     static long aStaticTabs[]= { 2, 0, 12 };
208*cdf0e10cSrcweir     aRadioLB.SvxSimpleTable::SetTabs( aStaticTabs );
209*cdf0e10cSrcweir     String sHeader( CUI_RES( STR_HEADER_PATHS ) );
210*cdf0e10cSrcweir     aRadioLB.SetQuickHelpText( sHeader );
211*cdf0e10cSrcweir     sHeader.Insert( '\t', 0 );
212*cdf0e10cSrcweir     aRadioLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT );
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir     FreeResource();
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     aPathLB.SetSelectHdl( LINK( this, SvxMultiPathDialog, SelectHdl_Impl ) );
217*cdf0e10cSrcweir     aRadioLB.SetSelectHdl( LINK( this, SvxMultiPathDialog, SelectHdl_Impl ) );
218*cdf0e10cSrcweir     aRadioLB.SetCheckButtonHdl( LINK( this, SvxMultiPathDialog, CheckHdl_Impl ) );
219*cdf0e10cSrcweir     aAddBtn.SetClickHdl( LINK( this, SvxMultiPathDialog, AddHdl_Impl ) );
220*cdf0e10cSrcweir 	aDelBtn.SetClickHdl( LINK( this, SvxMultiPathDialog, DelHdl_Impl ) );
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir     SelectHdl_Impl( NULL );
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 	aAddBtn.SetAccessibleRelationMemberOf(&aPathLB);
225*cdf0e10cSrcweir 	aDelBtn.SetAccessibleRelationMemberOf(&aPathLB);
226*cdf0e10cSrcweir }
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir // -----------------------------------------------------------------------
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir SvxMultiPathDialog::~SvxMultiPathDialog()
231*cdf0e10cSrcweir {
232*cdf0e10cSrcweir     sal_uInt16 nPos = aPathLB.GetEntryCount();
233*cdf0e10cSrcweir     while ( nPos-- )
234*cdf0e10cSrcweir 		delete (String*)aPathLB.GetEntryData(nPos);
235*cdf0e10cSrcweir     nPos = (sal_uInt16)aRadioLB.GetEntryCount();
236*cdf0e10cSrcweir     while ( nPos-- )
237*cdf0e10cSrcweir     {
238*cdf0e10cSrcweir         SvLBoxEntry* pEntry = aRadioLB.GetEntry( nPos );
239*cdf0e10cSrcweir         delete (String*)pEntry->GetUserData();
240*cdf0e10cSrcweir     }
241*cdf0e10cSrcweir     delete pImpl;
242*cdf0e10cSrcweir }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir // -----------------------------------------------------------------------
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir String SvxMultiPathDialog::GetPath() const
247*cdf0e10cSrcweir {
248*cdf0e10cSrcweir     String sNewPath;
249*cdf0e10cSrcweir 	sal_Unicode cDelim = pImpl->bIsClassPathMode ? CLASSPATH_DELIMITER : SVT_SEARCHPATH_DELIMITER;
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir     if ( pImpl->bIsRadioButtonMode )
252*cdf0e10cSrcweir     {
253*cdf0e10cSrcweir         String sWritable;
254*cdf0e10cSrcweir         for ( sal_uInt16 i = 0; i < aRadioLB.GetEntryCount(); ++i )
255*cdf0e10cSrcweir         {
256*cdf0e10cSrcweir             SvLBoxEntry* pEntry = aRadioLB.GetEntry(i);
257*cdf0e10cSrcweir             if ( aRadioLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED )
258*cdf0e10cSrcweir                 sWritable = *(String*)pEntry->GetUserData();
259*cdf0e10cSrcweir             else
260*cdf0e10cSrcweir             {
261*cdf0e10cSrcweir                 if ( sNewPath.Len() > 0 )
262*cdf0e10cSrcweir                     sNewPath += cDelim;
263*cdf0e10cSrcweir                 sNewPath += *(String*)pEntry->GetUserData();
264*cdf0e10cSrcweir             }
265*cdf0e10cSrcweir         }
266*cdf0e10cSrcweir         if ( sNewPath.Len() > 0 )
267*cdf0e10cSrcweir             sNewPath += cDelim;
268*cdf0e10cSrcweir         sNewPath += sWritable;
269*cdf0e10cSrcweir     }
270*cdf0e10cSrcweir     else
271*cdf0e10cSrcweir     {
272*cdf0e10cSrcweir         for ( sal_uInt16 i = 0; i < aPathLB.GetEntryCount(); ++i )
273*cdf0e10cSrcweir         {
274*cdf0e10cSrcweir             if ( sNewPath.Len() > 0 )
275*cdf0e10cSrcweir                 sNewPath += cDelim;
276*cdf0e10cSrcweir             sNewPath += *(String*)aPathLB.GetEntryData(i);
277*cdf0e10cSrcweir         }
278*cdf0e10cSrcweir     }
279*cdf0e10cSrcweir     return sNewPath;
280*cdf0e10cSrcweir }
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir // -----------------------------------------------------------------------
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir void SvxMultiPathDialog::SetPath( const String& rPath )
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir 	sal_Unicode cDelim = pImpl->bIsClassPathMode ? CLASSPATH_DELIMITER : SVT_SEARCHPATH_DELIMITER;
287*cdf0e10cSrcweir     sal_uInt16 nPos, nCount = rPath.GetTokenCount( cDelim );
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir     for ( sal_uInt16 i = 0; i < nCount; ++i )
290*cdf0e10cSrcweir 	{
291*cdf0e10cSrcweir         String sPath = rPath.GetToken( i, cDelim );
292*cdf0e10cSrcweir         String sSystemPath;
293*cdf0e10cSrcweir         sal_Bool bIsSystemPath =
294*cdf0e10cSrcweir             ::utl::LocalFileHelper::ConvertURLToSystemPath( sPath, sSystemPath );
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir         if ( pImpl->bIsRadioButtonMode )
297*cdf0e10cSrcweir         {
298*cdf0e10cSrcweir             String sEntry( '\t' );
299*cdf0e10cSrcweir             sEntry += bIsSystemPath ? sSystemPath : sPath;
300*cdf0e10cSrcweir             SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sEntry );
301*cdf0e10cSrcweir             String* pURL = new String( sPath );
302*cdf0e10cSrcweir             pEntry->SetUserData( pURL );
303*cdf0e10cSrcweir         }
304*cdf0e10cSrcweir         else
305*cdf0e10cSrcweir         {
306*cdf0e10cSrcweir             if ( bIsSystemPath )
307*cdf0e10cSrcweir                 nPos = aPathLB.InsertEntry( sSystemPath, LISTBOX_APPEND );
308*cdf0e10cSrcweir             else
309*cdf0e10cSrcweir                 nPos = aPathLB.InsertEntry( sPath, LISTBOX_APPEND );
310*cdf0e10cSrcweir             aPathLB.SetEntryData( nPos, (void*)new String( sPath ) );
311*cdf0e10cSrcweir         }
312*cdf0e10cSrcweir 	}
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir     if ( pImpl->bIsRadioButtonMode && nCount > 0 )
315*cdf0e10cSrcweir     {
316*cdf0e10cSrcweir         SvLBoxEntry* pEntry = aRadioLB.GetEntry( nCount - 1 );
317*cdf0e10cSrcweir         if ( pEntry )
318*cdf0e10cSrcweir         {
319*cdf0e10cSrcweir             aRadioLB.SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
320*cdf0e10cSrcweir             aRadioLB.HandleEntryChecked( pEntry );
321*cdf0e10cSrcweir         }
322*cdf0e10cSrcweir     }
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir     SelectHdl_Impl( NULL );
325*cdf0e10cSrcweir }
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir // -----------------------------------------------------------------------
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir void SvxMultiPathDialog::SetClassPathMode()
330*cdf0e10cSrcweir {
331*cdf0e10cSrcweir 	pImpl->bIsClassPathMode = sal_True;
332*cdf0e10cSrcweir 	SetText( CUI_RES( RID_SVXSTR_ARCHIVE_TITLE ));
333*cdf0e10cSrcweir     aPathFL.SetText( CUI_RES( RID_SVXSTR_ARCHIVE_HEADLINE ) );
334*cdf0e10cSrcweir }
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir // -----------------------------------------------------------------------
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir sal_Bool SvxMultiPathDialog::IsClassPathMode() const
339*cdf0e10cSrcweir {
340*cdf0e10cSrcweir     return pImpl->bIsClassPathMode;
341*cdf0e10cSrcweir }
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir // -----------------------------------------------------------------------
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir void SvxMultiPathDialog::EnableRadioButtonMode()
346*cdf0e10cSrcweir {
347*cdf0e10cSrcweir     pImpl->bIsRadioButtonMode = true;
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir     aPathFL.Hide();
350*cdf0e10cSrcweir     aPathLB.Hide();
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir     aRadioLB.ShowTable();
353*cdf0e10cSrcweir     aRadioFT.Show();
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir     Point aNewPos = aAddBtn.GetPosPixel();
356*cdf0e10cSrcweir     long nDelta = aNewPos.Y() - aRadioLB.GetPosPixel().Y();
357*cdf0e10cSrcweir     aNewPos.Y() -= nDelta;
358*cdf0e10cSrcweir     aAddBtn.SetPosPixel( aNewPos );
359*cdf0e10cSrcweir     aNewPos = aDelBtn.GetPosPixel();
360*cdf0e10cSrcweir     aNewPos.Y() -= nDelta;
361*cdf0e10cSrcweir     aDelBtn.SetPosPixel( aNewPos );
362*cdf0e10cSrcweir }
363*cdf0e10cSrcweir 
364