Kaydet (Commit) ac2dff01 authored tarafından Muhammet Kara's avatar Muhammet Kara

tdf#60543: Remember the URL of the currently applied persona

Change-Id: I21bc9353dc37825967bdca3329568990907928b4
Reviewed-on: https://gerrit.libreoffice.org/60888
Tested-by: Jenkins
Reviewed-by: 's avatarMuhammet Kara <muhammet.kara@pardus.org.tr>
üst d3e6b3e4
......@@ -21,6 +21,8 @@
#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
#include <vcl/fixedhyper.hxx>
#include <vcl/weld.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/svapp.hxx>
......@@ -278,7 +280,7 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( vcl::Window *pParent, cons
// persona
get( m_pNoPersona, "no_persona" );
get( m_pDefaultPersona, "default_persona" );
get( m_pAppliedThemeLabel, "applied_theme" );
get( m_pAppliedThemeLabel, "applied_theme_link" );
get( m_pOwnPersona, "own_persona" );
m_pOwnPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, ForceSelect ) );
......@@ -411,14 +413,24 @@ void SvxPersonalizationTabPage::CheckAppliedTheme()
void SvxPersonalizationTabPage::ShowAppliedThemeLabel(const OUString& aPersonaSetting)
{
sal_Int32 nSlugIndex, nNameIndex;
OUString aName;
OUString aSlug, aName;
sal_Int32 nIndex = 0;
aSlug = aPersonaSetting.getToken( 0, ';', nIndex );
nSlugIndex = aPersonaSetting.indexOf( ';' ) + 1;
nNameIndex = aPersonaSetting.indexOf( ';', nSlugIndex );
aName = "(" + aPersonaSetting.copy( nSlugIndex, nNameIndex ) +")";
m_pAppliedThemeLabel->Show();
m_pAppliedThemeLabel->SetText( aName );
if ( nIndex > 0 )
aName = "(" + aPersonaSetting.getToken( 0, ';', nIndex ) + ")";
if ( !aName.isEmpty() )
{
m_pAppliedThemeLabel->SetText( aName );
m_pAppliedThemeLabel->SetURL( "https://addons.mozilla.org/en-US/firefox/addon/" + aSlug + "/" );
m_pAppliedThemeLabel->Show();
}
else
{
SAL_WARN("cui.options", "Applied persona doesn't have a name!");
}
}
void SvxPersonalizationTabPage::LoadDefaultImages()
......
......@@ -23,6 +23,7 @@
#define MAX_DEFAULT_PERSONAS 3 // Maximum number of default personas
class FixedText;
class FixedHyperlink;
class SearchAndParseThread;
class SvxPersonalizationTabPage : public SfxTabPage
......@@ -39,7 +40,7 @@ private:
VclPtr<ListBox> m_pPersonaList; ///< The ListBox to show the list of installed personas
OUString m_aPersonaSettings; ///< Header and footer images + color to be set in the settings.
VclPtr<FixedText> m_pExtensionLabel; ///< The "select persona installed via extensions" label
VclPtr<FixedText> m_pAppliedThemeLabel; ///< The label for showing applied custom theme
VclPtr<FixedHyperlink> m_pAppliedThemeLabel; ///< The label for showing applied custom theme
std::vector<OUString> m_vDefaultPersonaSettings;
std::vector<OUString> m_vExtensionPersonaSettings;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkVBox" id="PersonalizationTabPage">
......@@ -134,9 +134,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="applied_theme">
<property name="visible">True</property>
<property name="can_focus">False</property>
<object class="GtkLinkButton" id="applied_theme_link">
<property name="label" translatable="no">Applied persona's name and URL</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
<packing>
<property name="expand">True</property>
......@@ -167,8 +169,8 @@
<child>
<object class="GtkLabel" id="extensions_label">
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="personalization_tab|extensions_label">Or, select from the Themes installed via extensions:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
......
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