Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
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.

149 lines
3.9KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0110
  3. header_name {.H}
  4. code_name {.C}
  5. comment {//
  6. // Copyright (C) 2008 Jonathan Moore Liles
  7. //
  8. // This program is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU General Public License
  10. // as published by the Free Software Foundation; either version 2
  11. // of the License, or (at your option) any later version.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU General Public License
  19. // along with this program; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. //
  22. } {in_source in_header
  23. }
  24. decl {\#include <stdlib.h>} {}
  25. decl {\#include <string.h>} {}
  26. decl {\#include <stdio.h>} {}
  27. decl {\#include <FL/Fl_File_Chooser.H>} {}
  28. class New_Project_Dialog {open
  29. } {
  30. Function {New_Project_Dialog()} {open
  31. } {
  32. code {make_window();} {}
  33. }
  34. Function {run()} {open return_type void
  35. } {
  36. code {_window->show();
  37. while ( _window->shown() )
  38. Fl::wait();} {}
  39. }
  40. Function {make_window()} {open
  41. } {
  42. Fl_Window _window {
  43. label {New Project} open
  44. xywh {406 251 550 195} type Double hide modal xclass Non_DAW
  45. } {
  46. Fl_File_Input _name {
  47. label {Named:}
  48. xywh {75 140 375 35}
  49. }
  50. Fl_Button {} {
  51. label Browse
  52. callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
  53. xywh {455 100 80 35}
  54. }
  55. Fl_Return_Button {} {
  56. label Create
  57. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  58. {
  59. char pat[1024];
  60. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  61. path = strdup( pat );
  62. _default_path = strdup( _directory->value() );
  63. //if ( ! Project::create( pat, _template->text( _template->value() ) ) )
  64. // fl_alert( "Error creating project!" );
  65. _window->hide();
  66. }}
  67. xywh {455 140 80 35}
  68. }
  69. Fl_File_Input _directory {
  70. label {Where:}
  71. callback {if ( ! fl_filename_isdir( o->value() ) )
  72. {
  73. fl_alert( "Must be a directory" );
  74. o->value( "" );
  75. return;
  76. }
  77. // write_line( user_config_dir, "default_path", o->value() );}
  78. xywh {75 100 375 35}
  79. code0 {\#include <FL/filename.H>}
  80. code1 {char *v;}
  81. code2 {// read_line( user_config_dir, "default_path", &v );}
  82. code3 {o->value( v );}
  83. }
  84. Fl_Box {} {
  85. label {New Project}
  86. xywh {15 8 520 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  87. }
  88. Fl_Choice _template {
  89. label {Template:} open
  90. private xywh {310 60 225 25} down_box BORDER_BOX
  91. } {
  92. MenuItem {} {
  93. label Default
  94. xywh {0 0 40 25}
  95. }
  96. }
  97. }
  98. }
  99. decl {char *path;} {public
  100. }
  101. decl {char *_default_path} {}
  102. Function {templates( const char **templates )} {open return_type void
  103. } {
  104. code {for ( const char **s = templates; *s; ++s )
  105. _template->add( *s );} {}
  106. }
  107. Function {default_path( char *s )} {open return_type void
  108. } {
  109. code {_default_path = s;} {}
  110. }
  111. Function {default_path()} {open return_type {char *}
  112. } {
  113. code {return _default_path;} {}
  114. }
  115. Function {selected_template()} {open return_type {const char *}
  116. } {
  117. code {return _template->text( _template->value() );} {}
  118. }
  119. }
  120. Function {new_project_chooser( const char **templates, char **default_path, char **selected_template )} {open C return_type {char*}
  121. } {
  122. code {New_Project_Dialog nsd;
  123. nsd.templates( templates );
  124. nsd.default_path( *default_path );
  125. nsd.run();
  126. *default_path = strdup( nsd.default_path() );
  127. *selected_template = strdup( nsd.selected_template() );
  128. return strdup( nsd.path );} {selected
  129. }
  130. }