| Reply | « Previous Thread | Next Thread » |
|
Is there a limit of 20 filds into one form? Python crashes when I try to save a form with 21 fields.
PyNetMony - the ultimate War- and BlueWalking tool and 2G/3G Netmonitor http://pynetmony.googlepages.com/home |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
it is really not mentioned anywhere in the documentation that we can use only 20 fields but yes there can be a limit and it can be 20 which make your python crash ![]() Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Online
Forum Nokia Champion
|
|
I tried it on my N95 and S60 3rd edition FP2 emulator. In both cases I got the "KErrNoMemory" error with 22 fields (21 worked fine). So as far as I can tell there isn't a set limit for the number of fields in a form, just that Python can't allocate memory for so many fields.
|
|
I think there are some restrictions to the form field text, may be 80 characters; but number of form fields may depend on memory available.
Just try having 18 fields with two applications running in the background and see if it works ! Br, Croozeus |
|
Yup 21 fields in form do work in emulator.
IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi subhendra
correct in emulator 21 fileds worked for me but in the n70 it only worked for 20 field and after that the python crashes. ![]() Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
I can excecute the Form with 21 Fields on the Phone, but when I change a field I cannot close the Form after saving. When I try to close the form without saving, Python shuts down completely, my app and also the script shell without any error message. 20 Fields work fine. I will try a greater Heap size with ensymble. This is the setup form class.
Code:
class Setup( object ):
# Config constants
SOUND_OFF = 0
SOUND_SOUND = 1
SOUND_VOICE = 2
SOUND_VOICE_NEW = 3
LIGHT_OFF = 0
LIGHT_CELL = 1
LIGHT_ALWAYS = 2
LIGHT_NEW_CELL = 3
VOICE_CELL = 0
VOICE_BAND = 1
VOICE_BAND_LAC = 2
VOICE_BAND_LAC_NET = 3
VOICE_BAND_CLF = 4
GPS_INTERNAL = 0
GPS_EXTERNAL = 1
GPS_ASSISTED = 2
CLF_DEVICE = 0
CLF_CARD = 1
WLAN_DEVICE = 0
WLAN_CARD = 1
WLAN_NOTIFY_OFF = 0
WLAN_NOTIFY_ADHOC = 1
WLAN_NOTIFY_OPEN = 2
BT_DEVICE = 0
BT_CARD = 1
BT_NOTIFY_OFF = 0
BT_NOTIFY_NEW_VOICE = 1
BT_NOTIFY_NEW_LIGHT = 2
BT_NOTIFY_NEW_VOICE_LIGHT = 3
COLOR_THEME_BLUE = 0
COLOR_THEME_BLACK = 1
COLOR_THEME_RED = 2
COLOR_THEME_GREEN = 3
FONT_SIZE_SMALL = 0
FONT_SIZE_MEDIUM = 1
FONT_SIZE_LARGE = 2
WPS_OFF = 0
WPS_ON = 1
## The constructor.
def __init__( self ):
global config
## Config options
self._iSound = [u'OFF', u'Sound', u'Voice', u'Only new']
self._iLight = [u'OFF', u'Cell change on', u'Always on', u'New cells only']
self._iVoice = [u'Cell only',
u'Band & Cell',
u'Band & Cell & LAC',
u'Band & Cell & LAC & NET',
u'Band & CLF']
self._iGPS = [u'Internal', u'External', u'Assisted']
self._iCLF = [u'Device', u'Memory Card']
self._iWLAN_Store = [u'Device', u'Memory Card']
self._iWLAN_Notify = [u'OFF', u'AD-HOC', u'Open']
self._iBT_Store = [u'Device', u'Memory Card']
self._iBT_Notify = [u'OFF', u'Voice', u'Light', u'Voice & Light']
self._iCOLOR_THEME = [u'Blue', u'Black', u'Red', u'Green']
self._iFONT_SIZE = [u'Small', u'Medium', u'Large']
#self._iWPS = [u'OFF', u'ON']
## Setup Menu
self._iMenu = [(u'Defaults', self.defaultConfig),
(u'Reload Config File', self.loadConfig)]
## Form fields
self.configToForm()
#flags = appuifw.FFormEditModeOnly
flags = appuifw.FFormEditModeOnly + appuifw.FFormDoubleSpaced
self._iForm = appuifw.Form(self._iFields, flags)
self._iForm.save_hook = self.saveForm
#self._iForm.flags = appuifw.FFormEditModeOnly
self._iForm.menu = self._iMenu
def configToForm(self):
global config
_iFields = [( u'Cellselection Notifier', 'combo', ( self._iSound, config['CellNotify'] ) ),
( u'Light', 'combo', ( self._iLight, config['Light'] ) ),
( u'WLAN Scan [s] (off=0 / on>9)','number', config['Refresh'] ),
( u'Volume','number', config['Volume'] ),
( u'Voice Text','combo', (self._iVoice, config['Voice']) ),
( u'GPS', 'combo', ( self._iGPS, config['GPS'] ) ),
( u'Neighbour Radius [km]', 'float', config['Neighbour Radius']),
( u'WLAN Autosave Interval [min]','number', config['WLANInter']),
( u'CLF stored on','combo', (self._iCLF, config['CLF'])),
( u'WLAN Database stored on','combo', (self._iWLAN_Store, config['WLAN_STORE'])),
( u'WLAN Notifier','combo', (self._iWLAN_Notify, config['WLAN_NOTIFY'])),
( u'Map Zoom Level (1-12)','number', config['MAPZOOM']),
( u'Sec between BT Scans 0=off','number', config['BT_SCAN']),
( u'BT Database stored on','combo', (self._iBT_Store, config['BT_STORE'])),
( u'BT Notifier','combo', (self._iBT_Notify, config['BT_NOTIFY'])),
( u'BT Autosave Interval [min]','number', config['BT_Autosave']),
( u'BT Scan Timeout [s]','number', config['BT_SCAN_TIMEOUT']),
( u'CLF Autosave Interval [min]','number', config['CLF_AUTOSAVE']),
( u'Color Theme','combo', (self._iCOLOR_THEME, config['COLOR_THEME'])),
( u'Font Size','combo', (self._iFONT_SIZE, config['FONT_SIZE']))]
#( u'WLAN Positioning System', 'combo', (self._iWPS, config['WPS']))]
## XXX: live update doesn't work yet. Need fixing
if hasattr(self, '_iFields'):
for i in range(len(_iFields)):
self._iFields[i] = _iFields[i]
else:
self._iFields = _iFields
def formToConfig(self):
global config
## XXX: must find elegant way for conversion Form <-> config
config = {
'CellNotify': self._iFields[0][2][1],
'Light': self._iFields[1][2][1],
'Refresh': self._iFields[2][2],
'Volume': self._iFields[3][2],
'Voice': self._iFields[4][2][1],
'GPS': self._iFields[5][2][1],
'Neighbour Radius': self._iFields[6][2],
'WLANInter': self._iFields[7][2],
'CLF': self._iFields[8][2][1],
'WLAN_STORE': self._iFields[9][2][1],
'WLAN_NOTIFY': self._iFields[10][2][1],
'MAPZOOM': self._iFields[11][2],
'BT_SCAN': self._iFields[12][2],
'BT_STORE': self._iFields[13][2][1],
'BT_NOTIFY': self._iFields[14][2][1],
'BT_Autosave': self._iFields[15][2],
'BT_SCAN_TIMEOUT': self._iFields[16][2],
'CLF_AUTOSAVE': self._iFields[17][2],
'COLOR_THEME': self._iFields[18][2][1],
'FONT_SIZE': self._iFields[19][2][1]}
#'WPS': self._iFields[20][2][1]
cfgfile = open(configfile, 'wt')
cfgfile.write(repr(config))
cfgfile.close()
def defaultConfig(self):
global config, defconfig
config = defconfig.copy()
self.configToForm()
appuifw.note(u"Please reopen the Setup dialog.")
def loadConfig(self, silent=False):
global config
config = defconfig.copy()
try:
cfgfile = open(configfile, 'rt')
content = cfgfile.read()
cfgfile.close()
config.update(eval(content))
if not silent:
appuifw.note(u"Please reopen the Setup dialog.")
except IOError, error:
if not silent:
appuifw.note(unicode(error),'error')
self.configToForm()
## Displays the form.
def execute( self ):
self._iForm.execute( )
## save_hook send True if the form has been saved.
def saveForm( self, aConfig ):
global config
self._iFields = aConfig
self.formToConfig()
PyNetMony - the ultimate War- and BlueWalking tool and 2G/3G Netmonitor http://pynetmony.googlepages.com/home |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi carknue
yes that is really a good option to try with bigger heap size using the ensymble tool. the problem in your case is totally on the heap size as number of fields increases the dynamic memory required increases which make the python crash. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
I tried with --heapsize=64k,2M. Still crashes after saving and closing form with Python 1.4.4. So if this is not a bug that could be fixed, the only solution would be to create a 2nd form.
![]() PyNetMony - the ultimate War- and BlueWalking tool and 2G/3G Netmonitor http://pynetmony.googlepages.com/home |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
really i was just going to give you the same suggestion but you find it before me. its advisable to use two forms as the forms with more than 20 field is very huge in size. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Form troubles | matdodgson | Symbian User Interface | 2 | 2008-12-06 11:49 |
| Can we add listeners to the form to listen any changes in the form fields? | shail229 | Python | 15 | 2008-07-14 13:38 |
| problem with editing[dim] different fields in a form | lavanya kartheek | General Discussion | 0 | 2008-04-22 14:33 |
| Compare value between fields in a form | ninidotnet | Symbian User Interface | 1 | 2006-08-18 10:56 |
| disallowing users from editing/adding labels and deleting fields in my form? | advocatee | General Symbian C++ | 2 | 2003-07-16 16:47 |