Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a75be27
Replace file_chooser.run () in MainWindow
jeremypw Jun 22, 2026
4b3c2f7
Replace chooser.run () in MainWindow
jeremypw Jun 22, 2026
df7ebda
Replace confirmation_dialog.run () in MainWindow
jeremypw Jun 22, 2026
04ee148
Replace dialog.run () in Document.vala
jeremypw Jun 22, 2026
dbef704
Replace file_Chooser.run () in Document
jeremypw Jun 22, 2026
64ff120
Replace dialog.run () in FolderManager
jeremypw Jun 22, 2026
9f0046d
Replace dialog.run () in spell plugin
jeremypw Jun 22, 2026
302dc32
Create custom dialogs as modal; use present () consistently
jeremypw Jun 23, 2026
29d5788
Lose unused dialog
jeremypw Jun 23, 2026
c4ee58c
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 23, 2026
684ecb4
Add missed modal: true
jeremypw Jun 23, 2026
c0d134e
Address Granite.MessageDialogs
jeremypw Jun 23, 2026
f87c76b
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 23, 2026
41289b0
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 24, 2026
18b4b9d
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 25, 2026
9d8a143
Update POTFILES
jeremypw Jun 25, 2026
2ea727d
Return correct response in ask_save_changes
jeremypw Jun 25, 2026
6ef61da
Make global search async
jeremypw Jun 25, 2026
d984300
Clarify dialog.show () at end of clause
jeremypw Jun 25, 2026
5b51e12
Yield after showing dialog in add_folder.
jeremypw Jun 25, 2026
cc55b5d
Make clone repository async
jeremypw Jun 25, 2026
4cc1a7e
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 27, 2026
e2d0ea3
Merge branch 'master' into jeremypw/gtk4prep/replace-dialog-run
jeremypw Jun 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plugins/spell/spell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ public class Scratch.Plugins.Spell: Peas.ExtensionBase, Scratch.Services.Activat
new ThemedIcon ("dialog-warning"),
Gtk.ButtonsType.CLOSE
);
dialog.run ();
dialog.destroy ();

dialog.response.connect (() => {
dialog.destroy ();
});
dialog.show ();

