Esempio n. 1
0
        static void Main(string [] args)
        {
#if WINDOWS
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            History.Default.Load();

			var view = new MainView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var model = new PipelineProject();
            var controller = new PipelineController(view, model);   
            Application.Run(view);
#endif
#if LINUX || MONOMAC

			Gtk.Application.Init ();
			MainWindow win = new MainWindow ();
			win.Show (); 
			var model = new PipelineProject();
			new PipelineController(win, model);  
			if (args != null && args.Length > 0)
			{
				var projectFilePath = string.Join(" ", args);
				win.OpenProjectPath = projectFilePath;
			}
			win.OnShowEvent ();
			Gtk.Application.Run ();
#endif
        }
Esempio n. 2
0
        public void Initalize(MainWindow window, MenuItem treerebuild, PropertiesView propertiesView)
        {
            this.window = window;
            this.propertiesView = propertiesView;

            menu = new Menu ();

            treenewitem = new MenuItem ("New Item...");
            treenewitem.Activated += window.OnNewItemActionActivated;
            menu.Add (treenewitem);

            treeadditem = new MenuItem ("Add Item...");
            treeadditem.Activated += window.OnAddItemActionActivated;
            menu.Add (treeadditem);

            treedelete = new MenuItem ("Delete");
            treedelete.Activated += window.OnDeleteActionActivated;
            menu.Add (treedelete);

            seperator = new SeparatorMenuItem ();
            menu.Add (seperator);

            treeopenfile = new MenuItem ("Open File");
            treeopenfile.Activated += delegate {
                List<TreeIter> iters;
                List<Gdk.Pixbuf> icons;
                GetSelectedTreePath(out iters, out icons);

                if(icons[0] != ICON_BASE)
                    Process.Start(window._controller.GetFullPath(GetPathFromIter(iters[0])));
                else
                    Process.Start(openedProject);
            };
            menu.Add (treeopenfile);

            treeopenfilelocation = new MenuItem ("Open File Location");
            treeopenfilelocation.Activated += delegate {
                List<TreeIter> iters;
                List<Gdk.Pixbuf> icons;
                GetSelectedTreePath(out iters, out icons);

                if(icons[0] != ICON_BASE)
                    Process.Start(System.IO.Path.GetDirectoryName(window._controller.GetFullPath(GetPathFromIter(iters[0]))));
                else
                    Process.Start(System.IO.Path.GetDirectoryName(window._controller.GetFullPath("")));
            };
            menu.Add (treeopenfilelocation);

            seperator2 = new SeparatorMenuItem ();
            menu.Add (seperator2);

            menu.Add (treerebuild);
        }
Esempio n. 3
0
        public CustomFolderDialog(Window parrent, string startDirectory)
            : base(Global.GetNewDialog(parrent.Handle))
        {
            Build();

            _window = (MainWindow)parrent;

            string pl = ((PipelineController)_window._controller).ProjectLocation;
            if (!pl.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                pl += System.IO.Path.DirectorySeparatorChar;

            _projectLocation = new Uri(pl);

            entryPath.Text = startDirectory;
            entryPath.Position = entryPath.Text.Length;
        }
Esempio n. 4
0
        static void Main(string [] args)
        {
#if WINDOWS
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            PipelineSettings.Default.Load();

			var view = new MainView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var controller = new PipelineController(view);
            Application.Run(view);
#endif
#if LINUX || MONOMAC

			Gtk.Application.Init ();
            Global.Initalize ();
			MainWindow win = new MainWindow ();
			win.Show (); 
			new PipelineController(win);
			#if LINUX
			if (args != null && args.Length > 0)
			{
				var projectFilePath = string.Join(" ", args);
				win.OpenProjectPath = projectFilePath;
			}
			#elif MONOMAC
			var project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
			if (!string.IsNullOrEmpty (project)) {
				win.OpenProjectPath = project;
			}
			#endif
			win.OnShowEvent ();
			Gtk.Application.Run ();
#endif
        }
Esempio n. 5
0
 public void Initalize(Window window)
 {
     this.window = (MainWindow)window;
 }
Esempio n. 6
0
        public void Initalize(MainWindow window, MenuItem treerebuild, PropertiesView propertiesView)
        {
            this.window = window;
            this.propertiesView = propertiesView;

            menu = new Menu ();
            addmenu = new Menu();

            treeadd = new MenuItem("Add");
            treeadd.Submenu = addmenu;

            treeaddseperator = new SeparatorMenuItem ();

            treenewitem = new MenuItem ("New Item...");
            treenewitem.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args)
                { menu.Popdown(); window.OnNewItemActionActivated(o, args); };

            treenewfolder = new MenuItem ("New Folder...");
            treenewfolder.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args)
                { menu.Popdown(); window.OnNewFolderActionActivated(o, args); };

            treeadditem = new MenuItem ("Existing Item...");
            treeadditem.ButtonPressEvent += window.OnAddItemActionActivated;

            treeaddfolder = new MenuItem ("Existing Folder...");
            treeaddfolder.ButtonPressEvent += window.OnAddFolderActionActivated;
            
            treerename = new MenuItem ("Rename");
            treerename.Activated += window.OnRenameActionActivated;
            
            treerenameseparator = new SeparatorMenuItem();

            treedelete = new MenuItem ("Delete");
            treedelete.Activated += window.OnDeleteActionActivated;

            treeopenfile = new MenuItem ("Open");
            treeopenfile.Activated += delegate {
                List<TreeIter> iters;
                List<string> ids;
                GetSelectedTreePath(out iters, out ids);

                if (ids.Count != 1)
                    return;

                string start = openedProject;

                if(ids[0] != ID_BASE)
                    start = window._controller.GetFullPath(GetPathFromIter(iters[0]));

                #if LINUX
                Process.Start("mimeopen", "-n " + start);
                #else
                Process.Start(start);
                #endif
            };

            treeopenfilelocation = new MenuItem ("Open Item Directory");
            treeopenfilelocation.Activated += delegate {
                List<TreeIter> iters;
                List<string> ids;
                GetSelectedTreePath(out iters, out ids);

                if(ids[0] != ID_BASE)
                    Process.Start(System.IO.Path.GetDirectoryName(window._controller.GetFullPath(GetPathFromIter(iters[0]))));
                else
                    Process.Start(System.IO.Path.GetDirectoryName(window._controller.GetFullPath("")));
            };

            addmenu.Add (treenewitem);
            addmenu.Add (treenewfolder);
            addmenu.Add (new SeparatorMenuItem ());
            addmenu.Add (treeadditem);
            addmenu.Add (treeaddfolder);

            menu.Add (treeopenfile);
            menu.Add (treeadd);
            menu.Add (treeaddseperator);
            menu.Add (treeopenfilelocation);
            menu.Add (treerebuild);
            menu.Add (new SeparatorMenuItem ());
            menu.Add (treerename);
            menu.Add (treerenameseparator);
            menu.Add (treedelete);
        }