Remove unused Reset buttons from various dialogs
These dialogs hide the standard Reset button that SfxTabDialogController adds to dialogs. Instead of doing that, let's just not create a button that has to be hidden in the first place. Dialogs can be accessed via: New Base doc -> Edit -> Database -> Advanced Settings... New Base doc -> Tools -> User Administration... New Base doc -> Edit -> Database -> Properties... New <any> doc -> Export as... -> Export as PDF... New Writer doc -> Insert -> Footnote and Endnote -> Footnote then right-click in the footnote area -> Footnote/Endnote Settings... Change-Id: I06ed3ff8f70db9eb081e654d2f73deda480c3322 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207236 Reviewed-by: Dan Williams <dcbw@libreoffice.org> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
This commit is contained in:
@@ -60,9 +60,6 @@ namespace dbaui
|
||||
m_xExampleSet.reset(new SfxItemSet(*GetInputSetImpl()));
|
||||
|
||||
AddTabPage(u"settings"_ustr, OUserAdmin::Create, nullptr);
|
||||
|
||||
// remove the reset button - it's meaning is much too ambiguous in this dialog
|
||||
RemoveResetButton();
|
||||
}
|
||||
|
||||
OUserAdminDlg::~OUserAdminDlg()
|
||||
|
||||
@@ -383,9 +383,6 @@ namespace dbaui
|
||||
// any "special settings"?
|
||||
if (rFeatures.supportsAnySpecialSetting())
|
||||
AddTabPage(u"special"_ustr, DBA_RES(STR_SPECIAL_SETTINGS), ODriversSettings::CreateSpecialSettingsPage, nullptr);
|
||||
|
||||
// remove the reset button - it's meaning is much too ambiguous in this dialog
|
||||
RemoveResetButton();
|
||||
}
|
||||
|
||||
AdvancedSettingsDialog::~AdvancedSettingsDialog()
|
||||
|
||||
@@ -49,9 +49,6 @@ ODbAdminDialog::ODbAdminDialog(weld::Window* pParent,
|
||||
|
||||
// add the initial tab page
|
||||
AddTabPage(m_sMainPageID, OConnectionTabPage::Create, nullptr);
|
||||
|
||||
// remove the reset button - it's meaning is much too ambiguous in this dialog
|
||||
RemoveResetButton();
|
||||
}
|
||||
|
||||
ODbAdminDialog::~ODbAdminDialog()
|
||||
|
||||
@@ -20,20 +20,6 @@
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="label" translatable="yes" context="stock">_Reset</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok">
|
||||
<property name="label" translatable="yes" context="stock">_OK</property>
|
||||
@@ -47,7 +33,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -61,7 +47,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -126,7 +112,6 @@
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="101">reset</action-widget>
|
||||
<action-widget response="-5">ok</action-widget>
|
||||
<action-widget response="-6">cancel</action-widget>
|
||||
<action-widget response="-11">help</action-widget>
|
||||
|
||||
@@ -20,20 +20,6 @@
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="label" translatable="yes" context="stock">_Reset</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="no-show-all">True</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok">
|
||||
<property name="label" translatable="yes" context="stock">_OK</property>
|
||||
@@ -47,7 +33,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -61,7 +47,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -75,7 +61,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
<property name="position">2</property>
|
||||
<property name="secondary">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -105,7 +91,6 @@
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="101">reset</action-widget>
|
||||
<action-widget response="-5">ok</action-widget>
|
||||
<action-widget response="-6">cancel</action-widget>
|
||||
<action-widget response="-11">help</action-widget>
|
||||
|
||||
@@ -23,19 +23,6 @@
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="label" translatable="yes" context="stock">_Reset</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok">
|
||||
<property name="label" translatable="yes" context="stock">_OK</property>
|
||||
@@ -49,7 +36,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -63,7 +50,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -77,7 +64,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
<property name="position">2</property>
|
||||
<property name="secondary">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -152,7 +139,6 @@
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="101">reset</action-widget>
|
||||
<action-widget response="-5">ok</action-widget>
|
||||
<action-widget response="-6">cancel</action-widget>
|
||||
<action-widget response="-11">help</action-widget>
|
||||
|
||||
@@ -228,9 +228,6 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property
|
||||
|
||||
GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl));
|
||||
GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl));
|
||||
|
||||
// remove the reset button, not needed in this tabbed dialog
|
||||
RemoveResetButton();
|
||||
}
|
||||
|
||||
ImpPDFTabSecurityPage* ImpPDFTabDialog::getSecurityPage() const
|
||||
|
||||
@@ -20,19 +20,6 @@
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="label" translatable="yes" context="stock">_Reset</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok">
|
||||
<property name="label" translatable="yes" context="pdfoptionsdialog|ok">E_xport</property>
|
||||
@@ -46,7 +33,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -60,7 +47,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -74,7 +61,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
<property name="position">2</property>
|
||||
<property name="secondary">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -192,7 +192,6 @@ public:
|
||||
weld::Button* GetStandardButton() const { return m_xBaseFmtBtn.get(); }
|
||||
weld::Button* GetApplyButton() const { return m_xApplyBtn.get(); }
|
||||
weld::Button* GetResetButton() const { return m_xResetBtn.get(); }
|
||||
void RemoveResetButton();
|
||||
void RemoveStandardButton();
|
||||
|
||||
virtual short run() override;
|
||||
|
||||
@@ -96,13 +96,11 @@ SfxTabDialogItem* SfxTabDialogItem::Clone(SfxItemPool* pToPool) const
|
||||
|
||||
struct TabDlg_Impl
|
||||
{
|
||||
bool bHideResetBtn : 1;
|
||||
bool bStarted : 1;
|
||||
std::vector<Data_Impl*> aData;
|
||||
|
||||
explicit TabDlg_Impl(sal_uInt8 nCnt)
|
||||
: bHideResetBtn(false)
|
||||
, bStarted(false)
|
||||
: bStarted(false)
|
||||
{
|
||||
aData.reserve( nCnt );
|
||||
}
|
||||
@@ -134,14 +132,17 @@ SfxTabDialogController::SfxTabDialogController
|
||||
, m_bStandardPushed(false)
|
||||
{
|
||||
m_pImpl.reset(new TabDlg_Impl(m_xTabCtrl->get_n_pages()));
|
||||
m_pImpl->bHideResetBtn = !m_xResetBtn->get_visible();
|
||||
m_xOKBtn->connect_clicked(LINK(this, SfxTabDialogController, OkHdl));
|
||||
m_xCancelBtn->connect_clicked(LINK(this, SfxTabDialogController, CancelHdl));
|
||||
m_xResetBtn->connect_clicked(LINK(this, SfxTabDialogController, ResetHdl));
|
||||
m_xResetBtn->set_label(SfxResId(STR_RESET));
|
||||
m_xTabCtrl->connect_enter_page(LINK(this, SfxTabDialogController, ActivatePageHdl));
|
||||
m_xTabCtrl->connect_leave_page(LINK(this, SfxTabDialogController, DeactivatePageHdl));
|
||||
|
||||
if (m_xResetBtn)
|
||||
{
|
||||
m_xResetBtn->connect_clicked(LINK(this, SfxTabDialogController, ResetHdl));
|
||||
m_xResetBtn->set_label(SfxResId(STR_RESET));
|
||||
m_xResetBtn->set_help_id(HID_TABDLG_RESET_BTN);
|
||||
}
|
||||
|
||||
if (bEditFmt)
|
||||
{
|
||||
@@ -159,10 +160,6 @@ SfxTabDialogController::SfxTabDialogController
|
||||
m_xExampleSet.reset(new SfxItemSet(*m_pSet));
|
||||
m_pOutSet.reset(new SfxItemSet(*m_pSet->GetPool(), m_pSet->GetRanges()));
|
||||
}
|
||||
|
||||
// The reset functionality seems to be confusing to many; disable in LOK.
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
RemoveResetButton();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(SfxTabDialogController, OkHdl, weld::Button&, void)
|
||||
@@ -348,11 +345,14 @@ void SfxTabDialogController::ActivatePage(const OUString& rPage)
|
||||
if (m_xExampleSet)
|
||||
pTabPage->ActivatePage(*m_xExampleSet);
|
||||
|
||||
if (pTabPage->IsReadOnly() || m_pImpl->bHideResetBtn)
|
||||
if (m_xResetBtn)
|
||||
{
|
||||
if (pTabPage->IsReadOnly())
|
||||
m_xResetBtn->hide();
|
||||
else
|
||||
m_xResetBtn->show();
|
||||
}
|
||||
}
|
||||
|
||||
IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, const OUString&, rPage, bool)
|
||||
{
|
||||
@@ -1110,12 +1110,6 @@ SfxItemSet* SfxTabDialogController::GetInputSetImpl()
|
||||
return m_pSet.get();
|
||||
}
|
||||
|
||||
void SfxTabDialogController::RemoveResetButton()
|
||||
{
|
||||
m_xResetBtn->hide();
|
||||
m_pImpl->bHideResetBtn = true;
|
||||
}
|
||||
|
||||
void SfxTabDialogController::RemoveStandardButton()
|
||||
{
|
||||
m_xBaseFmtBtn->hide();
|
||||
|
||||
@@ -43,8 +43,6 @@ SwFootNoteOptionDlg::SwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rS)
|
||||
: SfxTabDialogController(pParent, u"modules/swriter/ui/footendnotedialog.ui"_ustr, u"FootEndnoteDialog"_ustr)
|
||||
, m_rSh( rS )
|
||||
{
|
||||
RemoveResetButton();
|
||||
|
||||
GetOKButton().connect_clicked(LINK(this, SwFootNoteOptionDlg, OkHdl));
|
||||
|
||||
AddTabPage(u"footnotes"_ustr, TabResId(RID_TAB_FOOTNOTES.aLabel), SwFootNoteOptionPage::Create,
|
||||
|
||||
@@ -20,19 +20,6 @@
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="label" translatable="yes" context="stock">_Reset</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok">
|
||||
<property name="label" translatable="yes" context="stock">_OK</property>
|
||||
@@ -46,7 +33,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -60,7 +47,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -74,7 +61,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
<property name="position">2</property>
|
||||
<property name="secondary">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
Reference in New Issue
Block a user