~sir-rainbow/+junk/scribes-on-win

« back to all changes in this revision

Viewing changes to plugins/PluginRemoteDialog.py

  • Committer: goldenmyst
  • Date: 2007-09-25 17:15:52 UTC
  • Revision ID: goldenmyst@goldenmyst-desktop-20070925171552-mvrhxdd39iibs0sr
New branch. New Trigger Management System. New Trigger API. New Plugin Management System. Fix for bug triggered by PyGTK+ version 2.11 or better.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Copyright © 2005 Lateef Alabi-Oki
 
3
#
 
4
# This file is part of Scribes.
 
5
#
 
6
# Scribes is free software; you can redistribute it and/or modify
 
7
# it under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation; either version 2 of the License, or
 
9
# (at your option) any later version.
 
10
#
 
11
# Scribes is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with Scribes; if not, write to the Free Software
 
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 
19
# USA
 
20
 
 
21
"""
 
22
This module documents a class that implements the plug-in protocol to
 
23
show the remote dialog.
 
24
 
 
25
@author: Lateef Alabi-Oki
 
26
@organization: The Scribes Project
 
27
@copyright: Copyright © 2005 Lateef Alabi-Oki
 
28
@license: GNU GPLv2 or Later
 
29
@contact: <mystilleef@gmail.com>
 
30
"""
 
31
 
 
32
name = "Remote Dialog Plugin"
 
33
authors = ["Lateef Alabi-Oki <mystilleef@gmail.com>"]
 
34
version = 0.1
 
35
autoload = True
 
36
class_name = "RemoteDialogPlugin"
 
37
short_description = "Show the remote dialog."
 
38
long_description = """This plug-in shows the remote dialog."""
 
39
 
 
40
class RemoteDialogPlugin(object):
 
41
        """
 
42
        This class initializes a plug-in that shows the remote dialog.
 
43
        """
 
44
 
 
45
        def __init__(self, editor):
 
46
                """
 
47
                Initialize the plug-in object.
 
48
 
 
49
                @param self: Reference to the RemoteDialogPlugin instance.
 
50
                @type self: A RemoteDialogPlugin object.
 
51
 
 
52
                @param editor: Reference to the text editor.
 
53
                @type editor: An Editor object.
 
54
                """
 
55
                self.__editor = editor
 
56
                self.__trigger = None
 
57
 
 
58
        def load(self):
 
59
                """
 
60
                Initialize the RemoteDialogPlugin instance.
 
61
 
 
62
                @param self: Reference to the RemoteDialogPlugin instance.
 
63
                @type self: An RemoteDialogPlugin object.
 
64
                """
 
65
                from RemoteDialog.Trigger import RemoteDialogTrigger
 
66
                self.__trigger = RemoteDialogTrigger(self.__editor)
 
67
                return
 
68
 
 
69
        def unload(self):
 
70
                """
 
71
                Destroy the RemoteDialogPlugin instance.
 
72
 
 
73
                @param self: Reference to the RemoteDialogPlugin instance.
 
74
                @type self: An RemoteDialogPlugin object.
 
75
                """
 
76
                self.__trigger.emit("destroy")
 
77
                return