diff --git a/SparkleLib/Defines.cs b/SparkleLib/Defines.cs
index ff7f0e13..8d3ab42e 100644
--- a/SparkleLib/Defines.cs
+++ b/SparkleLib/Defines.cs
@@ -28,4 +28,3 @@ namespace SparkleLib {
public const string INSTALL_DIR = "/app/share/sparkleshare";
}
}
-
diff --git a/SparkleLib/Defines.cs.in b/SparkleLib/Defines.cs.in
index 22364d6b..8ba23317 100755
--- a/SparkleLib/Defines.cs.in
+++ b/SparkleLib/Defines.cs.in
@@ -28,4 +28,3 @@ namespace SparkleLib {
public const string INSTALL_DIR = "@expanded_datadir@/sparkleshare";
}
}
-
diff --git a/SparkleLib/SparkleWatcher.cs b/SparkleLib/SparkleWatcher.cs
index 463fba7f..72681cc7 100755
--- a/SparkleLib/SparkleWatcher.cs
+++ b/SparkleLib/SparkleWatcher.cs
@@ -25,7 +25,7 @@ namespace SparkleLib {
public event ChangeEventEventHandler ChangeEvent = delegate { };
public delegate void ChangeEventEventHandler (FileSystemEventArgs args);
- private Object thread_lock = new Object ();
+ private object thread_lock = new object ();
public SparkleWatcher (string path) : base (path)
diff --git a/SparkleShare/Linux/SparkleController.cs b/SparkleShare/Linux/SparkleController.cs
index 2d56ace3..c6a6852c 100755
--- a/SparkleShare/Linux/SparkleController.cs
+++ b/SparkleShare/Linux/SparkleController.cs
@@ -19,11 +19,11 @@ using System;
using System.Diagnostics;
using System.IO;
-using SparkleLib;
-
using Gtk;
using Mono.Unix.Native;
+using SparkleLib;
+
namespace SparkleShare {
public class SparkleController : SparkleControllerBase {
@@ -44,34 +44,35 @@ namespace SparkleShare {
// start SparkleShare automatically at login
public override void CreateStartupItem ()
{
- string autostart_path = Path.Combine (
- Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "autostart");
-
+ string autostart_path = Path.Combine (Config.HomePath, ".config", "autostart");
string autostart_file_path = Path.Combine (autostart_path, "org.sparkleshare.SparkleShare.Autostart.desktop");
if (File.Exists (autostart_file_path))
- return;
+ return;
- if (!Directory.Exists (autostart_path))
+ if (!Directory.Exists (autostart_path))
Directory.CreateDirectory (autostart_path);
- try {
+ string autostart_exec = "sparkleshare";
+
+ if (Defines.INSTALL_DIR.StartsWith ("/app/"))
+ autostart_exec = "xdg-app run org.sparkleshare.SparkleShare";
+
+ try {
File.WriteAllText (autostart_file_path,
"[Desktop Entry]\n" +
- "Type=Application\n" +
"Name=SparkleShare\n" +
- "Exec=sparkleshare\n" +
+ "Type=Application\n" +
+ "Exec=" + autostart_exec + "\n" +
"Icon=org.sparkleshare.SparkleShare\n" +
"Terminal=false\n" +
- "X-GNOME-Autostart-enabled=true\n" +
- "Categories=Network");
+ "X-GNOME-Autostart-enabled=true\n");
- SparkleLogger.LogInfo ("Controller", "Added SparkleShare to login items");
+ SparkleLogger.LogInfo ("Controller", "Added SparkleShare to startup items");
} catch (Exception e) {
- SparkleLogger.LogInfo ("Controller", "Failed adding SparkleShare to login items: " + e.Message);
+ SparkleLogger.LogInfo ("Controller", "Failed to add SparkleShare to startup items", e);
}
-
}
@@ -130,7 +131,7 @@ namespace SparkleShare {
var process = new SparkleProcess ("gvfs-set-attribute", SparkleConfig.DefaultConfig.FoldersPath + " " +
"metadata::custom-icon-name org.sparkleshare.SparkleShare");
- process.StartAndWaitForExit ();
+ process.StartAndWaitForExit ();
}
@@ -142,10 +143,7 @@ namespace SparkleShare {
public override void OpenFile (string path)
{
- Process process = new Process ();
- process.StartInfo.FileName = "xdg-open";
- process.StartInfo.Arguments = "\"" + path + "\"";
- process.Start ();
+ new SparkleProcess ("xdg-open", "\"" + path + "\"").Start ();
}
diff --git a/SparkleShare/Linux/SparkleEventLog.cs b/SparkleShare/Linux/SparkleEventLog.cs
index 6dde5b2b..701f2704 100755
--- a/SparkleShare/Linux/SparkleEventLog.cs
+++ b/SparkleShare/Linux/SparkleEventLog.cs
@@ -48,10 +48,11 @@ namespace SparkleShare {
IconName = "org.sparkleshare.SparkleShare";
Gdk.Rectangle monitor_0_rect = Gdk.Screen.Default.GetMonitorGeometry (0);
- SetSizeRequest (480, (int) (monitor_0_rect.Height * 0.8));
+ SetSizeRequest (480, 640);
+ Resize (480, (int)(monitor_0_rect.Height * 0.8));
this.pos_x = (int) (monitor_0_rect.Width * 0.61);
- this.pos_y = (int) (monitor_0_rect.Height * 0.5 - (HeightRequest * 0.5));
+ this.pos_y = (int) (monitor_0_rect.Height * 0.5 - (AllocatedHeight * 0.5));
this.size_label = new Label () { Xalign = 0, Markup = "Size: …" };
this.history_label = new Label () { Xalign = 0, Markup = "History: …" };
diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs
index 0424bc63..13966a1f 100644
--- a/SparkleShare/SparkleControllerBase.cs
+++ b/SparkleShare/SparkleControllerBase.cs
@@ -239,7 +239,7 @@ namespace SparkleShare {
}
- private int reopen_attempt_counts = 0;
+ int reopen_attempt_counts = 0;
public void HandleReopen ()
{
@@ -323,7 +323,7 @@ namespace SparkleShare {
}
- private void CheckRepositories ()
+ void CheckRepositories ()
{
lock (this.check_repos_lock) {
string path = Config.FoldersPath;
@@ -385,7 +385,7 @@ namespace SparkleShare {
}
- private void AddRepository (string folder_path)
+ void AddRepository (string folder_path)
{
SparkleRepoBase repo = null;
string folder_name = Path.GetFileName (folder_path);
@@ -459,7 +459,7 @@ namespace SparkleShare {
}
- private void OnFolderActivity (object o, FileSystemEventArgs args)
+ void OnFolderActivity (object o, FileSystemEventArgs args)
{
if (args != null && args.FullPath.EndsWith (".xml") &&
args.ChangeType == WatcherChangeTypes.Created) {
@@ -470,7 +470,7 @@ namespace SparkleShare {
}
- private void StartupInviteScan ()
+ void StartupInviteScan ()
{
foreach (string invite in Directory.GetFiles (FoldersPath, "*.xml")) {
HandleInvite (invite);
@@ -478,13 +478,13 @@ namespace SparkleShare {
}
- private void HandleInvite (FileSystemEventArgs args)
+ void HandleInvite (FileSystemEventArgs args)
{
HandleInvite (args.FullPath);
}
- private void HandleInvite (string path)
+ void HandleInvite (string path)
{
if (this.fetcher != null &&
this.fetcher.IsActive) {
@@ -517,7 +517,7 @@ namespace SparkleShare {
// Fires events for the current syncing state
- private void UpdateState ()
+ void UpdateState ()
{
bool has_unsynced_repos = false;
bool has_syncing_repos = false;
@@ -705,7 +705,7 @@ namespace SparkleShare {
}
- private void ClearDirectoryAttributes (string path)
+ void ClearDirectoryAttributes (string path)
{
if (!Directory.Exists (path))
return;
@@ -723,7 +723,7 @@ namespace SparkleShare {
}
- private bool IsSymlink (string file)
+ bool IsSymlink (string file)
{
FileAttributes attributes = File.GetAttributes (file);
return ((attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint);
diff --git a/SparkleShare/Windows/SparkleController.cs b/SparkleShare/Windows/SparkleController.cs
index fe9911a9..d4aa63df 100644
--- a/SparkleShare/Windows/SparkleController.cs
+++ b/SparkleShare/Windows/SparkleController.cs
@@ -24,21 +24,18 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
-using Forms = System.Windows.Forms;
-using Microsoft.Win32;
-using SparkleLib;
using System.Windows;
+using Forms = System.Windows.Forms;
+using Microsoft.Win32;
+using SparkleLib;
namespace SparkleShare {
public class SparkleController : SparkleControllerBase {
- private int ssh_agent_pid;
-
-
- public SparkleController () : base ()
+ public SparkleController ()
{
}