Skip to content

Commit

Permalink
Merge pull request #263 from torikulhabib/master
Browse files Browse the repository at this point in the history
Tooltips
  • Loading branch information
torikulhabib authored Jun 19, 2024
2 parents 82b9620 + 13716dc commit 88031ea
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 62 deletions.
38 changes: 17 additions & 21 deletions src/AddUrl.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -377,6 +375,7 @@ namespace Gabut {
};

port_entry = new Gtk.SpinButton.with_range (0, 999999, 1) {
tooltip_text = _("Port"),
width_request = 250
};

Expand Down Expand Up @@ -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,
Expand All @@ -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 ()) {
Expand Down Expand Up @@ -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,
Expand All @@ -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 ()) {
Expand Down Expand Up @@ -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
Expand All @@ -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
};
Expand Down
1 change: 1 addition & 0 deletions src/FileAllocation.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions src/GabutWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ namespace Gabut {
}
set {
_deascend = value;
set_dbsetting (DBSettings.ASCEDESCEN, _deascend.to_string ());
}
}

Expand Down Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/PieceSelector.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 88031ea

Please sign in to comment.