diff --git a/Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py b/Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py index d877107c2b0..03d57af7e76 100644 --- a/Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py +++ b/Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py @@ -16,6 +16,7 @@ from Tribler.Core.DownloadState import DownloadState from Tribler.Core.Libtorrent import checkHandleAndSynchronize, waitForHandleAndSynchronize from Tribler.Core.TorrentDef import TorrentDefNoMetainfo, TorrentDef +from Tribler.Core.Utilities.torrent_utils import get_info_from_handle from Tribler.Core.osutils import fix_filebasename from Tribler.Core.simpledefs import (DLSTATUS_WAITING4HASHCHECK, DLSTATUS_HASHCHECKING, DLSTATUS_METADATA, DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING, DLSTATUS_ALLOCATING_DISKSPACE, @@ -311,16 +312,16 @@ def network_create_engine_wrapper(self, pstate, initialdlstatus=None, share_mode if self.handle: self.set_selected_files() - # set_selected_files sets priorities to 1, so we must set - # share_mode again, but first we must unset it, otherwise - # set_share_mode doesn't do anything - if share_mode: - self.handle.set_share_mode(not share_mode) - self.handle.set_share_mode(share_mode) + # set_selected_files sets priorities to 1, so we must set + # share_mode again, but first we must unset it, otherwise + # set_share_mode doesn't do anything + if share_mode: + self.handle.set_share_mode(not share_mode) + self.handle.set_share_mode(share_mode) - # If we lost resume_data always resume download in order to force checking - if initialdlstatus != DLSTATUS_STOPPED or not resume_data: - self.handle.resume() + # If we lost resume_data always resume download in order to force checking + if initialdlstatus != DLSTATUS_STOPPED or not resume_data: + self.handle.resume() # If we only needed to perform checking, pause download after it is complete self.pause_after_next_hashcheck = initialdlstatus == DLSTATUS_STOPPED diff --git a/Tribler/Core/Libtorrent/LibtorrentMgr.py b/Tribler/Core/Libtorrent/LibtorrentMgr.py index 994afb9bf96..b865249bbf5 100644 --- a/Tribler/Core/Libtorrent/LibtorrentMgr.py +++ b/Tribler/Core/Libtorrent/LibtorrentMgr.py @@ -324,30 +324,6 @@ def process_alert(self, alert): else: self._logger.debug("LibtorrentMgr: alert for invalid torrent") - def reachability_check(self): - # obsolete function - return - - # if self.ltsession and self.ltsession.status().has_incoming_connections: - # self.trsession.lm.threadpool.add_task(self.trsession.lm.dialback_reachable_callback, 3) - # else: - # self.trsession.lm.threadpool.add_task(self.reachability_check, 10) - - def monitor_dht(self, infohash, chances_remaining=1): - # obsolete function - return - - # Sometimes the dht fails to start. To workaround this issue we monitor the #dht_nodes, and restart if needed. - # if self.ltsession: - # if self.get_dht_nodes() <= 25: - # if self.get_dht_nodes() >= 5 and chances_remaining: - # self._logger.info("LibtorrentMgr: giving the dht a chance (%d, %d)", self.ltsession.status().dht_nodes, chances_remaining) - # self.trsession.lm.threadpool.add_task(lambda: self.monitor_dht(chances_remaining - 1), 5) - # else: - # self._logger.debug("could not find torrent %s", infohash) - # else: - # self._logger.debug("alert for invalid torrent") - def get_peers(self, infohash, callback, timeout=30): def on_metainfo_retrieved(metainfo, infohash=infohash, callback=callback): callback(infohash, metainfo.get('initial peers', [])) diff --git a/Tribler/Main/Utility/GuiDBTuples.py b/Tribler/Main/Utility/GuiDBTuples.py index 2c5dcb0e4aa..9ac02fc7f7f 100644 --- a/Tribler/Main/Utility/GuiDBTuples.py +++ b/Tribler/Main/Utility/GuiDBTuples.py @@ -127,7 +127,7 @@ def __init__(self, torrent_id, infohash, name, length, category, status, num_see @cacheProperty def torrent_id(self): - self._logger.error("Torrent: fetching getTorrentID from DB %s", self) + self._logger.debug("Torrent: fetching getTorrentID from DB %s", self) return self.torrent_db.getTorrentID(self.infohash) def update_torrent_id(self, torrent_id): diff --git a/Tribler/Main/tribler_main.py b/Tribler/Main/tribler_main.py index 025ab4206f4..524b163c170 100755 --- a/Tribler/Main/tribler_main.py +++ b/Tribler/Main/tribler_main.py @@ -790,12 +790,13 @@ def sesscb_ntfy_torrentupdates(self, events): torrent = t.torrent if isinstance(t, CollectedTorrent) else t self.frame.librarydetailspanel.setTorrent(torrent) - def sesscb_ntfy_torrentfinished(self, subject, changeType, infohash, *args): + def sesscb_ntfy_torrentfinished(self, subject, changeType, objectID, *args): self.guiUtility.Notify( "Download Completed", "Torrent '%s' has finished downloading. Now seeding." % args[0], icon='seed') if self._frame_and_ready(): + infohash = objectID torrent = self.guiUtility.torrentsearch_manager.getTorrentByInfohash(infohash) # Check if we got the actual torrent as the bandwith investor # downloads aren't going to be there. diff --git a/Tribler/Main/vwxGUI/GuiUtility.py b/Tribler/Main/vwxGUI/GuiUtility.py index 8121667af5e..40a448cd957 100644 --- a/Tribler/Main/vwxGUI/GuiUtility.py +++ b/Tribler/Main/vwxGUI/GuiUtility.py @@ -251,34 +251,11 @@ def ShowPage(self, page, *args): self.frame.librarylist.Show(False) if page == 'creditmining': - # Show list - # self.frame.creditmininglist.Show(True) - # - # # Open infohash - # if args: - # self.frame.creditmininglist.GetManager().refresh_or_expand(args[0]) - # else: - # items = self.frame.creditmininglist.GetExpandedItems() - # if items: - # items[0][1].expanded = False - # self.frame.creditmininglist.Select(items[0][0]) - # - # # Open infohash - # if args: - # self.frame.creditmininglist.GetManager().refresh_or_expand(args[0]) - self.frame.creditminingpanel.Show(True) elif self.guiPage == 'creditmining': self.frame.creditminingpanel.Show(False) - if page == 'cmbeta': - # Show list - self.frame.creditminingpanel.Show(True) - elif self.guiPage == 'cmbeta': - # Hide list - self.frame.creditminingpanel.Show(False) - if page == 'home': self.frame.home.ResetSearchBox() self.frame.home.Show() @@ -682,8 +659,7 @@ def toggleFamilyFilter(self, newState=None, setCheck=False): if setCheck: self.frame.SRstatusbar.ff_checkbox.SetValue(newState) - # we don't use this panel in credit mining - # self.frame.home.aw_panel.refreshNow() + self.frame.home.aw_panel.refreshNow() if newState: self.utility.write_config('family_filter', 1) diff --git a/Tribler/Main/vwxGUI/MainFrame.py b/Tribler/Main/vwxGUI/MainFrame.py index ee8f7059d47..c793fe4a407 100644 --- a/Tribler/Main/vwxGUI/MainFrame.py +++ b/Tribler/Main/vwxGUI/MainFrame.py @@ -190,8 +190,6 @@ def __init__(self, abc, parent, internalvideo): self.searchlist.Show(False) self.librarylist = LibraryList(self.splitter_top_window) self.librarylist.Show(False) - # self.creditmininglist = CreditMiningList(self) - # self.creditmininglist.Show(False) self.channellist = ChannelList(self.splitter_top_window) self.channellist.Show(False) self.selectedchannellist = SelectedChannelList(self.splitter_top_window) @@ -245,9 +243,6 @@ def OnShowSplitter(event): event.Skip() self.splitter.Bind(wx.EVT_SHOW, OnShowSplitter) - # self.creditmininglist = CreditMiningList(self) - # self.creditmininglist.Show(False) - self.stats = Stats(self) self.stats.Show(False) self.managechannel = ManageChannel(self) @@ -271,7 +266,6 @@ def OnShowSplitter(event): hSizer.Add(self.stats, 1, wx.EXPAND) hSizer.Add(self.networkgraph, 1, wx.EXPAND) hSizer.Add(self.splitter, 1, wx.EXPAND) - # hSizer.Add(self.creditmininglist, 1, wx.EXPAND) hSizer.Add(self.managechannel, 1, wx.EXPAND) diff --git a/Tribler/Main/vwxGUI/list.py b/Tribler/Main/vwxGUI/list.py index 9aaaea25cb0..a6c3b5c2274 100644 --- a/Tribler/Main/vwxGUI/list.py +++ b/Tribler/Main/vwxGUI/list.py @@ -2524,8 +2524,6 @@ def __SetData(self): if sys.platform != 'darwin': data_list.append((6, ['Videoplayer'], None, ActivityListItem)) - # data_list.append((7, ['CM List beta'], None, ActivityListItem)) - self.list.SetData(data_list) self.ResizeListItems() self.DisableItem(2) @@ -2535,8 +2533,6 @@ def __SetData(self): self.DisableCollapse() self.selectTab('home') - # self.list.GetItem(7).num_items.Show(False) - # Create expanded panels in advance channels_item = self.list.GetItem(3) self.expandedPanel_channels = ChannelsExpandedPanel(channels_item) @@ -2626,8 +2622,6 @@ def OnExpand(self, item): return self.expandedPanel_videoplayer elif item.data[0] == 'Credit Mining': self.guiutility.ShowPage('creditmining') - elif item.data[0] == 'CM List beta': - self.guiutility.ShowPage('cmbeta') return True def OnCollapse(self, item, panel, from_expand): @@ -2693,10 +2687,9 @@ def selectTab(self, tab): elif tab == 'my_files': itemKey = 4 elif tab == 'videoplayer': - itemKey = 5 itemKey = 6 - # elif tab == 'cmbeta': - # itemKey = 7 + elif tab == 'creditmining': + itemKey = 5 if itemKey: wx.CallAfter(self.Select, itemKey, True) return @@ -2717,7 +2710,7 @@ def _DoPage(self, increment): if curPage < 0: curPage = len(pages) - 1 - pageNames = ['home', 'search_results', 'channels', 'my_files', 'creditmining', 'videoplayer']#, 'cmbeta'] + pageNames = ['home', 'search_results', 'channels', 'my_files', 'creditmining', 'videoplayer'] for i in self.settings.keys(): pageNames.pop(i - 1) self.guiutility.ShowPage(pageNames[curPage]) diff --git a/Tribler/Main/vwxGUI/list_item.py b/Tribler/Main/vwxGUI/list_item.py index 71e5d78d570..1163588acef 100644 --- a/Tribler/Main/vwxGUI/list_item.py +++ b/Tribler/Main/vwxGUI/list_item.py @@ -1139,7 +1139,7 @@ def __init__(self, *args, **kwargs): def AddComponents(self, leftSpacer, rightSpacer): ListItem.AddComponents(self, leftSpacer, rightSpacer) - if self.data[0] in ['Results', 'Channels', 'Downloads', 'Credit Mining', 'Videoplayer', 'CM List beta']: + if self.data[0] in ['Results', 'Channels', 'Downloads', 'Credit Mining', 'Videoplayer']: self.num_items = TagText(self, -1, label='0', fill_colour=GRADIENT_DGREY, edge_colour=SEPARATOR_GREY) self.hSizer.Add(self.num_items, 0, wx.CENTER | wx.RIGHT, 5) self.hSizer.Layout() diff --git a/Tribler/bootstraptribler.txt b/Tribler/bootstraptribler.txt new file mode 100644 index 00000000000..cff68bfa681 --- /dev/null +++ b/Tribler/bootstraptribler.txt @@ -0,0 +1,42 @@ +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 +127.0.0.1 0 diff --git a/Tribler/dispersy b/Tribler/dispersy index d056b388836..99cfaa0757a 160000 --- a/Tribler/dispersy +++ b/Tribler/dispersy @@ -1 +1 @@ -Subproject commit d056b388836cec227f6752683045534325b5b5e4 +Subproject commit 99cfaa0757aa019e1ce17ad00d65b92ccf7802dd