summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorEfe Gürkan YALAMAN <efeyalaman@gmail.com>2013-11-17 20:49:37 +0200
committerThorsten Behrens <thb@documentfoundation.org>2013-11-20 06:54:54 -0600
commitdde6090b1ac8aecf539e7a779d0f3f42eff3bfb5 (patch)
tree27fba299eea75b8ce5887b94e8d0fc24838ee3fc /cui/source
parenta5b4c3dc7300e38621b97b6ddfbc6adf6a9792cf (diff)
fdo#67642 Expert Config Page Moved to its own window
Expert Config Page moved SfxTabPage to ModalDialog. It has its own window as requested on this bug. Double click works as edit button now for better usability. Also Default button renamed as Reset button. Change-Id: Ie4732860b9677a313697d5faa72109c8b16b9c2d Reviewed-on: https://gerrit.libreoffice.org/6704 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Thorsten Behrens <thb@documentfoundation.org> Tested-by: Thorsten Behrens <thb@documentfoundation.org>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/options/optaboutconfig.cxx55
-rw-r--r--cui/source/options/optaboutconfig.hxx16
-rw-r--r--cui/source/options/optjava.cxx19
-rw-r--r--cui/source/options/optjava.hxx3
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/options/treeopt.src1
6 files changed, 49 insertions, 47 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 57e51905c2b3..742b649d6675 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -122,10 +122,15 @@ Size CuiCustomMultilineEdit::GetOptimalSize() const
return LogicToPixel(Size(150,30),MAP_APPFONT);
}
-CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet& rItemSet ) :
- SfxTabPage( pParent, "AboutConfig", "cui/ui/aboutconfigdialog.ui", rItemSet),
+Size CuiAboutConfigTabPage::GetOptimalSize() const
+{
+ return LogicToPixel(Size(1024,800),MAP_APPFONT);
+}
+
+CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSet& rItemSet*/ ) :
+ ModalDialog( pParent, "AboutConfig", "cui/ui/aboutconfigdialog.ui"),
m_pPrefCtrl( get<SvSimpleTableContainer>("preferences") ),
- m_pDefaultBtn( get<PushButton>("default") ),
+ m_pResetBtn( get<PushButton>("reset") ),
m_pEditBtn( get<PushButton>("edit") ),
m_vectorOfModified(),
m_pPrefBox( new OptHeaderTabListBox( *m_pPrefCtrl,
@@ -136,6 +141,8 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet&
m_pPrefCtrl->set_height_request(aControlSize.Height());
m_pEditBtn->SetClickHdl( LINK( this, CuiAboutConfigTabPage, StandardHdl_Impl ) );
+ m_pResetBtn->SetClickHdl( LINK( this, CuiAboutConfigTabPage, ResetBtnHdl_Impl ) );
+ m_pPrefBox->SetDoubleClickHdl( LINK(this, CuiAboutConfigTabPage, StandardHdl_Impl) );
HeaderBar &rBar = m_pPrefBox->GetTheHeaderBar();
rBar.InsertItem( ITEMID_PREFNAME, get<FixedText>("preference")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
@@ -143,7 +150,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet&
rBar.InsertItem( ITEMID_TYPE, get<FixedText>("type")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
rBar.InsertItem( ITEMID_VALUE, get<FixedText>("value")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
- long aTabs[] = {4,120,50,50,50};//TODO: Not works correctly hardcoded for now.
+ long aTabs[] = {4,900,50,50,50};//TODO: Not works correctly hardcoded for now.
aTabs[2] += aTabs[1] + rBar.GetTextWidth(rBar.GetItemText(1));
aTabs[3] += aTabs[2] + 160; //rBar.GetTextWidth(rBar.GetItemText(2));
@@ -152,11 +159,6 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet&
m_pPrefBox->SetTabs(aTabs, MAP_PIXEL);
}
-SfxTabPage* CuiAboutConfigTabPage::Create( Window* pParent, const SfxItemSet& rItemSet )
-{
- return ( new CuiAboutConfigTabPage( pParent, rItemSet) );
-}
-
void CuiAboutConfigTabPage::InsertEntry( OUString& rProp, OUString& rStatus, OUString& rType, OUString& rValue)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
@@ -170,7 +172,7 @@ void CuiAboutConfigTabPage::InsertEntry( OUString& rProp, OUString& rStatus, OU
m_pPrefBox->Insert( pEntry );
}
-void CuiAboutConfigTabPage::Reset( const SfxItemSet& )
+void CuiAboutConfigTabPage::Reset(/* const SfxItemSet&*/ )
{
OUString sRootNodePath = "";
m_pPrefBox->Clear();
@@ -178,15 +180,13 @@ void CuiAboutConfigTabPage::Reset( const SfxItemSet& )
m_vectorOfModified.clear();
m_pPrefBox->GetModel()->SetSortMode( SortNone );
- m_pDefaultBtn->Enable(sal_False);
-
m_pPrefBox->SetUpdateMode(sal_False);
Reference< XNameAccess > xConfigAccess = getConfigAccess( sRootNodePath, sal_False );
FillItems( xConfigAccess, sRootNodePath );
m_pPrefBox->SetUpdateMode(sal_True);
}
-sal_Bool CuiAboutConfigTabPage::FillItemSet( SfxItemSet& )
+sal_Bool CuiAboutConfigTabPage::FillItemSet(/* SfxItemSet&*/ )
{
sal_Bool bModified = sal_False;
Reference< XNameAccess > xUpdateAccess = getConfigAccess( "/", sal_True );
@@ -432,30 +432,11 @@ IMPL_LINK( CuiAboutConfigTabPage, HeaderSelect_Impl, HeaderBar*, /*pBar*/ )
return 0;
}
- //if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
- //return 0;
-
- //HeaderBarItemBits nBits = pBar->GetItemBits(ITEMID_TYPE);
- //sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- //SvSortMode eMode = SortAscending;
-
- //if ( bUp )
- //{
- //nBits &= ~HIB_UPARROW;
- //nBits |= HIB_DOWNARROW;
- //eMode = SortDescending;
- //}
- //else
- //{
- //nBits &= ~HIB_DOWNARROW;
- //nBits |= HIB_UPARROW;
- //}
- //pBar->SetItemBits( ITEMID_TYPE, nBits );
- //SvTreeList* pModel = m_pPrefBox->GetModel();
- //pModel->SetSortMode( eMode );
- //pModel->Resort();
- //return 1;
- //}
+IMPL_LINK_NOARG( CuiAboutConfigTabPage, ResetBtnHdl_Impl )
+{
+ Reset();
+ return 0;
+}
IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
{
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index 6b27066bcf5c..55ba3e22bd1e 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -40,31 +40,33 @@ public:
//void setBehaviour( bool bNumeric, int nLengthLimit);
};
-class CuiAboutConfigTabPage : public SfxTabPage
+class CuiAboutConfigTabPage : public ModalDialog
{
private:
SvSimpleTableContainer* m_pPrefCtrl;
- PushButton* m_pDefaultBtn;
+ PushButton* m_pResetBtn;
PushButton* m_pEditBtn;
std::vector< boost::shared_ptr< Prop_Impl > > m_vectorOfModified;
boost::scoped_ptr< svx::OptHeaderTabListBox > m_pPrefBox;
- CuiAboutConfigTabPage( Window* pParent, const SfxItemSet& rItemSet );
void AddToModifiedVector( const boost::shared_ptr< Prop_Impl >& rProp );
std::vector< OUString > commaStringToSequence( const OUString& rCommaSepString );
DECL_LINK( HeaderSelect_Impl, HeaderBar * );
DECL_LINK( StandardHdl_Impl, void * );
+ DECL_LINK( ResetBtnHdl_Impl, void * );
public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rItemset );
-
+ //static ModalDialog* Create( Window* pParent, const SfxItemSet& rItemset );
+ CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSet& rItemSet*/ );
void InsertEntry(OUString& rProp, OUString& rStatus, OUString& rType, OUString& rValue);
- void Reset( const SfxItemSet& );
+ void Reset(/* const SfxItemSet&*/ );
void FillItems( com::sun::star::uno::Reference < com::sun::star::container::XNameAccess > xNameAccess, OUString sPath);
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess( OUString sNodePath, sal_Bool bUpdate );
- virtual sal_Bool FillItemSet( SfxItemSet& rSet );
+ virtual sal_Bool FillItemSet( /* SfxItemSet& rSet*/ );
+
+ virtual Size GetOptimalSize() const;
};
class CuiAboutConfigValueDialog : public ModalDialog
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 348c411947e4..1841c40a700a 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -19,6 +19,7 @@
#include <config_features.h>
+#include "optaboutconfig.hxx"
#include "optjava.hxx"
#include <dialmgr.hxx>
@@ -149,6 +150,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
get(m_pClassPathBtn, "classpath");
get(m_pExperimentalCB, "experimental");
get(m_pMacroCB, "macrorecording");
+ get(m_pExpertConfigBtn, "expertconfig");
m_sAccessibilityText = get<FixedText>("a11y")->GetText();
m_sAddDialogText = get<FixedText>("selectruntime")->GetText();
@@ -180,6 +182,8 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
m_aResetTimer.SetTimeoutHdl( LINK( this, SvxJavaOptionsPage, ResetHdl_Impl ) );
m_aResetTimer.SetTimeout( RESET_TIMEOUT );
+ m_pExpertConfigBtn->SetClickHdl( LINK( this, SvxJavaOptionsPage, ExpertConfigHdl_Impl) );
+
xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, DialogClosedHdl ) );
EnableHdl_Impl(m_pJavaEnableCB);
@@ -411,6 +415,21 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
// -----------------------------------------------------------------------
+IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
+{
+ CuiAboutConfigTabPage* m_pExpertConfigDlg = new CuiAboutConfigTabPage(this);
+ m_pExpertConfigDlg->Reset();//initialize and reset function
+
+ if( RET_OK == m_pExpertConfigDlg->Execute() )
+ {
+ m_pExpertConfigDlg->FillItemSet();//save changes if there are any
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
void SvxJavaOptionsPage::ClearJavaInfo()
{
#if HAVE_FEATURE_JAVA
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 1b474ca6eab4..e37baa756c10 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -57,6 +57,7 @@ private:
PushButton* m_pAddBtn;
PushButton* m_pParameterBtn;
PushButton* m_pClassPathBtn;
+ PushButton* m_pExpertConfigBtn;
SvxJavaParameterDlg* m_pParamDlg;
SvxJavaClassPathDlg* m_pPathDlg;
@@ -93,6 +94,8 @@ private:
DECL_LINK( StartFolderPickerHdl, void * );
DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
+ DECL_LINK(ExpertConfigHdl_Impl, void *);
+
void ClearJavaInfo();
void ClearJavaList();
void LoadJREs();
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 171af686a963..6d5c27eeb0db 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -319,7 +319,6 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
- case RID_SVXPAGE_ABOUT_CONFIG: fnCreate = &CuiAboutConfigTabPage::Create; break;
#ifndef DISABLE_SCRIPTING
case RID_SVXPAGE_BASICIDE_OPTIONS: fnCreate = &SvxBasicIDEOptionsPage::Create; break;
#endif
@@ -355,7 +354,6 @@ static OptionsMapping_Impl const OptionsMap_Impl[] =
{ "ProductName", "Java", RID_SVXPAGE_OPTIONS_JAVA },
{ "ProductName", "BasicIDEOptions", RID_SVXPAGE_BASICIDE_OPTIONS },
{ "ProductName", "OnlineUpdate", RID_SVXPAGE_ONLINEUPDATE },
- { "ProductName", "AboutConfig", RID_SVXPAGE_ABOUT_CONFIG },
{ "LanguageSettings", NULL, SID_LANGUAGE_OPTIONS },
{ "LanguageSettings", "Languages", OFA_TP_LANGUAGES },
{ "LanguageSettings", "WritingAids", RID_SFXPAGE_LINGU },
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index f5f6a6603e26..fe4428fc00c6 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -102,7 +102,6 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
< "Advanced" ; RID_SVXPAGE_OPTIONS_JAVA ; > ;
< "Basic IDE Options" ; RID_SVXPAGE_BASICIDE_OPTIONS ; > ;
< "Online Update" ; RID_SVXPAGE_ONLINEUPDATE ; > ;
- < "Expert Config" ; RID_SVXPAGE_ABOUT_CONFIG ; > ;
};
};
StringArray SID_LANGUAGE_OPTIONS