On Thu, 2004-03-25 at 20:44, Mike Weisenborn wrote:
> I'd like to do that when I clean it up a bit. One thing I'd like to do
> is have it auto-recognize when its settings have changed and then reload
> them. I tried catching the signal "setup changed" but it doesn't send
> any parameters.

This is a sub I wrote to check the settings. (Kinlo could have written this sub too, 
can't recall of him or me wrote it)

sub check_settings {

    my $trackbar_style  = Irssi::settings_get_str('trackbar_style');
    my $trackbar_string = Irssi::settings_get_str('trackbar_string');

    if ($trackbar_style !~ /^%[kKbBgGcCrRmMpPyYwW]$/) {
        Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_wrong_style');
        Irssi::settings_set_str('trackbar_style',  => '%K');
    }

    if (!$trackbar_string) {
        Irssi::printformat(MSGLEVEL_CLIENTCRAP,
'trackbar_wrong_string');
        Irssi::settings_set_str('trackbar_string' => default_string());
    }

    if ($trackbar_string =~ /%/) {
        Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_not_allowed');
        Irssi::settings_set_str('trackbar_string' => default_string());
    }

    if (!$_[0]) {
        resize_all();
    }
}

Irssi::signal_add('setup changed', 'check_settings');

Regards,
Geert Hauwaerts.

-- 
.---------------------------------------------------------------------------.
| Geert Hauwaerts          http://www.safeweb.be         <[EMAIL PROTECTED]> |
| Certified Unix/Linux Administrator  ||  Cisco Certified Network Associate |
`---------------------------------------------------------------------------'



Reply via email to