Author: bdonlan
Date: 2004-07-04 23:45:50 -0400 (Sun, 04 Jul 2004)
New Revision: 299
Added:
trunk/clients/haver-gtk/bin/serverdlg-test.pl
Log:
* bin/serverdlg-test.pl - Import test script for server selection dialog
Added: trunk/clients/haver-gtk/bin/serverdlg-test.pl
===================================================================
--- trunk/clients/haver-gtk/bin/serverdlg-test.pl 2004-07-05 03:44:58 UTC
(rev 298)
+++ trunk/clients/haver-gtk/bin/serverdlg-test.pl 2004-07-05 03:45:50 UTC
(rev 299)
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+# vim: set ft=perl ts=4 sw=4:
+# serverdlg-test.pl - ServerDialog test script. delete once it's in
haver-gtk.pl
+#
+# Copyright (C) 2004 Bryan Donlan, Dylan William Hardison.
+#
+# This module 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 module 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 module; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+use strict;
+use warnings;
+
+use Gtk;
+use POE;
+use Haver::Config;
+use Haver::OS;
+use Haver::UI::Gtk::ServerDialog;
+
+my ($user, $confdir, $config);
+
+eval {
+ $user = Haver::OS->current_user();
+ $confdir = Haver::OS->config_find(
+ scope => 'user',
+ name => 'haver-gtk',
+ type => 'dir',
+ );
+
+ $config = Haver::Config->new(
+ file => "$confdir/config",
+ default => {
+ UID => lc $user,
+ Address => 'hardison.net:7070',
+ Alias => {},
+ },
+ );
+};
+
+POE::Session->create(
+ package_states => [
+ main => [qw{
+ _start
+ connectwin_connect
+ connectwin_close
+ kill
+ }]
+ ]
+);
+
+sub _start {
+ my ($kernel, $heap, $session) = @_[KERNEL,HEAP,SESSION];
+ $kernel->alias_set("main");
+ $heap->{toplevel} = new Gtk::Window("toplevel");
+ $kernel->signal_ui_destroy($heap->{toplevel});
+ $heap->{toplevel}->set_title('serverdlg-test');
+ $heap->{killbtn} = new Gtk::Button("Close");
+ $heap->{toplevel}->add($heap->{killbtn});
+ $heap->{killbtn}->show;
+ $heap->{toplevel}->show;
+ $heap->{killbtn}->signal_connect("clicked", $session->postback("kill"));
+ $heap->{serverdlg} = new Haver::UI::Gtk::ServerDialog('main', $config);
+}
+
+sub connectwin_connect {}
+sub connectwin_close {}
+sub kill { exit 0; }
+
+POE::Kernel->run();
Property changes on: trunk/clients/haver-gtk/bin/serverdlg-test.pl
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native