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

Kill Mozilla personas

As per ESC & Design Team decisions.

It has become unusable anyway after major changes
on the Mozilla side.

Long live Libreoffice Themes! :)

Change-Id: I2893fbc5e4f5637ee9715fa426b92ca58534f126
Reviewed-on: https://gerrit.libreoffice.org/72811
Tested-by: Jenkins
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Reviewed-by: 's avatarMuhammet Kara <muhammet.kara@collabora.com>
üst dd5c9897
......@@ -179,7 +179,6 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/searchattrdialog \
cui/uiconfig/ui/searchformatdialog \
cui/uiconfig/ui/securityoptionsdialog \
cui/uiconfig/ui/select_persona_dialog \
cui/uiconfig/ui/selectpathdialog \
cui/uiconfig/ui/shadowtabpage \
cui/uiconfig/ui/showcoldialog \
......
......@@ -368,7 +368,6 @@
#define RID_SVXSTR_NORESULTS NC_("RID_SVXSTR_NORESULTS", "No results found.")
#define RID_SVXSTR_APPLYPERSONA NC_("RID_SVXSTR_APPLYPERSONA", "Applying Theme...")
#define RID_SVXSTR_INVALIDPERSONAURL NC_("RID_SVXSTR_INVALIDPERSONAURL", "Please enter a valid theme address or a search term.")
#define RID_SVXSTR_MOZAPIUNREACHABLE NC_("RID_SVXSTR_MOZAPIUNREACHABLE", "The Mozilla Themes API is currently unavailable.")
#define RID_SVXSTR_TABLE_PRESET_NONE NC_("RID_SVXSTR_TABLE_PRESET_NONE", "Set No Borders")
#define RID_SVXSTR_TABLE_PRESET_ONLYOUTER NC_("RID_SVXSTR_TABLE_PRESET_ONLYOUTER", "Set Outer Border Only")
......
......@@ -47,7 +47,6 @@ cui/ui/scriptorganizer.ui
cui/ui/searchattrdialog.ui
cui/ui/searchformatdialog.ui
cui/ui/securityoptionsdialog.ui
cui/ui/select_persona_dialog.ui
cui/ui/selectpathdialog.ui
cui/ui/shadowtabpage.ui
cui/ui/showcoldialog.ui
......
......@@ -11,22 +11,13 @@
#define INCLUDED_CUI_SOURCE_OPTIONS_PERSONALIZATION_HXX
#include <sfx2/tabdlg.hxx>
#include <salhelper/thread.hxx>
#include <rtl/ref.hxx>
#include <vcl/prgsbar.hxx>
#include <vector>
#include <array>
#include <atomic>
#define MAX_RESULTS 9 // Maximum number of search results
#define MAX_DEFAULT_PERSONAS 6 // Maximum number of default personas
class Edit;
class FixedText;
class FixedHyperlink;
class SearchAndParseThread;
class GetPersonaThread;
class SvxPersonalizationTabPage : public SfxTabPage
{
using SfxTabPage::DeactivatePage;
......@@ -34,17 +25,10 @@ class SvxPersonalizationTabPage : public SfxTabPage
private:
VclPtr<RadioButton> m_pNoPersona; ///< Just the default look, without any bitmap
VclPtr<RadioButton> m_pDefaultPersona; ///< Use the built-in bitmap
VclPtr<RadioButton> m_pOwnPersona; ///< Use the user-defined bitmap
VclPtr<PushButton> m_pSelectPersona; ///< Let the user select in the 'own' case
VclPtr<PushButton> m_vDefaultPersonaImages[MAX_DEFAULT_PERSONAS]; ///< Buttons to show the default persona images
VclPtr<PushButton> m_pExtensionPersonaPreview; ///< Buttons to show the last 3 personas installed via extensions
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<FixedHyperlink> m_pAppliedThemeLabel; ///< The label for showing applied custom theme
std::vector<OUString> m_vDefaultPersonaSettings;
std::vector<OUString> m_vExtensionPersonaSettings;
public:
SvxPersonalizationTabPage( vcl::Window *pParent, const SfxItemSet &rSet );
......@@ -59,10 +43,6 @@ public:
/// Reset to default settings ([Revert] button).
virtual void Reset( const SfxItemSet *rSet ) override;
void SetPersonaSettings( const OUString& );
void CheckAppliedTheme();
void ShowAppliedThemeLabel( const OUString& );
/*
* Loads the default personas from the shared personas directory
* which resides in the shared gallery.
......@@ -77,105 +57,13 @@ public:
* abstract;Abstract;abstract/preview.jpg;abstract/Header2.jpg;abstract/Footer2.jpg;#ffffff
*/
void LoadDefaultImages();
void LoadExtensionThemes();
private:
/// Handle the Persona selection
DECL_LINK( SelectPersona, Button*, void );
/// When 'own' is chosen, but the Persona is not chosen yet.
DECL_LINK( ForceSelect, Button*, void );
/// Handle the default Persona selection
DECL_LINK( DefaultPersona, Button*, void );
/// Handle the Personas installed through extensions selection
DECL_LINK( SelectInstalledPersona, ListBox&, void );
};
/** Dialog that will allow the user to choose a Persona to use. */
class SelectPersonaDialog : public weld::GenericDialogController
{
private:
std::vector<OUString> m_vPersonaSettings;
OUString m_aSelectedPersona;
OUString m_aAppliedPersona;
std::unique_ptr<weld::Entry> m_xEdit; ///< The input line for the search term
std::unique_ptr<weld::Button> m_xSearchButton; ///< The search button
std::unique_ptr<weld::Label> m_xProgressLabel; ///< The label for showing progress of search
std::unique_ptr<weld::ComboBox> m_xCategories; ///< The list of categories
std::unique_ptr<weld::Button> m_xOkButton; ///< The OK button
std::unique_ptr<weld::Button> m_xCancelButton; ///< The Cancel button
std::unique_ptr<weld::Button> m_vResultList[MAX_RESULTS]; ///< List of buttons to show search results
::rtl::Reference< SearchAndParseThread > m_pSearchThread;
::rtl::Reference< GetPersonaThread > m_pGetPersonaThread;
public:
explicit SelectPersonaDialog(weld::Window *pParent);
virtual ~SelectPersonaDialog() override;
OUString GetSelectedPersona() const;
void SetProgress( const OUString& );
/**
* @brief Assigns preview images to result buttons
* @param aPreviewImage Persona preview image
* @param sName Name of the persona
* @param nIndex Index number of the result button
*/
void SetImages( VirtualDevice& rPreviewImage, const OUString& sName, const sal_Int32& nIndex );
void AddPersonaSetting( OUString const & );
void ClearSearchResults();
void SetAppliedPersonaSetting( OUString const & );
const OUString& GetAppliedPersonaSetting() const;
private:
/// Handle the Search button
DECL_LINK( SearchPersonas, weld::Button&, void );
/// Handle persona categories list box
DECL_LINK( SelectCategory, weld::ComboBox&, void );
DECL_LINK( SelectPersona, weld::Button&, void );
DECL_LINK( ActionOK, weld::Button&, void );
DECL_LINK( ActionCancel, weld::Button&, void );
};
class SearchAndParseThread: public salhelper::Thread
{
private:
SelectPersonaDialog* m_pPersonaDialog;
OUString m_aURL;
std::atomic<bool> m_bExecute;
bool m_bDirectURL;
virtual ~SearchAndParseThread() override;
virtual void execute() override;
public:
SearchAndParseThread( SelectPersonaDialog* pDialog,
const OUString& rURL, bool bDirectURL );
void StopExecution() { m_bExecute = false; }
};
class GetPersonaThread: public salhelper::Thread
{
private:
SelectPersonaDialog* m_pPersonaDialog;
OUString m_aSelectedPersona;
std::atomic<bool> m_bExecute;
virtual ~GetPersonaThread() override;
virtual void execute() override;
public:
GetPersonaThread( SelectPersonaDialog* pDialog,
const OUString& rSelectedPersona );
void StopExecution() { m_bExecute = false; }
};
#endif // INCLUDED_CUI_SOURCE_OPTIONS_PERSONALIZATION_HXX
......
......@@ -52,7 +52,6 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">own_persona</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -183,111 +182,6 @@
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkRadioButton" id="own_persona">
<property name="label" translatable="yes" context="personalization_tab|own_persona">Own Theme</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="draw_indicator">True</property>
<property name="group">no_persona</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<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>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="select_persona">
<property name="label" translatable="yes" context="personalization_tab|select_persona">Load Firefox theme</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="extensions_label">
<property name="can_focus">False</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>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkTreeView" id="installed_personas:border">
<property name="can_focus">True</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="persona_preview">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
</child>
</object>
......@@ -296,7 +190,7 @@
<object class="GtkLabel" id="personas_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="personalization_tab|personas_label">Firefox Themes</property>
<property name="label" translatable="yes" context="personalization_tab|personas_label">LibreOffice Themes</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
......@@ -310,9 +204,4 @@
</packing>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="select_persona"/>
</widgets>
</object>
</interface>
This diff is collapsed.
......@@ -390,23 +390,6 @@ cui/uiconfig/ui/securityoptionsdialog.ui://GtkImage[@id='locksavesenddocs'] no-l
cui/uiconfig/ui/securityoptionsdialog.ui://GtkImage[@id='lockwhensigning'] no-labelled-by
cui/uiconfig/ui/securityoptionsdialog.ui://GtkImage[@id='lockwhenpdf'] no-labelled-by
cui/uiconfig/ui/securityoptionsdialog.ui://GtkLabel[@id='label3'] orphan-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkEntry[@id='search_term'] no-labelled-by
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion1'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion2'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion3'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion4'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion5'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='suggestion6'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result1'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result2'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result3'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result4'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result5'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result6'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result7'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result8'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkButton[@id='result9'] button-no-label
cui/uiconfig/ui/select_persona_dialog.ui://GtkLabel[@id='progress_label'] orphan-label
cui/uiconfig/ui/signsignatureline.ui://GtkTextView[@id='edit_comment'] duplicate-mnemonic
cui/uiconfig/ui/signsignatureline.ui://GtkLabel[@id='label_or'] orphan-label
cui/uiconfig/ui/specialcharacters.ui://GtkLabel[@id='hexulabel'] orphan-label
......
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