summaryrefslogtreecommitdiffstats
path: root/dbaccess/source/ui/dlg
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2000-11-10 16:35:29 +0000
committerFrank Schönheit <fs@openoffice.org>2000-11-10 16:35:29 +0000
commit1af223db78f1e3f46a3d431bbca81abc4898511e (patch)
tree9c0c82d50f31711ff379a6e093653dd4e930ac97 /dbaccess/source/ui/dlg
parentrevokeObject: do a removeEventListener (diff)
downloadcore-1af223db78f1e3f46a3d431bbca81abc4898511e.tar.gz
core-1af223db78f1e3f46a3d431bbca81abc4898511e.zip
no parameter in checkItems anymore - did not make sense in the context it is called / some small bug fixes
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx25
-rw-r--r--dbaccess/source/ui/dlg/adminpages.hxx15
2 files changed, 29 insertions, 11 deletions
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index fe996521328b..f0e3e80a0ee4 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: adminpages.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fs $ $Date: 2000-11-02 15:20:04 $
+ * last change: $Author: fs $ $Date: 2000-11-10 17:35:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -176,7 +176,7 @@ int OGenericAdministrationPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
{
- if (!checkItems(*_pSet))
+ if (!checkItems())
return KEEP_PAGE;
FillItemSet(*_pSet);
}
@@ -232,6 +232,7 @@ OGeneralPage::OGeneralPage(Window* pParent, const SfxItemSet& _rItems)
,m_aSpecialMessage (this, ResId(FT_SPECIAL_MESSAGE))
,m_pCollection(NULL)
,m_eCurrentSelection(DST_UNKNOWN)
+ ,m_bDisplayingDeleted(sal_False)
{
// fill the listbox with the UI descriptions for the possible types
// and remember the respective DSN prefixes
@@ -319,9 +320,9 @@ void OGeneralPage::onTypeSelected(DATASOURCE_TYPE _eType)
}
//-------------------------------------------------------------------------
-sal_Bool OGeneralPage::checkItems(const SfxItemSet& _rSet)
+sal_Bool OGeneralPage::checkItems()
{
- if (0 == m_aName.GetText().Len())
+ if ((0 == m_aName.GetText().Len()) && !m_bDisplayingDeleted)
{
String sErrorMsg(ModuleRes(STR_ERR_EMPTY_DSN_NAME));
ErrorBox aErrorBox(GetParent(), WB_OK, sErrorMsg);
@@ -353,6 +354,7 @@ void OGeneralPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValu
String sConnectURL, sName;
String sMessage;
+ m_bDisplayingDeleted = sal_False;
if (bValid)
{
// collect some items and some values
@@ -370,6 +372,7 @@ void OGeneralPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValu
{
OLocalResourceAccess aStringResAccess(PAGE_GENERAL, RSC_TABPAGE);
sMessage = String(ResId(STR_DATASOURCEDELETED));
+ m_bDisplayingDeleted = sal_True;
}
}
m_aSpecialMessage.SetText(sMessage);
@@ -542,6 +545,13 @@ IMPL_LINK(OGeneralPage, OnBrowseConnections, PushButton*, _pButton)
}
}
}
+ else
+ {
+ OLocalResourceAccess aLocRes(PAGE_GENERAL, RSC_TABPAGE);
+ String sError(ModuleRes(STR_NO_ADABASE_DATASOURCES));
+ ErrorBox aBox(this, WB_OK, sError);
+ aBox.Execute();
+ }
}
break;
case DST_ODBC:
@@ -1207,7 +1217,7 @@ void OTextDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSave
}
}
// -----------------------------------------------------------------------
-sal_Bool OTextDetailsPage::checkItems(const SfxItemSet& _rSet)
+sal_Bool OTextDetailsPage::checkItems()
{
OLocalResourceAccess aStringResAccess(PAGE_TEXT, RSC_TABPAGE);
// for accessing the strings which are local to our own resource block
@@ -1743,6 +1753,9 @@ IMPL_LINK( OTableSubscriptionPage, OnRadioButtonClicked, Button*, pButton )
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.12 2000/11/02 15:20:04 fs
+ * #79983# +isBrowseable / #79830# +checkItems
+ *
* Revision 1.11 2000/11/02 14:18:21 fs
* #79967# check the getenv return against NULL
*
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index c28f5936fd3a..02c054b9ea05 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: adminpages.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: fs $ $Date: 2000-11-02 15:20:04 $
+ * last change: $Author: fs $ $Date: 2000-11-10 17:35:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -127,7 +127,7 @@ protected:
void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); }
/// called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_True
- virtual sal_Bool checkItems(const SfxItemSet& _rSet) { return sal_True; }
+ virtual sal_Bool checkItems() { return sal_True; }
/** called from within Reset and ActivatePage, use to initialize the controls with the items from the given set
@param _bSaveValue if set to sal_True, the implementation should call SaveValue on all relevant controls
@@ -180,6 +180,8 @@ private:
Link m_aTypeSelectHandler; /// to be called if a new type is selected
Link m_aNameModifiedHandler; /// to be called whenever the name of the data source is changed by the user
+ sal_Bool m_bDisplayingDeleted : 1; // the currently displayed data source is deleted
+
public:
static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet);
@@ -199,7 +201,7 @@ protected:
virtual void Reset(const SfxItemSet& _rCoreAttrs);
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
- virtual sal_Bool checkItems(const SfxItemSet& _rSet);
+ virtual sal_Bool checkItems();
virtual void GetFocus();
@@ -385,7 +387,7 @@ private:
void SetSeparator( ComboBox& rBox, const String& rList, const String& rVal );
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
- virtual sal_Bool checkItems(const SfxItemSet& _rSet);
+ virtual sal_Bool checkItems();
};
//========================================================================
@@ -456,6 +458,9 @@ private:
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.9 2000/11/02 15:20:04 fs
+ * #79983# +isBrowseable / #79830# +checkItems
+ *
* Revision 1.8 2000/10/30 15:22:44 fs
* no password fields anymore - don't want to have them in and _data source aministration_ dialog
*