diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 15:28:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 16:09:26 +0000 |
commit | 5667ca141785f83c849caac7d76e250e852ac236 (patch) | |
tree | 321bf2b85c7fff1c5ea0eebb5cbeff03faf99595 /dbaccess/source/ui | |
parent | aea6aab9f25467891d92efa43d91412576a00b8c (diff) |
convert add relationships dialog to .ui
Change-Id: I984ff7e4fca6e7cd3529e921383bca4e6f2a464e
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/dlg/AutoControls.src | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.cxx | 118 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.hrc | 39 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.src | 97 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/adtabdlg.hxx | 31 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_dlg.hrc | 4 |
6 files changed, 76 insertions, 224 deletions
diff --git a/dbaccess/source/ui/dlg/AutoControls.src b/dbaccess/source/ui/dlg/AutoControls.src index fd890ca38070..265b64a862a5 100644 --- a/dbaccess/source/ui/dlg/AutoControls.src +++ b/dbaccess/source/ui/dlg/AutoControls.src @@ -79,6 +79,17 @@ String STR_THUNDERBIRD_PROFILE_NAME Text[ en-US ] = "~Thunderbird profile name"; }; +String STR_ADD_TABLES +{ + Text [ en-US ] = "Add Tables"; +}; + +String STR_ADD_TABLE_OR_QUERY +{ + Text [ en-US ] = "Add Table or Query" ; +}; + + // ------------------------------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index f9621cd1398e..aabdbd9ecefc 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -18,7 +18,6 @@ */ #include "adtabdlg.hxx" -#include "adtabdlg.hrc" #include "sqlmessage.hxx" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -316,61 +315,49 @@ bool QueryListFacade::isLeafSelected() const } OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext ) - :ModelessDialog( pParent, ModuleRes(DLG_JOIN_TABADD) ) - ,m_aCaseTables( this, ModuleRes( RB_CASE_TABLES ) ) - ,m_aCaseQueries( this, ModuleRes( RB_CASE_QUERIES ) ) - ,m_aTableList( this, ModuleRes( LB_TABLE_OR_QUERY ), sal_False ) - ,m_aQueryList( this, ModuleRes( LB_TABLE_OR_QUERY ) ) - ,aAddButton( this, ModuleRes( PB_ADDTABLE ) ) - ,aCloseButton( this, ModuleRes( PB_CLOSE ) ) - ,aHelpButton( this, ModuleRes( PB_HELP ) ) - ,m_rContext( _rContext ) + : ModelessDialog(pParent, "TablesJoinDialog", "dbaccess/ui/tablesjoindialog.ui") + , m_rContext(_rContext) { - // the Close-Button already has a standard help text which should not - // occur here. Therefore, resetting the text and giving a new ID - aCloseButton.SetHelpText(OUString()); - aCloseButton.SetHelpId(HID_JOINSH_ADDTAB_CLOSE); - - m_aTableList.SetHelpId( HID_JOINSH_ADDTAB_TABLELIST ); - m_aQueryList.SetHelpId( HID_JOINSH_ADDTAB_QUERYLIST ); - - m_aCaseTables.SetClickHdl( LINK( this, OAddTableDlg, OnTypeSelected ) ); - m_aCaseQueries.SetClickHdl( LINK( this, OAddTableDlg, OnTypeSelected ) ); - aAddButton.SetClickHdl( LINK( this, OAddTableDlg, AddClickHdl ) ); - aCloseButton.SetClickHdl( LINK( this, OAddTableDlg, CloseClickHdl ) ); - m_aTableList.SetDoubleClickHdl( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); - m_aTableList.SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); - m_aQueryList.SetDoubleClickHdl( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); - m_aQueryList.SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); - - m_aTableList.EnableInplaceEditing( false ); - m_aTableList.SetStyle(m_aTableList.GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); - m_aTableList.EnableCheckButton( NULL ); // do not show any buttons - m_aTableList.SetSelectionMode( SINGLE_SELECTION ); - m_aTableList.notifyHiContrastChanged(); - m_aTableList.suppressEmptyFolders(); - - m_aQueryList.EnableInplaceEditing( false ); - m_aQueryList.SetSelectionMode( SINGLE_SELECTION ); + get(m_pCaseTables, "tables"); + get(m_pCaseQueries, "queries"); + + get(m_pTableList, "tablelist"); + get(m_pQueryList, "querylist"); + Size aSize(LogicToPixel(Size(106 , 122), MAP_APPFONT)); + m_pTableList->set_height_request(aSize.Height()); + m_pTableList->set_width_request(aSize.Width()); + get(m_pQueryList, "querylist"); + m_pQueryList->set_height_request(aSize.Height()); + m_pQueryList->set_width_request(aSize.Width()); + + get(m_pAddButton, "add"); + get(m_pCloseButton, "close"); + + m_pCaseTables->SetClickHdl( LINK( this, OAddTableDlg, OnTypeSelected ) ); + m_pCaseQueries->SetClickHdl( LINK( this, OAddTableDlg, OnTypeSelected ) ); + m_pAddButton->SetClickHdl( LINK( this, OAddTableDlg, AddClickHdl ) ); + m_pCloseButton->SetClickHdl( LINK( this, OAddTableDlg, CloseClickHdl ) ); + m_pTableList->SetDoubleClickHdl( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); + m_pTableList->SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); + m_pQueryList->SetDoubleClickHdl( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); + m_pQueryList->SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); + + m_pTableList->EnableInplaceEditing( false ); + m_pTableList->SetStyle(m_pTableList->GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); + m_pTableList->EnableCheckButton( NULL ); // do not show any buttons + m_pTableList->SetSelectionMode( SINGLE_SELECTION ); + m_pTableList->notifyHiContrastChanged(); + m_pTableList->suppressEmptyFolders(); + + m_pQueryList->EnableInplaceEditing( false ); + m_pQueryList->SetSelectionMode( SINGLE_SELECTION ); if ( !m_rContext.allowQueries() ) { - m_aCaseTables.Hide(); - m_aCaseQueries.Hide(); - - long nPixelDiff = m_aTableList.GetPosPixel().Y() - m_aCaseTables.GetPosPixel().Y(); - - Point aListPos( m_aTableList.GetPosPixel() ); - aListPos.Y() -= nPixelDiff; - - Size aListSize( m_aTableList.GetSizePixel() ); - aListSize.Height() += nPixelDiff; - - m_aTableList.SetPosSizePixel( aListPos, aListSize ); + m_pCaseTables->Hide(); + m_pCaseQueries->Hide(); } - FreeResource(); - SetText( getDialogTitleForContext( m_rContext ) ); } @@ -384,36 +371,36 @@ void OAddTableDlg::impl_switchTo( ObjectList _eList ) switch ( _eList ) { case Tables: - m_aTableList.Show( true ); m_aCaseTables.Check( sal_True ); - m_aQueryList.Show( false ); m_aCaseQueries.Check( sal_False ); - m_pCurrentList.reset( new TableListFacade( m_aTableList, m_rContext.getConnection() ) ); - m_aTableList.GrabFocus(); + m_pTableList->Show( true ); m_pCaseTables->Check( sal_True ); + m_pQueryList->Show( false ); m_pCaseQueries->Check( sal_False ); + m_xCurrentList.reset( new TableListFacade( *m_pTableList, m_rContext.getConnection() ) ); + m_pTableList->GrabFocus(); break; case Queries: - m_aTableList.Show( false ); m_aCaseTables.Check( sal_False ); - m_aQueryList.Show( true ); m_aCaseQueries.Check( sal_True ); - m_pCurrentList.reset( new QueryListFacade( m_aQueryList, m_rContext.getConnection() ) ); - m_aQueryList.GrabFocus(); + m_pTableList->Show( false ); m_pCaseTables->Check( sal_False ); + m_pQueryList->Show( true ); m_pCaseQueries->Check( sal_True ); + m_xCurrentList.reset( new QueryListFacade( *m_pQueryList, m_rContext.getConnection() ) ); + m_pQueryList->GrabFocus(); break; } - m_pCurrentList->updateTableObjectList( m_rContext.allowViews() ); + m_xCurrentList->updateTableObjectList( m_rContext.allowViews() ); } void OAddTableDlg::Update() { - if ( !m_pCurrentList.get() ) + if ( !m_xCurrentList.get() ) impl_switchTo( Tables ); else - m_pCurrentList->updateTableObjectList( m_rContext.allowViews() ); + m_xCurrentList->updateTableObjectList( m_rContext.allowViews() ); } void OAddTableDlg::impl_addTable() { - if ( m_pCurrentList->isLeafSelected() ) + if ( m_xCurrentList->isLeafSelected() ) { OUString sSelectedName, sAliasName; - sSelectedName = m_pCurrentList->getSelectedName( sAliasName ); + sSelectedName = m_xCurrentList->getSelectedName( sAliasName ); m_rContext.addTableWindow( sSelectedName, sAliasName ); } @@ -440,7 +427,7 @@ IMPL_LINK( OAddTableDlg, TableListDoubleClickHdl, void*, /*EMPTY_ARG*/ ) IMPL_LINK( OAddTableDlg, TableListSelectHdl, void*, /*EMPTY_ARG*/ ) { - aAddButton.Enable( m_pCurrentList->isLeafSelected() ); + m_pAddButton->Enable( m_xCurrentList->isLeafSelected() ); return 0; } @@ -451,7 +438,7 @@ IMPL_LINK( OAddTableDlg, CloseClickHdl, Button*, /*pButton*/ ) IMPL_LINK( OAddTableDlg, OnTypeSelected, void*, /*EMPTY_ARG*/ ) { - if ( m_aCaseTables.IsChecked() ) + if ( m_pCaseTables->IsChecked() ) impl_switchTo( Tables ); else impl_switchTo( Queries ); @@ -473,7 +460,6 @@ OUString OAddTableDlg::getDialogTitleForContext( IAddTableDialogContext& _rConte { OUString sTitle; - ::svt::OLocalResourceAccess aLocalRes( ModuleRes( DLG_JOIN_TABADD ), RSC_MODELESSDIALOG ); if ( _rContext.allowQueries() ) sTitle = ModuleRes( STR_ADD_TABLE_OR_QUERY ); else diff --git a/dbaccess/source/ui/dlg/adtabdlg.hrc b/dbaccess/source/ui/dlg/adtabdlg.hrc deleted file mode 100644 index 4b646944f0c4..000000000000 --- a/dbaccess/source/ui/dlg/adtabdlg.hrc +++ /dev/null @@ -1,39 +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_ADTABDLG_HRC -#define DBAUI_ADTABDLG_HRC - -#define LB_TABLE_OR_QUERY 1 -#define LB_DATABASE 2 - -#define FT_DATABASE 1 - -#define PB_ADDTABLE 1 -#define PB_CLOSE 2 -#define PB_HELP 3 - -#define RB_CASE_TABLES 1 -#define RB_CASE_QUERIES 2 - -#define STR_ADD_TABLES 1 -#define STR_ADD_TABLE_OR_QUERY 2 - -#endif // DBAUI_ADTABDLG_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/adtabdlg.src b/dbaccess/source/ui/dlg/adtabdlg.src deleted file mode 100644 index 05867eddfdb8..000000000000 --- a/dbaccess/source/ui/dlg/adtabdlg.src +++ /dev/null @@ -1,97 +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 "adtabdlg.hrc" -#include "dbaccess_helpid.hrc" -#include "dbu_dlg.hrc" - -ModelessDialog DLG_JOIN_TABADD -{ - OutputSize = TRUE ; - SVLook = TRUE ; - HelpID = HID_DLG_JOIN_TABADD ; - Size = MAP_APPFONT ( 178 , 147 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - - RadioButton RB_CASE_TABLES - { - HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_TABLES"; - Pos = MAP_APPFONT( 6, 6 ); - Size = MAP_APPFONT( 50, 8 ); - Text [ en-US ] = "Tables"; - }; - - RadioButton RB_CASE_QUERIES - { - HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_QUERIES"; - Pos = MAP_APPFONT( 62, 6 ); - Size = MAP_APPFONT( 50, 8 ); - Text [ en-US ] = "Queries"; - }; - - Control LB_TABLE_OR_QUERY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 18 ) ; - Size = MAP_APPFONT ( 106 , 122 ) ; - TabStop = TRUE ; - Hide = TRUE; - Group = TRUE; - }; - - PushButton PB_ADDTABLE - { - HelpID = "dbaccess:PushButton:DLG_JOIN_TABADD:PB_ADDTABLE"; - Pos = MAP_APPFONT ( 123 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add" ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - - CancelButton PB_CLOSE - { - Pos = MAP_APPFONT ( 123 , 22 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - HelpId = HID_JOINSH_ADDTAB_CLOSE; - Text [ en-US ] = "~Close" ; - TabStop = TRUE ; - }; - - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 123 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - - String STR_ADD_TABLES - { - Text [ en-US ] = "Add Tables"; - }; - - String STR_ADD_TABLE_OR_QUERY - { - Text [ en-US ] = "Add Table or Query" ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index f4b8b703b5bf..947e582ef421 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -19,20 +19,14 @@ #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_ADTABDLG_HXX #define INCLUDED_DBACCESS_SOURCE_UI_INC_ADTABDLG_HXX +#include <boost/scoped_ptr.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> #include <vcl/dialog.hxx> - #include <vcl/button.hxx> - #include <vcl/fixed.hxx> - -#include <com/sun/star/sdbc/XConnection.hpp> - #include <vcl/lstbox.hxx> - #include "tabletree.hxx" -#include <memory> - namespace dbaui { /** unifies the access to a list of table/query objects @@ -64,20 +58,17 @@ namespace dbaui class OAddTableDlg : public ModelessDialog { - RadioButton m_aCaseTables; - RadioButton m_aCaseQueries; + RadioButton* m_pCaseTables; + RadioButton* m_pCaseQueries; - OTableTreeListBox m_aTableList; - SvTreeListBox m_aQueryList; - ::std::auto_ptr< TableObjectListFacade > - m_pCurrentList; + OTableTreeListBox* m_pTableList; + SvTreeListBox* m_pQueryList; + boost::scoped_ptr< TableObjectListFacade > m_xCurrentList; - PushButton aAddButton; - CancelButton aCloseButton; - HelpButton aHelpButton; + PushButton* m_pAddButton; + PushButton* m_pCloseButton; - IAddTableDialogContext& - m_rContext; + IAddTableDialogContext& m_rContext; DECL_LINK( AddClickHdl, Button* ); DECL_LINK( CloseClickHdl, Button* ); @@ -91,7 +82,7 @@ namespace dbaui IAddTableDialogContext& _rContext ); virtual ~OAddTableDlg(); - void DetermineAddTable() { aAddButton.Enable( impl_isAddAllowed() ); } + void DetermineAddTable() { m_pAddButton->Enable( impl_isAddAllowed() ); } void Update(); static OUString getDialogTitleForContext( diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc index dcf445016ec6..bedbae4b1846 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hrc +++ b/dbaccess/source/ui/inc/dbu_dlg.hrc @@ -69,8 +69,8 @@ // FREE #define STR_COMMAND_EXECUTED_SUCCESSFULLY RID_STR_DLG_START + 23 #define STR_DIRECTSQL_CONNECTIONLOST RID_STR_DLG_START + 24 - // FREE - // FREE +#define STR_ADD_TABLES RID_STR_DLG_START + 25 +#define STR_ADD_TABLE_OR_QUERY RID_STR_DLG_START + 26 #define STR_USERADMIN_NOT_AVAILABLE RID_STR_DLG_START + 27 #define STR_TAB_INDEX_SORTORDER RID_STR_DLG_START + 28 #define STR_TAB_INDEX_FIELD RID_STR_DLG_START + 29 |