From dde6090b1ac8aecf539e7a779d0f3f42eff3bfb5 Mon Sep 17 00:00:00 2001 From: Efe Gürkan YALAMAN Date: Sun, 17 Nov 2013 20:49:37 +0200 Subject: 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 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- cui/source/options/optaboutconfig.cxx | 55 ++---- cui/source/options/optaboutconfig.hxx | 16 +- cui/source/options/optjava.cxx | 19 ++ cui/source/options/optjava.hxx | 3 + cui/source/options/treeopt.cxx | 2 - cui/source/options/treeopt.src | 1 - cui/uiconfig/ui/aboutconfigdialog.ui | 320 ++++++++++++++++++++-------------- cui/uiconfig/ui/optadvancedpage.ui | 18 ++ 8 files changed, 256 insertions(+), 178 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("preferences") ), - m_pDefaultBtn( get("default") ), + m_pResetBtn( get("reset") ), m_pEditBtn( get("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("preference")->GetText(), 0, HIB_LEFT | HIB_VCENTER ); @@ -143,7 +150,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet& rBar.InsertItem( ITEMID_TYPE, get("type")->GetText(), 0, HIB_LEFT | HIB_VCENTER ); rBar.InsertItem( ITEMID_VALUE, get("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 +#include "optaboutconfig.hxx" #include "optjava.hxx" #include @@ -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("a11y")->GetText(); m_sAddDialogText = get("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 diff --git a/cui/uiconfig/ui/aboutconfigdialog.ui b/cui/uiconfig/ui/aboutconfigdialog.ui index e99008922ac9..b92e63f5b8b0 100644 --- a/cui/uiconfig/ui/aboutconfigdialog.ui +++ b/cui/uiconfig/ui/aboutconfigdialog.ui @@ -1,159 +1,215 @@ - - True + + False - 6 - vertical - 12 - - + 5 + dialog + + True False - True - True - 0 - none + vertical + 12 + + + False + end + + + Edit + True + True + True + + + False + True + 1 + + + + + Reset + True + True + True + + + False + True + 2 + + + + + gtk-ok + True + True + True + True + + + False + True + 3 + + + + + gtk-cancel + True + True + True + True + + + False + True + 4 + + + + + gtk-help + True + True + True + True + + + False + True + 5 + + + + + False + True + end + 0 + + - + True False - 6 - 12 + True + True + 0 + none - + True False - vertical + 6 + 12 - + + True False - True - 6 - 6 - True + vertical - - True + False - 0.49000000953674316 - Preference Name + True + 6 + 6 + True + + + True + False + 0.49000000953674316 + Preference Name + + + 0 + 0 + 1 + 1 + + + + + True + False + 0.51999998092651367 + 0.50999999046325684 + Property + + + 1 + 0 + 1 + 1 + + + + + True + False + Type + + + 2 + 0 + 1 + 1 + + + + + True + False + Value + + + 3 + 0 + 1 + 1 + + - 0 - 0 - 1 - 1 + False + True + 0 - + True - False - 0.51999998092651367 - 0.50999999046325684 - Property - - - 1 - 0 - 1 - 1 - - - - - True - False - Type + True + True + True + + + - 2 - 0 - 1 - 1 - - - - - True - False - Value - - - 3 - 0 - 1 - 1 + True + True + 1 - - False - True - 0 - - - - - True - False - True - True - - - True - True - 1 - - - - - - True - False - Preferences - - - - - - - - False - True - 0 - - - - - True - False - 12 - end - - - Default - True - True - True - - - False - True - 0 - - - - - Edit - True - True - True + + + True + False + Preferences + + + + + False @@ -162,11 +218,13 @@ - - False - True - 1 - + + edit + reset + ok + cancel + help + diff --git a/cui/uiconfig/ui/optadvancedpage.ui b/cui/uiconfig/ui/optadvancedpage.ui index 26ba413a251c..4554014fa07e 100644 --- a/cui/uiconfig/ui/optadvancedpage.ui +++ b/cui/uiconfig/ui/optadvancedpage.ui @@ -1,6 +1,7 @@ + True False @@ -237,6 +238,9 @@ False True True + + + 0 @@ -355,6 +359,20 @@ 1 + + + Expert Config Page + True + True + True + + + 0 + 2 + 1 + 1 + + -- cgit v1.2.3