Skip to content

Commit

Permalink
Group interfaces in gui's base API
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyluke committed Jul 24, 2009
1 parent ab20068 commit 5202422
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 89 deletions.
7 changes: 2 additions & 5 deletions amsn2/gui/base/__init__.py
Expand Up @@ -6,9 +6,6 @@
from splash import *
from chat_window import *
from skins import *
from error import *
from filechooser import *
from notification import *
from dialog import *
from dpchooser import *
from utility import *
from choosers import *

19 changes: 19 additions & 0 deletions amsn2/gui/base/dpchooser.py → amsn2/gui/base/choosers.py
@@ -1,4 +1,22 @@

class aMSNFileChooserWindow(object):
"""
This Interface represent a window used to choose a file,
which could be an image for the dp, a file to send, a theme file, etc.
"""
def __init__(self, filter, directory):
"""
@type filter: tuple
@param filter: A tuple containing strings, that will represent the file
formats to filter.
@type directory: str
@param directory: The path to start from.
This will eventually call the related show() method, so the window is
displayed when created.
"""
raise NotImplementedError

class aMSNDPChooser(object):
"""
This Interface represent a window used to choose a display picture,
Expand All @@ -17,3 +35,4 @@ def __init__(self, default_dps, actions):
displayed when created.
"""
raise NotImplementedError

19 changes: 0 additions & 19 deletions amsn2/gui/base/dialog.py

This file was deleted.

12 changes: 0 additions & 12 deletions amsn2/gui/base/error.py

This file was deleted.

19 changes: 0 additions & 19 deletions amsn2/gui/base/filechooser.py

This file was deleted.

19 changes: 0 additions & 19 deletions amsn2/gui/base/input.py

This file was deleted.

15 changes: 0 additions & 15 deletions amsn2/gui/base/notification.py

This file was deleted.

63 changes: 63 additions & 0 deletions amsn2/gui/base/utility.py
@@ -0,0 +1,63 @@

class aMSNErrorWindow(object):
""" This Interface represent an error window """
def __init__(self, error_text):
"""
@type error_text: str
This will eventually call the related show() method, so the window is
displayed when created.
"""
raise NotImplementedError

class aMSNNotificationWindow(object):
"""
This Interface represent a window used to display a notification message,
generally when an operation has finished succesfully.
"""
def __init__(self, notification_text):
"""
@type notification_text: str
This will eventually call the related show() method, so the window is
displayed when created.
"""
raise NotImplementedError

class aMSNDialogWindow(object):
"""
This Interface represent a dialog window, used to ask the user
about something to do.
"""
def __init__(self, message, actions):
"""
@type message: str
@type actions: tuple
@param actions: A tuple containing the options between
which the user can choose. Every option is a tuple itself, of the form (name, callback),
where callback is the function that will be called if the option is selected.
This will eventually call the related show() method, so the window is
displayed when created.
"""
raise NotImplementedError

class aMSNInputWindow(object):
"""
This Interface represent a window used to get an input,
like a new contact or a new group.
"""
def __init__(self, message, type, callback, params):
"""
@type message: str
@type type: ContactView or GroupView
@param type: contains the view to fill.
@type callback: function
@param callback: The function that will be called when the view has been filled.
The prototype is callback(view), where view is the ContactView or the Grouview
filled, or None if the input has been canceled.
@type params: tuple
@param params: a list of existing contacts or groups
"""
raise notImplementedError

0 comments on commit 5202422

Please sign in to comment.