52
52
static GuiBuilderProjectPad widgetTreePad;
53
53
static string GuiBuilderLayout = "GUI Builder";
55
#if DUMMY_STRINGS_FOR_TRANSLATION_DO_NOT_COMPILE
56
private void DoNotCompile ()
58
//The default GUI Builder layout, translated indirectly because it's used as an ID
59
GettextCatalog.GetString ("GUI Builder");
54
63
static string defaultLayout;
56
65
static Stetic.Application steticApp;
58
67
static bool generating;
405
415
bool canGenerateInProcess = IsolationMode != Stetic.IsolationMode.None || info.GuiBuilderProject.SteticProject.CanGenerateCode;
407
// Run the generation in another thread to avoid freezing the GUI
408
System.Threading.ThreadPool.QueueUserWorkItem ( delegate {
410
if (!canGenerateInProcess) {
417
if (!canGenerateInProcess) {
418
// Run the generation in another thread to avoid freezing the GUI
419
System.Threading.ThreadPool.QueueUserWorkItem ( delegate {
411
421
// Generate the code in another process if stetic is not isolated
412
422
CodeGeneratorProcess cob = (CodeGeneratorProcess) Runtime.ProcessService.CreateExternalProcessObject (typeof (CodeGeneratorProcess), false);
414
424
generationResult = cob.GenerateCode (projects, info.GenerateGettext, info.GettextClass, info.GeneratePartialClasses);
417
// No need to create another process, since stetic has its own backend process
418
// or the widget libraries have no custom wrappers
419
Stetic.GenerationOptions options = new Stetic.GenerationOptions ();
420
options.UseGettext = info.GenerateGettext;
421
options.GettextClass = info.GettextClass;
422
options.UsePartialClasses = info.GeneratePartialClasses;
423
options.GenerateSingleFile = false;
424
generationResult = SteticApp.GenerateProjectCode (options, info.GuiBuilderProject.SteticProject);
426
} catch (Exception ex) {
427
generatedException = ex;
434
DispatchService.RunPendingEvents ();
435
System.Threading.Thread.Sleep (100);
438
// No need to create another process, since stetic has its own backend process
439
// or the widget libraries have no custom wrappers
441
Stetic.GenerationOptions options = new Stetic.GenerationOptions ();
442
options.UseGettext = info.GenerateGettext;
443
options.GettextClass = info.GettextClass;
444
options.UsePartialClasses = info.GeneratePartialClasses;
445
options.GenerateSingleFile = false;
446
generationResult = SteticApp.GenerateProjectCode (options, info.GuiBuilderProject.SteticProject);
426
447
} catch (Exception ex) {
427
448
generatedException = ex;
434
DispatchService.RunPendingEvents ();
435
System.Threading.Thread.Sleep (100);
438
453
if (generatedException != null) {
446
461
CodeDomProvider provider = project.LanguageBinding.GetCodeDomProvider ();
447
462
if (provider == null)
448
throw new UserException ("Code generation not supported in language: " + project.LanguageName);
463
throw new UserException ("Code generation not supported for language: " + project.LanguageName);
450
465
string basePath = Path.GetDirectoryName (info.SteticGeneratedFile);
451
466
string ext = Path.GetExtension (info.SteticGeneratedFile);