Kaydet (Commit) 59ff29f8 authored tarafından Faisal M. Al-Otaibi's avatar Faisal M. Al-Otaibi

Convert java start parameters dialog to .ui

Change-Id: Ib3aaeb751ae67c0ed4e444f6febd676ddd94f924
üst 61c0071d
......@@ -44,6 +44,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/insertrowcolumn \
cui/uiconfig/ui/javaclasspathdialog \
cui/uiconfig/ui/javastartparametersdialog \
cui/uiconfig/ui/linedialog \
cui/uiconfig/ui/linetabpage \
cui/uiconfig/ui/lineendstabpage \
......
......@@ -33,7 +33,6 @@
#define HID_CLB_LINGU_OPTIONS "CUI_HID_CLB_LINGU_OPTIONS"
#define HID_EDIT_MODULES "CUI_HID_EDIT_MODULES"
#define HID_OPTIONS_COLORCONFIG_SAVE_SCHEME "CUI_HID_OPTIONS_COLORCONFIG_SAVE_SCHEME"
#define HID_OPTIONS_JAVA_PARAMETER "CUI_HID_OPTIONS_JAVA_PARAMETER"
#define HID_OFADLG_OPTIONS_TREE "CUI_HID_OFADLG_OPTIONS_TREE"
#define HID_OFA_CONNPOOL_DRIVERLIST "CUI_HID_OFA_CONNPOOL_DRIVERLIST"
#define UID_OFA_CONNPOOL_DRIVERLIST_BACK "CUI_UID_OFA_CONNPOOL_DRIVERLIST_BACK"
......
......@@ -24,7 +24,6 @@
#include <svtools/miscopt.hxx>
#include "optjava.hrc"
#include <cuires.hrc>
#include "helpid.hrc"
#include <vcl/svapp.hxx>
......@@ -780,30 +779,23 @@ void SvxJavaOptionsPage::FillUserData()
SvxJavaParameterDlg::SvxJavaParameterDlg( Window* pParent ) :
ModalDialog( pParent, CUI_RES( RID_SVXDLG_JAVA_PARAMETER ) ),
m_aParameterLabel ( this, CUI_RES( FT_PARAMETER ) ),
m_aParameterEdit ( this, CUI_RES( ED_PARAMETER ) ),
m_aAssignBtn ( this, CUI_RES( PB_ASSIGN ) ),
m_aAssignedLabel ( this, CUI_RES( FT_ASSIGNED ) ),
m_aAssignedList ( this, CUI_RES( LB_ASSIGNED ) ),
m_aExampleText ( this, CUI_RES( FT_EXAMPLE ) ),
m_aRemoveBtn ( this, CUI_RES( PB_REMOVE ) ),
m_aButtonsLine ( this, CUI_RES( FL_BUTTONS ) ),
m_aOKBtn ( this, CUI_RES( PB_PARAMETER_OK ) ),
m_aCancelBtn ( this, CUI_RES( PB_PARAMETER_ESC ) ),
m_aHelpBtn ( this, CUI_RES( PB_PARAMETER_HLP ) )
ModalDialog( pParent, "JavaStartParameters",
"cui/ui/javastartparametersdialog.ui" )
{
FreeResource();
m_aParameterEdit.SetModifyHdl( LINK( this, SvxJavaParameterDlg, ModifyHdl_Impl ) );
m_aAssignBtn.SetClickHdl( LINK( this, SvxJavaParameterDlg, AssignHdl_Impl ) );
m_aRemoveBtn.SetClickHdl( LINK( this, SvxJavaParameterDlg, RemoveHdl_Impl ) );
m_aAssignedList.SetSelectHdl( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) );
m_aAssignedList.SetDoubleClickHdl( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) );
ModifyHdl_Impl( &m_aParameterEdit );
get( m_pParameterEdit, "parameterfield");
get( m_pAssignBtn, "assignbtn");
get( m_pAssignedList, "assignlist");
m_pAssignedList->SetDropDownLineCount(6);
m_pAssignedList->set_width_request(m_pAssignedList->approximate_char_width() * 54);
get( m_pRemoveBtn, "removebtn");
m_pParameterEdit->SetModifyHdl( LINK( this, SvxJavaParameterDlg, ModifyHdl_Impl ) );
m_pAssignBtn->SetClickHdl( LINK( this, SvxJavaParameterDlg, AssignHdl_Impl ) );
m_pRemoveBtn->SetClickHdl( LINK( this, SvxJavaParameterDlg, RemoveHdl_Impl ) );
m_pAssignedList->SetSelectHdl( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) );
m_pAssignedList->SetDoubleClickHdl( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) );
ModifyHdl_Impl( m_pParameterEdit );
EnableRemoveButton();
}
......@@ -817,8 +809,8 @@ SvxJavaParameterDlg::~SvxJavaParameterDlg()
IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl)
{
OUString sParam = comphelper::string::strip(m_aParameterEdit.GetText(), ' ');
m_aAssignBtn.Enable(!sParam.isEmpty());
OUString sParam = comphelper::string::strip(m_pParameterEdit->GetText(), ' ');
m_pAssignBtn->Enable(!sParam.isEmpty());
return 0;
}
......@@ -827,15 +819,15 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl)
IMPL_LINK_NOARG(SvxJavaParameterDlg, AssignHdl_Impl)
{
OUString sParam = comphelper::string::strip(m_aParameterEdit.GetText(), ' ');
OUString sParam = comphelper::string::strip(m_pParameterEdit->GetText(), ' ');
if (!sParam.isEmpty())
{
sal_uInt16 nPos = m_aAssignedList.GetEntryPos( sParam );
sal_uInt16 nPos = m_pAssignedList->GetEntryPos( sParam );
if ( LISTBOX_ENTRY_NOTFOUND == nPos )
nPos = m_aAssignedList.InsertEntry( sParam );
m_aAssignedList.SelectEntryPos( nPos );
m_aParameterEdit.SetText( String() );
ModifyHdl_Impl( &m_aParameterEdit );
nPos = m_pAssignedList->InsertEntry( sParam );
m_pAssignedList->SelectEntryPos( nPos );
m_pParameterEdit->SetText( String() );
ModifyHdl_Impl( m_pParameterEdit );
EnableRemoveButton();
}
......@@ -854,9 +846,9 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, SelectHdl_Impl)
IMPL_LINK_NOARG(SvxJavaParameterDlg, DblClickHdl_Impl)
{
sal_uInt16 nPos = m_aAssignedList.GetSelectEntryPos();
sal_uInt16 nPos = m_pAssignedList->GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
m_aParameterEdit.SetText( m_aAssignedList.GetEntry( nPos ) );
m_pParameterEdit->SetText( m_pAssignedList->GetEntry( nPos ) );
return 0;
}
......@@ -864,16 +856,16 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, DblClickHdl_Impl)
IMPL_LINK_NOARG(SvxJavaParameterDlg, RemoveHdl_Impl)
{
sal_uInt16 nPos = m_aAssignedList.GetSelectEntryPos();
sal_uInt16 nPos = m_pAssignedList->GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
m_aAssignedList.RemoveEntry( nPos );
sal_uInt16 nCount = m_aAssignedList.GetEntryCount();
m_pAssignedList->RemoveEntry( nPos );
sal_uInt16 nCount = m_pAssignedList->GetEntryCount();
if ( nCount )
{
if ( nPos >= nCount )
nPos = ( nCount - 1 );
m_aAssignedList.SelectEntryPos( nPos );
m_pAssignedList->SelectEntryPos( nPos );
}
}
EnableRemoveButton();
......@@ -885,8 +877,8 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, RemoveHdl_Impl)
short SvxJavaParameterDlg::Execute()
{
m_aParameterEdit.GrabFocus();
m_aAssignedList.SetNoSelection();
m_pParameterEdit->GrabFocus();
m_pAssignedList->SetNoSelection();
return ModalDialog::Execute();
}
......@@ -894,11 +886,11 @@ short SvxJavaParameterDlg::Execute()
Sequence< OUString > SvxJavaParameterDlg::GetParameters() const
{
sal_uInt16 nCount = m_aAssignedList.GetEntryCount();
sal_uInt16 nCount = m_pAssignedList->GetEntryCount();
Sequence< OUString > aParamList( nCount );
OUString* pArray = aParamList.getArray();
for ( sal_uInt16 i = 0; i < nCount; ++i )
pArray[i] = OUString( m_aAssignedList.GetEntry(i) );
pArray[i] = OUString( m_pAssignedList->GetEntry(i) );
return aParamList;
}
......@@ -906,13 +898,13 @@ Sequence< OUString > SvxJavaParameterDlg::GetParameters() const
void SvxJavaParameterDlg::SetParameters( Sequence< OUString >& rParams )
{
m_aAssignedList.Clear();
m_pAssignedList->Clear();
sal_uLong i, nCount = rParams.getLength();
const OUString* pArray = rParams.getConstArray();
for ( i = 0; i < nCount; ++i )
{
String sParam = String( *pArray++ );
m_aAssignedList.InsertEntry( sParam );
m_pAssignedList->InsertEntry( sParam );
}
}
......
/* -*- 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 .
*/
#ifndef _SVX_OPTJAVA_HRC
#define _SVX_OPTJAVA_HRC
// defines ---------------------------------------------------------------
// class SvxJavaParameterDlg ---------------------------------------------
#define FT_PARAMETER 10
#define ED_PARAMETER 11
#define PB_ASSIGN 12
#define FT_ASSIGNED 20
#define LB_ASSIGNED 21
#define FT_EXAMPLE 22
#define PB_REMOVE 23
#define FL_BUTTONS 30
#define PB_PARAMETER_OK 31
#define PB_PARAMETER_ESC 32
#define PB_PARAMETER_HLP 33
#endif // #ifndef _SVX_OPTJAVA_HRC
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -117,19 +117,11 @@ public:
class SvxJavaParameterDlg : public ModalDialog
{
private:
FixedText m_aParameterLabel;
Edit m_aParameterEdit;
PushButton m_aAssignBtn;
Edit* m_pParameterEdit;
PushButton* m_pAssignBtn;
FixedText m_aAssignedLabel;
ListBox m_aAssignedList;
FixedText m_aExampleText;
PushButton m_aRemoveBtn;
FixedLine m_aButtonsLine;
OKButton m_aOKBtn;
CancelButton m_aCancelBtn;
HelpButton m_aHelpBtn;
ListBox* m_pAssignedList;
PushButton* m_pRemoveBtn;
DECL_LINK(ModifyHdl_Impl, void *);
DECL_LINK(AssignHdl_Impl, void *);
......@@ -138,8 +130,8 @@ private:
DECL_LINK(RemoveHdl_Impl, void *);
inline void EnableRemoveButton()
{ m_aRemoveBtn.Enable(
m_aAssignedList.GetSelectEntryPos()
{ m_pRemoveBtn->Enable(
m_pAssignedList->GetSelectEntryPos()
!= LISTBOX_ENTRY_NOTFOUND ); }
......
......@@ -17,90 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "optjava.hrc"
#include <cuires.hrc>
#include "helpid.hrc"
// RID_SVXDLG_JAVA_PARAMETER ---------------------------------------------
ModalDialog RID_SVXDLG_JAVA_PARAMETER
{
HelpId = HID_OPTIONS_JAVA_PARAMETER ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 270 , 140 ) ;
Text [ en-US ] = "Java Start Parameters" ;
Moveable = TRUE ;
FixedText FT_PARAMETER
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 202 , 8 ) ;
Text [ en-US ] = "Java start ~parameter" ;
};
Edit ED_PARAMETER
{
HelpID = "cui:Edit:RID_SVXDLG_JAVA_PARAMETER:ED_PARAMETER";
Pos = MAP_APPFONT ( 6 , 15 ) ;
Size = MAP_APPFONT ( 202 , 12 ) ;
Border = TRUE ;
};
PushButton PB_ASSIGN
{
HelpID = "cui:PushButton:RID_SVXDLG_JAVA_PARAMETER:PB_ASSIGN";
Pos = MAP_APPFONT ( 214 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Assign" ;
};
FixedText FT_ASSIGNED
{
Pos = MAP_APPFONT ( 6 , 31 ) ;
Size = MAP_APPFONT ( 202 , 8 ) ;
Text [ en-US ] = "Assig~ned start parameters" ;
};
ListBox LB_ASSIGNED
{
HelpID = "cui:ListBox:RID_SVXDLG_JAVA_PARAMETER:LB_ASSIGNED";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 42 ) ;
Size = MAP_APPFONT ( 202 , 53 ) ;
AutoHScroll = TRUE ;
};
FixedText FT_EXAMPLE
{
Pos = MAP_APPFONT ( 6 , 98 ) ;
Size = MAP_APPFONT ( 202 , 8 ) ;
Text [ en-US ] = "For example: -Dmyprop=c:\\program files\\java" ;
};
PushButton PB_REMOVE
{
HelpID = "cui:PushButton:RID_SVXDLG_JAVA_PARAMETER:PB_REMOVE";
Pos = MAP_APPFONT ( 214 , 42 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Remove" ;
};
FixedLine FL_BUTTONS
{
Pos = MAP_APPFONT ( 3 , 109 ) ;
Size = MAP_APPFONT ( 264 , 8 ) ;
};
OKButton PB_PARAMETER_OK
{
Pos = MAP_APPFONT ( 105 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton PB_PARAMETER_ESC
{
Pos = MAP_APPFONT ( 158 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton PB_PARAMETER_HLP
{
Pos = MAP_APPFONT ( 214 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
ErrorBox RID_SVXERR_JRE_NOT_RECOGNIZED
{
BUTTONS = WB_OK ;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment