[Libreoffice-commits] core.git: Branch 'feature/aboutconfig' - 2 commits - cui/source

Efe Gürkan YALAMAN efeyalaman at gmail.com
Sun Jul 28 17:51:20 PDT 2013


 cui/source/options/optaboutconfig.cxx |   36 +++++++++++++++++++++++++++++++---
 cui/source/options/optaboutconfig.hxx |    3 +-
 2 files changed, 35 insertions(+), 4 deletions(-)

New commits:
commit c5a5a09044ee794e6494d6a59e98b1380ae62fae
Author: Efe Gürkan YALAMAN <efeyalaman at gmail.com>
Date:   Mon Jul 29 03:48:41 2013 +0300

    initial editBtn click handler added
    
    Change-Id: I31ea8ab94331a8f6edc9e3c3f8f35105da5d7041

diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 8434aa0..688b48b 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -46,6 +46,8 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet&
     WinBits nBits = WB_SCROLL | WB_SORT | WB_HSCROLL | WB_VSCROLL;
     pPrefBox = new svx::OptHeaderTabListBox( *m_pPrefCtrl, nBits );
 
+    m_pEditBtn->SetClickHdl( LINK( this, CuiAboutConfigTabPage, StandardHdl_Impl ) );
+
     HeaderBar &rBar = pPrefBox->GetTheHeaderBar();
     rBar.InsertItem( ITEMID_PREF, get<FixedText>("preference")->GetText(), 0, HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW);
     rBar.InsertItem( ITEMID_TYPE, get<FixedText>("status")->GetText(), 0,  HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
@@ -273,6 +275,20 @@ IMPL_LINK( CuiAboutConfigTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
 IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
 {
     SvTreeListEntry* pEntry = pPrefBox->FirstSelected();
+
+    OUString sType = pPrefBox->GetEntryText( pEntry, 2 );
+
+    if( sType == OUString("boolean") )
+    {
+        //TODO: this is just cosmetic, take all needed value and handle them properly
+        OUString sValue = pPrefBox->GetEntryText( pEntry, 1 );
+            if (sValue == OUString("true"))
+                pPrefBox->SetEntryText( OUString("false"), pEntry, 1 );
+            else if(sValue == OUString("false"))
+                pPrefBox->SetEntryText( OUString("true"), pEntry, 1 );
+    }
+    //TODO: add other types
+
     return 0;
 
 }
commit bbe546ac8d31a0e66e0593d346833281b18c9d24
Author: Efe Gürkan YALAMAN <efeyalaman at gmail.com>
Date:   Mon Jul 29 02:21:50 2013 +0300

    getConfigAccess Re-arranged for getting update access
    
    getConfigAccess now has a second argument which allows getting update
    access when needed. If second argument is sal_False gets ReadOnly
    access, otherwise takes update access.
    
    Change-Id: I53731e6cb8c586f59aec81abc1f12bcb60fd5481

diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index c36a195..8434aa0 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -90,7 +90,7 @@ void CuiAboutConfigTabPage::Reset( const SfxItemSet& )
    OUString sRootNodePath = "/";
    pPrefBox->Clear();
 
-   Reference< XNameAccess > xConfigAccess = getConfigAccess( sRootNodePath );
+   Reference< XNameAccess > xConfigAccess = getConfigAccess( sRootNodePath, sal_False );
 
    FillItems( xConfigAccess, sRootNodePath );
 }
@@ -214,7 +214,7 @@ void CuiAboutConfigTabPage::FillItems( Reference< XNameAccess >xNameAccess, OUSt
     }
 }
 
-Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( OUString sNodePath )
+Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( OUString sNodePath, sal_Bool bUpdate )
 {
     uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
 
@@ -228,9 +228,16 @@ Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( OUString sNodeP
     uno::Sequence< uno::Any > aArgumentList( 1 );
     aArgumentList[0] = uno::makeAny( aProperty );
 
+    OUString sAccessString;
+
+    if( bUpdate )
+        sAccessString = "com.sun.star.configuration.ConfigurationUpdateAccess";
+    else
+        sAccessString = "com.sun.star.configuration.ConfigurationAccess";
+
     uno::Reference< container::XNameAccess > xNameAccess(
                 xConfigProvider->createInstanceWithArguments(
-                    "com.sun.star.configuration.ConfigurationAccess", aArgumentList ),
+                    sAccessString, aArgumentList ),
                 uno::UNO_QUERY_THROW );
 
     return xNameAccess;
@@ -263,4 +270,11 @@ IMPL_LINK( CuiAboutConfigTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
     return 1;
 }
 
+IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
+{
+    SvTreeListEntry* pEntry = pPrefBox->FirstSelected();
+    return 0;
+
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index 22661d7..3ba4355 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -33,13 +33,14 @@ private:
     ~CuiAboutConfigTabPage();
 
     DECL_LINK( HeaderSelect_Impl, HeaderBar * );
+    DECL_LINK( StandardHdl_Impl, void * );
 public:
    static SfxTabPage* Create( Window* pParent, const SfxItemSet& rItemset );
 
    void     InsertEntry(OUString& rProp, OUString&  rStatus, OUString& rType, OUString& rValue);
    void     Reset( const SfxItemSet& );
    void     FillItems( com::sun::star::uno::Reference < com::sun::star::container::XNameAccess > xNameAccess, OUString sPath);
-   com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess( OUString sNodePath );
+   com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess( OUString sNodePath, sal_Bool bUpdate );
 
 };
 


More information about the Libreoffice-commits mailing list