diff --git a/deluge/ui/gtkui/glade/torrent_menu.glade b/deluge/ui/gtkui/glade/torrent_menu.glade
index 774cc3716..b371e68d3 100644
--- a/deluge/ui/gtkui/glade/torrent_menu.glade
+++ b/deluge/ui/gtkui/glade/torrent_menu.glade
@@ -35,6 +35,11 @@
+
+
+
-
@@ -90,97 +95,5 @@
-
-
-
-
-
-
diff --git a/deluge/ui/gtkui/listview.py b/deluge/ui/gtkui/listview.py
index 253d81bd3..0dec730cc 100644
--- a/deluge/ui/gtkui/listview.py
+++ b/deluge/ui/gtkui/listview.py
@@ -82,6 +82,7 @@ class ListView:
def __init__(self, name, column_indices):
self.name = name
self.column_indices = column_indices
+ self.column = None
def __init__(self, treeview_widget=None):
log.debug("ListView initialized..")
@@ -113,6 +114,13 @@ class ListView:
else:
return self.columns[name].column_indices[0]
+ def create_checklist_menu(self):
+ menu = gtk.Menu()
+ for column in self.columns.values():
+ menuitem = gtk.CheckMenuItem(column.name)
+ menu.append(menuitem)
+ return menu
+
def create_new_liststore(self):
# Create a new liststore with added column and move the data from the
# old one to the new one.
@@ -158,6 +166,7 @@ class ListView:
column.set_reorderable(True)
column.set_visible(visible)
self.treeview.append_column(column)
+ self.columns[header].column = column
return True
@@ -194,7 +203,8 @@ class ListView:
column.set_min_width(10)
column.set_reorderable(True)
self.treeview.append_column(column)
-
+ self.columns[header].column = column
+
return True
def add_progress_column(self, header):
@@ -221,7 +231,8 @@ class ListView:
column.set_min_width(10)
column.set_reorderable(True)
self.treeview.append_column(column)
-
+ self.columns[header].column = column
+
return True
def add_texticon_column(self, header):
@@ -251,5 +262,6 @@ class ListView:
column.add_attribute(render, 'text',
self.columns[header].column_indices[1])
self.treeview.append_column(column)
-
+ self.columns[header].column = column
+
return True
diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py
index eb58085a2..1d6fdc03c 100644
--- a/deluge/ui/gtkui/torrentview.py
+++ b/deluge/ui/gtkui/torrentview.py
@@ -80,6 +80,9 @@ class TorrentView(listview.ListView):
listview.cell_data_ratio,
[float])
+ self.window.main_glade.get_widget("menu_columns").set_submenu(
+ self.create_checklist_menu())
+
### Connect Signals ###
# Connect to the 'button-press-event' to know when to bring up the
# torrent menu popup.
@@ -100,7 +103,7 @@ class TorrentView(listview.ListView):
"eta"]
status = functions.get_torrent_status(self.core, torrent_id,
status_keys)
-
+
# Set values for each column in the row
self.liststore.set_value(row,
diff --git a/libtorrent/include/libtorrent/alert_types.hpp b/libtorrent/include/libtorrent/alert_types.hpp
index 7b32d2502..48491bca4 100755
--- a/libtorrent/include/libtorrent/alert_types.hpp
+++ b/libtorrent/include/libtorrent/alert_types.hpp
@@ -184,6 +184,63 @@ namespace libtorrent
{ return std::auto_ptr(new torrent_finished_alert(*this)); }
};
+ struct TORRENT_EXPORT piece_finished_alert: torrent_alert
+ {
+ piece_finished_alert(
+ const torrent_handle& h
+ , int piece_num
+ , const std::string& msg)
+ : torrent_alert(h, alert::warning, msg)
+ , piece_index(piece_num)
+ { assert(piece_index >= 0);}
+
+ int piece_index;
+
+ virtual std::auto_ptr clone() const
+ { return std::auto_ptr(new piece_finished_alert(*this)); }
+ };
+
+ struct TORRENT_EXPORT block_finished_alert: torrent_alert
+ {
+ block_finished_alert(
+ const torrent_handle& h
+ , int block_num
+ , int piece_num
+ , const std::string& msg)
+ : torrent_alert(h, alert::warning, msg)
+ , block_index(block_num)
+ , piece_index(piece_num)
+ { assert(block_index >= 0 && piece_index >= 0);}
+
+ int block_index;
+ int piece_index;
+
+ virtual std::auto_ptr clone() const
+ { return std::auto_ptr(new block_finished_alert(*this)); }
+ };
+
+ struct TORRENT_EXPORT block_downloading_alert: torrent_alert
+ {
+ block_downloading_alert(
+ const torrent_handle& h
+ , std::string& speedmsg
+ , int block_num
+ , int piece_num
+ , const std::string& msg)
+ : torrent_alert(h, alert::warning, msg)
+ , peer_speedmsg(speedmsg)
+ , block_index(block_num)
+ , piece_index(piece_num)
+ { assert(block_index >= 0 && piece_index >= 0);}
+
+ std::string peer_speedmsg;
+ int block_index;
+ int piece_index;
+
+ virtual std::auto_ptr clone() const
+ { return std::auto_ptr(new block_downloading_alert(*this)); }
+ };
+
struct TORRENT_EXPORT storage_moved_alert: torrent_alert
{
storage_moved_alert(torrent_handle const& h, std::string const& path)
diff --git a/libtorrent/include/libtorrent/bandwidth_manager.hpp b/libtorrent/include/libtorrent/bandwidth_manager.hpp
index 4df9d4f2f..75e1f1d4e 100644
--- a/libtorrent/include/libtorrent/bandwidth_manager.hpp
+++ b/libtorrent/include/libtorrent/bandwidth_manager.hpp
@@ -90,47 +90,47 @@ struct bandwidth_limit
{
static const int inf = boost::integer_traits::const_max;
- bandwidth_limit()
+ bandwidth_limit() throw()
: m_quota_left(0)
, m_local_limit(inf)
, m_current_rate(0)
{}
- void throttle(int limit)
+ void throttle(int limit) throw()
{
m_local_limit = limit;
}
- int throttle() const
+ int throttle() const throw()
{
return m_local_limit;
}
- void assign(int amount)
+ void assign(int amount) throw()
{
assert(amount > 0);
m_current_rate += amount;
m_quota_left += amount;
}
- void use_quota(int amount)
+ void use_quota(int amount) throw()
{
assert(amount <= m_quota_left);
m_quota_left -= amount;
}
- int quota_left() const
+ int quota_left() const throw()
{
return (std::max)(m_quota_left, 0);
}
- void expire(int amount)
+ void expire(int amount) throw()
{
assert(amount >= 0);
m_current_rate -= amount;
}
- int max_assignable() const
+ int max_assignable() const throw()
{
if (m_local_limit == inf) return inf;
if (m_local_limit <= m_current_rate) return 0;
@@ -160,7 +160,7 @@ private:
};
template
-T clamp(T val, T ceiling, T floor)
+T clamp(T val, T ceiling, T floor) throw()
{
assert(ceiling >= floor);
if (val >= ceiling) return ceiling;
@@ -171,7 +171,7 @@ T clamp(T val, T ceiling, T floor)
template
struct bandwidth_manager
{
- bandwidth_manager(io_service& ios, int channel)
+ bandwidth_manager(io_service& ios, int channel) throw()
: m_ios(ios)
, m_history_timer(m_ios)
, m_limit(bandwidth_limit::inf)
@@ -179,14 +179,14 @@ struct bandwidth_manager
, m_channel(channel)
{}
- void throttle(int limit)
+ void throttle(int limit) throw()
{
mutex_t::scoped_lock l(m_mutex);
assert(limit >= 0);
m_limit = limit;
}
- int throttle() const
+ int throttle() const throw()
{
mutex_t::scoped_lock l(m_mutex);
return m_limit;
@@ -197,7 +197,7 @@ struct bandwidth_manager
// this is used by web seeds
void request_bandwidth(intrusive_ptr peer
, int blk
- , bool non_prioritized)
+ , bool non_prioritized) throw()
{
INVARIANT_CHECK;
assert(blk > 0);
@@ -257,8 +257,11 @@ struct bandwidth_manager
private:
- void add_history_entry(history_entry const& e) try
+ void add_history_entry(history_entry const& e) throw()
{
+#ifndef NDEBUG
+ try {
+#endif
INVARIANT_CHECK;
m_history.push_front(e);
m_current_quota += e.amount;
@@ -268,11 +271,17 @@ private:
m_history_timer.expires_at(e.expires_at);
m_history_timer.async_wait(bind(&bandwidth_manager::on_history_expire, this, _1));
+#ifndef NDEBUG
+ }
+ catch (std::exception&) { assert(false); }
+#endif
}
- catch (std::exception&) { assert(false); }
- void on_history_expire(asio::error_code const& e) try
+ void on_history_expire(asio::error_code const& e) throw()
{
+#ifndef NDEBUG
+ try {
+#endif
INVARIANT_CHECK;
if (e) return;
@@ -303,14 +312,20 @@ private:
// means we can hand out more (in case there
// are still consumers in line)
if (!m_queue.empty()) hand_out_bandwidth();
+#ifndef NDEBUG
+ }
+ catch (std::exception&)
+ {
+ assert(false);
+ }
+#endif
}
- catch (std::exception&)
- {
- assert(false);
- };
- void hand_out_bandwidth() try
+ void hand_out_bandwidth() throw()
{
+#ifndef NDEBUG
+ try {
+#endif
INVARIANT_CHECK;
ptime now(time_now());
@@ -404,9 +419,12 @@ private:
add_history_entry(history_entry(
qe.peer, t, hand_out_amount, now + bw_window_size));
}
+#ifndef NDEBUG
+ }
+ catch (std::exception& e)
+ { assert(false); };
+#endif
}
- catch (std::exception& e)
- { assert(false); };
typedef boost::mutex mutex_t;
diff --git a/libtorrent/include/libtorrent/config.hpp b/libtorrent/include/libtorrent/config.hpp
index c8d86955e..b36d4da22 100755
--- a/libtorrent/include/libtorrent/config.hpp
+++ b/libtorrent/include/libtorrent/config.hpp
@@ -37,6 +37,8 @@ POSSIBILITY OF SUCH DAMAGE.
#if defined(__GNUC__) && __GNUC__ >= 4
+#define TORRENT_DEPRECATED __attribute__ ((deprecated))
+
# if defined(TORRENT_BUILDING_SHARED) || defined(TORRENT_LINKING_SHARED)
# define TORRENT_EXPORT __attribute__ ((visibility("default")))
# else
@@ -61,6 +63,9 @@ POSSIBILITY OF SUCH DAMAGE.
# define TORRENT_EXPORT
#endif
+#ifndef TORRENT_DEPRECATED
+#define TORRENT_DEPRECATED
+#endif
#endif // TORRENT_CONFIG_HPP_INCLUDED
diff --git a/libtorrent/include/libtorrent/disk_io_thread.hpp b/libtorrent/include/libtorrent/disk_io_thread.hpp
index aff0930e4..16ee0bca4 100644
--- a/libtorrent/include/libtorrent/disk_io_thread.hpp
+++ b/libtorrent/include/libtorrent/disk_io_thread.hpp
@@ -111,6 +111,10 @@ namespace libtorrent
// memory pool for read and write operations
boost::pool<> m_pool;
+#ifndef NDEBUG
+ int m_block_size;
+#endif
+
// thread for performing blocking disk io operations
boost::thread m_disk_io_thread;
};
diff --git a/libtorrent/include/libtorrent/entry.hpp b/libtorrent/include/libtorrent/entry.hpp
index a1eba5324..59e29803d 100755
--- a/libtorrent/include/libtorrent/entry.hpp
+++ b/libtorrent/include/libtorrent/entry.hpp
@@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
-#include
+#include
#include