[main] Do proper OS detection

This commit is contained in:
Hylke Bons 2010-11-20 14:47:18 +00:00
parent 842c8683a8
commit 930671beff

View file

@ -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) {
Controller = new SparkleLinController ();
// else if (Platform.Equals ("Mac")) case PlatformID.Unix:
// Controller = new SparkleMacController (); SetProcessName ("sparkleshare");
// else if (Platform.Equals ("Win")) Controller = new SparkleLinController ();
// Controller = new SparkleWinController (); break;
case PlatformID.MacOSX:
//Controller = new SparkleMacController ();
break;
case PlatformID.Win32NT:
//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)
{ {