Bug fix: closing the file
[codimension.git] / src / debugger / bpwp.py
blob6ecf597efff47f489821f28be5a07eb39a518387
2 # -*- coding: utf-8 -*-
4 # codimension - graphics python two-way code editor and analyzer
5 # Copyright (C) 2010-2012 Sergey Satskiy <sergey.satskiy@gmail.com>
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # $Id$
23 " Debugger break and watch point viewer "
26 from bpointviewer import BreakPointViewer
27 from wpointviewer import WatchPointViewer
29 from PyQt4.QtCore import Qt
30 from PyQt4.QtGui import QVBoxLayout, QWidget, QSplitter
33 class DebuggerBreakWatchPoints( QWidget ):
34 " Implements the debugger break and watch point viewer "
36 def __init__( self, parent, debugger ):
37 QWidget.__init__( self, parent )
39 self.__debugger = debugger
40 self.__createLayout()
41 return
43 def __createLayout( self ):
44 " Creates the widget layout "
46 verticalLayout = QVBoxLayout( self )
47 verticalLayout.setContentsMargins( 1, 1, 1, 1 )
49 self.splitter = QSplitter( Qt.Vertical )
51 self.breakPointViewer = BreakPointViewer( self.splitter,
52 self.__debugger.getBreakPointModel() )
53 self.__watchPointViewer = WatchPointViewer( self.splitter,
54 self.__debugger.getWatchPointModel() )
55 # TODO: temporary
56 self.__watchPointViewer.setVisible( False )
58 self.splitter.addWidget( self.breakPointViewer )
59 self.splitter.addWidget( self.__watchPointViewer )
61 self.splitter.setCollapsible( 0, False )
62 self.splitter.setCollapsible( 1, False )
64 verticalLayout.addWidget( self.splitter )
65 return
67 def clear( self ):
68 " Clears everything "
69 self.breakPointViewer.clear()
70 self.__watchPointViewer.clear()
71 return
73 def setFocus( self ):
74 " Sets the focus to the break points window "
75 self.breakPointViewer.setFocus()
76 return