XDCC-Fetch 1.386
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +23 -0
- data/XDCC-Fetch.rbw +54 -0
- data/doc/ark.png +0 -0
- data/doc/connect_established.png +0 -0
- data/doc/index.html +300 -0
- data/doc/mega_ark.png +0 -0
- data/doc/package.png +0 -0
- data/doc/package_unknown.png +0 -0
- data/doc/shot1.png +0 -0
- data/doc/shot1_mini.png +0 -0
- data/doc/shot2.png +0 -0
- data/doc/shot2_mini.png +0 -0
- data/doc/xdccfetch.css +155 -0
- data/icons/ark.png +0 -0
- data/icons/ark_big.png +0 -0
- data/icons/camera_test.png +0 -0
- data/icons/cancel.png +0 -0
- data/icons/connect_creating.png +0 -0
- data/icons/connect_established.png +0 -0
- data/icons/connect_failed.png +0 -0
- data/icons/connect_no.png +0 -0
- data/icons/edit_add.png +0 -0
- data/icons/edit_remove.png +0 -0
- data/icons/exit.png +0 -0
- data/icons/fileclose.png +0 -0
- data/icons/folder_inbox.png +0 -0
- data/icons/idea.png +0 -0
- data/icons/mega_ark.png +0 -0
- data/icons/messagebox_critical.png +0 -0
- data/icons/messagebox_info.png +0 -0
- data/icons/messagebox_warning.png +0 -0
- data/icons/messagebox_warning_small.png +0 -0
- data/icons/package.png +0 -0
- data/icons/package_favourite.png +0 -0
- data/icons/package_unknown.png +0 -0
- data/src/Console/Console_Parser.rb +71 -0
- data/src/Console/XDCC_Pack_Match_Template.rb +29 -0
- data/src/Console/xdcc-fetch.rb +123 -0
- data/src/GUI/About_Dialog.rb +50 -0
- data/src/GUI/Application_Builder.rb +280 -0
- data/src/GUI/Context_Menu.rb +81 -0
- data/src/GUI/Custom_Tabs.rb +60 -0
- data/src/GUI/Dialog_Box.rb +116 -0
- data/src/GUI/Download_Finished_Box.rb +41 -0
- data/src/GUI/Empty_Text_Field_Handler.rb +86 -0
- data/src/GUI/Gui_Logic.rb +629 -0
- data/src/GUI/Icon_Loader.rb +58 -0
- data/src/GUI/Main_Window.rb +227 -0
- data/src/GUI/Packet_Item.rb +171 -0
- data/src/GUI/Packet_List.rb +145 -0
- data/src/GUI/Speed_Widget.rb +101 -0
- data/src/GUI/Talk_Back.rb +118 -0
- data/src/GUI/Toggle_Button.rb +56 -0
- data/src/Network/CTCP_Handler.rb +61 -0
- data/src/Network/DCC_File.rb +323 -0
- data/src/Network/DCC_Parser.rb +71 -0
- data/src/Network/IPAddr_Ext.rb +76 -0
- data/src/Network/IRC_Message.rb +161 -0
- data/src/Network/IRC_Server.rb +273 -0
- data/src/Network/IRC_Server_Respond_Map.rb +223 -0
- data/src/Network/IRC_User.rb +58 -0
- data/src/Network/TCP_Connection.rb +168 -0
- data/src/Network/XDCC_Announcement.rb +120 -0
- data/src/Network/XDCC_Announcement_Storage.rb +167 -0
- data/src/Network/XDCC_Download_Handler.rb +412 -0
- data/src/Network/XDCC_Pack.rb +58 -0
- data/src/Network/XDCC_Parser.rb +253 -0
- data/src/Translations/README +61 -0
- data/src/Translations/check_translations +83 -0
- data/src/Translations/de.rb +140 -0
- data/src/Translations/en.rb +145 -0
- data/src/Utilities/Configuration.rb +91 -0
- data/src/Utilities/Events.rb +87 -0
- data/src/Utilities/Globals.rb +138 -0
- data/src/Utilities/PrettyException.rb +1091 -0
- data/src/Utilities/Recursive_Open_Struct.rb +159 -0
- data/src/Utilities/Timer.rb +71 -0
- metadata +135 -0
@@ -0,0 +1,145 @@
|
|
1
|
+
# Copyright (c) 2004, 2005 Christoph Heindl and Martin Ankerl
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
# are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# * Redistributions of source code must retain the above copyright notice, this list
|
8
|
+
# of conditions and the following disclaimer.
|
9
|
+
# * Redistributions in binary form must reproduce the above copyright notice, this list
|
10
|
+
# of conditions and the following disclaimer in the documentation and/or other materials
|
11
|
+
# provided with the distribution.
|
12
|
+
# * Neither the name of Christoph Heindl and Martin Ankerl nor the names of its contributors
|
13
|
+
# may be used to endorse or promote products derived from this software without specific
|
14
|
+
# prior written permission.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
17
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
18
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
21
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
22
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
23
|
+
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
# Language definition #################################
|
26
|
+
|
27
|
+
lang = $cfg.text.en
|
28
|
+
lang.language_name = "English"
|
29
|
+
|
30
|
+
lang.about = "&About\t\tShows an about dialog"
|
31
|
+
lang.help = "&Help"
|
32
|
+
lang.add_server = "&Add Server\tCtrl-A\tAdds and connects to an IRC server"
|
33
|
+
lang.remove_server = "Remove\t\tDisconnects and removes the IRC server"
|
34
|
+
lang.add_channel = "Add Channel\t\tAdds (joins) a channel"
|
35
|
+
lang.add_channel_dialog = "Add Channel"
|
36
|
+
lang.remove_channel = "Remove\t\tRemoves (parts) a channel"
|
37
|
+
lang.specify_server = "Specify Server"
|
38
|
+
|
39
|
+
lang.server = "Server"
|
40
|
+
lang.port = "Port"
|
41
|
+
lang.nickname = "Nickname"
|
42
|
+
lang.password = "Password"
|
43
|
+
lang.channel = "Channel"
|
44
|
+
|
45
|
+
lang.disconnect = "&Disconnect"
|
46
|
+
lang.connect = "&Connect"
|
47
|
+
|
48
|
+
|
49
|
+
lang.file = "&File"
|
50
|
+
lang.quit = "&Exit\tCtrl-X\tCloses the application and all active connections"
|
51
|
+
|
52
|
+
lang.speed_widget_init = "0.0 kb\tShows total download speed in kilobytes\tShows total download speed in kilobytes"
|
53
|
+
|
54
|
+
lang.enter_ip_or_domain = "Enter IP or domain"
|
55
|
+
lang.the_servers_port = "The server's port"
|
56
|
+
|
57
|
+
lang.channel_name = "Channel Name"
|
58
|
+
lang.connections = "Connections\tRight click in the underlying area\nto add IRC Servers and Channels\tRight click in the underlying area to add IRC Servers and Channels"
|
59
|
+
lang.search = "Search\tEnter your query in the box to the right\tEnter your query in the box to the right"
|
60
|
+
|
61
|
+
lang.free_slots = "\tShow/hide packets where\nbot has free slots\tShow/hide packets where bot has free slots"
|
62
|
+
lang.slots_unknown = "\tShow/hide packets where\nslot status is unknown\tShow/hide packets where slot status is unknown"
|
63
|
+
lang.no_free_slots = "\tShow/hide packets where\nbot does not have free slots\tShow/hide packets where bot does not have free slots"
|
64
|
+
|
65
|
+
lang.what_do_you_want_to_fetch_today = "What do you want to fetch today?"
|
66
|
+
|
67
|
+
lang.bot = "Bot"
|
68
|
+
lang.name = "Name"
|
69
|
+
lang.size = "Size"
|
70
|
+
|
71
|
+
lang.active = "Active\tShows active downloads\tShows active downloads"
|
72
|
+
lang.completed = "Completed\tShows completed downloads\tShows completed downloads"
|
73
|
+
lang.error = "Error\tShows aborted downloads\tShows aborted downloads"
|
74
|
+
|
75
|
+
lang.download = "&Download\t\tDownload this pack"
|
76
|
+
lang.status = "Status"
|
77
|
+
lang.target_directory = "Download Directory"
|
78
|
+
lang.clear_list = "&Clear List"
|
79
|
+
|
80
|
+
lang.download_waiting = "Waiting"
|
81
|
+
lang.download_requesting = "Requesting"
|
82
|
+
lang.download_timeout = "Timeout"
|
83
|
+
lang.download_cancelling = "Cancelling"
|
84
|
+
lang.download_started = "Downloading"
|
85
|
+
lang.download_finished = "Finished"
|
86
|
+
lang.download_failed = "Failed"
|
87
|
+
lang.queue_remote = "Remotely Queued: "
|
88
|
+
lang.queue_local = "Locally Queued: "
|
89
|
+
lang.speed = "Speed"
|
90
|
+
|
91
|
+
lang.version = "Version"
|
92
|
+
lang.revision = "Revision"
|
93
|
+
lang.credits = "Developers"
|
94
|
+
lang.thanks = "Special Thanks To"
|
95
|
+
|
96
|
+
|
97
|
+
# "x of x packs"
|
98
|
+
lang.of = "/"
|
99
|
+
lang.packs = ""
|
100
|
+
lang.status_label_tooltip = "\tShows number of visible\npacks / total pack number\tShows number of visible packs / total pack number"
|
101
|
+
|
102
|
+
lang.cancel = "&Cancel\t\tCancels the download"
|
103
|
+
lang.submit = "&Submit"
|
104
|
+
|
105
|
+
lang.md5.disabled = "unknown"
|
106
|
+
lang.md5.unavailable = "unknown"
|
107
|
+
lang.md5.ok = "ok"
|
108
|
+
lang.md5.failed = "wrong"
|
109
|
+
|
110
|
+
lang.checksum = "Checksum"
|
111
|
+
|
112
|
+
lang.speed = "Speed"
|
113
|
+
|
114
|
+
lang.version = "Version"
|
115
|
+
lang.revision = "Revision"
|
116
|
+
lang.credits = "Credits"
|
117
|
+
|
118
|
+
lang.download_finished_box = "Download Finished"
|
119
|
+
|
120
|
+
lang.show_warning = "&Show Error"
|
121
|
+
|
122
|
+
# Network messages
|
123
|
+
lang.network.ip.err_notroutable_ip = "Not routable ip address given"
|
124
|
+
lang.network.tcp.err_invalid_address = "Invalid TCP address/port info"
|
125
|
+
lang.network.tcp.err_con_closed = "Connection is closed"
|
126
|
+
lang.network.tcp.err_con_active = "Connection is currently active"
|
127
|
+
lang.network.tcp.err_con_timeout = "Timeout while trying to connect"
|
128
|
+
lang.network.tcp.err_con_no_remote = "No address and/or port specified"
|
129
|
+
lang.network.dcc.err_dir_notexist = "Destination directory does not exist"
|
130
|
+
lang.network.dcc.err_file_permission = "Cannot write to file"
|
131
|
+
lang.network.dcc.err_filesize_differ = "Filesize seems to differ"
|
132
|
+
lang.network.dcc.err_verification = "File verification failed"
|
133
|
+
lang.network.xdcc.err_punish_slowness = "Download speed too low for bot"
|
134
|
+
lang.network.xdcc.err_pack_already_requested = "Pack already requested"
|
135
|
+
lang.network.xdcc.err_max_packs_requested = "Max number of packs requested from bot"
|
136
|
+
lang.network.xdcc.err_bot_left = "Bot left IRC"
|
137
|
+
lang.network.xdcc.err_server_disconnect = "IRC Server connection lost"
|
138
|
+
lang.network.xdcc.err_con_closed = "Connection remotely closed"
|
139
|
+
lang.network.xdcc.err_no_answer = "No XDCC answer"
|
140
|
+
lang.network.xdcc.err_ip_address_conversion = "Could not determine IP address"
|
141
|
+
lang.network.xdcc.cancel_download_default = "User canceled download"
|
142
|
+
|
143
|
+
|
144
|
+
lang.message.connection_error_title = "Connection Error"
|
145
|
+
lang.message.connection_error = "Connection to IRC-Server failed"
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# Copyright (c) 2004-2005, Martin Ankerl
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
# are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# * Redistributions of source code must retain the above copyright notice, this list
|
8
|
+
# of conditions and the following disclaimer.
|
9
|
+
# * Redistributions in binary form must reproduce the above copyright notice, this list
|
10
|
+
# of conditions and the following disclaimer in the documentation and/or other materials
|
11
|
+
# provided with the distribution.
|
12
|
+
# * Neither the name of Christoph Heindl and Martin Ankerl nor the names of its contributors
|
13
|
+
# may be used to endorse or promote products derived from this software without specific
|
14
|
+
# prior written permission.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
17
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
18
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
21
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
22
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
23
|
+
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
require 'yaml'
|
26
|
+
|
27
|
+
# Configuration is responsible for loading and saving XDCC-Fetch's settings that are
|
28
|
+
# configurable by the user.
|
29
|
+
class Configuration
|
30
|
+
def initialize(whole_config)
|
31
|
+
@whole_config = whole_config
|
32
|
+
@config = whole_config.config
|
33
|
+
@lang = whole_config.text
|
34
|
+
end
|
35
|
+
|
36
|
+
# Loads configuration parameters, and the language.
|
37
|
+
def load
|
38
|
+
load_saved_config
|
39
|
+
set_language("en")
|
40
|
+
set_language(@config.current_language) if @config.current_language != "en"
|
41
|
+
end
|
42
|
+
|
43
|
+
# Saves the configuration into a YAML file.
|
44
|
+
def save
|
45
|
+
save_config
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def save_config
|
51
|
+
data = { }
|
52
|
+
@config.attrs.each do |attr|
|
53
|
+
data[attr] = @config[attr]
|
54
|
+
end
|
55
|
+
File.open(@whole_config.config_filename, "wb") do |file|
|
56
|
+
file.write(YAML::dump(data))
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_saved_config
|
61
|
+
@config.re_open
|
62
|
+
data = { }
|
63
|
+
begin
|
64
|
+
File.open(@whole_config.config_filename) do |file|
|
65
|
+
data = YAML::load(file.read)
|
66
|
+
end
|
67
|
+
rescue Errno::ENOENT
|
68
|
+
end
|
69
|
+
data.each do |key, value|
|
70
|
+
@config[key] = value
|
71
|
+
end
|
72
|
+
@config.close
|
73
|
+
end
|
74
|
+
|
75
|
+
def set_language(lang_id)
|
76
|
+
@lang.re_open
|
77
|
+
copy(@lang[lang_id], @lang)
|
78
|
+
@lang.close
|
79
|
+
end
|
80
|
+
|
81
|
+
def copy(source, target)
|
82
|
+
source.attrs.each do |attr|
|
83
|
+
if source[attr].class == Recursive_Open_Struct
|
84
|
+
target[attr] ||= Recursive_Open_Struct.new
|
85
|
+
copy(source[attr], target[attr])
|
86
|
+
else
|
87
|
+
target[attr] = source[attr]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Copyright (c) 2004-2005, Christoph Heindl
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
# are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# * Redistributions of source code must retain the above copyright notice, this list
|
8
|
+
# of conditions and the following disclaimer.
|
9
|
+
# * Redistributions in binary form must reproduce the above copyright notice, this list
|
10
|
+
# of conditions and the following disclaimer in the documentation and/or other materials
|
11
|
+
# provided with the distribution.
|
12
|
+
# * Neither the name of Christoph Heindl nor the names of its contributors may be used to
|
13
|
+
# endorse or promote products derived from this software without specific prior written
|
14
|
+
# permission.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
17
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
18
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
21
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
22
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
23
|
+
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
|
26
|
+
require 'set'
|
27
|
+
|
28
|
+
# Provides a generic interface for an event based publisher/subscriber pattern.
|
29
|
+
# Subscribers may only register/unregister for certain events, given by a bitmask.
|
30
|
+
# Subscribers need to provide a generic notify method on_event, which has three
|
31
|
+
# parameters: 1. event trigger, 2. type of the event, and 3. array of event arguments
|
32
|
+
module Event_Publisher
|
33
|
+
|
34
|
+
@@global_event_id = 1
|
35
|
+
|
36
|
+
def init_events
|
37
|
+
@event_listeners = Hash.new()
|
38
|
+
end
|
39
|
+
|
40
|
+
def shutdown_events
|
41
|
+
@event_listeners = nil
|
42
|
+
end
|
43
|
+
|
44
|
+
def events_of_nr(n)
|
45
|
+
tmp = [n, 0]
|
46
|
+
events = []
|
47
|
+
i = 0
|
48
|
+
begin
|
49
|
+
tmp = tmp[0].divmod(2)
|
50
|
+
events.push(2**i) unless tmp[1] == 0
|
51
|
+
i += 1
|
52
|
+
end while tmp[0] != 0
|
53
|
+
events
|
54
|
+
end
|
55
|
+
|
56
|
+
def connect_to_events(events, listener)
|
57
|
+
self.events_of_nr(events).each do |event|
|
58
|
+
if !@event_listeners.include?(event)
|
59
|
+
@event_listeners[event] = Set[listener]
|
60
|
+
else
|
61
|
+
@event_listeners[event].add(listener)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def disconnect_from_events(events, listener)
|
67
|
+
self.events_of_nr(events).each do |event|
|
68
|
+
if @event_listeners.include?(event)
|
69
|
+
@event_listeners[event].delete(listener)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def fire_event(events, *eventargs)
|
75
|
+
self.events_of_nr(events).each do |event|
|
76
|
+
if @event_listeners.include?(event)
|
77
|
+
@event_listeners[event].each do |listener|
|
78
|
+
listener.on_event(self, event, eventargs)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def Event_Publisher.next_global_eventID
|
85
|
+
@@global_event_id *= 2
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# This file contains all global variables of XDCC-Fetch.
|
2
|
+
|
3
|
+
# Copyright (c) 2004-2005, Christoph Heindl and Martin Ankerl
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
7
|
+
# are permitted provided that the following conditions are met:
|
8
|
+
#
|
9
|
+
# * Redistributions of source code must retain the above copyright notice, this list
|
10
|
+
# of conditions and the following disclaimer.
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice, this list
|
12
|
+
# of conditions and the following disclaimer in the documentation and/or other materials
|
13
|
+
# provided with the distribution.
|
14
|
+
# * Neither the name of Christoph Heindl and Martin Ankerl nor the names of its contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without specific
|
16
|
+
# prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
19
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
21
|
+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
24
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
25
|
+
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
|
27
|
+
require 'src/Utilities/Recursive_Open_Struct'
|
28
|
+
|
29
|
+
$cfg = Recursive_Open_Struct.new
|
30
|
+
|
31
|
+
$cfg.app.name = "XDCC-Fetch"
|
32
|
+
$cfg.app.version = "STONEAGE"
|
33
|
+
|
34
|
+
$cfg.app.revision = "1.386"
|
35
|
+
|
36
|
+
$cfg.app.developers = [
|
37
|
+
"Martin Ankerl (GUI)",
|
38
|
+
"Christoph Heindl (Network)",
|
39
|
+
"Marlene Gugimaier (Testing, User Interface)",
|
40
|
+
]
|
41
|
+
$cfg.app.thanks = [
|
42
|
+
"The Ruby Community (http://ruby-lang.org/)",
|
43
|
+
"FXRuby Team (http://www.fxruby.org/)",
|
44
|
+
"Fox-Toolkit Team (http://fox-toolkit.org/)",
|
45
|
+
"Everaldo for Crystal-SVG (http://www.everaldo.com/)"
|
46
|
+
]
|
47
|
+
$cfg.app.copyright = "Copyright (c) 2004, 2005 The XDCC-Fetch Team"
|
48
|
+
$cfg.app.url = "http://xdccfetch.sourceforge.net/"
|
49
|
+
|
50
|
+
# use first font that is available
|
51
|
+
$cfg.app.font.name = ["Bitstream Vera Sans", "Verdana", "Trebuchet MS", "Tahoma", "Arial"]
|
52
|
+
$cfg.app.font.size = 8
|
53
|
+
|
54
|
+
$cfg.dialogbox.textwidth = 120
|
55
|
+
|
56
|
+
$cfg.talkback.name = "Talkback"
|
57
|
+
|
58
|
+
$cfg.app.width = 640
|
59
|
+
$cfg.app.height = 480
|
60
|
+
$cfg.left.width = 130
|
61
|
+
$cfg.bottom.height = 150
|
62
|
+
$cfg.list.opts = ICONLIST_SINGLESELECT|ICONLIST_DETAILED|LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_AUTOSIZE # HSCROLLER_NEVER|
|
63
|
+
|
64
|
+
# icons
|
65
|
+
$cfg.icons.clear = "fileclose.png"
|
66
|
+
|
67
|
+
$cfg.icons.disconnected = "connect_no.png"
|
68
|
+
$cfg.icons.connecting = "connect_creating.png"
|
69
|
+
$cfg.icons.connected = "connect_established.png"
|
70
|
+
$cfg.icons.connection_failed = "connect_failed.png"
|
71
|
+
$cfg.alternative_user_name = "XDCC-Fetch_#{rand(36**5).to_s(36)}"
|
72
|
+
|
73
|
+
$cfg.icons.warning = "messagebox_warning_small.png"
|
74
|
+
$cfg.icons.packet = "package.png"
|
75
|
+
$cfg.icons.active = "folder_inbox.png"
|
76
|
+
$cfg.icons.completed = "camera_test.png"
|
77
|
+
$cfg.icons.error = "cancel.png"
|
78
|
+
$cfg.icons.quit = "exit.png"
|
79
|
+
$cfg.icons.app = "ark.png"
|
80
|
+
$cfg.icons.app_big = "ark_big.png"
|
81
|
+
$cfg.icons.app_mega = "mega_ark.png"
|
82
|
+
$cfg.icons.add = "edit_add.png"
|
83
|
+
$cfg.icons.remove = "edit_remove.png"
|
84
|
+
$cfg.icons.free_slots = "ark.png"
|
85
|
+
$cfg.icons.slots_unknown = "package_unknown.png"
|
86
|
+
$cfg.icons.package_failed = "package_favourite.png"
|
87
|
+
$cfg.icons.about = "idea.png"
|
88
|
+
$cfg.icons.cancel = "cancel.png"
|
89
|
+
$cfg.icons.error_big = "messagebox_critical.png"
|
90
|
+
$cfg.icons.warning_big = "messagebox_warning.png"
|
91
|
+
|
92
|
+
# parameters for network code
|
93
|
+
$cfg.network.tcp.connect_timeout = 5
|
94
|
+
$cfg.network.tcp.connect_thread_priority = -2
|
95
|
+
$cfg.network.dcc.send_regexp = /^DCC\sSEND\s(\S+)\s(\d+)\s(\d+)\s(\d+)$/i
|
96
|
+
$cfg.network.dcc.accept_regexp = /^DCC\sACCEPT\s(\S+\s)?\s*(\d+)\s(\d+)$/i
|
97
|
+
$cfg.network.dcc.verification_bytes = 5000
|
98
|
+
$cfg.network.dcc.block_nonroutable_addresses = true
|
99
|
+
$cfg.network.ctcp.enable_replies = true
|
100
|
+
$cfg.network.irc.default_port = 6667
|
101
|
+
$cfg.network.irc.msg_regexp = /^(:\S*\s)?(\S*)\s?(.*)?$/
|
102
|
+
$cfg.network.irc.prefix_regexp = /^:([^!\s]*)!?([^@\s]*)?@?(\S*)?\s/
|
103
|
+
$cfg.network.irc.params_regexp = /:.+|\S+/
|
104
|
+
$cfg.network.xdcc.offer_regexp = /^\002\*{2}\002\D*(\d+)[^\002]*\002\*{2}\002\D*(\d+)\D*(\d+).*$/
|
105
|
+
$cfg.network.xdcc.queue_regexp = /Queue:\s(\d+)\/(\d+)/
|
106
|
+
$cfg.network.xdcc.pack_regexp = /\002#(\d+)\s*\002\D*(\d+)x\D*\[([^\]]*)\]\s*(.*)/
|
107
|
+
$cfg.network.xdcc.queue_add_regexp = /Added\syou\sto\sthe\smain\squeue\sin\sposition\s(\d+)/i
|
108
|
+
$cfg.network.xdcc.punish_slowness_regexp = /You\sare\sbeing\spunished\sfor\syour\sslowness/i
|
109
|
+
$cfg.network.xdcc.queue_full_regexp = /Main\squeue\sof\ssize\d+\sis\full/i
|
110
|
+
$cfg.network.xdcc.queue_full_wait = 60
|
111
|
+
$cfg.network.xdcc.is_queued_regexp = /You\s\already\shave\sthat\sitem\squeued/i
|
112
|
+
$cfg.network.xdcc.is_queued_wait = 60
|
113
|
+
$cfg.network.xdcc.max_queued_regexp = /You\salready\shave\s\d+\sitems\squeued/i
|
114
|
+
$cfg.network.xdcc.max_queued_wait = 60
|
115
|
+
$cfg.network.xdcc.queue_update_regexp = /in\sposition\s(\d+)\sof\s(\d+)/i
|
116
|
+
$cfg.network.xdcc.request_timeout = 20
|
117
|
+
$cfg.network.xdcc.max_rerequests = 5
|
118
|
+
$cfg.network.xdcc.no_max_rerequests = true
|
119
|
+
$cfg.network.xdcc.con_error_wait = 20
|
120
|
+
$cfg.network.xdcc.enable_md5 = true
|
121
|
+
$cfg.network.xdcc.md5_regexp = /md5sum: (\w+)\)/i
|
122
|
+
|
123
|
+
|
124
|
+
$cfg.config_filename = File.join(ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH'], ".xdcc-fetch.conf")
|
125
|
+
|
126
|
+
# $cfg.config is managed by the configuration class.
|
127
|
+
# The following values are default values which might be overridden by the config file.
|
128
|
+
$cfg.config.current_language = 'en'
|
129
|
+
$cfg.config.servers = { }
|
130
|
+
$cfg.config.download_directory = "."
|
131
|
+
|
132
|
+
# load all language files
|
133
|
+
Dir['src/Translations/*.rb'].each do |language_file|
|
134
|
+
require language_file
|
135
|
+
end
|
136
|
+
|
137
|
+
# prevent further modifications
|
138
|
+
$cfg.close
|