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