diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc index ddee13a74ba6..b970d44865f5 100644 --- a/desktop/source/deployment/gui/dp_gui.hrc +++ b/desktop/source/deployment/gui/dp_gui.hrc @@ -67,7 +67,7 @@ #define RID_CTX_ITEM_ENABLE (RID_DEPLOYMENT_GUI_START+81) #define RID_CTX_ITEM_DISABLE (RID_DEPLOYMENT_GUI_START+82) #define RID_CTX_ITEM_CHECK_UPDATE (RID_DEPLOYMENT_GUI_START+83) -#define RID_CTX_ITEM_OPTIONS (RID_DEPLOYMENT_GUI_START+84) +//There is a gap here #define RID_STR_ADDING_PACKAGES (RID_DEPLOYMENT_GUI_START+85) #define RID_STR_REMOVING_PACKAGES (RID_DEPLOYMENT_GUI_START+86) diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src index ae85a1d247d5..9078a353533a 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog.src +++ b/desktop/source/deployment/gui/dp_gui_dialog.src @@ -44,11 +44,6 @@ String RID_CTX_ITEM_CHECK_UPDATE Text [ en-US ] = "~Update..."; }; -String RID_CTX_ITEM_OPTIONS -{ - Text [ en-US ] = "~Options..."; -}; - String RID_STR_ADDING_PACKAGES { Text [ en-US ] = "Adding %EXTENSION_NAME"; diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 6afa3aea5923..043021d54c28 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -116,7 +116,6 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl { bool m_bInterfaceLocked; - VclPtr m_pOptionsBtn; VclPtr m_pEnableBtn; VclPtr m_pRemoveBtn; @@ -130,7 +129,6 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl DECL_LINK( ScrollHdl, ScrollBar*, void ); - DECL_LINK( HandleOptionsBtn, Button*, void ); DECL_LINK( HandleEnableBtn, Button*, void ); DECL_LINK( HandleRemoveBtn, Button*, void ); @@ -153,7 +151,6 @@ public: ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl(vcl::Window* pParent) : ExtensionBox_Impl(pParent) , m_bInterfaceLocked(false) - , m_pOptionsBtn(nullptr) , m_pEnableBtn(nullptr) , m_pRemoveBtn(nullptr) , m_pParent(nullptr) @@ -166,26 +163,21 @@ void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog) m_pParent = pParentDialog; - m_pOptionsBtn = VclPtr::Create( this, WB_TABSTOP ); m_pEnableBtn = VclPtr::Create( this, WB_TABSTOP ); m_pRemoveBtn = VclPtr::Create( this, WB_TABSTOP ); SetHelpId( HID_EXTENSION_MANAGER_LISTBOX ); - m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS ); m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE ); m_pRemoveBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_REMOVE ); - m_pOptionsBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleOptionsBtn ) ); m_pEnableBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleEnableBtn ) ); m_pRemoveBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleRemoveBtn ) ); - m_pOptionsBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_OPTIONS ) ); m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); m_pRemoveBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) ); Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ), MapMode( MapUnit::MapAppFont ) ); - m_pOptionsBtn->SetSizePixel( aSize ); m_pEnableBtn->SetSizePixel( aSize ); m_pRemoveBtn->SetSizePixel( aSize ); @@ -207,7 +199,6 @@ ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl() void ExtBoxWithBtns_Impl::dispose() { - m_pOptionsBtn.disposeAndClear(); m_pEnableBtn.disposeAndClear(); m_pRemoveBtn.disposeAndClear(); m_pParent.clear(); @@ -225,8 +216,7 @@ void ExtBoxWithBtns_Impl::RecalcAll() } else { - m_pOptionsBtn->Disable(); - m_pOptionsBtn->Hide(); + m_pParent->enableOptionsButton( false ); m_pEnableBtn->Disable(); m_pEnableBtn->Hide(); m_pRemoveBtn->Disable(); @@ -252,14 +242,12 @@ void ExtBoxWithBtns_Impl::selectEntry( const long nPos ) void ExtBoxWithBtns_Impl::SetButtonPos( const Rectangle& rRect ) { - Size aBtnSize( m_pOptionsBtn->GetSizePixel() ); + Size aBtnSize( m_pRemoveBtn->GetSizePixel() ); Point aBtnPos( rRect.Left() + ICON_OFFSET, rRect.Bottom() - TOP_OFFSET - aBtnSize.Height() ); - m_pOptionsBtn->SetPosPixel( aBtnPos ); - aBtnPos.X() = rRect.Right() - TOP_OFFSET - aBtnSize.Width(); m_pRemoveBtn->SetPosPixel( aBtnPos ); - aBtnPos.X() -= ( TOP_OFFSET + aBtnSize.Width() ); + aBtnPos.X() = rRect.Right() - TOP_OFFSET - aBtnSize.Width(); m_pEnableBtn->SetPosPixel( aBtnPos ); } @@ -296,14 +284,12 @@ void ExtBoxWithBtns_Impl::SetButtonStatus(const TEntry_Impl& rEntry) if ( rEntry->m_bHasOptions && bShowOptionBtn ) { - m_pOptionsBtn->Enable(); - m_pOptionsBtn->Show(); + m_pParent->enableOptionsButton( true ); rEntry->m_bHasButtons = true; } else { - m_pOptionsBtn->Disable(); - m_pOptionsBtn->Hide(); + m_pParent->enableOptionsButton( false ); } if ( rEntry->m_bUser || rEntry->m_bShared ) @@ -329,15 +315,9 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse ) PushButton *pNext = nullptr; - if ( m_pOptionsBtn->HasFocus() ) { - if ( !bReverse && !GetEntryData( nIndex )->m_bLocked ) - pNext = m_pEnableBtn; - } - else if ( m_pEnableBtn->HasFocus() ) { + if ( m_pEnableBtn->HasFocus() ) { if ( !bReverse ) pNext = m_pRemoveBtn; - else if ( GetEntryData( nIndex )->m_bHasOptions ) - pNext = m_pOptionsBtn; } else if ( m_pRemoveBtn->HasFocus() ) { if ( bReverse ) @@ -345,15 +325,11 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse ) } else { if ( !bReverse ) { - if ( GetEntryData( nIndex )->m_bHasOptions ) - pNext = m_pOptionsBtn; - else if ( ! GetEntryData( nIndex )->m_bLocked ) + if ( ! GetEntryData( nIndex )->m_bLocked ) pNext = m_pEnableBtn; } else { if ( ! GetEntryData( nIndex )->m_bLocked ) pNext = m_pRemoveBtn; - else if ( GetEntryData( nIndex )->m_bHasOptions ) - pNext = m_pOptionsBtn; } } @@ -471,9 +447,9 @@ void ExtBoxWithBtns_Impl::enableButtons( bool bEnable ) } else { - m_pOptionsBtn->Enable( false ); m_pRemoveBtn->Enable( false ); m_pEnableBtn->Enable( false ); + m_pParent->enableOptionsButton( false ); } } @@ -482,37 +458,15 @@ IMPL_LINK( ExtBoxWithBtns_Impl, ScrollHdl, ScrollBar*, pScrBar, void ) { long nDelta = pScrBar->GetDelta(); - Point aNewOptPt( m_pOptionsBtn->GetPosPixel() - Point( 0, nDelta ) ); Point aNewRemPt( m_pRemoveBtn->GetPosPixel() - Point( 0, nDelta ) ); Point aNewEnPt( m_pEnableBtn->GetPosPixel() - Point( 0, nDelta ) ); DoScroll( nDelta ); - m_pOptionsBtn->SetPosPixel( aNewOptPt ); m_pRemoveBtn->SetPosPixel( aNewRemPt ); m_pEnableBtn->SetPosPixel( aNewEnPt ); } - -IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleOptionsBtn, Button*, void) -{ - const sal_Int32 nActive = getSelIndex(); - - if ( nActive != svt::IExtensionListBox::ENTRY_NOTFOUND ) - { - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - - if ( pFact ) - { - OUString sExtensionId = GetEntryData( nActive )->m_xPackage->getIdentifier().Value; - ScopedVclPtr pDlg(pFact->CreateOptionsDialog( this, sExtensionId, OUString() )); - - pDlg->Execute(); - } - } -} - - IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleEnableBtn, Button*, void) { const sal_Int32 nActive = getSelIndex(); @@ -689,8 +643,9 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager, , m_pManager(pManager) { get(m_pExtensionBox, "extensions"); - get(m_pAddBtn, "add"); - get(m_pUpdateBtn, "update"); + get(m_pOptionsBtn, "optionsbtn"); + get(m_pAddBtn, "addbtn"); + get(m_pUpdateBtn, "updatebtn"); get(m_pCloseBtn, "close"); get(m_pBundledCbx, "bundled"); get(m_pSharedCbx, "shared"); @@ -702,6 +657,9 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager, m_pExtensionBox->InitFromDialog(this); + m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS ); + + m_pOptionsBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleOptionsBtn ) ); m_pAddBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleAddBtn ) ); m_pCloseBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleCloseBtn ) ); @@ -738,6 +696,7 @@ void ExtMgrDialog::dispose() { m_aIdle.Stop(); m_pExtensionBox.clear(); + m_pOptionsBtn.clear(); m_pAddBtn.clear(); m_pUpdateBtn.clear(); m_pCloseBtn.clear(); @@ -942,6 +901,10 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() return files; } +void ExtMgrDialog::enableOptionsButton( bool bEnable ) +{ + m_pOptionsBtn->Enable( bEnable ); +} IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn, Button*, void) { @@ -1042,6 +1005,23 @@ void ExtMgrDialog::updatePackageInfo( const uno::Reference< deployment::XPackage m_pExtensionBox->updateEntry( xPackage ); } +IMPL_LINK_NOARG(ExtMgrDialog, HandleOptionsBtn, Button*, void) +{ + const sal_Int32 nActive = m_pExtensionBox->getSelIndex(); + + if ( nActive != svt::IExtensionListBox::ENTRY_NOTFOUND ) + { + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); + + if ( pFact ) + { + OUString sExtensionId = m_pExtensionBox->GetEntryData( nActive )->m_xPackage->getIdentifier().Value; + ScopedVclPtr pDlg(pFact->CreateOptionsDialog( this, sExtensionId, OUString() )); + + pDlg->Execute(); + } + } +} IMPL_LINK_NOARG(ExtMgrDialog, HandleAddBtn, Button*, void) { diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index db0ad303aec3..3f0317163fbc 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -102,6 +102,7 @@ class ExtMgrDialog : public ModelessDialog, public DialogHelper { VclPtr m_pExtensionBox; + VclPtr m_pOptionsBtn; VclPtr m_pAddBtn; VclPtr m_pUpdateBtn; VclPtr m_pCloseBtn; @@ -132,6 +133,7 @@ class ExtMgrDialog : public ModelessDialog, bool removeExtensionWarn( const OUString &rExtensionTitle ) const; + DECL_LINK( HandleOptionsBtn, Button*, void ); DECL_LINK( HandleAddBtn, Button*, void ); DECL_LINK( HandleUpdateBtn, Button*, void ); DECL_LINK( HandleCancelBtn, Button*, void ); @@ -171,6 +173,8 @@ public: virtual void checkEntries() override; css::uno::Sequence< OUString > raiseAddPicker(); + + void enableOptionsButton( bool bEnable ); }; diff --git a/desktop/uiconfig/ui/extensionmanager.ui b/desktop/uiconfig/ui/extensionmanager.ui index 7db4d203bc4e..af2f904ee737 100644 --- a/desktop/uiconfig/ui/extensionmanager.ui +++ b/desktop/uiconfig/ui/extensionmanager.ui @@ -1,5 +1,5 @@ - + @@ -32,34 +32,6 @@ True - - - Add... - True - True - True - True - True - - - False - True - 1 - - - - - Check for updates... - True - True - True - - - False - True - 2 - - gtk-close @@ -71,7 +43,7 @@ False True - 3 + 1 @@ -99,6 +71,93 @@ 0 + + + True + False + 6 + start + + + _Options + True + True + True + True + + + True + True + 0 + + + + + Check for _Updates + True + True + True + True + + + False + True + 1 + True + + + + + _Add + True + True + True + True + True + True + + + False + True + 2 + True + + + + + Remove + True + True + True + + + True + True + 3 + True + + + + + Enable + True + True + True + + + True + True + 4 + True + + + + + False + True + 1 + + True @@ -187,7 +246,7 @@ False True - 1 + 2 @@ -199,8 +258,8 @@ False True - right Adding %EXTENSION_NAME + right 0 @@ -247,11 +306,20 @@ 1 + + + + + + + + + False True - 2 + 3 @@ -265,8 +333,6 @@ help - add - update close