summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Duret <yduret@mandriva.com>2001-08-27 12:22:03 +0000
committerYves Duret <yduret@mandriva.com>2001-08-27 12:22:03 +0000
commitb327f43b97113390a6249dcfb0a535cc9783db27 (patch)
tree1c92ca35b6b6d987f955fccc9783fc09e7956761
parent47057885ef4f405f0d717bf16dad523a2286665f (diff)
downloadcontrol-center-b327f43b97113390a6249dcfb0a535cc9783db27.tar
control-center-b327f43b97113390a6249dcfb0a535cc9783db27.tar.gz
control-center-b327f43b97113390a6249dcfb0a535cc9783db27.tar.bz2
control-center-b327f43b97113390a6249dcfb0a535cc9783db27.tar.xz
control-center-b327f43b97113390a6249dcfb0a535cc9783db27.zip
back from chamonix
-rw-r--r--TODO2
-rwxr-xr-xcontrol-center330
-rwxr-xr-xlogdrake42
3 files changed, 225 insertions, 149 deletions
diff --git a/TODO b/TODO
index a44ac1c1..ea02c21f 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,3 @@
-- integrate wizard tool
++ integrate wizard tool
- xinerama compliant: look in gdm
- logdrake: add a save button
diff --git a/control-center b/control-center
index 1871b208..ab7c450b 100755
--- a/control-center
+++ b/control-center
@@ -2,9 +2,9 @@
# $Id$
# Copyright (C) 1999-2001 MandrakeSoft
+# Yves Duret <yduret at mandrakesoft.com>
# Damien Krotkine (damien@mandrakesoft.com)
# Daouda Lo (daouda@mandrakesoft.com)
-# Yves Duret <yduret at mandrakesoft.com>
#
# 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
@@ -22,12 +22,14 @@
use Config;
use POSIX;
+use Data::Dumper;
my $_xbindir = "/usr/X11R6/bin";
my $_bindir = "/usr/bin";
my $_sbindir = "/usr/sbin";
my $_iconsdir = "/usr/share/icons";
my $_docdir = "/usr/share/doc";
+my $_wizdir = "/usr/share/wizards";
my $_version = "0.70";
@@ -50,6 +52,102 @@ my $xpm_path_l="$_iconsdir";
my $tree_depth_max = 1;
my @treeitem_sub;
+######### tree def
+# leaf: label, icon, parent, file_to_seek, exec, gtk/x, grep, num_xwininfo
+
+$::isWiz = (-e $_wizdir);
+
+my @tree_parent =
+ ([_("Boot"), 'boot-mdk.png'],
+ [_("Hardware"), 'drakhard-mdk.png'],
+ [_("Network & Internet"),'net-mdk.png'],
+ [_("Security"),'security-mdk.png'],
+ [_("System"),'system-mdk.png'],
+ if_($::isWiz, [_("Wizard"), 'net-mdk.png'])
+ );
+
+my @tree_app =
+ ([_("Boot Disk"), 'drakfloppy-mdk.png',1] , [_("Boot Config"),'drakboot-mdk.png',1], [_("Auto Install"), 'drakfloppy-mdk.png', 1],
+
+ [_("Display"),'XFdrake-mdk.png',2] , [_("Hardware"),'harddrake-mdk.png',2] , [_("Mouse"), 'mousedrake-mdk.png',2],
+ [_("Printer"),'printer-mdk.png',2] , [_("Keyboard"), 'keyboard-mdk.png',2],
+
+ [_("Connection") , 'draknet-mdk.png',3] , [_("Connection Sharing"),'drakgw-mdk.png',3], #[_("Proxy"), 'drakgw-mdk.png', 3],
+
+ [_("Security Level"), 'draksec-mdk.png',4], [_("Firewalling"), 'firewall-mdk.png',4],
+
+ [_("Menus") , 'menudrake-mdk.png',5], [_("Services") , 'service-mdk.png' , 5],
+ [_("Fonts"), 'drakfont-mdk.png',5], [_("Date & Time") , 'time-mdk.png',5],
+ [_("Software Manager"), 'harddrake-mdk.png',5], [_("Logs"), 'drakboot-mdk.png',5],
+ [_("Console"), 'drakboot-mdk.png', 5],
+
+ if_($::isWiz,[_("client"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("db"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("dhcp"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("dns"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("firewall"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("ftp"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("global"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("news"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("postfix"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("samba"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("server"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("time"), 'drakboot-mdk.png', 6]),
+ if_($::isWiz,[_("web"), 'drakboot-mdk.png', 6]),
+ );
+
+my %tree_exec = (_("Boot Disk") => "$_xbindir/drakfloppy.real", _("Boot Config") => "$_sbindir/drakboot", _("Auto Install") => "$_sbindir/drakautoinst",
+ _("Display") => "$_sbindir/XFdrake" ,
+ _("Hardware") => "$_sbindir/harddrake" , _("Mouse") => "$_sbindir/mousedrake" ,
+ _("Printer") => "$_sbindir/printerdrake" , _("Keyboard") => "$_sbindir/keyboarddrake" ,
+ _("Connection") => "$_sbindir/draknet",
+ _("Connection Sharing") => "$_sbindir/drakgw",
+ _("Proxy") => "$_sbindir/drakproxy",
+ _("Firewalling") => "$_sbindir/tinyfirewall",
+ _("Security Level") => "$_sbindir/draksec",
+ _("Date & Time") => "$_sbindir/clock.pm",
+ _("Menus") => "$_sbindir/menus.pm",
+ _("Services") => "$_sbindir/drakxservices",
+ _("Fonts") => "$_xbindir/drakfont",
+ _("Software Manager") => "$_bindir/rpmdrake",
+ _("Logs") => "$_sbindir/logdrake",
+ _("Console") => "$_xbindir/rxvt",
+ # wizard java
+ _("client") => "$_wizdir/client_wizard/client.wiz",
+ _("db") => "$_wizdir/db_wizard/db.wiz",
+ _("dhcp") => "$_wizdir/dhcp_wizard/dhcp.wiz",
+ _("dns") => "$_wizdir/dns_wizard/dns.wiz",
+ _("firewall") => "$_wizdir/firewall_wizard/firewall.wiz",
+ _("ftp") => "$_wizdir/ftp_wizard/ftp.wiz",
+ _("global") => "$_wizdir/global_wizard/global.wiz",
+ _("news") => "$_wizdir/news_wizard/news.wiz",
+ _("postfix") => "$_wizdir/postfix_wizard/postfix.wiz",
+ _("samba") => "$_wizdir/samba_wizard/samba.wiz",
+ _("server") => "$_wizdir/server_wizard/server.wiz",
+ _("time") => "$_wizdir/time_wizard/time.wiz",
+ _("web") => "$_wizdir/web_wizard/web.wiz",
+ );
+
+my %xapp = (_("Console") => ["rxvt", "rxvt", 1],
+ _("client") => ["wiz $_wizdir/client_wizard/client.wiz", "wizdrake", 1],
+ _("db") => ["wiz $_wizdir/db_wizard/db.wiz", "wizdrake", 1],
+ _("dhcp") => ["wiz $_wizdir/dhcp_wizard/dhcp.wiz", "wizdrake", 1],
+ _("dns") => ["wiz $_wizdir/dns_wizard/dns.wiz", "wizdrake", 1],
+ _("firewall") => ["wiz $_wizdir/firewall_wizard/firewall.wiz", "wizdrake", 1],
+ _("ftp") => ["wiz $_wizdir/ftp_wizard/ftp.wiz", "wizdrake", 1],
+ _("global") => ["wiz $_wizdir/global_wizard/global.wiz", "wizdrake", 1],
+ _("news") => ["wiz $_wizdir/news_wizard/news.wiz", "wizdrake", 1],
+ _("postfix") => ["wiz $_wizdir/postfix_wizard/postfix.wiz", "wizdrake", 1],
+ _("samba") => ["wiz $_wizdir/samba_wizard/samba.wiz", "wizdrake", 1],
+ _("server") => ["wiz $_wizdir/server_wizard/server.wiz", "wizdrake", 1],
+ _("time") => ["wiz $_wizdir/time_wizard/time.wiz", "wizdrake", 1],
+ _("web") => ["wiz $_wizdir/web_wizard/web.wiz", "wizdrake", 1],
+ );
+
+
+######### tree def
+
+
my $nb_pages=0;
my $window_global = new Gtk::Window -toplevel;
$window_global->signal_connect ( delete_event => sub { quit_global(); });
@@ -97,63 +195,41 @@ my @anim;
($anim[$_]->[0], $anim[$_]->[1]) = gtkcreate_png("$xpm_path_l/anim_" . ($_ + 1) . ".png") foreach (0..9);
my $vbox_about = new Gtk::VBox(0,0);
-my $darea1= new Gtk::DrawingArea();
+my $darea1 = new Gtk::DrawingArea();
$darea1->size(540,460);
$darea1->set_usize(540,460);
$vbox_about->pack_start($darea1,1,1,0);
$notebook_global->append_page($vbox_about, undef);
-
my $vbox_global_left = new Gtk::VBox(0,0);
$scrolled_global->add_with_viewport($vbox_global_left);
-
$window_global->realize;
+my @pid_launched;
+my %tree_launched;
+
my $tree= new Gtk::Tree;
$tree->set_selection_mode('browse');
$tree->set_view_lines(0);
$tree->set_view_mode('item');
-$vbox_global_left->pack_start($tree,1,1,0);
-map {
- create_tree_item($tree, $_->[0] , "$xpm_path_l/$_->[1]",1);
-} ([_("Boot"), 'boot-mdk.png'] , [_("Hardware"), 'drakhard-mdk.png'] ,
- [_("Network & Internet"),'net-mdk.png'] , [_("Security"),'security-mdk.png'], [_("System"),'system-mdk.png']);
-
-map {
- create_tree_item($treeitem_sub[int($_->[2])],$_->[0], "$xpm_path_l/$_->[1]",0);
-} ([_("Boot Disk"), 'drakfloppy-mdk.png',4] , [_("Boot Config"),'drakboot-mdk.png',4], [_("Auto Install"), 'drakfloppy-mdk.png', 4],
- [_("Display"),'XFdrake-mdk.png',3] , [_("Hardware"),'harddrake-mdk.png',3] , [_("Mouse"), 'mousedrake-mdk.png',3] ,
- [_("Printer"),'printer-mdk.png',3] , [_("Keyboard"), 'keyboard-mdk.png',3],
- [_("Connection") , 'draknet-mdk.png',2] , [_("Connection Sharing"),'drakgw-mdk.png',2], #[_("Proxy"), 'drakgw-mdk.png', 2],
- [_("Security Level"), 'draksec-mdk.png',1], [_("Firewalling"), 'firewall-mdk.png',1],
- [_("Menus") , 'menudrake-mdk.png',0], [_("Services") , 'service-mdk.png' , 0],
- [_("Fonts"), 'drakfont-mdk.png',0], [_("Date & Time") , 'time-mdk.png',0],
- [_("Software Manager"), 'harddrake-mdk.png',0],[_("Logs"), 'drakboot-mdk.png',0],
- [_("Console"), 'drakboot-mdk.png',0]
- );
-
-my %tree_exec = (_("Boot Disk") => "$_xbindir/drakfloppy.real", _("Boot Config") => "$_sbindir/drakboot", _("Auto Install") => "$_sbindir/drakautoinst",
- _("Display") => "$_sbindir/XFdrake" ,
- _("Hardware") => "$_sbindir/harddrake" , _("Mouse") => "$_sbindir/mousedrake" ,
- _("Printer") => "$_sbindir/printerdrake" , _("Keyboard") => "$_sbindir/keyboarddrake" ,
- _("Connection") => "$_sbindir/draknet",
- _("Connection Sharing") => "$_sbindir/drakgw",
- _("Proxy") => "$_sbindir/drakproxy",
- _("Firewalling") => "$_sbindir/tinyfirewall",
- _("Security Level") => "$_sbindir/draksec",
- _("Date & Time") => "$_sbindir/clock.pm",
- _("Menus") => "$_sbindir/menus.pm",
- _("Services") => "$_sbindir/drakxservices",
- _("Fonts") => "$_xbindir/drakfont",
- _("Software Manager") => "$_bindir/rpmdrake",
- _("Logs") => "$_sbindir/logdrake",
- _("Console") => "$_xbindir/rxvt",
- );
-
-my @pid_launched;
-my %tree_launched;
+map { create_tree_item($tree, $_->[0] , "$xpm_path_l/$_->[1]",1); }
+ @tree_parent;
+map { create_tree_item($treeitem_sub[st(int($_->[2]))],$_->[0], "$xpm_path_l/$_->[1]",0);}
+ @tree_app;
+$vbox_global_left->pack_start($tree,1,1,0);
$window_global->show_all;
+my $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, 540,460);
+draw_exposed($pix_dbl);
+$darea1->signal_connect( expose_event => sub {
+ $darea1->window->draw_pixmap
+ ($darea1->style->white_gc,
+ $pix_dbl, 0, 0,
+ ($darea1->allocation->[2]-540)/2, ($darea1->allocation->[3]-460)/2,
+ 540, 460);
+ return 1;
+ });
+
$SIG{USR1} = sub {
${$tree_launched{$_}->[1]}->deselect() foreach (keys %tree_launched);
$notebook_global->set_page(0);
@@ -172,14 +248,6 @@ $SIG{USR2} = sub { Gtk->timeout_remove($lock_time_tag);
$notebook_global->set_page($a);
};
-my $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, 540,460);
-draw_exposed($pix_dbl);
-$darea1->signal_connect( expose_event => sub { $darea1->window->draw_pixmap
- ($darea1->style->white_gc,
- $pix_dbl, 0, 0,
- ($darea1->allocation->[2]-540)/2, ($darea1->allocation->[3]-460)/2,
- 540, 460);
- });
Gtk->main_iteration while Gtk->events_pending;
Gtk->main;
@@ -203,9 +271,13 @@ sub translate {
}
#-------------------------------------------------------------
-# sub
+# plug & tree sub
#-------------------------------------------------------------
+sub st {
+ return (@tree_parent - $_[0]);
+}
+
sub exec_treeitem {
my ($label, $exec_string, $available) = @_;
$scrolled_global->set_usize($label eq _("Software Manager") ? 1 : 210, 0);
@@ -220,94 +292,98 @@ sub exec_treeitem {
return;
}
if (!$tree_launched{$label}->[0]) {
-
- if ($label eq _("Console")) {
- my $socket = new Gtk::Socket;
- $notebook_global->append_page($socket, new Gtk::Label(""));
- $nb_pages++;
- $tree_launched{$label}->[0]=$nb_pages;
- $notebook_global->set_page($nb_pages);
- $socket->realize;
- $socket->steal(launch_wait("rxvt", "rxvt",1));
- $notebook_global->show_all();
- $notebook_global->set_page($nb_pages);
- return;
- }
- my $vbox = new Gtk::VBox(0, 0);
- $vbox->show;
- my $vbox2 = new Gtk::VBox(0, 0);
- $vbox2->show;
- $global_vbox=\$vbox2;
- $vbox->pack_start($vbox2,1,0,0);
- my $label_ = new Gtk::Label (_("Please wait while loading ..."));
- $vbox2->pack_start( $label_, 0, 0, 0);
- $label_->show;
- my $hbox = new Gtk::HBox(0, 0);
- $hbox->show;
- $vbox2->pack_start($hbox,0,0,0);
- my $darea1= new Gtk::DrawingArea();
- $darea1->size(350,12);
- $darea1->set_usize(340,12);
- $frame0 = new Gtk::Frame;
- $frame0->add($darea1);
- $frame0->show;
- $darea1->show;
- $frame0->set_shadow_type('etched_out');
- $hbox->pack_start($frame0,1,0,0);
- my $socket = new Gtk::Socket;
- $global_socket = \$socket;
- $vbox->pack_start($socket, 1, 1, 0);
- $notebook_global->append_page($vbox, "");
- $nb_pages++;
- $tree_launched{$label}->[0]=$nb_pages;
- $notebook_global->set_page($nb_pages);
- $tree_launched{$_}->[0] or ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(0) foreach (keys %tree_launched);
- my $anim_nb=0;
- $global_time_tag = Gtk->timeout_add(100, sub {
- $darea1->window->draw_pixmap
- ($darea1->style->white_gc,
- $anim[$anim_nb]->[0], 0, 0,
- ($darea1->allocation->[2]-340)/2, ($darea1->allocation->[3]-15)/2,
- 350, 13);
- $anim_nb++;
- $anim_nb > 9 and $anim_nb=0;
- 1;
- });
- $lock_time_tag = Gtk->timeout_add(15000, sub {
- Gtk->timeout_remove($global_time_tag);
- ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
- $vbox->pack_start(new Gtk::Label (_("After 20 sec., Failed to launch \nSee if it's installed")), 1, 1, 0);
- $label_->set(_("After 15 sec., Failed to launch '%s'\nSee if it's installed", $exec_string)); $darea1->hide;
- });
-
- $socket->realize;
-# $label->destroy;
- my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$;
- my $pid;
- unless ($pid = fork) {
- splash_warning(_("cannot fork: %s", $~)) unless defined $pid;
- exec("$a");
- }
- $pid_launched[$nb_pages-1] = $pid;
+ (member($label, keys(%xapp))) ? xplug($label) : gtkplug($label,$exec_string);
} else {
$notebook_global->set_page($tree_launched{$label}->[0]);
}
}
-sub launch_wait {
- my ($exec, $grep, $num, $zz) = @_;
- my $b = "xwininfo -root -tree -int | grep '" . $grep . "'";
+sub gtkplug {
+ my ($label, $exec_string) =@_;
+ my $vbox = new Gtk::VBox(0, 0);
+ $vbox->show;
+ my $vbox2 = new Gtk::VBox(0, 0);
+ $vbox2->show;
+ $global_vbox=\$vbox2;
+ $vbox->pack_start($vbox2,1,0,0);
+ my $label_ = new Gtk::Label (_("Please wait while loading ..."));
+ $vbox2->pack_start( $label_, 0, 0, 0);
+ $label_->show;
+ my $hbox = new Gtk::HBox(0, 0);
+ $hbox->show;
+ $vbox2->pack_start($hbox,0,0,0);
+ my $darea1= new Gtk::DrawingArea();
+ $darea1->size(350,12);
+ $darea1->set_usize(340,12);
+ $frame0 = new Gtk::Frame;
+ $frame0->add($darea1);
+ $frame0->show;
+ $darea1->show;
+ $frame0->set_shadow_type('etched_out');
+ $hbox->pack_start($frame0,1,0,0);
+ my $socket = new Gtk::Socket;
+ $global_socket = \$socket;
+ $vbox->pack_start($socket, 1, 1, 0);
+ $notebook_global->append_page($vbox, "");
+ $nb_pages++;
+ $tree_launched{$label}->[0]=$nb_pages;
+ $notebook_global->set_page($nb_pages);
+ $tree_launched{$_}->[0] or ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(0) foreach (keys %tree_launched);
+ my $anim_nb=0;
+ $global_time_tag = Gtk->timeout_add(100, sub {
+ $darea1->window->draw_pixmap
+ ($darea1->style->white_gc,
+ $anim[$anim_nb]->[0], 0, 0,
+ ($darea1->allocation->[2]-340)/2, ($darea1->allocation->[3]-15)/2,
+ 350, 13);
+ $anim_nb++;
+ $anim_nb > 9 and $anim_nb=0;
+ 1;
+ });
+ $lock_time_tag = Gtk->timeout_add(15000, sub {
+ Gtk->timeout_remove($global_time_tag);
+ ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
+ $vbox->pack_start(new Gtk::Label (_("After 20 sec., Failed to launch \nSee if it's installed")), 1, 1, 0);
+ $label_->set(_("After 15 sec., Failed to launch '%s'\nSee if it's installed", $exec_string)); $darea1->hide;
+ });
+
+ $socket->realize;
+ #$label->destroy;
+ my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$;
+ my $pid;
+ unless ($pid = fork) {
+ splash_warning(_("cannot fork: %s", $~)) unless defined $pid;
+ exec("$a");
+ }
+ $pid_launched[$nb_pages-1] = $pid;
+}
+
+sub xplug {
+# my ($label) =@_;
+ my $socket = new Gtk::Socket;
+ $notebook_global->append_page($socket, new Gtk::Label(""));
+ $nb_pages++;
+ $tree_launched{$_[0]}->[0]=$nb_pages;
+ $notebook_global->set_page($nb_pages);
+ $socket->realize;
+ $socket->steal(launch_xapp($xapp{$_[0]}));
+ $notebook_global->show_all();
+ $notebook_global->set_page($nb_pages);
+}
+
+sub launch_xapp {
+# my ($exec, $grep, $num) = @_;
+ my $b = "xwininfo -root -tree -int | grep '" . $_[0]->[1] . "'";
my @before = split ('\n', `$b`);
unless ($pid = fork) {
splash_warning(_("cannot fork: %s", $~)) unless defined $pid;
- exec($exec);
+ exec($_[0]->[0]);
}
$pid_launched[$nb_pages-1] = $pid;
-# $nb_pages++;
my $res = 0;
while (!$res) {
my @after = split ('\n', `$b`);
- while (@after ne ($num+@before)) {
+ while (@after ne ($_[0]->[2]+@before)) {
@after = split ('\n', `$b`);
}
my $i = 0;
diff --git a/logdrake b/logdrake
index 78aecdae..346285fe 100755
--- a/logdrake
+++ b/logdrake
@@ -19,13 +19,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#$|= 1;
-#open F, $ARGV[0];
-#while (1) {
-# print while <F>;
-# seek F, 0, 1;
-#}
-
use POSIX;
use Gtk;
@@ -40,7 +33,6 @@ use my_gtk qw(:helpers :wrappers);
use MDK::Common;
-
#-------------------------------------------------------------
# i18n routines
# IMPORTANT: next two routines have to be redefined here to
@@ -103,18 +95,18 @@ my $cal_butt = gtksignal_connect(new Gtk::CheckButton("Show only for this day"),
# the menus are not shown
# but they provides shiny shortcut like C-q
my @menu_items = (
- { path => _("/_File"), type => '<Branch>' },
- { path => _("/File/_New"), accelerator => _("<control>N"), callback => \&print_hello },
- { path => _("/File/_Open"), accelerator => _("<control>O"),callback => \&print_hello },
- { path => _("/File/_Save"), accelerator => _("<control>S"),callback => \&print_hello },
- { path => _("/File/Save _As") },
- { path => _("/File/-"),type => '<Separator>' },
- { path => _("/File/_Quit"), accelerator => _("<control>Q"), callback => sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0) } },
- { path => _("/_Options"), type => '<Branch>' },
- { path => _("/Options/Test") },
- { path => _("/_Help"),type => '<LastBranch>' },
- { path => _("/Help/_About...") }
- );
+ { path => _("/_File"), type => '<Branch>' },
+ { path => _("/File/_New"), accelerator => _("<control>N"), callback => \&print_hello },
+ { path => _("/File/_Open"), accelerator => _("<control>O"),callback => \&print_hello },
+ { path => _("/File/_Save"), accelerator => _("<control>S"),callback => \&save },
+ { path => _("/File/Save _As") },
+ { path => _("/File/-"),type => '<Separator>' },
+ { path => _("/File/_Quit"), accelerator => _("<control>Q"), callback => sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0) } },
+ { path => _("/_Options"), type => '<Branch>' },
+ { path => _("/Options/Test") },
+ { path => _("/_Help"),type => '<LastBranch>' },
+ { path => _("/Help/_About...") }
+ );
my $menubar = get_main_menu( $window );
######### menus end
@@ -198,6 +190,7 @@ gtkadd($window,
createScrolledWindow(my $log_text = new Gtk::Text(undef, undef))
),
0, gtkadd (gtkset_layout(new Gtk::HButtonBox,-end),
+ gtksignal_connect(new Gtk::Button (_("Save")), clicked => \&save),
gtksignal_connect(new Gtk::Button (_("OK")), clicked=>sub{updateInit();updateAutologin();updateAurora();$::isEmbedded ? kill(USR1,$::CCPID) : Gtk->exit(0)}),
gtksignal_connect(new Gtk::Button ($::isEmbedded ? _("Cancel") : _("Quit")), clicked => sub {$::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0)})
)
@@ -234,7 +227,6 @@ sub search {
sub parse_file {
my $file = $_[0];
-
$file =~ s/\.gz$//;
my $i=0;
gtkadd(my $win_pb = (gtkset_modal new Gtk::Window(), 1),
@@ -344,6 +336,11 @@ sub log_output {
# menu callback functions
#-------------------------------------------------------------
+
+sub save {
+ print $log_text->get_length() . "\n";
+}
+
sub print_hello {
print( "mcdtg !\n" );
}
@@ -395,6 +392,9 @@ sub destroy_window {
# log
# $Log$
+# Revision 1.22 2001/08/27 12:22:03 yduret
+# back from chamonix
+#
# Revision 1.21 2001/08/20 15:04:55 siegel
# added "Gtk->set_locale;"
#