Kaydet (Commit) 019c6ae2 authored tarafından heiko tietze's avatar heiko tietze Kaydeden (comit) Heiko Tietze

Resolves tdf#87965 - Make 'Search Results' dialog optional

* Option introduced at Tools > Options > Calc > View (Windows)
* Convenience checkbox added to the dialog

Change-Id: Ic30fb302e61e77b0eefacd504f61f955bcf6e595
Reviewed-on: https://gerrit.libreoffice.org/71910
Tested-by: Jenkins
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
üst 5187d3ae
......@@ -390,6 +390,14 @@
</info>
<value>true</value>
</prop>
<prop oor:name="SearchSummary" oor:type="xs:boolean" oor:nillable="false">
<!-- UIHints: Tools - Options -Spreadsheets - View - [Section] Window -->
<info>
<desc>Specifies whether a summarizing dialog is displayed after search.</desc>
<label>Search summary</label>
</info>
<value>true</value>
</prop>
</group>
<group oor:name="Other">
<info>
......
......@@ -44,7 +44,8 @@ enum ScViewOption
VOPT_HELPLINES,
VOPT_ANCHOR,
VOPT_PAGEBREAKS,
VOPT_CLIPMARKS
VOPT_SUMMARY,
VOPT_CLIPMARKS,
};
enum ScVObjType
......
......@@ -109,6 +109,7 @@ void ScViewOptions::SetDefaults()
aOptArr[ VOPT_ANCHOR ] = true;
aOptArr[ VOPT_PAGEBREAKS ] = true;
aOptArr[ VOPT_CLIPMARKS ] = true;
aOptArr[ VOPT_SUMMARY ] = true;
aModeArr[VOBJ_TYPE_OLE ] = VOBJ_MODE_SHOW;
aModeArr[VOBJ_TYPE_CHART] = VOBJ_MODE_SHOW;
......@@ -214,6 +215,7 @@ SfxPoolItem* ScTpViewItem::Clone( SfxItemPool * ) const
#define SCLAYOUTOPT_SHEETTAB 7
#define SCLAYOUTOPT_OUTLINE 8
#define SCLAYOUTOPT_GRID_ONCOLOR 9
#define SCLAYOUTOPT_SUMMARY 10
#define CFGPATH_DISPLAY "Office.Calc/Content/Display"
......@@ -251,7 +253,8 @@ Sequence<OUString> ScViewCfg::GetLayoutPropertyNames()
"Window/VerticalScroll", // SCLAYOUTOPT_VERTSCROLL
"Window/SheetTab", // SCLAYOUTOPT_SHEETTAB
"Window/OutlineSymbol", // SCLAYOUTOPT_OUTLINE
"Line/GridOnColoredCells"}; // SCLAYOUTOPT_GRID_ONCOLOR;
"Line/GridOnColoredCells", // SCLAYOUTOPT_GRID_ONCOLOR;
"Window/SearchSummary"}; // SCLAYOUTOPT_SUMMARY
}
Sequence<OUString> ScViewCfg::GetDisplayPropertyNames()
......@@ -339,6 +342,9 @@ ScViewCfg::ScViewCfg() :
case SCLAYOUTOPT_OUTLINE:
SetOption( VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) );
break;
case SCLAYOUTOPT_SUMMARY:
SetOption( VOPT_SUMMARY, ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) );
break;
}
}
}
......@@ -503,6 +509,9 @@ IMPL_LINK_NOARG(ScViewCfg, LayoutCommitHdl, ScLinkConfigItem&, void)
case SCLAYOUTOPT_OUTLINE:
pValues[nProp] <<= GetOption( VOPT_OUTLINER );
break;
case SCLAYOUTOPT_SUMMARY:
pValues[nProp] <<= GetOption( VOPT_SUMMARY );
break;
}
}
aLayoutItem.PutProperties(aNames, aValues);
......
......@@ -26,9 +26,10 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParen
, mpDoc(nullptr)
, mxList(m_xBuilder->weld_tree_view("results"))
, mxSearchResults(m_xBuilder->weld_label("lbSearchResults"))
, mxShowDialog(m_xBuilder->weld_check_button("cbShow"))
{
mxList->set_size_request(mxList->get_approximate_digit_width() * 50, mxList->get_height_rows(15));
mxShowDialog->connect_toggled(LINK(this, SearchResultsDlg, OnShowToggled));
std::vector<int> aWidths;
aWidths.push_back(mxList->get_approximate_digit_width() * 10);
aWidths.push_back(mxList->get_approximate_digit_width() * 10);
......@@ -187,6 +188,14 @@ IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl, weld::TreeView&, void )
pScViewShell->AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP);
}
IMPL_STATIC_LINK( SearchResultsDlg, OnShowToggled, weld::ToggleButton&, rButton, void )
{
ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
ScViewOptions aViewOpt( pScViewShell->GetViewData().GetOptions() );
aViewOpt.SetOption( VOPT_SUMMARY, rButton.get_active() );
pScViewShell->GetViewData().SetOptions( aViewOpt );
}
SearchResultsDlgWrapper::SearchResultsDlgWrapper(
vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* /*pInfo*/)
: SfxChildWindow(_pParent, nId)
......
......@@ -27,8 +27,10 @@ class SearchResultsDlg : public SfxDialogController
ScDocument* mpDoc;
std::unique_ptr<weld::TreeView> mxList;
std::unique_ptr<weld::Label> mxSearchResults;
std::unique_ptr<weld::CheckButton> mxShowDialog;
DECL_LINK(ListSelectHdl, weld::TreeView&, void);
DECL_STATIC_LINK(SearchResultsDlg, OnShowToggled, weld::ToggleButton&, void);
public:
SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParent);
virtual ~SearchResultsDlg() override;
......
......@@ -55,6 +55,7 @@ class ScTpContentOptions : public SfxTabPage
VclPtr<CheckBox> pVScrollCB;
VclPtr<CheckBox> pTblRegCB;
VclPtr<CheckBox> pOutlineCB;
VclPtr<CheckBox> pSummaryCB;
std::unique_ptr<ScViewOptions> pLocalOptions;
......
......@@ -60,6 +60,7 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent,
get(pVScrollCB,"vscroll");
get(pTblRegCB,"tblreg");
get(pOutlineCB,"outline");
get(pSummaryCB,"cbSummary");
SetExchangeSupport();
Link<ListBox&,void> aSelObjHdl(LINK( this, ScTpContentOptions, SelLbObjHdl ) );
......@@ -83,6 +84,7 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent,
pBreakCB ->SetClickHdl(aCBHdl);
pGuideLineCB->SetClickHdl(aCBHdl);
pRowColHeaderCB->SetClickHdl(aCBHdl);
pSummaryCB->SetClickHdl(aCBHdl);
pColorLB->SetSlotId(SID_ATTR_CHAR_COLOR);
pColorLB->SetAutoDisplayColor(SC_STD_GRIDCOLOR);
......@@ -117,6 +119,7 @@ void ScTpContentOptions::dispose()
pVScrollCB.clear();
pTblRegCB.clear();
pOutlineCB.clear();
pSummaryCB.clear();
SfxTabPage::dispose();
}
......@@ -146,6 +149,7 @@ bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
pOutlineCB ->IsValueChangedFromSaved() ||
pColorLB ->IsValueChangedFromSaved() ||
pBreakCB ->IsValueChangedFromSaved() ||
pSummaryCB ->IsValueChangedFromSaved() ||
pGuideLineCB ->IsValueChangedFromSaved())
{
NamedColor aNamedColor = pColorLB->GetSelectedEntry();
......@@ -196,6 +200,7 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet )
pVScrollCB->Check( pLocalOptions->GetOption(VOPT_VSCROLL) );
pTblRegCB ->Check( pLocalOptions->GetOption(VOPT_TABCONTROLS) );
pOutlineCB->Check( pLocalOptions->GetOption(VOPT_OUTLINER) );
pSummaryCB->Check( pLocalOptions->GetOption(VOPT_SUMMARY) );
InitGridOpt();
......@@ -228,6 +233,7 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet )
pColorLB->SaveValue();
pBreakCB->SaveValue();
pGuideLineCB->SaveValue();
pSummaryCB->SaveValue();
}
void ScTpContentOptions::ActivatePage( const SfxItemSet& rSet)
......@@ -276,6 +282,7 @@ IMPL_LINK( ScTpContentOptions, CBHdl, Button*, pBtn, void )
else if ( pBreakCB == pBtn ) eOption = VOPT_PAGEBREAKS;
else if ( pGuideLineCB == pBtn ) eOption = VOPT_HELPLINES;
else if ( pRowColHeaderCB == pBtn ) eOption = VOPT_HEADER;
else if ( pSummaryCB == pBtn ) eOption = VOPT_SUMMARY;
pLocalOptions->SetOption( eOption, bChecked );
}
......
......@@ -1875,7 +1875,9 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL)
{
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm && !comphelper::LibreOfficeKit::isActive())
bool bShow = GetViewData().GetViewShell()->GetViewData().GetOptions().GetOption( VOPT_SUMMARY );
if (bShow && pViewFrm && !comphelper::LibreOfficeKit::isActive())
{
pViewFrm->ShowChildWindow(sc::SearchResultsDlgWrapper::GetChildWindowId());
SfxChildWindow* pWnd = pViewFrm->GetChildWindow(sc::SearchResultsDlgWrapper::GetChildWindowId());
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.1 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<object class="GtkTreeStore" id="liststore3">
......@@ -29,7 +29,26 @@
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkCheckButton" id="cbShow">
<property name="label" translatable="yes" context="searchresults|ShowBox">_Show this dialog</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes" context="searchresults|ShowBox">Enable the dialog again at Tools &gt; Options &gt; Calc &gt; View</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close">
<property name="label">gtk-close</property>
......@@ -43,7 +62,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
</object>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Thu Jan 9 10:47:53 2014 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
......@@ -278,6 +278,24 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cbSummary">
<property name="label" translatable="yes" context="tpviewpage|summary">Summary o_n search</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="width">1</property>
<property name="height">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
</object>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment