[Libreoffice-commits] core.git: extensions/AllLangResTarget_pcr.mk extensions/source extensions/uiconfig extensions/UIConfig_spropctrlr.mk

Caolán McNamara caolanm at redhat.com
Thu Aug 14 07:49:19 PDT 2014


 extensions/AllLangResTarget_pcr.mk                    |    4 
 extensions/UIConfig_spropctrlr.mk                     |    1 
 extensions/source/propctrlr/formresid.hrc             |    5 
 extensions/source/propctrlr/listselectiondlg.cxx      |   47 ++----
 extensions/source/propctrlr/listselectiondlg.hxx      |   15 --
 extensions/source/propctrlr/listselectiondlg.src      |   72 ----------
 extensions/uiconfig/spropctrlr/ui/listselectdialog.ui |  121 ++++++++++++++++++
 7 files changed, 142 insertions(+), 123 deletions(-)

New commits:
commit 93a4899047efb2c3eab1a8b7c9abe65a59ccb0f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 14 15:38:08 2014 +0100

    convert RID_DLG_SELECTION to .ui format
    
    Change-Id: Ib23d8ec34c757bb8268651d4a1d00c6528dac9c1

diff --git a/extensions/AllLangResTarget_pcr.mk b/extensions/AllLangResTarget_pcr.mk
index 0480dfc..a305fd9 100644
--- a/extensions/AllLangResTarget_pcr.mk
+++ b/extensions/AllLangResTarget_pcr.mk
@@ -32,8 +32,4 @@ $(eval $(call gb_SrsTarget_add_files,pcr/res,\
 	extensions/source/propctrlr/formlinkdialog.src \
 ))
 
-$(eval $(call gb_SrsTarget_add_nonlocalizable_files,pcr/res,\
-    extensions/source/propctrlr/listselectiondlg.src \
-))
-
 # vim:set noet sw=4 ts=4:
diff --git a/extensions/UIConfig_spropctrlr.mk b/extensions/UIConfig_spropctrlr.mk
index 9793906..eda1044 100644
--- a/extensions/UIConfig_spropctrlr.mk
+++ b/extensions/UIConfig_spropctrlr.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\
 	extensions/uiconfig/spropctrlr/ui/fieldlinkrow \
 	extensions/uiconfig/spropctrlr/ui/formlinksdialog \
 	extensions/uiconfig/spropctrlr/ui/labelselectiondialog \
+	extensions/uiconfig/spropctrlr/ui/listselectdialog \
 	extensions/uiconfig/spropctrlr/ui/taborder \
 ))
 
diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc
index 3396a83..48625eb 100644
--- a/extensions/source/propctrlr/formresid.hrc
+++ b/extensions/source/propctrlr/formresid.hrc
@@ -274,11 +274,6 @@
 
 #define RID_STR_CONFIRM_DELETE_DATA_TYPE    ( RID_FORMBROWSER_START + 500 )
 
-// - dialogs
-
-#define RID_DLG_TABORDER                    ( RID_PROPCONTROLLER_START +  1 )
-#define RID_DLG_SELECTION                   ( RID_PROPCONTROLLER_START +  3 )
-
 // - ImageLists
 
 #define RID_IL_FORMEXPLORER                 ( RID_PROPCONTROLLER_START +  0 )
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 4c9d430..7808c27 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -18,47 +18,36 @@
  */
 
 #include "listselectiondlg.hxx"
-#include "listselectiondlg.hrc"
 
 #include "modulepcr.hxx"
 #include "formresid.hrc"
 #include "formstrings.hxx"
 #include <vcl/msgbox.hxx>
 
