File gnome-do-quiet-autostart.patch of Package gnome-do
Index: gnome-do-0.8.4/Do/src/Do.cs
===================================================================
--- gnome-do-0.8.4.orig/Do/src/Do.cs
+++ gnome-do-0.8.4/Do/src/Do.cs
@@ -44,6 +44,19 @@ namespace Do {
Gtk.Application.Init ();
Gdk.Threads.Init ();
+ bool arg_quiet = false;
+ int i = 0;
+ while (i < args.Length) {
+ string arg = args [i];
+ ++i;
+
+ switch (arg) {
+ case "--quiet":
+ arg_quiet = true;
+ break;
+ }
+ }
+
// We are conservative with the log at first.
Log.DisplayLevel = LogLevel.Error;
if (CorePreferences.PeekDebug)
@@ -70,7 +83,7 @@ namespace Do {
Controller.Initialize ();
UniverseManager.Initialize ();
- if (!Preferences.QuietStart)
+ if (!arg_quiet && !Preferences.QuietStart)
Controller.Summon ();
Gtk.Application.Run ();
Index: gnome-do-0.8.4/data/Makefile.am
===================================================================
--- gnome-do-0.8.4.orig/data/Makefile.am
+++ gnome-do-0.8.4/data/Makefile.am
@@ -1,7 +1,7 @@
SUBDIRS = icons
-EXTRA_DIST = $(schemas_in_files) gnome-do.desktop.in
-CLEANFILES = $(schemas_DATA) gnome-do.desktop
+EXTRA_DIST = $(schemas_in_files) gnome-do.desktop.in gnome-do-autostart.desktop.in
+CLEANFILES = $(schemas_DATA) gnome-do.desktop gnome-do-autostart.desktop
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
schemas_in_files = gnome-do.schemas.in
@@ -11,7 +11,7 @@ applicationsdir = $(datadir)/application
applications_DATA = gnome-do.desktop
startupdir = $(sysconfdir)/xdg/autostart
-startup_DATA = gnome-do.desktop
+startup_DATA = gnome-do-autostart.desktop
@INTLTOOL_DESKTOP_RULE@
Index: gnome-do-0.8.4/data/gnome-do-autostart.desktop.in
===================================================================
--- /dev/null
+++ gnome-do-0.8.4/data/gnome-do-autostart.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+_Name=GNOME Do
+Type=Application
+Exec=gnome-do --quiet
+Terminal=false
+Icon=gnome-do
+OnlyShowIn=GNOME;
+_Comment=Do things as quickly as possible (but no quicker) with your files, bookmarks, applications, music, contacts, and more!
+Categories=Utility;
Index: gnome-do-0.8.4/Do.Platform.Linux/Makefile.am
===================================================================
--- gnome-do-0.8.4.orig/Do.Platform.Linux/Makefile.am
+++ gnome-do-0.8.4/Do.Platform.Linux/Makefile.am
@@ -43,7 +43,8 @@ endif
RESOURCES = \
gtk-gui/gui.stetic \
- Resources/Do.Platform.Linux.addin.xml
+ Resources/Do.Platform.Linux.addin.xml \
+ $(top_srcdir)/data/gnome-do-autostart.desktop
PKG_CONFIG_FILES = do.platform.linux.pc
Index: gnome-do-0.8.4/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs
===================================================================
--- gnome-do-0.8.4.orig/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs
+++ gnome-do-0.8.4/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs
@@ -160,34 +160,30 @@ namespace Do.Platform.Linux
}
}
- string AutoStartUri {
- get {
- return Gnome.Vfs.Uri.GetUriFromLocalPath (AutoStartFileName);
- }
- }
-
DesktopItem AutoStartFile {
get {
if (autostartfile != null)
return autostartfile;
try {
- autostartfile = DesktopItem.NewFromUri (AutoStartUri, DesktopItemLoadFlags.NoTranslations);
+ autostartfile = DesktopItem.NewFromFile (AutoStartFileName, DesktopItemLoadFlags.NoTranslations);
} catch (GLib.GException loadException) {
Log<SystemService>.Info ("Unable to load existing autostart file: {0}", loadException.Message);
Log<SystemService>.Info ("Writing new autostart file to {0}", AutoStartFileName);
- autostartfile = DesktopItem.NewFromFile (System.IO.Path.Combine (AssemblyInfo.InstallData, "applications/gnome-do.desktop"),
- DesktopItemLoadFlags.NoTranslations);
try {
if (!Directory.Exists (AutoStartDir))
Directory.CreateDirectory (AutoStartDir);
- // This *enables* autostart, by setting the "Hidden" key (which disables autostart) to false.
- // Explicitly setting this key fixes LP #398303; otherwise our IsAutoStartEnabled method won't find
- // the AutoStartKey, and will erroneously return false.
- autostartfile.SetBoolean (AutoStartKey, false);
- autostartfile.Save (AutoStartUri, true);
- autostartfile.Location = AutoStartUri;
+ Assembly assembly = Assembly.GetExecutingAssembly ();
+ StreamReader reader = new StreamReader (assembly.GetManifestResourceStream ("gnome-do-autostart.desktop"));
+ StreamWriter writer = new StreamWriter (AutoStartFileName);
+ string l;
+ while ((l = reader.ReadLine ()) != null)
+ writer.WriteLine (l);
+ reader.Close ();
+ writer.Close ();
+
+ autostartfile = DesktopItem.NewFromFile (AutoStartFileName, DesktopItemLoadFlags.NoTranslations);
} catch (Exception e) {
Log<SystemService>.Error ("Failed to write initial autostart file: {0}", e.Message);
}
@@ -201,7 +197,7 @@ namespace Do.Platform.Linux
DesktopItem autostart = AutoStartFile;
if (!autostart.Exists ()) {
- Log<SystemService>.Error ("Could not open autostart file {0}", AutoStartUri);
+ Log<SystemService>.Error ("Could not open autostart file {0}", AutoStartFileName);
}
if (autostart.AttrExists (AutoStartKey)) {