Kaydet (Commit) 38b7f282 authored tarafından Caolán McNamara's avatar Caolán McNamara

adapt code to use masterlayoutdlg .ui

Change-Id: I4fd8530d461701c736beaf15ca6cf66dfdf58f86
üst 66e39940
...@@ -55,7 +55,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\ ...@@ -55,7 +55,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
sd/source/ui/dlg/inspagob.src \ sd/source/ui/dlg/inspagob.src \
sd/source/ui/dlg/ins_paste.src \ sd/source/ui/dlg/ins_paste.src \
sd/source/ui/dlg/LayerDialog.src \ sd/source/ui/dlg/LayerDialog.src \
sd/source/ui/dlg/masterlayoutdlg.src \
sd/source/ui/dlg/morphdlg.src \ sd/source/ui/dlg/morphdlg.src \
sd/source/ui/dlg/navigatr.src \ sd/source/ui/dlg/navigatr.src \
sd/source/ui/dlg/PaneDockingWindow.src \ sd/source/ui/dlg/PaneDockingWindow.src \
......
...@@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\ ...@@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
$(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/definecustomslideshow \ sd/uiconfig/simpress/ui/definecustomslideshow \
sd/uiconfig/simpress/ui/masterlayoutdlg \
sd/uiconfig/simpress/ui/presentationdialog \ sd/uiconfig/simpress/ui/presentationdialog \
sd/uiconfig/simpress/ui/printeroptions \ sd/uiconfig/simpress/ui/printeroptions \
sd/uiconfig/simpress/ui/photoalbum \ sd/uiconfig/simpress/ui/photoalbum \
......
...@@ -24,23 +24,21 @@ ...@@ -24,23 +24,21 @@
#include "strings.hrc" #include "strings.hrc"
#include "dialogs.hrc" #include "dialogs.hrc"
#include "masterlayoutdlg.hxx" #include "masterlayoutdlg.hxx"
#include "masterlayoutdlg.hrc"
#include "drawdoc.hxx" #include "drawdoc.hxx"
using namespace ::sd; using namespace ::sd;
MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage ) MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
: ModalDialog( pParent, SdResId( RID_SD_DLG_MASTER_LAYOUT ) ), : ModalDialog(pParent, "MasterLayoutDialog", "modules/simpress/ui/masterlayoutdlg.ui")
mpDoc( pDoc ), , mpDoc(pDoc)
mpCurrentPage( pCurrentPage ), , mpCurrentPage(pCurrentPage)
maFLPlaceholders( this, SdResId( FL_PLACEHOLDERS ) ),
maCBDate( this, SdResId( CB_DATE ) ),
maCBPageNumber( this, SdResId( CB_PAGE_NUMBER ) ),
maCBHeader( this, SdResId( CB_HEADER ) ),
maCBFooter( this, SdResId( CB_FOOTER ) ),
maPBOK( this, SdResId( BT_OK ) ),
maPBCancel( this, SdResId( BT_CANCEL ) )
{ {
get(mpCBDate, "datetime");
get(mpCBPageNumber, "pagenumber");
get(mpCBSlideNumber, "slidenumber");
get(mpCBHeader, "header");
get(mpCBFooter, "footer");
if( mpCurrentPage && !mpCurrentPage->IsMasterPage() ) if( mpCurrentPage && !mpCurrentPage->IsMasterPage() )
{ {
mpCurrentPage = (SdPage*)(&(mpCurrentPage->TRG_GetMasterPage())); mpCurrentPage = (SdPage*)(&(mpCurrentPage->TRG_GetMasterPage()));
...@@ -54,40 +52,27 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S ...@@ -54,40 +52,27 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S
switch( mpCurrentPage->GetPageKind() ) switch( mpCurrentPage->GetPageKind() )
{ {
case PK_STANDARD: case PK_STANDARD:
{ {
// aTitle = String( SdResId( STR_MASTER_LAYOUT_TITLE ) ); mpCBHeader->Enable(false);
maCBHeader.Enable( sal_False ); mpCBPageNumber->SetText(mpCBSlideNumber->GetText());
String aSlideNumberStr( SdResId( STR_SLIDE_NUMBER ) ); break;
maCBPageNumber.SetText( aSlideNumberStr ); }
break; case PK_NOTES:
break;
case PK_HANDOUT:
break;
} }
case PK_NOTES:
// aTitle = String( SdResId( STR_NOTES_MASTER_LAYOUT_TITLE ) );
break;
case PK_HANDOUT:
// aTitle = String( SdResId( STR_HANDOUT_TEMPLATE_LAYOUT_TITLE ) );
break;
}
String aTitle (SdResId( STR_MASTER_LAYOUT_TITLE ) );
SetText( aTitle );
FreeResource();
mbOldHeader = mpCurrentPage->GetPresObj( PRESOBJ_HEADER ) != NULL; mbOldHeader = mpCurrentPage->GetPresObj( PRESOBJ_HEADER ) != NULL;
mbOldDate = mpCurrentPage->GetPresObj( PRESOBJ_DATETIME ) != NULL; mbOldDate = mpCurrentPage->GetPresObj( PRESOBJ_DATETIME ) != NULL;
mbOldFooter = mpCurrentPage->GetPresObj( PRESOBJ_FOOTER ) != NULL; mbOldFooter = mpCurrentPage->GetPresObj( PRESOBJ_FOOTER ) != NULL;
mbOldPageNumber = mpCurrentPage->GetPresObj( PRESOBJ_SLIDENUMBER ) != NULL; mbOldPageNumber = mpCurrentPage->GetPresObj( PRESOBJ_SLIDENUMBER ) != NULL;
maCBHeader.Check( mbOldHeader ); mpCBHeader->Check( mbOldHeader );
maCBDate.Check( mbOldDate ); mpCBDate->Check( mbOldDate );
maCBFooter.Check( mbOldFooter ); mpCBFooter->Check( mbOldFooter );
maCBPageNumber.Check( mbOldPageNumber ); mpCBPageNumber->Check( mbOldPageNumber );
}
MasterLayoutDialog::~MasterLayoutDialog()
{
} }
short MasterLayoutDialog::Execute() short MasterLayoutDialog::Execute()
...@@ -101,7 +86,7 @@ void MasterLayoutDialog::applyChanges() ...@@ -101,7 +86,7 @@ void MasterLayoutDialog::applyChanges()
{ {
mpDoc->BegUndo(GetText()); mpDoc->BegUndo(GetText());
if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != maCBHeader.IsChecked() ) ) if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != mpCBHeader->IsChecked() ) )
{ {
if( mbOldHeader ) if( mbOldHeader )
remove( PRESOBJ_HEADER ); remove( PRESOBJ_HEADER );
...@@ -109,7 +94,7 @@ void MasterLayoutDialog::applyChanges() ...@@ -109,7 +94,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_HEADER ); create( PRESOBJ_HEADER );
} }
if( mbOldFooter != maCBFooter.IsChecked() ) if( mbOldFooter != mpCBFooter->IsChecked() )
{ {
if( mbOldFooter ) if( mbOldFooter )
remove( PRESOBJ_FOOTER ); remove( PRESOBJ_FOOTER );
...@@ -117,7 +102,7 @@ void MasterLayoutDialog::applyChanges() ...@@ -117,7 +102,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_FOOTER ); create( PRESOBJ_FOOTER );
} }
if( mbOldDate != maCBDate.IsChecked() ) if( mbOldDate != mpCBDate->IsChecked() )
{ {
if( mbOldDate ) if( mbOldDate )
remove( PRESOBJ_DATETIME ); remove( PRESOBJ_DATETIME );
...@@ -125,7 +110,7 @@ void MasterLayoutDialog::applyChanges() ...@@ -125,7 +110,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_DATETIME ); create( PRESOBJ_DATETIME );
} }
if( mbOldPageNumber != maCBPageNumber.IsChecked() ) if( mbOldPageNumber != mpCBPageNumber->IsChecked() )
{ {
if( mbOldPageNumber ) if( mbOldPageNumber )
remove( PRESOBJ_SLIDENUMBER ); remove( PRESOBJ_SLIDENUMBER );
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <dialogs.hrc>
#include <masterlayoutdlg.hrc>
#include <strings.hrc>
ModalDialog RID_SD_DLG_MASTER_LAYOUT
{
HelpID = "sd:ModalDialog:RID_SD_DLG_MASTER_LAYOUT";
Size = MAP_APPFONT( 89 , 92 );
OutputSize = TRUE;
SVLook = TRUE;
Moveable = TRUE;
CloseAble = TRUE;
FixedLine FL_PLACEHOLDERS
{
Pos = MAP_APPFONT( 3, 3 );
Size = MAP_APPFONT( 83, 10 );
Text [ en-US ] = "Placeholders";
};
CheckBox CB_HEADER
{
HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_HEADER";
Pos = MAP_APPFONT( 6, 16 );
Size = MAP_APPFONT( 134 , 10 );
TabStop = TRUE;
Text [ en-US ] = "Header";
};
CheckBox CB_DATE
{
HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_DATE";
Pos = MAP_APPFONT( 6, 29 );
Size = MAP_APPFONT( 134 , 10 );
TabStop = TRUE;
Text [ en-US ] = "Date/time";
};
CheckBox CB_FOOTER
{
HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_FOOTER";
Pos = MAP_APPFONT( 6, 42 );
Size = MAP_APPFONT( 134 , 10 );
TabStop = TRUE;
Text [ en-US ] = "Footer";
};
CheckBox CB_PAGE_NUMBER
{
HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_PAGE_NUMBER";
Pos = MAP_APPFONT( 6, 55 );
Size = MAP_APPFONT( 134 , 10 );
TabStop = TRUE;
Text [ en-US ] = "Page number";
};
OKButton BT_OK
{
Pos = MAP_APPFONT( 3, 71 );
Size = MAP_APPFONT( 40 , 14 );
TabStop = TRUE;
};
CancelButton BT_CANCEL
{
Pos = MAP_APPFONT( 46, 71 );
Size = MAP_APPFONT( 40 , 14 );
TabStop = TRUE;
};
String STR_SLIDE_NUMBER
{
Text [ en-US ] = "Slide number";
};
String STR_MASTER_LAYOUT_TITLE
{
Text [ en-US ] = "Master Elements";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
/** module unique resource ids for dialogs */ /** module unique resource ids for dialogs */
#define RID_SD_DLG_HEADERFOOTER (1000) #define RID_SD_DLG_HEADERFOOTER (1000)
#define RID_SD_DLG_MASTER_LAYOUT (1001)
/** module unique resource ids for tabpages */ /** module unique resource ids for tabpages */
#define RID_SD_TABPAGE_HEADERFOOTER (1000) #define RID_SD_TABPAGE_HEADERFOOTER (1000)
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#define FL_PLACEHOLDERS 1
#define CB_DATE 2
#define CB_PAGE_NUMBER 3
#define CB_HEADER 4
#define CB_FOOTER 5
#define BT_OK 6
#define BT_CANCEL 7
#define STR_SLIDE_NUMBER 8
#define STR_MASTER_LAYOUT_TITLE 9
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -37,19 +37,16 @@ private: ...@@ -37,19 +37,16 @@ private:
SdDrawDocument* mpDoc; SdDrawDocument* mpDoc;
SdPage* mpCurrentPage; SdPage* mpCurrentPage;
FixedLine maFLPlaceholders; CheckBox* mpCBDate;
CheckBox maCBDate; CheckBox* mpCBPageNumber;
CheckBox maCBPageNumber; CheckBox* mpCBSlideNumber;
CheckBox maCBHeader; CheckBox* mpCBHeader;
CheckBox maCBFooter; CheckBox* mpCBFooter;
OKButton maPBOK; bool mbOldHeader;
CancelButton maPBCancel; bool mbOldFooter;
bool mbOldDate;
sal_Bool mbOldHeader; bool mbOldPageNumber;
sal_Bool mbOldFooter;
sal_Bool mbOldDate;
sal_Bool mbOldPageNumber;
void applyChanges(); void applyChanges();
void remove( PresObjKind eKind ); void remove( PresObjKind eKind );
...@@ -57,7 +54,6 @@ private: ...@@ -57,7 +54,6 @@ private:
public: public:
MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage ); MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage );
~MasterLayoutDialog();
virtual short Execute(); virtual short Execute();
}; };
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="MasterElementsDialog"> <object class="GtkDialog" id="MasterLayoutDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Master Elements</property> <property name="title" translatable="yes">Master Elements</property>
...@@ -10,19 +10,19 @@ ...@@ -10,19 +10,19 @@
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">2</property> <property name="spacing">12</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1"> <object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">spread</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="ok1"> <object class="GtkButton" id="ok">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property> <property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
...@@ -32,12 +32,11 @@ ...@@ -32,12 +32,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel1"> <object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
...@@ -71,13 +70,13 @@ ...@@ -71,13 +70,13 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child> <child>
<object class="GtkCheckButton" id="checkbutton1"> <object class="GtkCheckButton" id="header">
<property name="label" translatable="yes">_Header</property> <property name="label" translatable="yes">_Header</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
...@@ -89,12 +88,11 @@ ...@@ -89,12 +88,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="checkbutton2"> <object class="GtkCheckButton" id="datetime">
<property name="label" translatable="yes">_Date/time</property> <property name="label" translatable="yes">_Date/time</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
...@@ -106,12 +104,11 @@ ...@@ -106,12 +104,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="checkbutton3"> <object class="GtkCheckButton" id="footer">
<property name="label" translatable="yes">_Footer</property> <property name="label" translatable="yes">_Footer</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
...@@ -123,12 +120,11 @@ ...@@ -123,12 +120,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="checkbutton4"> <object class="GtkCheckButton" id="pagenumber">
<property name="label" translatable="yes">_Page number</property> <property name="label" translatable="yes">_Page number</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
...@@ -139,6 +135,22 @@ ...@@ -139,6 +135,22 @@
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="slidenumber">
<property name="label" translatable="yes">_Slide number</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
...@@ -166,8 +178,8 @@ ...@@ -166,8 +178,8 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">ok1</action-widget> <action-widget response="0">ok</action-widget>
<action-widget response="0">cancel1</action-widget> <action-widget response="0">cancel</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </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