summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-22 09:09:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-22 09:54:39 +0100
commitfa9ce74db51a27a2ecb65fc6045c5fc209581a57 (patch)
tree81bbdd64118a7e424d7a839c728d34d0a2dfc401 /dbaccess
parentc1dd91a93c59b19ed9542da61e5b1ce43cf4ffbf (diff)
convert summary page to .ui
Change-Id: I27fbeaafb53b4a0ae30c3408888419af93a37300
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/source/ext/macromigration/dbmm_global.hrc1
-rw-r--r--dbaccess/source/ext/macromigration/macromigration.hrc7
-rw-r--r--dbaccess/source/ext/macromigration/macromigration.src50
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.cxx47
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.hxx9
-rw-r--r--dbaccess/uiconfig/ui/summarypage.ui90
7 files changed, 110 insertions, 95 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkGrid" id="SummaryPage">
+ <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">Summary</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="success">
+ <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">The migration was successful. Below is a log of the actions which have been taken to your document.</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="failure">
+ <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">The migration was not successful. Examine the migration log below for details.</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>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="textview:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="editable">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+</interface>