Home | Trees | Indices | Help |
|
---|
|
1 # ================================================================================== 2 # 3 # Copyright (C) 2007-2008 Conceptive Engineering bvba. All rights reserved. 4 # www.conceptive.be / project-camelot@conceptive.be 5 # 6 # This file is part of the Camelot Library. 7 # 8 # This file may be used under the terms of the GNU General Public 9 # License version 2.0 as published by the Free Software Foundation 10 # and appearing in the file LICENSE.GPL included in the packaging of 11 # this file. Please review the following information to ensure GNU 12 # General Public Licensing requirements will be met: 13 # http://www.trolltech.com/products/qt/opensource.html 14 # 15 # If you are unsure which license is appropriate for your use, please 16 # review the following information: 17 # http://www.trolltech.com/products/qt/licensing.html or contact 18 # project-camelot@conceptive.be. 19 # 20 # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 21 # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 22 # 23 # For use of this library in commercial applications, please contact 24 # project-camelot@conceptive.be 25 # 26 # ================================================================================== 27 28 """The action module contains various QAction classes, representing commands that 29 can be invoked via menus, toolbar buttons, and keyboard shortcuts.""" 30 31 from PyQt4.QtCore import Qt 32 from PyQt4 import QtGui, QtCore 33 34 from camelot.view.art import Icon 35 from camelot.view.model_thread import post 36 37 import logging 38 logger = logging.getLogger( 'camelot.action.refresh' ) 3941 """Session refresh expires all objects in the current session and sends 42 a local entity update signal via the remote_signals mechanism""" 437145 super( SessionRefresh, self ).__init__( 'Refresh', parent ) 46 self.setShortcut( Qt.Key_F9 ) 47 self.setIcon( Icon( 'tango/16x16/actions/view-refresh.png' ).getQIcon() ) 48 self.connect( self, QtCore.SIGNAL( 'triggered(bool)' ), self.sessionRefresh ) 49 from camelot.view.remote_signals import get_signal_handler 50 self.signal_handler = get_signal_handler()51 5557 logger.debug( 'session refresh requested' ) 58 59 def refresh_objects(): 60 from elixir import session 61 refreshed_objects = [] 62 63 for _key, value in session.identity_map.items(): 64 session.refresh( value ) 65 refreshed_objects.append( value ) 66 67 return refreshed_objects68 69 70 post( refresh_objects, self.refreshed)
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 12 15:42:10 2010 | http://epydoc.sourceforge.net |