diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-17 14:06:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-17 15:00:01 +0000 |
commit | 3a806d027cb744cde08e0c4472bec5159d5a541d (patch) | |
tree | 5f8319d3a3d1114aabfc62b11cbd4a74d1149259 /dbaccess | |
parent | 7edb1f5f32b21a934e3ed4999482ceb07568dfd0 (diff) |
convert field dialog to .ui
Change-Id: Ic268c17941038319240bb70d59d04c9b9a7a2412
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/AllLangResTarget_dbu.mk | 1 | ||||
-rw-r--r-- | dbaccess/UIConfig_dbaccess.mk | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dlgattr.cxx | 35 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dlgattr.src | 77 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/UITools.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dlgattr.hrc | 30 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dlgattr.hxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 16 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/fielddialog.ui | 159 |
11 files changed, 179 insertions, 152 deletions
diff --git a/dbaccess/AllLangResTarget_dbu.mk b/dbaccess/AllLangResTarget_dbu.mk index 55715cd32d90..16d94319b6c4 100644 --- a/dbaccess/AllLangResTarget_dbu.mk +++ b/dbaccess/AllLangResTarget_dbu.mk @@ -47,7 +47,6 @@ $(eval $(call gb_SrsTarget_add_files,dbaccess/dbu,\ dbaccess/source/ui/dlg/dbadmin.src \ dbaccess/source/ui/dlg/dbfindex.src \ dbaccess/source/ui/dlg/directsql.src \ - dbaccess/source/ui/dlg/dlgattr.src \ dbaccess/source/ui/dlg/dlgsave.src \ dbaccess/source/ui/dlg/dsselect.src \ dbaccess/source/ui/dlg/indexdialog.src \ diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk index 8fee67b13f0c..258975f79f96 100644 --- a/dbaccess/UIConfig_dbaccess.mk +++ b/dbaccess/UIConfig_dbaccess.mk @@ -12,6 +12,7 @@ $(eval $(call gb_UIConfig_UIConfig,dbaccess)) $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ dbaccess/uiconfig/ui/colwidthdialog \ dbaccess/uiconfig/ui/directsqldialog \ + dbaccess/uiconfig/ui/fielddialog \ dbaccess/uiconfig/ui/generalpagedialog \ dbaccess/uiconfig/ui/generalpagewizard \ dbaccess/uiconfig/ui/querypropertiesdialog \ diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 9f761052c932..b5d5584ca4a5 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -632,8 +632,7 @@ IMPL_LINK( OFieldDescControl, FormatClickHdl, Button *, /*pButton*/ ) SvNumberFormatsSupplierObj* pSupplierImpl = SvNumberFormatsSupplierObj::getImplementation( xSupplier ); SvNumberFormatter* pFormatter = pSupplierImpl->GetNumberFormatter(); - sal_uInt16 nFlags; - if(::dbaui::callColumnFormatDialog(this,pFormatter,pActFieldDescr->GetType(),nOldFormatKey,rOldJustify,nFlags,sal_True)) + if(::dbaui::callColumnFormatDialog(this,pFormatter,pActFieldDescr->GetType(),nOldFormatKey,rOldJustify,sal_True)) { sal_Bool bModified = sal_False; if(nOldFormatKey != pActFieldDescr->GetFormatKey()) diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index f19e87760ab8..a882d0c07910 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -34,25 +34,21 @@ using namespace dbaui; DBG_NAME(SbaSbAttrDlg) -SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, sal_uInt16 nFlags, sal_Bool bRow) - : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs ) - ,aTitle(ModuleRes(ST_ROW)) + +SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, + SvNumberFormatter* pFormatter, bool bHasFormat, bool bRow) + : SfxTabDialog(pParent, "FieldDialog", "dbaccess/ui/fielddialog.ui", pCellAttrs) + , m_nNumberFormatId(0) { DBG_CTOR(SbaSbAttrDlg,NULL); pNumberInfoItem = new SvxNumberInfoItem( pFormatter, 0 ); if (bRow) - SetText(aTitle); - if( nFlags & TP_ATTR_CHAR ) - { - OSL_FAIL( "found flag TP_ATTR_CHAR" ); - } - if( nFlags & TP_ATTR_NUMBER ) - AddTabPage( RID_SVXPAGE_NUMBERFORMAT,OUString(ModuleRes(TP_ATTR_NUMBER)) ); - if( nFlags & TP_ATTR_ALIGN ) - AddTabPage( RID_SVXPAGE_ALIGNMENT,OUString(ModuleRes(TP_ATTR_ALIGN)) ); - FreeResource(); + SetText(get<FixedText>("alttitle")->GetText()); + if (bHasFormat) + m_nNumberFormatId = AddTabPage("format", RID_SVXPAGE_NUMBERFORMAT); + AddTabPage("alignment", RID_SVXPAGE_ALIGNMENT); } SbaSbAttrDlg::~SbaSbAttrDlg() @@ -65,17 +61,10 @@ SbaSbAttrDlg::~SbaSbAttrDlg() void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - switch ( nPageId ) + if (nPageId == m_nNumberFormatId) { - case RID_SVXPAGE_NUMBERFORMAT: - { - aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO)); - rTabPage.PageCreated(aSet); - } - break; - - default: - break; + aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO)); + rTabPage.PageCreated(aSet); } } diff --git a/dbaccess/source/ui/dlg/dlgattr.src b/dbaccess/source/ui/dlg/dlgattr.src deleted file mode 100644 index 542616823d73..000000000000 --- a/dbaccess/source/ui/dlg/dlgattr.src +++ /dev/null @@ -1,77 +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 <svx/dialogs.hrc> -#include "dbaccess_helpid.hrc" -#include "dbu_dlg.hrc" -#include "dlgattr.hrc" - - //================================================ - // Der Attributdialog: -TabDialog DLG_ATTR -{ - Moveable = TRUE ; - Closeable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Field Format" ; - TabControl 1 - { - OutputSize = TRUE ; - }; - OKButton 1 - { - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - DefButton = TRUE; - }; - CancelButton 1 - { - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; - PushButton 1 - { - TabStop = TRUE ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text [ en-US ] = "Bac~k" ; - }; - String TP_ATTR_CHAR - { - Text [ en-US ] = "Font" ; - }; - String TP_ATTR_NUMBER - { - Text [ en-US ] = "Format" ; - }; - String TP_ATTR_ALIGN - { - Text [ en-US ] = "Alignment" ; - }; - String ST_ROW - { - Text [ en-US ] = "Table Format" ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index bb048335c292..3577d627f46c 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -196,7 +196,6 @@ namespace dbaui sal_Int32 _nDataType, sal_Int32& _nFormatKey, SvxCellHorJustify& _eJustify, - sal_uInt16& _nFlags, sal_Bool _bHasFormat); /** append a name to tablefilter of a datasource @param _xConnection the connection is need to get the datasource diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 501828e7a28d..dad4a1c8feb1 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -83,7 +83,6 @@ #define DLG_PARAMETERS RID_DIALOG_START + 5 #define DLG_FILTERCRIT RID_DIALOG_START + 6 -#define DLG_ATTR RID_DIALOG_START + 10 #define DLG_SAVE_AS RID_DIALOG_START + 11 #define DLG_JOIN_TABADD RID_DIALOG_START + 14 #define DLG_QRY_JOIN RID_DIALOG_START + 15 diff --git a/dbaccess/source/ui/inc/dlgattr.hrc b/dbaccess/source/ui/inc/dlgattr.hrc deleted file mode 100644 index 82f89947e9f8..000000000000 --- a/dbaccess/source/ui/inc/dlgattr.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 . - */ - -#ifndef DBAUI_SBATTRDLG_HRC -#define DBAUI_SBATTRDLG_HRC - -#define TP_ATTR_CHAR 1 -#define TP_ATTR_NUMBER 2 -#define TP_ATTR_ALIGN 4 -#define ST_ROW 5 - -#endif//DBAUI_SBATTRDLG_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index df3a120cc894..c7c8381de710 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -19,10 +19,7 @@ #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DLGATTR_HXX #define INCLUDED_DBACCESS_SOURCE_UI_INC_DLGATTR_HXX -#include "dlgattr.hrc" - #include <sfx2/tabdlg.hxx> -#include <tools/solar.h> class SvxNumberInfoItem; class SfxItemSet; @@ -32,11 +29,11 @@ namespace dbaui class SbaSbAttrDlg : public SfxTabDialog { - OUString aTitle; SvxNumberInfoItem* pNumberInfoItem; + sal_uInt32 m_nNumberFormatId; public: - SbaSbAttrDlg( Window * pParent, const SfxItemSet*, SvNumberFormatter*, sal_uInt16 nFlags = TP_ATTR_CHAR , sal_Bool bRow = sal_False); + SbaSbAttrDlg(Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat, bool bRow = false); ~SbaSbAttrDlg(); virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 9d67f8aaba00..8fd95f244831 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -65,7 +65,6 @@ #include <com/sun/star/awt/FontRelief.hpp> #include <com/sun/star/awt/FontWidth.hpp> #include <com/sun/star/frame/XModel.hpp> -#include "dlgattr.hrc" #include "TypeInfo.hxx" #include "FieldDescriptions.hxx" #include <comphelper/processfactory.hxx> @@ -771,11 +770,10 @@ void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol, if ( bHasFormat ) nFormatKey = ::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY)); - sal_uInt16 nFlags = 0; - if(callColumnFormatDialog(_pParent,_pFormatter,nDataType,nFormatKey,eJustify,nFlags,bHasFormat)) + if(callColumnFormatDialog(_pParent,_pFormatter,nDataType,nFormatKey,eJustify,bHasFormat)) { xAffectedCol->setPropertyValue(PROPERTY_ALIGN, makeAny((sal_Int16)dbaui::mapTextAllign(eJustify))); - if (nFlags & TP_ATTR_NUMBER) + if (bHasFormat) xAffectedCol->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey)); } @@ -792,15 +790,9 @@ sal_Bool callColumnFormatDialog(Window* _pParent, sal_Int32 _nDataType, sal_Int32& _nFormatKey, SvxCellHorJustify& _eJustify, - sal_uInt16& _nFlags, sal_Bool _bHasFormat) { sal_Bool bRet = sal_False; - // the allowed format changes depending on the type of the field ... - _nFlags = TP_ATTR_ALIGN; - - if (_bHasFormat) - _nFlags |= TP_ATTR_NUMBER; // UNO->ItemSet static SfxItemInfo aItemInfos[] = @@ -859,7 +851,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent, } { // want the dialog to be destroyed before our set - SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor, _pFormatter, _nFlags); + SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat); if (RET_OK == aDlg.Execute()) { // ItemSet->UNO @@ -874,7 +866,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent, _eJustify = (SvxCellHorJustify)pHorJustify->GetValue(); // format key - if (_nFlags & TP_ATTR_NUMBER) + if (_bHasFormat) { SFX_ITEMSET_GET(*pSet, pFormat, SfxUInt32Item, SBA_DEF_FMTVALUE, sal_True); _nFormatKey = (sal_Int32)pFormat->GetValue(); diff --git a/dbaccess/uiconfig/ui/fielddialog.ui b/dbaccess/uiconfig/ui/fielddialog.ui new file mode 100644 index 000000000000..dc44d2f0bc7a --- /dev/null +++ b/dbaccess/uiconfig/ui/fielddialog.ui @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.0 on Fri Jan 17 14:37:18 2014 --> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="FieldDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Field Format</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="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> + <child> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</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">3</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="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="format"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Format</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="alignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0.4699999988079071</property> + <property name="label" translatable="yes">Alignment</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="alttitle"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Table Format</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">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-widget response="0">reset</action-widget> + </action-widgets> + </object> +</interface> |