Kaydet (Commit) 7b763893 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert label dialog to .ui

Change-Id: I77ce740b1ca7178d8c5f5f2d4ce55920cf18a85b
üst 1fd4b34a
......@@ -197,6 +197,11 @@ public:
{
return m_pTabCtrl->GetCurPageId();
}
OUString GetPageText( sal_uInt16 nPageId ) const
{
return m_pTabCtrl->GetPageText(nPageId);
}
void ShowPage( sal_uInt16 nId );
// may provide local slots converted by Map
......
......@@ -105,6 +105,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/insertsectiondialog \
sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/labeldialog \
sw/uiconfig/swriter/ui/labelformatpage \
sw/uiconfig/swriter/ui/labeloptionspage \
sw/uiconfig/swriter/ui/linenumbering \
......
......@@ -33,10 +33,6 @@
#define TP_ENV_FMT (RC_ENVELP_BEGIN + 3)
#define TP_ENV_PRT (RC_ENVELP_BEGIN + 4)
#define TP_LAB_LAB (RC_ENVELP_BEGIN + 5)
#define TP_LAB_FMT (RC_ENVELP_BEGIN + 6)
#define TP_LAB_PRT (RC_ENVELP_BEGIN + 7)
#define DLG_MAILMERGE (RC_ENVELP_BEGIN + 8)
#define DLG_SYNC_BTN (RC_ENVELP_BEGIN + 9)
......@@ -58,9 +54,6 @@
#define RC_LABFMT_BEGIN (RC_ENVELP_BEGIN + 50)
#define RC_LABFMT_END (RC_ENVELP_BEGIN + 62)
// RC_LABPRT_BEGIN (RC_ENVELP_BEGIN + 63)
#define RC_LABPRT_END (RC_ENVELP_BEGIN + 72)
// Strings --------------------------------------------------------------------
#define STR_DATABASE_NOT_OPENED (RC_ENVLOP_BEGIN + 63)
......@@ -68,7 +61,6 @@
#define DLG_MERGE_FIELD_CONNECTIONS (RC_ENVLOP_BEGIN + 66)
#define STR_BTN_NEW_DOC (RC_ENVLOP_BEGIN + 67)
#define STR_BTN_NEWDOC (RC_ENVLOP_BEGIN + 68)
#define STR_SENDER_TOKENS (RC_ENVLOP_BEGIN + 69)
// Ueberlaufpruefung ----------------------------------------------------------
......
......@@ -176,10 +176,7 @@
#define TP_TOX_SELECT (RC_GLOBALS_BEGIN + 90)
#define TP_TOX_ENTRY (RC_GLOBALS_BEGIN + 91)
#define TP_TOX_STYLES (RC_GLOBALS_BEGIN + 92)
#define TP_VISITING_CARDS (RC_GLOBALS_BEGIN + 93)
#define DLG_ADD_IDX_STYLES (RC_GLOBALS_BEGIN + 94)
#define TP_PRIVATE_DATA (RC_GLOBALS_BEGIN + 95)
#define TP_BUSINESS_DATA (RC_GLOBALS_BEGIN + 96)
#define TP_OPTCOMPATIBILITY_PAGE (RC_GLOBALS_BEGIN + 103)
#define TP_MAILCONFIG (RC_GLOBALS_BEGIN + 104)
//maximum: RC_GLOBALS_BEGIN + 120
......
......@@ -330,7 +330,6 @@
#define HID_DRAW_TEXT_TOOLBOX "SW_HID_DRAW_TEXT_TOOLBOX"
#define HID_NUM_TOOLBOX "SW_HID_NUM_TOOLBOX"
#define HID_LABEL_INSERT "SW_HID_LABEL_INSERT"
#define HID_CALC_TOOLBOX "SW_HID_CALC_TOOLBOX"
#define HID_PVIEW_TOOLBOX "SW_HID_PVIEW_TOOLBOX"
......
......@@ -247,7 +247,7 @@ public:
class AbstractSwLabDlg : public SfxAbstractTabDialog //add for SwLabDlg
{
public:
virtual const String& GetBusinessCardStr() const = 0;
virtual const OUString& GetBusinessCardStr() const = 0;
virtual Printer *GetPrt() =0;
};
......@@ -356,8 +356,8 @@ public:
virtual SfxAbstractTabDialog* CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ) = 0; //add for SwEnvDlg
virtual AbstractSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId ) = 0;
virtual AbstractSwLabDlg* CreateSwLabDlg(Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, bool bLabel) = 0;
virtual SwLabDlgMethod GetSwLabDlgStaticMethod () =0;//add for SwLabDlg
......
......@@ -168,7 +168,7 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create();
OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!");
AbstractSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg( 0, aSet, pNewDBMgr, bLabel, DLG_LAB );
AbstractSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg(0, aSet, pNewDBMgr, bLabel);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( RET_OK == pDlg->Execute() )
......
......@@ -282,7 +282,7 @@ OUString AbstractSwLabDlg_Impl::GetText() const
return pDlg->GetText();
}
const String& AbstractSwLabDlg_Impl::GetBusinessCardStr() const
const OUString& AbstractSwLabDlg_Impl::GetBusinessCardStr() const
{
return pDlg->GetBusinessCardStr();
}
......@@ -791,23 +791,11 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pPa
return 0;
}
AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId )
AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg(Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, bool bLabel)
{
SwLabDlg* pDlg=NULL;
switch ( nResId )
{
case DLG_LAB :
pDlg = new SwLabDlg( pParent, rSet, pNewDBMgr,bLabel );
break;
default:
break;
}
if ( pDlg )
return new AbstractSwLabDlg_Impl( pDlg );
return 0;
SwLabDlg* pDlg = new SwLabDlg(pParent, rSet, pNewDBMgr, bLabel);
return new AbstractSwLabDlg_Impl(pDlg);
}
SwLabDlgMethod SwAbstractDialogFactory_Impl::GetSwLabDlgStaticMethod ()
......@@ -815,7 +803,6 @@ SwLabDlgMethod SwAbstractDialogFactory_Impl::GetSwLabDlgStaticMethod ()
return SwLabDlg::UpdateFieldInformation;
}
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pParent, SwView& rVw,
const SfxItemSet& rCoreSet ,
sal_uInt8 nDialogMode,
......
......@@ -197,8 +197,8 @@ class AbstractSwLabDlg_Impl : public AbstractSwLabDlg
//From class Window.
virtual void SetText( const OUString& rStr );
virtual OUString GetText() const;
virtual const String& GetBusinessCardStr() const;
virtual Printer *GetPrt();
virtual const OUString& GetBusinessCardStr() const;
virtual Printer *GetPrt();
};
//add for SwLabDlg end
......@@ -458,8 +458,8 @@ public:
virtual AbstractDropDownFieldDialog * CreateDropDownFieldDialog (Window *pParent, SwWrtShell &rSh,
SwField* pField, sal_Bool bNextButton = sal_False);
virtual SfxAbstractTabDialog* CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ); //add for SwEnvDlg
virtual AbstractSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId );
virtual AbstractSwLabDlg* CreateSwLabDlg(Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, bool bLabel);
virtual SwLabDlgMethod GetSwLabDlgStaticMethod (); //add for SwLabDlg
virtual SfxAbstractTabDialog* CreateSwParaDlg ( Window *pParent, //add for SwParaDlg
......
......@@ -28,10 +28,6 @@ String STR_NO_DRIVERS
{
Text [ en-US ] = "No database drivers installed." ;
};
String STR_BTN_NEW_DOC
{
Text [ en-US ] = "~New Document" ;
};
String STR_BTN_NEWDOC
{
......
......@@ -38,17 +38,6 @@
#define WIN_PREVIEW 12
#define ST_INSERT 13
#define ST_CHANGE 14
// global resources ********************************************************
#define STR_DOC_TITLE (RC_ENVLOP_BEGIN)
// overflow check ********************************************************
#define ENVLOP_ACT_END STR_DOC_TITLE
#if ENVLOP_ACT_END > RC_ENVLOP_END
#error Resource-Ueberlauf in #file, #line
#endif
#endif
......
......@@ -166,10 +166,5 @@ TabPage TP_ENV_ENV
Size = MAP_APPFONT ( 84 , 63 ) ;
};
};
// Strings ******************************************************************
String STR_DOC_TITLE
{
Text [ en-US ] = "Envelope" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -26,12 +26,7 @@
#define BTN_SYNC 20
#define ST_BUSINESSCARDDLG 62
#define ST_FIRSTPAGE_LAB 63
#define ST_FIRSTPAGE_BC 64
// global resources ********************************************************
#define STR_DOC_TITLE (RC_LABEL_BEGIN)
#define STR_CUSTOM (RC_LABEL_BEGIN + 1)
// overflow check ********************************************************
......
......@@ -20,70 +20,6 @@
#include "label.hrc"
#include "globals.hrc"
#include "helpid.h"
// ----- defined strings -----------------------------------------------------
#define LABEL_STRING \
Text [ en-US ] = "Labels" ; \
#define BUSINESS_CARD_STRING \
Text [ en-US ] = "Business Cards"; \
// DLG_LAB ------------------------------------------------------------------
TabDialog DLG_LAB
{
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
LABEL_STRING
TabControl 1
{
OutputSize = TRUE ;
PageList =
{
PageItem
{
Identifier = TP_VISITING_CARDS;
PageResID = TP_VISITING_CARDS;
BUSINESS_CARD_STRING
};
PageItem
{
Identifier = TP_PRIVATE_DATA;
PageResID = TP_PRIVATE_DATA;
Text [ en-US ] = "Private";
};
PageItem
{
Identifier = TP_BUSINESS_DATA;
PageResID = TP_BUSINESS_DATA;
Text [ en-US ] = "Business";
};
PageItem
{
Identifier = TP_LAB_FMT ;
PageResID = TP_LAB_FMT ;
Text [ en-US ] = "Format" ;
};
PageItem
{
Identifier = TP_LAB_PRT ;
PageResID = TP_LAB_PRT ;
Text [ en-US ] = "Options" ;
};
};
};
String ST_BUSINESSCARDDLG
{
BUSINESS_CARD_STRING
};
String ST_FIRSTPAGE_LAB
{
LABEL_STRING
};
String ST_FIRSTPAGE_BC
{
Text [ en-US ] = "Medium";
};
};
#define WIDTH 100
#define HEIGHT 16
......@@ -105,11 +41,6 @@ FloatingWindow DLG_SYNC_BTN
Size = MAP_APPFONT ( WIDTH - 1 , HEIGHT - 1 ) ;
Text [ en-US ] = "Synchronize Labels" ;
};
};
// String *******************************************************************
String STR_DOC_TITLE
{
Text [ en-US ] = "Labels" ;
};
String STR_CUSTOM
{
......
......@@ -78,7 +78,7 @@ void SwLabDlg::_ReplaceGroup( const String &rMake )
void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
if (nId == TP_LAB_LAB)
if (nId == m_nLabelId)
{
if(m_bLabel)
{
......@@ -88,47 +88,49 @@ void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
else
((SwLabPage*)&rPage)->SetToBusinessCard();
}
else if (nId == TP_LAB_PRT)
else if (nId == m_nOptionsId)
pPrtPage = (SwLabPrtPage*)&rPage;
}
SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
SwNewDBMgr* pDBMgr, sal_Bool bLabel) :
SfxTabDialog( pParent, SW_RES(DLG_LAB), &rSet, sal_False ),
pNewDBMgr(pDBMgr),
pPrtPage(0),
aTypeIds( 50, 10 ),
pRecs ( new SwLabRecs() ),
sBusinessCardDlg(SW_RES(ST_BUSINESSCARDDLG)),
sFormat(SW_RES(ST_FIRSTPAGE_LAB)),
sMedium(SW_RES(ST_FIRSTPAGE_BC)),
m_bLabel(bLabel)
SwNewDBMgr* pDBMgr, sal_Bool bLabel)
: SfxTabDialog(pParent, "LabelDialog",
"modules/swriter/ui/labeldialog.ui", &rSet, false)
, pNewDBMgr(pDBMgr)
, pPrtPage(0)
, aTypeIds(50, 10)
, pRecs(new SwLabRecs())
, m_bLabel(bLabel)
, m_nFormatId(0)
, m_nOptionsId(0)
, m_nLabelId(0)
, m_nCardsId(0)
, m_nBusinessId(0)
, m_nPrivateId(0)
{
WaitObject aWait( pParent );
FreeResource();
m_nFormatId = AddTabPage("format", SwLabFmtPage::Create, 0);
m_nOptionsId = AddTabPage("options", SwLabPrtPage::Create, 0);
m_nCardsId = AddTabPage("cards", SwVisitingCardPage::Create, 0);
m_sBusinessCardDlg = GetPageText(m_nCardsId);
GetOKButton().SetText(String(SW_RES(STR_BTN_NEW_DOC)));
GetOKButton().SetHelpId(HID_LABEL_INSERT);
GetOKButton().SetHelpText(aEmptyStr); // in order for generated help text to get used
AddTabPage(TP_LAB_LAB, m_bLabel ? sFormat : sMedium ,SwLabPage ::Create, 0, sal_False, 0);
AddTabPage(TP_VISITING_CARDS, SwVisitingCardPage::Create, 0);
AddTabPage(TP_LAB_FMT, SwLabFmtPage::Create, 0);
AddTabPage(TP_LAB_PRT, SwLabPrtPage::Create, 0);
AddTabPage(TP_BUSINESS_DATA, SwBusinessDataPage::Create, 0 );
AddTabPage(TP_PRIVATE_DATA, SwPrivateDataPage::Create, 0);
if(m_bLabel)
if (m_bLabel)
{
RemoveTabPage(TP_BUSINESS_DATA);
RemoveTabPage(TP_PRIVATE_DATA);
RemoveTabPage(TP_VISITING_CARDS);
RemoveTabPage("business");
RemoveTabPage("private");
RemoveTabPage("cards");
RemoveTabPage("medium");
m_nLabelId = AddTabPage("labels", SwLabPage::Create, 0);
}
else
{
SetText(sBusinessCardDlg);
RemoveTabPage("labels");
RemoveTabPage("cards");
m_nLabelId = AddTabPage("medium", SwLabPage::Create, 0);
m_nBusinessId = AddTabPage("business", SwBusinessDataPage::Create, 0 );
m_nPrivateId = AddTabPage("private", SwPrivateDataPage::Create, 0);
SetText(m_sBusinessCardDlg);
}
// Read user label from writer.cfg
SwLabItem aItem((const SwLabItem&)rSet.Get( FN_LABEL ));
......
......@@ -40,12 +40,16 @@ class SwLabDlg : public SfxTabDialog
std::vector<sal_uInt16> aTypeIds;
std::vector<OUString> aMakes;
SwLabRecs* pRecs;
String aLstGroup;
String sBusinessCardDlg;
String sFormat;
String sMedium;
sal_Bool m_bLabel;
SwLabRecs* pRecs;
String aLstGroup;
OUString m_sBusinessCardDlg;
bool m_bLabel;
sal_uInt16 m_nFormatId;
sal_uInt16 m_nOptionsId;
sal_uInt16 m_nLabelId;
sal_uInt16 m_nCardsId;
sal_uInt16 m_nBusinessId;
sal_uInt16 m_nPrivateId;
void _ReplaceGroup( const String &rMake );
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
......@@ -72,7 +76,7 @@ public:
void UpdateGroup( const String &rMake ) {_ReplaceGroup( rMake );}
static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
const SwLabItem& rItem);
const String& GetBusinessCardStr() const {return sBusinessCardDlg;}
const OUString& GetBusinessCardStr() const {return m_sBusinessCardDlg;}
SwLabelConfig& GetLabelsConfig() {return aLabelsCfg;}
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="LabelDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Labels</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">_New Document</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="medium">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Medium</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="labels">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Labels</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="cards">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Business Cards</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="private">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Private</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="business">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Business</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="format">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Format</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="options">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Options</property>
</object>
<packing>
<property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets>
</object>
</interface>
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