… | |
… | |
738 | my ($host, $port) = split /:/, $PROFILE->{host}; |
738 | my ($host, $port) = split /:/, $PROFILE->{host}; |
739 | |
739 | |
740 | $MAP = new DC::Map; |
740 | $MAP = new DC::Map; |
741 | |
741 | |
742 | $CONN = eval { |
742 | $CONN = eval { |
|
|
743 | local $SIG{__DIE__}; |
|
|
744 | |
743 | new DC::Protocol |
745 | new DC::Protocol |
744 | host => $host, |
746 | host => $host, |
745 | port => $port || 13327, |
747 | port => $port || 13327, |
746 | user => $PROFILE->{user}, |
748 | user => $PROFILE->{user}, |
747 | pass => $PROFILE->{password}, |
749 | pass => $PROFILE->{password}, |
… | |
… | |
1742 | |
1744 | |
1743 | $r |
1745 | $r |
1744 | } |
1746 | } |
1745 | |
1747 | |
1746 | my %SORT_ORDER = ( |
1748 | my %SORT_ORDER = ( |
1747 | type => undef, |
1749 | type => sub { |
|
|
1750 | sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_ |
|
|
1751 | }, |
1748 | mtime => sub { |
1752 | mtime => sub { |
1749 | my $NOW = time; |
1753 | my $NOW = time; |
1750 | sort { |
1754 | sort { |
1751 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
1755 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
1752 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
1756 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
… | |
… | |
2242 | has_close_button => 1, |
2246 | has_close_button => 1, |
2243 | ; |
2247 | ; |
2244 | |
2248 | |
2245 | $METASERVER = metaserver_dialog; |
2249 | $METASERVER = metaserver_dialog; |
2246 | # the name is changed to not conflict with the older name as users could have hidden it |
2250 | # the name is changed to not conflict with the older name as users could have hidden it |
2247 | $MESSAGE_WINDOW = new DC::UI::Dockbar (name => "message_window2", title => 'Messages'); |
2251 | $MESSAGE_WINDOW = new DC::UI::Dockbar |
|
|
2252 | name => "message_window2", |
|
|
2253 | title => 'Messages', |
|
|
2254 | force_w => $::WIDTH * 0.6, |
|
|
2255 | force_h => $::HEIGHT * 0.25, |
|
|
2256 | ; |
|
|
2257 | |
2248 | $MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW; |
2258 | $MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW; |
2249 | |
2259 | |
2250 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, |
2260 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, |
2251 | filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); |
2261 | filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); |
2252 | |
2262 | |
… | |
… | |
2474 | pickup => 0, |
2484 | pickup => 0, |
2475 | inv_sort => "mtime", |
2485 | inv_sort => "mtime", |
2476 | default => "profile", # default profile |
2486 | default => "profile", # default profile |
2477 | show_tips => 1, |
2487 | show_tips => 1, |
2478 | logview_max_par => 1000, |
2488 | logview_max_par => 1000, |
|
|
2489 | shift_fire_stop => 0, |
2479 | ); |
2490 | ); |
2480 | |
2491 | |
2481 | while (my ($k, $v) = each %DEF_CFG) { |
2492 | while (my ($k, $v) = each %DEF_CFG) { |
2482 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2493 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2483 | } |
2494 | } |