Skip to content

Commit

Permalink
🔖 Merge dev into main (v0.2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vysp3r authored Nov 29, 2022
2 parents ee5580c + 4455824 commit 5638ff4
Show file tree
Hide file tree
Showing 27 changed files with 754 additions and 452 deletions.
Binary file removed Icon.png
Binary file not shown.
11 changes: 9 additions & 2 deletions com.vysp3r.ProtonPlus.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@
"--socket=fallback-x11",
"--device=dri",
"--socket=wayland",
"--filesystem=home",
"--filesystem=~/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d",
"--filesystem=~/.steam/root/compatibilitytools.d",
"--filesystem=~/.local/share/Steam/compatibilitytools.d",
"--filesystem=~/.var/app/net.lutris.Lutris/data/lutris/",
"--filesystem=~/.local/share/lutris/",
"--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/",
"--filesystem=~/.config/heroic/tools",
"--filesystem=~/.var/app/com.usebottles.bottles/data/bottles/runners",
"--filesystem=~/.local/share/bottles/runners",
"--talk-name=org.gtk.vfs.*",
"--filesystem=xdg-run/gvfsd"
],
"modules" : [
{
"name" : "ProtonPlus",
"builddir" : true,
"only-arches": ["x86_64"],
"buildsystem" : "meson"
}
]
Expand Down
114 changes: 105 additions & 9 deletions data/com.vysp3r.ProtonPlus.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<p>ProtonPlus a simple Wine and Proton-based compatiblity tools manager for GNOME. It works with Steam, Lutris, Heroic Games Launcher and Bottles. It was made in Vala with GTK4 and Libadwaita using GNOME Builder.</p>
</description>

<url type="homepage">https://github.com/Vysp3r/ProtonPlus</url>
<url type="bugtracker">https://github.com/Vysp3r/ProtonPlus/issues</url>

<launchable type="desktop-id">com.vysp3r.ProtonPlus.desktop</launchable>

<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/Vysp3r/ProtonPlus/main/Preview-1.png</image>
Expand All @@ -21,15 +26,106 @@
</screenshot>
</screenshots>

<url type="homepage">https://github.com/Vysp3r/ProtonPlus</url>
<url type="bugtracker">https://github.com/Vysp3r/ProtonPlus/issues</url>

