Skip to content

Commit ddc44bf

Browse files
authored
Merge pull request #266 from torikulhabib/master
Fix
2 parents 00f5b7a + f3b631a commit ddc44bf

File tree

6 files changed

+56
-81
lines changed

6 files changed

+56
-81
lines changed

data/com.github.gabutakut.gabutdm.appdata.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<binary>com.github.gabutakut.gabutdm</binary>
3232
</provides>
3333
​ <releases>
34-
<release version="2.2.5" date="2024-6-19">
34+
<release version="2.2.6" date="2024-6-19">
3535
<description>
3636
<p>Replace Treeview to Listbox</p>
3737
<p>Remove and replace Deprecated library</p>

data/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ actions = [
4242
'.cookie.svg',
4343
'.opt.svg',
4444
'.menu.svg',
45-
'.onactive.svg',
45+
'.onactive.svg'
4646
]
4747

4848
foreach m : actions

src/AddUrl.vala

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,8 @@ namespace Gabut {
321321

322322
method_flow = new Gtk.FlowBox ();
323323
var method_popover = new Gtk.Popover () {
324-
position = Gtk.PositionType.TOP,
325-
width_request = 70,
326324
child = method_flow
327325
};
328-
method_popover.show.connect (() => {
329-
if (proxymethod != null) {
330-
method_flow.select_child (proxymethod);
331-
proxymethod.grab_focus ();
332-
}
333-
});
334326
prometh_button = new Gtk.MenuButton () {
335327
popover = method_popover
336328
};
@@ -339,23 +331,20 @@ namespace Gabut {
339331
}
340332
method_flow.show ();
341333
method_flow.child_activated.connect ((method)=> {
334+
((Gtk.Label)((ProxyMethod) proxymethod).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
342335
proxymethod = method as ProxyMethod;
336+
((Gtk.Label)proxymethod.get_last_child ()).attributes = color_attribute (0, 60000, 0);
343337
method_popover.hide ();
344338
});
345339
proxymethod = method_flow.get_child_at_index (0) as ProxyMethod;
346-
340+
((Gtk.Label)proxymethod.get_last_child ()).attributes = color_attribute (0, 60000, 0);
341+
method_popover.show.connect (() => {
342+
method_flow.unselect_all ();
343+
});
347344
type_flow = new Gtk.FlowBox ();
348345
var type_popover = new Gtk.Popover () {
349-
position = Gtk.PositionType.TOP,
350-
width_request = 70,
351346
child = type_flow
352347
};
353-
type_popover.show.connect (() => {
354-
if (proxytype != null) {
355-
type_flow.select_child (proxytype);
356-
proxytype.grab_focus ();
357-
}
358-
});
359348
type_button = new Gtk.MenuButton () {
360349
popover = type_popover
361350
};
@@ -364,11 +353,16 @@ namespace Gabut {
364353
}
365354
type_flow.show ();
366355
type_flow.child_activated.connect ((typepr)=> {
356+
((Gtk.Label)((ProxyType) proxytype).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
367357
proxytype = typepr as ProxyType;
358+
((Gtk.Label)proxytype.get_last_child ()).attributes = color_attribute (0, 60000, 0);
368359
type_popover.hide ();
369360
});
370361
proxytype = type_flow.get_child_at_index (0) as ProxyType;
371-
362+
((Gtk.Label)proxytype.get_last_child ()).attributes = color_attribute (0, 60000, 0);
363+
type_popover.show.connect (() => {
364+
type_flow.unselect_all ();
365+
});
372366
proxy_entry = new MediaEntry ("com.github.gabutakut.gabutdm.gohome", "edit-paste") {
373367
width_request = 250,
374368
placeholder_text = _("Address")
@@ -408,16 +402,8 @@ namespace Gabut {
408402

409403
login_flow = new Gtk.FlowBox ();
410404
var login_popover = new Gtk.Popover () {
411-
position = Gtk.PositionType.TOP,
412-
width_request = 70,
413405
child = login_flow
414406
};
415-
login_popover.show.connect (() => {
416-
if (loginuser != null) {
417-
login_flow.select_child (loginuser);
418-
loginuser.grab_focus ();
419-
}
420-
});
421407
login_button = new Gtk.MenuButton () {
422408
tooltip_text = _("FTP/HTTP download with username and password"),
423409
popover = login_popover
@@ -428,11 +414,16 @@ namespace Gabut {
428414
login_flow.show ();
429415

430416
login_flow.child_activated.connect ((logn)=> {
417+
((Gtk.Label)((LoginUser) loginuser).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
431418
loginuser = logn as LoginUser;
419+
((Gtk.Label)loginuser.get_last_child ()).attributes = color_attribute (0, 60000, 0);
432420
login_popover.hide ();
433421
});
434422
loginuser = login_flow.get_child_at_index (0) as LoginUser;
435-
423+
((Gtk.Label)loginuser.get_last_child ()).attributes = color_attribute (0, 60000, 0);
424+
login_popover.show.connect (() => {
425+
login_flow.unselect_all ();
426+
});
436427
loguser_entry = new MediaEntry ("avatar-default", "edit-paste") {
437428
width_request = 350,
438429
placeholder_text = _("User")
@@ -476,16 +467,8 @@ namespace Gabut {
476467

477468
checksums_flow = new Gtk.FlowBox ();
478469
var checksums_popover = new Gtk.Popover () {
479-
position = Gtk.PositionType.TOP,
480-
width_request = 70,
481470
child = checksums_flow
482471
};
483-
checksums_popover.show.connect (() => {
484-
if (checksumtype != null) {
485-
checksums_flow.select_child (checksumtype);
486-
checksumtype.grab_focus ();
487-
}
488-
});
489472
checksum_button = new Gtk.MenuButton () {
490473
tooltip_text = _("TYPE is hash type"),
491474
popover = checksums_popover
@@ -500,11 +483,17 @@ namespace Gabut {
500483
placeholder_text = _("Hash")
501484
};
502485
checksums_flow.child_activated.connect ((checksum)=> {
486+
((Gtk.Label)((ChecksumType) checksumtype).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
503487
checksumtype = checksum as ChecksumType;
488+
((Gtk.Label)checksumtype.get_last_child ()).attributes = color_attribute (0, 60000, 0);
504489
checksums_popover.hide ();
505490
});
506491
checksumtype = checksums_flow.get_child_at_index (0) as ChecksumType;
492+
((Gtk.Label)checksumtype.get_last_child ()).attributes = color_attribute (0, 60000, 0);
507493

494+
checksums_popover.show.connect (() => {
495+
checksums_flow.unselect_all ();
496+
});
508497
var checksumgrid = new Gtk.Grid () {
509498
height_request = 130,
510499
halign = Gtk.Align.CENTER,
@@ -528,17 +517,9 @@ namespace Gabut {
528517

529518
encrypt_flow = new Gtk.FlowBox ();
530519
var encrypt_popover = new Gtk.Popover () {
531-
width_request = 70,
532520
child = encrypt_flow
533521
};
534-
encrypt_popover.show.connect (() => {
535-
if (btencrypt != null) {
536-
encrypt_flow.select_child (btencrypt);
537-
btencrypt.grab_focus ();
538-
}
539-
});
540522
encrypt_button = new Gtk.MenuButton () {
541-
direction = Gtk.ArrowType.UP,
542523
popover = encrypt_popover
543524
};
544525
foreach (var encrp in BTEncrypts.get_all ()) {
@@ -547,11 +528,17 @@ namespace Gabut {
547528
encrypt_flow.show ();
548529

549530
encrypt_flow.child_activated.connect ((encrp)=> {
531+
((Gtk.Label)((BTEncrypt) btencrypt).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
550532
btencrypt = encrp as BTEncrypt;
533+
((Gtk.Label)btencrypt.get_last_child ()).attributes = color_attribute (0, 60000, 0);
551534
encrypt_popover.hide ();
552535
});
553536
btencrypt = encrypt_flow.get_child_at_index (0) as BTEncrypt;
537+
((Gtk.Label)btencrypt.get_last_child ()).attributes = color_attribute (0, 60000, 0);
554538

539+
encrypt_popover.show.connect (() => {
540+
encrypt_flow.unselect_all ();
541+
});
555542
encrypt = new Gtk.CheckButton.with_label (_("BT Require Crypto")) {
556543
tooltip_text = _("Aria2 doesn't accept and establish connection with legacy BitTorrent handshake"),
557544
width_request = 350,

src/Application.vala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ namespace Gabut {
6767
protected override void activate () {
6868
if (gabutwindow == null) {
6969
if (open_database (out gabutdb) != Sqlite.OK) {
70-
notify_app (_("Database Error"), _("Can't open database: %s\n").printf (gabutdb.errmsg ()), new ThemedIcon ("office-database"));
70+
notify_app (_("Database Error"),
71+
_("Can't open database: %s\n").printf (gabutdb.errmsg ()), new ThemedIcon ("office-database"));
7172
play_sound ("dialog-error");
7273
}
7374
settings_table ();

src/ModeButton.vala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,9 @@ namespace Gabut {
8080
return index;
8181
}
8282

83-
private void clear_selected () {
84-
_selected = -1;
85-
foreach (var item in item_map.values) {
86-
if (item != null && item.active) {
87-
item.set_active (false);
88-
}
89-
}
90-
}
91-
9283
public void set_active (int new_active_index) {
9384
if (new_active_index <= -1) {
94-
clear_selected ();
85+
_selected = -1;
9586
return;
9687
}
9788
var new_item = item_map[new_active_index] as Item;

src/Preferences.vala

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,9 @@ namespace Gabut {
173173

174174
var stream_flow = new Gtk.FlowBox ();
175175
var stream_popover = new Gtk.Popover () {
176-
width_request = 70,
177176
child = stream_flow
178177
};
179-
stream_popover.show.connect (() => {
180-
if (pieceselector != null) {
181-
stream_flow.select_child (pieceselector);
182-
pieceselector.grab_focus ();
183-
}
184-
});
178+
185179
piecesel_button = new Gtk.MenuButton () {
186180
direction = Gtk.ArrowType.UP,
187181
tooltip_text = _("Specify piece selection algorithm used in HTTP/FTP download"),
@@ -192,27 +186,26 @@ namespace Gabut {
192186
}
193187
stream_flow.show ();
194188
stream_flow.child_activated.connect ((piecesel)=> {
189+
((Gtk.Label)((PieceSelector) pieceselector).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
195190
pieceselector = piecesel as PieceSelector;
191+
((Gtk.Label)pieceselector.get_last_child ()).attributes = color_attribute (0, 60000, 0);
196192
stream_popover.hide ();
197193
});
198194
for (int a = 0; a <= PieceSelectors.GEOM; a++) {
199195
var piecesel = stream_flow.get_child_at_index (a);
200196
if (((PieceSelector) piecesel).selector.to_string ().down () == pharse_options (pack_data, AriaOptions.STREAM_PIECE_SELECTOR)) {
201197
pieceselector = piecesel as PieceSelector;
198+
((Gtk.Label)pieceselector.get_last_child ()).attributes = color_attribute (0, 60000, 0);
202199
}
203200
}
204-
201+
stream_popover.show.connect (() => {
202+
stream_flow.unselect_all ();
203+
});
205204
var urisel_flow = new Gtk.FlowBox ();
206205
var urisel_popover = new Gtk.Popover () {
207-
width_request = 70,
208206
child = urisel_flow
209207
};
210-
urisel_popover.show.connect (() => {
211-
if (uriselector != null) {
212-
urisel_flow.select_child (uriselector);
213-
uriselector.grab_focus ();
214-
}
215-
});
208+
216209
urisel_button = new Gtk.MenuButton () {
217210
direction = Gtk.ArrowType.UP,
218211
tooltip_text = _("Specify URI selection algorithm"),
@@ -223,16 +216,21 @@ namespace Gabut {
223216
}
224217
urisel_flow.show ();
225218
urisel_flow.child_activated.connect ((urisel)=> {
219+
((Gtk.Label)((UriSelector) uriselector).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
226220
uriselector = urisel as UriSelector;
221+
((Gtk.Label)uriselector.get_last_child ()).attributes = color_attribute (0, 60000, 0);
227222
urisel_popover.hide ();
228223
});
229224
for (int a = 0; a <= UriSelectors.ADAPTIVE; a++) {
230225
var urisel = urisel_flow.get_child_at_index (a);
231226
if (((UriSelector) urisel).selector.to_string ().down () == pharse_options (pack_data, AriaOptions.URI_SELECTOR)) {
232227
uriselector = urisel as UriSelector;
228+
((Gtk.Label)uriselector.get_last_child ()).attributes = color_attribute (0, 60000, 0);
233229
}
234230
}
235-
231+
urisel_popover.show.connect (() => {
232+
urisel_flow.unselect_all ();
233+
});
236234
var settings = new Gtk.Grid () {
237235
column_homogeneous = true,
238236
height_request = 150,
@@ -586,16 +584,9 @@ namespace Gabut {
586584

587585
var allocate_flow = new Gtk.FlowBox ();
588586
var allocate_popover = new Gtk.Popover () {
589-
position = Gtk.PositionType.TOP,
590-
width_request = 70,
591587
child = allocate_flow
592588
};
593-
allocate_popover.show.connect (() => {
594-
if (fileallocation != null) {
595-
allocate_flow.select_child (fileallocation);
596-
fileallocation.grab_focus ();
597-
}
598-
});
589+
599590
allocate_button = new Gtk.MenuButton () {
600591
tooltip_text = _("Specify file allocation method"),
601592
popover = allocate_popover
@@ -605,16 +596,21 @@ namespace Gabut {
605596
}
606597
allocate_flow.show ();
607598
allocate_flow.child_activated.connect ((allocate)=> {
599+
((Gtk.Label)((FileAllocation) fileallocation).get_last_child ()).attributes = set_attribute (Pango.Weight.BOLD);
608600
fileallocation = allocate as FileAllocation;
601+
((Gtk.Label)fileallocation.get_last_child ()).attributes = color_attribute (0, 60000, 0);
609602
allocate_popover.hide ();
610603
});
611604
for (int a = 0; a <= FileAllocations.FALLOC; a++) {
612605
var allocate = allocate_flow.get_child_at_index (a);
613606
if (((FileAllocation) allocate).fileallocation.to_string ().down () == pharse_options (pack_data, AriaOptions.FILE_ALLOCATION)) {
614607
fileallocation = allocate as FileAllocation;
608+
((Gtk.Label)fileallocation.get_last_child ()).attributes = color_attribute (0, 60000, 0);
615609
}
616610
}
617-
611+
allocate_popover.show.connect (() => {
612+
allocate_flow.unselect_all ();
613+
});
618614
var moreoptions = new Gtk.Grid () {
619615
column_homogeneous = true,
620616
height_request = 150,

0 commit comments

Comments
 (0)