[Libreoffice-commits] core.git: basctl/inc basctl/source basctl/uiconfig basctl/UIConfig_basicide.mk extras/source

Caolán McNamara caolanm at redhat.com
Fri Jan 3 06:56:06 PST 2014


 basctl/UIConfig_basicide.mk                    |    1 
 basctl/inc/basidesh.hrc                        |    1 
 basctl/inc/helpid.hrc                          |    1 
 basctl/source/basicide/moduldl2.cxx            |   20 ++
 basctl/source/basicide/moduldlg.cxx            |   25 +--
 basctl/source/basicide/moduldlg.hxx            |   39 ++---
 basctl/source/basicide/moduldlg.src            |   56 -------
 basctl/uiconfig/basicide/ui/importlibdialog.ui |  195 +++++++++++++++++++++++++
 extras/source/glade/libreoffice-catalog.xml.in |    3 
 9 files changed, 244 insertions(+), 97 deletions(-)

New commits:
commit 6fd7f5b1c931051b9fff31436955c1c6af00d135
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 3 14:38:01 2014 +0000

    convert import library dialog to .ui
    
    Change-Id: Iaedcbeb5618ece65692a9688ccb5c13aad1e6626

diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk
index 0a0263d..21e52ee 100644
--- a/basctl/UIConfig_basicide.mk
+++ b/basctl/UIConfig_basicide.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
 	basctl/uiconfig/basicide/ui/basicmacrodialog \
 	basctl/uiconfig/basicide/ui/gotolinedialog \
 	basctl/uiconfig/basicide/ui/exportdialog \
+	basctl/uiconfig/basicide/ui/importlibdialog \
 	basctl/uiconfig/basicide/ui/managebreakpoints \
 	basctl/uiconfig/basicide/ui/newlibdialog \
 	basctl/uiconfig/basicide/ui/organizedialog \
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index fbf22d4..6fdd05e 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -33,7 +33,6 @@
 #define RID_TP_MODULS                   ( RID_BASICIDE_START + 37 )
 #define RID_TP_LIBS                     ( RID_BASICIDE_START + 38 )
 #define RID_TP_DLGS                     ( RID_BASICIDE_START + 39 )
-#define RID_DLG_LIBS                    ( RID_BASICIDE_START + 40 )
 #define RID_POPUP_DLGED                 ( RID_BASICIDE_START + 62 )
 #define RID_PRINTDLG_STRLIST            ( RID_BASICIDE_START + 78 )
 
diff --git a/basctl/inc/helpid.hrc b/basctl/inc/helpid.hrc
index 4d6c92b..75aca8f 100644
--- a/basctl/inc/helpid.hrc
+++ b/basctl/inc/helpid.hrc
@@ -26,7 +26,6 @@
 
 #define HID_BASICIDE_MODULES_TREE                         "BASCTL_HID_BASICIDE_MODULES_TREE"
 #define HID_BASICIDE_LIBS_TREE                            "BASCTL_HID_BASICIDE_LIBS_TREE"
-#define HID_BASICIDE_LIBSDLG_TREE                         "BASCTL_HID_BASICIDE_LIBSDLG_TREE"
 #define HID_BASICIDE_OBJECTCAT                            "BASCTL_HID_BASICIDE_OBJECTCAT"
 
 #define HID_BASICIDE_OBJCAT_SHOW                          "BASCTL_HID_BASICIDE_OBJCAT_SHOW"
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 9a4c1a1..4edc506 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -173,6 +173,26 @@ CheckBox::CheckBox( Window* pParent, const ResId& rResId )
     Init();
 }
 
+CheckBox::CheckBox(Window* pParent, WinBits nStyle)
+    : SvTabListBox(pParent, nStyle)
+    , eMode(ObjectMode::Module)
+    , m_aDocument(ScriptDocument::getApplicationScriptDocument())
+{
+    long aTabs_[] = { 1, 12 };  // TabPos needs at least one...
+                                // 12 because of the CheckBox
+    SetTabs( aTabs_ );
+    Init();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCheckBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+    WinBits nWinBits = WB_TABSTOP;
+    OString sBorder = VclBuilder::extractCustomProperty(rMap);
+    if (!sBorder.isEmpty())
+       nWinBits |= WB_BORDER;
+    return new CheckBox(pParent, nWinBits);
+}
+
 //----------------------------------------------------------------------------
 
 CheckBox::~CheckBox()
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index c6808c5..48bf93e 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -909,31 +909,22 @@ void ObjectPage::EndTabDialog( sal_uInt16 nRet )
         pTabDlg->EndDialog( nRet );
 }
 
