[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7774 - in trunk/gnue-forms/src: . GFObjects uidrivers/_base uidr
From: |
jcater |
Subject: |
[gnue] r7774 - in trunk/gnue-forms/src: . GFObjects uidrivers/_base uidrivers/_commonGuiToolkit uidrivers/qt uidrivers/qt/widgets |
Date: |
Tue, 2 Aug 2005 23:23:15 -0500 (CDT) |
Author: jcater
Date: 2005-08-02 23:23:13 -0500 (Tue, 02 Aug 2005)
New Revision: 7774
Modified:
trunk/gnue-forms/src/GFForm.py
trunk/gnue-forms/src/GFObjects/GFObj.py
trunk/gnue-forms/src/uidrivers/_base/UIdriver.py
trunk/gnue-forms/src/uidrivers/_commonGuiToolkit/UIdriver.py
trunk/gnue-forms/src/uidrivers/qt/UILoginHandler.py
trunk/gnue-forms/src/uidrivers/qt/UIdriver.py
trunk/gnue-forms/src/uidrivers/qt/common.py
trunk/gnue-forms/src/uidrivers/qt/widgets/entry.py
Log:
Some very basic text cleanup
Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py 2005-08-02 17:41:02 UTC (rev 7773)
+++ trunk/gnue-forms/src/GFForm.py 2005-08-03 04:23:13 UTC (rev 7774)
@@ -350,7 +350,7 @@
# cannot change focus to same entry
if widget == self._currentEntry:
- gDebug (5, "Widget is current entry %s" % widget)
+ gDebug (5, "Current entry did not change from %s" % widget)
return
cen = self._currentEntry is not None and self._currentEntry.name or '-'
@@ -959,7 +959,9 @@
@return: None
"""
block = self._currentBlock
- if not block: return
+ if not block:
+ gDebug(5,'No current block - cannot refresh UI')
+ return
dispatchEvent = self.dispatchEvent
if block.mode == 'query':
Modified: trunk/gnue-forms/src/GFObjects/GFObj.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFObj.py 2005-08-02 17:41:02 UTC (rev
7773)
+++ trunk/gnue-forms/src/GFObjects/GFObj.py 2005-08-03 04:23:13 UTC (rev
7774)
@@ -39,13 +39,23 @@
# Base internal object for GNUE Forms
#
class GFObj(GObj, GTriggerExtension):
+ def __repr__(self):
+ try:
+ name = self.name
+ except AttributeError:
+ try:
+ name = self.id
+ except AttributeError:
+ return '<%s instance at %s>' % (self.__class__, id(self))
+ return '<%s instance (%s) at %s>' % (self.__class__, self.name, id(self))
+
def __init__(self, parent=None, type='GFObj'):
GTriggerExtension.__init__(self)
GObj.__init__(self, parent, type)
self.hidden = False
self.readonly = False
self._visibleIndex = 0
- self.name = "__%s__" % self
+ self.name = "__GF%s" % id(self)
self._rows = 1
self._gap = 0
self._inits = []
Modified: trunk/gnue-forms/src/uidrivers/_base/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/_base/UIdriver.py 2005-08-02 17:41:02 UTC
(rev 7773)
+++ trunk/gnue-forms/src/uidrivers/_base/UIdriver.py 2005-08-03 04:23:13 UTC
(rev 7774)
@@ -126,7 +126,7 @@
# UIForm objects held in memory
self._formNameToGFForm = {} # Holds links the to the top level
# UIForm objects held in memory
- self._gfObjToUIWidget = {} # dictionary of driver specific
+ self._gfObjToUIWidget = {} # dictionary of driver specific
# UIfoo widgets with the GFObj used
# as the key
@@ -143,7 +143,7 @@
basedir = os.path.dirname(sys.modules[moduleName].__file__)
else: #Normal case
basedir = os.path.dirname (sys.modules [self.__module__].__file__)
-
+
uiDriver = os.path.basename (basedir)
basedir +='/widgets/'
for widgetName in dircache.listdir (basedir):
@@ -561,7 +561,7 @@
# ---------------------------------------------------------------------------
-
+
def _showMessage (self, message, kind = 'Info', title = None, cancel =
False):
raise ImplementationError, (self.name, '_showMessage')
@@ -606,7 +606,7 @@
@param title: title of the input dialog
@param fields: field definition as described below
@param cancel: if True the dialog has a cancel button, otherwise not
-
+
These field definitions are specified as follows:
A field definition is a tuple having these elements:
@@ -730,7 +730,7 @@
"""
This function must be overriden by a descendant UI driver class. It get's
called for all exceptions except UserErrors. It's purpose is to display
- an exception.
+ an exception.
@param group: Group of the exception like 'system', 'admin', 'application'
@param name: Name of the exception, i.e. 'KeyError', 'FoobarError', ...
@param message: Message of the exception
Modified: trunk/gnue-forms/src/uidrivers/_commonGuiToolkit/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/_commonGuiToolkit/UIdriver.py
2005-08-02 17:41:02 UTC (rev 7773)
+++ trunk/gnue-forms/src/uidrivers/_commonGuiToolkit/UIdriver.py
2005-08-03 04:23:13 UTC (rev 7774)
@@ -99,7 +99,7 @@
def formBeep(self, event):
"""
- Rings the system bell
+ Rings the system bell
"""
self._beep()
Modified: trunk/gnue-forms/src/uidrivers/qt/UILoginHandler.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/qt/UILoginHandler.py 2005-08-02 17:41:02 UTC
(rev 7773)
+++ trunk/gnue-forms/src/uidrivers/qt/UILoginHandler.py 2005-08-03 04:23:13 UTC
(rev 7774)
@@ -22,7 +22,7 @@
# UIwxpython.py
#
# DESCRIPTION:
-# A wxPython based user interface driver for GNUe forms.
+# A QT based user interface driver for GNUe forms.
#
# NOTES:
#
@@ -57,9 +57,6 @@
self.dlg = None
def getLogin(self, loginData, errortext=None):
- if 1: # TODO: This is left here to prevent me from having to unindent this
code
- # TODO: Since the UI stuff is currently being gutted I'm not wasting
the time
- # TODO: to do the right thing
if len(loginData[1]):
loginMesg = _('Login required for\n"%s"') % (loginData[1])
else:
Modified: trunk/gnue-forms/src/uidrivers/qt/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/qt/UIdriver.py 2005-08-02 17:41:02 UTC
(rev 7773)
+++ trunk/gnue-forms/src/uidrivers/qt/UIdriver.py 2005-08-03 04:23:13 UTC
(rev 7774)
@@ -120,10 +120,17 @@
maxDescent = fm.descent()
maxLeading = fm.leading()
- self.textWidth = int(maxWidth+maxLeading) # The pixel width of text
inside a widget
- self.textHeight = int(maxHeight+maxDescent) # The pixel height of text
inside a widget
- self.widgetWidth = self.textWidth # The pixel width of a 1
char widget (for things like buttons)
- self.widgetHeight = self.textHeight + 4 # The pixel height of a 1
char widget (for things like buttons)
+ # The pixel width of text inside a widget
+ self.textWidth = int(maxWidth+maxLeading)
+
+ # The pixel height of text inside a widget
+ self.textHeight = int(maxHeight+maxDescent)
+
+ # The pixel width of a 1 char widget (for things like buttons)
+ self.widgetWidth = self.textWidth
+
+ # The pixel height of a 1 char widget (for things like buttons)
+ self.widgetHeight = self.textHeight + 4
@@ -141,7 +148,7 @@
# Tells the application to close it's main window
#
def _exit(self, formName):
- exitApp = 1
+ exitApp = True
for child in self._children:
if child._form.name == formName:
child.mainWindow.hide()
@@ -150,7 +157,7 @@
if exitApp:
for child in self._children:
- child.mainWindow.close(1)
+ child.mainWindow.close(True)
Modified: trunk/gnue-forms/src/uidrivers/qt/common.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/qt/common.py 2005-08-02 17:41:02 UTC (rev
7773)
+++ trunk/gnue-forms/src/uidrivers/qt/common.py 2005-08-03 04:23:13 UTC (rev
7774)
@@ -124,7 +124,8 @@
elif not (control or alt):
char = "%s" % event.text()
if char:
- action = events.Event('requestKEYPRESS', char, text=char, code=keycode)
+ action = events.Event('requestKEYPRESS',
+ char, text=char, code=keycode)
if action:
# Add the object's _form to the outgoing event
@@ -150,9 +151,14 @@
try:
self.__cursor = self.cursorPosition()
selected, start, end = self.getSelection()
-
self._eventHandler('requestCURSORMOVE',position=self.cursorPosition(),_form=gfObject._form)
+ self._eventHandler('requestCURSORMOVE',
+ position=self.cursorPosition(),
+ _form=gfObject._form)
if selected:
-
self._eventHandler('requestSELECTWITHMOUSE',position1=start,position2=end,_form=gfObject._form)
+ self._eventHandler('requestSELECTWITHMOUSE',
+ position1=start,
+ position2=end,
+ _form=gfObject._form)
except AttributeError:
pass # Not everything has a cursorPosition()
@@ -162,7 +168,10 @@
gfObject = uiwidget._gfObject
selected, start, end = self.getSelection()
if selected:
-
self._eventHandler('requestSELECTWITHMOUSE',position1=start,position2=end,_form=gfObject._form)
+ self._eventHandler('requestSELECTWITHMOUSE',
+ position1=start,
+ position2=end,
+ _form=gfObject._form)
Modified: trunk/gnue-forms/src/uidrivers/qt/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/qt/widgets/entry.py 2005-08-02 17:41:02 UTC
(rev 7773)
+++ trunk/gnue-forms/src/uidrivers/qt/widgets/entry.py 2005-08-03 04:23:13 UTC
(rev 7774)
@@ -118,7 +118,8 @@
def __init__(self, event, uiwidget):
QLineEdit.__init__(self, event.container)
_Base.__init__(self, event, uiwidget, QLineEdit)
- QObject.connect(self, SIGNAL('selectionChanged()'), self._selectionChanged)
+ QObject.connect(self, SIGNAL('selectionChanged()'),
+ self._selectionChanged)
@@ -129,7 +130,8 @@
def __init__(self, event, uiwidget):
QTextEdit.__init__(self, event.container)
_Base.__init__(self, event, uiwidget, QTextEdit)
- QObject.connect(self, SIGNAL('selectionChanged()'), self._selectionChanged)
+ QObject.connect(self, SIGNAL('selectionChanged()'),
+ self._selectionChanged)
@@ -140,7 +142,8 @@
QComboBox.__init__(self, True, event.container, "Foo")
_Base.__init__(self, event, uiwidget, QComboBox)
QComboBox.setLineEdit(self, _SingleLineEdit(event, uiwidget))
- QObject.connect(self, SIGNAL('activated(int)'), self.__itemSelected)
+ QObject.connect(self, SIGNAL('activated(int)'),
+ self.__itemSelected)
def setChoices(self,choices):
self.__choices = choices
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7774 - in trunk/gnue-forms/src: . GFObjects uidrivers/_base uidrivers/_commonGuiToolkit uidrivers/qt uidrivers/qt/widgets,
jcater <=