summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center72
1 files changed, 4 insertions, 68 deletions
diff --git a/control-center b/control-center
index 11498c00..41c879bd 100755
--- a/control-center
+++ b/control-center
@@ -67,7 +67,6 @@ $window_splash->add(
-r "$mcc_dir/$theme/splash_screen.png" ? gtkpng("splash_screen") : new Gtk::Label(_("Loading... Please wait")))
);
$window_splash->show_all;
-#$window_splash->realize;
Gtk->main_iteration while Gtk->events_pending;
my $timer_splash = Gtk->timeout_add(200, sub { Gtk->main_iteration while Gtk->events_pending });
@@ -77,11 +76,10 @@ my $rc = "$mcc_dir/$theme/gtkrc";
my ($log_check_box, $embedded_check_box);
-$::isWiz = -e "/usr/sbin/wizdrake"; #- $in->do_pkgs->is_installed(q(wizard));
+$::isWiz = -e "/usr/sbin/wizdrake";
my $exec_hash =
{
-#- ("label") => [ "search exp", "exec", gtk_plug? if not, then xplug, "exec_alternative" for when not embedded, or [ args for xplug ] ],
_("Boot Disk") => [ "drakfloppy", "$_xbindir/drakfloppy.real", 1],
_("Boot Config") => [ "drakboot", "$_sbindir/drakboot", 1 ],
_("Auto Install") => [ "drakautoinst", "$_sbindir/drakautoinst", 1 ],
@@ -92,7 +90,6 @@ my $exec_hash =
_("Scanner") => [ "scannerdrake", "$_sbindir/scannerdrake", 1 ],
_("Keyboard") => [ "keyboarddrake", "$_sbindir/keyboarddrake", 1 ],
_("Hard Drives") => [ "diskdrake", "$_sbindir/diskdrake --hd", 1 ],
-# _("Removable disks") => [ "diskdrake", "$_sbindir/diskdrake --removable", 1 ],
_("NFS mount points") => [ "diskdrake", "$_sbindir/diskdrake --nfs", 1 ],
_("Samba mount points") => [ "diskdrake", "$_sbindir/diskdrake --smb", 1 ],
_("Partition Sharing") => [ "diskdrake", "$_sbindir/diskdrake --fileshare", 1 ],
@@ -100,7 +97,6 @@ my $exec_hash =
_("Connection Sharing") => [ "drakgw", "$_sbindir/drakgw", 1 ],
_("Proxy Configuration") => [ "drakproxy", "$_sbindir/drakproxy", 1 ],
_("Security Level") => [ "draksec", "$_sbindir/draksec", 1 ],
-# _("Firewall") => [ "tinyfirewall", "$_sbindir/tinyfirewall", 1 ],
_("Menus") => [ "menudrake", "$_sbindir/menus_launcher.pl", 1, "$_bindir/menudrake" ],
_("Services") => [ "drakxservices", "$_sbindir/drakxservices", 1 ],
_("Fonts") => [ "drakfont", "$_sbindir/drakfont", 1 ],
@@ -108,9 +104,7 @@ my $exec_hash =
_("Software Manager") => [ "rpmdrake", "$_bindir/rpmdrake", -1 ],
_("Logs") => [ "logdrake", "$_sbindir/logdrake", 1 ],
_("Console") => [ "rxvt", "", 0, ["$_xbindir/rxvt", "rxvt", 1] ],
-# _("Users") => [ "userdrake", "$_bindir/userdrake", 1 ],
_("TV Cards") => [ "drakxtv", "$_sbindir/drakxtv", 1 ],
-# _("RFBDrake") => [ "rfbdrake", "$_xbindir/rfbdrake", 1 ],
_("DNS Client") => ["Client wizard", "wiz $_wizdir/client_wizard/client.wiz", -1 ],
_("DHCP") => ["DHCP wizard", "wiz $_wizdir/dhcp_wizard/dhcp.wiz", -1 ],
@@ -267,7 +261,6 @@ foreach (@tree) {
$dbl_area_left = new Gtk::Gdk::Pixmap($darea_left->window, $dx, $dy);
$dbl_area_left->{state} = $darea_left->{state};
$darea_left->{dbl} = $dbl_area_left;
- #FIXME
fill_tiled($darea_left, $dbl_area_left, $back[$state], 40, $dy, 40, 45);
$dbl_area_left->draw_pixmap($darea_left->style->bg_gc('normal'),
$icon[$state], 0, 0, 4, int(($dy-35)/2/5)*5, 35, 35);
@@ -425,7 +418,6 @@ $darea_title->signal_connect( expose_event => sub {
my ($pixmap_back_right, undef) = gtkcreate_png_('mcc-core-back');
-#my ($pix_splash_map, undef) = gtkcreate_png_('mcc-splash');
my $pix_dbl;
$notebook_global->append_page(my $darea1 = new Gtk::DrawingArea);#my $fixed_about = new Gtk::Fixed);
$darea1->signal_connect( size_allocate => sub { $pix_dbl = undef });
@@ -437,7 +429,6 @@ $darea1->signal_connect( expose_event => sub {
fill_tiled($darea1, $pix_dbl, $pixmap_back_right, 540, 460, $dx, $dy);
my $style = $darea1->style->copy();;
$style->font(Gtk::Gdk::Font->fontset_load(_("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*")));
- #_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*")));
$pix_dbl->draw_string($style->font, $darea1->style->black_gc, 80, 115, _("Welcome to the Mandrake Control Center") );
my @revtree;
open VERS, "/etc/mandrake-release" or die _("cannot open this file for read: %s", $!);
@@ -470,13 +461,7 @@ foreach (@tree) {
$pixmap_back_right, 540, 460, 55, 50, 50, 50, 50, 50, \&compute_exec_string, $exec_hash);
$notebook_global->append_page($w);
}
-#$window_global->show_all;
-#$emb_box->hide;
-#$window_global->realize;
-
my %tree_launched;
-
-#$window_global->hide;
Gtk->main_iteration while Gtk->events_pending;
$notebook_global->signal_connect( switch_page => sub {
my (undef, $tab_widget, $tab_number) = @_;
@@ -501,37 +486,24 @@ $window_global->set_position(1);
$SIG{USR1} = \&sig_usr1;
$SIG{USR2} = \&sig_usr2;
-$SIG{TERM} = \&quit_global; # embedded applications will send me that signal in order to quit the cc.
+$SIG{TERM} = \&quit_global;
Gtk->main;
-
-#---
-# icon handling
-#---
-
-# my @icon_cache;
-
sub gtkpng_ {
my $gtkpix;
eval { $gtkpix = gtkpng(@_) };
$@ and $theme ne 'default' ? exec "$0 --safe" : die "$@";
-# push @icon_cache, { type => 'gtkpng', name => $_[0], data => $gtkpix };
- $gtkpix;
+ $gtkpix
}
sub gtkcreate_png_ {
my ($gdkpix, $gdkmap);
eval { ($gdkpix, $gdkmap) = gtkcreate_png(@_) };
$@ and $theme ne 'default' ? exec "$0 --safe" : die "$@";
-# push @icon_cache, { type => 'gdkpng', name => $_[0], data => [$gdkpix, $gdkmap] };
($gdkpix, $gdkmap);
}
-#---
-# signal handlers
-#---
-
-sub sig_usr1 { # embedded applications will send me that signal in order to "kill/hide" them}
+sub sig_usr1 {
$left_locked = 0;
clean_socket();
$darea_left_sav and $darea_left_sav->{state} = 2, $darea_left_sav->draw(undef);
@@ -541,7 +513,6 @@ sub sig_usr1 { # embedded applications will send me that signal in order to "kil
my $timer;
sub sig_usr2 {
$left_locked = 0;
-# Gtk->timeout_remove($timer);
$emb_wait->hide;
$emb_socket->show;
}
@@ -567,11 +538,6 @@ sub sig_usr2 {
}
}
-
-#---
-# launching applications
-#---
-
sub compute_exec_string {
my ($arg) = @_;
my ($log_exp, $exec, $gtkplug, $alternate) = @$arg;
@@ -587,7 +553,6 @@ sub compute_exec_string {
$emb_wait->show;
$left_locked = 1;
$pending_app = 1;
-# $timer = Gtk->timeout_add(15000, sub { splash_warning(_("This tool seems to be broken, as it didn't show up.\n Try to reinstall it")); sig_usr1(); });
my $pid;
unless ($pid = fork) {
splash_warning(_("cannot fork: %s", $~)) unless defined $pid;
@@ -624,7 +589,6 @@ sub compute_exec_string {
}
sub launch_xapp {
-# my ($exec, $grep, $num) = @_;
my $b = "xwininfo -root -tree -int | grep '" . $_[0]->[1] . "'";
my @before = split ('\n', `$b`);
my $pid;
@@ -652,10 +616,6 @@ sub launch_xapp {
$res;
}
-#---
-# socket handling
-#---
-
sub clean_socket {
$emb_box->hide;
$logs and $exp_frame->hide;
@@ -677,10 +637,6 @@ sub res_socket {
$logs and gtkadd($exp_frame, $exp_socket = new Gtk::Socket);
}
-#---
-# exit
-#---
-
sub quit_global {
foreach(@pid_launched) {
kill 'TERM', $_ if (defined $_);
@@ -693,10 +649,6 @@ sub quit_global {
Gtk->exit(0);
}
-#---
-# additional / info
-#---
-
sub splash_warning {
my ($label, $cancel_button) = @_;
my $ret;
@@ -725,7 +677,6 @@ sub more_themes {
my $window_about = new Gtk::Dialog();
$window_about->set_position(1);
$window_about->set_border_width(10);
-# $window_about->set_usize(400, 0);
$window_about->set_title( _("More themes"));
$window_about->action_area->pack_start(gtkadd(new Gtk::HButtonBox,
gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub { $window_about->destroy()})),0,0,0);
@@ -802,10 +753,6 @@ sub connect_to_site {
}
}
-#---
-# menu related functions
-#---
-
sub display_logs {
$logs = $log_check_box->active;
update_exp();
@@ -855,17 +802,6 @@ sub get_main_menu {
),
{ path => _("/_Help"),
type => '<Branch>' },
-# { path => _("/Help")._("/_Help on line"), callback => sub { Gtk->exit(0) } },
-# { path => _("/Help")._("/_Report Bug"),
-# callback => \&connect_to_site("https://qa.mandrakesoft.com/")},
-# { path => _("/Help/-"),
-# type => '<Separator>' },
-# { path => _("/Help")._("/Mandrake_Campus"),
-# callback => \&connect_to_site("http://www.mandrakecampus.com/") },
-# { path => _("/Help")._("/Mandrake_Expert"),
-# callback => \&connect_to_site("http://www.mandrakeexpert.com/") },
-# { path => _("/Help/-"),
-# type => '<Separator>' },
{ path => _("/Help")._("/_About..."),
callback => \&about_mdk_cc }
)