diff options
author | Jan Holesovsky <kendy@collabora.com> | 2013-09-29 12:14:58 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-09-29 14:49:43 +0200 |
commit | b84c89bb2ab5c2ac8e4bf2efff9db2d6cf26c401 (patch) | |
tree | 366017972af399de8217e69a82af852540b7e6fc | |
parent | ffe69acb222f1b4773a6fad20429ee1bc44fd985 (diff) |
Convert dbregister to .ui + adapt code.
Change-Id: I81cef872b6369df425b6cb3bab0eeae3fde2c34c
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 3 | ||||
-rw-r--r-- | cui/source/inc/dbregister.hxx | 14 | ||||
-rw-r--r-- | cui/source/options/dbregister.cxx | 41 | ||||
-rw-r--r-- | cui/source/options/dbregister.hrc | 34 | ||||
-rw-r--r-- | cui/source/options/dbregister.src | 67 | ||||
-rw-r--r-- | cui/uiconfig/ui/dbregisterpage.ui | 129 |
7 files changed, 167 insertions, 122 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 2fae5da5f40e..05ae93b4a5e6 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -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 \ diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 0ccdd9c6633f..5e23c480e0ef 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -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: */ diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx index 9a5c7bf532c1..d89560dfaef3 100644 --- a/cui/source/inc/dbregister.hxx +++ b/cui/source/inc/dbregister.hxx @@ -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; diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 1e4ce41275c2..4701c7d0eb4b 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -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; } // ----------------------------------------------------------------------------- diff --git a/cui/source/options/dbregister.hrc b/cui/source/options/dbregister.hrc deleted file mode 100644 index ac3841bff9cd..000000000000 --- a/cui/source/options/dbregister.hrc +++ /dev/null @@ -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: */ diff --git a/cui/source/options/dbregister.src b/cui/source/options/dbregister.src index 4e89503c606c..2f8d708721a5 100644 --- a/cui/source/options/dbregister.src +++ b/cui/source/options/dbregister.src @@ -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: */ diff --git a/cui/uiconfig/ui/dbregisterpage.ui b/cui/uiconfig/ui/dbregisterpage.ui new file mode 100644 index 000000000000..f555953bd44a --- /dev/null +++ b/cui/uiconfig/ui/dbregisterpage.ui @@ -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> |