16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2001-2002 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# forms/wizards/AddDataSource.py |
# forms/wizards/AddDataSource.py |
71 |
if stepCode == '0': |
if stepCode == '0': |
72 |
|
|
73 |
if self.__firstConnection: |
if self.__firstConnection: |
74 |
self.variables['connection'] == self.__firstConnection |
self.variables['connection'] = self.__firstConnection |
75 |
|
|
76 |
return { 'title': 'Add DataSource', |
return { 'title': 'Add DataSource', |
77 |
'content': (WizardText('To create your DataSource, I need to know some basic information.\n\n' |
'content': (WizardText('To create your DataSource, I need to know some basic information.\n\n' |
136 |
|
|
137 |
# Create new datasource |
# Create new datasource |
138 |
datasource = self.AddElement('datasource', self.form, |
datasource = self.AddElement('datasource', self.form, |
139 |
{ 'name': self.variables['name'], |
{ 'name': self.GetUniqueName(self.variables['name']), |
140 |
'database': self.variables['connection'], |
'connection': self.variables['connection'], |
141 |
'table': self.variables['table'] } ) |
'table': self.variables['table'] } ) |
142 |
|
|
143 |
|
|
151 |
# |
# |
152 |
def __getExistingDatasources(self): |
def __getExistingDatasources(self): |
153 |
self.__firstConnection = None |
self.__firstConnection = None |
154 |
for child in self.form._children: |
for child in self.form.findChildrenOfType('GFDataSource'): |
155 |
if child._type == 'GFDataSource' and hasattr(child,'table'): |
if hasattr(child,'table'): |
156 |
if not self.__firstConnection: |
if not self.__firstConnection: |
157 |
self.__firstConnection = child.database |
self.__firstConnection = child.database |
158 |
break |
break |
173 |
'Version' : VERSION, |
'Version' : VERSION, |
174 |
'Author' : 'The GNUe Designer Team', |
'Author' : 'The GNUe Designer Team', |
175 |
'Behavior': WIZARD, |
'Behavior': WIZARD, |
176 |
'Location' : 'Tools|Insert|Datasource' |
'Location' : 'Edit|Insert|Datasource' |
177 |
} |
} |
178 |
|
|