Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 9 additions & 6 deletions plugins/spell/spell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,21 @@ public class Scratch.Plugins.Spell: Peas.ExtensionBase, Scratch.Services.Activat
}

if (language_list.length () == 0) {
// This fallback to the LC used but might fail.
spell.set_language (null);

var dialog = new Granite.MessageDialog (
_("No Suitable Dictionaries Were Found"),
_("Please install at least one [aspell] dictionary."),
new ThemedIcon ("dialog-warning"),
Gtk.ButtonsType.CLOSE
);
dialog.run ();
dialog.destroy ();

// This fallback to the LC used but might fail.
spell.set_language (null);

dialog.response.connect (() => {
dialog.destroy ();
});
// The following code does not depend on the dialog response
//so we can just show the dialog
dialog.show ();
} else if (!exist_language) {
this.lang_dict = language_list.first ().data;
spell.set_language (lang_dict);
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
4 changes: 2 additions & 2 deletions src/Dialogs/CloneRepositoryDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ 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
);
}

construct {
transient_for = ((Gtk.Application)(GLib.Application.get_default ())).get_active_window ();
image_icon = new ThemedIcon ("git");
badge_icon = new ThemedIcon ("emblem-downloads");
modal = true;

///TRANSLATORS "Git" is a proper name and must not be translated
primary_text = _("Create a local clone of a Git repository");
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
4 changes: 2 additions & 2 deletions src/Dialogs/OverwriteUncommittedConfirmationDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ 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);
}

construct {
modal = true;
image_icon = new ThemedIcon ("dialog-warning");

primary_text = _("There are uncommitted changes in the current branch");
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
16 changes: 10 additions & 6 deletions src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
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
5 changes: 3 additions & 2 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
11 changes: 6 additions & 5 deletions src/Services/Document.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,8 @@ namespace Scratch.Services {
Gtk.ButtonsType.NONE
) {
badge_icon = new ThemedIcon ("dialog-question"),
transient_for = app_instance.active_window
transient_for = app_instance.active_window,
modal = true
};

dialog.add_button (_("Ignore"), Gtk.ResponseType.REJECT);
Expand Down Expand Up @@ -1077,7 +1078,7 @@ namespace Scratch.Services {
});
});

dialog.present ();
dialog.show ();
}

private void ask_external_changes (
Expand All @@ -1094,8 +1095,8 @@ namespace Scratch.Services {
new ThemedIcon ("dialog-warning"),
Gtk.ButtonsType.NONE
) {
transient_for = app_instance.active_window

transient_for = app_instance.active_window,
modal = true
};

dialog.add_button (_("Continue"), Gtk.ResponseType.REJECT);
Expand Down Expand Up @@ -1153,7 +1154,7 @@ namespace Scratch.Services {
});
});

dialog.present ();
dialog.show ();
}
// Set Undo/Redo action sensitive property
public void check_undoable_actions () {
Expand Down
15 changes: 9 additions & 6 deletions src/Services/MonitoredRepository.vala
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ namespace Scratch.Services {
};

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

Expand Down Expand Up @@ -313,16 +313,17 @@ namespace Scratch.Services {
parent,
new_branch_name,
project_diff
);
) {
modal = true
};
dialog.response.connect ((res) => {
dialog.destroy ();
if (res == Gtk.ResponseType.ACCEPT) {
checkout_branch (new_head_branch, false);
}
});

dialog.present ();

dialog.show ();
return false;
}

Expand All @@ -342,10 +343,12 @@ namespace Scratch.Services {
_("An error occurred while checking out the requested branch"),
e.message,
"dialog-warning"
);
) {
modal = true
};

dialog.response.connect (dialog.destroy);
dialog.present ();
dialog.show ();
return false;
}

Expand Down