Kaydet (Commit) 1d95129b authored tarafından Caolán McNamara's avatar Caolán McNamara

show the 'java' options page when java disabled

because there are now a bunch of unrelated to java things in there in its new
incarnation as the "advanced" tabpage

this removes the weird empty tabpage in options
in the java-disabled-at-build-time configuration

Change-Id: Ie59d8362d440c41e746b67a0195e4159848f162a
üst cdad9755
...@@ -146,8 +146,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ ...@@ -146,8 +146,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/options/optHeaderTabListbox \ cui/source/options/optHeaderTabListbox \
cui/source/options/opthtml \ cui/source/options/opthtml \
cui/source/options/optinet2 \ cui/source/options/optinet2 \
$(if $(filter TRUE,$(SOLAR_JAVA)), \ cui/source/options/optjava \
cui/source/options/optjava) \
cui/source/options/optjsearch \ cui/source/options/optjsearch \
cui/source/options/optlingu \ cui/source/options/optlingu \
cui/source/options/optmemory \ cui/source/options/optmemory \
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp> #include <com/sun/star/ucb/XContentProvider.hpp>
#ifdef SOLAR_JAVA
#include <jvmfwk/framework.h> #include <jvmfwk/framework.h>
#endif
// define ---------------------------------------------------------------- // define ----------------------------------------------------------------
...@@ -180,7 +182,11 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet ...@@ -180,7 +182,11 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, DialogClosedHdl ) ); xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, DialogClosedHdl ) );
EnableHdl_Impl(m_pJavaEnableCB); EnableHdl_Impl(m_pJavaEnableCB);
#ifdef SOLAR_JAVA
jfw_lock(); jfw_lock();
#else
get<Window>("javaframe")->Disable();
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -191,6 +197,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage() ...@@ -191,6 +197,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage()
delete m_pParamDlg; delete m_pParamDlg;
delete m_pPathDlg; delete m_pPathDlg;
ClearJavaInfo(); ClearJavaInfo();
#ifdef SOLAR_JAVA
std::vector< JavaInfo* >::iterator pIter; std::vector< JavaInfo* >::iterator pIter;
for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter ) for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter )
{ {
...@@ -199,6 +206,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage() ...@@ -199,6 +206,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage()
} }
jfw_unlock(); jfw_unlock();
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -269,6 +277,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl) ...@@ -269,6 +277,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl)
IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
{ {
#ifdef SOLAR_JAVA
Sequence< OUString > aParameterList; Sequence< OUString > aParameterList;
if ( !m_pParamDlg ) if ( !m_pParamDlg )
{ {
...@@ -309,7 +318,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) ...@@ -309,7 +318,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
} }
else else
m_pParamDlg->SetParameters( aParameterList ); m_pParamDlg->SetParameters( aParameterList );
#endif
return 0; return 0;
} }
...@@ -317,6 +326,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) ...@@ -317,6 +326,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl) IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
{ {
#ifdef SOLAR_JAVA
String sClassPath; String sClassPath;
if ( !m_pPathDlg ) if ( !m_pPathDlg )
...@@ -353,7 +363,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl) ...@@ -353,7 +363,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
} }
else else
m_pPathDlg->SetClassPath( sClassPath ); m_pPathDlg->SetClassPath( sClassPath );
#endif
return 0; return 0;
} }
...@@ -402,6 +412,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt ) ...@@ -402,6 +412,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
void SvxJavaOptionsPage::ClearJavaInfo() void SvxJavaOptionsPage::ClearJavaInfo()
{ {
#ifdef SOLAR_JAVA
if ( m_parJavaInfo ) if ( m_parJavaInfo )
{ {
JavaInfo** parInfo = m_parJavaInfo; JavaInfo** parInfo = m_parJavaInfo;
...@@ -415,6 +426,7 @@ void SvxJavaOptionsPage::ClearJavaInfo() ...@@ -415,6 +426,7 @@ void SvxJavaOptionsPage::ClearJavaInfo()
m_parJavaInfo = NULL; m_parJavaInfo = NULL;
m_nInfoSize = 0; m_nInfoSize = 0;
} }
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -435,6 +447,7 @@ void SvxJavaOptionsPage::ClearJavaList() ...@@ -435,6 +447,7 @@ void SvxJavaOptionsPage::ClearJavaList()
void SvxJavaOptionsPage::LoadJREs() void SvxJavaOptionsPage::LoadJREs()
{ {
#ifdef SOLAR_JAVA
WaitObject aWaitObj(m_pJavaList); WaitObject aWaitObj(m_pJavaList);
javaFrameworkError eErr = jfw_findAllJREs( &m_parJavaInfo, &m_nInfoSize ); javaFrameworkError eErr = jfw_findAllJREs( &m_parJavaInfo, &m_nInfoSize );
if ( JFW_E_NONE == eErr && m_parJavaInfo ) if ( JFW_E_NONE == eErr && m_parJavaInfo )
...@@ -473,12 +486,14 @@ void SvxJavaOptionsPage::LoadJREs() ...@@ -473,12 +486,14 @@ void SvxJavaOptionsPage::LoadJREs()
} }
jfw_freeJavaInfo( pSelectedJava ); jfw_freeJavaInfo( pSelectedJava );
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo ) void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo )
{ {
#ifdef SOLAR_JAVA
OUStringBuffer sEntry; OUStringBuffer sEntry;
sEntry.append('\t'); sEntry.append('\t');
sEntry.append(_pInfo->sVendor); sEntry.append(_pInfo->sVendor);
...@@ -491,6 +506,9 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo ) ...@@ -491,6 +506,9 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo )
INetURLObject aLocObj( OUString( _pInfo->sLocation ) ); INetURLObject aLocObj( OUString( _pInfo->sLocation ) );
String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) ); String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) );
pEntry->SetUserData( pLocation ); pEntry->SetUserData( pLocation );
#else
(void)_pInfo;
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -519,6 +537,7 @@ void SvxJavaOptionsPage::HandleCheckEntry( SvTreeListEntry* _pEntry ) ...@@ -519,6 +537,7 @@ void SvxJavaOptionsPage::HandleCheckEntry( SvTreeListEntry* _pEntry )
void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder ) void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
{ {
#ifdef SOLAR_JAVA
bool bStartAgain = true; bool bStartAgain = true;
JavaInfo* pInfo = NULL; JavaInfo* pInfo = NULL;
javaFrameworkError eErr = jfw_getJavaInfoByPath( _rFolder.pData, &pInfo ); javaFrameworkError eErr = jfw_getJavaInfoByPath( _rFolder.pData, &pInfo );
...@@ -584,6 +603,9 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder ) ...@@ -584,6 +603,9 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
xFolderPicker->setDisplayDirectory( _rFolder ); xFolderPicker->setDisplayDirectory( _rFolder );
Application::PostUserEvent( LINK( this, SvxJavaOptionsPage, StartFolderPickerHdl ) ); Application::PostUserEvent( LINK( this, SvxJavaOptionsPage, StartFolderPickerHdl ) );
} }
#else
(void)_rFolder;
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -598,23 +620,6 @@ SfxTabPage* SvxJavaOptionsPage::Create( Window* pParent, const SfxItemSet& rAttr ...@@ -598,23 +620,6 @@ SfxTabPage* SvxJavaOptionsPage::Create( Window* pParent, const SfxItemSet& rAttr
sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
{ {
sal_Bool bModified = sal_False; sal_Bool bModified = sal_False;
javaFrameworkError eErr = JFW_E_NONE;
if ( m_pParamDlg )
{
Sequence< OUString > aParamList = m_pParamDlg->GetParameters();
sal_Int32 i, nSize = aParamList.getLength();
rtl_uString** pParamArr = (rtl_uString**)rtl_allocateMemory( sizeof(rtl_uString*) * nSize );
rtl_uString** pParamArrIter = pParamArr;
const OUString* pList = aParamList.getConstArray();
for ( i = 0; i < nSize; ++i )
pParamArr[i] = pList[i].pData;
eErr = jfw_setVMParameters( pParamArrIter, nSize );
DBG_ASSERT( JFW_E_NONE == eErr,
"SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters" );
pParamArrIter = pParamArr;
rtl_freeMemory( pParamArr );
bModified = sal_True;
}
if ( m_pExperimentalCB->IsChecked() != m_pExperimentalCB->GetSavedValue() ) if ( m_pExperimentalCB->IsChecked() != m_pExperimentalCB->GetSavedValue() )
{ {
...@@ -637,6 +642,25 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) ...@@ -637,6 +642,25 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
bModified = sal_True; bModified = sal_True;
} }
#ifdef SOLAR_JAVA
javaFrameworkError eErr = JFW_E_NONE;
if ( m_pParamDlg )
{
Sequence< OUString > aParamList = m_pParamDlg->GetParameters();
sal_Int32 i, nSize = aParamList.getLength();
rtl_uString** pParamArr = (rtl_uString**)rtl_allocateMemory( sizeof(rtl_uString*) * nSize );
rtl_uString** pParamArrIter = pParamArr;
const OUString* pList = aParamList.getConstArray();
for ( i = 0; i < nSize; ++i )
pParamArr[i] = pList[i].pData;
eErr = jfw_setVMParameters( pParamArrIter, nSize );
DBG_ASSERT( JFW_E_NONE == eErr,
"SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters" );
pParamArrIter = pParamArr;
rtl_freeMemory( pParamArr );
bModified = sal_True;
}
if ( m_pPathDlg ) if ( m_pPathDlg )
{ {
OUString sPath( m_pPathDlg->GetClassPath() ); OUString sPath( m_pPathDlg->GetClassPath() );
...@@ -700,6 +724,7 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) ...@@ -700,6 +724,7 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
"SvxJavaOptionsPage::FillItemSet(): error in jfw_setEnabled" ); "SvxJavaOptionsPage::FillItemSet(): error in jfw_setEnabled" );
bModified = sal_True; bModified = sal_True;
} }
#endif
return bModified; return bModified;
} }
...@@ -713,12 +738,17 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ ) ...@@ -713,12 +738,17 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
SvtMiscOptions aMiscOpt; SvtMiscOptions aMiscOpt;
#ifdef SOLAR_JAVA
sal_Bool bEnabled = sal_False; sal_Bool bEnabled = sal_False;
javaFrameworkError eErr = jfw_getEnabled( &bEnabled ); javaFrameworkError eErr = jfw_getEnabled( &bEnabled );
if ( eErr != JFW_E_NONE ) if ( eErr != JFW_E_NONE )
bEnabled = sal_False; bEnabled = sal_False;
m_pJavaEnableCB->Check( bEnabled ); m_pJavaEnableCB->Check( bEnabled );
EnableHdl_Impl(m_pJavaEnableCB); EnableHdl_Impl(m_pJavaEnableCB);
#else
m_pJavaEnableCB->Check( false );
m_pJavaEnableCB->Disable();
#endif
m_pExperimentalCB->Check( aMiscOpt.IsExperimentalMode() ); m_pExperimentalCB->Check( aMiscOpt.IsExperimentalMode() );
m_pExperimentalCB->SaveValue(); m_pExperimentalCB->SaveValue();
......
...@@ -32,7 +32,11 @@ ...@@ -32,7 +32,11 @@
// forward --------------------------------------------------------------- // forward ---------------------------------------------------------------
#ifdef SOLAR_JAVA
typedef struct _JavaInfo JavaInfo; typedef struct _JavaInfo JavaInfo;
#else
typedef void* JavaInfo;
#endif
class SvxJavaParameterDlg; class SvxJavaParameterDlg;
class SvxJavaClassPathDlg; class SvxJavaClassPathDlg;
......
...@@ -314,9 +314,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem ...@@ -314,9 +314,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break; case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break;
case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break; case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break;
case RID_SVXPAGE_INET_MOZPLUGIN: fnCreate = &MozPluginTabPage::Create; break; case RID_SVXPAGE_INET_MOZPLUGIN: fnCreate = &MozPluginTabPage::Create; break;
#ifdef SOLAR_JAVA
case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break; case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
#endif
case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break; case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break; case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">18</property> <property name="spacing">18</property>
<child> <child>
<object class="GtkFrame" id="frame1"> <object class="GtkFrame" id="javaframe">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
......
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