Kaydet (Commit) 9fa72ccc authored tarafından Caolán McNamara's avatar Caolán McNamara

convert Printer Options dialog to .ui

Change-Id: Ie9f5823170c58f785328e41edcfa1ad70a949529
üst f06ba360
......@@ -12,6 +12,7 @@ $(eval $(call gb_UI_UI,sfx))
$(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/checkin \
sfx2/uiconfig/ui/password \
sfx2/uiconfig/ui/printeroptionsdialog \
))
# vim: set noet sw=4 ts=4:
......@@ -35,9 +35,6 @@ struct SfxPrintOptDlg_Impl;
class SfxPrintOptionsDialog : public ModalDialog
{
private:
OKButton aOkBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
SfxPrintOptDlg_Impl* pDlgImpl;
SfxViewShell* pViewSh;
SfxItemSet* pOptions;
......
......@@ -198,25 +198,20 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions )
//--------------------------------------------------------------------
SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent,
SfxPrintOptionsDialog::SfxPrintOptionsDialog(Window *pParent,
SfxViewShell *pViewShell,
const SfxItemSet *pSet ) :
ModalDialog( pParent, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
aOkBtn ( this ),
aCancelBtn ( this ),
aHelpBtn ( this ),
pDlgImpl ( new SfxPrintOptDlg_Impl ),
pViewSh ( pViewShell ),
pOptions ( pSet->Clone() ),
pPage ( NULL )
const SfxItemSet *pSet)
: ModalDialog(pParent, "PrinterOptionsDialog",
"sfx/ui/printeroptionsdialog.ui")
, pDlgImpl(new SfxPrintOptDlg_Impl)
, pViewSh(pViewShell)
, pOptions(pSet->Clone())
{
SetText( SfxResId(STR_PRINT_OPTIONS_TITLE).toString() );
VclContainer *pVBox = m_pUIBuilder->get<VclVBox>("dialog-vbox1");
// Insert TabPage
pPage = pViewSh->CreatePrintOptionsPage( this, *pOptions );
pPage = pViewSh->CreatePrintOptionsPage(pVBox, *pOptions);
DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
if( pPage )
{
......@@ -224,31 +219,6 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent,
SetHelpId( pPage->GetHelpId() );
pPage->Show();
}
// Set dialog size
Size a6Sz = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
Size aBtnSz = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
Size aOutSz( pPage ? pPage->GetSizePixel() : Size() );
aOutSz.Height() += 6;
long nWidth = aBtnSz.Width();
nWidth += a6Sz.Width();
aOutSz.Width() += nWidth;
if ( aOutSz.Height() < 90 )
// at least the height of the 3 buttons
aOutSz.Height() = 90;
SetOutputSizePixel( aOutSz );
// set position and size of the buttons
Point aBtnPos( aOutSz.Width() - aBtnSz.Width() - a6Sz.Width(), a6Sz.Height() );
aOkBtn.SetPosSizePixel( aBtnPos, aBtnSz );
aBtnPos.Y() += aBtnSz.Height() + ( a6Sz.Height() / 2 );
aCancelBtn.SetPosSizePixel( aBtnPos, aBtnSz );
aBtnPos.Y() += aBtnSz.Height() + a6Sz.Height();
aHelpBtn.SetPosSizePixel( aBtnPos, aBtnSz );
aCancelBtn.Show();
aOkBtn.Show();
aHelpBtn.Show();
}
//--------------------------------------------------------------------
......@@ -294,7 +264,7 @@ void SfxPrintOptionsDialog::DisableHelp()
{
pDlgImpl->mbHelpDisabled = sal_True;
aHelpBtn.Disable();
get<HelpButton>("help")->Disable();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -27,7 +27,7 @@
#define STR_PRINT_OPTIONS (RID_SFX_VIEW_START+ 6)
#define STR_PRINT_OPTIONS_TITLE (RID_SFX_VIEW_START+ 7)
#define STR_ERROR_PRINTER_BUSY (RID_SFX_VIEW_START+ 8)
#define STR_NOSTARTPRINTER (RID_SFX_VIEW_START+ 9)
#define STR_PRINTING (RID_SFX_VIEW_START+10)
......
......@@ -38,10 +38,6 @@ String STR_PRINT_OPTIONS
{
Text [ en-US ] = "Options..." ;
};
String STR_PRINT_OPTIONS_TITLE
{
Text [ en-US ] = "Printer Options" ;
};
String STR_ERROR_PRINTER_BUSY
{
Text [ en-US ] = "Printer busy" ;
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="PrinterOptionsDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Printer Options</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">2</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">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">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="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</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="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</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>
</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>
<placeholder/>
</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-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