frogpie-commit Mailing List for frogpie
Status: Pre-Alpha
Brought to you by:
jurner
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(49) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(178) |
Feb
(190) |
Mar
(195) |
Apr
(2) |
May
|
Jun
(79) |
Jul
(296) |
Aug
(297) |
Sep
(61) |
Oct
(1) |
Nov
(2) |
Dec
|
|
From: <ju...@us...> - 2007-11-05 12:48:46
|
Revision: 1384
http://frogpie.svn.sourceforge.net/frogpie/?rev=1384&view=rev
Author: jurner
Date: 2007-11-05 04:48:30 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
svn fix
Removed Paths:
-------------
trunk/sandbox/qt4ex/qt4ex/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ju...@us...> - 2007-11-01 14:59:13
|
Revision: 1383
http://frogpie.svn.sourceforge.net/frogpie/?rev=1383&view=rev
Author: jurner
Date: 2007-11-01 07:59:16 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
...
Added Paths:
-----------
trunk/sandbox/qt4ex/qt4ex/ctrls/progressbarwrap.py
Added: trunk/sandbox/qt4ex/qt4ex/ctrls/progressbarwrap.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/ctrls/progressbarwrap.py (rev 0)
+++ trunk/sandbox/qt4ex/qt4ex/ctrls/progressbarwrap.py 2007-11-01 14:59:16 UTC (rev 1383)
@@ -0,0 +1,29 @@
+"""Progressbar wrappers"""
+
+from PyQt4 import QtGui
+#***************************************************************
+#
+#***************************************************************
+class ProgressBarEx(QtGui.QProgressBar):
+ """Extended progressbar"""
+
+ def __init__(self, parent):
+ QtGui.QProgressBar.__init__(self, parent)
+
+ def setColors(self, colorText=None, colorBar=None, colorBg=None):
+ """Sets the colors of the progressabar
+ @param colorText: (str) color of the bars text or None to leave unchanged
+ @param colorBar: (str) color of the bar or None to leave unchanged
+ @param colorBg: (str) background color or None to leave unchanged
+ @note: all three colors can be actually anything QColor accepts as input
+ """
+ pal = self.palette()
+ if colorText is not None:
+ pal.setColor(QtGui.QColorGroup.Foreground, QtGui.QColor(colorFg))
+ if colorBar is not None:
+ pal.setColor(pal.Highlight, QtGui.QColor(colorBar))
+ if colorBg is not None:
+ pal.setColor(pal.Background, QtGui.QColor(colorBg))
+ self.setPalette(pal)
+ self.update()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ju...@us...> - 2007-10-31 12:04:07
|
Revision: 1382
http://frogpie.svn.sourceforge.net/frogpie/?rev=1382&view=rev
Author: jurner
Date: 2007-10-31 05:04:10 -0700 (Wed, 31 Oct 2007)
Log Message:
-----------
fixed docstring
Modified Paths:
--------------
trunk/sandbox/chm/chm_lib/epydoc_fs.py
Modified: trunk/sandbox/chm/chm_lib/epydoc_fs.py
===================================================================
--- trunk/sandbox/chm/chm_lib/epydoc_fs.py 2007-09-19 20:19:15 UTC (rev 1381)
+++ trunk/sandbox/chm/chm_lib/epydoc_fs.py 2007-10-31 12:04:10 UTC (rev 1382)
@@ -232,8 +232,8 @@
def list_dir(self, item):
"""Retunrs a sorted list of all subitems of an item
- @return: the next item in turn
- @rtype: str
+ @return: sorted list of items
+ @rtype: list
"""
out = []
if self.is_namespace(item):
@@ -257,7 +257,7 @@
return self.get_name(item).split('.')
-
+
#*********************************************************************************
#
#*********************************************************************************
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:19:23
|
Revision: 1381
http://frogpie.svn.sourceforge.net/frogpie/?rev=1381&view=rev
Author: jUrner
Date: 2007-09-19 13:19:15 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
bug in translation fixed
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.py
Modified: trunk/sandbox/colordip/colordip/colordip.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 20:18:41 UTC (rev 1380)
+++ trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 20:19:15 UTC (rev 1381)
@@ -5,9 +5,6 @@
# TODO:
#
-# x. switching language does not update qt entries in context menus of editboxes
-#
-#
# x. currently the gui is fixed size
# This is due to flicker and other problems on dynamically resizing the gui.
# Another reason for fixed size is that there is AFAIK no way to tell a QLabel
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:18:38
|
Revision: 1380
http://frogpie.svn.sourceforge.net/frogpie/?rev=1380&view=rev
Author: jUrner
Date: 2007-09-19 13:18:41 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py
Modified: trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py 2007-09-19 20:18:30 UTC (rev 1379)
+++ trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py 2007-09-19 20:18:41 UTC (rev 1380)
@@ -108,23 +108,29 @@
self.actions[name] = act
# adjust actions
- # TODO: disable SelectAll when all is already selected
+ # NOTE: disabling "SelectAll" is somewhat unnecessary, so leave it out
if isinstance(self.edit, QtGui.QLineEdit):
- self.actions['Undo'].setEnabled(self.edit.isUndoAvailable())
- self.actions['Redo'].setEnabled(self.edit.isRedoAvailable())
- self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.hasSelectedText())
- self.actions['Copy'].setEnabled(self.edit.hasSelectedText())
- self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and (not QtGui.QApplication.clipboard().text().isEmpty()))
-
+ canPaste = not QtGui.QApplication.clipboard().text().isEmpty()
+ canRedo = self.edit.isRedoAvailable()
+ canUndo = self.edit.isUndoAvailable()
+ hasSelection = self.edit.hasSelectedText()
+ isReadOnly = self.edit.isReadOnly()
else:
- self.actions['Undo'].setEnabled(self.edit.document().isUndoAvailable())
- self.actions['Redo'].setEnabled(self.edit.document().isRedoAvailable())
- self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.textCursor().hasSelection())
- self.actions['Copy'].setEnabled(self.edit.textCursor().hasSelection())
- self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and self.edit.canPaste())
+ canPaste = self.edit.canPaste()
+ canRedo = self.edit.document().isRedoAvailable()
+ canUndo = self.edit.document().isUndoAvailable()
+ hasSelection = self.edit.textCursor().hasSelection()
+ isReadOnly = self.edit.isReadOnly()
+
+ self.actions['Undo'].setEnabled(canUndo)
+ self.actions['Redo'].setEnabled(canRedo)
+ self.actions['Cut'].setEnabled(not isReadOnly and hasSelection)
+ self.actions['Copy'].setEnabled(hasSelection)
+ self.actions['Paste'].setEnabled(not isReadOnly and canPaste)
+ self.actions['SelectAll'].setEnabled(True)
# TODO: control chars submenu not yet implemented
- # one problem is that you can not remove a menu from a menu
+ # one problem is that one can not remove a menu from a menu
#~ ControlCharacters = (
#~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRM Left-to-right mark"), 0x200e),
#~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLM Right-to-left mark"), 0x200f),
@@ -160,6 +166,7 @@
def testEditBoxContextMenuWrap():
def customizeContextMenu(wrapper, menu):
+ return
menu.addSeparator()
menu.removeAction(wrapper.actions['Undo'])
menu.removeAction(wrapper.actions['Redo'])
@@ -188,7 +195,7 @@
sys.exit(res)
-#testEditBoxContextMenuWrap()
+ #testEditBoxContextMenuWrap()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:18:26
|
Revision: 1379
http://frogpie.svn.sourceforge.net/frogpie/?rev=1379&view=rev
Author: jUrner
Date: 2007-09-19 13:18:30 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
bugfix
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/language.py
Modified: trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/language.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/language.py 2007-09-19 20:18:25 UTC (rev 1378)
+++ trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/language.py 2007-09-19 20:18:30 UTC (rev 1379)
@@ -376,11 +376,11 @@
The new translator will replace the translator installed in the last
call to this method. Use this method to dynamically switch translators.
"""
+ oldTranslator = self._translators.get(prefix, None)
+ if oldTranslator is not None:
+ QtGui.QApplication.removeTranslator(oldTranslator)
translator = self.getTranslator(parent, localeName, prefix=prefix)
if translator is not None:
- oldTranslator = self._translators.get(prefix, None)
- if oldTranslator is not None:
- QtGui.QApplication.removeTranslator(oldTranslator)
QtGui.QApplication.installTranslator(translator)
self._translators[prefix] = translator
return translator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:18:23
|
Revision: 1378
http://frogpie.svn.sourceforge.net/frogpie/?rev=1378&view=rev
Author: jUrner
Date: 2007-09-19 13:18:25 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
bugfix
Modified Paths:
--------------
trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/language.py
Modified: trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/language.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/language.py 2007-09-19 20:17:59 UTC (rev 1377)
+++ trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/language.py 2007-09-19 20:18:25 UTC (rev 1378)
@@ -376,11 +376,11 @@
The new translator will replace the translator installed in the last
call to this method. Use this method to dynamically switch translators.
"""
+ oldTranslator = self._translators.get(prefix, None)
+ if oldTranslator is not None:
+ QtGui.QApplication.removeTranslator(oldTranslator)
translator = self.getTranslator(parent, localeName, prefix=prefix)
if translator is not None:
- oldTranslator = self._translators.get(prefix, None)
- if oldTranslator is not None:
- QtGui.QApplication.removeTranslator(oldTranslator)
QtGui.QApplication.installTranslator(translator)
self._translators[prefix] = translator
return translator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:17:55
|
Revision: 1377
http://frogpie.svn.sourceforge.net/frogpie/?rev=1377&view=rev
Author: jUrner
Date: 2007-09-19 13:17:59 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
bit of this and that
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py
Modified: trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py 2007-09-19 20:17:43 UTC (rev 1376)
+++ trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py 2007-09-19 20:17:59 UTC (rev 1377)
@@ -108,23 +108,29 @@
self.actions[name] = act
# adjust actions
- # TODO: disable SelectAll when all is already selected
+ # NOTE: disabling "SelectAll" is somewhat unnecessary, so leave it out
if isinstance(self.edit, QtGui.QLineEdit):
- self.actions['Undo'].setEnabled(self.edit.isUndoAvailable())
- self.actions['Redo'].setEnabled(self.edit.isRedoAvailable())
- self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.hasSelectedText())
- self.actions['Copy'].setEnabled(self.edit.hasSelectedText())
- self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and (not QtGui.QApplication.clipboard().text().isEmpty()))
-
+ canPaste = not QtGui.QApplication.clipboard().text().isEmpty()
+ canRedo = self.edit.isRedoAvailable()
+ canUndo = self.edit.isUndoAvailable()
+ hasSelection = self.edit.hasSelectedText()
+ isReadOnly = self.edit.isReadOnly()
else:
- self.actions['Undo'].setEnabled(self.edit.document().isUndoAvailable())
- self.actions['Redo'].setEnabled(self.edit.document().isRedoAvailable())
- self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.textCursor().hasSelection())
- self.actions['Copy'].setEnabled(self.edit.textCursor().hasSelection())
- self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and self.edit.canPaste())
+ canPaste = self.edit.canPaste()
+ canRedo = self.edit.document().isRedoAvailable()
+ canUndo = self.edit.document().isUndoAvailable()
+ hasSelection = self.edit.textCursor().hasSelection()
+ isReadOnly = self.edit.isReadOnly()
+
+ self.actions['Undo'].setEnabled(canUndo)
+ self.actions['Redo'].setEnabled(canRedo)
+ self.actions['Cut'].setEnabled(not isReadOnly and hasSelection)
+ self.actions['Copy'].setEnabled(hasSelection)
+ self.actions['Paste'].setEnabled(not isReadOnly and canPaste)
+ self.actions['SelectAll'].setEnabled(True)
# TODO: control chars submenu not yet implemented
- # one problem is that you can not remove a menu from a menu
+ # one problem is that one can not remove a menu from a menu
#~ ControlCharacters = (
#~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRM Left-to-right mark"), 0x200e),
#~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLM Right-to-left mark"), 0x200f),
@@ -160,6 +166,7 @@
def testEditBoxContextMenuWrap():
def customizeContextMenu(wrapper, menu):
+ return
menu.addSeparator()
menu.removeAction(wrapper.actions['Undo'])
menu.removeAction(wrapper.actions['Redo'])
@@ -188,7 +195,7 @@
sys.exit(res)
-#testEditBoxContextMenuWrap()
+ #testEditBoxContextMenuWrap()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 20:17:39
|
Revision: 1376
http://frogpie.svn.sourceforge.net/frogpie/?rev=1376&view=rev
Author: jUrner
Date: 2007-09-19 13:17:43 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
installTranslators() did not remove rencent translators when no new translator was found - fixed
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/language.py
Modified: trunk/sandbox/qt4ex/qt4ex/language.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/language.py 2007-09-19 18:18:21 UTC (rev 1375)
+++ trunk/sandbox/qt4ex/qt4ex/language.py 2007-09-19 20:17:43 UTC (rev 1376)
@@ -376,11 +376,11 @@
The new translator will replace the translator installed in the last
call to this method. Use this method to dynamically switch translators.
"""
+ oldTranslator = self._translators.get(prefix, None)
+ if oldTranslator is not None:
+ QtGui.QApplication.removeTranslator(oldTranslator)
translator = self.getTranslator(parent, localeName, prefix=prefix)
if translator is not None:
- oldTranslator = self._translators.get(prefix, None)
- if oldTranslator is not None:
- QtGui.QApplication.removeTranslator(oldTranslator)
QtGui.QApplication.installTranslator(translator)
self._translators[prefix] = translator
return translator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 18:18:30
|
Revision: 1375
http://frogpie.svn.sourceforge.net/frogpie/?rev=1375&view=rev
Author: jUrner
Date: 2007-09-19 11:18:21 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
...
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.py
Modified: trunk/sandbox/colordip/colordip/colordip.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 18:14:15 UTC (rev 1374)
+++ trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 18:18:21 UTC (rev 1375)
@@ -5,7 +5,9 @@
# TODO:
#
+# x. switching language does not update qt entries in context menus of editboxes
#
+#
# x. currently the gui is fixed size
# This is due to flicker and other problems on dynamically resizing the gui.
# Another reason for fixed size is that there is AFAIK no way to tell a QLabel
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 18:14:24
|
Revision: 1374
http://frogpie.svn.sourceforge.net/frogpie/?rev=1374&view=rev
Author: jUrner
Date: 2007-09-19 11:14:15 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
implemented edit box wrapper
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.py
Modified: trunk/sandbox/colordip/colordip/colordip.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 18:13:56 UTC (rev 1373)
+++ trunk/sandbox/colordip/colordip/colordip.py 2007-09-19 18:14:15 UTC (rev 1374)
@@ -46,7 +46,7 @@
from colordip_dlgs.preferences import ColorDipPreferences
from colordip_lib.qt4ex import settingsbase, qtools
-from colordip_lib.qt4ex.ctrls import dragtool, toolbarwrap, labelwrap
+from colordip_lib.qt4ex.ctrls import dragtool, editboxwrap, toolbarwrap, labelwrap
from colordip_lib.qt4ex.dlgs import dlgabout
#*******************************************************************
@@ -425,7 +425,7 @@
self._status = None
- self._cbs = []
+ self._wrappers = []
self._dragTools = {}
self._isCreated = False # to know when the gui is up and running
@@ -469,6 +469,11 @@
Ui_colordip.Ui_ColorDip.setupUi(self, self)
+ # setup statusbar
+ st = self.statusBar()
+ st.setSizeGripEnabled(False)
+ self._status = Status(self, st)
+
# setup main color label
self._colorLabel = labelwrap.ColorLabelWrap(self, self.controlById(ID_LABEL_COLOR), color=False)
@@ -476,12 +481,34 @@
for id_control in IDS_COLOR_EDITS:
ed = self.controlById(id_control)
self.connect(ed, QtCore.SIGNAL('returnPressed()'), self.onColorEdits)
- self._cbs.append(WidgetContextMenuCb(ed, self.onCustomEdContextMenu))
+ wrapper = editboxwrap.EditBoxContextMenuWrap(ed)
+ self._wrappers.append(wrapper)
+ self.connect(
+ wrapper,
+ QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'),
+ self.onCustomizeEdContextMenu
+ )
+ self.connect(
+ wrapper,
+ QtCore.SIGNAL('contextMenuActionSelected(QAction*, bool)'),
+ self._status.refresh
+ )
# setup lineedit for formated color output
ed = self.controlById(ID_ED_COLOR)
self.connect(ed, QtCore.SIGNAL('returnPressed()'), self.onColorEdit)
- self._cbs.append(WidgetContextMenuCb(ed, self.onCustomEdContextMenu))
+ wrapper = editboxwrap.EditBoxContextMenuWrap(ed)
+ self._wrappers.append(wrapper)
+ self.connect(
+ wrapper,
+ QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'),
+ self.onCustomizeEdContextMenu
+ )
+ self.connect(
+ wrapper,
+ QtCore.SIGNAL('contextMenuActionSelected(QAction*, bool)'),
+ self._status.refresh
+ )
# setup magnifier
label = self.controlById(ID_LABEL_MAGNIFIER)
@@ -507,11 +534,6 @@
self.connect(self._recentColors, QtCore.SIGNAL('rmbUp(int)'), self.onRecentColorRmbUp)
self.connect(self._recentColors, QtCore.SIGNAL('lmbUp(int)'), self.onRecentColorLmbUp)
- # setup statusbar
- st = self.statusBar()
- st.setSizeGripEnabled(False)
- self._status = Status(self, st)
-
# other stuff
self.setFixedSize(self.size())
@@ -628,59 +650,24 @@
self.setColor(color)
- def onCustomEdContextMenu(self, ed, pt):
-
- # create custom LineEdit context menu
- m = QtGui.QMenu(self)
-
- # add default LineEdit actions
- act = Act(
- parent=self,
- text=self.trUtf8( "Cu&t" ),
- shortcut=QtGui.QKeySequence.Cut,
- statustip=self.trUtf8('Cuts the currently selected text'),
- trigger=ed.cut,
- )
- act.setEnabled(ed.hasSelectedText())
- m.addAction(act)
- act = Act(
- parent=self,
- text=self.trUtf8( "&Copy" ),
- shortcut=QtGui.QKeySequence.Copy,
- statustip=self.trUtf8('Copies the currently selected text'),
- trigger=ed.copy,
- )
- act.setEnabled(ed.hasSelectedText())
- m.addAction(act)
- act = Act(
- parent=self,
- text=self.trUtf8( "&Paste" ),
- shortcut=QtGui.QKeySequence.Paste,
- statustip=self.trUtf8('Pastes text from the clipboard'),
- trigger=ed.paste,
- )
- act.setEnabled(not QtGui.QApplication.clipboard().text().isEmpty())
- m.addAction(act)
- act = Act(
- parent=self,
- text=self.trUtf8( "Select &All" ),
- shortcut='Ctrl+A',
- statustip=self.trUtf8('Selects all text'),
- trigger=ed.selectAll,
- )
- m.addAction(act)
+
+ def onCustomizeEdContextMenu(self, wrapper, menu):
+ """Slot triggered when a context menu for one of the color edits is requested"""
-
+ # remove some unwanted entries
+ menu.removeAction(wrapper.actions['Undo'])
+ menu.removeAction(wrapper.actions['Redo'])
+
# add menus for color format factories
- m.addSeparator()
+ menu.addSeparator()
ColorIOFactories = (
('arrow-right', self._inputFormatFactory, self._colorInputFormat, self.onSetColorInputFormat),
('arrow-left', self._outputFormatFactory, self._colorOutputFormat, self.onSetColorOutputFormat),
)
for iconName, factory, currentFormat, cb in ColorIOFactories:
icon=self.config.resources.getIcon(iconName, 32, iconTheme=self._userSettings['IconTheme'])
- menu = m.addMenu(factory.menuName() )
- menu.setIcon(icon)
+ subMenu = menu.addMenu(factory.menuName() )
+ subMenu.setIcon(icon)
gr = QtGui.QActionGroup(self)
formats = sorted([(f.displayName(), f._name_, f) for f in factory.formats()])
@@ -692,21 +679,13 @@
trigger=cb,
args=(name, ),
)
- menu.addAction(act)
+ subMenu.addAction(act)
gr.addAction(act)
if name == currentFormat._name_:
act.setCheckable(True)
act.setChecked(True)
-
- # popup context menu
- pt = ed.mapToGlobal(pt)
- act = m.exec_(pt)
- if act is not None: pass
-
- self._status.refresh()
-
-
+
def onEyedropperDragCanceled(self):
"""slot called when eyedropper tool dragging is canceled"""
self._giveDragToolFeedback(None)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 18:14:11
|
Revision: 1373
http://frogpie.svn.sourceforge.net/frogpie/?rev=1373&view=rev
Author: jUrner
Date: 2007-09-19 11:13:56 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
...
Added Paths:
-----------
trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py
Added: trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py (rev 0)
+++ trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/ctrls/editboxwrap.py 2007-09-19 18:13:56 UTC (rev 1373)
@@ -0,0 +1,194 @@
+"""Wrappers and tools for QLineEdit and QTextEdit"""
+
+from PyQt4 import QtCore, QtGui
+#***********************************************************************
+#
+#***********************************************************************
+class EditBoxContextMenuWrap(QtCore.QObject):
+ """Wrapper class for to handle custom context menus for editboxes
+
+ @note: make shure to always keep a reference to the wrapper
+ """
+
+ def __init__(self, edit):
+ """
+ @param edit: QTextEdit or QLineEdit
+ @attr edit: editbox
+ @attr actions: dict containing default actions for the editbox. Available actions are:
+ "Copy", "Cut", "Paste", "Redo", "SelectAll", "Undo". Caution: the dict is considered
+ to be read only!
+ @signal: 'customizeContextMenu(QObject* EditContextMenuWrap, QMenu* contextMenu)'.
+ This signal is emitted when the context menu for the editbox is requested. Use this signal
+ to customize the menu.
+ @signal: 'contextMenuActionSelected(QAction* action, bool isStandardAction)'.
+ Emitted when the user selected an action from the context menu. The flag indicates wether
+ a standard action or a custom action was selected
+
+ """
+ QtCore.QObject.__init__(self, edit)
+
+ self.edit = edit
+ self.actions = {}
+
+ edit.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
+ self.connect(
+ edit,
+ QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'),
+ self.__call__
+ )
+
+ def __call__(self, pt):
+
+ # create custom LineEdit context menu
+ self.actions = {}
+ m = QtGui.QMenu(self.edit)
+
+ # add default QLineEdit actions
+ actions = (
+ (
+ 'Undo',
+ self.edit.trUtf8("&Undo"),
+ QtGui.QKeySequence.Undo,
+ self.trUtf8('Undos the last ation'),
+ self.edit.undo,
+ ),
+ (
+ 'Redo',
+ self.edit.trUtf8("&Redo"),
+ QtGui.QKeySequence.Redo,
+ self.trUtf8('Redos the last ation'),
+ self.edit.redo,
+ ),
+ (
+ 'Cut',
+ self.edit.trUtf8("Cu&t"),
+ QtGui.QKeySequence.Cut,
+ self.trUtf8('Cuts the currently selected text'),
+ self.edit.cut,
+ ),
+ (
+ 'Copy',
+ self.edit.trUtf8("&Copy"),
+ QtGui.QKeySequence.Copy,
+ self.trUtf8('Copies the currently selected text'),
+ self.edit.copy,
+ ),
+ (
+ 'Paste',
+ self.edit.trUtf8("&Paste"),
+ QtGui.QKeySequence.Paste,
+ self.trUtf8('Pastes text from the clipboard'),
+ self.edit.paste,
+ ),
+ (
+ 'SelectAll',
+ self.edit.trUtf8("Select All"),
+ QtGui.QKeySequence.SelectAll,
+ self.trUtf8('Selects all text'),
+ self.edit.selectAll,
+ ),
+ #TODO: Delete
+ #d->actions[QLineEditPrivate::ClearAct] = new QAction(QLineEdit::tr("Delete"), this);
+ #QObject::connect(d->actions[QLineEditPrivate::ClearAct], SIGNAL(triggered()), this, SLOT(_q_deleteSelected()));
+ )
+
+ # setup actions
+ for name, text, shortcut, tip, trigger in actions:
+ act = QtGui.QAction(text, None)
+ act.setObjectName(name)
+ act.setStatusTip(tip)
+ if shortcut.__class__.__name__ == 'StandardKey':
+ # BUG: in PyQt4.3 - already reported
+ # initializing QKeySequence() with a Qt.StandardKey gives segfault
+ act.setShortcut(shortcut)
+ else:
+ act.setShortcut(QtGui.QKeySequence(shortcut) )
+ self.connect(act, QtCore.SIGNAL('triggered()'), trigger)
+ m.addAction(act)
+ self.actions[name] = act
+
+ # adjust actions
+ # TODO: disable SelectAll when all is already selected
+ if isinstance(self.edit, QtGui.QLineEdit):
+ self.actions['Undo'].setEnabled(self.edit.isUndoAvailable())
+ self.actions['Redo'].setEnabled(self.edit.isRedoAvailable())
+ self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.hasSelectedText())
+ self.actions['Copy'].setEnabled(self.edit.hasSelectedText())
+ self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and (not QtGui.QApplication.clipboard().text().isEmpty()))
+
+ else:
+ self.actions['Undo'].setEnabled(self.edit.document().isUndoAvailable())
+ self.actions['Redo'].setEnabled(self.edit.document().isRedoAvailable())
+ self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.textCursor().hasSelection())
+ self.actions['Copy'].setEnabled(self.edit.textCursor().hasSelection())
+ self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and self.edit.canPaste())
+
+ # TODO: control chars submenu not yet implemented
+ # one problem is that you can not remove a menu from a menu
+ #~ ControlCharacters = (
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRM Left-to-right mark"), 0x200e),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLM Right-to-left mark"), 0x200f),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWJ Zero width joiner"), 0x200d),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWNJ Zero width non-joiner"), 0x200c),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWSP Zero width space"), 0x200b),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRE Start of left-to-right embedding"), 0x202a),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLE Start of right-to-left embedding"), 0x202b),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRO Start of left-to-right override"), 0x202d),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLO Start of right-to-left override"), 0x202e),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "PDF Pop directional formatting"), 0x202c),
+ #~ )
+
+ # inform listeners
+ self.emit(QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'), self, m)
+ pt = self.edit.mapToGlobal(pt)
+ act = m.exec_(pt)
+
+ # find out if a custom action was triggered
+ if act is not None and act not in self.actions.values():
+ isStandardAction = act in self.actions.values()
+ self.emit(QtCore.SIGNAL('contextMenuActionSelected(QAction*, bool)'), act, isStandardAction)
+
+ # clear actions
+ for act in self.actions.values():
+ del act
+
+#***********************************************************************
+#
+#***********************************************************************
+if __name__ == '__main__':
+
+ def testEditBoxContextMenuWrap():
+
+ def customizeContextMenu(wrapper, menu):
+ menu.addSeparator()
+ menu.removeAction(wrapper.actions['Undo'])
+ menu.removeAction(wrapper.actions['Redo'])
+ menu.addAction('Custom Action 1')
+ menu.addAction('Custom Action 2')
+
+
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = QtGui.QWidget()
+ grid = QtGui.QVBoxLayout(w)
+
+ lineEd = QtGui.QLineEdit(w)
+ textEd = QtGui.QTextEdit(w)
+
+ wrappers = []
+ for ed in (lineEd, textEd):
+ grid.addWidget(ed)
+ wrapper = EditBoxContextMenuWrap(ed)
+ wrappers.append(wrapper)
+ ed.connect(wrapper, QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'), customizeContextMenu)
+
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
+#testEditBoxContextMenuWrap()
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 18:13:28
|
Revision: 1372
http://frogpie.svn.sourceforge.net/frogpie/?rev=1372&view=rev
Author: jUrner
Date: 2007-09-19 11:13:26 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
added a new module with wrappers for editboxes
Added Paths:
-----------
trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py
Added: trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py (rev 0)
+++ trunk/sandbox/qt4ex/qt4ex/ctrls/editboxwrap.py 2007-09-19 18:13:26 UTC (rev 1372)
@@ -0,0 +1,194 @@
+"""Wrappers and tools for QLineEdit and QTextEdit"""
+
+from PyQt4 import QtCore, QtGui
+#***********************************************************************
+#
+#***********************************************************************
+class EditBoxContextMenuWrap(QtCore.QObject):
+ """Wrapper class for to handle custom context menus for editboxes
+
+ @note: make shure to always keep a reference to the wrapper
+ """
+
+ def __init__(self, edit):
+ """
+ @param edit: QTextEdit or QLineEdit
+ @attr edit: editbox
+ @attr actions: dict containing default actions for the editbox. Available actions are:
+ "Copy", "Cut", "Paste", "Redo", "SelectAll", "Undo". Caution: the dict is considered
+ to be read only!
+ @signal: 'customizeContextMenu(QObject* EditContextMenuWrap, QMenu* contextMenu)'.
+ This signal is emitted when the context menu for the editbox is requested. Use this signal
+ to customize the menu.
+ @signal: 'contextMenuActionSelected(QAction* action, bool isStandardAction)'.
+ Emitted when the user selected an action from the context menu. The flag indicates wether
+ a standard action or a custom action was selected
+
+ """
+ QtCore.QObject.__init__(self, edit)
+
+ self.edit = edit
+ self.actions = {}
+
+ edit.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
+ self.connect(
+ edit,
+ QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'),
+ self.__call__
+ )
+
+ def __call__(self, pt):
+
+ # create custom LineEdit context menu
+ self.actions = {}
+ m = QtGui.QMenu(self.edit)
+
+ # add default QLineEdit actions
+ actions = (
+ (
+ 'Undo',
+ self.edit.trUtf8("&Undo"),
+ QtGui.QKeySequence.Undo,
+ self.trUtf8('Undos the last ation'),
+ self.edit.undo,
+ ),
+ (
+ 'Redo',
+ self.edit.trUtf8("&Redo"),
+ QtGui.QKeySequence.Redo,
+ self.trUtf8('Redos the last ation'),
+ self.edit.redo,
+ ),
+ (
+ 'Cut',
+ self.edit.trUtf8("Cu&t"),
+ QtGui.QKeySequence.Cut,
+ self.trUtf8('Cuts the currently selected text'),
+ self.edit.cut,
+ ),
+ (
+ 'Copy',
+ self.edit.trUtf8("&Copy"),
+ QtGui.QKeySequence.Copy,
+ self.trUtf8('Copies the currently selected text'),
+ self.edit.copy,
+ ),
+ (
+ 'Paste',
+ self.edit.trUtf8("&Paste"),
+ QtGui.QKeySequence.Paste,
+ self.trUtf8('Pastes text from the clipboard'),
+ self.edit.paste,
+ ),
+ (
+ 'SelectAll',
+ self.edit.trUtf8("Select All"),
+ QtGui.QKeySequence.SelectAll,
+ self.trUtf8('Selects all text'),
+ self.edit.selectAll,
+ ),
+ #TODO: Delete
+ #d->actions[QLineEditPrivate::ClearAct] = new QAction(QLineEdit::tr("Delete"), this);
+ #QObject::connect(d->actions[QLineEditPrivate::ClearAct], SIGNAL(triggered()), this, SLOT(_q_deleteSelected()));
+ )
+
+ # setup actions
+ for name, text, shortcut, tip, trigger in actions:
+ act = QtGui.QAction(text, None)
+ act.setObjectName(name)
+ act.setStatusTip(tip)
+ if shortcut.__class__.__name__ == 'StandardKey':
+ # BUG: in PyQt4.3 - already reported
+ # initializing QKeySequence() with a Qt.StandardKey gives segfault
+ act.setShortcut(shortcut)
+ else:
+ act.setShortcut(QtGui.QKeySequence(shortcut) )
+ self.connect(act, QtCore.SIGNAL('triggered()'), trigger)
+ m.addAction(act)
+ self.actions[name] = act
+
+ # adjust actions
+ # TODO: disable SelectAll when all is already selected
+ if isinstance(self.edit, QtGui.QLineEdit):
+ self.actions['Undo'].setEnabled(self.edit.isUndoAvailable())
+ self.actions['Redo'].setEnabled(self.edit.isRedoAvailable())
+ self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.hasSelectedText())
+ self.actions['Copy'].setEnabled(self.edit.hasSelectedText())
+ self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and (not QtGui.QApplication.clipboard().text().isEmpty()))
+
+ else:
+ self.actions['Undo'].setEnabled(self.edit.document().isUndoAvailable())
+ self.actions['Redo'].setEnabled(self.edit.document().isRedoAvailable())
+ self.actions['Cut'].setEnabled((not self.edit.isReadOnly()) and self.edit.textCursor().hasSelection())
+ self.actions['Copy'].setEnabled(self.edit.textCursor().hasSelection())
+ self.actions['Paste'].setEnabled((not self.edit.isReadOnly()) and self.edit.canPaste())
+
+ # TODO: control chars submenu not yet implemented
+ # one problem is that you can not remove a menu from a menu
+ #~ ControlCharacters = (
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRM Left-to-right mark"), 0x200e),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLM Right-to-left mark"), 0x200f),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWJ Zero width joiner"), 0x200d),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWNJ Zero width non-joiner"), 0x200c),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "ZWSP Zero width space"), 0x200b),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRE Start of left-to-right embedding"), 0x202a),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLE Start of right-to-left embedding"), 0x202b),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRO Start of left-to-right override"), 0x202d),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLO Start of right-to-left override"), 0x202e),
+ #~ (QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "PDF Pop directional formatting"), 0x202c),
+ #~ )
+
+ # inform listeners
+ self.emit(QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'), self, m)
+ pt = self.edit.mapToGlobal(pt)
+ act = m.exec_(pt)
+
+ # find out if a custom action was triggered
+ if act is not None and act not in self.actions.values():
+ isStandardAction = act in self.actions.values()
+ self.emit(QtCore.SIGNAL('contextMenuActionSelected(QAction*, bool)'), act, isStandardAction)
+
+ # clear actions
+ for act in self.actions.values():
+ del act
+
+#***********************************************************************
+#
+#***********************************************************************
+if __name__ == '__main__':
+
+ def testEditBoxContextMenuWrap():
+
+ def customizeContextMenu(wrapper, menu):
+ menu.addSeparator()
+ menu.removeAction(wrapper.actions['Undo'])
+ menu.removeAction(wrapper.actions['Redo'])
+ menu.addAction('Custom Action 1')
+ menu.addAction('Custom Action 2')
+
+
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = QtGui.QWidget()
+ grid = QtGui.QVBoxLayout(w)
+
+ lineEd = QtGui.QLineEdit(w)
+ textEd = QtGui.QTextEdit(w)
+
+ wrappers = []
+ for ed in (lineEd, textEd):
+ grid.addWidget(ed)
+ wrapper = EditBoxContextMenuWrap(ed)
+ wrappers.append(wrapper)
+ ed.connect(wrapper, QtCore.SIGNAL('customizeContextMenu(QObject*, QMenu*)'), customizeContextMenu)
+
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
+#testEditBoxContextMenuWrap()
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:54:37
|
Revision: 1371
http://frogpie.svn.sourceforge.net/frogpie/?rev=1371&view=rev
Author: jUrner
Date: 2007-09-19 08:54:36 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/settingsbase.py
Modified: trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/settingsbase.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/settingsbase.py 2007-09-19 15:54:16 UTC (rev 1370)
+++ trunk/sandbox/colordip/colordip/colordip_lib/qt4ex/settingsbase.py 2007-09-19 15:54:36 UTC (rev 1371)
@@ -330,4 +330,49 @@
@note: default implementation does nothing. Use this in customized classes to do clean up
"""
+#****************************************************************************************
+# ...for testing or non persiatant storage
+#***************************************************************************************
+class QSettingsNull(QtCore.QSettings):
+ """QSettings class that ignores all calls
+ @note: it ignores all setValue() calls aswell. So value() will always return an empty QVariant
+ """
+ def __init__(self, *args):
+ QtCore.QSettings.__init__(self)
+ self._groups = [QtCore.QString(), ]
+ self._arrayIndex = 0
+ self._fallbacksEnabled = False
+ def allKeys(self): return []
+ def beginGoup(self, name): self.groups.append(QtCore.QString(name))
+ def beginReadArray(self, *args): return 0
+ def beginWriteArray(self, *args): pass
+ def childGroups(self): return []
+ def childKeys(self): return []
+ def clear(self): pass
+ def contains(self, *args): return False
+ def endArray(self): pass
+ def endGroup(self): pass
+ def fallbacksEnabled(self): return self._fallbacksEnabled
+ def fileName(self): return QtCore.QString()
+ def group(self): return self._groups[-1]
+ def isWritable(self): return True
+ def remove(self, *args): pass
+ def setArrayIndex(self, i): self._arrayIndex = i
+ def setFallbacksEnabled(self, flag): self._fallbacksEnabled = bool(flag)
+ def setValue(self, key, value): pass
+ def status(self): return self.NoError
+ def sync(self): pass
+ def value(self, key, defaultValue=None): return QtCore.QVariant()
+
+
+class SettingsNull(object):
+ """Non persistant settings class
+ """
+ def __init__(self): pass
+ def getObject(self, parent): return QSettingsNull()
+ def readSettings(self, parent, *settingsClasses): pass
+ def dumpSettings(self, parent, *settingsClasses): pass
+ def close(self, settings): pass
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:54:12
|
Revision: 1370
http://frogpie.svn.sourceforge.net/frogpie/?rev=1370&view=rev
Author: jUrner
Date: 2007-09-19 08:54:16 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
test code was broken - fixed
Modified Paths:
--------------
trunk/sandbox/chartables/chartables/chartables_tables/tables_charsets.py
trunk/sandbox/chartables/chartables/chartables_tables/tables_colors.py
trunk/sandbox/chartables/chartables/chartables_tables/tables_entities.py
Modified: trunk/sandbox/chartables/chartables/chartables_tables/tables_charsets.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables_tables/tables_charsets.py 2007-09-19 15:53:57 UTC (rev 1369)
+++ trunk/sandbox/chartables/chartables/chartables_tables/tables_charsets.py 2007-09-19 15:54:16 UTC (rev 1370)
@@ -387,7 +387,7 @@
((0x7511, 0x8898), self.trUtf8("CJK Unified Ideographs (3)")),
((0x8899, 0x9fbb), self.trUtf8("CJK Unified Ideographs (4)")),
- ((0xa000, 0xa48f), self.trUtf8("Yi Syllables")), # 1167 crs
+ ((0xa000, 0xa48f), self.trUtf8("Yi Syllables")), # 1167 chrs
((0xa490, 0xa4cf), self.trUtf8("Yi Radicals")),
# 11171 chars ...split it up
@@ -515,7 +515,7 @@
#ASCIITable(root, 'AsciiTable')
#ControlChars(root, 'ControlChars')
- w = CharTablesWidget(None, root,cfg=config.configNull())
+ w = CharTablesWidget(None, root,cfg=config.ConfigNull(None))
w.show()
res = app.exec_()
sys.exit(res)
Modified: trunk/sandbox/chartables/chartables/chartables_tables/tables_colors.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables_tables/tables_colors.py 2007-09-19 15:53:57 UTC (rev 1369)
+++ trunk/sandbox/chartables/chartables/chartables_tables/tables_colors.py 2007-09-19 15:54:16 UTC (rev 1370)
@@ -716,7 +716,7 @@
# just a few sanity tests
root = table_base.root
- w = CharTablesWidget(None, root,cfg=config.configNull())
+ w = CharTablesWidget(None, root,cfg=config.ConfigNull(None))
w.show()
res = app.exec_()
sys.exit(res)
Modified: trunk/sandbox/chartables/chartables/chartables_tables/tables_entities.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables_tables/tables_entities.py 2007-09-19 15:53:57 UTC (rev 1369)
+++ trunk/sandbox/chartables/chartables/chartables_tables/tables_entities.py 2007-09-19 15:54:16 UTC (rev 1370)
@@ -491,7 +491,7 @@
# just a few sanity tests
root = table_base.root
- w = CharTablesWidget(None, root,cfg=config.configNull())
+ w = CharTablesWidget(None, root,cfg=config.ConfigNull(None))
w.show()
res = app.exec_()
sys.exit(res)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:53:56
|
Revision: 1369
http://frogpie.svn.sourceforge.net/frogpie/?rev=1369&view=rev
Author: jUrner
Date: 2007-09-19 08:53:57 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/settingsbase.py
Modified: trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/settingsbase.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/settingsbase.py 2007-09-19 15:53:45 UTC (rev 1368)
+++ trunk/sandbox/chartables/chartables/chartables_lib/qt4ex/settingsbase.py 2007-09-19 15:53:57 UTC (rev 1369)
@@ -330,4 +330,54 @@
@note: default implementation does nothing. Use this in customized classes to do clean up
"""
+#****************************************************************************************
+# ...for testing or non persiatant storage
+#***************************************************************************************
+class QSettingsNull(QtCore.QSettings):
+ """QSettings class that ignores all calls
+ @note: it ignores all setValue() calls aswell. So value() will always return an empty QVariant
+ """
+ def __init__(self, *args):
+ QtCore.QSettings.__init__(self)
+ self._groups = [QtCore.QString(), ]
+ self._arrayIndex = 0
+ self._fallbacksEnabled = False
+ def allKeys(self): return []
+ def beginGoup(self, name): self.groups.append(QtCore.QString(name))
+ def beginReadArray(self, *args): return 0
+ def beginWriteArray(self, *args): pass
+ def childGroups(self): return []
+ def childKeys(self): return []
+ def clear(self): pass
+ def contains(self, *args): return False
+ def endArray(self): pass
+ def endGroup(self): pass
+ def fallbacksEnabled(self): return self._fallbacksEnabled
+ def fileName(self): return QtCore.QString()
+ def group(self): return self._groups[-1]
+ def isWritable(self): return True
+ def remove(self, *args): pass
+ def setArrayIndex(self, i): self._arrayIndex = i
+ def setFallbacksEnabled(self, flag): self._fallbacksEnabled = bool(flag)
+ def setValue(self, key, value): pass
+ def status(self): return self.NoError
+ def sync(self): pass
+ def value(self, key, defaultValue=None): return QtCore.QVariant()
+
+
+class SettingsNull(object):
+ """Non persistant settings class
+ """
+ def __init__(self): pass
+ def getObject(self, parent): return QSettingsNull()
+ def readSettings(self, parent, *settingsClasses): pass
+ def dumpSettings(self, parent, *settingsClasses): pass
+ def close(self, settings): pass
+
+def configNull():
+ """Returns a Config() instance with non-persistant storage"""
+ cfg = Config()
+ cfg.settings = SettingsNull()
+ return cfg
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:53:46
|
Revision: 1368
http://frogpie.svn.sourceforge.net/frogpie/?rev=1368&view=rev
Author: jUrner
Date: 2007-09-19 08:53:45 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
added ConfigNull() class for testing
Modified Paths:
--------------
trunk/sandbox/chartables/chartables/config.py
Modified: trunk/sandbox/chartables/chartables/config.py
===================================================================
--- trunk/sandbox/chartables/chartables/config.py 2007-09-19 15:53:07 UTC (rev 1367)
+++ trunk/sandbox/chartables/chartables/config.py 2007-09-19 15:53:45 UTC (rev 1368)
@@ -41,4 +41,14 @@
+class ConfigNull(object):
+ """Config class for testing with non persistant settings"""
+ def __init__(self, parent):
+
+ self.assistant = assistant.Assistant(parent, profile=AssistantProfile, pages=DocPages)
+ self.language = language.Language([LanguageDir, ], translationPrefixes=TranslationPrefixes)
+ self.resources = resources.Resources([ResourceDir, ], )
+ self.settings = settingsbase.SettingsNull()
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:53:07
|
Revision: 1367
http://frogpie.svn.sourceforge.net/frogpie/?rev=1367&view=rev
Author: jUrner
Date: 2007-09-19 08:53:07 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
added some notes
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py
Modified: trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py 2007-09-19 15:52:28 UTC (rev 1366)
+++ trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py 2007-09-19 15:53:07 UTC (rev 1367)
@@ -1,3 +1,19 @@
+"""Preferences dialog"""
+
+
+# TODO:
+#
+# x. how to set some reasonable initial size? Mabe split the page population
+# process into two stages: 1. precreate all page widgets 2. tell the individual page
+# to init settings
+#
+# widget = page.create(parent)
+# page.initialize()
+# page.setVisible(flag)
+#
+
+
+
import sys, os
import cPickle
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-19 15:52:26
|
Revision: 1366
http://frogpie.svn.sourceforge.net/frogpie/?rev=1366&view=rev
Author: jUrner
Date: 2007-09-19 08:52:28 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
added SettingsNull() class for non persistant storage
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/settingsbase.py
Modified: trunk/sandbox/qt4ex/qt4ex/settingsbase.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/settingsbase.py 2007-09-17 09:56:22 UTC (rev 1365)
+++ trunk/sandbox/qt4ex/qt4ex/settingsbase.py 2007-09-19 15:52:28 UTC (rev 1366)
@@ -330,4 +330,49 @@
@note: default implementation does nothing. Use this in customized classes to do clean up
"""
+#****************************************************************************************
+# ...for testing or non persiatant storage
+#***************************************************************************************
+class QSettingsNull(QtCore.QSettings):
+ """QSettings class that ignores all calls
+ @note: it ignores all setValue() calls aswell. So value() will always return an empty QVariant
+ """
+ def __init__(self, *args):
+ QtCore.QSettings.__init__(self)
+ self._groups = [QtCore.QString(), ]
+ self._arrayIndex = 0
+ self._fallbacksEnabled = False
+ def allKeys(self): return []
+ def beginGoup(self, name): self.groups.append(QtCore.QString(name))
+ def beginReadArray(self, *args): return 0
+ def beginWriteArray(self, *args): pass
+ def childGroups(self): return []
+ def childKeys(self): return []
+ def clear(self): pass
+ def contains(self, *args): return False
+ def endArray(self): pass
+ def endGroup(self): pass
+ def fallbacksEnabled(self): return self._fallbacksEnabled
+ def fileName(self): return QtCore.QString()
+ def group(self): return self._groups[-1]
+ def isWritable(self): return True
+ def remove(self, *args): pass
+ def setArrayIndex(self, i): self._arrayIndex = i
+ def setFallbacksEnabled(self, flag): self._fallbacksEnabled = bool(flag)
+ def setValue(self, key, value): pass
+ def status(self): return self.NoError
+ def sync(self): pass
+ def value(self, key, defaultValue=None): return QtCore.QVariant()
+
+
+class SettingsNull(object):
+ """Non persistant settings class
+ """
+ def __init__(self): pass
+ def getObject(self, parent): return QSettingsNull()
+ def readSettings(self, parent, *settingsClasses): pass
+ def dumpSettings(self, parent, *settingsClasses): pass
+ def close(self, settings): pass
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-17 09:56:19
|
Revision: 1365
http://frogpie.svn.sourceforge.net/frogpie/?rev=1365&view=rev
Author: jUrner
Date: 2007-09-17 02:56:22 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
"MagnifierRelease" setting was not working - fixed
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.py
Modified: trunk/sandbox/colordip/colordip/colordip.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.py 2007-09-08 09:07:35 UTC (rev 1364)
+++ trunk/sandbox/colordip/colordip/colordip.py 2007-09-17 09:56:22 UTC (rev 1365)
@@ -861,12 +861,11 @@
for settingsName, (settingsType, value, isDirty) in self._userSettings:
if not isDirty:
continue
-
if settingsName == 'GuiStaysTopmost':
self.setStayTopmost(value)
elif settingsName == 'EyedropperRelease':
self._dragTools['eyedropper'].setReleaseOnClick(value)
- elif settingsName == 'MangnifierRelease':
+ elif settingsName == 'MagnifierRelease':
self._dragTools['magnifier'].setReleaseOnClick(value)
elif settingsName == 'LocaleName':
self.setLocale(value)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-08 09:07:32
|
Revision: 1364
http://frogpie.svn.sourceforge.net/frogpie/?rev=1364&view=rev
Author: jUrner
Date: 2007-09-08 02:07:35 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
...
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.pro
Modified: trunk/sandbox/colordip/colordip/colordip.pro
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.pro 2007-09-08 09:07:31 UTC (rev 1363)
+++ trunk/sandbox/colordip/colordip/colordip.pro 2007-09-08 09:07:35 UTC (rev 1364)
@@ -10,5 +10,5 @@
FORMS = colordip.ui \
colordip_dlgs/preferences.ui
-TRANSLATIONS = lang/en.ts \
- lang/de.ts
\ No newline at end of file
+TRANSLATIONS = lang/colordip_en.ts \
+ lang/colordip_de.ts
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-08 09:07:31
|
Revision: 1363
http://frogpie.svn.sourceforge.net/frogpie/?rev=1363&view=rev
Author: jUrner
Date: 2007-09-08 02:07:31 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
minor fix
Modified Paths:
--------------
trunk/sandbox/colordip/colordip/colordip.py
Modified: trunk/sandbox/colordip/colordip/colordip.py
===================================================================
--- trunk/sandbox/colordip/colordip/colordip.py 2007-09-08 09:07:19 UTC (rev 1362)
+++ trunk/sandbox/colordip/colordip/colordip.py 2007-09-08 09:07:31 UTC (rev 1363)
@@ -9,7 +9,7 @@
# x. currently the gui is fixed size
# This is due to flicker and other problems on dynamically resizing the gui.
# Another reason for fixed size is that there is AFAIK no way to tell a QLabel
-# to shrink its pixmap on resizing. See I I can get away with that.
+# to shrink its pixmap on resizing.
#
# x. isolate magnifier label to a ZoomViewEvemtFilter() and add scrolling
# functionality.
@@ -23,17 +23,13 @@
#
# x. keyboard interface
# y. no idea what shortcuts to use for color types and formats
-# x. "Color type" and "Color Format". Not happy with the wording.
#
-# x. when setting a color from the color edit box
-# the entered string should not be changed (???)
-#
# x. when background color for magnifier is changed the background color of
# the pixmap is not updated. Would have to store the clip region and redrap pixmap.
# Too much trouble so far........
# x. when no color is set getColor() should return None.
#
-# x. when color edoits are empty behaviour is not very well defined
+# x. when color edits are empty behaviour is not very well defined
# all empty = nothing will happens on return pressed (looks like Qt default behaviour)
# less than 0 empty = all others are assumed to be 0
#
@@ -56,13 +52,6 @@
#*******************************************************************
# consts
#*******************************************************************
-DIR_SELF = os.path.split(__file__)[0]
-QTA_PROFILE = os.path.join(DIR_SELF, 'doc', 'assistant.adp')
-HELP_PAGE = os.path.join(DIR_SELF, 'doc', 'index.html')
-
-CFG_ORG_NAME = 'jUrner'
-CFG_APP_NAME = 'DialogColorDip'
-
PREFIX_DRAGTOOL = 'dragtool-'
DRAGTOOL_HOTSPOTS = {
'eyedropper': (2, 27),
@@ -207,7 +196,7 @@
label = parent.controlById(ID_LABEL_MAGNIFIER)
result = settingsbase.SettingsBase.toUPng(self, parent, settings, name, variant, default)
if result is None:
- result = self._getEmptyMagnifierPixmap(label)
+ result = self._createEmptyMagnifierPixmap(label)
parent.updateMagnifier(px=result)
return result
@@ -217,14 +206,14 @@
px = value
else:
label = parent.controlById(ID_LABEL_MAGNIFIER)
- px = self._getEmptyMagnifierPixmap(label)
+ px = self._createEmptyMagnifierPixmap(label)
return settingsbase.SettingsBase.fromUPng(self, parent, settings, name, px)
###########################
## private methods
###########################
- def _getEmptyMagnifierPixmap(self, label):
+ def _createEmptyMagnifierPixmap(self, label):
size = label.size()
px = QtGui.QPixmap(size)
painter = QtGui.QPainter(px)
@@ -586,7 +575,7 @@
appName='ColorDip',
description=self.trUtf8('A Qt4 / PyQt4 based color picker with magnifier'),
version=__init__.__version__,
- author=__init__.__email__,
+ author=__init__.__author__,
email=__init__.__email__,
licence=__init__.__licence__,
copyright=__init__.__copyright__,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-08 09:07:23
|
Revision: 1362
http://frogpie.svn.sourceforge.net/frogpie/?rev=1362&view=rev
Author: jUrner
Date: 2007-09-08 02:07:19 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
minor fix
Modified Paths:
--------------
trunk/sandbox/chartables/chartables/chartables.py
Modified: trunk/sandbox/chartables/chartables/chartables.py
===================================================================
--- trunk/sandbox/chartables/chartables/chartables.py 2007-09-07 20:55:15 UTC (rev 1361)
+++ trunk/sandbox/chartables/chartables/chartables.py 2007-09-08 09:07:19 UTC (rev 1362)
@@ -2,6 +2,9 @@
# TODO:
#
+# x. bit of an overkill though, bookmark organisation in (sub)folders
+#
+#
import os
from PyQt4 import QtCore, QtGui
@@ -240,7 +243,7 @@
appName='CharTables',
description=self.trUtf8('Python and Qt4 good to have at hand tables'),
version=__init__.__version__,
- author=__init__.__email__,
+ author=__init__.__author__,
email=__init__.__email__,
licence=__init__.__licence__,
copyright=__init__.__copyright__,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-07 20:55:16
|
Revision: 1361
http://frogpie.svn.sourceforge.net/frogpie/?rev=1361&view=rev
Author: jUrner
Date: 2007-09-07 13:55:15 -0700 (Fri, 07 Sep 2007)
Log Message:
-----------
...
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/qtools.py
Modified: trunk/sandbox/qt4ex/qt4ex/qtools.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/qtools.py 2007-09-07 20:54:51 UTC (rev 1360)
+++ trunk/sandbox/qt4ex/qt4ex/qtools.py 2007-09-07 20:55:15 UTC (rev 1361)
@@ -51,7 +51,13 @@
key = keyboardEvent.key() | int(keyboardEvent.modifiers())
return key in [int(i) for i in QtGui.QKeySequence.keyBindings(standardKey)]
+#**********************************************************************
+#
+#**********************************************************************
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2007-09-07 20:54:50
|
Revision: 1360
http://frogpie.svn.sourceforge.net/frogpie/?rev=1360&view=rev
Author: jUrner
Date: 2007-09-07 13:54:51 -0700 (Fri, 07 Sep 2007)
Log Message:
-----------
outstanding changes are now processed on accept()
Modified Paths:
--------------
trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py
Modified: trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py
===================================================================
--- trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py 2007-09-07 10:43:27 UTC (rev 1359)
+++ trunk/sandbox/qt4ex/qt4ex/dlgs/dlgpreferences/__init__.py 2007-09-07 20:54:51 UTC (rev 1360)
@@ -141,7 +141,7 @@
def pageFromUuid(self, uuid):
"""Traverses the page and all its children to return a page given its uuid
@return: page or None if no page was found"""
- for flag, page in self.walk():
+ for page in self.walk():
if page.uuid() == uuid:
return page
@@ -181,23 +181,31 @@
"""Returns the uuid of the page"""
return self._pageData['uuid']
- def walk(self):
+ def walk(self, report=False):
"""Walks over a page and all its children
- @return: tupple(flag, page) for the next page in turn
- where flag is 1 if a page is a container for child pages, 0 if a page has no child pages
- and -1 if traversal of a pages child pages is completed
+ @param report: if If False the next page in turn is returned. If True, a tupple(flag, page) for the next
+ page in turn is returned, where flag is 1 if a page is a container for child pages, 0 if a page has no
+ child pages and -1 if traversal of a pages child pages is completed.
"""
- def walker(item):
- children = item.children()
- if children:
- yield 1, item
- for i in children:
- for x in walker(i):
+ if report:
+ def walker(page):
+ children = page.children()
+ if children:
+ yield 1, page
+ for childPage in children:
+ for x in walker(childPage):
+ yield x
+ yield -1, page
+ else:
+ yield 0, page
+ else:
+ def walker(page):
+ yield page
+ for childPage in page.children():
+ for x in walker(childPage):
yield x
- yield -1, item
- else:
- yield 0, item
- return iter(walker(self))
+
+ return walker(self)
#*********************************************************************
#
@@ -211,6 +219,7 @@
PrefixCapability = 'can'
PrefixCapabilityApply = 'do'
MethodNameIsDirty = 'isDirty'
+ MethodNameApply = 'doApply'
def __init__(self, ui, cb, pageContainer, buttonBox, maxPageDepth=None, pages=None):
@@ -272,7 +281,7 @@
if pages is not None:
# drop root item
- enum = iter(pages.walk())
+ enum = iter(pages.walk(report=True))
flag, root = enum.next()
# dump items
@@ -358,6 +367,20 @@
bt.setEnabled(method())
+ def close(self):
+ """Close the controler
+ @note: make shure to call this method on exit to apply outstanding changes
+ """
+ if self.pages is not None:
+ for page in self.pages.walk():
+ if page.isDirty():
+ method = getattr(page, self.MethodNameApply, None)
+ if method is None:
+ raise ValueError('Pages must provide a "%s" method' % self.MethodNameApply)
+ method()
+
+
+
def currentPage(self):
"""Returns the currently displayed page or None"""
if self.lastSelectedPage is not None:
@@ -526,6 +549,21 @@
self.restoreState(state)
+
+
+ #########################################
+ ## overwritten methods
+ ########################################
+ def accept(self):
+ oldCursor = self.cursor()
+ self.setCursor(QtCore.Qt.BusyCursor)
+ try:
+ self._pageControler.close()
+ finally:
+ self.setCursor(oldCursor)
+ QtGui.QDialog.accept(self)
+
+
#######################################
## slots
#######################################
@@ -721,6 +759,7 @@
def __init__(self, *args):
Page.__init__(self, *args)
self._widget = None
+ self.setDirty(True)
def displayName(self): return self.uuid()
def canApply(self): return True
@@ -729,16 +768,16 @@
def setVisible(self, parent, flag):
createdNew = False
if flag and self._widget is None:
+ createdNew = True
widget = QtGui.QFrame(parent)
grid = QtGui.QGridLayout(widget)
label = QtGui.QLabel(
- '<html>This pane shows preferences of the <b>"%s"</b> page</html>' % self.uuid(),
+ '<html>This pane shows the <b>"%s"</b> page</html>' % self.uuid(),
widget
)
label.setAlignment(QtCore.Qt.AlignTop)
grid.addWidget(label)
self._widget = widget
- createdNew = True
self._widget.setVisible(flag)
return (createdNew, self._widget)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|