diff options
author | Palenik Mihály <palenik.mihaly@gmail.com> | 2014-07-11 09:05:53 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-11 15:05:36 +0000 |
commit | bfdacadec9a6472826a23ef86d5ebe21794e1bf9 (patch) | |
tree | 77d395495fd82b239a7fe92f9bbbf6e9a506aa5b /sfx2 | |
parent | f86a4b4897814f9eea4116816e9163bf71a62262 (diff) |
Convert DLG_TEMPLATE_INFORMATION to .ui
Change-Id: I66469c17a46c1157b8e3801c0dc2b252c569a4bd
Reviewed-on: https://gerrit.libreoffice.org/10213
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/AllLangResTarget_sfx2.mk | 1 | ||||
-rw-r--r-- | sfx2/UIConfig_sfx.mk | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/templateinfodlg.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/dialog/templateinfodlg.hrc | 14 | ||||
-rw-r--r-- | sfx2/source/dialog/templateinfodlg.src | 28 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/templateinfodialog.ui | 79 |
6 files changed, 90 insertions, 63 deletions
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk index 9d7b68560e7c..6513e1cbdc83 100644 --- a/sfx2/AllLangResTarget_sfx2.mk +++ b/sfx2/AllLangResTarget_sfx2.mk @@ -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 \ diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk index 310d6e434372..07130472d703 100644 --- a/sfx2/UIConfig_sfx.mk +++ b/sfx2/UIConfig_sfx.mk @@ -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: diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx index 9437f3308e11..45dcd7837a74 100644 --- a/sfx2/source/dialog/templateinfodlg.cxx +++ b/sfx2/source/dialog/templateinfodlg.cxx @@ -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) diff --git a/sfx2/source/dialog/templateinfodlg.hrc b/sfx2/source/dialog/templateinfodlg.hrc deleted file mode 100644 index 7d2fa6f99047..000000000000 --- a/sfx2/source/dialog/templateinfodlg.hrc +++ /dev/null @@ -1,14 +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/. - */ - -#define DLG_TEMPLATE_INFORMATION 400 - -#define BTN_TEMPLATE_INFO_CLOSE 11 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/templateinfodlg.src b/sfx2/source/dialog/templateinfodlg.src deleted file mode 100644 index f012965b8a3f..000000000000 --- a/sfx2/source/dialog/templateinfodlg.src +++ /dev/null @@ -1,28 +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/. - */ - -#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: */ diff --git a/sfx2/uiconfig/ui/templateinfodialog.ui b/sfx2/uiconfig/ui/templateinfodialog.ui new file mode 100644 index 000000000000..0ba4f9d63215 --- /dev/null +++ b/sfx2/uiconfig/ui/templateinfodialog.ui @@ -0,0 +1,79 @@ +<?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> |