-
 LibDialog::LibDialog( Window* pParent )
-    : ModalDialog( pParent, IDEResId( RID_DLG_LIBS ) ),
-        aOKButton(      this, IDEResId( RID_PB_OK ) ),
-        aCancelButton(  this, IDEResId( RID_PB_CANCEL ) ),
-        aStorageName(   this, IDEResId( RID_FT_STORAGENAME ) ),
-        aLibBox(        this, IDEResId( RID_CTRL_LIBS ) ),
-        aFixedLine(     this, IDEResId( RID_FL_OPTIONS ) ),
-        aReferenceBox(  this, IDEResId( RID_CB_REF ) ),
-        aReplaceBox(    this, IDEResId( RID_CB_REPL ) )
-{
-    SetText( IDE_RESSTR(RID_STR_APPENDLIBS) );
-    FreeResource();
-}
-
-
-LibDialog::~LibDialog()
+    : ModalDialog(pParent, "ImportLibDialog", "modules/BasicIDE/ui/importlibdialog.ui")
 {
+    get(m_pStorageFrame, "storageframe");
+    get(m_pReferenceBox, "ref");
+    get(m_pReplaceBox, "replace");
+    get(m_pLibBox, "entries");
+    m_pLibBox->set_height_request(m_pLibBox->GetTextHeight() * 8);
+    m_pLibBox->set_width_request(m_pLibBox->approximate_char_width() * 32);
 }
 
 void LibDialog::SetStorageName( const OUString& rName )
 {
     OUString aName( IDE_RESSTR(RID_STR_FILENAME) );
     aName += rName;
-    aStorageName.SetText( aName );
+    m_pStorageFrame->set_label(aName);
 }
 
 // Helper function
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index abd91fb..529e840 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -23,18 +23,17 @@
 #include <svheader.hxx>
 
 #include <bastype2.hxx>
-#include <vcl/dialog.hxx>
-
+#include <svtools/svtabbx.hxx>
 #include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
 #include <vcl/fixed.hxx>
-#include <svtools/svtabbx.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/tabctrl.hxx>
 #include <vcl/tabdlg.hxx>
 #include <vcl/tabpage.hxx>
 #include <com/sun/star/task/XInteractionHandler.hpp>
 
-#include <vcl/tabctrl.hxx>
-#include <vcl/lstbox.hxx>
-
 class SvxPasswordDialog;
 
 namespace basctl
@@ -125,7 +124,8 @@ private:
     void                Init();
 
 public:
-    CheckBox( Window* pParent, const ResId& rResId );
+    CheckBox(Window* pParent, const ResId& rResId);
+    CheckBox(Window* pParent, WinBits nStyle);
     ~CheckBox();
 
     SvTreeListEntry*    DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND );
@@ -147,29 +147,24 @@ public:
 class LibDialog: public ModalDialog
 {
 private:
-    OKButton        aOKButton;
-    CancelButton    aCancelButton;
-    FixedText       aStorageName;
-    CheckBox        aLibBox;
-    FixedLine       aFixedLine;
-    ::CheckBox      aReferenceBox;
-    ::CheckBox      aReplaceBox;
+    VclFrame*       m_pStorageFrame;
+    CheckBox*       m_pLibBox;
+    ::CheckBox*     m_pReferenceBox;
+    ::CheckBox*     m_pReplaceBox;
 
 public:
-                    LibDialog( Window* pParent );
-                    ~LibDialog();
+    LibDialog( Window* pParent );
 
     void            SetStorageName( const OUString& rName );
 
-    CheckBox&       GetLibBox()                 { return aLibBox; }
-    bool            IsReference() const         { return aReferenceBox.IsChecked(); }
-    bool            IsReplace() const           { return aReplaceBox.IsChecked(); }
+    CheckBox&       GetLibBox()                 { return *m_pLibBox; }
+    bool            IsReference() const         { return m_pReferenceBox->IsChecked(); }
+    bool            IsReplace() const           { return m_pReplaceBox->IsChecked(); }
 
-    void            EnableReference (bool b)    { aReferenceBox.Enable(b); }
-    void            EnableReplace (bool b)      { aReplaceBox.Enable(b); }
+    void            EnableReference (bool b)    { m_pReferenceBox->Enable(b); }
+    void            EnableReplace (bool b)      { m_pReplaceBox->Enable(b); }
 };
 
