[main] Do proper OS detection
This commit is contained in:
parent
53e28cf061
commit
fa1e2f7c96
|
@ -14,7 +14,6 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using Gtk;
|
|
||||||
using Mono.Unix;
|
using Mono.Unix;
|
||||||
using Mono.Unix.Native;
|
using Mono.Unix.Native;
|
||||||
using System;
|
using System;
|
||||||
|
@ -45,8 +44,6 @@ namespace SparkleShare {
|
||||||
public static void Main (string [] args)
|
public static void Main (string [] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
SetProcessName ("sparkleshare");
|
|
||||||
|
|
||||||
// Use translations
|
// Use translations
|
||||||
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
|
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
|
||||||
|
|
||||||
|
@ -87,15 +84,24 @@ namespace SparkleShare {
|
||||||
if (show_help)
|
if (show_help)
|
||||||
ShowHelp (p);
|
ShowHelp (p);
|
||||||
|
|
||||||
// TODO: Detect this properly
|
|
||||||
string Platform = "Lin";
|
|
||||||
|
|
||||||
if (Platform.Equals ("Lin"))
|
switch (Environment.OSVersion.Platform) {
|
||||||
|
|
||||||
|
case PlatformID.Unix:
|
||||||
|
SetProcessName ("sparkleshare");
|
||||||
Controller = new SparkleLinController ();
|
Controller = new SparkleLinController ();
|
||||||
// else if (Platform.Equals ("Mac"))
|
break;
|
||||||
|
|
||||||
|
case PlatformID.MacOSX:
|
||||||
//Controller = new SparkleMacController ();
|
//Controller = new SparkleMacController ();
|
||||||
// else if (Platform.Equals ("Win"))
|
break;
|
||||||
|
|
||||||
|
case PlatformID.Win32NT:
|
||||||
//Controller = new SparkleWinController ();
|
//Controller = new SparkleWinController ();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!hide_ui) {
|
if (!hide_ui) {
|
||||||
|
|
||||||
|
@ -144,7 +150,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sets the unix process name to 'sparkleshare' instead of 'mono'
|
// Sets the Unix process name to 'sparkleshare' instead of 'mono'
|
||||||
private static void SetProcessName (string name)
|
private static void SetProcessName (string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue