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

convert insert slides dialog to .ui

Change-Id: I9dc8366d2e8bd2ab16ce11c9e69cbdbdca0ccae5
üst 8820448b
......@@ -421,6 +421,9 @@
<glade-widget-class title="Tab Order ListBox" name="pcrlo-TabOrderListBox"
generic-name="TabOrderListBox" parent="svtlo-SvTreeListBox"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Page Objs ListBox" name="sdlo-SdPageObjsTLB"
generic-name="SdPageObjsTLB" parent="svtlo-SvTreeListBox"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Checked Tree List" name="svxlo-SvxCheckListBox"
generic-name="Checked Tree List" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
......
......@@ -45,7 +45,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
sd/source/ui/dlg/dlgass.src \
sd/source/ui/dlg/dlgfield.src \
sd/source/ui/dlg/dlgolbul.src \
sd/source/ui/dlg/inspagob.src \
sd/source/ui/dlg/LayerDialog.src \
sd/source/ui/dlg/morphdlg.src \
sd/source/ui/dlg/navigatr.src \
......
......@@ -74,6 +74,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
sd/uiconfig/sdraw/ui/drawpagedialog \
sd/uiconfig/sdraw/ui/drawprtldialog \
sd/uiconfig/sdraw/ui/insertlayer \
sd/uiconfig/sdraw/ui/insertslidesdialog \
sd/uiconfig/sdraw/ui/namedesign \
sd/uiconfig/sdraw/ui/paranumberingtab \
sd/uiconfig/sdraw/ui/printeroptions \
......
......@@ -101,8 +101,6 @@
#define HID_SD_UNDODELETEWARNING_DLG "SD_HID_SD_UNDODELETEWARNING_DLG"
#define HID_SD_UNDODELETEWARNING_CBX "SD_HID_SD_UNDODELETEWARNING_CBX"
#define HID_SD_PAGEOBJSTLB "SD_HID_SD_PAGEOBJSTLB"
#define HID_SD_NAMEDIALOG_OBJECT "SD_HID_SD_NAMEDIALOG_OBJECT"
#define HID_SD_NAMEDIALOG_PAGE "SD_HID_SD_NAMEDIALOG_PAGE"
#define HID_SD_NAMEDIALOG_LINEEND "SD_HID_SD_NAMEDIALOG_LINEEND"
......@@ -157,7 +155,6 @@
#define HID_SD_TABLE_DESIGN "SD_HID_SD_TABLE_DESIGN"
#define HID_SD_ANNOTATIONS "SD_HID_SD_ANNOTATIONS"
#define HID_DLG_INSERT_PAGES_OBJS "SD_HID_DLG_INSERT_PAGES_OBJS"
#define HID_VECTORIZE_DLG "SD_HID_VECTORIZE_DLG"
#define HID_MN_SUB_GRAPHIC "SD_HID_MN_SUB_GRAPHIC"
......
......@@ -25,30 +25,27 @@
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
#include "ViewShell.hxx"
#include "inspagob.hrc"
SdInsertPagesObjsDlg::SdInsertPagesObjsDlg(
::Window* pWindow,
const SdDrawDocument* pInDoc,
SfxMedium* pSfxMedium,
const OUString& rFileName )
: ModalDialog ( pWindow, SdResId( DLG_INSERT_PAGES_OBJS ) ),
aLbTree ( this, SdResId( LB_TREE ) ),
aCbxLink ( this, SdResId( CBX_LINK ) ),
aCbxMasters ( this, SdResId( CBX_CHECK_MASTERS ) ),
aBtnOk ( this, SdResId( BTN_OK ) ),
aBtnCancel ( this, SdResId( BTN_CANCEL ) ),
aBtnHelp ( this, SdResId( BTN_HELP ) ),
pMedium ( pSfxMedium ),
mpDoc ( pInDoc ),
rName ( rFileName )
::Window* pWindow, const SdDrawDocument* pInDoc,
SfxMedium* pSfxMedium, const OUString& rFileName )
: ModalDialog(pWindow, "InsertSlidesDialog",
"modules/sdraw/ui/insertslidesdialog.ui")
, pMedium(pSfxMedium)
, mpDoc(pInDoc)
, rName(rFileName)
{
FreeResource();
get(m_pLbTree, "tree");
get(m_pCbxMasters, "backgrounds");
get(m_pCbxLink, "links");
aLbTree.SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
m_pLbTree->set_width_request(m_pLbTree->approximate_char_width() * 50);
m_pLbTree->set_height_request(m_pLbTree->GetTextHeight() * 12);
aLbTree.SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
m_pLbTree->SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
m_pLbTree->SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
// insert text
if( !pMedium )
......@@ -70,20 +67,20 @@ void SdInsertPagesObjsDlg::Reset()
{
if( pMedium )
{
aLbTree.SetSelectionMode( MULTIPLE_SELECTION );
m_pLbTree->SetSelectionMode( MULTIPLE_SELECTION );
// transfer ownership of Medium
aLbTree.Fill( mpDoc, pMedium, rName );
m_pLbTree->Fill( mpDoc, pMedium, rName );
}
else
{
Color aColor( COL_WHITE );
Bitmap aBmpText( SdResId( BMP_DOC_TEXT ) );
Image aImgText( aBmpText, aColor );
aLbTree.InsertEntry( rName, aImgText, aImgText );
m_pLbTree->InsertEntry( rName, aImgText, aImgText );
}
aCbxMasters.Check( sal_True );
m_pCbxMasters->Check( sal_True );
}
std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
......@@ -93,16 +90,16 @@ std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
{
// to ensure that bookmarks are opened
// (when the whole document is selected)
aLbTree.GetBookmarkDoc();
m_pLbTree->GetBookmarkDoc();
// If the document is selected (too) or nothing is selected,
// the whole document is inserted (but not more!)
if( aLbTree.GetSelectionCount() == 0 ||
( aLbTree.IsSelected( aLbTree.First() ) ) )
if( m_pLbTree->GetSelectionCount() == 0 ||
( m_pLbTree->IsSelected( m_pLbTree->First() ) ) )
return std::vector<OUString>();
}
return aLbTree.GetSelectEntryList( nType );
return m_pLbTree->GetSelectEntryList( nType );
}
/**
......@@ -110,7 +107,7 @@ std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
*/
sal_Bool SdInsertPagesObjsDlg::IsLink()
{
return( aCbxLink.IsChecked() );
return( m_pCbxLink->IsChecked() );
}
/**
......@@ -118,7 +115,7 @@ sal_Bool SdInsertPagesObjsDlg::IsLink()
*/
sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
{
return( aCbxMasters.IsChecked() );
return( m_pCbxMasters->IsChecked() );
}
/**
......@@ -126,10 +123,10 @@ sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
*/
IMPL_LINK_NOARG(SdInsertPagesObjsDlg, SelectObjectHdl)
{
if( aLbTree.IsLinkableSelected() )
aCbxLink.Enable();
if( m_pLbTree->IsLinkableSelected() )
m_pCbxLink->Enable();
else
aCbxLink.Disable();
m_pCbxLink->Disable();
return( 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 "helpids.h"
#include "inspagob.hrc"
ModalDialog DLG_INSERT_PAGES_OBJS
{
HelpID = HID_DLG_INSERT_PAGES_OBJS ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 200 , 128 ) ;
Moveable = TRUE ;
Text [ en-US ] = "Insert Slides/Objects" ;
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 144 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 144 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 144 , 46 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
Control LB_TREE
{
HelpId = HID_SD_PAGEOBJSTLB;
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 132 , 88 ) ;
TabStop = TRUE ;
};
CheckBox CBX_LINK
{
HelpID = "sd:CheckBox:DLG_INSERT_PAGES_OBJS:CBX_LINK";
Pos = MAP_APPFONT ( 6 , 100 ) ;
Size = MAP_APPFONT ( 140 , 12 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Link" ;
};
CheckBox CBX_CHECK_MASTERS
{
HelpID = "sd:CheckBox:DLG_INSERT_PAGES_OBJS:CBX_CHECK_MASTERS";
Pos = MAP_APPFONT ( 6 , 114 ) ;
Size = MAP_APPFONT ( 140 , 12 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Delete unused backg~rounds";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -100,8 +100,14 @@ SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable(
{
}
extern "C" SAL_DLLPUBLIC_EXPORT ::Window* SAL_CALL makeSdPageObjsTLB(::Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = WB_TABSTOP;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
return new SdPageObjsTLB(pParent, nWinStyle);
}
SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable()
{
......@@ -243,6 +249,35 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId )
SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
}
SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, WinBits nStyle )
: SvTreeListBox ( pParentWin, nStyle )
, mpParent ( pParentWin )
, mpDoc ( NULL )
, mpBookmarkDoc ( NULL )
, mpMedium ( NULL )
, mpOwnMedium ( NULL )
, maImgOle ( BitmapEx( SdResId( BMP_OLE ) ) )
, maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) )
, mbLinkableSelected ( sal_False )
, mpDropNavWin ( NULL )
, mbShowAllShapes ( false )
, mbShowAllPages ( false )
{
// add lines to Tree-ListBox
SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
WB_HASBUTTONS | // WB_HASLINESATROOT |
WB_HSCROLL |
WB_HASBUTTONSATROOT |
WB_QUICK_SEARCH /* i31275 */ );
SetNodeBitmaps( Image(Bitmap( SdResId(BMP_EXPAND) )),
Image(Bitmap( SdResId(BMP_COLLAPSE) )));
SetDragDropMode(
SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY |
SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
}
SdPageObjsTLB::~SdPageObjsTLB()
{
......
/* -*- 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 DLG_INSERT_PAGES_OBJS 938
#define BTN_OK 1
#define BTN_CANCEL 1
#define BTN_HELP 1
#define LB_TREE 1
#define CBX_LINK 1
#define CBX_CHECK_MASTERS 2
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -31,12 +31,9 @@ class SdDrawDocument;
class SdInsertPagesObjsDlg : public ModalDialog
{
private:
SdPageObjsTLB aLbTree;
CheckBox aCbxLink;
CheckBox aCbxMasters;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
SdPageObjsTLB* m_pLbTree;
CheckBox* m_pCbxLink;
CheckBox* m_pCbxMasters;
SfxMedium* pMedium;
const SdDrawDocument* mpDoc;
......
......@@ -179,7 +179,8 @@ protected:
public:
SdPageObjsTLB( Window* pParent, const SdResId& rSdResId );
SdPageObjsTLB( Window* pParent, const SdResId& rSdResId );
SdPageObjsTLB( Window* pParent, WinBits nStyle );
~SdPageObjsTLB();
virtual void SelectHdl();
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkDialog" id="InsertSlidesDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Insert Slides/Objects</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">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="layout_style">end</property>
<child>
<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_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="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkCheckButton" id="backgrounds">
<property name="label" translatable="yes">Delete unused backg_rounds</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="links">
<property name="label" translatable="yes">_Link</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="sdlo-SdPageObjsTLB" id="tree:border">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="SdPageObjsTLB-selection1"/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</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