Kaydet (Commit) 9319ea5b authored tarafından Caolán McNamara's avatar Caolán McNamara

convert FinalPage to .ui

Change-Id: I3e7728da37d36bdf7f9a24bbc70bae856a85d9c4
üst 55bad431
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
$(eval $(call gb_UIConfig_UIConfig,modules/sabpilot)) $(eval $(call gb_UIConfig_UIConfig,modules/sabpilot))
$(eval $(call gb_UIConfig_add_uifiles,modules/sabpilot,\ $(eval $(call gb_UIConfig_add_uifiles,modules/sabpilot,\
extensions/uiconfig/sabpilot/ui/datasourcepage \
extensions/uiconfig/sabpilot/ui/fieldassignpage \ extensions/uiconfig/sabpilot/ui/fieldassignpage \
extensions/uiconfig/sabpilot/ui/selecttablepage \ extensions/uiconfig/sabpilot/ui/selecttablepage \
extensions/uiconfig/sabpilot/ui/selecttypepage \ extensions/uiconfig/sabpilot/ui/selecttypepage \
......
...@@ -43,32 +43,33 @@ namespace abp ...@@ -43,32 +43,33 @@ namespace abp
} }
//= FinalPage //= FinalPage
FinalPage::FinalPage( OAddessBookSourcePilot* _pParent ) FinalPage::FinalPage( OAddessBookSourcePilot* _pParent )
:AddressBookSourcePage(_pParent, ModuleRes(RID_PAGE_FINAL)) : AddressBookSourcePage(_pParent, "DataSourcePage",
,m_aExplanation ( this, ModuleRes( FT_FINISH_EXPL ) ) "modules/sabpilot/ui/datasourcepage.ui")
,m_aLocationLabel ( this, ModuleRes( FT_LOCATION ) )
,m_aLocation ( this, ModuleRes( CBB_LOCATION ) )
,m_aBrowse ( this, ModuleRes( PB_BROWSE ) )
,m_aRegisterName ( this, ModuleRes( CB_REGISTER_DS ) )
,m_aNameLabel ( this, ModuleRes( FT_NAME_EXPL ) )
,m_aName ( this, ModuleRes( ET_DATASOURCENAME ) )
,m_aDuplicateNameError ( this, ModuleRes( FT_DUPLICATENAME ) )
,m_aLocationController( _pParent->getORB(), m_aLocation, m_aBrowse )
{ {
FreeResource(); get(m_pLocation, "location");
get(m_pBrowse, "browse");
m_aName.SetModifyHdl( LINK(this, FinalPage, OnNameModified) ); get(m_pRegisterName, "available");
m_aLocation.SetModifyHdl( LINK(this, FinalPage, OnNameModified) ); get(m_pNameLabel, "nameft");
m_aRegisterName.SetClickHdl( LINK( this, FinalPage, OnRegister ) ); get(m_pName, "name");
m_aRegisterName.Check(true); get(m_pDuplicateNameError, "warning");
m_pLocationController = new ::svx::DatabaseLocationInputController(_pParent->getORB(),
*m_pLocation, *m_pBrowse);
m_pName->SetModifyHdl( LINK(this, FinalPage, OnNameModified) );
m_pLocation->SetModifyHdl( LINK(this, FinalPage, OnNameModified) );
m_pRegisterName->SetClickHdl( LINK( this, FinalPage, OnRegister ) );
m_pRegisterName->Check(true);
} }
FinalPage::~FinalPage()
{
delete m_pLocationController;
}
bool FinalPage::isValidName() const bool FinalPage::isValidName() const
{ {
OUString sCurrentName(m_aName.GetText()); OUString sCurrentName(m_pName->GetText());
if (sCurrentName.isEmpty()) if (sCurrentName.isEmpty())
// the name must not be empty // the name must not be empty
...@@ -81,7 +82,6 @@ namespace abp ...@@ -81,7 +82,6 @@ namespace abp
return true; return true;
} }
void FinalPage::setFields() void FinalPage::setFields()
{ {
AddressSettings& rSettings = getSettings(); AddressSettings& rSettings = getSettings();
...@@ -104,16 +104,16 @@ namespace abp ...@@ -104,16 +104,16 @@ namespace abp
} }
OSL_ENSURE( aURL.GetProtocol() != INET_PROT_NOT_VALID ,"No valid file name!"); OSL_ENSURE( aURL.GetProtocol() != INET_PROT_NOT_VALID ,"No valid file name!");
rSettings.sDataSourceName = aURL.GetMainURL( INetURLObject::NO_DECODE ); rSettings.sDataSourceName = aURL.GetMainURL( INetURLObject::NO_DECODE );
m_aLocationController.setURL( rSettings.sDataSourceName ); m_pLocationController->setURL( rSettings.sDataSourceName );
OUString sName = aURL.getName( ); OUString sName = aURL.getName( );
sal_Int32 nPos = sName.indexOf(aURL.GetExtension()); sal_Int32 nPos = sName.indexOf(aURL.GetExtension());
if ( nPos != -1 ) if ( nPos != -1 )
{ {
sName = sName.replaceAt(nPos-1, 4, ""); sName = sName.replaceAt(nPos-1, 4, "");
} }
m_aName.SetText(sName); m_pName->SetText(sName);
OnRegister(&m_aRegisterName); OnRegister(m_pRegisterName);
} }
...@@ -131,15 +131,15 @@ namespace abp ...@@ -131,15 +131,15 @@ namespace abp
return false; return false;
if ( ( ::svt::WizardTypes::eTravelBackward != _eReason ) if ( ( ::svt::WizardTypes::eTravelBackward != _eReason )
&& ( !m_aLocationController.prepareCommit() ) && ( !m_pLocationController->prepareCommit() )
) )
return false; return false;
AddressSettings& rSettings = getSettings(); AddressSettings& rSettings = getSettings();
rSettings.sDataSourceName = m_aLocationController.getURL(); rSettings.sDataSourceName = m_pLocationController->getURL();
rSettings.bRegisterDataSource = m_aRegisterName.IsChecked(); rSettings.bRegisterDataSource = m_pRegisterName->IsChecked();
if ( rSettings.bRegisterDataSource ) if ( rSettings.bRegisterDataSource )
rSettings.sRegisteredDataSourceName = m_aName.GetText(); rSettings.sRegisteredDataSourceName = m_pName->GetText();
return true; return true;
} }
...@@ -154,7 +154,7 @@ namespace abp ...@@ -154,7 +154,7 @@ namespace abp
aContext.getDataSourceNames( m_aInvalidDataSourceNames ); aContext.getDataSourceNames( m_aInvalidDataSourceNames );
// give the name edit the focus // give the name edit the focus
m_aLocation.GrabFocus(); m_pLocation->GrabFocus();
// default the finish button // default the finish button
getDialog()->defaultButton( WZB_FINISH ); getDialog()->defaultButton( WZB_FINISH );
...@@ -181,14 +181,14 @@ namespace abp ...@@ -181,14 +181,14 @@ namespace abp
void FinalPage::implCheckName() void FinalPage::implCheckName()
{ {
bool bValidName = isValidName(); bool bValidName = isValidName();
bool bEmptyName = m_aName.GetText().isEmpty(); bool bEmptyName = m_pName->GetText().isEmpty();
bool bEmptyLocation = m_aLocation.GetText().isEmpty(); bool bEmptyLocation = m_pLocation->GetText().isEmpty();
// enable or disable the finish button // enable or disable the finish button
getDialog()->enableButtons( WZB_FINISH, !bEmptyLocation && (!m_aRegisterName.IsChecked() || bValidName) ); getDialog()->enableButtons( WZB_FINISH, !bEmptyLocation && (!m_pRegisterName->IsChecked() || bValidName) );
// show the error message for an invalid name // show the error message for an invalid name
m_aDuplicateNameError.Show( !bValidName && !bEmptyName ); m_pDuplicateNameError->Show( !bValidName && !bEmptyName );
} }
...@@ -201,9 +201,9 @@ namespace abp ...@@ -201,9 +201,9 @@ namespace abp
IMPL_LINK_NOARG(FinalPage, OnRegister) IMPL_LINK_NOARG(FinalPage, OnRegister)
{ {
bool bEnable = m_aRegisterName.IsChecked(); bool bEnable = m_pRegisterName->IsChecked();
m_aNameLabel.Enable(bEnable); m_pNameLabel->Enable(bEnable);
m_aName.Enable(bEnable); m_pName->Enable(bEnable);
implCheckName(); implCheckName();
return 0L; return 0L;
} }
......
...@@ -38,22 +38,21 @@ namespace abp ...@@ -38,22 +38,21 @@ namespace abp
class FinalPage : public AddressBookSourcePage class FinalPage : public AddressBookSourcePage
{ {
protected: protected:
FixedText m_aExplanation; ::svt::OFileURLControl* m_pLocation;
FixedText m_aLocationLabel; PushButton* m_pBrowse;
::svt::OFileURLControl m_aLocation; CheckBox* m_pRegisterName;
PushButton m_aBrowse; FixedText* m_pNameLabel;
CheckBox m_aRegisterName; Edit* m_pName;
FixedText m_aNameLabel; FixedText* m_pDuplicateNameError;
Edit m_aName;
FixedText m_aDuplicateNameError; ::svx::DatabaseLocationInputController*
m_pLocationController;
::svx::DatabaseLocationInputController
m_aLocationController;
StringBag m_aInvalidDataSourceNames; StringBag m_aInvalidDataSourceNames;
public: public:
FinalPage( OAddessBookSourcePilot* _pParent ); FinalPage( OAddessBookSourcePilot* _pParent );
~FinalPage();
protected: protected:
// OWizardPage overridables // OWizardPage overridables
......
...@@ -45,10 +45,9 @@ ...@@ -45,10 +45,9 @@
// tab pages // tab pages
#define RID_PAGE_ADMININVOKATION ( RID_PAGE_START + 1 ) #define RID_PAGE_ADMININVOKATION ( RID_PAGE_START + 1 )
#define RID_PAGE_FINAL ( RID_PAGE_START + 4 )
// please adjust RID_PAGE_END (below) when adding new tab pages // please adjust RID_PAGE_END (below) when adding new tab pages
#define RID_PAGE_END RID_PAGE_FINAL #define RID_PAGE_END RID_PAGE_ADMININVOKATION
// strings // strings
...@@ -130,18 +129,8 @@ ...@@ -130,18 +129,8 @@
#define FT_ADMINEXPLANATION 3 #define FT_ADMINEXPLANATION 3
#define FT_NAME_EXPL 4 #define FT_NAME_EXPL 4
#define FT_ERROR 5 #define FT_ERROR 5
#define FT_FINISH_EXPL 9
#define FT_DUPLICATENAME 10
#define FT_LOCATION 11
#define ET_DATASOURCENAME 1
#define PB_INVOKE_ADMIN_DIALOG 1 #define PB_INVOKE_ADMIN_DIALOG 1
#define PB_BROWSE 3
#define CB_REGISTER_DS 1
#define CBB_LOCATION 1
#define STR_SELECT_ABTYPE 1 #define STR_SELECT_ABTYPE 1
#define STR_INVOKE_ADMIN_DIALOG 2 #define STR_INVOKE_ADMIN_DIALOG 2
......
...@@ -93,92 +93,6 @@ TabPage RID_PAGE_ADMININVOKATION ...@@ -93,92 +93,6 @@ TabPage RID_PAGE_ADMININVOKATION
}; };
}; };
TabPage RID_PAGE_FINAL
{
HelpID = "extensions:TabPage:RID_PAGE_FINAL";
SVLook = TRUE ;
Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ;
FixedText FT_FINISH_EXPL
{
Pos = MAP_APPFONT ( BORDER_X, 9 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - 2 * BORDER_X, 40 ) ;
WordBreak = TRUE;
Text [ en-US ] = "That was all the information necessary to integrate your address data into %PRODUCTNAME.\n\nNow, just enter the name under which you want to register the data source in %PRODUCTNAME.";
};
FixedText FT_LOCATION
{
Pos = MAP_APPFONT ( BORDER_X, 53 ) ;
Size = MAP_APPFONT ( 50, 8 ) ;
Group = TRUE;
Text [ en-US ] = "Location";
};
ComboBox CBB_LOCATION
{
HelpID = "extensions:ComboBox:RID_PAGE_FINAL:CBB_LOCATION";
Pos = MAP_APPFONT ( BORDER_X , 64 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - 53 - BORDER_X - BORDER_X, 12) ;
SVLook = TRUE;
Border = TRUE;
DropDown = TRUE ;
AutoHScroll = TRUE ;
};
PushButton PB_BROWSE
{
HelpID = "extensions:PushButton:RID_PAGE_FINAL:PB_BROWSE";
Pos = MAP_APPFONT ( WINDOW_SIZE_X - 50 - BORDER_X , 63 ) ;
Size = MAP_APPFONT ( 50, 14) ;
SVLook = TRUE;
Group = FALSE;
Text [ en-US ] = "Browse...";
};
CheckBox CB_REGISTER_DS
{
HelpID = "extensions:CheckBox:RID_PAGE_FINAL:CB_REGISTER_DS";
Pos = MAP_APPFONT ( BORDER_X, 82 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - BORDER_X - BORDER_X, 8) ;
SVLook = TRUE;
Group = TRUE;
Text [ en-US ] = "Make this address book available to all modules in %PRODUCTNAME.";
};
FixedText FT_NAME_EXPL
{
Pos = MAP_APPFONT ( BORDER_X + 10, 93 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - BORDER_X - BORDER_X - 10, 8 ) ;
Text [ en-US ] = "Address book name";
};
Edit ET_DATASOURCENAME
{
HelpID = "extensions:Edit:RID_PAGE_FINAL:ET_DATASOURCENAME";
Pos = MAP_APPFONT ( BORDER_X + 10, 104 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - 56 - BORDER_X - BORDER_X - 10, 12) ;
SVLook = TRUE;
Border = TRUE;
};
FixedText FT_DUPLICATENAME
{
Pos = MAP_APPFONT ( BORDER_X + 10, WINDOW_SIZE_Y - HEADER_SIZE_Y - 7 - 24 ) ;
Size = MAP_APPFONT ( WINDOW_SIZE_X - 2 * BORDER_X, 24) ;
WordBreak = TRUE;
Hide = TRUE;
Group = FALSE;
Text [ en-US ] = "Another data source already has this name. As data sources have to have globally unique names, you need to choose another one.";
};
};
ErrorBox RID_ERR_NEEDTYPESELECTION ErrorBox RID_ERR_NEEDTYPESELECTION
{ {
Buttons = WB_OK; Buttons = WB_OK;
......
<?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="DataSourcePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">That was all the information necessary to integrate your address data into %PRODUCTNAME.
Now, just enter the name under which you want to register the data source in %PRODUCTNAME.</property>
<property name="wrap">True</property>
<property name="max_width_chars">80</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="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkGrid" id="grid4">
<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="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Location</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="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="use_underline">True</property>
</object>
<packing>
<property name="left_attach">2</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="comboboxtext-entry">
<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="GtkCheckButton" id="available">
<property name="label" translatable="yes">Make this address book available to all modules in %PRODUCTNAME.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</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>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkGrid" id="grid6">
<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="nameft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Address book name</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="GtkEntry" id="name">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
</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="GtkLabel" id="warning">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">Another data source already has this name. As data sources have to have globally unique names, you need to choose another one.</property>
<property name="wrap">True</property>
<property name="max_width_chars">80</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>
<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>
<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>
</interface>
...@@ -19,7 +19,7 @@ For instance, you could have stored the e-mail addresses in a field named "email ...@@ -19,7 +19,7 @@ For instance, you could have stored the e-mail addresses in a field named "email
Click the button below to open another dialog where you can enter the settings for your data source.</property> Click the button below to open another dialog where you can enter the settings for your data source.</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="max_width_chars">90</property> <property name="max_width_chars">80</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -52,7 +52,7 @@ Click the button below to open another dialog where you can enter the settings f ...@@ -52,7 +52,7 @@ Click the button below to open another dialog where you can enter the settings f
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="yalign">0</property> <property name="yalign">0</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="max_width_chars">90</property> <property name="max_width_chars">80</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
This wizard helps you create the data source.</property> This wizard helps you create the data source.</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="max_width_chars">90</property> <property name="max_width_chars">80</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment