Kaydet (Commit) 6502ebb0 authored tarafından Mike Kaganski's avatar Mike Kaganski

Related: tdf#110448: move Quickstart options to General page

Change-Id: Ib1eab8202903adb5bfcf9bfcabab5d12a773d3bb
Reviewed-on: https://gerrit.libreoffice.org/44508Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 03989b70
...@@ -203,57 +203,57 @@ DeactivateRC OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) ...@@ -203,57 +203,57 @@ DeactivateRC OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
namespace namespace
{ {
OUString impl_SystemFileOpenServiceName() OUString impl_SystemFileOpenServiceName()
{ {
const OUString &rDesktopEnvironment = Application::GetDesktopEnvironment(); const OUString &rDesktopEnvironment = Application::GetDesktopEnvironment();
if ( rDesktopEnvironment.equalsIgnoreAsciiCase("kde4") ) if ( rDesktopEnvironment.equalsIgnoreAsciiCase("kde4") )
{ {
#if ENABLE_KDE4 #if ENABLE_KDE4
return OUString("com.sun.star.ui.dialogs.KDE4FilePicker" ); return OUString("com.sun.star.ui.dialogs.KDE4FilePicker" );
#else #else
return OUString(); return OUString();
#endif #endif
} }
#if defined(_WIN32) #if defined(_WIN32)
return OUString("com.sun.star.ui.dialogs.SystemFilePicker"); return OUString("com.sun.star.ui.dialogs.SystemFilePicker");
#elif defined MACOSX #elif defined MACOSX
return OUString("com.sun.star.ui.dialogs.AquaFilePicker"); return OUString("com.sun.star.ui.dialogs.AquaFilePicker");
#else #else
return OUString(); return OUString();
#endif #endif
} }
bool lcl_HasSystemFilePicker() bool lcl_HasSystemFilePicker()
{ {
if( Application::hasNativeFileSelection() ) if( Application::hasNativeFileSelection() )
return true; return true;
// Otherwise fall-back on querying services // Otherwise fall-back on querying services
bool bRet = false; bool bRet = false;
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY ); Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
Reference< XSet > xSet( xFactory, UNO_QUERY ); Reference< XSet > xSet( xFactory, UNO_QUERY );
if ( ! xEnumAccess.is() || ! xSet.is() ) if ( ! xEnumAccess.is() || ! xSet.is() )
return bRet; return bRet;
try try
{ {
OUString aFileService = impl_SystemFileOpenServiceName(); OUString aFileService = impl_SystemFileOpenServiceName();
Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService ); Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
if ( xEnum.is() && xEnum->hasMoreElements() ) if ( xEnum.is() && xEnum->hasMoreElements() )
bRet = true; bRet = true;
} }
catch (const IllegalArgumentException&) catch (const IllegalArgumentException&)
{ {
} }
catch (const ElementExistException&) catch (const ElementExistException&)
{ {
} }
return bRet; return bRet;
} }
} }
OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet) OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
...@@ -278,6 +278,13 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet) ...@@ -278,6 +278,13 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
get(m_pYearValueField, "year"); get(m_pYearValueField, "year");
get(m_pToYearFT, "toyear"); get(m_pToYearFT, "toyear");
get(m_pCollectUsageInfo, "collectusageinfo"); get(m_pCollectUsageInfo, "collectusageinfo");
get(m_pQuickStarterFrame, "quickstarter");
#if defined(UNX)
get(m_pQuickLaunchCB, "systray");
#else
get(m_pQuickLaunchCB, "quicklaunch");
#endif
if (m_pFileDlgCB->IsVisible() && SvtMiscOptions().IsUseSystemFileDialogReadOnly()) if (m_pFileDlgCB->IsVisible() && SvtMiscOptions().IsUseSystemFileDialogReadOnly())
{ {
...@@ -285,6 +292,13 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet) ...@@ -285,6 +292,13 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pFileDlgCB->Disable(); m_pFileDlgCB->Disable();
} }
m_pQuickLaunchCB->Show();
//Only available in Win or if building the gtk systray
#if !defined(_WIN32) && ! ENABLE_GTK
m_pQuickStarterFrame->Hide();
#endif
m_aStrDateInfo = m_pToYearFT->GetText(); m_aStrDateInfo = m_pToYearFT->GetText();
m_pYearValueField->SetUseThousandSep(false); m_pYearValueField->SetUseThousandSep(false);
m_pYearValueField->SetModifyHdl( LINK( this, OfaMiscTabPage, TwoFigureHdl ) ); m_pYearValueField->SetModifyHdl( LINK( this, OfaMiscTabPage, TwoFigureHdl ) );
...@@ -308,6 +322,8 @@ void OfaMiscTabPage::dispose() ...@@ -308,6 +322,8 @@ void OfaMiscTabPage::dispose()
m_pYearValueField.clear(); m_pYearValueField.clear();
m_pToYearFT.clear(); m_pToYearFT.clear();
m_pCollectUsageInfo.clear(); m_pCollectUsageInfo.clear();
m_pQuickStarterFrame.clear();
m_pQuickLaunchCB.clear();
SfxTabPage::dispose(); SfxTabPage::dispose();
} }
...@@ -362,6 +378,12 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) ...@@ -362,6 +378,12 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
batch->commit(); batch->commit();
if( m_pQuickLaunchCB->IsValueChangedFromSaved())
{
rSet->Put(SfxBoolItem(SID_ATTR_QUICKLAUNCHER, m_pQuickLaunchCB->IsChecked()));
bModified = true;
}
return bModified; return bModified;
} }
...@@ -393,6 +415,17 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) ...@@ -393,6 +415,17 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
m_pCollectUsageInfo->Check(officecfg::Office::Common::Misc::CollectUsageInformation::get()); m_pCollectUsageInfo->Check(officecfg::Office::Common::Misc::CollectUsageInformation::get());
m_pCollectUsageInfo->Enable(!officecfg::Office::Common::Misc::CollectUsageInformation::isReadOnly()); m_pCollectUsageInfo->Enable(!officecfg::Office::Common::Misc::CollectUsageInformation::isReadOnly());
m_pCollectUsageInfo->SaveValue(); m_pCollectUsageInfo->SaveValue();
SfxItemState eState = rSet->GetItemState( SID_ATTR_QUICKLAUNCHER, false, &pItem );
if ( SfxItemState::SET == eState )
m_pQuickLaunchCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
else if ( SfxItemState::DISABLED == eState )
{
// quickstart not installed
m_pQuickStarterFrame->Hide();
}
m_pQuickLaunchCB->SaveValue();
} }
IMPL_LINK_NOARG( OfaMiscTabPage, TwoFigureHdl, Edit&, void ) IMPL_LINK_NOARG( OfaMiscTabPage, TwoFigureHdl, Edit&, void )
......
...@@ -54,10 +54,13 @@ private: ...@@ -54,10 +54,13 @@ private:
VclPtr<NumericField> m_pYearValueField; VclPtr<NumericField> m_pYearValueField;
VclPtr<FixedText> m_pToYearFT; VclPtr<FixedText> m_pToYearFT;
OUString m_aStrDateInfo; OUString m_aStrDateInfo;
VclPtr<CheckBox> m_pCollectUsageInfo; VclPtr<CheckBox> m_pCollectUsageInfo;
VclPtr<VclContainer> m_pQuickStarterFrame;
VclPtr<CheckBox> m_pQuickLaunchCB;
DECL_LINK( TwoFigureHdl, Edit&, void ); DECL_LINK( TwoFigureHdl, Edit&, void );
protected: protected:
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
......
...@@ -317,5 +317,70 @@ ...@@ -317,5 +317,70 @@
<property name="top_attach">5</property> <property name="top_attach">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkFrame" id="quickstarter">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkCheckButton" id="quicklaunch">
<property name="label" translatable="yes" context="optgeneralpage|quicklaunch">Load %PRODUCTNAME during system start-up</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="systray">
<property name="label" translatable="yes" context="optgeneralpage|systray">Enable systray Quickstarter</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="optgeneralpage|label8">%PRODUCTNAME Quickstarter</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
</object> </object>
</interface> </interface>
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