Skip to content

Commit

Permalink
Added utilities to the base gui's API
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyluke committed Jul 22, 2009
1 parent 5070569 commit 2d0a5f9
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
6 changes: 6 additions & 0 deletions amsn2/gui/base/__init__.py
Expand Up @@ -6,3 +6,9 @@
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 *

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

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

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

class aMSNDPChooser(object):
"""
This Interface represent a window used to choose a display picture,
should show a list of default dps and the possibility to catch a picture from a webcam.
"""
def __init__(self, default_dps, actions):
"""
@type default_dps: tuple
@params default_dps: a tuple containing strings representing the paths of the default dps.
@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
12 changes: 12 additions & 0 deletions amsn2/gui/base/error.py
@@ -0,0 +1,12 @@

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

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

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

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

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

1 change: 0 additions & 1 deletion amsn2/gui/front_ends/gtk/contact_list.py
Expand Up @@ -295,7 +295,6 @@ def onStatusChanged(self, combobox):
if self.status_values[key] == status:
break
# FIXME: changing status to 'offline' will disconnect, so return to login window
# also fix papyon, gives an error on setting 'offline'
if key != self._myview.presence:
self._myview.presence = key

Expand Down

0 comments on commit 2d0a5f9

Please sign in to comment.