<launchable type="desktop-id">com.vysp3r.ProtonPlus.desktop</launchable>
<releases>
<release version="0.1.9" date="2022-11-21" />
<release version="0.1.3" date="2022-11-19" />
<release version="0.1.2" date="2022-11-2" />
<release version="0.1.1" date="2022-10-24" />
<release version="0.1.0" date="2022-10-23" />
<release version="0.2.0" date="2022-11-29">
<description>
<p>For stability reasons, I've decided to disable Bottles and Heroic Games Launcher support for now. I also disabled Proton Tkg for the same reasons.</p>
<p>What's Changed:</p>
<ul>
<li>✨ Add NorthstarProton compatibility tool</li>
<li>🐛 Fix NorthstarProton not showing up</li>
<li>🔨 Update flatpak config</li>
<li>💬 Renamed tools in a uniform way</li>
<li>🧑‍💻 Project refactor</li>
<li>🚸 Add error message to selector</li>
<li>🔨 Update appdata</li>
<li>💬 Update the release notes</li>
</ul>
</description>
</release>
<release version="0.1.9" date="2022-11-21">
<description>
<p>We are now officialy on Flathub!</p>
<p>What's Changed:</p>
<ul>
<li>🔨 Update appdata</li>
<li>🔨 Update flatpak config</li>
<li>🍱 Update symbolic icon</li>
<li>🍱 Add icon</li>
<li>🔨 Update .desktop</li>
<li>🍱 Update the preview image</li>
<li>🍱 Add a preview image</li>
<li>🐛 Fix install button always being clickable</li>
<li>💬 Update the release notes</li>
</ul>
</description>
</release>
<release version="0.1.3" date="2022-11-19">
<description>
<p>The new naming convention for extracted directories is basically making sure each installed tools is easily recognizable to make it easier to manage them.</p>
<p>Naming convention: Tool name + Tool version</p>
<p>Example: GE-Proton | GE-Proton7-41</p>
<p>What's Changed:</p>
<ul>
<li>✏️ Fix typo in the release notes</li>
<li>🍱 Update the preview image</li>
<li>⚰️ Remove unused custom widget</li>
<li>🚧 Add notifications tab</li>
<li>💄 Update selector window components to Libadwaita</li>
<li>🧱 Separate Release from CompatibilityTool</li>
<li>🧱 Rename CompatibilityTool to Tool</li>
<li>⚰️ Remove unused file</li>
<li>💄 Update home message dialog to libadwaita</li>
<li>⚰️ Remove unused custom widget</li>
<li>✨ Added a naming convention extracted directories</li>
<li>🚚 Rename compatibilitytool to tool</li>
<li>💬 Update the release notes</li>
</ul>
</description>
</release>
<release version="0.1.2" date="2022-11-2">
<description>
<p>ProtonPlus now requires Libadwaita version 1.2 or higher.</p>
<p>What's Changed:</p>
<ul>
<li>📝 Update README.md</li>
<li>🐛 Fix Preferences window default siz</li>
<li>💄 Move main window to Libadwaita</li>
<li>💄 Move about window to Libadwaita</li>
<li>⚰️ Remove dead code</li>
<li>💄 Update main window components to Libadwaita</li>
<li>⚰️ Remove dead code</li>
<li>💄 Add an effect when extracting a tool</li>
<li>🐛 Fix label not showing up</li>
<li>🐛 Fix wrong label showing up</li>
<li>💄 Update preferences window to Libadwaita</li>
<li>⬆️ Update the runtime version</li>
<li>💬 Update the release notes</li>
</ul>
</description>
</release>
<release version="0.1.1" date="2022-10-24">
<description>
<p>What's Changed:</p>
<ul>
<li>🐛 Fix Steam not showing up on fresh install</li>
<li>🐛 Fix Kron4ek Wine-Builds Vanilla not showing properly</li>
<li>🐛 Fix installed tools showing files</li>
<li>🐛 Fix selector closing after an installation</li>
<li>🐛 Fix extraction not always working</li>
<li>📝 Update README.md</li>
<li>🐛 Fix Lutris DXVK not showing up</li>
</ul>
</description>
</release>
<release version="0.1.0" date="2022-10-23">
<description>
<p>What's Changed:</p>
<ul>
<li>🎉 Initial release</li>
<li>📝 Create pull request template</li>
</ul>
</description>
</release>
</releases>
</component>
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('protonplus', ['c', 'vala'],
version: '0.1.0',
version: '0.2.0',
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2',
'werror=false',
Expand Down
2 changes: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.bold {
font-weight: bold;
}
}
27 changes: 20 additions & 7 deletions src/application.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace ProtonPlus {
public class Application : Adw.Application {
Stores.Preferences preferences;

public Application () {
Object (application_id: "com.vysp3r.ProtonPlus", flags : ApplicationFlags.FLAGS_NONE);
}
Expand All @@ -19,13 +21,18 @@ namespace ProtonPlus {
public override void activate () {
base.activate ();

new Windows.Home (this);
preferences = new Stores.Preferences ();
if (Manager.Preferences.Load (ref preferences)) {
Manager.Preferences.Apply (ref preferences);
Manager.Themes.Load ();

Manager.Preferences.Load ();
Manager.Themes.Load ();
new Windows.Home (this);
} else {
stderr.printf ("There was an error loading the preferences and it will prevent the application from opening.\n");
}
}

private void on_about_action () {
void on_about_action () {
string[] devs = { "Charles Malouin (Vysp3r) https://github.com/Vysp3r" };
string[] designers = { "Charles Malouin (Vysp3r) https://github.com/Vysp3r" };
string[] thanks = {
Expand All @@ -39,10 +46,16 @@ namespace ProtonPlus {

aboutDialog.set_application_name ("ProtonPlus");
aboutDialog.set_application_icon ("com.vysp3r.ProtonPlus");
aboutDialog.set_version ("v0.1.9");
aboutDialog.set_version ("v0.2.0");
aboutDialog.set_comments ("A simple Wine and Proton-based compatiblity tools manager for GNOME");
aboutDialog.add_link ("Github", "https://github.com/Vysp3r/ProtonPlus");
aboutDialog.set_release_notes ("<ul>
<li>✨ Add NorthstarProton compatibility tool</li>
<li>🐛 Fix NorthstarProton not showing up</li>
<li>🔨 Update flatpak config</li>
<li>💬 Renamed tools in a uniform way</li>
<li>🧑‍💻 Project refactor</li>
<li>🚸 Add error message to selector</li>
<li>🔨 Update appdata</li>
<li>💬 Update the release notes</li>
</ul>");
Expand All @@ -56,8 +69,8 @@ namespace ProtonPlus {
aboutDialog.show ();
}

private void on_preferences_action () {
new ProtonPlus.Windows.Preferences ();
void on_preferences_action () {
new ProtonPlus.Windows.Preferences (ref preferences);
}
}
}
2 changes: 1 addition & 1 deletion src/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ int main (string[] args) {

var app = new ProtonPlus.Application ();
return app.run (args);
}
}
74 changes: 53 additions & 21 deletions src/manager/file.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace ProtonPlus.Manager {
public class File {
public static void Extract (string install_location, string launcher_name, string tool_name) {
public static string Extract (string install_location, string tool_name) { // RENAME launcher_name and tool_name correctly see line 117 in selector
const int bufferSize = 192000;

Archive.Read archive = new Archive.Read ();
archive.support_format_all ();
archive.support_filter_all ();
Expand All @@ -15,46 +17,44 @@ namespace ProtonPlus.Manager {
ext.set_standard_lookup ();
ext.set_options (flags);

if (archive.open_filename (install_location + tool_name + ".tar.gz", 1920000) != Archive.Result.OK) return;
if (archive.open_filename (install_location + tool_name + ".tar.gz", bufferSize) != Archive.Result.OK) return "";

ssize_t r;

unowned Archive.Entry entry;

int bob = 0;
string test = "";
string sourcePath = "";
bool firstRun = true;

for ( ;; ) {
r = archive.next_header (out entry);
if (r == Archive.Result.EOF) break;
if (r < Archive.Result.WARN) break;
entry.set_pathname (install_location + entry.pathname ());
if(bob++ == 0){
test = entry.pathname ();
if (r < Archive.Result.OK) stderr.printf (ext.error_string ());
if (r < Archive.Result.WARN) return "";
if (firstRun) {
sourcePath = entry.pathname ();
firstRun = false;
}
entry.set_pathname (install_location + entry.pathname ());
r = ext.write_header (entry);
if (entry.size () > 0) {
if (r < Archive.Result.OK) stderr.printf (ext.error_string ());
else if (entry.size () > 0) {
r = copy_data (archive, ext);
if (r < Archive.Result.WARN) break;
if (r < Archive.Result.WARN) return "";
}
r = ext.finish_entry ();
if (r < Archive.Result.WARN) break;
if (r < Archive.Result.OK) stderr.printf (ext.error_string ());
if (r < Archive.Result.WARN) return "";
}

archive.close ();

GLib.File file = GLib.File.new_for_path (install_location + tool_name + ".tar.gz");
file.delete ();

GLib.File fileSource = GLib.File.new_for_path (test);
GLib.File fileDest = GLib.File.new_for_path (install_location + launcher_name + " | " + tool_name);
fileSource.move(fileDest, FileCopyFlags.NONE, null, null);
Delete (install_location + tool_name + ".tar.gz");

ProtonPlus.Stores.Threads store = ProtonPlus.Stores.Threads.instance ();
store.ProgressBarDone = true;
return install_location + sourcePath;
}

private static ssize_t copy_data (Archive.Read ar, Archive.WriteDisk aw) {
static ssize_t copy_data (Archive.Read ar, Archive.WriteDisk aw) {
ssize_t r;
uint8[] buffer;
Archive.int64_t offset;
Expand All @@ -64,7 +64,39 @@ namespace ProtonPlus.Manager {
if (r == Archive.Result.EOF) return (Archive.Result.OK);
if (r < Archive.Result.OK) return (r);
r = aw.write_data_block (buffer, offset);
if (r < Archive.Result.OK) return (r);
if (r < Archive.Result.OK) {
stderr.printf (aw.error_string ());
return (r);
}
}
}

public static void Delete (string sourcePath) {
try {
GLib.File file = GLib.File.new_for_path (sourcePath);
file.delete ();
} catch (GLib.Error e) {
stderr.printf (e.message);
}
}

public static void Rename (string sourcePath, string destinationPath) {
try {
GLib.File fileSource = GLib.File.new_for_path (sourcePath);
GLib.File fileDest = GLib.File.new_for_path (destinationPath);
fileSource.move (fileDest, FileCopyFlags.NONE, null, null);
} catch (GLib.Error e) {
stderr.printf (e.message);
}
}

public static void Write (string sourcePath, string content) {
try {
GLib.File file = GLib.File.new_for_path (GLib.Environment.get_user_config_dir () + "/preferences.json");
FileOutputStream os = file.create (FileCreateFlags.PRIVATE);
os.write (content.data);
} catch (GLib.Error e) {
stderr.printf (e.message);
}
}
}
Expand Down
20 changes: 13 additions & 7 deletions src/manager/http.vala
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
namespace ProtonPlus.Manager {
public class HTTP {
public static string GET (string url) {
var session = new Soup.Session ();
var message = new Soup.Message ("GET", url);
session.set_user_agent ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246");
Bytes bytes = session.send_and_read (message);
return (string) bytes.get_data ();
try {
var session = new Soup.Session ();
var message = new Soup.Message ("GET", url);
session.set_user_agent ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246");
Bytes bytes = session.send_and_read (message);
return (string) bytes.get_data ();
} catch (GLib.Error e) {
stderr.printf (e.message);
return "";
}
}

public static int Download (string download_url, string download_path) {
try {
var file_from_http = GLib.File.new_for_uri (download_url);
GLib.File local_file = GLib.File.new_for_path (download_path);
ProtonPlus.Stores.Threads store = ProtonPlus.Stores.Threads.instance ();
Stores.Threads store = Stores.Threads.instance ();
file_from_http.copy (local_file, FileCopyFlags.OVERWRITE, null, (current, total) => {
store.ProgressBar = (current + 0.0d) / (total + 0.0d);
});
return 0;
} catch (Error e) {
} catch (GLib.Error e) {
stderr.printf (e.message);
return 1;
}
}
Expand Down
Loading

0 comments on commit 5638ff4

Please sign in to comment.