From 910638a560bb50123e0b92d560a30e9594ff0937 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 18 Apr 2014 15:04:03 +0100 Subject: convert select type address book page to .ui Change-Id: I94c0ed3385e64f854875f62c32adaa066d3b1ead --- extensions/Module_extensions.mk | 1 + extensions/UIConfig_sabpilot.mk | 16 ++ extensions/source/abpilot/abpresid.hrc | 14 -- extensions/source/abpilot/abspilot.src | 93 -------- extensions/source/abpilot/typeselectionpage.cxx | 62 ++---- extensions/source/abpilot/typeselectionpage.hxx | 24 +- extensions/uiconfig/sabpilot/ui/selecttypepage.ui | 259 ++++++++++++++++++++++ 7 files changed, 311 insertions(+), 158 deletions(-) create mode 100644 extensions/UIConfig_sabpilot.mk create mode 100644 extensions/uiconfig/sabpilot/ui/selecttypepage.ui (limited to 'extensions') diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk index 4761bbadecf4..139b8860d20c 100644 --- a/extensions/Module_extensions.mk +++ b/extensions/Module_extensions.mk @@ -21,6 +21,7 @@ $(eval $(call gb_Module_add_l10n_targets,extensions,\ AllLangResTarget_abp \ AllLangResTarget_scn \ AllLangResTarget_upd \ + UIConfig_sabpilot \ )) ifneq ($(filter-out IOS ANDROID,$(OS)),) diff --git a/extensions/UIConfig_sabpilot.mk b/extensions/UIConfig_sabpilot.mk new file mode 100644 index 000000000000..e90fc7e20fda --- /dev/null +++ b/extensions/UIConfig_sabpilot.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UIConfig_UIConfig,modules/sabpilot)) + +$(eval $(call gb_UIConfig_add_uifiles,modules/sabpilot,\ + extensions/uiconfig/sabpilot/ui/selecttypepage \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/extensions/source/abpilot/abpresid.hrc b/extensions/source/abpilot/abpresid.hrc index 402590a80737..15db79d46997 100644 --- a/extensions/source/abpilot/abpresid.hrc +++ b/extensions/source/abpilot/abpresid.hrc @@ -45,7 +45,6 @@ // tab pages -#define RID_PAGE_SELECTABTYPE ( RID_PAGE_START + 0 ) #define RID_PAGE_ADMININVOKATION ( RID_PAGE_START + 1 ) #define RID_PAGE_TABLESELECTION_AB ( RID_PAGE_START + 2 ) #define RID_PAGE_FIELDMAPPING ( RID_PAGE_START + 3 ) @@ -148,19 +147,6 @@ #define FT_LOCATION 11 -#define RB_MORK 1 -#define RB_THUNDERBIRD 2 -#define RB_EVOLUTION 3 -#define RB_KAB 4 -#define RB_MACAB 5 -#define RB_LDAP 6 -#define RB_OUTLOOK 7 -#define RB_OUTLOOKEXPRESS 8 -#define RB_OTHER 9 -#define RB_EVOLUTION_GROUPWISE 10 -#define RB_EVOLUTION_LDAP 11 - - #define ET_DATASOURCENAME 1 diff --git a/extensions/source/abpilot/abspilot.src b/extensions/source/abpilot/abspilot.src index f898724155a8..7531f122f852 100644 --- a/extensions/source/abpilot/abspilot.src +++ b/extensions/source/abpilot/abspilot.src @@ -58,99 +58,6 @@ ModalDialog RID_DLG_ADDRESSBOOKSOURCEPILOT }; }; - -TabPage RID_PAGE_SELECTABTYPE -{ - HelpID = "extensions:TabPage:RID_PAGE_SELECTABTYPE"; - SVLook = TRUE ; - Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; - - FixedText FT_TYPE_HINTS - { - Pos = MAP_APPFONT ( BORDER_X, 9 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 2 * BORDER_X, 40 ) ; - WordBreak = TRUE; - - Text [ en-US ] = "%PRODUCTNAME lets you access address data already present in your system. To do this, a %PRODUCTNAME data source will be created in which your address data is available in tabular form.\n\nThis wizard helps you create the data source."; - }; - - FixedLine FL_TYPE - { - Pos = MAP_APPFONT ( 7, 56 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 8 ) ; - - Text [ en-US ] = "Please select the type of your external address book:"; - }; - - RadioButton RB_EVOLUTION - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_EVOLUTION"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Evolution"; - }; - RadioButton RB_EVOLUTION_GROUPWISE - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_EVOLUTION_GROUPWISE"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Groupwise"; - }; - RadioButton RB_EVOLUTION_LDAP - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_EVOLUTION_LDAP"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Evolution LDAP"; - }; - RadioButton RB_MORK - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_MORK"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Mozilla / Netscape"; - }; - RadioButton RB_THUNDERBIRD - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_THUNDERBIRD"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Thunderbird/Icedove"; - }; - RadioButton RB_KAB - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_KAB"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "KDE address book"; - }; - RadioButton RB_MACAB - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_MACAB"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Mac OS X address book"; - }; - RadioButton RB_LDAP - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_LDAP"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "LDAP address data"; - }; - RadioButton RB_OUTLOOK - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_OUTLOOK"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Outlook address book"; - }; - RadioButton RB_OUTLOOKEXPRESS - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_OUTLOOKEXPRESS"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Windows system address book"; - }; - RadioButton RB_OTHER - { - HelpID = "extensions:RadioButton:RID_PAGE_SELECTABTYPE:RB_OTHER"; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 30, 8 ) ; - Text [ en-US ] = "Other external data source"; - }; -}; - - TabPage RID_PAGE_ADMININVOKATION { HelpID = "extensions:TabPage:RID_PAGE_ADMININVOKATION"; diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 0903175ee403..a2615d81f0d6 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -32,26 +32,20 @@ namespace abp // TypeSelectionPage TypeSelectionPage::TypeSelectionPage( OAddessBookSourcePilot* _pParent ) - :AddressBookSourcePage(_pParent, ModuleRes(RID_PAGE_SELECTABTYPE)) - ,m_aHint (this, ModuleRes(FT_TYPE_HINTS)) - ,m_aTypeSep (this, ModuleRes(FL_TYPE)) - ,m_aEvolution (this, ModuleRes(RB_EVOLUTION)) - ,m_aEvolutionGroupwise (this, ModuleRes(RB_EVOLUTION_GROUPWISE)) - ,m_aEvolutionLdap (this, ModuleRes(RB_EVOLUTION_LDAP)) - ,m_aMORK (this, ModuleRes(RB_MORK)) - ,m_aThunderbird (this, ModuleRes(RB_THUNDERBIRD)) - ,m_aKab (this, ModuleRes(RB_KAB)) - ,m_aMacab (this, ModuleRes(RB_MACAB)) - ,m_aLDAP (this, ModuleRes(RB_LDAP)) - ,m_aOutlook (this, ModuleRes(RB_OUTLOOK)) - ,m_aOE (this, ModuleRes(RB_OUTLOOKEXPRESS)) - ,m_aOther (this, ModuleRes(RB_OTHER)) + : AddressBookSourcePage(_pParent, "SelectTypePage", + "modules/sabpilot/ui/selecttypepage.ui") { - FreeResource(); - - Point aTopLeft( LogicToPixel( Point( 15, 68 ), MAP_APPFONT ) ); - Size aItemSize( LogicToPixel( Size( 0, 8 ), MAP_APPFONT ) ); - aItemSize.Width() = GetOutputSizePixel().Width() - 30; + get(m_pEvolution, "evolution"); + get(m_pEvolutionGroupwise, "groupwise"); + get(m_pEvolutionLdap, "evoldap"); + get(m_pMORK, "firefox"); + get(m_pThunderbird, "thunderbird"); + get(m_pKab, "kde"); + get(m_pMacab, "macosx"); + get(m_pLDAP, "ldap"); + get(m_pOutlook, "outlook"); + get(m_pOE, "windows"); + get(m_pOther, "other"); //TODO: For now, try to keep offering the same choices like before the // Mozilla/MORK cleanup, even if the status of what driver actually @@ -127,25 +121,19 @@ namespace abp #endif // Items are displayed in list order - m_aAllTypes.push_back( ButtonItem( &m_aEvolution, AST_EVOLUTION, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( &m_aEvolutionGroupwise, AST_EVOLUTION_GROUPWISE, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( &m_aEvolutionLdap, AST_EVOLUTION_LDAP, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( &m_aMORK, AST_MORK, bWithMozilla || bWithMork) ); - m_aAllTypes.push_back( ButtonItem( &m_aThunderbird, AST_THUNDERBIRD, bWithMozilla || bWithMork) ); - m_aAllTypes.push_back( ButtonItem( &m_aKab, AST_KAB, bHaveKab ) ); - m_aAllTypes.push_back( ButtonItem( &m_aMacab, AST_MACAB, bHaveMacab ) ); - m_aAllTypes.push_back( ButtonItem( &m_aLDAP, AST_LDAP, bWithMozilla ) ); - m_aAllTypes.push_back( ButtonItem( &m_aOutlook, AST_OUTLOOK, bWithMozilla ) ); - m_aAllTypes.push_back( ButtonItem( &m_aOE, AST_OE, bWithMozilla ) ); - m_aAllTypes.push_back( ButtonItem( &m_aOther, AST_OTHER, true ) ); + m_aAllTypes.push_back( ButtonItem( m_pEvolution, AST_EVOLUTION, bHaveEvolution ) ); + m_aAllTypes.push_back( ButtonItem( m_pEvolutionGroupwise, AST_EVOLUTION_GROUPWISE, bHaveEvolution ) ); + m_aAllTypes.push_back( ButtonItem( m_pEvolutionLdap, AST_EVOLUTION_LDAP, bHaveEvolution ) ); + m_aAllTypes.push_back( ButtonItem( m_pMORK, AST_MORK, bWithMozilla || bWithMork) ); + m_aAllTypes.push_back( ButtonItem( m_pThunderbird, AST_THUNDERBIRD, bWithMozilla || bWithMork) ); + m_aAllTypes.push_back( ButtonItem( m_pKab, AST_KAB, bHaveKab ) ); + m_aAllTypes.push_back( ButtonItem( m_pMacab, AST_MACAB, bHaveMacab ) ); + m_aAllTypes.push_back( ButtonItem( m_pLDAP, AST_LDAP, bWithMozilla ) ); + m_aAllTypes.push_back( ButtonItem( m_pOutlook, AST_OUTLOOK, bWithMozilla ) ); + m_aAllTypes.push_back( ButtonItem( m_pOE, AST_OE, bWithMozilla ) ); + m_aAllTypes.push_back( ButtonItem( m_pOther, AST_OTHER, true ) ); Link aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected ); - const Size aSpacing( LogicToPixel( Size( 0, 3 ), MAP_APPFONT ) ); - if ( ! m_aAllTypes.empty() ) - { - ButtonItem aItem = m_aAllTypes[0]; - aItem.m_pItem->SetStyle( aItem.m_pItem->GetStyle() | WB_GROUP ); - } for ( ::std::vector< ButtonItem >::const_iterator loop = m_aAllTypes.begin(); loop != m_aAllTypes.end(); ++loop ) { @@ -154,8 +142,6 @@ namespace abp aItem.m_pItem->Hide(); else { - aItem.m_pItem->SetPosPixel( aTopLeft ); - aTopLeft.Y() += aItemSize.Height() + aSpacing.Height(); aItem.m_pItem->SetClickHdl( aTypeSelectionHandler ); aItem.m_pItem->Show(); } diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx index 56249f9af46f..2e4437e285f8 100644 --- a/extensions/source/abpilot/typeselectionpage.hxx +++ b/extensions/source/abpilot/typeselectionpage.hxx @@ -35,19 +35,17 @@ namespace abp class TypeSelectionPage : public AddressBookSourcePage { protected: - FixedText m_aHint; - FixedLine m_aTypeSep; - RadioButton m_aEvolution; - RadioButton m_aEvolutionGroupwise; - RadioButton m_aEvolutionLdap; - RadioButton m_aMORK; - RadioButton m_aThunderbird; - RadioButton m_aKab; - RadioButton m_aMacab; - RadioButton m_aLDAP; - RadioButton m_aOutlook; - RadioButton m_aOE; - RadioButton m_aOther; + RadioButton* m_pEvolution; + RadioButton* m_pEvolutionGroupwise; + RadioButton* m_pEvolutionLdap; + RadioButton* m_pMORK; + RadioButton* m_pThunderbird; + RadioButton* m_pKab; + RadioButton* m_pMacab; + RadioButton* m_pLDAP; + RadioButton* m_pOutlook; + RadioButton* m_pOE; + RadioButton* m_pOther; struct ButtonItem { RadioButton *m_pItem; diff --git a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui new file mode 100644 index 000000000000..5cbe221e3afd --- /dev/null +++ b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui @@ -0,0 +1,259 @@ + + + + + + True + False + 6 + 12 + + + True + False + True + 6 + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + + + Evolution + True + True + False + 0 + True + True + groupwise + + + 0 + 0 + 1 + 1 + + + + + Groupwise + True + True + False + 0 + True + evoldap + + + 0 + 1 + 1 + 1 + + + + + Evolution LDAP + True + True + False + 0 + True + firefox + + + 0 + 2 + 1 + 1 + + + + + Firefox/Iceweasel + True + True + False + 0 + True + thunderbird + + + 0 + 3 + 1 + 1 + + + + + Thunderbird/Icedove + True + True + False + 0 + True + kde + + + 0 + 4 + 1 + 1 + + + + + KDE address book + True + True + False + 0 + True + macosx + + + 0 + 5 + 1 + 1 + + + + + Mac OS X address book + True + True + False + 0 + True + ldap + + + 0 + 6 + 1 + 1 + + + + + LDAP address data + True + True + False + 0 + True + outlook + + + 0 + 7 + 1 + 1 + + + + + Outlook address book + True + True + False + 0 + True + windows + + + 0 + 8 + 1 + 1 + + + + + Windows system address book + True + True + False + 0 + True + other + + + 0 + 9 + 1 + 1 + + + + + Other external data source + True + True + False + 0 + True + evolution + + + 0 + 10 + 1 + 1 + + + + + + + + + True + False + Please select the type of your external address book + + + + + + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + 0 + %PRODUCTNAME lets you access address data already present in your system. To do this, a %PRODUCTNAME data source will be created in which your address data is available in tabular form. + +This wizard helps you create the data source. + True + 100 + + + 0 + 0 + 1 + 1 + + + + -- cgit