diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-21 20:50:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-22 09:19:33 +0100 |
commit | 38b7f28268fc48e2761f963ffc7652ebdf2a8e9b (patch) | |
tree | b949e204d4406129fb6f547e56f80970796a8261 /sd | |
parent | Use implicit default constructors (diff) | |
download | core-38b7f28268fc48e2761f963ffc7652ebdf2a8e9b.tar.gz core-38b7f28268fc48e2761f963ffc7652ebdf2a8e9b.zip |
adapt code to use masterlayoutdlg .ui
Change-Id: I4fd8530d461701c736beaf15ca6cf66dfdf58f86
Diffstat (limited to 'sd')
-rw-r--r-- | sd/AllLangResTarget_sd.mk | 1 | ||||
-rw-r--r-- | sd/UIConfig_simpress.mk | 1 | ||||
-rw-r--r-- | sd/source/ui/dlg/masterlayoutdlg.cxx | 69 | ||||
-rw-r--r-- | sd/source/ui/dlg/masterlayoutdlg.src | 105 | ||||
-rw-r--r-- | sd/source/ui/inc/dialogs.hrc | 1 | ||||
-rw-r--r-- | sd/source/ui/inc/masterlayoutdlg.hrc | 30 | ||||
-rw-r--r-- | sd/source/ui/inc/masterlayoutdlg.hxx | 22 | ||||
-rw-r--r-- | sd/uiconfig/simpress/ui/masterlayoutdlg.ui | 46 |
8 files changed, 66 insertions, 209 deletions
diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk index 5f25e41d6af4..0e5938471e13 100644 --- a/sd/AllLangResTarget_sd.mk +++ b/sd/AllLangResTarget_sd.mk @@ -55,7 +55,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\ sd/source/ui/dlg/inspagob.src \ sd/source/ui/dlg/ins_paste.src \ sd/source/ui/dlg/LayerDialog.src \ - sd/source/ui/dlg/masterlayoutdlg.src \ sd/source/ui/dlg/morphdlg.src \ sd/source/ui/dlg/navigatr.src \ sd/source/ui/dlg/PaneDockingWindow.src \ diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk index f5d088fdc422..8234765e2d66 100644 --- a/sd/UIConfig_simpress.mk +++ b/sd/UIConfig_simpress.mk @@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\ sd/uiconfig/simpress/ui/definecustomslideshow \ + sd/uiconfig/simpress/ui/masterlayoutdlg \ sd/uiconfig/simpress/ui/presentationdialog \ sd/uiconfig/simpress/ui/printeroptions \ sd/uiconfig/simpress/ui/photoalbum \ diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx index b0fd86f5e125..e080822f69d5 100644 --- a/sd/source/ui/dlg/masterlayoutdlg.cxx +++ b/sd/source/ui/dlg/masterlayoutdlg.cxx @@ -24,23 +24,21 @@ #include "strings.hrc" #include "dialogs.hrc" #include "masterlayoutdlg.hxx" -#include "masterlayoutdlg.hrc" #include "drawdoc.hxx" using namespace ::sd; MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage ) -: ModalDialog( pParent, SdResId( RID_SD_DLG_MASTER_LAYOUT ) ), - mpDoc( pDoc ), - 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 ) ) + : ModalDialog(pParent, "MasterLayoutDialog", "modules/simpress/ui/masterlayoutdlg.ui") + , mpDoc(pDoc) + , mpCurrentPage(pCurrentPage) { + get(mpCBDate, "datetime"); + get(mpCBPageNumber, "pagenumber"); + get(mpCBSlideNumber, "slidenumber"); + get(mpCBHeader, "header"); + get(mpCBFooter, "footer"); + if( mpCurrentPage && !mpCurrentPage->IsMasterPage() ) { mpCurrentPage = (SdPage*)(&(mpCurrentPage->TRG_GetMasterPage())); @@ -54,40 +52,27 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S switch( mpCurrentPage->GetPageKind() ) { - case PK_STANDARD: - { - // aTitle = String( SdResId( STR_MASTER_LAYOUT_TITLE ) ); - maCBHeader.Enable( sal_False ); - String aSlideNumberStr( SdResId( STR_SLIDE_NUMBER ) ); - maCBPageNumber.SetText( aSlideNumberStr ); - break; + case PK_STANDARD: + { + mpCBHeader->Enable(false); + mpCBPageNumber->SetText(mpCBSlideNumber->GetText()); + 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; mbOldDate = mpCurrentPage->GetPresObj( PRESOBJ_DATETIME ) != NULL; mbOldFooter = mpCurrentPage->GetPresObj( PRESOBJ_FOOTER ) != NULL; mbOldPageNumber = mpCurrentPage->GetPresObj( PRESOBJ_SLIDENUMBER ) != NULL; - maCBHeader.Check( mbOldHeader ); - maCBDate.Check( mbOldDate ); - maCBFooter.Check( mbOldFooter ); - maCBPageNumber.Check( mbOldPageNumber ); -} - -MasterLayoutDialog::~MasterLayoutDialog() -{ + mpCBHeader->Check( mbOldHeader ); + mpCBDate->Check( mbOldDate ); + mpCBFooter->Check( mbOldFooter ); + mpCBPageNumber->Check( mbOldPageNumber ); } short MasterLayoutDialog::Execute() @@ -101,7 +86,7 @@ void MasterLayoutDialog::applyChanges() { mpDoc->BegUndo(GetText()); - if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != maCBHeader.IsChecked() ) ) + if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != mpCBHeader->IsChecked() ) ) { if( mbOldHeader ) remove( PRESOBJ_HEADER ); @@ -109,7 +94,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_HEADER ); } - if( mbOldFooter != maCBFooter.IsChecked() ) + if( mbOldFooter != mpCBFooter->IsChecked() ) { if( mbOldFooter ) remove( PRESOBJ_FOOTER ); @@ -117,7 +102,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_FOOTER ); } - if( mbOldDate != maCBDate.IsChecked() ) + if( mbOldDate != mpCBDate->IsChecked() ) { if( mbOldDate ) remove( PRESOBJ_DATETIME ); @@ -125,7 +110,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_DATETIME ); } - if( mbOldPageNumber != maCBPageNumber.IsChecked() ) + if( mbOldPageNumber != mpCBPageNumber->IsChecked() ) { if( mbOldPageNumber ) remove( PRESOBJ_SLIDENUMBER ); diff --git a/sd/source/ui/dlg/masterlayoutdlg.src b/sd/source/ui/dlg/masterlayoutdlg.src deleted file mode 100644 index 18e520c6a5c8..000000000000 --- a/sd/source/ui/dlg/masterlayoutdlg.src +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- 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: */ diff --git a/sd/source/ui/inc/dialogs.hrc b/sd/source/ui/inc/dialogs.hrc index 61dfa76b3f40..b19b8e02834c 100644 --- a/sd/source/ui/inc/dialogs.hrc +++ b/sd/source/ui/inc/dialogs.hrc @@ -19,7 +19,6 @@ /** module unique resource ids for dialogs */ #define RID_SD_DLG_HEADERFOOTER (1000) -#define RID_SD_DLG_MASTER_LAYOUT (1001) /** module unique resource ids for tabpages */ #define RID_SD_TABPAGE_HEADERFOOTER (1000) diff --git a/sd/source/ui/inc/masterlayoutdlg.hrc b/sd/source/ui/inc/masterlayoutdlg.hrc deleted file mode 100644 index 0f663353bc91..000000000000 --- a/sd/source/ui/inc/masterlayoutdlg.hrc +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- 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: */ diff --git a/sd/source/ui/inc/masterlayoutdlg.hxx b/sd/source/ui/inc/masterlayoutdlg.hxx index 95cf77bd02f9..037caac48dcb 100644 --- a/sd/source/ui/inc/masterlayoutdlg.hxx +++ b/sd/source/ui/inc/masterlayoutdlg.hxx @@ -37,19 +37,16 @@ private: SdDrawDocument* mpDoc; SdPage* mpCurrentPage; - FixedLine maFLPlaceholders; - CheckBox maCBDate; - CheckBox maCBPageNumber; - CheckBox maCBHeader; - CheckBox maCBFooter; + CheckBox* mpCBDate; + CheckBox* mpCBPageNumber; + CheckBox* mpCBSlideNumber; + CheckBox* mpCBHeader; + CheckBox* mpCBFooter; - OKButton maPBOK; - CancelButton maPBCancel; - - sal_Bool mbOldHeader; - sal_Bool mbOldFooter; - sal_Bool mbOldDate; - sal_Bool mbOldPageNumber; + bool mbOldHeader; + bool mbOldFooter; + bool mbOldDate; + bool mbOldPageNumber; void applyChanges(); void remove( PresObjKind eKind ); @@ -57,7 +54,6 @@ private: public: MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage ); - ~MasterLayoutDialog(); virtual short Execute(); }; diff --git a/sd/uiconfig/simpress/ui/masterlayoutdlg.ui b/sd/uiconfig/simpress/ui/masterlayoutdlg.ui index d7d5f104cf35..40d391dc3d0a 100644 --- a/sd/uiconfig/simpress/ui/masterlayoutdlg.ui +++ b/sd/uiconfig/simpress/ui/masterlayoutdlg.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> - <object class="GtkDialog" id="MasterElementsDialog"> + <object class="GtkDialog" id="MasterLayoutDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes">Master Elements</property> @@ -10,19 +10,19 @@ <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> <property name="orientation">vertical</property> - <property name="spacing">2</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">spread</property> + <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok1"> + <object class="GtkButton" id="ok"> <property name="label">gtk-ok</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_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -32,12 +32,11 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel1"> + <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_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -71,13 +70,13 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkCheckButton" id="checkbutton1"> + <object class="GtkCheckButton" id="header"> <property name="label" translatable="yes">_Header</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="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> @@ -89,12 +88,11 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton2"> + <object class="GtkCheckButton" id="datetime"> <property name="label" translatable="yes">_Date/time</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="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> @@ -106,12 +104,11 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton3"> + <object class="GtkCheckButton" id="footer"> <property name="label" translatable="yes">_Footer</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="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> @@ -123,12 +120,11 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton4"> + <object class="GtkCheckButton" id="pagenumber"> <property name="label" translatable="yes">_Page number</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="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> @@ -139,6 +135,22 @@ <property name="position">3</property> </packing> </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> </child> </object> @@ -166,8 +178,8 @@ </object> </child> <action-widgets> - <action-widget response="0">ok1</action-widget> - <action-widget response="0">cancel1</action-widget> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> </action-widgets> </object> </interface> |