-
 class OrganizeDialog : public TabDialog
 {
 private:
diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src
index 885ee06..4e54211 100644
--- a/basctl/source/basicide/moduldlg.src
+++ b/basctl/source/basicide/moduldlg.src
@@ -215,62 +215,6 @@ TabPage RID_TP_LIBS
         TabStop = TRUE ;
     };
 };
-ModalDialog RID_DLG_LIBS
-{
-    HelpId = "basctl:ModalDialog:RID_DLG_LIBS" ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 168 , 132 ) ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    OKButton RID_PB_OK
-    {
-        Pos = MAP_APPFONT ( 112 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton RID_PB_CANCEL
-    {
-        Pos = MAP_APPFONT ( 112 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText RID_FT_STORAGENAME
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 100 , 10 ) ;
-    };
-    Control RID_CTRL_LIBS
-    {
-        HelpID = HID_BASICIDE_LIBSDLG_TREE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 19 ) ;
-        Size = MAP_APPFONT ( 100 , 67 ) ;
-        TabStop = TRUE ;
-    };
-    FixedLine RID_FL_OPTIONS
-    {
-        Pos = MAP_APPFONT ( 6 , 89 ) ;
-        Size = MAP_APPFONT ( 156 , 8 ) ;
-        Text [ en-US ] = "Options" ;
-    };
-    CheckBox RID_CB_REF
-    {
-        HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REF";
-        Pos = MAP_APPFONT ( 12 , 100 ) ;
-        Size = MAP_APPFONT ( 146 , 10 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Insert as reference (read-only)" ;
-    };
-    CheckBox RID_CB_REPL
-    {
-        HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REPL";
-        Pos = MAP_APPFONT ( 12 , 113 ) ;
-        Size = MAP_APPFONT ( 146 , 10 ) ;
-        Text [ en-US ] = "Replace existing libraries" ;
-    };
-};
 
 String RID_STR_EXPORTPACKAGE
 {
diff --git a/basctl/uiconfig/basicide/ui/importlibdialog.ui b/basctl/uiconfig/basicide/ui/importlibdialog.ui
new file mode 100644
index 0000000..9d145fe
--- /dev/null
+++ b/basctl/uiconfig/basicide/ui/importlibdialog.ui
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Fri Jan  3 14:30:17 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="ImportLibDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Import Libraries</property>
+    <property name="type_hint">dialog</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>
+          </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="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">12</property>
+            <child>
+              <object class="GtkFrame" id="frame1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</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="top_padding">6</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="row_spacing">6</property>
+                        <child>
+                          <object class="GtkCheckButton" id="ref">
+                            <property name="label" translatable="yes">Insert as reference (read-only)</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>
+                          </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>
+                          <object class="GtkCheckButton" id="replace">
+                            <property name="label" translatable="yes">Replace existing libraries</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>
+                          </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>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Options</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </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>
+              <object class="GtkFrame" id="storageframe">
+                <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="alignment2">
+                    <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="basctllo-CheckBox" id="entries:border">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection" id="treeview-selection2"/>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </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>
+          <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-widgets>
+  </object>
+</interface>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 0bf7eca..766e072 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -436,6 +436,9 @@
     <glade-widget-class title="Tab List" name="svtlo-SvTabListBox"
                         generic-name="Tab List" parent="svtlo-SvTreeListBox"
                         icon-name="widget-gtk-treeview"/>
+    <glade-widget-class title="CheckBox List" name="basctllo-CheckBox"
+                        generic-name="CheckBox List" parent="svtlo-SvTabListBox"
+                        icon-name="widget-gtk-treeview"/>
     <glade-widget-class title="SwIdxTreeListBox" name="swuilo-SwIdxTreeListBox"
                         generic-name="SwIdxTreeListBox" parent="svtlo-SvTreeListBox"
                         icon-name="widget-gtk-treeview"/>


More information about the Libreoffice-commits mailing list