~ubuntu-branches/ubuntu/trusty/spyder/trusty-backports

« back to all changes in this revision

Viewing changes to spyderlib/plugins/configdialog.py

  • Committer: Package Import Robot
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2013-07-11 22:14:17 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20130711221417-gtzupg1u3s2h088p
Tags: 2.2.1+dfsg-1
Imported Upstream version 2.2.1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                                 getexistingdirectory, getopenfilename)
34
34
 
35
35
 
36
 
class SizeMixin(object):
37
 
    """Mixin to keep widget size accessible
38
 
    even when C++ object has been deleted"""
39
 
    def resizeEvent(self, event):
40
 
        """Reimplement Qt method"""
41
 
        QDialog.resizeEvent(self, event)
42
 
        self.emit(SIGNAL("size_change(QSize)"), self.size())
43
 
 
44
 
 
45
36
class ConfigPage(QWidget):
46
37
    """Configuration page base class"""
47
38
    def __init__(self, parent, apply_callback=None):
95
86
        raise NotImplementedError
96
87
 
97
88
 
98
 
class ConfigDialog(QDialog, SizeMixin):
 
89
class ConfigDialog(QDialog):
99
90
    """Spyder configuration ('Preferences') dialog box"""
100
91
    def __init__(self, parent=None):
101
92
        QDialog.__init__(self, parent)
102
 
        SizeMixin.__init__(self)
103
93
        
104
94
        # Destroying the C++ object right after closing the dialog box,
105
95
        # otherwise it may be garbage-collected in another QThread
203
193
        """This method is called to check all configuration page settings
204
194
        after configuration dialog has been shown"""
205
195
        self.emit(SIGNAL('check_settings()'))
 
196
    
 
197
    def resizeEvent(self, event):
 
198
        """
 
199
        Reimplement Qt method to be able to save the widget's size from the
 
200
        main application
 
201
        """
 
202
        QDialog.resizeEvent(self, event)
 
203
        self.emit(SIGNAL("size_change(QSize)"), self.size())
206
204
 
207
205
 
208
206
class SpyderConfigPage(ConfigPage):