Kaydet (Commit) ad5493c3 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SelectPersonaDialog

Change-Id: Ice5e59bb8c26f007b71ba7844872ce825a5549f8
Reviewed-on: https://gerrit.libreoffice.org/67371
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 930d691d
......@@ -94,25 +94,24 @@ private:
};
/** Dialog that will allow the user to choose a Persona to use. */
class SelectPersonaDialog : public ModalDialog
class SelectPersonaDialog : public weld::GenericDialogController
{
private:
VclPtr<Edit> m_pEdit; ///< The input line for the search term
VclPtr<PushButton> m_pSearchButton; ///< The search button
VclPtr<FixedText> m_pProgressLabel; ///< The label for showing progress of search
VclPtr<PushButton> m_vResultList[MAX_RESULTS]; ///< List of buttons to show search results
VclPtr<ListBox> m_pCategories; ///< The list of categories
VclPtr<PushButton> m_pOkButton; ///< The OK button
VclPtr<PushButton> m_pCancelButton; ///< The Cancel button
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
public:
explicit SelectPersonaDialog( vcl::Window *pParent );
explicit SelectPersonaDialog(weld::Window *pParent);
virtual ~SelectPersonaDialog() override;
virtual void dispose() override;
::rtl::Reference< SearchAndParseThread > m_pSearchThread;
::rtl::Reference< GetPersonaThread > m_pGetPersonaThread;
......@@ -124,7 +123,7 @@ public:
* @param sName Name of the persona
* @param nIndex Index number of the result button
*/
void SetImages(const Image& aPreviewImage, const OUString& sName, const sal_Int32& nIndex );
void SetImages( VirtualDevice& rPreviewImage, const OUString& sName, const sal_Int32& nIndex );
void AddPersonaSetting( OUString const & );
void ClearSearchResults();
void SetAppliedPersonaSetting( OUString const & );
......@@ -132,19 +131,19 @@ public:
private:
/// Handle the Search button
DECL_LINK( SearchPersonas, Button*, void );
DECL_LINK( SearchPersonas, weld::Button&, void );
/// Handle persona categories list box
DECL_LINK( SelectCategory, ListBox&, void );
DECL_LINK( SelectPersona, Button*, void );
DECL_LINK( ActionOK, Button*, void );
DECL_LINK( ActionCancel, Button*, void );
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:
VclPtr<SelectPersonaDialog> m_pPersonaDialog;
SelectPersonaDialog* m_pPersonaDialog;
OUString m_aURL;
std::atomic<bool> m_bExecute;
bool m_bDirectURL;
......@@ -164,7 +163,7 @@ class GetPersonaThread: public salhelper::Thread
{
private:
VclPtr<SelectPersonaDialog> m_pPersonaDialog;
SelectPersonaDialog* m_pPersonaDialog;
OUString m_aSelectedPersona;
std::atomic<bool> m_bExecute;
......
......@@ -6,6 +6,9 @@
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="select_persona_dialog|SelectPersonaDialog">Select Firefox Theme</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
......@@ -68,7 +71,9 @@
<object class="GtkLabel" id="progress_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="ellipsize">end</property>
<property name="width_chars">45</property>
<property name="max_width_chars">45</property>
<property name="xalign">0</property>
</object>
......@@ -98,6 +103,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="placeholder_text" translatable="yes" context="select_persona_dialog|search_term">Search term or address</property>
......@@ -142,7 +148,7 @@
<object class="GtkLabel" id="categories_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" context="select_persona_dialog|categories_label" translatable="yes">Ca_tegory:</property>
<property name="label" translatable="yes" context="select_persona_dialog|categories_label">Ca_tegory:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">categoriesCB</property>
</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