Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
12 changes: 10 additions & 2 deletions plugins/pastebin/pastebin.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class Scratch.Plugins.Pastebin : Peas.ExtensionBase, Scratch.Services.Act
GLib.MenuItem? menuitem = null;
GLib.Menu? share_menu = null;
public Object object { owned get; set construct; }
Dialogs.PasteBinDialog? pastebin_dialog = null;

Scratch.Services.Document? doc = null;
Scratch.Services.Interface plugins;
Expand Down Expand Up @@ -142,8 +143,15 @@ public class Scratch.Plugins.Pastebin : Peas.ExtensionBase, Scratch.Services.Act
}

void show_paste_bin_upload_dialog () {
MainWindow window = plugins.manager.window;
new Dialogs.PasteBinDialog (window, doc);
if (pastebin_dialog != null) {
pastebin_dialog.present ();
} else {
MainWindow window = plugins.manager.window;
pastebin_dialog = new Dialogs.PasteBinDialog (window, doc);
pastebin_dialog.destroy.connect (() => {
pastebin_dialog = null;
});
}
}

public void deactivate () {
Expand Down