Skip to content

Commit

Permalink
🔖 Merge dev into main (v0.2.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vysp3r authored Dec 6, 2022
2 parents b8eeaf9 + f642f84 commit 1bc62b8
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 48 deletions.
Binary file modified Preview-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Preview-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ If you have any questions about ProtonPlus or want to share information with us,

## 💥 Known Issues

- None
- Heroic Games Launcher support not working
- Bottles support not working

- - - -

Expand Down
18 changes: 18 additions & 0 deletions data/com.vysp3r.ProtonPlus.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@
</screenshots>

<releases>
<release version="0.2.3" date="2022-12-05">
<description>
<p>What's Changed:</p>
<ul>
<li>💄 Fix ListBox CSS missing</li>
<li>🚚 Renamed HomeInfo to AboutTool</li>
<li>💄 Update Home layout</li>
<li>🧑‍💻 Refactor ProtonMessageDialog</li>
<li>🚚 Rename Selector to InstallTool</li>
<li>🐛 Fix Adw-Critical error</li>
<li>🐛 Fix crash on tool delete</li>
<li>🍱 Update preview images</li>
<li>📝 Update README.md</li>
<li>🔨 Update appdata</li>
<li>💬 Update the release notes</li>
</ul>
</description>
</release>
<release version="0.2.2" date="2022-12-03">
<description>
<p>What's Changed:</p>
Expand Down
19 changes: 10 additions & 9 deletions src/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ namespace ProtonPlus {

aboutDialog.set_application_name ("ProtonPlus");
aboutDialog.set_application_icon ("com.vysp3r.ProtonPlus");
aboutDialog.set_version ("v0.2.2");
aboutDialog.set_version ("v0.2.3");
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>🧑‍💻 Project refactor</li>
<li>🐛 Fix ListBox missing scrollbar</li>
<li>✨ Add launcher cleanup utility</li>
<li>🐛 Fix possible crash scenario</li>
<li>➖ Remove Posix dependency</li>
<li>🐛 Fix button always being active</li>
<li>🧑‍💻 Add new message dialog widget</li>
<li>🐛 Fix useless log showing up</li>
<li>💄 Fix ListBox CSS missing</li>
<li>🚚 Renamed HomeInfo to AboutTool</li>
<li>💄 Update Home layout</li>
<li>🧑‍💻 Refactor ProtonMessageDialog</li>
<li>🚚 Rename Selector to InstallTool</li>
<li>🐛 Fix Adw-Critical error</li>
<li>🐛 Fix crash on tool delete</li>
<li>🍱 Update preview images</li>
<li>📝 Update README.md</li>
<li>🔨 Update appdata</li>
<li>💬 Update the release notes</li>
</ul>");
Expand Down
5 changes: 3 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ protonplus_sources = [
'widgets/ProtonMessageDialog.vala',

'windows/Home.vala',
'windows/HomeInfo.vala',
'windows/AboutTool.vala',
'windows/Preferences.vala',
'windows/Selector.vala',
'windows/InstallTool.vala',
'windows/LauncherSettings.vala',

'main.vala',
'application.vala',
Expand Down
62 changes: 34 additions & 28 deletions src/views/Tools.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace ProtonPlus.Views {
Gtk.ListBox listInstalledTools;
Gtk.Button btnAdd;
Gtk.Button btnClean;
Gtk.Button btnSettings;

// Values
GLib.List<Models.Launcher> launchers;
Expand All @@ -21,6 +22,7 @@ namespace ProtonPlus.Views {
crInstallLocation = new Widgets.ProtonComboRow ("Launcher", Models.Launcher.GetStore (launchers));
btnAdd = new Gtk.Button ();
btnClean = new Gtk.Button ();
btnSettings = new Gtk.Button ();
listInstalledTools = new Gtk.ListBox ();

// Get the box child from the window
Expand All @@ -30,43 +32,51 @@ namespace ProtonPlus.Views {
boxMain.set_margin_start (15);
boxMain.set_margin_top (15);

// Setup boxLaunchers
var boxLaunchers = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 15);

// Setup crInstallLocation
crInstallLocation.notify.connect (crInstallLocation_Notify);

// Create a group with crInstallLocation in it
var groupInstallLocation = new Adw.PreferencesGroup ();
groupInstallLocation.set_hexpand (true);
groupInstallLocation.add (crInstallLocation);

// Add groupInstallLocation to boxMain
boxMain.append (groupInstallLocation);
boxLaunchers.append (groupInstallLocation);

// Setup btnClean
btnClean.set_icon_name ("user-trash-symbolic");
btnClean.set_icon_name ("preferences-system-symbolic");
btnClean.add_css_class ("flat");
btnClean.add_css_class ("bold");
btnClean.clicked.connect (btnClean_Clicked);
btnClean.width_request = 50;
btnClean.set_tooltip_text ("Launcher settings");
btnClean.clicked.connect (btnLauncherSettings_Clicked);

// Setup btnAdd
btnAdd.set_icon_name ("tab-new-symbolic");
btnAdd.add_css_class ("flat");
btnAdd.add_css_class ("bold");
btnAdd.width_request = 50;
btnAdd.set_tooltip_text ("Install a new tool");
btnAdd.clicked.connect (btnAdd_Clicked);

// Create an ActionRow with a label and a button
var rowInstalledTools = new Adw.ActionRow ();
rowInstalledTools.set_title ("Installed Tools");
rowInstalledTools.add_suffix (btnClean);
rowInstalledTools.add_suffix (btnAdd);
// Setup boxActions
var boxActions = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
boxActions.add_css_class ("card");
boxActions.append (btnClean);
boxActions.append (btnAdd);

// Create a group with rowInstalledTools in it
var groupInstalledTools = new Adw.PreferencesGroup ();
groupInstalledTools.add (rowInstalledTools);
// Add boxActions to boxLaunchers
boxLaunchers.append (boxActions);

// Add groupInstalledTools to boxMain
boxMain.append (groupInstalledTools);
// Add boxLaunchers to boxMain
boxMain.append (boxLaunchers);

// Setup listInstalledTools
listInstalledTools.set_vexpand (true);
listInstalledTools.add_css_class ("boxed-list");

// Setup scrolledWindowInstalledTools
var scrolledWindowInstalledTools = new Gtk.ScrolledWindow ();
Expand Down Expand Up @@ -113,35 +123,31 @@ namespace ProtonPlus.Views {
}

void btnAdd_Clicked () {
var dialogAddVersion = new Windows.Selector (window, currentLauncher);
dialogAddVersion.response.connect ((response_id) => {
var dialogAdd = new Windows.InstallTool (window, currentLauncher);
dialogAdd.response.connect ((response_id) => {
if (response_id == Gtk.ResponseType.APPLY) crInstallLocation.notify_property ("selected");
if (response_id == Gtk.ResponseType.CANCEL) dialogAddVersion.close ();
if (response_id == Gtk.ResponseType.CANCEL) dialogAdd.close ();
});
}

void btnClean_Clicked () {
new Widgets.ProtonMessageDialog (window, null, "Are you sure you want to clean this launcher? WARNING: It will delete every file inside the launcher tool directory!", Widgets.ProtonMessageDialog.MessageDialogType.NO_YES, (response) => {
if (response == "yes") {
GLib.Timeout.add (1000, () => {
Manager.File.Delete (currentLauncher.Directory);
Manager.File.CreateDirectory (currentLauncher.Directory);
crInstallLocation.notify_property ("selected");
return false;
}, 2);
}
void btnLauncherSettings_Clicked () {
var dialogLauncherSettings = new Windows.LauncherSettings (window, currentLauncher);
dialogLauncherSettings.response.connect ((response_id) => {
if (response_id == Gtk.ResponseType.APPLY) crInstallLocation.notify_property ("selected");
if (response_id == Gtk.ResponseType.CANCEL) dialogLauncherSettings.close ();
});
}

void btnInfo_Clicked (Models.Release release) {
var dialogShowVersion = new Windows.HomeInfo (window, release, currentLauncher);
var dialogShowVersion = new Windows.AboutTool (window, release, currentLauncher);
dialogShowVersion.response.connect ((response_id) => {
dialogShowVersion.close ();
});
}

void btnDelete_Clicked (Models.Release release) {
new Widgets.ProtonMessageDialog (window, null, "Are you sure you want to delete the selected tool?", Widgets.ProtonMessageDialog.MessageDialogType.NO_YES, (response) => {
var dialogDelete = new Widgets.ProtonMessageDialog (window, null, "Are you sure you want to delete the selected tool?", Widgets.ProtonMessageDialog.MessageDialogType.NO_YES, null);
dialogDelete.response.connect ((response) => {
if (response == "yes") {
GLib.Timeout.add (1000, () => {
Manager.File.Delete (currentLauncher.Directory + "/" + release.Title);
Expand Down
8 changes: 4 additions & 4 deletions src/widgets/ProtonMessageDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace ProtonPlus.Widgets {

public delegate void ResponseCallback (string response);

public ProtonMessageDialog (Gtk.Window window, string? heading, string? body, MessageDialogType type, ResponseCallback test) {
public ProtonMessageDialog (Gtk.Window window, string? heading, string? body, MessageDialogType type, ResponseCallback? responseCallback) {
set_transient_for (window);
set_heading (heading);
set_body (body);
if (heading != null) set_heading (heading);
if (body != null) set_body (body);

switch (type) {
case MessageDialogType.NO_YES:
Expand All @@ -22,7 +22,7 @@ namespace ProtonPlus.Widgets {
break;
}

response.connect ((response) => test (response));
if (responseCallback != null) response.connect ((response) => responseCallback (response));

show ();
}
Expand Down
4 changes: 2 additions & 2 deletions src/windows/HomeInfo.vala → src/windows/AboutTool.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace ProtonPlus.Windows {
public class HomeInfo : Gtk.Dialog {
public HomeInfo (Gtk.ApplicationWindow parent, ProtonPlus.Models.Release release, ProtonPlus.Models.Launcher launcher) {
public class AboutTool : Gtk.Dialog {
public AboutTool (Gtk.ApplicationWindow parent, ProtonPlus.Models.Release release, ProtonPlus.Models.Launcher launcher) {
set_title ("About");
set_default_size (500, 0);
set_transient_for (parent);
Expand Down
4 changes: 2 additions & 2 deletions src/windows/Selector.vala → src/windows/InstallTool.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace ProtonPlus.Windows {
public class Selector : Gtk.Dialog {
public class InstallTool : Gtk.Dialog {
// Widgets
Gtk.Button btnInstall;
Gtk.Button btnInfo;
Expand All @@ -18,7 +18,7 @@ namespace ProtonPlus.Windows {
// Stores
Stores.Threads store;

public Selector (Gtk.ApplicationWindow parent, Models.Launcher launcher) {
public InstallTool (Gtk.ApplicationWindow parent, Models.Launcher launcher) {
set_transient_for (parent);
set_title ("Install");
set_default_size (430, 0);
Expand Down
47 changes: 47 additions & 0 deletions src/windows/LauncherSettings.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace ProtonPlus.Windows {
public class LauncherSettings : Gtk.Dialog {
// Values
Models.Launcher currentLauncher;

public LauncherSettings (Gtk.ApplicationWindow parent, Models.Launcher launcher) {
set_transient_for (parent);
set_title ("Launcher Settings");
set_default_size (430, 0);

currentLauncher = launcher;

// Setup boxMain
var boxMain = this.get_content_area ();
boxMain.set_orientation (Gtk.Orientation.VERTICAL);
boxMain.set_spacing (15);
boxMain.set_margin_bottom (15);
boxMain.set_margin_end (15);
boxMain.set_margin_start (15);
boxMain.set_margin_top (15);

// Setup btnClean
var btnClean = new Gtk.Button.with_label ("Clean launcher");
btnClean.set_tooltip_text ("Delete every installed tools from the launcher");
btnClean.clicked.connect (btnClean_Clicked);
boxMain.append (btnClean);

// Show the window
show ();
}

// Events
void btnClean_Clicked () {
new Widgets.ProtonMessageDialog (this, null, "Are you sure you want to clean this launcher? WARNING: It will delete every installed tools from the launcher!", Widgets.ProtonMessageDialog.MessageDialogType.NO_YES, (response) => {
if (response == "yes") {
Manager.File.Delete (currentLauncher.Directory);
Manager.File.CreateDirectory (currentLauncher.Directory);

GLib.Timeout.add (1000, () => {
this.response (Gtk.ResponseType.APPLY);
return false;
}, 2);
}
});
}
}
}

0 comments on commit 1bc62b8

Please sign in to comment.