~dobey/ubuntu/oneiric/ubuntu-sso-client/release-133

« back to all changes in this revision

Viewing changes to ubuntu_sso/tests/bin/show_gui

  • Committer: Ken VanDine
  • Date: 2010-09-09 15:03:00 UTC
  • mfrom: (11.1.3 ubuntu-sso-client-0.99.6)
  • Revision ID: ken.vandine@canonical.com-20100909150300-z0lnnumytp0493tf
Tags: 0.99.6-0ubuntu1
releasing version 0.99.6-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
# ubuntu-sso-login-gui - GUI for registration and login for Ubuntu SSO
 
4
#
 
5
# Author: Natalia Bidart <natalia.bidart@canonical.com>
 
6
#
 
7
# Copyright 2010 Canonical Ltd.
 
8
#
 
9
# This program is free software: you can redistribute it and/or modify it
 
10
# under the terms of the GNU General Public License version 3, as published
 
11
# by the Free Software Foundation.
 
12
#
 
13
# This program is distributed in the hope that it will be useful, but
 
14
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
15
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
16
# PURPOSE.  See the GNU General Public License for more details.
 
17
#
 
18
# You should have received a copy of the GNU General Public License along
 
19
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
"""Script to run the Ubuntu SSO client GUI."""
 
21
 
 
22
import gtk
 
23
import sys
 
24
 
 
25
from ubuntu_sso.gui import UbuntuSSOClientGUI
 
26
 
 
27
 
 
28
APP_NAME = 'Ubuntu'
 
29
TC_URI = 'http://one.ubuntu.com/terms'
 
30
HELP_TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' \
 
31
            'Nam sed lorem nibh. Suspendisse gravida nulla non nunc suscipit' \
 
32
            ' pulvinar tempus ut augue.'
 
33
 
 
34
main_quit = lambda *args, **kwargs: gtk.main_quit()
 
35
 
 
36
 
 
37
if __name__ == '__main__':
 
38
    tc_uri=TC_URI
 
39
    login_only = False
 
40
    xid = 0
 
41
 
 
42
    if '--login' in sys.argv:
 
43
        login_only = True
 
44
        tc_uri = None
 
45
 
 
46
    if '--with-parent-window' in sys.argv:
 
47
        win = gtk.Window()
 
48
        win.set_title(APP_NAME)
 
49
        win.set_position(gtk.WIN_POS_CENTER)
 
50
        win.set_size_request(800, 600)
 
51
        win.show()
 
52
        xid = win.window.xid
 
53
 
 
54
    UbuntuSSOClientGUI(close_callback=main_quit, app_name=APP_NAME,
 
55
                       tc_uri=tc_uri, help_text=HELP_TEXT, window_id=xid,
 
56
                       login_only=login_only)
 
57
    gtk.main()