Convert dbregister to .ui + adapt code.
Change-Id: I81cef872b6369df425b6cb3bab0eeae3fde2c34c
This commit is contained in:
@@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
|
|||||||
cui/uiconfig/ui/formatnumberdialog \
|
cui/uiconfig/ui/formatnumberdialog \
|
||||||
cui/uiconfig/ui/gradientpage \
|
cui/uiconfig/ui/gradientpage \
|
||||||
cui/uiconfig/ui/colorconfigwin \
|
cui/uiconfig/ui/colorconfigwin \
|
||||||
|
cui/uiconfig/ui/dbregisterpage \
|
||||||
cui/uiconfig/ui/effectspage \
|
cui/uiconfig/ui/effectspage \
|
||||||
cui/uiconfig/ui/hatchpage \
|
cui/uiconfig/ui/hatchpage \
|
||||||
cui/uiconfig/ui/hyphenate \
|
cui/uiconfig/ui/hyphenate \
|
||||||
|
@@ -445,6 +445,9 @@
|
|||||||
#define RID_SVXSTR_HEADER1 (RID_SVX_START + 1242)
|
#define RID_SVXSTR_HEADER1 (RID_SVX_START + 1242)
|
||||||
#define RID_SVXSTR_HEADER2 (RID_SVX_START + 1243)
|
#define RID_SVXSTR_HEADER2 (RID_SVX_START + 1243)
|
||||||
|
|
||||||
|
#define RID_SVXSTR_TYPE (RID_SVX_START + 1244)
|
||||||
|
#define RID_SVXSTR_PATH (RID_SVX_START + 1245)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -44,13 +44,13 @@ namespace svx
|
|||||||
class DbRegistrationOptionsPage : public SfxTabPage
|
class DbRegistrationOptionsPage : public SfxTabPage
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
FixedLine aStdBox;
|
OUString aTypeText;
|
||||||
FixedText aTypeText;
|
OUString aPathText;
|
||||||
FixedText aPathText;
|
|
||||||
SvSimpleTableContainer aPathCtrl;
|
SvSimpleTableContainer* m_pPathCtrl;
|
||||||
PushButton m_aNew;
|
PushButton* m_pNew;
|
||||||
PushButton m_aEdit;
|
PushButton* m_pEdit;
|
||||||
PushButton m_aDelete;
|
PushButton* m_pDelete;
|
||||||
|
|
||||||
::svx::OptHeaderTabListBox* pPathBox;
|
::svx::OptHeaderTabListBox* pPathBox;
|
||||||
SvTreeListEntry* m_pCurEntry;
|
SvTreeListEntry* m_pCurEntry;
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dbregister.hxx"
|
#include "dbregister.hxx"
|
||||||
#include "dbregister.hrc"
|
|
||||||
#include "dbregistersettings.hxx"
|
#include "dbregistersettings.hxx"
|
||||||
#include "connpooloptions.hxx"
|
#include "connpooloptions.hxx"
|
||||||
#include <svl/filenotation.hxx>
|
#include <svl/filenotation.hxx>
|
||||||
@@ -104,29 +103,33 @@ short DatabaseRegistrationDialog::Execute()
|
|||||||
|
|
||||||
DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
|
DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
|
||||||
|
|
||||||
SfxTabPage( pParent, CUI_RES( RID_SFXPAGE_DBREGISTER), rSet ),
|
SfxTabPage( pParent, "DbRegisterPage", "cui/ui/dbregisterpage.ui", rSet ),
|
||||||
|
|
||||||
aStdBox ( this, CUI_RES( GB_STD ) ),
|
aTypeText ( CUI_RES( RID_SVXSTR_TYPE ) ),
|
||||||
aTypeText ( this, CUI_RES( FT_TYPE ) ),
|
aPathText ( CUI_RES( RID_SVXSTR_PATH ) ),
|
||||||
aPathText ( this, CUI_RES( FT_PATH ) ),
|
|
||||||
aPathCtrl ( this, CUI_RES( LB_PATH ) ),
|
|
||||||
m_aNew ( this, CUI_RES( BTN_NEW ) ),
|
|
||||||
m_aEdit ( this, CUI_RES( BTN_EDIT ) ),
|
|
||||||
m_aDelete ( this, CUI_RES( BTN_DELETE ) ),
|
|
||||||
pPathBox ( NULL ),
|
pPathBox ( NULL ),
|
||||||
m_pCurEntry ( NULL ),
|
m_pCurEntry ( NULL ),
|
||||||
m_nOldCount ( 0 ),
|
m_nOldCount ( 0 ),
|
||||||
m_bModified ( sal_False )
|
m_bModified ( sal_False )
|
||||||
{
|
{
|
||||||
m_aNew.SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) );
|
get(m_pPathCtrl, "pathctrl");
|
||||||
m_aEdit.SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
|
Size aControlSize(248, 147);
|
||||||
m_aDelete.SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) );
|
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
|
||||||
|
m_pPathCtrl->set_width_request(aControlSize.Width());
|
||||||
|
m_pPathCtrl->set_height_request(aControlSize.Height());
|
||||||
|
|
||||||
Size aBoxSize = aPathCtrl.GetOutputSizePixel();
|
get(m_pNew, "new");
|
||||||
|
get(m_pEdit, "edit");
|
||||||
|
get(m_pDelete, "delete");
|
||||||
|
|
||||||
|
m_pNew->SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) );
|
||||||
|
m_pEdit->SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
|
||||||
|
m_pDelete->SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) );
|
||||||
|
|
||||||
|
Size aBoxSize = m_pPathCtrl->GetOutputSizePixel();
|
||||||
|
|
||||||
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
|
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
|
||||||
pPathBox = new ::svx::OptHeaderTabListBox( aPathCtrl, nBits );
|
pPathBox = new ::svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
|
||||||
|
|
||||||
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
|
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
|
||||||
|
|
||||||
@@ -134,11 +137,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
|
|||||||
rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
|
rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
|
||||||
Size aSz;
|
Size aSz;
|
||||||
aSz.Width() = TAB_WIDTH1;
|
aSz.Width() = TAB_WIDTH1;
|
||||||
rBar.InsertItem( ITEMID_TYPE, aTypeText.GetText(),
|
rBar.InsertItem( ITEMID_TYPE, aTypeText,
|
||||||
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
|
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
|
||||||
HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
|
HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
|
||||||
aSz.Width() = TAB_WIDTH2;
|
aSz.Width() = TAB_WIDTH2;
|
||||||
rBar.InsertItem( ITEMID_PATH, aPathText.GetText(),
|
rBar.InsertItem( ITEMID_PATH, aPathText,
|
||||||
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
|
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
|
||||||
HIB_LEFT | HIB_VCENTER );
|
HIB_LEFT | HIB_VCENTER );
|
||||||
|
|
||||||
@@ -158,8 +161,6 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
|
|||||||
rBar.SetHelpId( HID_DBPATH_HEADERBAR );
|
rBar.SetHelpId( HID_DBPATH_HEADERBAR );
|
||||||
|
|
||||||
pPathBox->ShowTable();
|
pPathBox->ShowTable();
|
||||||
|
|
||||||
FreeResource();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@@ -384,8 +385,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, PathSelect_Impl)
|
|||||||
bReadOnly = pRegistration->bReadOnly;
|
bReadOnly = pRegistration->bReadOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_aEdit.Enable( !bReadOnly );
|
m_pEdit->Enable( !bReadOnly );
|
||||||
m_aDelete.Enable( !bReadOnly );
|
m_pDelete->Enable( !bReadOnly );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@@ -1,34 +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 SVX_DBREGISTER_HRC
|
|
||||||
#define SVX_DBREGISTER_HRC
|
|
||||||
// defines ---------------------------------------------------------------
|
|
||||||
|
|
||||||
#define FT_TYPE 10
|
|
||||||
#define FT_PATH 11
|
|
||||||
#define LB_PATH 12
|
|
||||||
#define BTN_NEW 13
|
|
||||||
#define BTN_EDIT 14
|
|
||||||
#define GB_STD 15
|
|
||||||
#define IMG_LOCK 16
|
|
||||||
#define BTN_DELETE 17
|
|
||||||
|
|
||||||
#endif // SVX_DBREGISTER_HRC
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
@@ -17,70 +17,15 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dbregister.hrc"
|
|
||||||
#include <cuires.hrc>
|
#include <cuires.hrc>
|
||||||
#include <cuires.hrc>
|
|
||||||
#include <svx/dialogs.hrc>
|
|
||||||
|
|
||||||
// RID_SFXPAGE_PATH -----------------------------------------------------
|
String RID_SVXSTR_TYPE
|
||||||
#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
|
|
||||||
TabPage RID_SFXPAGE_DBREGISTER
|
|
||||||
{
|
{
|
||||||
HelpId = "cui:TabPage:RID_SFXPAGE_DBREGISTER" ;
|
Text [ en-US ] = "Registered name" ;
|
||||||
OutputSize = TRUE ;
|
};
|
||||||
SVLook = TRUE ;
|
String RID_SVXSTR_PATH
|
||||||
Hide = TRUE ;
|
{
|
||||||
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
|
Text [ en-US ] = "Database file" ;
|
||||||
Text [ en-US ] = "Registered databases" ;
|
|
||||||
|
|
||||||
FixedText FT_TYPE
|
|
||||||
{
|
|
||||||
Hide = TRUE;
|
|
||||||
Pos = MAP_APPFONT ( 12 , 14 ) ;
|
|
||||||
Size = MAP_APPFONT ( 40 , 10 ) ;
|
|
||||||
Text [ en-US ] = "Registered name" ;
|
|
||||||
};
|
|
||||||
FixedText FT_PATH
|
|
||||||
{
|
|
||||||
Hide = TRUE;
|
|
||||||
Pos = MAP_APPFONT ( 110 , 14 ) ;
|
|
||||||
Size = MAP_APPFONT ( 40 , 10 ) ;
|
|
||||||
Text [ en-US ] = "Database file" ;
|
|
||||||
};
|
|
||||||
Control LB_PATH
|
|
||||||
{
|
|
||||||
Pos = MAP_APPFONT ( 12 , 14 ) ;
|
|
||||||
Size = MAP_APPFONT ( 236 , 147 ) ;
|
|
||||||
Border = TRUE ;
|
|
||||||
TabStop = TRUE;
|
|
||||||
};
|
|
||||||
PushButton BTN_NEW
|
|
||||||
{
|
|
||||||
HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_NEW";
|
|
||||||
Pos = MAP_APPFONT ( 47 , 165 ) ;
|
|
||||||
Size = MAP_APPFONT ( 65 , 14 ) ;
|
|
||||||
Text [ en-US ] = "~New..." ;
|
|
||||||
};
|
|
||||||
PushButton BTN_EDIT
|
|
||||||
{
|
|
||||||
HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_EDIT";
|
|
||||||
Pos = MAP_APPFONT ( 183 , 165 ) ;
|
|
||||||
Size = MAP_APPFONT ( 65 , 14 ) ;
|
|
||||||
Text [ en-US ] = "~Edit..." ;
|
|
||||||
};
|
|
||||||
PushButton BTN_DELETE
|
|
||||||
{
|
|
||||||
HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_DELETE";
|
|
||||||
Pos = MAP_APPFONT ( 115 , 165 ) ;
|
|
||||||
Size = MAP_APPFONT ( 65 , 14 ) ;
|
|
||||||
Text [ en-US ] = "~Delete" ;
|
|
||||||
};
|
|
||||||
FixedLine GB_STD
|
|
||||||
{
|
|
||||||
Pos = MAP_APPFONT ( 6 , 3 ) ;
|
|
||||||
Size = MAP_APPFONT ( 248 , 8 ) ;
|
|
||||||
Text [ en-US ] = "Registered databases" ;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
129
cui/uiconfig/ui/dbregisterpage.ui
Normal file
129
cui/uiconfig/ui/dbregisterpage.ui
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<!-- interface-requires LibreOffice 1.0 -->
|
||||||
|
<object class="GtkGrid" id="DbRegisterPage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="border_width">6</property>
|
||||||
|
<property name="row_spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="frame1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="label_xalign">0</property>
|
||||||
|
<property name="shadow_type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkAlignment" id="alignment1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">6</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="top_padding">6</property>
|
||||||
|
<property name="left_padding">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="svtlo-SvSimpleTableContainer" id="pathctrl">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child internal-child="selection">
|
||||||
|
<object class="GtkTreeSelection" id="Simple Table Container-selection1"/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box2">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="new">
|
||||||
|
<property name="label" translatable="yes">_New...</property>
|
||||||
|
<property name="use_action_appearance">False</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_underline">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="delete">
|
||||||
|
<property name="label" translatable="yes">_Delete</property>
|
||||||
|
<property name="use_action_appearance">False</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_underline">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="edit">
|
||||||
|
<property name="label" translatable="yes">_Edit...</property>
|
||||||
|
<property name="use_action_appearance">False</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_underline">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="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="label">
|
||||||
|
<object class="GtkLabel" id="label1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Registered databases</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="bold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
</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>
|
||||||
|
</interface>
|
Reference in New Issue
Block a user