summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center50
1 files changed, 36 insertions, 14 deletions
diff --git a/control-center b/control-center
index 5ea3a1b2..80bfd047 100755
--- a/control-center
+++ b/control-center
@@ -23,6 +23,7 @@
my $_xbindir = "/usr/X11R6/bin";
my $_bindir = "/usr/bin";
my $_sbindir = "/usr/sbin";
+my $mcc_dir = "/usr/share/mcc";
!$ENV{DISPLAY} and exec ("$_sbindir/drakxconf; reset");
@@ -47,9 +48,18 @@ my $conffile = "/root/.mcc";
my %h = getVarsFromSh($conffile);
my $embedded;
my $logs;
+my $theme;
+defined $h{THEME} or $h{THEME} = 'default';
defined $h{EMBEDDED} or $h{EMBEDDED} = bool2text(1);
defined $h{LOGS} or $h{LOGS} = bool2text(0);
($embedded, $logs) = (text2bool($h{EMBEDDED}), text2bool($h{LOGS}));
+$theme = $h{THEME};
+if ("@ARGV" =~ /--theme (\w+)/) { $theme = $1 }
+-d "$mcc_dir/$theme" or $theme = 'default';
+my_gtk::add_icon_path("$mcc_dir/$theme");
+my $rc = "$mcc_dir/$theme/gtkrc";
+print "rc : $rc\n";
+-r $rc and Gtk::Rc->parse($rc);
my ($log_check_box, $embedded_check_box);
@@ -70,6 +80,7 @@ my $exec_hash =
_("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 ],
_("Connection") => [ "draknet", "$_sbindir/draknet", 1 ],
_("Connection Sharing") => [ "drakgw", "$_sbindir/drakgw", 1 ],
_("Security Level") => [ "draksec", "$_sbindir/draksec", 1 ],
@@ -107,6 +118,7 @@ my @tree =
[_("Removable disks"), 'diskdrake_other'],
[_("NFS mount points"), 'diskdrake_nfs'],
[_("Samba mount points"), 'diskdrake_samba'],
+ [_("Partition Sharing"), 'diskdrake_fileshare'],
]
],
[_("Network & Internet"),'net-mdk',
@@ -432,8 +444,10 @@ sub sig_usr1 { # embedded applications will send me that signal in order to "kil
$notebook_global->show;
}
+my $timer;
sub sig_usr2 {
print "USR2\n";
+ Gtk->timeout_remove($timer);
$emb_wait->hide;
$emb_socket->show;
# Gtk->timeout_remove($lock_time_tag);
@@ -477,10 +491,11 @@ sub compute_exec_string {
$notebook_global->hide;
res_socket();
$emb_box->show;
- $emb_wait->show;
$emb_socket->realize;
my $exec = $exec . " --embedded " . $emb_socket->window->XWINDOW . " " . $$;
if ($gtkplug) {
+ $emb_wait->show;
+ $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;
@@ -488,7 +503,6 @@ sub compute_exec_string {
}
push @pid_launched, $pid;
} else {
- $emb_wait->hide;
$emb_socket->show;
$emb_socket->steal(launch_xapp($alternate));
}
@@ -577,7 +591,8 @@ sub quit_global {
}
setVarsInSh($conffile, {
EMBEDDED => bool2text($embedded),
- LOGS => bool2text($logs)
+ LOGS => bool2text($logs),
+ THEME => $theme,
});
Gtk->exit(0);
}
@@ -591,17 +606,15 @@ sub splash_warning {
my $win_about = new Gtk::Dialog();
$win_about->set_position(1);
- my $bbox1 = new Gtk::HButtonBox;
- $win_about->action_area->pack_start($bbox1,0,0,0);
-
- my $button = new Gtk::Button(_("Close"));
- $button->signal_connect_object("clicked",$win_about => 'destroy');
- $bbox1->add($button);
-
- my $lab = new Gtk::Label($label);
- my $style1 = new Gtk::Style;
- $win_about->vbox->pack_start($lab, 1, 1, 0);
-
+ gtkpack__($win_about->action_area,
+ gtkadd(new Gtk::HButtonBox,
+ gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub {$win_about->destroy()}),
+ )
+ );
+ gtkpack($win_about->vbox,
+ gtkpng("warning"),
+ new Gtk::Label($label),
+ );
$win_about->show_all();
$win_about->set_modal(1);
}
@@ -684,6 +697,15 @@ sub get_main_menu {
{ path => _("/Options")._("/_Embedded Mode"),
callback => \&embedded_mode,
type => '<ToggleItem>'},
+ { path => _("/_Themes"),
+ type => '<Branch>' },
+ map { my $l = $_;
+ my %h = (
+ path => _("/Themes"). "/_" . $l,
+ callback => \&embedded_mode, #sub { print " pp :$l\n"; },
+ );
+ \%h;
+ } ("plop", "plap", "plip"),
{ path => _("/_Help"),
type => '<Branch>' },
# { path => _("/Help")._("/_Help on line"), callback => sub { Gtk->exit(0) } },