From 0bade58c23e53ec87385d88e5cb5b0b8add32d6d Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 18 Apr 2007 12:06:34 +0000 Subject: Remove obsolete tests --- diff --git a/tests/test-button.py b/tests/test-button.py deleted file mode 100755 index 9cceb92..0000000 --- a/tests/test-button.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2007, One Laptop Per Child -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import sys -sys.path.insert(0, '/home/tomeu/sugar-jhbuild/source/sugar') - -import gtk -import hippo - -from sugar.graphics.toolbar import Toolbar -from sugar.graphics.iconbutton import IconButton -from sugar.graphics.toggleiconbutton import ToggleIconButton -from sugar.graphics.button import Button -from sugar.graphics.entry import Entry - -def _button_activated_cb(button): - print "_button_activated_cb" - -def _toggled_changed_cb(button, pspec): - print "Toggle state: %d" % button.props.toggled - -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -window.show() - -canvas = hippo.Canvas() -window.add(canvas) -canvas.show() - -vbox = hippo.CanvasBox() -canvas.set_root(vbox) - -for i in [1, 2]: - toolbar = Toolbar() - toolbar.props.box_width = 400 - vbox.append(toolbar) - - icon_button = IconButton(icon_name='theme:stock-close') - toolbar.append(icon_button) - - toggle = ToggleIconButton(icon_name='theme:stock-back') - toggle.connect('notify::toggled', _toggled_changed_cb) - toolbar.append(toggle) - - button = Button(text='Click me!', icon_name='theme:stock-close') - button.connect('activated', _button_activated_cb) - toolbar.append(button) - - entry = Entry(text='mec') - toolbar.append(entry) - -gtk.main() diff --git a/tests/test-entry.py b/tests/test-entry.py deleted file mode 100755 index 80f0e23..0000000 --- a/tests/test-entry.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2007, One Laptop Per Child -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import gtk -import hippo - -from sugar.graphics.toolbar import Toolbar -from sugar.graphics.frame import Frame -from sugar.graphics.iconbutton import IconButton -from sugar.graphics.entry import Entry - -def _entry_activated_cb(entry): - print "_entry_activated_cb" - -def _entry_button_activated_cb(entry, action_id): - print "_entry_button_activated_cb: " + str(action_id) - entry.props.text = '' - -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -window.show() - -canvas = hippo.Canvas() -window.add(canvas) -canvas.show() - -vbox = hippo.CanvasBox() -canvas.set_root(vbox) - -for i in [1, 2]: - toolbar = Toolbar() - vbox.append(toolbar) - - button = IconButton('theme:stock-close') - toolbar.append(button) - - BUTTON_DELETE = 1 - entry = Entry() - entry.props.text = 'mec mac' - entry.add_button('theme:stock-close', BUTTON_DELETE) - entry.connect('activated', _entry_activated_cb) - entry.connect('button-activated', _entry_button_activated_cb) - toolbar.append(entry, hippo.PACK_EXPAND) - - entry = Entry() - entry.props.text = 'moc muc' - toolbar.append(entry, hippo.PACK_EXPAND) - - gtk_entry = gtk.Entry() - gtk_entry.props.has_frame = False - #gtk_entry.connect("activate", self._entry_activate_cb) - - gtk_entry_widget = hippo.CanvasWidget() - gtk_entry_widget.props.widget = gtk_entry - toolbar.append(gtk_entry_widget, hippo.PACK_EXPAND) - -gtk.main() diff --git a/tests/test-frame.py b/tests/test-frame.py deleted file mode 100755 index 4a22fd1..0000000 --- a/tests/test-frame.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2006, Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import gtk -import hippo - -from sugar.graphics.frame import Frame - -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -window.show() - -canvas = hippo.Canvas() - -frame = Frame() -canvas.set_root(frame) - -window.add(canvas) -canvas.show() - -gtk.main() diff --git a/tests/test-label.py b/tests/test-label.py deleted file mode 100755 index 6e7b6b2..0000000 --- a/tests/test-label.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2007, One Laptop Per Child -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import gtk -import hippo - -from sugar.graphics.toolbar import Toolbar -from sugar.graphics.label import Label -from sugar.graphics.iconbutton import IconButton - -BUTTON_DELETE = 1 - -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -window.show() - -canvas = hippo.Canvas() -window.add(canvas) -canvas.show() - -vbox = hippo.CanvasBox() -canvas.set_root(vbox) - -toolbar = Toolbar() -vbox.append(toolbar) - -button = IconButton('theme:stock-close') -toolbar.append(button) - -label = Label('mec moc') -toolbar.append(label) - -label = Label() -label.props.text = 'mac mic' -toolbar.append(label) - -gtk.main() diff --git a/tests/test-option-menu.py b/tests/test-option-menu.py deleted file mode 100755 index a9202da..0000000 --- a/tests/test-option-menu.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2007, One Laptop Per Child -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import sys -sys.path.insert(0, '/home/tomeu/sugar-jhbuild/source/sugar') -from gettext import gettext as _ - -import gtk -import hippo - -from sugar.graphics.toolbar import Toolbar -from sugar.graphics.optionmenu import OptionMenu -from sugar.graphics.menu import MenuItem -from sugar.graphics.iconbutton import IconButton - -def _option_menu_changed_cb(option_menu): - print '_option_menu_activated_cb: %i' % option_menu.props.value - -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -window.show() - -canvas = hippo.Canvas() -window.add(canvas) -canvas.show() - -vbox = hippo.CanvasBox() -canvas.set_root(vbox) - -toolbar = Toolbar() -vbox.append(toolbar) - -button = IconButton(icon_name='theme:stock-close') -toolbar.append(button) - -OPTION_ANYTHING = 1 -OPTION_DRAW = 2 -OPTION_WRITE = 3 -OPTION_CHAT = 4 - -option_menu = OptionMenu() -option_menu.add_item(MenuItem(OPTION_ANYTHING, 'Anything')) -option_menu.add_separator() -option_menu.add_item(MenuItem(OPTION_DRAW, 'Draw', 'theme:stock-close')) -option_menu.add_item(MenuItem(OPTION_WRITE, 'Write')) -option_menu.add_item(MenuItem(OPTION_CHAT, 'Chat')) -option_menu.connect('changed', _option_menu_changed_cb) -toolbar.append(option_menu) - -gtk.main() diff --git a/tests/test-theme.py b/tests/test-theme.py deleted file mode 100755 index eae835f..0000000 --- a/tests/test-theme.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2006, Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import pygtk -pygtk.require('2.0') - -import gtk - -# Main window -window = gtk.Window() -window.connect("destroy", lambda w: gtk.main_quit()) -#window.set_border_width(10) - -# Main VBox - -main_vbox = gtk.VBox(homogeneous=False, spacing=0) -window.add(main_vbox) - -############################### ############################## -############################### Menus ############################## -############################### ############################## - -menu = gtk.Menu() -file_menu = gtk.Menu() # Don't need to show menus -edit_menu = gtk.Menu() - -# Create the menu items -dummy_item_1 = gtk.MenuItem("Dummy Item 1") -dummy_item_2 = gtk.MenuItem("Dummy Item 2") -quit_item = gtk.MenuItem("Quit") -dummy_item_3 = gtk.MenuItem("Dummy Item 3") -dummy_item_4 = gtk.MenuItem("Dummy Item 4") -dummy_item_5 = gtk.MenuItem("Dummy Item 5") - -# Add them to the menu -file_menu.append(dummy_item_1) -file_menu.append(dummy_item_2) -file_menu.append(quit_item) - -edit_menu.append(dummy_item_3) -edit_menu.append(dummy_item_4) -edit_menu.append(dummy_item_5) - -# We can attach the Quit menu item to our exit function -quit_item.connect_object ("activate", lambda w: gtk.main_quit (), "file.quit") - -# We do need to show menu items -dummy_item_1.show() -dummy_item_2.show() -quit_item.show() -dummy_item_3.show() -dummy_item_4.show() -dummy_item_5.show() - -# Pack the menu into the menubar -menu_bar = gtk.MenuBar() -main_vbox.pack_start(menu_bar, False, False, 0) -menu_bar.show() - -file_item = gtk.MenuItem("File") -file_item.show() -menu_bar.append(file_item) -file_item.set_submenu(file_menu) - -edit_item = gtk.MenuItem("Edit") -edit_item.show() -menu_bar.append(edit_item) -edit_item.set_submenu(edit_menu) - - -# Scrolled window -scrolled_window = gtk.ScrolledWindow(hadjustment=None, vadjustment=None) -#scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) -scrolled_window.set_border_width(10) -main_vbox.pack_start(scrolled_window, True, True, 0) - -# Vbox inside the scrolled window -vbox = gtk.VBox(homogeneous=False, spacing=10) -scrolled_window.add_with_viewport(vbox) -vbox.set_border_width (10) - -# Label -label = gtk.Label("This is a label") -vbox.pack_start(label, False, False, 0) - -# Entry -entry = gtk.Entry () -entry.set_text("Type some text here") -vbox.pack_start(entry, False, False, 0) - -# Buttons -buttons_hbox = gtk.HBox(homogeneous=False, spacing=5) -vbox.pack_start(buttons_hbox, False, False, 0) - -button_1 = gtk.Button ("Button 1") -buttons_hbox.pack_start(button_1, False, False, 0) - -button_2 = gtk.Button ("Button 2") -buttons_hbox.pack_start(button_2, False, False, 0) - -button_3 = gtk.Button ("Button 3") -buttons_hbox.pack_start(button_3, False, False, 0) - -window.show_all() - -gtk.main() diff --git a/tests/test-window-manager.py b/tests/test-window-manager.py deleted file mode 100644 index 539979d..0000000 --- a/tests/test-window-manager.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2006, Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import pygtk -pygtk.require('2.0') - -from sugar.session.UITestSession import UITestSession - -session = UITestSession() -session.start() - -import gtk - -def _show_dialog(window): - dialog = gtk.Dialog(title='No Unviewed Media', - parent=window, flags=gtk.DIALOG_MODAL, - buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) - label = gtk.Label('There is no unviewed media to download.') - dialog.vbox.pack_start(label, True, True, 0) - label.show() - response = dialog.run() - dialog.hide() - del dialog - -window = gtk.Window() -window.show() - -_show_dialog(window) - -gtk.main() -- cgit v0.9.1