ProjectDialog.cs 766 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using Gtk;
  3. namespace starter
  4. {
  5. public partial class ProjectDialog : Gtk.Dialog
  6. {
  7. MainWindow win;
  8. public ProjectDialog (MainWindow win)
  9. {
  10. this.Build ();
  11. this.win = win;
  12. }
  13. protected void OnProjectDialogOkClicked (object sender, EventArgs e)
  14. {
  15. win.m_project_name = name_entry.Text;
  16. win.m_source_path = source_entry.Text;
  17. }
  18. protected void OnSourceButtonClicked (object sender, EventArgs e)
  19. {
  20. Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the file to open",
  21. this.win,
  22. FileChooserAction.SelectFolder,
  23. "Cancel", ResponseType.Cancel,
  24. "Open", ResponseType.Accept);
  25. if (fc.Run () == (int)ResponseType.Accept)
  26. {
  27. source_entry.Text = fc.Filename;
  28. }
  29. fc.Destroy ();
  30. }
  31. }
  32. }