Skip to content

Commit

Permalink
Merge pull request #28 from torikulhabib/master
Browse files Browse the repository at this point in the history
Fix and release
  • Loading branch information
torikulhabib authored Dec 2, 2021
2 parents 491145a + 92103e2 commit 148da50
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 75 deletions.
6 changes: 3 additions & 3 deletions data/com.github.gabutakut.gabutdm.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p>Features:</p>
<ul>
<li>
Gabutakut Download Manager application that can download Metallink Magnetlink Torrents using Aria2c and,
Gabutakut Download Manager application that can download Link URIs Metallink Magnetlink Torrents using Aria2c and,
an application that has a local server service interface.
can also accept file transfers from smartphones.
Made with love and sleep deprivation. :D
Expand All @@ -28,7 +28,7 @@
<binary>com.github.gabutakut.gabutdm</binary>
</provides>
​ <releases>
<release version="1.5.1" date="2021-11-12">
<release version="1.5.8" date="2021-12-2">
<description>
<p>Release</p>
<ul>
Expand Down Expand Up @@ -93,7 +93,7 @@
<url type="bugtracker">http://github.com/gabutakut/gabutdm/issues</url>
<url type="help">http://github.com/gabutakut/gabutdm/issues</url>
<custom>
<value key="x-appcenter-color-primary">#37a400</value>
<value key="x-appcenter-color-primary">#2A7D00</value>
<value key="x-appcenter-color-primary-text">#d1ff82</value>
<value key="x-appcenter-suggested-price">6</value>
</custom>
Expand Down
2 changes: 1 addition & 1 deletion data/com.github.gabutakut.gabutdm.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GenericName=Gabut Download Manager
Exec=com.github.gabutakut.gabutdm %U
Icon=com.github.gabutakut.gabutdm
Terminal=false
Categories=Network;
Categories=Network,P2P,FileTransfer;
Keywords=Torrent;Bittorrent;Magnetlink;Metalink;Download;
MimeType=application/x-bittorrent;x-scheme-handler/magnet;application/metalink+xml;
StartupNotify=true
12 changes: 2 additions & 10 deletions src/AddUrl.vala
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,7 @@ namespace Gabut {
moregrid.attach (new HeaderLabel (_("Referer:"), 300), 1, 2, 1, 1);
moregrid.attach (refer_entry, 1, 3, 1, 1);

var opfile = new Gtk.FileChooserDialog (
_("Pick File"), this, Gtk.FileChooserAction.OPEN,
_("Cancel"), Gtk.ResponseType.CANCEL,
_("Open"), Gtk.ResponseType.ACCEPT);
cookie_location = new Gtk.FileChooserButton.with_dialog (opfile);
cookie_location = new Gtk.FileChooserButton (_("Open"), Gtk.FileChooserAction.OPEN);
var all_file = new Gtk.FileFilter ();
all_file.set_filter_name (_("All Files"));
all_file.add_pattern ("*");
Expand All @@ -285,11 +281,7 @@ namespace Gabut {
});
cookie_location.sensitive = usecookie.active;

var opfolder = new Gtk.FileChooserDialog (
_("Pick File"), this, Gtk.FileChooserAction.SELECT_FOLDER,
_("Cancel"), Gtk.ResponseType.CANCEL,
_("Open"), Gtk.ResponseType.ACCEPT);
folder_location = new Gtk.FileChooserButton.with_dialog (opfolder);
folder_location = new Gtk.FileChooserButton (_("Open"), Gtk.FileChooserAction.SELECT_FOLDER);
var filter_folder = new Gtk.FileFilter ();
filter_folder.add_mime_type ("inode/directory");
folder_location.set_filter (filter_folder);
Expand Down
49 changes: 0 additions & 49 deletions src/FileChooser.vala

This file was deleted.

6 changes: 1 addition & 5 deletions src/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ namespace Gabut {
bittorrent.attach (new HeaderLabel (_("Seed Time (in Minutes):"), 220), 0, 2, 1, 1);
bittorrent.attach (bt_seedtime, 0, 3, 1, 1);

var dialog = new Gtk.FileChooserDialog (
_("Pick File"), this, Gtk.FileChooserAction.SELECT_FOLDER,
_("Cancel"), Gtk.ResponseType.CANCEL,
_("Open"), Gtk.ResponseType.ACCEPT);
var folder_location = new Gtk.FileChooserButton.with_dialog (dialog);
var folder_location = new Gtk.FileChooserButton (_("Open"), Gtk.FileChooserAction.SELECT_FOLDER);
var filter_folder = new Gtk.FileFilter ();
filter_folder.add_mime_type ("inode/directory");
folder_location.set_filter (filter_folder);
Expand Down
22 changes: 16 additions & 6 deletions src/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1515,17 +1515,27 @@ namespace Gabut {
return "$%s".printf (dollar);
}

private File[] run_open_file (Gtk.Window widget, bool multi) {
var file = new FileChooser (widget.application);
file.select_multiple = multi;
private File[] run_open_file (Gtk.Window window, bool multi) {
var filechooser = new Gtk.FileChooserNative (_("Open"), window, Gtk.FileChooserAction.OPEN, _("Open"), _("Cancel"));
filechooser.select_multiple = multi;

var torrent = new Gtk.FileFilter ();
torrent.set_filter_name (_("Torrent"));
torrent.add_mime_type ("application/x-bittorrent");
var metalink = new Gtk.FileFilter ();
metalink.set_filter_name (_("Metalink"));
metalink.add_pattern ("application/metalink+xml");

filechooser.add_filter (torrent);
filechooser.add_filter (metalink);

File[] files = null;
if (file.run () == Gtk.ResponseType.ACCEPT) {
foreach (File item in file.get_files ()) {
if (filechooser.run () == Gtk.ResponseType.ACCEPT) {
foreach (File item in filechooser.get_files ()) {
files += item;
}
}
file.destroy ();
filechooser.destroy ();
return files;
}

Expand Down
1 change: 0 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ sources = files (
'QrCode.vala',
'ServerUpload.vala',
'ServerHome.vala',
'FileChooser.vala',
'ServerDM.vala',
'ServerCss.vala',
'FileAllocation.vala',
Expand Down

0 comments on commit 148da50

Please sign in to comment.