Kaydet (Commit) bfdacade authored tarafından Palenik Mihály's avatar Palenik Mihály Kaydeden (comit) Caolán McNamara

Convert DLG_TEMPLATE_INFORMATION to .ui

Change-Id: I66469c17a46c1157b8e3801c0dc2b252c569a4bd
Reviewed-on: https://gerrit.libreoffice.org/10213Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f86a4b48
......@@ -355,6 +355,9 @@
<glade-widget-class title="SvtValueSet" name="svtlo-ValueSet"
generic-name="Set of Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Document Info Preview" name="svtlo-ODocumentInfoPreview"
generic-name="Document Info Preview" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="SvxColorValueSet" name="svxcorelo-SvxColorValueSet"
generic-name="Set of Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......
......@@ -12,6 +12,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/layout.hxx>
namespace svtools {
class ODocumentInfoPreview;
......@@ -36,7 +37,8 @@ protected:
private:
PushButton maBtnClose;
PushButton* mpBtnClose;
VclBox* mpBox;
Window *mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor)
svtools::ODocumentInfoPreview *mpInfoView;
......
......@@ -46,7 +46,6 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\
sfx2/source/dialog/newstyle.src \
sfx2/source/dialog/recfloat.src \
sfx2/source/dialog/taskpane.src \
sfx2/source/dialog/templateinfodlg.src \
sfx2/source/dialog/templdlg.src \
sfx2/source/dialog/versdlg.src \
sfx2/source/doc/doc.src \
......
......@@ -40,10 +40,11 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/securityinfopage \
sfx2/uiconfig/ui/singletabdialog \
sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/templatedlg \
sfx2/uiconfig/ui/templateinfodialog \
sfx2/uiconfig/ui/versionsofdialog \
sfx2/uiconfig/ui/versioncommentdialog \
sfx2/uiconfig/ui/versionscmis \
sfx2/uiconfig/ui/templatedlg \
))
# vim: set noet sw=4 ts=4:
......@@ -24,10 +24,6 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include "templateinfodlg.hrc"
#define DLG_BORDER_SIZE 12
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::document;
......@@ -37,34 +33,28 @@ using namespace ::com::sun::star::task;
using namespace ::com::sun::star::util;
SfxTemplateInfoDlg::SfxTemplateInfoDlg (Window *pParent)
: ModalDialog(pParent,SfxResId(DLG_TEMPLATE_INFORMATION)),
maBtnClose(this,SfxResId(BTN_TEMPLATE_INFO_CLOSE)),
mpPreviewView(new Window(this)),
mpInfoView(new svtools::ODocumentInfoPreview(this,WB_LEFT | WB_VSCROLL | WB_READONLY | WB_BORDER | WB_3DLOOK))
: ModalDialog(pParent, "TemplateInfo", "sfx/ui/templateinfodialog.ui")
{
maBtnClose.SetClickHdl(LINK(this,SfxTemplateInfoDlg,CloseHdl));
get(mpBtnClose, "close");
get(mpBox, "box");
get(mpInfoView, "infoDrawingArea");
mpPreviewView = new Window(mpBox);
Size aWinSize = GetOutputSizePixel();
aWinSize.setHeight( aWinSize.getHeight() - 3*DLG_BORDER_SIZE - maBtnClose.GetOutputHeightPixel() );
aWinSize.setWidth( (aWinSize.getWidth() - 3*DLG_BORDER_SIZE)/2 );
mpInfoView->SetPosSizePixel(Point(DLG_BORDER_SIZE,DLG_BORDER_SIZE),aWinSize);
Size aSize(LogicToPixel(Size(250, 160), MAP_APPFONT));
mpBox->set_width_request(aSize.Width());
mpBox->set_height_request(aSize.Height());
mpPreviewView->SetPosSizePixel(Point(aWinSize.getWidth()+2*DLG_BORDER_SIZE,DLG_BORDER_SIZE),aWinSize);
mpBtnClose->SetClickHdl(LINK(this,SfxTemplateInfoDlg,CloseHdl));
xWindow = VCLUnoHelper::GetInterface(mpPreviewView);
m_xFrame = Frame::create( comphelper::getProcessComponentContext() );
m_xFrame->initialize( xWindow );
mpPreviewView->Show();
mpInfoView->Show();
}
SfxTemplateInfoDlg::~SfxTemplateInfoDlg()
{
m_xFrame->dispose();
delete mpInfoView;
}
void SfxTemplateInfoDlg::loadDocument(const OUString &rURL)
......
/* -*- 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/.
*/
#define DLG_TEMPLATE_INFORMATION 400
#define BTN_TEMPLATE_INFO_CLOSE 11
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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/.
*/
#include "templateinfodlg.hrc"
ModalDialog DLG_TEMPLATE_INFORMATION
{
OutputSize = TRUE;
SVLook = TRUE;
Size = MAP_APPFONT( 250, 180 );
Moveable = TRUE;
Closeable = TRUE;
PushButton BTN_TEMPLATE_INFO_CLOSE
{
Pos = MAP_APPFONT( 194, 160 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Close";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkDialog" id="TemplateInfo">
<property name="can_focus">False</property>
<property name="border_width">6</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="hexpand">True</property>
<property name="vexpand">True</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="layout_style">end</property>
<child>
<object class="GtkButton" id="close">
<property name="label" translatable="yes">_Close</property>
<property name="use_action_appearance">False</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_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</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="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="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="svtlo-ODocumentInfoPreview" id="infoDrawingArea">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</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">close</action-widget>
</action-widgets>
</object>
</interface>
......@@ -54,6 +54,11 @@ ODocumentInfoPreview::ODocumentInfoPreview(Window * pParent, WinBits nBits):
ODocumentInfoPreview::~ODocumentInfoPreview() {}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeODocumentInfoPreview(Window *pParent, VclBuilder::stringmap)
{
return new ODocumentInfoPreview(pParent, WB_BORDER | WB_READONLY);
}
void ODocumentInfoPreview::Resize() {
m_pEditWin.SetPosSizePixel(Point(0, 0), GetOutputSize());
}
......
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