~ubuntu-branches/ubuntu/jaunty/gedit/jaunty

« back to all changes in this revision

Viewing changes to plugins/pythonconsole/pythonconsole/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-01-19 23:24:09 UTC
  • mfrom: (1.1.56 upstream)
  • Revision ID: james.westby@ubuntu.com-20090119232409-ejljvc4iac8tybwy
Tags: 2.25.5-0ubuntu1
* New upstream version:
  - Add Fullscreen Mode 
  - Add a configuration dialog for the python console 
  - Rescan plugins when opening the preference dialog 
  - Misc bugfixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import gtk
28
28
import gedit
 
29
 
29
30
from console import PythonConsole
 
31
from config import PythonConsoleConfigDialog
30
32
 
31
33
class PythonConsolePlugin(gedit.Plugin):
32
34
        def __init__(self):
33
35
                gedit.Plugin.__init__(self)
 
36
                self.dlg = None
34
37
                
35
38
        def activate(self, window):
36
39
                console = PythonConsole(namespace = {'__builtins__' : __builtins__,
52
55
                bottom = window.get_bottom_panel()
53
56
                bottom.remove_item(console)
54
57
 
 
58
        def is_configurable(self):
 
59
                return True
 
60
 
 
61
        def create_configure_dialog(self):
 
62
                if not self.dlg:
 
63
                        self.dlg = PythonConsoleConfigDialog(self.get_data_dir())
 
64
                
 
65
                dialog = self.dlg.dialog()
 
66
                window = gedit.app_get_default().get_active_window()
 
67
                if window:
 
68
                        dialog.set_transient_for(window)
 
69
 
 
70
                return dialog
 
71