summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-10 16:59:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:44 +0100
commit87b5cdd5ed13f5d05fe90b11b01e3832e5725b72 (patch)
tree3ce67b9dd7f1c9378a09b0d55bafb8d416f7d894 /sc
parent644cb58ac6ea53abab37c61e49d047eab0a1735c (diff)
convert writer, draw, impress, calc and starmath printer dialogs
to new-style widget layout mostly described in .ui format Change-Id: I8ead53a246a8ac3e2d446d158f06d7e2e436ce60
Diffstat (limited to 'sc')
-rw-r--r--sc/Module_sc.mk1
-rw-r--r--sc/UI_scalc.mk16
-rw-r--r--sc/source/ui/unoobj/docuno.cxx66
-rw-r--r--sc/uiconfig/scalc/ui/printeroptions.ui51
4 files changed, 104 insertions, 30 deletions
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index a7f7c15c8aee..649a6fca0b4f 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Module_add_targets,sc,\
Library_scfilt \
Library_scui \
Package_uiconfig \
+ UI_scalc \
))
ifneq ($(DISABLE_SCRIPTING),TRUE)
diff --git a/sc/UI_scalc.mk b/sc/UI_scalc.mk
new file mode 100644
index 000000000000..c2b21a951855
--- /dev/null
+++ b/sc/UI_scalc.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_UI_UI,modules/scalc))
+
+$(eval $(call gb_UI_add_uifiles,modules/scalc,\
+ sw/uiconfig/scalc/ui/printeroptions \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 51e50ed51386..9d5964236895 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -231,62 +231,69 @@ ScPrintUIOptions::ScPrintUIOptions()
if( aStrings.Count() < 10 ) // bad resource ?
return;
- m_aUIProperties.realloc( 8 );
+ sal_Int32 nNumProps= 9, nIdx = 0;
+
+ m_aUIProperties.realloc(nNumProps);
+
+ // load the writer PrinterOptions into the custom tab
+ m_aUIProperties[nIdx].Name = rtl::OUString("OptionsUIFile");
+ m_aUIProperties[nIdx++].Value <<= rtl::OUString("modules/scalc/ui/printeroptions.ui");
// create Section for spreadsheet (results in an extra tab page in dialog)
SvtModuleOptions aOpt;
String aAppGroupname( aStrings.GetString( 9 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) );
- m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, rtl::OUString());
- // create subgroup for pages
- m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() );
+ // show subgroup for pages
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", rtl::OUString(aStrings.GetString(0)), rtl::OUString());
// create a bool option for empty pages
- m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ),
- ! bSuppress
- );
- // create Subgroup for print content
+ m_aUIProperties[nIdx++].Value = setBoolControlOpt("includeemptypages", rtl::OUString( aStrings.GetString( 1 ) ),
+ ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox",
+ "IsIncludeEmptyPages",
+ ! bSuppress);
+ // show Subgroup for print content
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
- m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ),
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("printrange", rtl::OUString(aStrings.GetString(2)),
rtl::OUString(),
- aPrintRangeOpt
- );
+ aPrintRangeOpt);
// create a choice for the content to create
- uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 );
+ uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 ), aWidgetIds( 3 );
aChoices[0] = aStrings.GetString( 3 );
aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aWidgetIds[0] = "printallsheets";
aChoices[1] = aStrings.GetString( 4 );
aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aWidgetIds[1] = "printselectedsheets";
aChoices[2] = aStrings.GetString( 5 );
aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
- m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpIds,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ),
- aChoices,
- nContent );
+ aWidgetIds[2] = "printselectedcells";
+ m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(),
+ aHelpIds, "PrintContent",
+ aChoices, nContent );
- // create Subgroup for print range
+ // show Subgroup for print range
aPrintRangeOpt.mbInternalOnly = sal_True;
- m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("fromwhich", rtl::OUString(aStrings.GetString(6)),
rtl::OUString(),
- aPrintRangeOpt
- );
+ aPrintRangeOpt);
// create a choice for the range to print
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
aChoices.realloc( 2 );
aHelpIds.realloc( 2 );
+ aWidgetIds.realloc( 2 );
aChoices[0] = aStrings.GetString( 7 );
aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) );
+ aWidgetIds[0] = "printallpages";
aChoices[1] = aStrings.GetString( 8 );
aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) );
- m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
+ aWidgetIds[1] = "printpages";
+ m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(),
aHelpIds,
aPrintRangeName,
aChoices,
@@ -294,12 +301,11 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
- m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
- rtl::OUString(),
- aPageRangeOpt
- );
+ m_aUIProperties[nIdx++].Value = setEditControlOpt("pagerange", rtl::OUString(),
+ ".HelpID:vcl:PrintDialog:PageRange:Edit",
+ "PageRange", rtl::OUString(), aPageRangeOpt);
+
+ assert(nIdx == nNumProps);
}
void ScPrintUIOptions::SetDefaults()
diff --git a/sc/uiconfig/scalc/ui/printeroptions.ui b/sc/uiconfig/scalc/ui/printeroptions.ui
new file mode 100644
index 000000000000..e65686f5d670
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/printeroptions.ui
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkFrame" id="pages">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkCheckButton" id="includeemptypages">
+ <property name="label" translatable="yes">Include output of empty pages</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Pages</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+</interface>