summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-21 17:05:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-21 17:10:37 +0100
commit55a639f6b3f0b78eac0f4c16c28baf6a51b1d623 (patch)
tree24b4f1a0d60e9cb00914a360118ce6d6ae2b8a23
parentcebd0347a02844b1f3b3f496e4722b30a9393d47 (diff)
convert backup page to .ui
Change-Id: Id9a90001153fdaad51a00b68f38b1298195c5646
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/inc/dbaccess_helpid.hrc2
-rw-r--r--dbaccess/source/ext/macromigration/dbmm_global.hrc1
-rw-r--r--dbaccess/source/ext/macromigration/macromigration.hrc8
-rw-r--r--dbaccess/source/ext/macromigration/macromigration.src76
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.cxx35
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.hxx18
-rw-r--r--dbaccess/uiconfig/ui/backuppage.ui144
8 files changed, 171 insertions, 114 deletions
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index c6060f1ea634..25675c8826b9 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/admindialog \
dbaccess/uiconfig/ui/advancedsettingsdialog \
dbaccess/uiconfig/ui/applycolpage \
+ dbaccess/uiconfig/ui/backuppage \
dbaccess/uiconfig/ui/choosedatasourcedialog \
dbaccess/uiconfig/ui/collectionviewdialog \
dbaccess/uiconfig/ui/colwidthdialog \
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc
index b99138fb9ff3..a64c290a1f3c 100644
--- a/dbaccess/inc/dbaccess_helpid.hrc
+++ b/dbaccess/inc/dbaccess_helpid.hrc
@@ -245,8 +245,6 @@
#define HID_DLG_DATABASE_WIZARD "DBACCESS_HID_DLG_DATABASE_WIZARD"
-#define HID_MACRO_MIGRATION_BACKUP_LOCATION "DBACCESS_HID_MACRO_MIGRATION_BACKUP_LOCATION"
-
#endif // _DBA_DBACCESS_HELPID_HRC_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ext/macromigration/dbmm_global.hrc b/dbaccess/source/ext/macromigration/dbmm_global.hrc
index 9354332e1324..fb6fb050f8ac 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_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 ada05ff5e7c0..fdb85a019d37 100644
--- a/dbaccess/source/ext/macromigration/macromigration.hrc
+++ b/dbaccess/source/ext/macromigration/macromigration.hrc
@@ -47,9 +47,6 @@
//... fixed texts .......................................................
#define FT_HEADER 1
-#define FT_EXPLANATION 3
-#define FT_SAVE_AS_LABEL 4
-#define FT_START_MIGRATION 5
#define FT_CURRENT_OBJECT_LABEL 6
#define FT_CURRENT_OBJECT 7
#define FT_CURRENT_PROGRESS_LABEL 8
@@ -68,13 +65,8 @@
//... edits ..............................................................
-#define ED_SAVE_AS_LOCATION 1
#define ED_CHANGES 2
-//... buttons ............................................................
-
-#define PB_BROWSE_SAVE_AS_LOCATION 1
-
//... strings ............................................................
#define STR_STATE_CLOSE_SUB_DOCS 1
diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src
index b58891c579fe..cf0c6c155b1b 100644
--- a/dbaccess/source/ext/macromigration/macromigration.src
+++ b/dbaccess/source/ext/macromigration/macromigration.src
@@ -51,83 +51,7 @@ ModalDialog DLG_MACRO_MIGRATION
};
};
-//= SaveDBDocPage
-
-TabPage TP_SAVE_DBDOC_AS
-{
- HelpID = "dbaccess:TabPage:TP_SAVE_DBDOC_AS";
- 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 ] = "Backup your Document";
- };
-
- FixedText FT_EXPLANATION
- {
- Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X );
- Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN, 5 * FIXED_TEXT_HEIGHT );
-
- WordBreak = TRUE;
-
- Text [ en-US ] = "To allow you to go back to the state before the migration, the database "
- "document will be backed up to a location of your choice. Every change done by the wizard will "
- "be made to the original document, the backup will stay untouched.";
- };
-
- FixedText FT_SAVE_AS_LABEL
- {
- Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X + 5 * FIXED_TEXT_HEIGHT + SPACING_UNRELATED );
- Size = MAP_APPFONT( 60, INPUT_HEIGHT );
-
- VCenter = TRUE;
-
- Text [ en-US ] = "Save To:";
- };
-
- ComboBox ED_SAVE_AS_LOCATION
- {
- HelpID = "dbaccess:ComboBox:TP_SAVE_DBDOC_AS:ED_SAVE_AS_LOCATION";
- Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN + 60 + SPACING_RELATED,
- CONTENT_POS_X + 5 * FIXED_TEXT_HEIGHT + SPACING_UNRELATED );
- Size = MAP_APPFONT( TAB_PAGE_WIDTH - ( TAB_PAGE_CONTENT_MARGIN + 60 + SPACING_RELATED ) - TAB_PAGE_CONTENT_MARGIN,
- INPUT_HEIGHT );
-
- Border = TRUE;
- DropDown = TRUE ;
- };
-
- PushButton PB_BROWSE_SAVE_AS_LOCATION
- {
- HelpID = "dbaccess:PushButton:TP_SAVE_DBDOC_AS:PB_BROWSE_SAVE_AS_LOCATION";
- Pos = MAP_APPFONT( TAB_PAGE_WIDTH - BUTTON_WIDTH - TAB_PAGE_CONTENT_MARGIN,
- CONTENT_POS_X + 5 * FIXED_TEXT_HEIGHT + SPACING_UNRELATED + INPUT_HEIGHT + SPACING_RELATED );
- Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT );
-
- Text [ en-US ] = "Browse ...";
- };
-
- FixedText FT_START_MIGRATION
- {
- Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN,
- TAB_PAGE_HEIGHT - TAB_PAGE_CONTENT_MARGIN - 3 * FIXED_TEXT_HEIGHT );
- Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN,
- 3 * FIXED_TEXT_HEIGHT );
-
- WordBreak = TRUE;
-
- Text [ en-US ] = "Press 'Next' to save a copy of your document, and to begin the migration.";
- };
-};
-
//= ProgressPage
-
TabPage TP_MIGRATE
{
HelpID = "dbaccess:TabPage:TP_MIGRATE";
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
index 4591eb3b8e99..ceddbe9b0f98 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
@@ -94,29 +94,30 @@ namespace dbmm
}
// SaveDBDocPage
- SaveDBDocPage::SaveDBDocPage( MacroMigrationDialog& _rParentDialog )
- :MacroMigrationPage( _rParentDialog, MacroMigrationResId( TP_SAVE_DBDOC_AS ) )
- ,m_aExplanation ( this, MacroMigrationResId( FT_EXPLANATION ) )
- ,m_aSaveAsLabel ( this, MacroMigrationResId( FT_SAVE_AS_LABEL ) )
- ,m_aSaveAsLocation ( this, MacroMigrationResId( ED_SAVE_AS_LOCATION ) )
- ,m_aBrowseSaveAsLocation( this, MacroMigrationResId( PB_BROWSE_SAVE_AS_LOCATION ) )
- ,m_aStartMigration ( this, MacroMigrationResId( FT_START_MIGRATION ) )
- ,m_aLocationController( _rParentDialog.getComponentContext(), m_aSaveAsLocation, m_aBrowseSaveAsLocation )
+ SaveDBDocPage::SaveDBDocPage(MacroMigrationDialog& _rParentDialog)
+ : MacroMigrationPage(&_rParentDialog, "BackupPage" ,"dbaccess/ui/backuppage.ui")
{
- FreeResource();
-
- m_aSaveAsLocation.SetModifyHdl( LINK( this, SaveDBDocPage, OnLocationModified ) );
- m_aSaveAsLocation.SetDropDownLineCount( 20 );
+ get(m_pStartMigration, "startmigrate");
+ get(m_pBrowseSaveAsLocation, "browse");
+ get(m_pSaveAsLocation, "location");
+ m_pLocationController = new ::svx::DatabaseLocationInputController(
+ _rParentDialog.getComponentContext(), *m_pSaveAsLocation, *m_pBrowseSaveAsLocation);
- m_aSaveAsLocation.SetHelpId( HID_MACRO_MIGRATION_BACKUP_LOCATION );
+ m_pSaveAsLocation->SetModifyHdl( LINK( this, SaveDBDocPage, OnLocationModified ) );
+ m_pSaveAsLocation->SetDropDownLineCount( 20 );
impl_updateLocationDependentItems();
}
+ SaveDBDocPage::~SaveDBDocPage()
+ {
+ delete m_pLocationController;
+ }
+
void SaveDBDocPage::impl_updateLocationDependentItems()
{
updateDialogTravelUI();
- m_aStartMigration.Show( !m_aSaveAsLocation.GetText().isEmpty() );
+ m_pStartMigration->Show(!m_pSaveAsLocation->GetText().isEmpty());
}
IMPL_LINK( SaveDBDocPage, OnLocationModified, Edit*, /**/ )
@@ -140,7 +141,7 @@ namespace dbmm
aBaseName.appendAscii( ".backup" );
aURLParser.setBase( aBaseName.makeStringAndClear() );
- m_aLocationController.setURL( aURLParser.GetMainURL( INetURLObject::NO_DECODE ) );
+ m_pLocationController->setURL( aURLParser.GetMainURL( INetURLObject::NO_DECODE ) );
impl_updateLocationDependentItems();
}
catch( const Exception& )
@@ -154,7 +155,7 @@ namespace dbmm
if ( !MacroMigrationPage::canAdvance() )
return false;
- return !m_aSaveAsLocation.GetText().isEmpty();
+ return !m_pSaveAsLocation->GetText().isEmpty();
}
bool SaveDBDocPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
@@ -165,7 +166,7 @@ namespace dbmm
if ( ::svt::WizardTypes::eTravelBackward == _eReason )
return true;
- if ( !m_aLocationController.prepareCommit() )
+ if ( !m_pLocationController->prepareCommit() )
return false;
return true;
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
index fa59d77ee515..bd5535d19049 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
@@ -76,21 +76,19 @@ namespace dbmm
class SaveDBDocPage : public MacroMigrationPage
{
public:
- SaveDBDocPage( MacroMigrationDialog& _rParentDialog );
+ SaveDBDocPage(MacroMigrationDialog& _rParentDialog);
+ ~SaveDBDocPage();
static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
public:
- OUString getBackupLocation() const { return m_aLocationController.getURL(); }
- void grabLocationFocus() { m_aSaveAsLocation.GrabFocus(); }
+ OUString getBackupLocation() const { return m_pLocationController->getURL(); }
+ void grabLocationFocus() { m_pSaveAsLocation->GrabFocus(); }
protected:
- FixedText m_aExplanation;
- FixedText m_aSaveAsLabel;
- ::svt::OFileURLControl m_aSaveAsLocation;
- PushButton m_aBrowseSaveAsLocation;
- FixedText m_aStartMigration;
- ::svx::DatabaseLocationInputController
- m_aLocationController;
+ ::svt::OFileURLControl* m_pSaveAsLocation;
+ PushButton* m_pBrowseSaveAsLocation;
+ FixedText* m_pStartMigration;
+ ::svx::DatabaseLocationInputController* m_pLocationController;
protected:
// IWizardPageController overridables
diff --git a/dbaccess/uiconfig/ui/backuppage.ui b/dbaccess/uiconfig/ui/backuppage.ui
new file mode 100644
index 000000000000..68bec543bd62
--- /dev/null
+++ b/dbaccess/uiconfig/ui/backuppage.ui
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkGrid" id="BackupPage">
+ <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">Backup your Document</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">To allow you to go back to the state before the migration, the database document will be backed up to a location of your choice. Every change done by the wizard will be made to the original document, the backup will stay untouched.</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="startmigrate">
+ <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">Press 'Next' to save a copy of your document, and to begin the migration.</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">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Save To:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">location</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="svtlo-OFileURLControl" id="location">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="has_entry">True</property>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="URLBox-entry1">
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </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>
+ <child>
+ <object class="GtkButton" id="browse">
+ <property name="label" translatable="yes">Browse...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">end</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>
+ <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>