… | |
… | |
223 | |
223 | |
224 | $self = $self->Glib::Object::new; |
224 | $self = $self->Glib::Object::new; |
225 | $self->{$_} = delete $arg{$_} for keys %arg; |
225 | $self->{$_} = delete $arg{$_} for keys %arg; |
226 | |
226 | |
227 | gtk::state $self, "game::window", undef, window_size => [620, 460]; |
227 | gtk::state $self, "game::window", undef, window_size => [620, 460]; |
|
|
228 | $self->set (allow_shrink => 1); |
228 | |
229 | |
229 | $self->signal_connect (destroy => sub { |
230 | $self->signal_connect (destroy => sub { |
230 | $self->unlisten; |
231 | $self->unlisten; |
231 | delete $self->{app}{game}{$self->{channel}}; |
232 | delete $self->{app}{game}{$self->{channel}}; |
232 | %{$_[0]} = (); |
233 | %{$_[0]} = (); |
… | |
… | |
333 | sub join { |
334 | sub join { |
334 | my ($self) = @_; |
335 | my ($self) = @_; |
335 | return if $self->{joined}; |
336 | return if $self->{joined}; |
336 | |
337 | |
337 | $self->SUPER::join; |
338 | $self->SUPER::join; |
|
|
339 | } |
|
|
340 | |
|
|
341 | sub part { |
|
|
342 | my ($self) = @_; |
|
|
343 | |
|
|
344 | $self->hide; |
|
|
345 | $self->SUPER::part; |
338 | } |
346 | } |
339 | |
347 | |
340 | sub event_join { |
348 | sub event_join { |
341 | my ($self) = @_; |
349 | my ($self) = @_; |
342 | |
350 | |
… | |
… | |
878 | |
886 | |
879 | my ($size, $time, $interval, $count, $type); |
887 | my ($size, $time, $interval, $count, $type); |
880 | |
888 | |
881 | if (!$self->{channel}) { |
889 | if (!$self->{channel}) { |
882 | $inlay->append_text ("\nNotes: "); |
890 | $inlay->append_text ("\nNotes: "); |
883 | $inlay->append_entry (\$info->{notes}, 20, ""); |
891 | $inlay->append_widget (gtk::textentry \$info->{notes}, 20, ""); |
884 | $inlay->append_text ("\nGlobal Offer: "); |
892 | $inlay->append_text ("\nGlobal Offer: "); |
885 | $inlay->append_optionmenu (\$info->{flags}, |
893 | $inlay->append_optionmenu (\$info->{flags}, |
886 | 0 => "No", |
894 | 0 => "No", |
887 | 2 => "Yes", |
895 | 2 => "Yes", |
888 | ); |
896 | ); |
… | |
… | |
941 | if ($self->{channel}) { |
949 | if ($self->{channel}) { |
942 | $inlay->append_text ("\nHandicap: "); |
950 | $inlay->append_text ("\nHandicap: "); |
943 | $inlay->append_optionmenu (\$info->{rules}{handicap}, map +($_, $_), 0..9); |
951 | $inlay->append_optionmenu (\$info->{rules}{handicap}, map +($_, $_), 0..9); |
944 | |
952 | |
945 | $inlay->append_text ("\nKomi: "); |
953 | $inlay->append_text ("\nKomi: "); |
946 | $inlay->append_entry (\$info->{rules}{komi}, 5); |
954 | $inlay->append_widget (gtk::numentry \$info->{rules}{komi}, 5); |
947 | } |
955 | } |
948 | |
956 | |
949 | $inlay->append_text ("\nTimesys: "); |
957 | $inlay->append_text ("\nTimesys: "); |
950 | $inlay->append_optionmenu ( |
958 | $inlay->append_optionmenu ( |
951 | \$info->{rules}{timesys}, |
959 | \$info->{rules}{timesys}, |
… | |
… | |
980 | } |
988 | } |
981 | } |
989 | } |
982 | ); |
990 | ); |
983 | |
991 | |
984 | $inlay->append_text ("\nMain Time: "); |
992 | $inlay->append_text ("\nMain Time: "); |
985 | $time = $inlay->append_entry (\$info->{rules}{time}, 5); |
993 | $time = $inlay->append_widget (gtk::timeentry \$info->{rules}{time}, 5); |
986 | $inlay->append_text ("\nInterval: "); |
994 | $inlay->append_text ("\nInterval: "); |
987 | $interval = $inlay->append_entry (\$info->{rules}{interval}, 3); |
995 | $interval = $inlay->append_widget (gtk::timeentry \$info->{rules}{interval}, 5); |
988 | $inlay->append_text ("\nPeriods/Stones: "); |
996 | $inlay->append_text ("\nPeriods/Stones: "); |
989 | $count = $inlay->append_entry (\$info->{rules}{count}, 2); |
997 | $count = $inlay->append_widget (gtk::numentry \$info->{rules}{count}, 5); |
990 | |
998 | |
991 | $inlay->append_text ("\n"); |
999 | $inlay->append_text ("\n"); |
992 | |
1000 | |
993 | if (!$self->{channel}) { |
1001 | if (!$self->{channel}) { |
994 | $inlay->append_button ("Create Challenge", sub { |
1002 | $inlay->append_button ("Create Challenge", sub { |