diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-06 17:18:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-06 17:19:17 +0000 |
commit | 9fa72ccc425dbfea695c879020f0d5462d07d753 (patch) | |
tree | a803f269d59c6c9f0af6eca6600dc49c661d4ff8 /sfx2 | |
parent | f06ba36094680e8806a6ede65a851c672bab1b67 (diff) |
convert Printer Options dialog to .ui
Change-Id: Ie9f5823170c58f785328e41edcfa1ad70a949529
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/UI_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/prnmon.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/printer.cxx | 50 | ||||
-rw-r--r-- | sfx2/source/view/view.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/view/view.src | 4 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/printeroptionsdialog.ui | 85 |
6 files changed, 97 insertions, 48 deletions
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk index c164884df217..a6e2223c47fc 100644 --- a/sfx2/UI_sfx.mk +++ b/sfx2/UI_sfx.mk @@ -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: diff --git a/sfx2/inc/sfx2/prnmon.hxx b/sfx2/inc/sfx2/prnmon.hxx index 564f8b235ee8..0d14c616a7bc 100644 --- a/sfx2/inc/sfx2/prnmon.hxx +++ b/sfx2/inc/sfx2/prnmon.hxx @@ -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; diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 1716dcb1652a..efdcd6aa3b77 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -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: */ diff --git a/sfx2/source/view/view.hrc b/sfx2/source/view/view.hrc index 02132e1198c8..c7df0cc5394d 100644 --- a/sfx2/source/view/view.hrc +++ b/sfx2/source/view/view.hrc @@ -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) diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src index cc2ebbb13143..e60aee0e905e 100644 --- a/sfx2/source/view/view.src +++ b/sfx2/source/view/view.src @@ -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" ; diff --git a/sfx2/uiconfig/ui/printeroptionsdialog.ui b/sfx2/uiconfig/ui/printeroptionsdialog.ui new file mode 100644 index 000000000000..c12aee53d472 --- /dev/null +++ b/sfx2/uiconfig/ui/printeroptionsdialog.ui @@ -0,0 +1,85 @@ +<?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> |