diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-18 17:13:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-19 22:00:27 +0200 |
commit | af60b15af12bbb0cda2b48b99fde632f1532e1aa (patch) | |
tree | e25dec08bb34d7bde3bd821810bd7b8aa83fd9f1 /cui | |
parent | dbf355e5dbffe97b64a98005d1b84edddc472e4f (diff) |
weld TPGalleryThemeGeneral
Change-Id: Id5ec1b1282c039f30c40fc781be0f6d72a8bfb47
Reviewed-on: https://gerrit.libreoffice.org/60718
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 65 | ||||
-rw-r--r-- | cui/source/inc/cuigaldlg.hxx | 22 | ||||
-rw-r--r-- | cui/uiconfig/ui/gallerygeneralpage.ui | 37 |
3 files changed, 33 insertions, 91 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 18e39c8ae267..a04340bbc80e 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -574,7 +574,6 @@ GalleryThemeProperties::GalleryThemeProperties(vcl::Window* pParent, SetText( aText ); } - void GalleryThemeProperties::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { if (nId == m_nGeneralPageId) @@ -583,39 +582,18 @@ void GalleryThemeProperties::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<TPGalleryThemeProperties&>( rPage ).SetXChgData( pData ); } - -TPGalleryThemeGeneral::TPGalleryThemeGeneral(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxTabPage(pParent, "GalleryGeneralPage", - "cui/ui/gallerygeneralpage.ui", &rSet) +TPGalleryThemeGeneral::TPGalleryThemeGeneral(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "cui/ui/gallerygeneralpage.ui", "GalleryGeneralPage", &rSet) , pData(nullptr) + , m_xFiMSImage(m_xBuilder->weld_image("image")) + , m_xEdtMSName(m_xBuilder->weld_entry("name")) + , m_xFtMSShowType(m_xBuilder->weld_label("type")) + , m_xFtMSShowPath(m_xBuilder->weld_label("location")) + , m_xFtMSShowContent(m_xBuilder->weld_label("contents")) + , m_xFtMSShowChangeDate(m_xBuilder->weld_label("modified")) { - get(m_pFiMSImage, "image"); - get(m_pEdtMSName, "name"); - get(m_pFtMSShowType, "type"); - get(m_pFtMSShowPath, "location"); - get(m_pFtMSShowContent, "contents"); - get(m_pFtMSShowChangeDate, "modified"); -} - - -TPGalleryThemeGeneral::~TPGalleryThemeGeneral() -{ - disposeOnce(); -} - - -void TPGalleryThemeGeneral::dispose() -{ - m_pFiMSImage.clear(); - m_pEdtMSName.clear(); - m_pFtMSShowType.clear(); - m_pFtMSShowPath.clear(); - m_pFtMSShowContent.clear(); - m_pFtMSShowChangeDate.clear(); - SfxTabPage::dispose(); } - void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) { pData = _pData; @@ -627,19 +605,15 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) OUString aType( SvxResId( RID_SVXSTR_GALLERYPROPS_GALTHEME ) ); bool bReadOnly = pThm->IsReadOnly(); - m_pEdtMSName->SetText( pThm->GetName() ); - m_pEdtMSName->SetReadOnly( bReadOnly ); - - if( bReadOnly ) - m_pEdtMSName->Disable(); - else - m_pEdtMSName->Enable(); + m_xEdtMSName->set_text(pThm->GetName()); + m_xEdtMSName->set_editable(!bReadOnly); + m_xEdtMSName->set_sensitive(!bReadOnly); if( pThm->IsReadOnly() ) aType += CuiResId( RID_SVXSTR_GALLERY_READONLY ); - m_pFtMSShowType->SetText( aType ); - m_pFtMSShowPath->SetText( pThm->GetSdgURL().GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ); + m_xFtMSShowType->set_label(aType); + m_xFtMSShowPath->set_label(pThm->GetSdgURL().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous)); // singular or plural? if ( 1 == pThm->GetObjectCount() ) @@ -649,7 +623,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) aOutStr += " " + aObjStr; - m_pFtMSShowContent->SetText( aOutStr ); + m_xFtMSShowContent->set_label(aOutStr); // get locale wrapper (singleton) const SvtSysLocale aSysLocale; @@ -657,7 +631,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) // ChangeDate/Time aAccess = aLocaleData.getDate( pData->aThemeChangeDate ) + ", " + aLocaleData.getTime( pData->aThemeChangeTime ); - m_pFtMSShowChangeDate->SetText( aAccess ); + m_xFtMSShowChangeDate->set_label(aAccess); // set image OUString sId; @@ -669,21 +643,20 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) else sId = RID_SVXBMP_THEME_NORMAL_BIG; - m_pFiMSImage->SetImage(Image(BitmapEx(sId))); + m_xFiMSImage->set_from_icon_name(sId); } bool TPGalleryThemeGeneral::FillItemSet( SfxItemSet* /*rSet*/ ) { - pData->aEditedTitle = m_pEdtMSName->GetText(); + pData->aEditedTitle = m_xEdtMSName->get_text(); return true; } -VclPtr<SfxTabPage> TPGalleryThemeGeneral::Create( TabPageParent pParent, const SfxItemSet* rSet ) +VclPtr<SfxTabPage> TPGalleryThemeGeneral::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<TPGalleryThemeGeneral>::Create( pParent.pParent, *rSet ); + return VclPtr<TPGalleryThemeGeneral>::Create(pParent, *rSet); } - TPGalleryThemeProperties::TPGalleryThemeProperties( vcl::Window* pWindow, const SfxItemSet& rSet ) : SfxTabPage(pWindow, "GalleryFilesPage", "cui/ui/galleryfilespage.ui", &rSet) , pData(nullptr) diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx index 4487a9bd23c7..fd36e8b314a3 100644 --- a/cui/source/inc/cuigaldlg.hxx +++ b/cui/source/inc/cuigaldlg.hxx @@ -206,27 +206,21 @@ public: class TPGalleryThemeGeneral : public SfxTabPage { private: - - VclPtr<FixedImage> m_pFiMSImage; - VclPtr<Edit> m_pEdtMSName; - VclPtr<FixedText> m_pFtMSShowType; - VclPtr<FixedText> m_pFtMSShowPath; - VclPtr<FixedText> m_pFtMSShowContent; - VclPtr<FixedText> m_pFtMSShowChangeDate; ExchangeData* pData; + std::unique_ptr<weld::Image> m_xFiMSImage; + std::unique_ptr<weld::Entry> m_xEdtMSName; + std::unique_ptr<weld::Label> m_xFtMSShowType; + std::unique_ptr<weld::Label> m_xFtMSShowPath; + std::unique_ptr<weld::Label> m_xFtMSShowContent; + std::unique_ptr<weld::Label> m_xFtMSShowChangeDate; + virtual void Reset( const SfxItemSet* ) override {} virtual bool FillItemSet( SfxItemSet* rSet ) override; - public: - - TPGalleryThemeGeneral( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~TPGalleryThemeGeneral() override; - virtual void dispose() override; - + TPGalleryThemeGeneral(TabPageParent pParent, const SfxItemSet& rSet); void SetXChgData( ExchangeData* pData ); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); }; diff --git a/cui/uiconfig/ui/gallerygeneralpage.ui b/cui/uiconfig/ui/gallerygeneralpage.ui index e8ba15e3b625..6749c4d3fd8c 100644 --- a/cui/uiconfig/ui/gallerygeneralpage.ui +++ b/cui/uiconfig/ui/gallerygeneralpage.ui @@ -1,5 +1,5 @@ <?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="GtkGrid" id="GalleryGeneralPage"> @@ -18,14 +18,12 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="gallerygeneralpage|label1">Modified:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -37,16 +35,12 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -59,14 +53,12 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="gallerygeneralpage|label2">Type:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -78,36 +70,30 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="gallerygeneralpage|label3">Location:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkLabel" id="label4"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="gallerygeneralpage|label4">Contents:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -119,8 +105,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -132,16 +116,12 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -166,8 +146,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -175,6 +153,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <accessibility> <relation type="labelled-by" target="image"/> </accessibility> @@ -182,16 +161,12 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> |