diff --git a/src/AddUrl.vala b/src/AddUrl.vala index 33da288..6aad3ca 100644 --- a/src/AddUrl.vala +++ b/src/AddUrl.vala @@ -183,7 +183,9 @@ namespace Gabut { header.title_widget = view_mode; header.decoration_layout = "none"; - folder_location = new Gtk.Button (); + folder_location = new Gtk.Button () { + tooltip_text = _("The directory to store the downloaded file") + }; folder_location.clicked.connect (()=> { run_open_fd.begin (this, OpenFiles.OPENPERDONLOADFOLDER, (obj, res)=> { try { @@ -207,7 +209,9 @@ namespace Gabut { }); ((Gtk.Label) usefolder.get_last_child ()).attributes = set_attribute (Pango.Weight.SEMIBOLD); folder_location.sensitive = usefolder.active; - cookie_location = new Gtk.Button (); + cookie_location = new Gtk.Button () { + tooltip_text = _("Load cookie a text file") + }; cookie_location.clicked.connect (()=> { run_open_all.begin (this, OpenFiles.OPENCOOKIES, (obj, res)=> { try { @@ -315,10 +319,7 @@ namespace Gabut { alllink.attach (foldergrid, 1, 5, 1, 1); alllink.attach (metaoverlay, 2, 0, 1, 5); - method_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + method_flow = new Gtk.FlowBox (); var method_popover = new Gtk.Popover () { position = Gtk.PositionType.TOP, width_request = 70, @@ -343,10 +344,7 @@ namespace Gabut { }); proxymethod = method_flow.get_child_at_index (0) as ProxyMethod; - type_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70, - }; + type_flow = new Gtk.FlowBox (); var type_popover = new Gtk.Popover () { position = Gtk.PositionType.TOP, width_request = 70, @@ -377,6 +375,7 @@ namespace Gabut { }; port_entry = new Gtk.SpinButton.with_range (0, 999999, 1) { + tooltip_text = _("Port"), width_request = 250 }; @@ -407,10 +406,7 @@ namespace Gabut { proxygrid.attach (headerlabel (_("Password:"), 250), 1, 4, 1, 1); proxygrid.attach (pass_entry, 1, 5, 1, 1); - login_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + login_flow = new Gtk.FlowBox (); var login_popover = new Gtk.Popover () { position = Gtk.PositionType.TOP, width_request = 70, @@ -423,6 +419,7 @@ namespace Gabut { } }); login_button = new Gtk.MenuButton () { + tooltip_text = _("FTP/HTTP download with username and password"), popover = login_popover }; foreach (var logn in LoginUsers.get_all ()) { @@ -477,9 +474,7 @@ namespace Gabut { moregrid.attach (headerlabel (_("Referer:"), 350), 1, 2, 1, 1); moregrid.attach (refer_entry, 1, 3, 1, 1); - checksums_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL - }; + checksums_flow = new Gtk.FlowBox (); var checksums_popover = new Gtk.Popover () { position = Gtk.PositionType.TOP, width_request = 70, @@ -492,6 +487,7 @@ namespace Gabut { } }); checksum_button = new Gtk.MenuButton () { + tooltip_text = _("TYPE is hash type"), popover = checksums_popover }; foreach (var checksum in AriaChecksumTypes.get_all ()) { @@ -520,18 +516,17 @@ namespace Gabut { checksumgrid.attach (checksum_entry, 1, 3, 1, 1); integrity = new Gtk.CheckButton.with_label (_("BT Seed")) { + tooltip_text = _("Check file integrity by validating piece hashes or a hash of entire file."), width_request = 350, margin_bottom = 5 }; unverified = new Gtk.CheckButton.with_label (_("BT Seed Unverified")) { + tooltip_text = _("Seed previously downloaded files without verifying piece hashes"), width_request = 350 }; - encrypt_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + encrypt_flow = new Gtk.FlowBox (); var encrypt_popover = new Gtk.Popover () { width_request = 70, child = encrypt_flow @@ -558,6 +553,7 @@ namespace Gabut { btencrypt = encrypt_flow.get_child_at_index (0) as BTEncrypt; encrypt = new Gtk.CheckButton.with_label (_("BT Require Crypto")) { + tooltip_text = _("Aria2 doesn't accept and establish connection with legacy BitTorrent handshake"), width_request = 350, margin_bottom = 5 }; diff --git a/src/FileAllocation.vala b/src/FileAllocation.vala index f300cda..8259d28 100755 --- a/src/FileAllocation.vala +++ b/src/FileAllocation.vala @@ -30,6 +30,7 @@ namespace Gabut { halign = Gtk.Align.CENTER, wrap_mode = Pango.WrapMode.WORD_CHAR, attributes = set_attribute (Pango.Weight.BOLD), + tooltip_text = fileallocation.to_tooltip (), margin_top = 6, margin_bottom = 6, margin_start = 12, diff --git a/src/GabutWindow.vala b/src/GabutWindow.vala index b959fee..e8f3184 100644 --- a/src/GabutWindow.vala +++ b/src/GabutWindow.vala @@ -69,7 +69,6 @@ namespace Gabut { } set { _deascend = value; - set_dbsetting (DBSettings.ASCEDESCEN, _deascend.to_string ()); } } @@ -273,6 +272,7 @@ namespace Gabut { use_markup = true, width_request = 60, valign = Gtk.Align.CENTER, + tooltip_text = _("Download Speed"), attributes = color_attribute (0, 60000, 0) }; var img_upload = new Gtk.Image () { @@ -285,6 +285,7 @@ namespace Gabut { use_markup = true, width_request = 60, valign = Gtk.Align.CENTER, + tooltip_text = _("Upload Speed"), attributes = color_attribute (60000, 0, 0) }; var gridinf = new Gtk.Grid () { @@ -627,6 +628,7 @@ namespace Gabut { dsasc.notify["id"].connect (()=> { sort_popover.hide (); deascend = (DeAscend) dsasc.id; + set_dbsetting (DBSettings.ASCEDESCEN, dsasc.id.to_string ()); list_box.set_sort_func ((Gtk.ListBoxSortFunc) sort_dm); listrow.sort (sort_dm); }); @@ -663,8 +665,7 @@ namespace Gabut { sorttype = sort_flow.get_child_at_index (int.parse (get_dbsetting (DBSettings.SORTBY))) as SortBy; ((Gtk.Label)sorttype.get_last_child ()).attributes = color_attribute (0, 60000, 0); sort_popover.show.connect (() => { - sort_flow.select_child (sorttype); - sorttype.grab_focus (); + sort_flow.unselect_all (); }); return sort_popover; } diff --git a/src/PieceSelector.vala b/src/PieceSelector.vala index 4ade1f2..31ec0e3 100755 --- a/src/PieceSelector.vala +++ b/src/PieceSelector.vala @@ -30,6 +30,7 @@ namespace Gabut { halign = Gtk.Align.CENTER, wrap_mode = Pango.WrapMode.WORD_CHAR, attributes = set_attribute (Pango.Weight.BOLD), + tooltip_text = selector.to_tooltip (), margin_top = 6, margin_bottom = 6, margin_start = 12, diff --git a/src/Preferences.vala b/src/Preferences.vala index c389f05..317c738 100644 --- a/src/Preferences.vala +++ b/src/Preferences.vala @@ -118,55 +118,60 @@ namespace Gabut { var numbtries = new Gtk.SpinButton.with_range (0, 100, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Number of tries"), value = double.parse (pharse_options (pack_data, AriaOptions.MAX_TRIES)) }; var numbconn = new Gtk.SpinButton.with_range (0, 16, 1) { width_request = 220, hexpand = true, + tooltip_text = _("The maximum number of connections to one server for each download"), value = double.parse (pharse_options (pack_data, AriaOptions.MAX_CONNECTION_PER_SERVER)) }; var maxcurrent = new Gtk.SpinButton.with_range (1, 50, 1) { width_request = 220, hexpand = true, + tooltip_text = _("The maximum number of parallel downloads for every queue item"), value = double.parse (pharse_options (pack_data, AriaOptions.MAX_CONCURRENT_DOWNLOADS)) }; var timeout = new Gtk.SpinButton.with_range (0, 600, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Timeout"), value = double.parse (pharse_options (pack_data, AriaOptions.TIMEOUT)) }; var retry = new Gtk.SpinButton.with_range (0, 600, 1) { width_request = 220, hexpand = true, + tooltip_text = _("The seconds to wait between retries"), value = double.parse (pharse_options (pack_data, AriaOptions.RETRY_WAIT)) }; var split = new Gtk.SpinButton.with_range (0, 6000, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously."), value = double.parse (pharse_options (pack_data, AriaOptions.SPLIT)) }; var splitsize = new Gtk.SpinButton.with_range (0, 9999999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Split"), value = double.parse (pharse_options (pack_data, AriaOptions.MIN_SPLIT_SIZE)) / 1024 }; var lowestspd = new Gtk.SpinButton.with_range (0, 9999999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Close connection if download speed is lower than or equal to this value(bytes per sec)"), value = double.parse (pharse_options (pack_data, AriaOptions.LOWEST_SPEED_LIMIT)) / 1024 }; - var stream_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + var stream_flow = new Gtk.FlowBox (); var stream_popover = new Gtk.Popover () { width_request = 70, child = stream_flow @@ -179,6 +184,7 @@ namespace Gabut { }); piecesel_button = new Gtk.MenuButton () { direction = Gtk.ArrowType.UP, + tooltip_text = _("Specify piece selection algorithm used in HTTP/FTP download"), popover = stream_popover }; foreach (var piecesel in PieceSelectors.get_all ()) { @@ -196,10 +202,7 @@ namespace Gabut { } } - var urisel_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + var urisel_flow = new Gtk.FlowBox (); var urisel_popover = new Gtk.Popover () { width_request = 70, child = urisel_flow @@ -212,6 +215,7 @@ namespace Gabut { }); urisel_button = new Gtk.MenuButton () { direction = Gtk.ArrowType.UP, + tooltip_text = _("Specify URI selection algorithm"), popover = urisel_popover }; foreach (var urisel in UriSelectors.get_all ()) { @@ -262,40 +266,47 @@ namespace Gabut { var maxopfile = new Gtk.SpinButton.with_range (0, 200, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Specify maximum number of files to open in multi-file BitTorrent/Metalink download globally"), value = double.parse (pharse_options (pack_data, AriaOptions.BT_MAX_OPEN_FILES)) }; var maxpeers = new Gtk.SpinButton.with_range (0, 200, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Specify the maximum number of peers per torrent"), value = double.parse (pharse_options (pack_data, AriaOptions.BT_MAX_PEERS)) }; var bt_timeout = new Gtk.SpinButton.with_range (0, 240, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Timeout"), value = double.parse (pharse_options (pack_data, AriaOptions.BT_TRACKER_TIMEOUT)) }; var bt_seedtime = new Gtk.SpinButton.with_range (0, 240, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Specify seeding time in (fractional) minutes"), value = double.parse (pharse_options (pack_data, AriaOptions.SEED_TIME)) }; var bt_upload = new Gtk.SpinButton.with_range (0, 999999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Max overall upload speed"), value = double.parse (pharse_options (pack_data, AriaOptions.MAX_OVERALL_UPLOAD_LIMIT)) / 1024 }; var bt_download = new Gtk.SpinButton.with_range (0, 999999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Max overall download speed "), value = double.parse (pharse_options (pack_data, AriaOptions.MAX_OVERALL_DOWNLOAD_LIMIT)) / 1024 }; var trackertext = new Gtk.TextView () { - wrap_mode = Gtk.WrapMode.WORD_CHAR + wrap_mode = Gtk.WrapMode.WORD_CHAR, + tooltip_text = _("Comma separated list of additional BitTorrent tracker's announce URI") }; trackertext.buffer.text = pharse_options (pack_data, AriaOptions.BT_TRACKER).replace ("\\/", "/"); @@ -355,7 +366,8 @@ namespace Gabut { layout_track.attach (action_track, 0, 1); var etrackertext = new Gtk.TextView () { - wrap_mode = Gtk.WrapMode.WORD_CHAR + wrap_mode = Gtk.WrapMode.WORD_CHAR, + tooltip_text = _("Comma separated list of BitTorrent tracker's announce URI to remove") }; etrackertext.buffer.text = pharse_options (pack_data, AriaOptions.BT_EXCLUDE_TRACKER).replace ("\\/", "/"); @@ -437,7 +449,9 @@ namespace Gabut { bittorrent.attach (headerlabel (_("BitTorrent Tracker:"), 220), 0, 6, 1, 1); bittorrent.attach (layout_track, 0, 7, 1, 1); - folder_location = new Gtk.Button (); + folder_location = new Gtk.Button () { + tooltip_text = _("The directory to store the downloaded file") + }; folder_location.clicked.connect (()=> { run_open_fd.begin (this, OpenFiles.OPENGLOBALFOLDER, (obj, res)=> { try { @@ -453,7 +467,9 @@ namespace Gabut { }); selectfd = File.new_for_path (pharse_options (pack_data, AriaOptions.DIR).replace ("\\/", "/")); - folder_sharing = new Gtk.Button (); + folder_sharing = new Gtk.Button () { + tooltip_text = _("The directory is Shared for connected the same Network") + }; folder_sharing.clicked.connect (()=> { run_open_fd.begin (this, OpenFiles.OPENFOLDERSHARING, (obj, res)=> { try { @@ -470,7 +486,7 @@ namespace Gabut { selectfs = File.new_for_path (get_dbsetting (DBSettings.SHAREDIR)); var add_auth = new Gtk.Button.from_icon_name ("list-add") { - tooltip_text = _("Add Authenty") + tooltip_text = _("Add Authenty local server") }; var usergrid = new Gtk.Grid () { @@ -529,43 +545,46 @@ namespace Gabut { var rpc_port = new Gtk.SpinButton.with_range (0, 9999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Specify a port number for JSON-RPC/XML-RPC server to listen to"), value = double.parse (pharse_options (pack_data, AriaOptions.RPC_LISTEN_PORT)) }; var local_port = new Gtk.SpinButton.with_range (0, 9999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("pecify a port number for local server to listen to"), value = double.parse (get_dbsetting (DBSettings.PORTLOCAL)) }; var bt_listenport = new Gtk.SpinButton.with_range (0, 99999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("TCP port number for BitTorrent downloads"), value = double.parse (pharse_options (pack_data, AriaOptions.LISTEN_PORT)) }; var dht_listenport = new Gtk.SpinButton.with_range (0, 99999, 1) { width_request = 220, hexpand = true, + tooltip_text = _("UDP listening port used by DHT(IPv4, IPv6) and UDP tracker"), value = double.parse (pharse_options (pack_data, AriaOptions.DHT_LISTEN_PORT)) }; var maxrequest = new Gtk.SpinButton.with_range (0, 9000000000, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Max size of JSON-RPC/XML-RPC request"), value = double.parse (pharse_options (pack_data, AriaOptions.RPC_MAX_REQUEST_SIZE)) }; var diskcache = new Gtk.SpinButton.with_range (0, 9000000000, 1) { width_request = 220, hexpand = true, + tooltip_text = _("Enable disk cache. If SIZE is 0, the disk cache is disabled"), value = double.parse (pharse_options (pack_data, AriaOptions.DISK_CACHE)) }; - var allocate_flow = new Gtk.FlowBox () { - orientation = Gtk.Orientation.HORIZONTAL, - width_request = 70 - }; + var allocate_flow = new Gtk.FlowBox (); var allocate_popover = new Gtk.Popover () { position = Gtk.PositionType.TOP, width_request = 70, @@ -578,6 +597,7 @@ namespace Gabut { } }); allocate_button = new Gtk.MenuButton () { + tooltip_text = _("Specify file allocation method"), popover = allocate_popover }; foreach (var allocate in FileAllocations.get_all ()) { diff --git a/src/UriSelector.vala b/src/UriSelector.vala index 47b2c1d..f0cc043 100755 --- a/src/UriSelector.vala +++ b/src/UriSelector.vala @@ -30,6 +30,7 @@ namespace Gabut { halign = Gtk.Align.CENTER, wrap_mode = Pango.WrapMode.WORD_CHAR, attributes = set_attribute (Pango.Weight.BOLD), + tooltip_text = selector.to_tooltip (), margin_top = 6, margin_bottom = 6, margin_start = 12, diff --git a/src/Utils.vala b/src/Utils.vala index e283cc0..65a415c 100644 --- a/src/Utils.vala +++ b/src/Utils.vala @@ -1155,13 +1155,26 @@ namespace Gabut { public string to_string () { switch (this) { case PREALLOC: - return "Prealloc"; + return _("Prealloc"); case TRUNC: - return "Trunc"; + return _("Trunc"); case FALLOC: - return "Falloc"; + return _("Falloc"); default: - return "None"; + return _("None"); + } + } + + public string to_tooltip () { + switch (this) { + case PREALLOC: + return _("Pre-allocates file space before download begins"); + case TRUNC: + return _("Uses ftruncate(2) system call or platform-specific counterpart to truncate a file to a specified length"); + case FALLOC: + return _("is your best choice. It allocates large(few GiB) files almost instantly"); + default: + return _("Doesn't pre-allocate file space"); } } @@ -1177,9 +1190,9 @@ namespace Gabut { public string to_string () { switch (this) { case TUNNEL: - return "Tunnel"; + return _("Tunnel"); default: - return "Get"; + return _("Get"); } } @@ -1195,9 +1208,9 @@ namespace Gabut { public string to_string () { switch (this) { case ARC4: - return "Arc4"; + return _("Arc4"); default: - return "Plain"; + return _("Plain"); } } @@ -1213,9 +1226,9 @@ namespace Gabut { public string to_string () { switch (this) { case FTP: - return "FTP"; + return _("FTP"); default: - return "HTTP"; + return _("HTTP"); } } @@ -1233,13 +1246,26 @@ namespace Gabut { public string to_string () { switch (this) { case INORDER: - return "Inorder"; + return _("Inorder"); case RANDOM: - return "Random"; + return _("Random"); case GEOM: - return "Geom"; + return _("Geom"); default: - return "Default"; + return _("Default"); + } + } + + public string to_tooltip () { + switch (this) { + case INORDER: + return _("Select a piece closest to the beginning of the file"); + case RANDOM: + return _("Select a piece randomly"); + case GEOM: + return _("When starting to download a file, select a piece closest to the beginning of the file like inorder, but then exponentially increases space between pieces"); + default: + return _("Select a piece to reduce the number of connections established"); } } @@ -1256,11 +1282,22 @@ namespace Gabut { public string to_string () { switch (this) { case INORDER: - return "Inorder"; + return _("Inorder"); + case ADAPTIVE: + return _("Adaptive"); + default: + return _("Feedback"); + } + } + + public string to_tooltip () { + switch (this) { + case INORDER: + return _("URI is tried in the order appeared in the URI list"); case ADAPTIVE: - return "Adaptive"; + return _("selects one of the best mirrors for the first and reserved connections."); default: - return "Feedback"; + return _("Aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list"); } } @@ -1308,13 +1345,13 @@ namespace Gabut { public string to_string () { switch (this) { case HTTP: - return "HTTP"; + return _("HTTP"); case HTTPS: - return "HTTPS"; + return _("HTTPS"); case FTP: - return "FTP"; + return _("FTP"); default: - return "ALL"; + return _("ALL"); } }