[Libreoffice-commits] core.git: dbaccess/source dbaccess/uiconfig dbaccess/UIConfig_dbaccess.mk

Caolán McNamara caolanm at redhat.com
Mon Jul 21 08:29:11 PDT 2014


 dbaccess/UIConfig_dbaccess.mk                              |    1 
 dbaccess/source/ext/macromigration/dbmm_global.hrc         |    1 
 dbaccess/source/ext/macromigration/macromigration.hrc      |    1 
 dbaccess/source/ext/macromigration/macromigration.src      |   49 --------
 dbaccess/source/ext/macromigration/macromigrationpages.cxx |   25 ++--
 dbaccess/source/ext/macromigration/macromigrationpages.hxx |   10 -
 dbaccess/uiconfig/ui/preparepage.ui                        |   72 +++++++++++++
 7 files changed, 93 insertions(+), 66 deletions(-)

New commits:
commit aa7d58a1e6e6f809a5372d893b70fc298a240676
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 21 16:26:22 2014 +0100

    convert TP_PREPARE to .ui
    
    Change-Id: Iad0c94ffd08117f79cba5d5305f03c836ac6ada9

diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 197e4a3..c6060f1 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
     dbaccess/uiconfig/ui/indexdesigndialog \
     dbaccess/uiconfig/ui/joindialog \
     dbaccess/uiconfig/ui/password \
+    dbaccess/uiconfig/ui/preparepage \
     dbaccess/uiconfig/ui/queryfilterdialog \
     dbaccess/uiconfig/ui/querypropertiesdialog  \
     dbaccess/uiconfig/ui/relationdialog \
diff --git a/dbaccess/source/ext/macromigration/dbmm_global.hrc b/dbaccess/source/ext/macromigration/dbmm_global.hrc
index 2918be1..9354332 100644
--- a/dbaccess/source/ext/macromigration/dbmm_global.hrc
+++ b/dbaccess/source/ext/macromigration/dbmm_global.hrc
@@ -38,7 +38,6 @@
 
 //= tab pages
 
-#define TP_PREPARE          ( RID_DBMM_TAPPAGE_START + 0 )
 #define TP_SAVE_DBDOC_AS    ( RID_DBMM_TAPPAGE_START + 1 )
 #define TP_MIGRATE          ( RID_DBMM_TAPPAGE_START + 2 )
 #define TP_SUMMARY          ( RID_DBMM_TAPPAGE_START + 3 )
diff --git a/dbaccess/source/ext/macromigration/macromigration.hrc b/dbaccess/source/ext/macromigration/macromigration.hrc
index d55a9e1..ada05ff 100644
--- a/dbaccess/source/ext/macromigration/macromigration.hrc
+++ b/dbaccess/source/ext/macromigration/macromigration.hrc
@@ -47,7 +47,6 @@
 //... fixed texts  .......................................................
 
 #define FT_HEADER                   1
-#define FT_INTRODUCTION             2
 #define FT_EXPLANATION              3
 #define FT_SAVE_AS_LABEL            4
 #define FT_START_MIGRATION          5
diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src
index 52da579..b58891c 100644
--- a/dbaccess/source/ext/macromigration/macromigration.src
+++ b/dbaccess/source/ext/macromigration/macromigration.src
@@ -51,55 +51,6 @@ ModalDialog DLG_MACRO_MIGRATION
     };
 };
 
-//= PreparationPage
-
-TabPage TP_PREPARE
-{
-    HelpID = "dbaccess:TabPage:TP_PREPARE";
-    Pos = MAP_APPFONT( 40, 130 );
-    Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
-
-    Hide = TRUE;
-
-    FixedText FT_HEADER
-    {
-        Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, TAB_PAGE_CONTENT_MARGIN );
-        Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN, FIXED_TEXT_HEIGHT );
-
-        Text [ en-US ] = "Welcome to the Database Macro Migration Wizard";
-    };
-
-    FixedText FT_INTRODUCTION
-    {
-        Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X );
-        Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN,
-                            TAB_PAGE_HEIGHT - CONTENT_POS_X - TAB_PAGE_CONTENT_MARGIN - ( 2 * FIXED_TEXT_HEIGHT - SPACING_UNRELATED ) );
-        WordBreak = TRUE;
-
-        Text [ en-US ] = "This wizard will guide you through the task of migrating your macros.\n\n"
-
-            "After you finished it, all macros which were formerly embedded into the forms and reports of "
-            "the current database document will have been moved to the document itself. In this course, "
-            "libraries will be renamed as needed.\n\n"
-
-            "If your forms and reports contain references to those macros, they will be adjusted, where "
-            "possible.\n\n"
-
-            "Before the migration can start, all forms, reports, queries and tables belonging to the document must be closed. "
-            "Press 'Next' to do so.";
-    };
-
-    FixedText FT_CLOSE_DOC_ERROR
-    {
-        Pos = MAP_APPFONT ( TAB_PAGE_CONTENT_MARGIN,
-                            TAB_PAGE_HEIGHT - TAB_PAGE_CONTENT_MARGIN - ( 2 * FIXED_TEXT_HEIGHT - SPACING_UNRELATED ) );
-        Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN,
-                            2 * FIXED_TEXT_HEIGHT - SPACING_UNRELATED );
-        Text [ en-US ] = "Not all objects could be closed. Please close them manually, and re-start the wizard.";
-        hide = TRUE;
-    };
-};
-
 //= SaveDBDocPage
 
 TabPage TP_SAVE_DBDOC_AS
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
index 762a5e9..4591eb3 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
@@ -48,15 +48,22 @@ namespace dbmm
     // MacroMigrationPage
     MacroMigrationPage::MacroMigrationPage( MacroMigrationDialog& _rParentDialog, const ResId& _rRes )
         :MacroMigrationPage_Base( &_rParentDialog, _rRes )
