You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.3 KiB

  1. //
  2. // The Pimp The Pathetic Image Manipulation Program
  3. // Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
  4. // All Rights Reserved
  5. //
  6. // $Id$
  7. //
  8. // This library is free software. It comes without any warranty, to
  9. // the extent permitted by applicable law. You can redistribute it
  10. // and/or modify it under the terms of the Do What The Fuck You Want
  11. // To Public License, Version 2, as published by Sam Hocevar. See
  12. // http://sam.zoy.org/wtfpl/COPYING for more details.
  13. //
  14. using System;
  15. using Gtk;
  16. namespace ThePimp
  17. {
  18. public partial class SaveFile : Gtk.Dialog
  19. {
  20. private static readonly SaveFile instance = new SaveFile();
  21. // Do not mark type as beforefieldinit
  22. static SaveFile() {}
  23. private SaveFile()
  24. {
  25. this.Build();
  26. }
  27. public static string GetChoice()
  28. {
  29. instance.ShowAll();
  30. ResponseType rsp = (ResponseType)instance.Run();
  31. instance.Hide();
  32. if(rsp != ResponseType.Ok)
  33. return null;
  34. return instance.filechooserwidget1.Filename;
  35. }
  36. protected virtual void OnFilechooserwidget1FileActivated (object sender, System.EventArgs e)
  37. {
  38. Respond(ResponseType.Ok);
  39. }
  40. }
  41. }