Kaydet (Commit) b84c89bb authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Convert dbregister to .ui + adapt code.

Change-Id: I81cef872b6369df425b6cb3bab0eeae3fde2c34c
üst ffe69acb
......@@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/formatnumberdialog \
cui/uiconfig/ui/gradientpage \
cui/uiconfig/ui/colorconfigwin \
cui/uiconfig/ui/dbregisterpage \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hatchpage \
cui/uiconfig/ui/hyphenate \
......
......@@ -445,6 +445,9 @@
#define RID_SVXSTR_HEADER1 (RID_SVX_START + 1242)
#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
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -44,13 +44,13 @@ namespace svx
class DbRegistrationOptionsPage : public SfxTabPage
{
private:
FixedLine aStdBox;
FixedText aTypeText;
FixedText aPathText;
SvSimpleTableContainer aPathCtrl;
PushButton m_aNew;
PushButton m_aEdit;
PushButton m_aDelete;
OUString aTypeText;
OUString aPathText;
SvSimpleTableContainer* m_pPathCtrl;
PushButton* m_pNew;
PushButton* m_pEdit;
PushButton* m_pDelete;
::svx::OptHeaderTabListBox* pPathBox;
SvTreeListEntry* m_pCurEntry;
......
......@@ -18,7 +18,6 @@
*/
#include "dbregister.hxx"
#include "dbregister.hrc"
#include "dbregistersettings.hxx"
#include "connpooloptions.hxx"
#include <svl/filenotation.hxx>
......@@ -104,29 +103,33 @@ short DatabaseRegistrationDialog::Execute()
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 ( this, CUI_RES( FT_TYPE ) ),
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 ) ),
aTypeText ( CUI_RES( RID_SVXSTR_TYPE ) ),
aPathText ( CUI_RES( RID_SVXSTR_PATH ) ),
pPathBox ( NULL ),
m_pCurEntry ( NULL ),
m_nOldCount ( 0 ),
m_bModified ( sal_False )
{
m_aNew.SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) );
m_aEdit.SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
m_aDelete.SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) );
get(m_pPathCtrl, "pathctrl");
Size aControlSize(248, 147);
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;
pPathBox = new ::svx::OptHeaderTabListBox( aPathCtrl, nBits );
pPathBox = new ::svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
......@@ -134,11 +137,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
Size aSz;
aSz.Width() = TAB_WIDTH1;
rBar.InsertItem( ITEMID_TYPE, aTypeText.GetText(),
rBar.InsertItem( ITEMID_TYPE, aTypeText,
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
aSz.Width() = TAB_WIDTH2;
rBar.InsertItem( ITEMID_PATH, aPathText.GetText(),
rBar.InsertItem( ITEMID_PATH, aPathText,
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
HIB_LEFT | HIB_VCENTER );
......@@ -158,8 +161,6 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
rBar.SetHelpId( HID_DBPATH_HEADERBAR );
pPathBox->ShowTable();
FreeResource();
}
// -----------------------------------------------------------------------
......@@ -384,8 +385,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, PathSelect_Impl)
bReadOnly = pRegistration->bReadOnly;
}
m_aEdit.Enable( !bReadOnly );
m_aDelete.Enable( !bReadOnly );
m_pEdit->Enable( !bReadOnly );
m_pDelete->Enable( !bReadOnly );
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 .
*/
#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 .
*/
#include "dbregister.hrc"
#include <cuires.hrc>
#include <cuires.hrc>
#include <svx/dialogs.hrc>
// RID_SFXPAGE_PATH -----------------------------------------------------
#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
TabPage RID_SFXPAGE_DBREGISTER
String RID_SVXSTR_TYPE
{
HelpId = "cui:TabPage:RID_SFXPAGE_DBREGISTER" ;
OutputSize = TRUE ;
SVLook = TRUE ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
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" ;
};
Text [ en-US ] = "Registered name" ;
};
String RID_SVXSTR_PATH
{
Text [ en-US ] = "Database file" ;
};
/* 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="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>
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