From fa9ce74db51a27a2ecb65fc6045c5fc209581a57 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 22 Jul 2014 09:09:19 +0100 Subject: convert summary page to .ui Change-Id: I27fbeaafb53b4a0ae30c3408888419af93a37300 --- dbaccess/UIConfig_dbaccess.mk | 1 + dbaccess/source/ext/macromigration/dbmm_global.hrc | 1 - .../source/ext/macromigration/macromigration.hrc | 7 -- .../source/ext/macromigration/macromigration.src | 50 ------------ .../ext/macromigration/macromigrationpages.cxx | 47 ++++------- .../ext/macromigration/macromigrationpages.hxx | 9 +-- dbaccess/uiconfig/ui/summarypage.ui | 90 ++++++++++++++++++++++ 7 files changed, 110 insertions(+), 95 deletions(-) create mode 100644 dbaccess/uiconfig/ui/summarypage.ui (limited to 'dbaccess') diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk index 25675c8826b9..08da25180e47 100644 --- a/dbaccess/UIConfig_dbaccess.mk +++ b/dbaccess/UIConfig_dbaccess.mk @@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ dbaccess/uiconfig/ui/specialsettingspage \ dbaccess/uiconfig/ui/sortdialog \ dbaccess/uiconfig/ui/sqlexception \ + dbaccess/uiconfig/ui/summarypage \ dbaccess/uiconfig/ui/tablesfilterdialog \ dbaccess/uiconfig/ui/tablesfilterpage \ dbaccess/uiconfig/ui/tablesjoindialog \ diff --git a/dbaccess/source/ext/macromigration/dbmm_global.hrc b/dbaccess/source/ext/macromigration/dbmm_global.hrc index fb6fb050f8ac..fec924bccf87 100644 --- a/dbaccess/source/ext/macromigration/dbmm_global.hrc +++ b/dbaccess/source/ext/macromigration/dbmm_global.hrc @@ -39,7 +39,6 @@ //= tab pages #define TP_MIGRATE ( RID_DBMM_TAPPAGE_START + 2 ) -#define TP_SUMMARY ( RID_DBMM_TAPPAGE_START + 3 ) //= strings diff --git a/dbaccess/source/ext/macromigration/macromigration.hrc b/dbaccess/source/ext/macromigration/macromigration.hrc index fdb85a019d37..334ef626d1ee 100644 --- a/dbaccess/source/ext/macromigration/macromigration.hrc +++ b/dbaccess/source/ext/macromigration/macromigration.hrc @@ -52,7 +52,6 @@ #define FT_CURRENT_PROGRESS_LABEL 8 #define FT_CURRENT_PROGRESS 9 #define FT_ALL_PROGRESS_LABEL 10 -#define FT_CHANGES_LABEL 11 #define FT_OBJECT_COUNT 12 #define FT_OBJECT_COUNT_PROGRESS 13 #define FT_MIGRATION_DONE 14 @@ -63,18 +62,12 @@ #define WND_CURRENT_PROGRESS 1 #define WND_ALL_PROGRESS 2 -//... edits .............................................................. - -#define ED_CHANGES 2 - //... strings ............................................................ #define STR_STATE_CLOSE_SUB_DOCS 1 #define STR_STATE_BACKUP_DBDOC 2 #define STR_STATE_MIGRATE 3 #define STR_STATE_SUMMARY 4 -#define STR_SUCCESSFUL 5 -#define STR_UNSUCCESSFUL 6 #endif // DBACCESS_MACROMIGRATION_HRC diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index cf0c6c155b1b..2f0f364b2c6f 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -162,56 +162,6 @@ TabPage TP_MIGRATE }; }; -//= ResultPage - -TabPage TP_SUMMARY -{ - HelpID = "dbaccess:TabPage:TP_SUMMARY"; - 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 ] = "Summary"; - }; - - FixedText FT_CHANGES_LABEL - { - Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X ); - Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN, FIXED_TEXT_HEIGHT ); - - WordBreak = TRUE; - }; - - MultiLineEdit ED_CHANGES - { - HelpID = "dbaccess:MultiLineEdit:TP_SUMMARY:ED_CHANGES"; - Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X + FIXED_TEXT_HEIGHT + SPACING_RELATED ); - Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN, - TAB_PAGE_HEIGHT - ( CONTENT_POS_X + FIXED_TEXT_HEIGHT + SPACING_RELATED ) - TAB_PAGE_CONTENT_MARGIN ); - - ReadOnly = TRUE; - AutoVScroll = TRUE; - Border = TRUE; - BorderStyle = WINDOW_BORDER_MONO; - }; - - String STR_SUCCESSFUL - { - Text [ en-US ] = "The migration was successful. Below is a log of the actions which have been taken to your document."; - }; - - String STR_UNSUCCESSFUL - { - Text [ en-US ] = "The migration was not successful. Examine the migration log below for details."; - }; -}; - String STR_FORM { Text [ en-US ] = "Form '$name$'"; diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index ceddbe9b0f98..c1716eb71422 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -266,45 +266,28 @@ namespace dbmm } // ResultPage - ResultPage::ResultPage( MacroMigrationDialog& _rParentDialog ) - :MacroMigrationPage( _rParentDialog, MacroMigrationResId( TP_SUMMARY ) ) - ,m_aChangesLabel( this, MacroMigrationResId( FT_CHANGES_LABEL ) ) - ,m_aChanges ( this, MacroMigrationResId( ED_CHANGES ) ) - ,m_aSuccessful ( MacroMigrationResId( STR_SUCCESSFUL ) ) - ,m_aUnsuccessful( MacroMigrationResId( STR_UNSUCCESSFUL ) ) + ResultPage::ResultPage(Window* pParent) + : MacroMigrationPage(pParent, "SummaryPage" ,"dbaccess/ui/summarypage.ui") { - FreeResource(); + get(m_pChanges, "textview"); + m_pChanges->set_height_request(GetTextHeight() * 10); + m_pChanges->set_width_request(approximate_char_width() * 40); + get(m_pSuccessLabel, "success"); + get(m_pFailureLabel, "failure"); } - TabPage* ResultPage::Create( ::svt::RoadmapWizard& _rParentDialog ) + TabPage* ResultPage::Create(::svt::RoadmapWizard& _rParentDialog) { - return new ResultPage( dynamic_cast< MacroMigrationDialog& >( _rParentDialog ) ); + return new ResultPage(&_rParentDialog); } - void ResultPage::displayMigrationLog( const bool _bSuccessful, const OUString& _rSummary ) + void ResultPage::displayMigrationLog(const bool _bSuccessful, const OUString& _rSummary) { - m_aChangesLabel.SetText( _bSuccessful ? m_aSuccessful : m_aUnsuccessful ); - m_aChanges.SetText( _rSummary ); - - // resize m_aChangesLabel and m_aChances as needed for the label text to fit - Rectangle aOriginalLabelSize( m_aChangesLabel.GetPosPixel(), m_aChangesLabel.GetSizePixel() ); - // assume 3 lines, at most - Rectangle aNewLabelSize( aOriginalLabelSize ); - aNewLabelSize.Bottom() = aNewLabelSize.Top() + m_aChangesLabel.LogicToPixel( Size( 0, 3*8 ), MAP_APPFONT ).Height(); - TextRectInfo aInfo; - aNewLabelSize = m_aChangesLabel.GetTextRect( aNewLabelSize, m_aChangesLabel.GetText(), TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK, &aInfo ); - aNewLabelSize.Bottom() = aNewLabelSize.Top() + m_aChangesLabel.LogicToPixel( Size( 0, aInfo.GetLineCount() * 8 ), MAP_APPFONT ).Height(); - - m_aChangesLabel.SetSizePixel( aNewLabelSize.GetSize() ); - - long nChangesDiff = aNewLabelSize.GetHeight() - aOriginalLabelSize.GetHeight(); - Size aChangesSize( m_aChanges.GetSizePixel() ); - aChangesSize.Height() -= nChangesDiff; - m_aChanges.SetSizePixel( aChangesSize ); - - Point aChangesPos( m_aChanges.GetPosPixel() ); - aChangesPos.Y() += nChangesDiff; - m_aChanges.SetPosPixel( aChangesPos ); + if (_bSuccessful) + m_pFailureLabel->Hide(); + else + m_pSuccessLabel->Hide(); + m_pChanges->SetText(_rSummary); } } // namespace dbmm diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx index 50b6a5ad0d26..2fcbbf1f5c86 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx @@ -139,17 +139,16 @@ namespace dbmm class ResultPage : public MacroMigrationPage { public: - ResultPage( MacroMigrationDialog& _rParentDialog ); + ResultPage(Window *pParent); static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); void displayMigrationLog( const bool _bSuccessful, const OUString& _rLog ); private: - FixedText m_aChangesLabel; - MultiLineEdit m_aChanges; - OUString m_aSuccessful; - OUString m_aUnsuccessful; + FixedText* m_pSuccessLabel; + FixedText* m_pFailureLabel; + VclMultiLineEdit* m_pChanges; }; } // namespace dbmm diff --git a/dbaccess/uiconfig/ui/summarypage.ui b/dbaccess/uiconfig/ui/summarypage.ui new file mode 100644 index 000000000000..024a06e0950b --- /dev/null +++ b/dbaccess/uiconfig/ui/summarypage.ui @@ -0,0 +1,90 @@ + + + + + + True + False + True + 6 + 24 + + + True + False + True + 0 + Summary + + + + + + 0 + 0 + 1 + 1 + + + + + True + False + True + 0 + 0 + The migration was successful. Below is a log of the actions which have been taken to your document. + True + 64 + + + 0 + 1 + 1 + 1 + + + + + True + False + True + 0 + 0 + The migration was not successful. Examine the migration log below for details. + True + 64 + + + 0 + 2 + 1 + 1 + + + + + True + True + True + True + in + + + True + True + True + True + False + + + + + 0 + 3 + 1 + 1 + + + + -- cgit