1 |
#!/usr/bin/perl -w |
2 |
################################################################################ |
3 |
# # |
4 |
# # |
5 |
# Copyright (C) 2002 MandrakeSoft # |
6 |
# |
7 |
# Daouda Lo <daouda@mandrakesoft.com> # |
8 |
# # |
9 |
# This program is free software; you can redistribute it and/or modify # |
10 |
# it under the terms of the GNU General Public License Version 2 as # |
11 |
# published by the Free Software Foundation. # |
12 |
# # |
13 |
# This program is distributed in the hope that it will be useful, # |
14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
16 |
# GNU General Public License for more details. # |
17 |
# # |
18 |
# You should have received a copy of the GNU General Public License # |
19 |
# along with this program; if not, write to the Free Software # |
20 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # |
21 |
################################################################################ |
22 |
|
23 |
use strict; |
24 |
use lib qw(/usr/lib/libDrakX); |
25 |
use standalone; |
26 |
use ugtk2 qw(:all); |
27 |
use common; |
28 |
|
29 |
my ($ent, $link); |
30 |
my $execbin = '/usr/bin/mdkwebadmin'; |
31 |
my ($opt) = @ARGV; |
32 |
@ARGV == 1 && ($opt eq '--direct' || $opt eq '--link') or exit(1); |
33 |
|
34 |
$opt eq '--direct' and exec "$execbin"; |
35 |
my $w = ugtk2->new('mdkwebadmin.pl'); |
36 |
unless ($::isEmbedded) { |
37 |
$w->{rwindow}->set_title(N("Connect to remote Site")); |
38 |
$w->{window}->set_border_width(5); |
39 |
} |
40 |
|
41 |
gtkadd($w->{window}, |
42 |
gtkpack_(Gtk2::VBox->new(0,5), |
43 |
1, Gtk2::Label->new(N("Enter the webmin address server below \n")), |
44 |
1, $ent = Gtk2::Entry->new(), |
45 |
0, Gtk2::HSeparator->new, |
46 |
0, gtkpack(create_hbox(), |
47 |
gtksignal_connect(Gtk2::Button->new(N("Connect")), clicked => sub { |
48 |
$link = 'https://' . $ent->get_text() . ':10000/'; |
49 |
exec "$execbin $link"; |
50 |
}), |
51 |
gtksignal_connect(Gtk2::Button->new(N("Abort")), clicked => \&quit)))); |
52 |
$w->{window}->show_all; |
53 |
$w->main; |
54 |
|
55 |
sub quit() { ugtk2->exit(0) } |