-
 namespace pcr
 {
-
-
     using namespace ::com::sun::star::uno;
     using namespace ::com::sun::star::beans;
 
-
-    //= ListSelectionDialog
-
-
-    ListSelectionDialog::ListSelectionDialog( Window* _pParent, const Reference< XPropertySet >& _rxListBox,
-            const OUString& _rPropertyName, const OUString& _rPropertyUIName )
-        :ModalDialog( _pParent, PcrRes( RID_DLG_SELECTION ) )
-        ,m_aLabel   ( this, PcrRes( FT_ENTRIES ) )
-        ,m_aEntries ( this, PcrRes( LB_ENTRIES ) )
-        ,m_aOK      ( this, PcrRes( PB_OK      ) )
-        ,m_aCancel  ( this, PcrRes( PB_CANCEL  ) )
-        ,m_aHelp    ( this, PcrRes( PB_HELP    ) )
+    ListSelectionDialog::ListSelectionDialog(Window* _pParent, const Reference< XPropertySet >& _rxListBox,
+            const OUString& _rPropertyName, const OUString& _rPropertyUIName)
+        : ModalDialog( _pParent, "ListSelectDialog", "modules/spropctrlr/ui/listselectdialog.ui" )
         ,m_xListBox     ( _rxListBox     )
         ,m_sPropertyName( _rPropertyName )
     {
-        FreeResource();
-
         OSL_PRECOND( m_xListBox.is(), "ListSelectionDialog::ListSelectionDialog: invalid list box!" );
 
-        SetText( _rPropertyUIName );
-        m_aLabel.SetText( _rPropertyUIName );
+        get(m_pEntries, "treeview");
+        Size aSize(LogicToPixel(Size(85, 97), MAP_APPFONT));
+        m_pEntries->set_width_request(aSize.Width());
+        m_pEntries->set_height_request(aSize.Height());
+
+        SetText(_rPropertyUIName);
+        get<VclFrame>("frame")->set_label(_rPropertyUIName);
 
         initialize( );
     }
 
-
     short ListSelectionDialog::Execute()
     {
         short nResult = ModalDialog::Execute();
@@ -75,14 +64,14 @@ namespace pcr
         if ( !m_xListBox.is() )
             return;
 
-        m_aEntries.SetStyle( GetStyle() | WB_SIMPLEMODE );
+        m_pEntries->SetStyle( GetStyle() | WB_SIMPLEMODE );
 
         try
         {
             // initialize the multi-selection flag
             bool bMultiSelection = false;
             OSL_VERIFY( m_xListBox->getPropertyValue( PROPERTY_MULTISELECTION ) >>= bMultiSelection );
-            m_aEntries.EnableMultiSelection( bMultiSelection );
+            m_pEntries->EnableMultiSelection( bMultiSelection );
 
             // fill the list box with all entries
             Sequence< OUString > aListEntries;
@@ -122,31 +111,31 @@ namespace pcr
 
     void ListSelectionDialog::fillEntryList( const Sequence< OUString >& _rListEntries )
     {
-        m_aEntries.Clear();
+        m_pEntries->Clear();
         const OUString* _pListEntries = _rListEntries.getConstArray();
         const OUString* _pListEntriesEnd = _rListEntries.getConstArray() + _rListEntries.getLength();
         for ( ; _pListEntries < _pListEntriesEnd; ++_pListEntries )
-            m_aEntries.InsertEntry( *_pListEntries );
+            m_pEntries->InsertEntry( *_pListEntries );
     }
 
 
     void ListSelectionDialog::collectSelection( Sequence< sal_Int16 >& /* [out] */ _rSelection )
     {
-        sal_uInt16 nSelectedCount = m_aEntries.GetSelectEntryCount( );
+        sal_uInt16 nSelectedCount = m_pEntries->GetSelectEntryCount( );
         _rSelection.realloc( nSelectedCount );
         sal_Int16* pSelection = _rSelection.getArray();
         for ( sal_uInt16 selected = 0; selected < nSelectedCount; ++selected, ++pSelection )
-            *pSelection = static_cast< sal_Int16 >( m_aEntries.GetSelectEntryPos( selected ) );
+            *pSelection = static_cast< sal_Int16 >( m_pEntries->GetSelectEntryPos( selected ) );
     }
 
 
     void ListSelectionDialog::selectEntries( const Sequence< sal_Int16 >& /* [in ] */ _rSelection )
     {
-        m_aEntries.SetNoSelection();
+        m_pEntries->SetNoSelection();
         const sal_Int16* pSelection = _rSelection.getConstArray();
         const sal_Int16* pSelectionEnd = _rSelection.getConstArray() + _rSelection.getLength();
         for ( ; pSelection != pSelectionEnd; ++pSelection )
-            m_aEntries.SelectEntryPos( *pSelection );
+            m_pEntries->SelectEntryPos( *pSelection );
     }
 
 
diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx
index 7f81e21..7dd905e 100644
--- a/extensions/source/propctrlr/listselectiondlg.hxx
+++ b/extensions/source/propctrlr/listselectiondlg.hxx
@@ -21,28 +21,17 @@
 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX
 
 #include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 
-
 namespace pcr
 {
-
-
-
-    //= ListSelectionDialog
-
     class ListSelectionDialog : public ModalDialog
     {
     private:
-        FixedText       m_aLabel;
-        ListBox         m_aEntries;
-        OKButton        m_aOK;
-        CancelButton    m_aCancel;
-        HelpButton      m_aHelp;
+        ListBox*        m_pEntries;
 
         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
                         m_xListBox;
diff --git a/extensions/source/propctrlr/listselectiondlg.src b/extensions/source/propctrlr/listselectiondlg.src
deleted file mode 100644
index dcce9d7..0000000
--- a/extensions/source/propctrlr/listselectiondlg.src
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "formresid.hrc"
-#include "propctrlr.hrc"
-#include "listselectiondlg.hrc"
-
-ModalDialog RID_DLG_SELECTION
-{
-    HelpID = "extensions:ModalDialog:RID_DLG_SELECTION";
-    OutputSize = TRUE ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 150, 120 ) ;
-
-    FixedText FT_ENTRIES
-    {
-        Pos  = MAP_APPFONT(  6, 6 );
-        Size = MAP_APPFONT( 85, 8 );
-    };
-
-    ListBox LB_ENTRIES
-    {
-        HelpID = "extensions:ListBox:RID_DLG_SELECTION:LB_ENTRIES";
-        Pos  = MAP_APPFONT(  6, 17 );
-        Size = MAP_APPFONT( 85, 97 );
-
-        Border   =  TRUE;
-        DropDown = FALSE;
-    };
-
-    OKButton PB_OK
-    {
-        Pos  = MAP_APPFONT( 97,  6 );
-        Size = MAP_APPFONT( 50, 14 );
-        TabStop   = TRUE;
-        DefButton = TRUE;
-    };
-
-    CancelButton PB_CANCEL
-    {
-        Pos  = MAP_APPFONT( 97, 23 );
-        Size = MAP_APPFONT( 50, 14 );
-        TabStop = TRUE;
-    };
-
-    HelpButton PB_HELP
-    {
-        Pos  = MAP_APPFONT( 97, 43 );
-        Size = MAP_APPFONT( 50, 14 );
-        TabStop = TRUE;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/uiconfig/spropctrlr/ui/listselectdialog.ui b/extensions/uiconfig/spropctrlr/ui/listselectdialog.ui
new file mode 100644
index 0000000..7fc53ea
--- /dev/null
+++ b/extensions/uiconfig/spropctrlr/ui/listselectdialog.ui
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkDialog" id="ListSelectDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="type_hint">normal</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="frame">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkTreeView" id="treeview:border">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection2"/>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list