-        ,m_aHeader( this, MacroMigrationResId( FT_HEADER ) )
     {
-        Font aFont( m_aHeader.GetFont() );
+        m_pHeader = new FixedText(this, MacroMigrationResId(FT_HEADER));
+        Font aFont( m_pHeader->GetFont() );
         aFont.SetWeight( WEIGHT_BOLD );
-        m_aHeader.SetFont( aFont );
+        m_pHeader->SetFont( aFont );
+    }
+
+    MacroMigrationPage::MacroMigrationPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription)
+        : MacroMigrationPage_Base(pParent, rID, rUIXMLDescription)
+        , m_pHeader(0) //remove when upper ctor is removed
+    {
     }
 
     MacroMigrationPage::~MacroMigrationPage()
     {
+        delete m_pHeader;
     }
 
     const MacroMigrationDialog& MacroMigrationPage::getDialog() const
@@ -70,22 +77,20 @@ namespace dbmm
     }
 
     // PreparationPage
-    PreparationPage::PreparationPage( MacroMigrationDialog& _rParentDialog )
-        :MacroMigrationPage( _rParentDialog, MacroMigrationResId( TP_PREPARE ) )
-        ,m_aIntroduction ( this, MacroMigrationResId( FT_INTRODUCTION    ) )
-        ,m_aCloseDocError( this, MacroMigrationResId( FT_CLOSE_DOC_ERROR ) )
+    PreparationPage::PreparationPage(Window *pParent)
+        : MacroMigrationPage(pParent, "PreparePage" ,"dbaccess/ui/preparepage.ui")
     {
-        FreeResource();
+        get(m_pCloseDocError, "closedocerror");
     }
 
     void PreparationPage::showCloseDocsError( bool _bShow )
     {
-        m_aCloseDocError.Show( _bShow );
+        m_pCloseDocError->Show( _bShow );
     }
 
     TabPage* PreparationPage::Create( ::svt::RoadmapWizard& _rParentDialog )
     {
-        return new PreparationPage( dynamic_cast< MacroMigrationDialog& >( _rParentDialog ) );
+        return new PreparationPage(&_rParentDialog);
     }
 
     // SaveDBDocPage
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
index be05f56..fa59d77 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
@@ -46,6 +46,7 @@ namespace dbmm
     {
     public:
         MacroMigrationPage( MacroMigrationDialog& _rParentDialog, const ResId& _rRes );
+        MacroMigrationPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
         virtual ~MacroMigrationPage();
 
     protected:
@@ -53,23 +54,22 @@ namespace dbmm
               MacroMigrationDialog& getDialog()      ;
 
     protected:
-        FixedText   m_aHeader;
+        FixedText*  m_pHeader;
     };
 
     // PreparationPage
     class PreparationPage : public MacroMigrationPage
     {
     public:
-        PreparationPage( MacroMigrationDialog& _rParentDialog );
+        PreparationPage(Window *pParent);
 
         static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
 
     public:
-        void    showCloseDocsError( bool _bShow );
+        void    showCloseDocsError(bool _bShow);
 
     protected:
-        FixedText   m_aIntroduction;
-        FixedText   m_aCloseDocError;
+        FixedText*  m_pCloseDocError;
     };
 
     // SaveDBDocPage
diff --git a/dbaccess/uiconfig/ui/preparepage.ui b/dbaccess/uiconfig/ui/preparepage.ui
new file mode 100644
index 0000000..f6cb639
--- /dev/null
+++ b/dbaccess/uiconfig/ui/preparepage.ui
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkGrid" id="PreparePage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="border_width">6</property>
+    <property name="row_spacing">24</property>
+    <child>
+      <object class="GtkLabel" id="label1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">Welcome to the Database Macro Migration Wizard</property>
+        <attributes>
+          <attribute name="weight" value="semibold"/>
+        </attributes>
+      </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="GtkLabel" id="label2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0</property>
+        <property name="label" translatable="yes">This wizard will guide you through the task of migrating your macros.
+
+After you finished it, all macros which were formerly embedded into the forms and reports of the current database document will have been moved to the document itself. In this course, libraries will be renamed as needed.
+
+If your forms and reports contain references to those macros, they will be adjusted, where possible.
+
+Before the migration can start, all forms, reports, queries and tables belonging to the document must be closed. Press 'Next' to do so.</property>
+        <property name="wrap">True</property>
+        <property name="max_width_chars">64</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="closedocerror">
+        <property name="can_focus">False</property>
+        <property name="no_show_all">True</property>
+        <property name="hexpand">True</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0</property>
+        <property name="label" translatable="yes">Not all objects could be closed. Please close them manually, and re-start the wizard.</property>
+        <property name="wrap">True</property>
+        <property name="max_width_chars">64</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>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list