Пример #1
0
        public void Store()
        {
            DotNetProject project = entry as DotNetProject;

            if (project == null)
            {
                return;
            }

            LinuxDeployData data = LinuxDeployData.GetLinuxDeployData(project);

            data.GenerateScript = checkScript.Active;
            data.ScriptName     = entryScript.Text;
            data.GeneratePcFile = checkPcFile.Active;

            if (checkDesktop.Active)
            {
                DesktopEntry de = new DesktopEntry();
                de.SetEntry("Encoding", "UTF-8");
                de.Type     = DesktopEntryType.Application;
                de.Name     = entry.Name;
                de.Exec     = entryScript.Text;
                de.Terminal = false;
                string file = System.IO.Path.Combine(entry.BaseDirectory, "app.desktop");
                de.Save(file);
                ProjectFile      pfile = project.AddFile(file, BuildAction.Content);
                DeployProperties props = DeployService.GetDeployProperties(pfile);
                props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
            }
        }
Пример #2
0
		public void Store ()
		{
			DotNetProject project = entry as DotNetProject;
			if (project == null)
				return;
			
			LinuxDeployData data = LinuxDeployData.GetLinuxDeployData (project);
			data.GenerateScript = checkScript.Active;
			data.ScriptName = entryScript.Text;
			data.GeneratePcFile = checkPcFile.Active;
			
			if (checkDesktop.Active) {
				DesktopEntry de = new DesktopEntry ();
				de.SetEntry ("Encoding", "UTF-8");
				de.Type = DesktopEntryType.Application;
				de.Name = entry.Name;
				de.Exec = entryScript.Text;
				de.Terminal = false;
				string file = System.IO.Path.Combine (entry.BaseDirectory, "app.desktop");
				de.Save (file);
				ProjectFile pfile = project.AddFile (file, BuildAction.Content);
				DeployProperties props = DeployService.GetDeployProperties (pfile);
				props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
			}
		}
 void OnFileAdded(object o, ProjectFileEventArgs args)
 {
     foreach (ProjectFileEventInfo a in args)
     {
         if (a.ProjectFile.Name.EndsWith(".desktop"))
         {
             DesktopEntry de = new DesktopEntry();
             try {
                 de.Load(a.ProjectFile.Name);
                 a.ProjectFile.BuildAction = BuildAction.Content;
                 DeployProperties props = DeployService.GetDeployProperties(a.ProjectFile);
                 props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
                 if (string.IsNullOrEmpty(de.Exec))
                 {
                     LinuxDeployData dd = LinuxDeployData.GetLinuxDeployData(a.Project);
                     if (dd.GenerateScript && !string.IsNullOrEmpty(dd.ScriptName))
                     {
                         de.Exec = dd.ScriptName;
                         de.Save(a.ProjectFile.Name);
                     }
                 }
             } catch (Exception ex) {
                 LoggingService.LogError("Could not read .desktop file", ex);
             }
         }
     }
 }
Пример #4
0
 public DotDesktopView()
 {
     widget          = new DotDesktopViewWidget();
     widget.Changed += delegate {
         IsDirty = true;
     };
     entry = new DesktopEntry();
     widget.DesktopEntry = entry;
 }
		public DotDesktopView ()
		{
			widget = new DotDesktopViewWidget ();
			widget.Changed += delegate {
				IsDirty = true;
			};
			entry = new DesktopEntry ();
			widget.DesktopEntry = entry;
		}
Пример #6
0
        protected override Control OnGetViewControl(DocumentViewContent view)
        {
            widget          = new DotDesktopViewWidget();
            widget.Changed += delegate {
                HasUnsavedChanges = true;
            };
            entry = new DesktopEntry();
            widget.DesktopEntry = entry;

            entry.Load(FilePath);
            widget.DesktopEntry = entry;
            return((Control)widget);
        }
        public MenuCategorySelectorDialog()
        {
            this.Build();

            store               = new TreeStore(typeof(string), typeof(string), typeof(bool));
            tree.Model          = store;
            tree.HeadersVisible = false;

            TreeViewColumn col = new TreeViewColumn();

            Gtk.CellRendererToggle tog = new CellRendererToggle();
            tog.Toggled += OnToggled;
            col.PackStart(tog, false);

            Gtk.CellRendererText crt = new CellRendererText();
            col.PackStart(crt, true);

            col.AddAttribute(crt, "markup", 1);
            col.AddAttribute(tog, "active", 2);
            tree.AppendColumn(col);

            XmlDocument doc = DesktopEntry.GetDesktopInfo();

            categories = doc.DocumentElement ["Categories"];

            store.DefaultSortFunc = new Gtk.TreeIterCompareFunc(CompareNodes);
            store.SetSortColumnId(/* GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID */ -1, Gtk.SortType.Ascending);

            store.AppendValues("__other", Mono.Unix.Catalog.GetString("Additional categories"), false);

            insertedCats             = new Hashtable();
            insertedCats ["__other"] = null;

            foreach (XmlElement cat in categories.SelectNodes("Category"))
            {
                InsertCategory(cat);
            }

            insertedCats = null;
            doc          = null;
        }
		void OnFileAdded (object o, ProjectFileEventArgs a)
		{
			if (a.ProjectFile.Name.EndsWith (".desktop")) {
				DesktopEntry de = new DesktopEntry ();
				try {
					de.Load (a.ProjectFile.Name);
					a.ProjectFile.BuildAction = BuildAction.Content;
					DeployProperties props = DeployService.GetDeployProperties (a.ProjectFile);
					props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
					if (string.IsNullOrEmpty (de.Exec)) {
						LinuxDeployData dd = LinuxDeployData.GetLinuxDeployData (a.Project);
						if (dd.GenerateScript && !string.IsNullOrEmpty (dd.ScriptName)) {
							de.Exec = dd.ScriptName;
							de.Save (a.ProjectFile.Name);
						}
					}
				} catch (Exception ex) {
					LoggingService.LogError ("Could not read .desktop file", ex);
				}
			}
		}