summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakki95 <akshaydeepiitr@gmail.com>2016-01-30 06:39:52 +0530
committerjan iversen <jani@documentfoundation.org>2016-01-30 07:47:37 +0000
commit7e51aeaa6797025ec8c1e7cea39a478edbca83d5 (patch)
tree9e37e12c738dcaf07095e9aee8ccd47d6ebb9e40
parent0d65526d397aff9bff367060f19f19476de748c2 (diff)
tdf#97425 - JVM start parameters should be editable.
Bug Resolved. Change-Id: I8bd5ee684a03f8e24f0b74d63ea98923945b0870 Reviewed-on: https://gerrit.libreoffice.org/21912 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
-rw-r--r--cui/source/options/optjava.cxx21
-rw-r--r--cui/source/options/optjava.hxx23
-rw-r--r--cui/uiconfig/ui/javastartparametersdialog.ui14
3 files changed, 57 insertions, 1 deletions
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index ee765235ee05..3de28be898d4 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -808,14 +808,17 @@ SvxJavaParameterDlg::SvxJavaParameterDlg( vcl::Window* pParent ) :
m_pAssignedList->SetDropDownLineCount(6);
m_pAssignedList->set_width_request(m_pAssignedList->approximate_char_width() * 54);
get( m_pRemoveBtn, "removebtn");
+ get( m_pEditBtn, "editbtn");
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_pEditBtn->SetClickHdl( LINK( this, SvxJavaParameterDlg, EditHdl_Impl ) );
m_pAssignedList->SetSelectHdl( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) );
m_pAssignedList->SetDoubleClickHdl( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) );
ModifyHdl_Impl( *m_pParameterEdit );
+ EnableEditButton();
EnableRemoveButton();
}
@@ -830,6 +833,7 @@ void SvxJavaParameterDlg::dispose()
m_pAssignBtn.clear();
m_pAssignedList.clear();
m_pRemoveBtn.clear();
+ m_pEditBtn.clear();
ModalDialog::dispose();
}
@@ -853,14 +857,30 @@ IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, AssignHdl_Impl, Button*, void)
m_pAssignedList->SelectEntryPos( nPos );
m_pParameterEdit->SetText( OUString() );
ModifyHdl_Impl( *m_pParameterEdit );
+ EnableEditButton();
EnableRemoveButton();
}
}
+IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, EditHdl_Impl, Button*, void)
+{
+ sal_Int32 nPos = m_pAssignedList->GetSelectEntryPos();
+
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ {
+ OUString eVal = m_pAssignedList->GetSelectEntry();
+ m_pAssignedList->RemoveEntry( nPos );
+ m_pParameterEdit->SetText( eVal );
+ }
+ DisableRemoveButton();
+ DisableEditButton();
+ EnableAssignButton();
+}
IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, SelectHdl_Impl, ListBox&, void)
{
+ EnableEditButton();
EnableRemoveButton();
}
@@ -893,7 +913,6 @@ IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, RemoveHdl_Impl, Button*, void)
}
-
short SvxJavaParameterDlg::Execute()
{
m_pParameterEdit->GrabFocus();
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 84fdfa480e46..0c8a41629dd9 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -127,18 +127,40 @@ private:
VclPtr<ListBox> m_pAssignedList;
VclPtr<PushButton> m_pRemoveBtn;
+ VclPtr<PushButton> m_pEditBtn;
+
DECL_LINK_TYPED(ModifyHdl_Impl, Edit&, void);
DECL_LINK_TYPED(AssignHdl_Impl, Button*, void);
DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void);
DECL_LINK_TYPED(DblClickHdl_Impl, ListBox&, void);
DECL_LINK_TYPED(RemoveHdl_Impl, Button*, void);
+ DECL_LINK_TYPED(EditHdl_Impl, Button*, void);
+
inline void EnableRemoveButton()
{ m_pRemoveBtn->Enable(
m_pAssignedList->GetSelectEntryPos()
!= LISTBOX_ENTRY_NOTFOUND ); }
+ inline void EnableEditButton()
+ { m_pEditBtn->Enable(
+ m_pAssignedList->GetSelectEntryPos()
+ != LISTBOX_ENTRY_NOTFOUND ); }
+
+ inline void EnableAssignButton()
+ { m_pAssignBtn->Enable(
+ true ); }
+
+ inline void DisableRemoveButton()
+ { m_pRemoveBtn->Disable(
+ true ); }
+
+ inline void DisableEditButton()
+ { m_pEditBtn->Disable(
+ true ); }
+
+
public:
explicit SvxJavaParameterDlg( vcl::Window* pParent );
virtual ~SvxJavaParameterDlg();
@@ -172,6 +194,7 @@ private:
{ m_pRemoveBtn->Enable(
m_pPathList->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
+
public:
explicit SvxJavaClassPathDlg( vcl::Window* pParent );
virtual ~SvxJavaClassPathDlg();
diff --git a/cui/uiconfig/ui/javastartparametersdialog.ui b/cui/uiconfig/ui/javastartparametersdialog.ui
index 2d5ec9722a3b..e1237ca77afb 100644
--- a/cui/uiconfig/ui/javastartparametersdialog.ui
+++ b/cui/uiconfig/ui/javastartparametersdialog.ui
@@ -191,6 +191,20 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="editbtn">
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">start</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
<placeholder/>
</child>
<child>