diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-18 15:04:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-20 21:51:01 +0100 |
commit | 910638a560bb50123e0b92d560a30e9594ff0937 (patch) | |
tree | 77a73231ba806f076e9e09a8e54f0a4a17ebaf56 /extensions | |
parent | 00d001c6d2c9e8f092b0a5b4b9d8f9c47f34d3db (diff) |
convert select type address book page to .ui
Change-Id: I94c0ed3385e64f854875f62c32adaa066d3b1ead
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/Module_extensions.mk | 1 | ||||
-rw-r--r-- | extensions/UIConfig_sabpilot.mk | 16 | ||||
-rw-r--r-- | extensions/source/abpilot/abpresid.hrc | 14 | ||||
-rw-r--r-- | extensions/source/abpilot/abspilot.src | 93 | ||||
-rw-r--r-- | extensions/source/abpilot/typeselectionpage.cxx | 62 | ||||
-rw-r--r-- | extensions/source/abpilot/typeselectionpage.hxx | 24 | ||||
-rw-r--r-- | extensions/uiconfig/sabpilot/ui/selecttypepage.ui | 259 |
7 files changed, 311 insertions, 158 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkGrid" id="SelectTypePage"> + <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="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="border_width">6</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <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="GtkRadioButton" id="evolution"> + <property name="label" translatable="yes">Evolution</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="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">groupwise</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="GtkRadioButton" id="groupwise"> + <property name="label" translatable="yes">Groupwise</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> + <property name="group">evoldap</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="GtkRadioButton" id="evoldap"> + <property name="label" translatable="yes">Evolution LDAP</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> + <property name="group">firefox</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="GtkRadioButton" id="firefox"> + <property name="label" translatable="yes">Firefox/Iceweasel</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> + <property name="group">thunderbird</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="GtkRadioButton" id="thunderbird"> + <property name="label" translatable="yes">Thunderbird/Icedove</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> + <property name="group">kde</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="kde"> + <property name="label" translatable="yes">KDE address book</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> + <property name="group">macosx</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="macosx"> + <property name="label" translatable="yes">Mac OS X address book</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> + <property name="group">ldap</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="ldap"> + <property name="label" translatable="yes">LDAP address data</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> + <property name="group">outlook</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="outlook"> + <property name="label" translatable="yes">Outlook address book</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> + <property name="group">windows</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">8</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="windows"> + <property name="label" translatable="yes">Windows system address book</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> + <property name="group">other</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">9</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="other"> + <property name="label" translatable="yes">Other external data source</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> + <property name="group">evolution</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">10</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Please select the type of your external address book</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </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> + <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">%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.</property> + <property name="wrap">True</property> + <property name="max_width_chars">100</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> + </object> +</interface> |