public MainClass(string [] args) { isFirstRun = false; CheckDataFolders(); BuildNlogConfig(); logger.Info("Starting MonoTorrent"); SetProcessName("monotorrent"); userEngineSettings = new UserEngineSettings(); portController = new ListenPortController(userEngineSettings); Application.Init (); Console.Out.WriteLine("IS FIRST RUN?!?! " + isFirstRun); mainWindow = new MainWindow (userEngineSettings, portController, isFirstRun); // This is so we can use IconEntry button // Use Gnome.Program instead of Gtk.Application? //Gnome.Program program = new Gnome.Program("monotorrent", "0.1", Gnome.Modules.UI, args); try{ Application.Run(); } catch(Exception e){ Console.Out.WriteLine(e.ToString()); Application.Init(); UnhandledExceptionDialog exDialog = new UnhandledExceptionDialog(e); exDialog.Run(); mainWindow.Stop(); exDialog.Destroy(); } portController.Stop(); }
public MainClass(string [] args) { isFirstRun = false; CheckDataFolders(); BuildNlogConfig(); logger.Info("Starting MonoTorrent"); SetProcessName("monotorrent"); userEngineSettings = new UserEngineSettings(); portController = new ListenPortController(userEngineSettings); Application.Init(); Console.Out.WriteLine("IS FIRST RUN?!?! " + isFirstRun); mainWindow = new MainWindow(userEngineSettings, portController, isFirstRun); // This is so we can use IconEntry button // Use Gnome.Program instead of Gtk.Application? //Gnome.Program program = new Gnome.Program("monotorrent", "0.1", Gnome.Modules.UI, args); try{ Application.Run(); } catch (Exception e) { Console.Out.WriteLine(e.ToString()); Application.Init(); UnhandledExceptionDialog exDialog = new UnhandledExceptionDialog(e); exDialog.Run(); mainWindow.Stop(); exDialog.Destroy(); } portController.Stop(); }
public MainWindow (UserEngineSettings userEngineSettings, ListenPortController portController, bool isFirstRun): base (Gtk.WindowType.Toplevel) { prefSettings = new PreferencesSettings (); this.userEngineSettings = userEngineSettings; this.portController = portController; userTorrentSettings = new UserTorrentSettings (); interfaceSettings = new InterfaceSettings (); labels = new ArrayList (); torrents = new Dictionary<MonoTorrent.Client.TorrentManager,Gtk.TreeIter> (); selectLabelTreeView = new TreeView(); Build (); BuildTray(); BuildPiecesTreeView(); BuildTorrentTreeView(); BuildPeerTreeView(); BuildFileTreeView(); BuildLabelTreeView(); BuildOptionsPage(); torrentController.engine.StatsUpdate += OnUpdateStats; torrentController.engine.ConnectionManager.PeerConnected += OnPeerConnected; torrentController.engine.ConnectionManager.PeerDisconnected += OnPeerDisconnected; GLib.Timeout.Add (1000, new GLib.TimeoutHandler (updateView)); RestoreInterface (); //portController = new ListenPortController(userEngineSettings); if (prefSettings.UpnpEnabled) portController.Start(); torrentController.LoadStoredTorrents (); RestoreLabels (); folderWatcher = new TorrentFolderWatcher (new DirectoryInfo (prefSettings.ImportLocation)); folderWatcher.TorrentFound += torrentController.OnTorrentFound; if (prefSettings.ImportEnabled) { logger.Info ("Starting import folder watcher"); folderWatcher.StartWatching (); } rssManagerController = new RssManagerController(torrentController); rssManagerController.StartWatchers(); if(isFirstRun) OpenDruid(); }