ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.73 by elmex, Mon May 29 19:30:27 2006 UTC vs.
Revision 1.77 by root, Mon May 29 21:54:15 2006 UTC

68 } 68 }
69 69
70 close CFG; 70 close CFG;
71} 71}
72 72
73mkdir "$Crossfire::VARDIR/pclient", 0777; 73mkdir "$Crossfire::VARDIR/cfplus", 0777;
74 74
75our $DB_ENV;
76
77{
78 use strict;
79
80 my $recover = $BerkeleyDB::db_version >= 4.4
81 ? eval "DB_REGISTER | DB_RECOVER"
82 : 0;
83
75our $DB_ENV = new BerkeleyDB::Env 84 $DB_ENV = new BerkeleyDB::Env
76 -Home => "$Crossfire::VARDIR/pclient", 85 -Home => "$Crossfire::VARDIR/cfplus",
77 -Cachesize => 1_000_000, 86 -Cachesize => 1_000_000,
78 -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt", 87 -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt",
79# -ErrPrefix => "DATABASE", 88# -ErrPrefix => "DATABASE",
80 -Verbose => 1, 89 -Verbose => 1,
81 -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, 90 -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover,
91 -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE | DB_TXN_WRITE_NOSYNC,
82 or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error"; 92 or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error";
93}
83 94
84sub db_table($) { 95sub db_table($) {
85 my ($table) = @_; 96 my ($table) = @_;
86 97
87 $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; 98 $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge;
88 99
89 new CFClient::Database 100 new CFClient::Database
90 -Env => $DB_ENV, 101 -Env => $DB_ENV,
91 -Filename => $table, 102 -Filename => $table,
92# -Filename => "database", 103# -Filename => "database",
93# -Subname => $table, 104# -Subname => $table,
94 -Property => DB_CHKSUM, 105 -Property => DB_CHKSUM,
95 -Flags => DB_CREATE | DB_UPGRADE, 106 -Flags => DB_CREATE | DB_UPGRADE,
96 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"; 107 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"
97} 108}
98 109
99sub pod_to_pango($) { 110sub pod_to_pango($) {
100 my ($pom) = @_; 111 my ($pom) = @_;
101 112
413 } 424 }
414 425
415 $entry->focus_out; 426 $entry->focus_out;
416 427
417 $::CFG->{bindings}->{$mod}->{$sym} = $cmd; 428 $::CFG->{bindings}->{$mod}->{$sym} = $cmd;
418 $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget Save Layout!"); 429 $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget 'Save Config'!");
419 430
420 $w->destroy 431 $w->destroy
421 }); 432 });
422 433
423 $entry->focus_in; 434 $entry->focus_in;
454 for (@$list) { 465 for (@$list) {
455 $CMDBOX->add (my $hb = new CFClient::UI::HBox); 466 $CMDBOX->add (my $hb = new CFClient::UI::HBox);
456 467
457 my $i = $idx; 468 my $i = $idx;
458 $hb->add (new CFClient::UI::Button 469 $hb->add (new CFClient::UI::Button
459 text => "del", 470 text => "delete",
460 tooltip => "Deletes the action from the record", 471 tooltip => "Deletes the action from the record",
461 on_activate => sub { 472 on_activate => sub {
462 $CMDBOX->remove ($hb); 473 $CMDBOX->remove ($hb);
463 $list->[$i] = undef; 474 $list->[$i] = undef;
464 }); 475 });
507 518
508 $RECORD_WINDOW->add (my $vb = new CFClient::UI::VBox); 519 $RECORD_WINDOW->add (my $vb = new CFClient::UI::VBox);
509 $vb->add ($REC_BTN = new CFClient::UI::Button 520 $vb->add ($REC_BTN = new CFClient::UI::Button
510 text => "start recording", 521 text => "start recording",
511 tooltip => "Start/Stops recording of actions." 522 tooltip => "Start/Stops recording of actions."
512 ."(CTRL+INS Starts the recorder, INS Stops recorder and binds automatically)" 523 ."(CTRL+Insert Starts the recorder, Insert Stops recorder and binds automatically)"
513 ."All subsequent actions after the recording started will be captured." 524 ."All subsequent actions after the recording started will be captured."
514 ."The actions are displayed after the record was stopped." 525 ."The actions are displayed after the record was stopped."
515 ."To bind the action you have to click on the 'Bind' button", 526 ."To bind the action you have to click on the 'Bind' button",
516 on_activate => sub { 527 on_activate => sub {
517 my ($btn) = @_; 528 my ($btn) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines