More changes for consistent naming of download location

This commit is contained in:
Calum Lind 2014-08-09 14:48:58 +01:00
parent a1bc11ec09
commit dc7a4df39a
12 changed files with 38 additions and 61 deletions

View File

@ -1057,7 +1057,7 @@ class TorrentManager(component.Component):
return
# Set an Error message and pause the torrent
alert_msg = decode_string(alert.message()).split(':', 1)[1].strip()
torrent.set_error_statusmsg("Failed to move storage: %s" % alert_msg)
torrent.set_error_statusmsg("Failed to move download folder: %s" % alert_msg)
torrent.moving_storage = False
torrent.pause()
torrent.update_state()

View File

@ -251,7 +251,7 @@ it will be added to the session.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
the .torrent will be deleted.</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
@ -273,7 +273,7 @@ the .torrent will be deleted.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
an extension will be appended to the .torrent
and it will remain in the same directory.</property>
<property name="use_action_appearance">False</property>
@ -323,7 +323,7 @@ and it will remain in the same directory.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
<property name="tooltip" translatable="yes">Once the torrent is added to the session,
the .torrent will copied to the chosen directory
and deleted from the watch folder.</property>
<property name="use_action_appearance">False</property>
@ -378,7 +378,7 @@ and deleted from the watch folder.</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Once the torrent is deleted from the session,
<property name="tooltip" translatable="yes">Once the torrent is deleted from the session,
also delete the .torrent file used to add it.</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
@ -438,11 +438,11 @@ also delete the .torrent file used to add it.</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkCheckButton" id="download_location_toggle">
<property name="label" translatable="yes">Set download location</property>
<property name="label" translatable="yes">Set download folder</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">This directory will be the download location</property>
<property name="tooltip" translatable="yes">This folder will be where the torrent data is downloaded to.</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
@ -502,7 +502,7 @@ also delete the .torrent file used to add it.</property>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Download Location&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Download Folder&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
@ -533,7 +533,7 @@ also delete the .torrent file used to add it.</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkCheckButton" id="move_completed_toggle">
<property name="label" translatable="yes">Set move completed location</property>
<property name="label" translatable="yes">Set move completed folder</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>

View File

@ -206,7 +206,7 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
}]
}]
}, {
title: _('Location'),
title: _('Folders'),
items: [{
border: false,
items: [{
@ -218,7 +218,7 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
xtype: 'checkbox',
name: 'apply_move_completed',
fieldLabel: '',
boxLabel: _('Apply location settings:'),
boxLabel: _('Apply folder settings:'),
listeners: {
check: this.onFieldChecked
}

View File

@ -769,7 +769,7 @@
</child>
<child>
<widget class="GtkCheckButton" id="apply_move_completed">
<property name="label" translatable="yes">Apply location settings:</property>
<property name="label" translatable="yes">Apply folder settings:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@ -789,7 +789,7 @@
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Location</property>
<property name="label" translatable="yes">Folders</property>
</widget>
<packing>
<property name="position">2</property>

View File

@ -1,46 +1,19 @@
#
# add.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from twisted.internet import defer
from deluge.ui.console.main import BaseCommand
import deluge.ui.console.colors as colors
from deluge.ui.client import client
import deluge.component as component
import deluge.common
from deluge.ui.common import TorrentInfo
from optparse import make_option
import os
@ -48,14 +21,14 @@ import base64
from urllib import url2pathname
from urlparse import urlparse
class Command(BaseCommand):
"""Add a torrent"""
option_list = BaseCommand.option_list + (
make_option('-p', '--path', dest='path',
help='save path for torrent'),
make_option('-p', '--path', dest='path', help='download folder for torrent'),
)
usage = "Usage: add [-p <save-location>] <torrent-file> [<torrent-file> ...]\n"\
usage = "Usage: add [-p <download-folder>] <torrent-file> [<torrent-file> ...]\n"\
" <torrent-file> arguments can be file paths, URLs or magnet uris"
def handle(self, *args, **options):
@ -70,6 +43,7 @@ class Command(BaseCommand):
self.console.write("{!error!}Torrent was not added: Already in session")
else:
self.console.write("{!success!}Torrent added!")
def on_fail(result):
self.console.write("{!error!}Torrent was not added: %s" % result)
@ -80,10 +54,12 @@ class Command(BaseCommand):
continue
if deluge.common.is_url(arg):
self.console.write("{!info!}Attempting to add torrent from url: %s" % arg)
deferreds.append(client.core.add_torrent_url(arg, t_options).addCallback(on_success).addErrback(on_fail))
deferreds.append(client.core.add_torrent_url(arg, t_options).addCallback(on_success).addErrback(
on_fail))
elif deluge.common.is_magnet(arg):
self.console.write("{!info!}Attempting to add torrent from magnet uri: %s" % arg)
deferreds.append(client.core.add_torrent_magnet(arg, t_options).addCallback(on_success).addErrback(on_fail))
deferreds.append(client.core.add_torrent_magnet(arg, t_options).addCallback(on_success).addErrback(
on_fail))
else:
# Just a file
if urlparse(arg).scheme == "file":
@ -98,9 +74,10 @@ class Command(BaseCommand):
self.console.write("{!info!}Attempting to add torrent: %s" % path)
filename = os.path.split(path)[-1]
filedump = base64.encodestring(open(path, "rb").read())
deferreds.append(client.core.add_torrent_file(filename, filedump, t_options).addCallback(on_success).addErrback(on_fail))
deferreds.append(client.core.add_torrent_file(filename, filedump, t_options).addCallback(
on_success).addErrback(on_fail))
return defer.DeferredList(deferreds)
def complete(self, line):
return component.get("ConsoleUI").tab_complete_path(line, ext=".torrent", sort="date")
return component.get("ConsoleUI").tab_complete_path(line, ext=".torrent", sort="date")

View File

@ -130,7 +130,7 @@ class DelugeHelpFormatter (optparse.IndentedHelpFormatter):
"<tab>": "{!white!}%s{!input!}",
"[_A-Z]{3,}": "{!cyan!}%s{!input!}",
"<save-location>": "{!yellow!}%s{!input!}",
"<download-folder>": "{!yellow!}%s{!input!}",
"<torrent-file>": "{!green!}%s{!input!}"
}

View File

@ -485,7 +485,7 @@ class AddTorrents(BaseMode, component.Component):
self.popup.add_text(msg)
self.popup.add_spaces(1)
self.popup.add_text_input("Save Location:","location", dl)
self.popup.add_text_input("Download Folder:","location", dl)
self.popup.add_select_input("Add Paused:","add_paused",["Yes","No"],[True,False],ap)

View File

@ -391,7 +391,7 @@
<object class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Download Location</property>
<property name="label" translatable="yes">Download Folder</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@ -446,7 +446,7 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Move Complete Location</property>
<property name="label" translatable="yes">Move Complete Folder</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>

View File

@ -48,7 +48,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_show_file">
<property name="label" translatable="yes">_Show In Folder</property>
<property name="label" translatable="yes">_Show</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>

View File

@ -64,7 +64,7 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
});
this.moveLocation = this.form.add({
fieldLabel: _('Location'),
fieldLabel: _('Download Folder'),
name: 'location',
width: 240
});

View File

@ -213,7 +213,7 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
text: ' ',
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-freespace',
tooltip: _('Freespace in download location'),
tooltip: _('Freespace in download folder'),
handler: function() {
deluge.preferences.show();
deluge.preferences.selectPage('Downloads');

View File

@ -52,7 +52,7 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
var fieldset = this.add({
xtype: 'fieldset',
title: _('Download Location'),
title: _('Download Folder'),
border: false,
autoHeight: true,
defaultType: 'textfield',
@ -68,7 +68,7 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
}));
var fieldset = this.add({
xtype: 'fieldset',
title: _('Move Completed Location'),
title: _('Move Completed Folder'),
border: false,
autoHeight: true,
defaultType: 'togglefield',