Kaydet (Commit) 5c72a213 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert table filter page to .ui

Change-Id: I7bfb7698e2a5303b492766fba564c7b9033bcc52
üst b3114106
...@@ -20,6 +20,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ ...@@ -20,6 +20,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/rowheightdialog \ dbaccess/uiconfig/ui/rowheightdialog \
dbaccess/uiconfig/ui/sortdialog \ dbaccess/uiconfig/ui/sortdialog \
dbaccess/uiconfig/ui/tablesfilterdialog \ dbaccess/uiconfig/ui/tablesfilterdialog \
dbaccess/uiconfig/ui/tablesfilterpage \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#define HID_DSADMIN_PAGE_JDBC "DBACCESS_HID_DSADMIN_PAGE_JDBC" #define HID_DSADMIN_PAGE_JDBC "DBACCESS_HID_DSADMIN_PAGE_JDBC"
#define HID_DSADMIN_PAGE_ODBC "DBACCESS_HID_DSADMIN_PAGE_ODBC" #define HID_DSADMIN_PAGE_ODBC "DBACCESS_HID_DSADMIN_PAGE_ODBC"
#define HID_DSADMIN_PAGE_TEXT "DBACCESS_HID_DSADMIN_PAGE_TEXT" #define HID_DSADMIN_PAGE_TEXT "DBACCESS_HID_DSADMIN_PAGE_TEXT"
#define HID_DSADMIN_TABLE_SUBSCRIPTION "DBACCESS_HID_DSADMIN_TABLE_SUBSCRIPTION"
#define HID_DSADMIN_DSACTIONS_NEWDS "DBACCESS_HID_DSADMIN_DSACTIONS_NEWDS" #define HID_DSADMIN_DSACTIONS_NEWDS "DBACCESS_HID_DSADMIN_DSACTIONS_NEWDS"
#define HID_DSADMIN_DSACTIONS_DELETEDS "DBACCESS_HID_DSADMIN_DSACTIONS_DELETEDS" #define HID_DSADMIN_DSACTIONS_DELETEDS "DBACCESS_HID_DSADMIN_DSACTIONS_DELETEDS"
#define HID_DSADMIN_DSACTIONS_RESTOREDS "DBACCESS_HID_DSADMIN_DSACTIONS_RESTOREDS" #define HID_DSADMIN_DSACTIONS_RESTOREDS "DBACCESS_HID_DSADMIN_DSACTIONS_RESTOREDS"
...@@ -63,7 +62,6 @@ ...@@ -63,7 +62,6 @@
#define HID_DSADMIN_ALL_TABLES "DBACCESS_HID_DSADMIN_ALL_TABLES" #define HID_DSADMIN_ALL_TABLES "DBACCESS_HID_DSADMIN_ALL_TABLES"
#define HID_DSADMIN_NO_TABLES "DBACCESS_HID_DSADMIN_NO_TABLES" #define HID_DSADMIN_NO_TABLES "DBACCESS_HID_DSADMIN_NO_TABLES"
#define HID_DSADMIN_SELECT_TABLES "DBACCESS_HID_DSADMIN_SELECT_TABLES" #define HID_DSADMIN_SELECT_TABLES "DBACCESS_HID_DSADMIN_SELECT_TABLES"
#define HID_DSADMIN_TABLE_SELECTOR "DBACCESS_HID_DSADMIN_TABLE_SELECTOR"
#define HID_DSADMIN_SUPPRESS_VERSIONCL "DBACCESS_HID_DSADMIN_SUPPRESS_VERSIONCL" #define HID_DSADMIN_SUPPRESS_VERSIONCL "DBACCESS_HID_DSADMIN_SUPPRESS_VERSIONCL"
#define HID_GENERIC_SQL_ERROR "DBACCESS_HID_GENERIC_SQL_ERROR" #define HID_GENERIC_SQL_ERROR "DBACCESS_HID_GENERIC_SQL_ERROR"
...@@ -178,7 +176,6 @@ ...@@ -178,7 +176,6 @@
#define HID_BROWSER_VIEW_CREATE_DESIGN "DBACCESS_HID_BROWSER_VIEW_CREATE_DESIGN" #define HID_BROWSER_VIEW_CREATE_DESIGN "DBACCESS_HID_BROWSER_VIEW_CREATE_DESIGN"
#define HID_DSADMIN_DOCUMENTS "DBACCESS_HID_DSADMIN_DOCUMENTS" #define HID_DSADMIN_DOCUMENTS "DBACCESS_HID_DSADMIN_DOCUMENTS"
#define HID_DSADMIN_DOCUMENTLINKS "DBACCESS_HID_DSADMIN_DOCUMENTLINKS" #define HID_DSADMIN_DOCUMENTLINKS "DBACCESS_HID_DSADMIN_DOCUMENTLINKS"
#define HID_DSADMIN_FILTER_EXPLANATION "DBACCESS_HID_DSADMIN_FILTER_EXPLANATION"
#define HID_CONFIRM_DROP_BUTTON_ALL "DBACCESS_HID_CONFIRM_DROP_BUTTON_ALL" #define HID_CONFIRM_DROP_BUTTON_ALL "DBACCESS_HID_CONFIRM_DROP_BUTTON_ALL"
#define HID_DSBROWSER_BOOKMARK_SELECTED "DBACCESS_HID_DSBROWSER_BOOKMARK_SELECTED" #define HID_DSBROWSER_BOOKMARK_SELECTED "DBACCESS_HID_DSBROWSER_BOOKMARK_SELECTED"
#define HID_DSADMIN_TABLE_TOOLBOX "DBACCESS_HID_DSADMIN_TABLE_TOOLBOX" #define HID_DSADMIN_TABLE_TOOLBOX "DBACCESS_HID_DSADMIN_TABLE_TOOLBOX"
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "imageprovider.hxx" #include "imageprovider.hxx"
#include "moduledbu.hxx" #include "moduledbu.hxx"
#include "dbu_control.hrc" #include "dbu_control.hrc"
#include <vcl/layout.hxx>
#include <vcl/menu.hxx> #include <vcl/menu.hxx>
#include <connectivity/dbtools.hxx> #include <connectivity/dbtools.hxx>
#include <comphelper/types.hxx> #include <comphelper/types.hxx>
...@@ -73,6 +74,15 @@ OTableTreeListBox::OTableTreeListBox(Window* pParent, WinBits nWinStyle) ...@@ -73,6 +74,15 @@ OTableTreeListBox::OTableTreeListBox(Window* pParent, WinBits nWinStyle)
implSetDefaultImages(); implSetDefaultImages();
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeOTableTreeListBox(Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = 0;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
return new OTableTreeListBox(pParent, nWinStyle);
}
OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId, sal_Bool _bVirtualRoot) OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId, sal_Bool _bVirtualRoot)
:OMarkableTreeListBox(pParent, rResId) :OMarkableTreeListBox(pParent, rResId)
,m_xImageProvider( new ImageProvider ) ,m_xImageProvider( new ImageProvider )
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
// FREE // FREE
#define FT_JDBCDRIVERCLASS 7 #define FT_JDBCDRIVERCLASS 7
#define FT_SPECIAL_MESSAGE 8 #define FT_SPECIAL_MESSAGE 8
#define FT_FILTER_EXPLANATION 9
#define FT_HOSTNAME 10 #define FT_HOSTNAME 10
#define FT_BASEDN 11 #define FT_BASEDN 11
#define FT_PORTNUMBER 12 #define FT_PORTNUMBER 12
...@@ -53,8 +52,6 @@ ...@@ -53,8 +52,6 @@
#define FL_SEPARATOR2 1 #define FL_SEPARATOR2 1
#define CTL_TABLESUBSCRIPTION 1
#define TLB_ACTIONS 1 #define TLB_ACTIONS 1
#define NF_PORTNUMBER 1 #define NF_PORTNUMBER 1
......
...@@ -41,52 +41,4 @@ String STR_COULD_NOT_CREATE_DIRECTORY ...@@ -41,52 +41,4 @@ String STR_COULD_NOT_CREATE_DIRECTORY
Text [ en-US ] = "The directory $name$ could not be created."; Text [ en-US ] = "The directory $name$ could not be created.";
}; };
#define EDIT_SIZE_X 50
#define FT_SIZE_X 90
#define WIN_X 220
#define WIN_Y 72
#define PAGE_X_T (PAGE_X -80)
#define PAGE_Y_T (PAGE_Y -50)
TabPage PAGE_TABLESUBSCRIPTION
{
SVLook = TRUE ;
Hide = TRUE;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( PAGE_X_T, PAGE_Y_T) ;
HelpId = HID_DSADMIN_TABLE_SUBSCRIPTION;
Text [ en-US ] = "Tables Filter" ;
FixedLine FL_SEPARATOR1
{
Pos = MAP_APPFONT ( RELATED_CONTROLS , UNRELATED_CONTROLS ) ;
Size = MAP_APPFONT ( PAGE_X_T - 2* RELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ;
Text [ en-US ] = "Tables and table filter";
};
Control CTL_TABLESUBSCRIPTION
{
Pos = MAP_APPFONT ( UNRELATED_CONTROLS , UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS) ;
Size = MAP_APPFONT ( PAGE_X_T - 2*UNRELATED_CONTROLS , 81 ) ;
Group = TRUE;
Border = TRUE ;
TabStop = TRUE ;
HelpId = HID_DSADMIN_TABLE_SELECTOR;
};
FixedText FT_FILTER_EXPLANATION
{
Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 2*UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS + 81 ) ;
Size = MAP_APPFONT ( PAGE_X_T - 2*UNRELATED_CONTROLS , 16 ) ;
HelpId = HID_DSADMIN_FILTER_EXPLANATION;
WordBreak = TRUE;
Text [ en-US ] = "Mark the tables that should be visible for the applications.";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -71,30 +71,34 @@ namespace dbaui ...@@ -71,30 +71,34 @@ namespace dbaui
// OTableSubscriptionPage // OTableSubscriptionPage
DBG_NAME(OTableSubscriptionPage) DBG_NAME(OTableSubscriptionPage)
OTableSubscriptionPage::OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs,OTableSubscriptionDialog* _pTablesDlg )
:OGenericAdministrationPage( pParent, ModuleRes(PAGE_TABLESUBSCRIPTION), _rCoreAttrs ) OTableSubscriptionPage::OTableSubscriptionPage(Window* pParent, const SfxItemSet& _rCoreAttrs,
,m_aTables (this, ModuleRes(FL_SEPARATOR1)) OTableSubscriptionDialog* _pTablesDlg)
,m_aTablesList (this, ModuleRes(CTL_TABLESUBSCRIPTION),sal_True) : OGenericAdministrationPage(pParent, "TablesFilterPage",
,m_aExplanation (this, ModuleRes(FT_FILTER_EXPLANATION)) "dbaccess/ui/tablesfilterpage.ui", _rCoreAttrs)
,m_bCatalogAtStart ( sal_True ) , m_bCatalogAtStart(true)
,m_pTablesDlg(_pTablesDlg) , m_pTablesDlg(_pTablesDlg)
{ {
get(m_pTables, "TablesFilterPage");
get(m_pTablesList, "treeview");
m_pTablesList->set_width_request(56 * m_pTablesList->approximate_char_width());
m_pTablesList->set_height_request(12 * m_pTablesList->GetTextHeight());
DBG_CTOR(OTableSubscriptionPage,NULL); DBG_CTOR(OTableSubscriptionPage,NULL);
m_aTablesList.SetCheckHandler(getControlModifiedLink()); m_pTablesList->SetCheckHandler(getControlModifiedLink());
// initialize the TabListBox // initialize the TabListBox
m_aTablesList.SetSelectionMode( MULTIPLE_SELECTION ); m_pTablesList->SetSelectionMode( MULTIPLE_SELECTION );
m_aTablesList.SetDragDropMode( 0 ); m_pTablesList->SetDragDropMode( 0 );
m_aTablesList.EnableInplaceEditing( sal_False ); m_pTablesList->EnableInplaceEditing( sal_False );
m_aTablesList.SetStyle(m_aTablesList.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); m_pTablesList->SetStyle(m_pTablesList->GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
m_aTablesList.Clear(); m_pTablesList->Clear();
FreeResource(); m_pTablesList->SetCheckButtonHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryChecked));
m_pTablesList->SetCheckHandler(LINK(this, OTableSubscriptionPage, OnTreeEntryChecked));
m_aTablesList.SetCheckButtonHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryChecked));
m_aTablesList.SetCheckHandler(LINK(this, OTableSubscriptionPage, OnTreeEntryChecked));
} }
OTableSubscriptionPage::~OTableSubscriptionPage() OTableSubscriptionPage::~OTableSubscriptionPage()
...@@ -116,7 +120,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -116,7 +120,7 @@ DBG_NAME(OTableSubscriptionPage)
if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{ {
// Check if we need to get new images for normal/high contrast mode // Check if we need to get new images for normal/high contrast mode
m_aTablesList.notifyHiContrastChanged(); m_pTablesList->notifyHiContrastChanged();
} }
} }
void OTableSubscriptionPage::DataChanged( const DataChangedEvent& rDCEvt ) void OTableSubscriptionPage::DataChanged( const DataChangedEvent& rDCEvt )
...@@ -128,17 +132,17 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -128,17 +132,17 @@ DBG_NAME(OTableSubscriptionPage)
( rDCEvt.GetFlags() & SETTINGS_STYLE )) ( rDCEvt.GetFlags() & SETTINGS_STYLE ))
{ {
// Check if we need to get new images for normal/high contrast mode // Check if we need to get new images for normal/high contrast mode
m_aTablesList.notifyHiContrastChanged(); m_pTablesList->notifyHiContrastChanged();
} }
} }
void OTableSubscriptionPage::resizeControls(const Size& _rDiff) void OTableSubscriptionPage::resizeControls(const Size& _rDiff)
{ {
if ( _rDiff.Height() ) if ( _rDiff.Height() )
{ {
Size aOldSize = m_aTablesList.GetSizePixel(); Size aOldSize = m_pTablesList->GetSizePixel();
aOldSize.Height() -= _rDiff.Height(); aOldSize.Height() -= _rDiff.Height();
m_aTablesList.SetPosSizePixel( m_pTablesList->SetPosSizePixel(
m_aTablesList.GetPosPixel()+Point(0,_rDiff.Height()), m_pTablesList->GetPosPixel()+Point(0,_rDiff.Height()),
aOldSize aOldSize
); );
} }
...@@ -163,7 +167,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -163,7 +167,7 @@ DBG_NAME(OTableSubscriptionPage)
// check the ones which are in the list // check the ones which are in the list
OUString sCatalog, sSchema, sName; OUString sCatalog, sSchema, sName;
SvTreeListEntry* pRootEntry = m_aTablesList.getAllObjectsEntry(); SvTreeListEntry* pRootEntry = m_pTablesList->getAllObjectsEntry();
sal_Bool bAllTables = sal_False; sal_Bool bAllTables = sal_False;
sal_Bool bAllSchemas = sal_False; sal_Bool bAllSchemas = sal_False;
...@@ -179,34 +183,34 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -179,34 +183,34 @@ DBG_NAME(OTableSubscriptionPage)
bAllSchemas = (1 == sSchema.getLength()) && ('%' == sSchema[0]); bAllSchemas = (1 == sSchema.getLength()) && ('%' == sSchema[0]);
// the catalog entry // the catalog entry
SvTreeListEntry* pCatalog = m_aTablesList.GetEntryPosByName(sCatalog, pRootEntry); SvTreeListEntry* pCatalog = m_pTablesList->GetEntryPosByName(sCatalog, pRootEntry);
if (!(pCatalog || sCatalog.isEmpty())) if (!(pCatalog || sCatalog.isEmpty()))
// the table (resp. its catalog) refered in this filter entry does not exist anymore // the table (resp. its catalog) refered in this filter entry does not exist anymore
continue; continue;
if (bAllSchemas && pCatalog) if (bAllSchemas && pCatalog)
{ {
m_aTablesList.checkWildcard(pCatalog); m_pTablesList->checkWildcard(pCatalog);
continue; continue;
} }
// the schema entry // the schema entry
SvTreeListEntry* pSchema = m_aTablesList.GetEntryPosByName(sSchema, (pCatalog ? pCatalog : pRootEntry)); SvTreeListEntry* pSchema = m_pTablesList->GetEntryPosByName(sSchema, (pCatalog ? pCatalog : pRootEntry));
if (!(pSchema || sSchema.isEmpty())) if (!(pSchema || sSchema.isEmpty()))
// the table (resp. its schema) refered in this filter entry does not exist anymore // the table (resp. its schema) refered in this filter entry does not exist anymore
continue; continue;
if (bAllTables && pSchema) if (bAllTables && pSchema)
{ {
m_aTablesList.checkWildcard(pSchema); m_pTablesList->checkWildcard(pSchema);
continue; continue;
} }
SvTreeListEntry* pEntry = m_aTablesList.GetEntryPosByName(sName, pSchema ? pSchema : (pCatalog ? pCatalog : pRootEntry) ); SvTreeListEntry* pEntry = m_pTablesList->GetEntryPosByName(sName, pSchema ? pSchema : (pCatalog ? pCatalog : pRootEntry) );
if (pEntry) if (pEntry)
m_aTablesList.SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); m_pTablesList->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
} }
m_aTablesList.CheckButtons(); m_pTablesList->CheckButtons();
} }
void OTableSubscriptionPage::implCompleteTablesCheck( const ::com::sun::star::uno::Sequence< OUString >& _rTableFilter ) void OTableSubscriptionPage::implCompleteTablesCheck( const ::com::sun::star::uno::Sequence< OUString >& _rTableFilter )
...@@ -247,7 +251,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -247,7 +251,7 @@ DBG_NAME(OTableSubscriptionPage)
{ {
if (!m_pTablesDlg->getCurrentSettings(aConnectionParams)) if (!m_pTablesDlg->getCurrentSettings(aConnectionParams))
{ {
m_aTablesList.Clear(); m_pTablesList->Clear();
m_pTablesDlg->endExecution(); m_pTablesDlg->endExecution();
return; return;
} }
...@@ -277,8 +281,8 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -277,8 +281,8 @@ DBG_NAME(OTableSubscriptionPage)
try try
{ {
WaitObject aWaitCursor(this); WaitObject aWaitCursor(this);
m_aTablesList.GetModel()->SetSortMode(SortAscending); m_pTablesList->GetModel()->SetSortMode(SortAscending);
m_aTablesList.GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare)); m_pTablesList->GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare));
Reference< XDriver > xDriver; Reference< XDriver > xDriver;
Reference<XPropertySet> xProp = m_pTablesDlg->getCurrentDataSource(); Reference<XPropertySet> xProp = m_pTablesDlg->getCurrentDataSource();
...@@ -309,7 +313,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -309,7 +313,7 @@ DBG_NAME(OTableSubscriptionPage)
if ( m_xCurrentConnection.is() ) if ( m_xCurrentConnection.is() )
{ {
m_aTablesList.UpdateTableList( m_xCurrentConnection ); m_pTablesList->UpdateTableList( m_xCurrentConnection );
if (m_pTablesDlg) if (m_pTablesDlg)
m_pTablesDlg->successfullyConnected(); m_pTablesDlg->successfullyConnected();
} }
...@@ -324,10 +328,8 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -324,10 +328,8 @@ DBG_NAME(OTableSubscriptionPage)
// establishing the connection failed. Show an error window and exit. // establishing the connection failed. Show an error window and exit.
OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo ); OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo );
aMessageBox.Execute(); aMessageBox.Execute();
m_aTables.Enable(sal_False); m_pTables->Enable(false);
m_aTablesList.Enable(sal_False); m_pTablesList->Clear();
m_aExplanation.Enable(sal_False);
m_aTablesList.Clear();
if ( m_pTablesDlg ) if ( m_pTablesDlg )
{ {
...@@ -370,12 +372,12 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -370,12 +372,12 @@ DBG_NAME(OTableSubscriptionPage)
implCompleteTablesCheck( aTableFilter ); implCompleteTablesCheck( aTableFilter );
// expand the first entry by default // expand the first entry by default
SvTreeListEntry* pExpand = m_aTablesList.getAllObjectsEntry(); SvTreeListEntry* pExpand = m_pTablesList->getAllObjectsEntry();
while (pExpand) while (pExpand)
{ {
m_aTablesList.Expand(pExpand); m_pTablesList->Expand(pExpand);
pExpand = m_aTablesList.FirstChild(pExpand); pExpand = m_pTablesList->FirstChild(pExpand);
if (pExpand && m_aTablesList.NextSibling(pExpand)) if (pExpand && m_pTablesList->NextSibling(pExpand))
pExpand = NULL; pExpand = NULL;
} }
...@@ -386,15 +388,15 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -386,15 +388,15 @@ DBG_NAME(OTableSubscriptionPage)
void OTableSubscriptionPage::CheckAll( sal_Bool _bCheck ) void OTableSubscriptionPage::CheckAll( sal_Bool _bCheck )
{ {
SvButtonState eState = _bCheck ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED; SvButtonState eState = _bCheck ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED;
SvTreeListEntry* pEntry = m_aTablesList.First(); SvTreeListEntry* pEntry = m_pTablesList->First();
while (pEntry) while (pEntry)
{ {
m_aTablesList.SetCheckButtonState( pEntry, eState); m_pTablesList->SetCheckButtonState( pEntry, eState);
pEntry = m_aTablesList.Next(pEntry); pEntry = m_pTablesList->Next(pEntry);
} }
if (_bCheck && m_aTablesList.getAllObjectsEntry()) if (_bCheck && m_pTablesList->getAllObjectsEntry())
m_aTablesList.checkWildcard(m_aTablesList.getAllObjectsEntry()); m_pTablesList->checkWildcard(m_pTablesList->getAllObjectsEntry());
} }
int OTableSubscriptionPage::DeactivatePage(SfxItemSet* _pSet) int OTableSubscriptionPage::DeactivatePage(SfxItemSet* _pSet)
...@@ -453,10 +455,10 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -453,10 +455,10 @@ DBG_NAME(OTableSubscriptionPage)
static const OUString sWildcard("%"); static const OUString sWildcard("%");
OUString sComposedName; OUString sComposedName;
const SvTreeListEntry* pAllObjectsEntry = m_aTablesList.getAllObjectsEntry(); const SvTreeListEntry* pAllObjectsEntry = m_pTablesList->getAllObjectsEntry();
if (!pAllObjectsEntry) if (!pAllObjectsEntry)
return aTableFilter; return aTableFilter;
SvTreeListEntry* pEntry = m_aTablesList.GetModel()->Next(const_cast<SvTreeListEntry*>(pAllObjectsEntry)); SvTreeListEntry* pEntry = m_pTablesList->GetModel()->Next(const_cast<SvTreeListEntry*>(pAllObjectsEntry));
while(pEntry) while(pEntry)
{ {
sal_Bool bCatalogWildcard = sal_False; sal_Bool bCatalogWildcard = sal_False;
...@@ -464,31 +466,31 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -464,31 +466,31 @@ DBG_NAME(OTableSubscriptionPage)
SvTreeListEntry* pSchema = NULL; SvTreeListEntry* pSchema = NULL;
SvTreeListEntry* pCatalog = NULL; SvTreeListEntry* pCatalog = NULL;
if (m_aTablesList.GetCheckButtonState(pEntry) == SV_BUTTON_CHECKED && !m_aTablesList.GetModel()->HasChildren(pEntry)) if (m_pTablesList->GetCheckButtonState(pEntry) == SV_BUTTON_CHECKED && !m_pTablesList->GetModel()->HasChildren(pEntry))
{ // checked and a leaf, which means it's no catalog, no schema, but a real table { // checked and a leaf, which means it's no catalog, no schema, but a real table
OUString sCatalog; OUString sCatalog;
if(m_aTablesList.GetModel()->HasParent(pEntry)) if(m_pTablesList->GetModel()->HasParent(pEntry))
{ {
pSchema = m_aTablesList.GetModel()->GetParent(pEntry); pSchema = m_pTablesList->GetModel()->GetParent(pEntry);
if (pAllObjectsEntry == pSchema) if (pAllObjectsEntry == pSchema)
// do not want to have the root entry // do not want to have the root entry
pSchema = NULL; pSchema = NULL;
if (pSchema) if (pSchema)
{ // it's a real schema entry, not the "all objects" root { // it's a real schema entry, not the "all objects" root
if(m_aTablesList.GetModel()->HasParent(pSchema)) if(m_pTablesList->GetModel()->HasParent(pSchema))
{ {
pCatalog = m_aTablesList.GetModel()->GetParent(pSchema); pCatalog = m_pTablesList->GetModel()->GetParent(pSchema);
if (pAllObjectsEntry == pCatalog) if (pAllObjectsEntry == pCatalog)
// do not want to have the root entry // do not want to have the root entry
pCatalog = NULL; pCatalog = NULL;
if (pCatalog) if (pCatalog)
{ // it's a real catalog entry, not the "all objects" root { // it's a real catalog entry, not the "all objects" root
bCatalogWildcard = m_aTablesList.isWildcardChecked(pCatalog); bCatalogWildcard = m_pTablesList->isWildcardChecked(pCatalog);
if (m_bCatalogAtStart) if (m_bCatalogAtStart)
{ {
sComposedName += m_aTablesList.GetEntryText( pCatalog ); sComposedName += m_pTablesList->GetEntryText( pCatalog );
sComposedName += m_sCatalogSeparator; sComposedName += m_sCatalogSeparator;
if (bCatalogWildcard) if (bCatalogWildcard)
sComposedName += sWildcard; sComposedName += sWildcard;
...@@ -500,12 +502,12 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -500,12 +502,12 @@ DBG_NAME(OTableSubscriptionPage)
else else
sCatalog = ""; sCatalog = "";
sCatalog += m_sCatalogSeparator; sCatalog += m_sCatalogSeparator;
sCatalog += m_aTablesList.GetEntryText( pCatalog ); sCatalog += m_pTablesList->GetEntryText( pCatalog );
} }
} }
} }
bSchemaWildcard = m_aTablesList.isWildcardChecked(pSchema); bSchemaWildcard = m_pTablesList->isWildcardChecked(pSchema);
sComposedName += m_aTablesList.GetEntryText( pSchema ); sComposedName += m_pTablesList->GetEntryText( pSchema );
sComposedName += sDot; sComposedName += sDot;
} }
...@@ -513,7 +515,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -513,7 +515,7 @@ DBG_NAME(OTableSubscriptionPage)
sComposedName += sWildcard; sComposedName += sWildcard;
} }
if (!bSchemaWildcard && !bCatalogWildcard) if (!bSchemaWildcard && !bCatalogWildcard)
sComposedName += m_aTablesList.GetEntryText( pEntry ); sComposedName += m_pTablesList->GetEntryText( pEntry );
if (!m_bCatalogAtStart && !bCatalogWildcard) if (!m_bCatalogAtStart && !bCatalogWildcard)
sComposedName += sCatalog; sComposedName += sCatalog;
...@@ -533,7 +535,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -533,7 +535,7 @@ DBG_NAME(OTableSubscriptionPage)
else if (bSchemaWildcard) else if (bSchemaWildcard)
pEntry = implNextSibling(pSchema); pEntry = implNextSibling(pSchema);
else else
pEntry = m_aTablesList.GetModel()->Next(pEntry); pEntry = m_pTablesList->GetModel()->Next(pEntry);
} }
return aTableFilter; return aTableFilter;
...@@ -544,9 +546,9 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -544,9 +546,9 @@ DBG_NAME(OTableSubscriptionPage)
SvTreeListEntry* pReturn = NULL; SvTreeListEntry* pReturn = NULL;
if (_pEntry) if (_pEntry)
{ {
pReturn = m_aTablesList.NextSibling(_pEntry); pReturn = m_pTablesList->NextSibling(_pEntry);
if (!pReturn) if (!pReturn)
pReturn = implNextSibling(m_aTablesList.GetParent(_pEntry)); pReturn = implNextSibling(m_pTablesList->GetParent(_pEntry));
} }
return pReturn; return pReturn;
} }
...@@ -564,7 +566,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -564,7 +566,7 @@ DBG_NAME(OTableSubscriptionPage)
if ( m_xCurrentConnection.is() ) if ( m_xCurrentConnection.is() )
{ // collect the table filter data only if we have a connection - else no tables are displayed at all { // collect the table filter data only if we have a connection - else no tables are displayed at all
Sequence< OUString > aTableFilter; Sequence< OUString > aTableFilter;
if (m_aTablesList.isWildcardChecked(m_aTablesList.getAllObjectsEntry())) if (m_pTablesList->isWildcardChecked(m_pTablesList->getAllObjectsEntry()))
{ {
aTableFilter.realloc(1); aTableFilter.realloc(1);
aTableFilter[0] = "%"; aTableFilter[0] = "%";
...@@ -582,11 +584,10 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -582,11 +584,10 @@ DBG_NAME(OTableSubscriptionPage)
void OTableSubscriptionPage::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) void OTableSubscriptionPage::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
{ {
} }
void OTableSubscriptionPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) void OTableSubscriptionPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
{ {
_rControlList.push_back(new ODisableWrapper<OTableTreeListBox>(&m_aTablesList)); _rControlList.push_back(new ODisableWrapper<VclContainer>(m_pTables));
_rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aTables));
_rControlList.push_back(new ODisableWrapper<FixedText>(&m_aExplanation));
} }
} // namespace dbaui } // namespace dbaui
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "adminpages.hxx" #include "adminpages.hxx"
#include <com/sun/star/i18n/XCollator.hpp> #include <com/sun/star/i18n/XCollator.hpp>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/fixed.hxx> #include <vcl/layout.hxx>
#include "tabletree.hxx" #include "tabletree.hxx"
#include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XConnection.hpp>
...@@ -36,9 +36,8 @@ namespace dbaui ...@@ -36,9 +36,8 @@ namespace dbaui
:public OGenericAdministrationPage :public OGenericAdministrationPage
{ {
private: private:
FixedLine m_aTables; VclContainer* m_pTables;
OTableTreeListBox m_aTablesList; OTableTreeListBox* m_pTablesList;
FixedText m_aExplanation;
OUString m_sCatalogSeparator; OUString m_sCatalogSeparator;
sal_Bool m_bCatalogAtStart : 1; sal_Bool m_bCatalogAtStart : 1;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Tue Jan 21 09:48:38 2014 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkFrame" id="TablesFilterPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">18</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Mark the tables that should be visible for the applications.</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="dbulo-OTableTreeListBox" id="treeview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</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>
</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">Tables and table filter</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
</interface>
...@@ -585,6 +585,10 @@ ...@@ -585,6 +585,10 @@
generic-name="DPFunctionListBox" parent="GtkTreeView" generic-name="DPFunctionListBox" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/> icon-name="widget-gtk-treeview"/>
<glade-widget-class title="OTableTreeListBox" name="dbulo-OTableTreeListBox"
generic-name="OTableTreeListBox" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView" <glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView"
generic-name="Icon View" parent="GtkIconView" generic-name="Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/> icon-name="widget-gtk-iconview"/>
......
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