// This fallback to the LC used but might fail.
spell.set_language (null);
Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/BranchActions/BranchActionDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public class Scratch.Dialogs.BranchActionDialog : Granite.MessageDialog {

public BranchActionDialog (FolderManager.ProjectFolderItem project) {
Object (
project: project
project: project,
modal: true
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/CloneRepositoryDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public class Scratch.Dialogs.CloneRepositoryDialog : Granite.MessageDialog {
public CloneRepositoryDialog (string _suggested_local_folder, string _suggested_remote) {
Object (
suggested_local_folder: _suggested_local_folder,
suggested_remote: _suggested_remote
suggested_remote: _suggested_remote,
modal: true
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/CloseProjectsConfirmationDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public class Scratch.Dialogs.CloseProjectsConfirmationDialog : Granite.MessageDi
buttons: Gtk.ButtonsType.NONE,
transient_for: parent,
n_parents: n_parents,
n_children: n_children
n_children: n_children,
modal: true
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/GlobalSearchDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class Scratch.Dialogs.GlobalSearchDialog : Granite.MessageDialog {
is_repo: is_repo,
case_sensitive: case_sensitive,
wholeword: wholeword,
use_regex: use_regex
use_regex: use_regex,
modal: true
);
}

Expand Down
81 changes: 0 additions & 81 deletions src/Dialogs/NewBranchDialog.vala

This file was deleted.

3 changes: 2 additions & 1 deletion src/Dialogs/OverwriteUncommittedConfirmationDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class Scratch.Dialogs.OverwriteUncommittedConfirmationDialog : Granite.Me
Object (
buttons: Gtk.ButtonsType.NONE,
transient_for: parent,
branch_name: new_branch_name
branch_name: new_branch_name,
modal: true
);

show_error_details (details);
Expand Down
5 changes: 4 additions & 1 deletion src/Dialogs/PreferencesDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class Scratch.Dialogs.Preferences : Granite.Dialog {
Object (
title: _("Preferences"),
transient_for: parent,
plugins: plugins
plugins: plugins,
modal: true
);
}

Expand Down Expand Up @@ -181,6 +182,8 @@ public class Scratch.Dialogs.Preferences : Granite.Dialog {
realize.connect (() => {
stack.set_visible_child_name ("behavior");
});

show_all ();
}

private class SettingSwitch : Gtk.Grid {
Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/RestoreConfirmationDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class Scratch.Dialogs.RestoreConfirmationDialog : Granite.MessageDialog {
public RestoreConfirmationDialog (MainWindow parent) {
Object (
buttons: Gtk.ButtonsType.NONE,
transient_for: parent
transient_for: parent,
modal: true
);
}

Expand Down
20 changes: 12 additions & 8 deletions src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
Expand Down Expand Up @@ -511,14 +511,18 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
var dialog = new Gtk.AppChooserDialog (new Gtk.Window (), Gtk.DialogFlags.MODAL, file);
dialog.deletable = false;

if (dialog.run () == Gtk.ResponseType.OK) {
var app_info = dialog.get_app_info ();
if (app_info != null) {
Utils.launch_app_with_file (app_info.get_id (), path);
dialog.response.connect ((res) => {
if (res == Gtk.ResponseType.OK) {
var app_info = dialog.get_app_info ();
if (app_info != null) {
Utils.launch_app_with_file (app_info.get_id (), path);
}
}
}

dialog.destroy ();
dialog.destroy ();
});

dialog.show ();
}

private void action_execute_contract_with_file_path (SimpleAction action, Variant? param) {
Expand Down Expand Up @@ -623,7 +627,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
}
});

dialog.run ();
dialog.show ();

if (close_projects) {
foreach (var item in parents) {
Expand Down
7 changes: 4 additions & 3 deletions src/FolderManager/ProjectFolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,14 @@ namespace Scratch.FolderManager {
new ThemedIcon ("git"),
Gtk.ButtonsType.CLOSE
) {
badge_icon = new ThemedIcon ("dialog-error")
badge_icon = new ThemedIcon ("dialog-error"),
modal = true
};
dialog.transient_for = (Gtk.Window)(view.get_toplevel ());
dialog.response.connect (() => {
dialog.destroy ();
});
dialog.run ();
dialog.show ();
}
}

Expand Down Expand Up @@ -512,7 +513,7 @@ namespace Scratch.FolderManager {
dialog.destroy ();
});

dialog.run ();
dialog.show ();
Comment thread
danirabbit marked this conversation as resolved.

if (search_term != null) {
// Remove results of previous search before attempting a new one
Expand Down
72 changes: 42 additions & 30 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,13 @@ namespace Scratch {
private void action_preferences () {
if (preferences_dialog == null) {
preferences_dialog = new Scratch.Dialogs.Preferences (this, plugins);
preferences_dialog.show_all ();

preferences_dialog.destroy.connect (() => {
preferences_dialog = null;
});
}

preferences_dialog.present ();
preferences_dialog.show ();
}

private void action_close_window () {
Expand Down Expand Up @@ -991,19 +990,22 @@ namespace Scratch {
file_chooser.select_multiple = true;
file_chooser.set_current_folder_uri (Utils.last_path ?? GLib.Environment.get_home_dir ());

var response = file_chooser.run ();
file_chooser.destroy (); // Close now so it does not stay open during lengthy or failed loading

if (response == Gtk.ResponseType.ACCEPT) {
foreach (string uri in file_chooser.get_uris ()) {
// Update last visited path
Utils.last_path = Path.get_dirname (uri);
// Open the file
var file = File.new_for_uri (uri);
var doc = new Scratch.Services.Document (actions, file);
open_document.begin (doc);
file_chooser.response.connect ((res) => {
var uris = file_chooser.get_uris ();
file_chooser.destroy (); // Close now so it does not stay open during lengthy or failed loading
if (res == Gtk.ResponseType.ACCEPT) {
foreach (string uri in file_chooser.get_uris ()) {
// Update last visited path
Utils.last_path = Path.get_dirname (uri);
// Open the file
var file = File.new_for_uri (uri);
var doc = new Scratch.Services.Document (actions, file);
open_document.begin (doc);
}
}
}
});

file_chooser.show ();
}

private void action_open_in_new_window (SimpleAction action, Variant? param) {
Expand Down Expand Up @@ -1033,14 +1035,18 @@ namespace Scratch {

chooser.select_multiple = true;

if (chooser.run () == Gtk.ResponseType.ACCEPT) {
chooser.get_files ().foreach ((glib_file) => {
var foldermanager_file = new FolderManager.File (glib_file.get_path ());
folder_manager_view.open_folder (foldermanager_file);
});
}
chooser.response.connect ((res) => {
var files = chooser.get_files ();
chooser.destroy ();
if (res == Gtk.ResponseType.ACCEPT) {
files.foreach ((glib_file) => {
var foldermanager_file = new FolderManager.File (glib_file.get_path ());
folder_manager_view.open_folder (foldermanager_file);
});
}
});

chooser.destroy ();
chooser.show ();
}

private void action_open_folder (SimpleAction action, Variant? param) {
Expand Down Expand Up @@ -1095,7 +1101,8 @@ namespace Scratch {
"dialog-error",
Gtk.ButtonsType.CLOSE
) {
transient_for = this
transient_for = this,
modal = true
};
message_dialog.add_button (_("Retry"), 1);
message_dialog.response.connect ((res) => {
Expand All @@ -1107,7 +1114,7 @@ namespace Scratch {

message_dialog.destroy ();
});
message_dialog.present ();
message_dialog.show ();
}
}
);
Expand All @@ -1116,7 +1123,7 @@ namespace Scratch {
}
});

clone_dialog.present ();
clone_dialog.show ();
}

private void action_collapse_all_folders () {
Expand Down Expand Up @@ -1157,13 +1164,18 @@ namespace Scratch {

private void action_revert () {
var confirmation_dialog = new Scratch.Dialogs.RestoreConfirmationDialog (this);
if (confirmation_dialog.run () == Gtk.ResponseType.ACCEPT) {
var doc = get_current_document ();
if (doc != null) {
doc.revert ();
confirmation_dialog.response.connect ((res) => {
if (res == Gtk.ResponseType.ACCEPT) {
var doc = get_current_document ();
if (doc != null) {
doc.revert ();
}
}
}
confirmation_dialog.destroy ();

confirmation_dialog.destroy ();
});

confirmation_dialog.show ();
}

private void action_duplicate () {
Expand Down
Loading