--- deliantra/Deliantra-Client/DC.pm 2006/05/29 19:30:27 1.73 +++ deliantra/Deliantra-Client/DC.pm 2006/05/30 02:55:45 1.79 @@ -70,22 +70,33 @@ close CFG; } -mkdir "$Crossfire::VARDIR/pclient", 0777; +mkdir "$Crossfire::VARDIR/cfplus", 0777; -our $DB_ENV = new BerkeleyDB::Env - -Home => "$Crossfire::VARDIR/pclient", - -Cachesize => 1_000_000, - -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt", +our $DB_ENV; + +{ + use strict; + + my $recover = $BerkeleyDB::db_version >= 4.4 + ? eval "DB_REGISTER | DB_RECOVER" + : 0; + + $DB_ENV = new BerkeleyDB::Env + -Home => "$Crossfire::VARDIR/cfplus", + -Cachesize => 1_000_000, + -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt", # -ErrPrefix => "DATABASE", - -Verbose => 1, - -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, - or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error"; + -Verbose => 1, + -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover, + -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE, + or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error"; +} sub db_table($) { my ($table) = @_; $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; - + new CFClient::Database -Env => $DB_ENV, -Filename => $table, @@ -93,7 +104,7 @@ # -Subname => $table, -Property => DB_CHKSUM, -Flags => DB_CREATE | DB_UPGRADE, - or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"; + or die "unable to create/open database table $_[0]: $BerkeleyDB::Error" } sub pod_to_pango($) { @@ -242,7 +253,8 @@ $targ = $::CONN->{open_container}; } - $::CONN->send ("move $targ $self->{tag} 0"); + $::CONN->send ("move $targ $self->{tag} 0") + if $targ || !($self->{flags} & F_LOCKED); } elsif ($ev->{button} == 1) { $::CONN->send ("examine $self->{tag}"); } elsif ($ev->{button} == 2) { @@ -415,7 +427,7 @@ $entry->focus_out; $::CFG->{bindings}->{$mod}->{$sym} = $cmd; - $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget Save Layout!"); + $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget 'Save Config'!"); $w->destroy }); @@ -456,7 +468,7 @@ my $i = $idx; $hb->add (new CFClient::UI::Button - text => "del", + text => "delete", tooltip => "Deletes the action from the record", on_activate => sub { $CMDBOX->remove ($hb); @@ -509,7 +521,7 @@ $vb->add ($REC_BTN = new CFClient::UI::Button text => "start recording", tooltip => "Start/Stops recording of actions." - ."(CTRL+INS Starts the recorder, INS Stops recorder and binds automatically)" + ."(CTRL+Insert Starts the recorder, Insert Stops recorder and binds automatically)" ."All subsequent actions after the recording started will be captured." ."The actions are displayed after the record was stopped." ."To bind the action you have to click on the 'Bind' button",