-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
122 additions
and
48 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); | ||
} | ||
} | ||
} |