Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon.csproj
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon.csproj	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon.csproj	(revision 6257)
@@ -79,5 +79,5 @@
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="MainWindow.Designer.cs">
+    <Compile Include="MainWindow.designer.cs">
       <DependentUpon>MainWindow.cs</DependentUpon>
     </Compile>
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.Designer.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.Designer.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.Designer.cs	(revision 6257)
@@ -29,8 +29,8 @@
       this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
       this.contextMenuNotifyIcon = new System.Windows.Forms.ContextMenuStrip(this.components);
+      this.homepageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
       this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
-      this.homepageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.mainTabControl = new System.Windows.Forms.TabControl();
       this.tabSlaveView = new System.Windows.Forms.TabPage();
@@ -69,23 +69,4 @@
       this.contextMenuNotifyIcon.Size = new System.Drawing.Size(210, 98);
       // 
-      // showToolStripMenuItem
-      // 
-      this.showToolStripMenuItem.Name = "showToolStripMenuItem";
-      this.showToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
-      this.showToolStripMenuItem.Text = "Show";
-      this.showToolStripMenuItem.Click += new System.EventHandler(this.showToolStripMenuItem_Click);
-      // 
-      // closeToolStripMenuItem
-      // 
-      this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
-      this.closeToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
-      this.closeToolStripMenuItem.Text = "Close";
-      this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
-      // 
-      // toolStripSeparator
-      // 
-      this.toolStripSeparator.Name = "toolStripSeparator";
-      this.toolStripSeparator.Size = new System.Drawing.Size(206, 6);
-      // 
       // homepageToolStripMenuItem
       // 
@@ -95,4 +76,23 @@
       this.homepageToolStripMenuItem.Text = "Visit dev.heuristiclab.com";
       this.homepageToolStripMenuItem.Click += new System.EventHandler(this.homepageToolStripMenuItem_Click);
+      // 
+      // toolStripSeparator
+      // 
+      this.toolStripSeparator.Name = "toolStripSeparator";
+      this.toolStripSeparator.Size = new System.Drawing.Size(206, 6);
+      // 
+      // showToolStripMenuItem
+      // 
+      this.showToolStripMenuItem.Name = "showToolStripMenuItem";
+      this.showToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
+      this.showToolStripMenuItem.Text = "Show";
+      this.showToolStripMenuItem.Click += new System.EventHandler(this.showToolStripMenuItem_Click);
+      // 
+      // closeToolStripMenuItem
+      // 
+      this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
+      this.closeToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
+      this.closeToolStripMenuItem.Text = "Close";
+      this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
       // 
       // mainTabControl
@@ -107,5 +107,5 @@
       this.mainTabControl.Name = "mainTabControl";
       this.mainTabControl.SelectedIndex = 0;
-      this.mainTabControl.Size = new System.Drawing.Size(581, 303);
+      this.mainTabControl.Size = new System.Drawing.Size(581, 369);
       this.mainTabControl.TabIndex = 1;
       // 
@@ -116,5 +116,5 @@
       this.tabSlaveView.Name = "tabSlaveView";
       this.tabSlaveView.Padding = new System.Windows.Forms.Padding(3);
-      this.tabSlaveView.Size = new System.Drawing.Size(573, 277);
+      this.tabSlaveView.Size = new System.Drawing.Size(573, 343);
       this.tabSlaveView.TabIndex = 0;
       this.tabSlaveView.Text = "Overview";
@@ -131,5 +131,5 @@
       this.slaveView.Name = "slaveView";
       this.slaveView.ReadOnly = false;
-      this.slaveView.Size = new System.Drawing.Size(561, 265);
+      this.slaveView.Size = new System.Drawing.Size(561, 331);
       this.slaveView.TabIndex = 0;
       // 
@@ -185,5 +185,5 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.ClientSize = new System.Drawing.Size(605, 327);
+      this.ClientSize = new System.Drawing.Size(605, 393);
       this.Controls.Add(this.mainTabControl);
       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.cs	(revision 6257)
@@ -49,5 +49,5 @@
     }
 
-    private void RestoreFromTray() {
+    public void RestoreFromTray() {
       Show();
       WindowState = FormWindowState.Normal;
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/Program.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/Program.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/Program.cs	(revision 6257)
@@ -12,11 +12,19 @@
     /// </summary>
     [STAThread]
-    static void Main() {
-      KillOtherInstances();
+    static void Main(string[] args) {
+      if (args.Length < 1 || (args.Length > 0 && args[0] != "showui")) {
+        KillOtherInstances();
+      }
 
       Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       MainWindow mw = new MainWindow();
-      mw.MinimizeToTray();
+      if (args.Length < 1 || (args.Length > 0 && args[0] != "showui")) {
+        mw.MinimizeToTray();
+      } else if (args.Length > 0 && args[0] == "showui") {
+        mw.RestoreFromTray();
+      }
+      
+
       mw.Content = new SlaveItem();
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs	(revision 6257)
@@ -28,4 +28,18 @@
 namespace HeuristicLab.Clients.Hive.SlaveCore.Views {
 
+
+  public enum SlaveDisplayStat {
+    Offline,  // not connected to Hive
+    Idle,     // slave has no jobs to calculate
+    Busy,     // jobs are currently running on slave
+    Asleep,   // we are not accepting jobs at the moment
+    NoService // the slave windows service is currently not running
+  }
+
+  public enum CoreConnection {
+    Connected,
+    Offline
+  }
+
   [CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
   [Item("SlaveItem", "Represents a slave which receives messages from the core")]
@@ -33,4 +47,5 @@
     private ISlaveCommunication pipeProxy;
     private DuplexChannelFactory<ISlaveCommunication> pipeFactory;
+    private int lastJobsFetched = 0;
 
     public SlaveItem() {
@@ -51,12 +66,15 @@
     void pipeFactory_Opened(object sender, EventArgs e) {
       OnMessageLogged("Connection to Slave core established");
+      OnCoreConnectionChanged(CoreConnection.Connected);
     }
 
     void pipeFactory_Closed(object sender, EventArgs e) {
       OnMessageLogged("Connection to Slave core closed");
+      OnCoreConnectionChanged(CoreConnection.Offline);
     }
 
     void pipeFactory_Faulted(object sender, EventArgs e) {
       OnMessageLogged("Connection to Slave core faulted");
+      OnCoreConnectionChanged(CoreConnection.Offline);
     }
 
@@ -120,6 +138,7 @@
     public void Sleep() {
       try {
-        if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed)
+        if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed) {
           pipeProxy.Sleep();
+        }
       }
       catch (Exception e) {
@@ -135,7 +154,5 @@
     }
 
-    private int lastJobsFetched = 0;
-
-    public event EventHandler<EventArgs<StatusCommons>> SlaveStatusChanged;
+    public event EventHandler<EventArgs<string>> UserVisibleMessageFired;
     public void OnUserVisibleMessageFired(string msg) {
       var handler = UserVisibleMessageFired;
@@ -143,13 +160,45 @@
     }
 
-    public event EventHandler<EventArgs<string>> UserVisibleMessageFired;
+    public event EventHandler<EventArgs<SlaveDisplayStat>> SlaveDisplayStateChanged;
+    public void OnSlaveDisplayStateChanged(StatusCommons status) {
+      SlaveDisplayStat stat;
+
+      if (status.Jobs.Count > 0) {
+        stat = SlaveDisplayStat.Busy;
+      } else {
+        stat = SlaveDisplayStat.Idle;
+      }
+      if (status.Asleep) {
+        stat = SlaveDisplayStat.Asleep;
+      }
+      if (status.Status == NetworkEnum.WcfConnState.Disconnected || status.Status == NetworkEnum.WcfConnState.Failed) {
+        stat = SlaveDisplayStat.Offline;
+      }
+
+      var handler = SlaveDisplayStateChanged;
+      if (handler != null) handler(this, new EventArgs<SlaveDisplayStat>(stat));
+    }
+
+    public void OnSlaveDisplayStateChanged(SlaveDisplayStat stat) {
+      var handler = SlaveDisplayStateChanged;
+      if (handler != null) handler(this, new EventArgs<SlaveDisplayStat>(stat));
+
+    }
+
+    public event EventHandler<EventArgs<StatusCommons>> SlaveStatusChanged;
     public void OnStatusChanged(StatusCommons status) {
       var handler = SlaveStatusChanged;
       if (handler != null) handler(this, new EventArgs<StatusCommons>(status));
 
+      OnSlaveDisplayStateChanged(status);
+
       int diff = status.JobsFetched - lastJobsFetched;
       lastJobsFetched = status.JobsFetched;
       if (diff > 0) {
-        OnUserVisibleMessageFired(string.Format("HeuristicLab Hive received {0} new jobs!", diff));
+        if (diff == 1) {
+          OnUserVisibleMessageFired("HeuristicLab Hive received 1 new job!");
+        } else {
+          OnUserVisibleMessageFired(string.Format("HeuristicLab Hive received {0} new jobs!", diff));
+        }
       }
     }
@@ -165,4 +214,11 @@
       var handler = SlaveShutdown;
       if (handler != null) handler(this, EventArgs.Empty);
+      OnSlaveDisplayStateChanged(SlaveDisplayStat.NoService);
+    }
+
+    public event EventHandler<EventArgs<CoreConnection>> CoreConnectionChanged;
+    public void OnCoreConnectionChanged(CoreConnection conn) {
+      var handler = CoreConnectionChanged;
+      if (handler != null) handler(this, new EventArgs<CoreConnection>(conn));
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs	(revision 6257)
@@ -45,86 +45,128 @@
     /// </summary>
     private void InitializeComponent() {
-      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Legend legend6 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel5 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
+      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel6 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
+      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel7 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
+      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel8 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
       System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
-      this.btnPauseAll = new System.Windows.Forms.Button();
-      this.btnStopAll = new System.Windows.Forms.Button();
-      this.btnRestart = new System.Windows.Forms.Button();
-      this.btnSleep = new System.Windows.Forms.Button();
+      System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series();
       this.jobChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
-      this.btnRestartService = new System.Windows.Forms.Button();
+      this.coresChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.btnStart = new System.Windows.Forms.Button();
+      this.btnStop = new System.Windows.Forms.Button();
+      this.btnKill = new System.Windows.Forms.Button();
+      this.lblSlaveState = new System.Windows.Forms.Label();
+      this.label1 = new System.Windows.Forms.Label();
       ((System.ComponentModel.ISupportInitialize)(this.jobChart)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.coresChart)).BeginInit();
       this.SuspendLayout();
       // 
-      // btnPauseAll
-      // 
-      this.btnPauseAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.btnPauseAll.Location = new System.Drawing.Point(476, 3);
-      this.btnPauseAll.Name = "btnPauseAll";
-      this.btnPauseAll.Size = new System.Drawing.Size(111, 28);
-      this.btnPauseAll.TabIndex = 2;
-      this.btnPauseAll.Text = "Pause all jobs";
-      this.btnPauseAll.UseVisualStyleBackColor = true;
-      this.btnPauseAll.Click += new System.EventHandler(this.btnSoftPause_Click);
-      // 
-      // btnStopAll
-      // 
-      this.btnStopAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.btnStopAll.Location = new System.Drawing.Point(476, 32);
-      this.btnStopAll.Name = "btnStopAll";
-      this.btnStopAll.Size = new System.Drawing.Size(111, 28);
-      this.btnStopAll.TabIndex = 3;
-      this.btnStopAll.Text = "Stop all jobs";
-      this.btnStopAll.UseVisualStyleBackColor = true;
-      this.btnStopAll.Click += new System.EventHandler(this.btnHardPause_Click);
-      // 
-      // btnRestart
-      // 
-      this.btnRestart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.btnRestart.Location = new System.Drawing.Point(476, 90);
-      this.btnRestart.Name = "btnRestart";
-      this.btnRestart.Size = new System.Drawing.Size(111, 28);
-      this.btnRestart.TabIndex = 4;
-      this.btnRestart.Text = "Restart Core";
-      this.btnRestart.UseVisualStyleBackColor = true;
-      this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click);
-      // 
-      // btnSleep
-      // 
-      this.btnSleep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.btnSleep.Location = new System.Drawing.Point(476, 61);
-      this.btnSleep.Name = "btnSleep";
-      this.btnSleep.Size = new System.Drawing.Size(111, 28);
-      this.btnSleep.TabIndex = 5;
-      this.btnSleep.Text = "Send slave to sleep";
-      this.btnSleep.UseVisualStyleBackColor = true;
-      this.btnSleep.Click += new System.EventHandler(this.btnSleep_Click);
-      // 
       // jobChart
       // 
-      chartArea6.Name = "ChartArea1";
-      this.jobChart.ChartAreas.Add(chartArea6);
-      legend6.Name = "Legend1";
-      this.jobChart.Legends.Add(legend6);
-      this.jobChart.Location = new System.Drawing.Point(3, 3);
+      this.jobChart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+      customLabel5.Text = "Jobs";
+      customLabel6.Text = "Aborted Jobs";
+      customLabel7.Text = "Finished Jobs";
+      customLabel8.Text = "Fetched Jobs";
+      chartArea3.AxisX.CustomLabels.Add(customLabel5);
+      chartArea3.AxisX.CustomLabels.Add(customLabel6);
+      chartArea3.AxisX.CustomLabels.Add(customLabel7);
+      chartArea3.AxisX.CustomLabels.Add(customLabel8);
+      chartArea3.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
+      chartArea3.AxisX.MajorGrid.Enabled = false;
+      chartArea3.AxisX.MajorTickMark.Enabled = false;
+      chartArea3.Name = "ChartArea1";
+      this.jobChart.ChartAreas.Add(chartArea3);
+      legend3.Name = "Legend1";
+      this.jobChart.Legends.Add(legend3);
+      this.jobChart.Location = new System.Drawing.Point(0, 3);
       this.jobChart.Name = "jobChart";
       series6.ChartArea = "ChartArea1";
-      series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Doughnut;
       series6.Legend = "Legend1";
       series6.Name = "Series1";
+      series7.ChartArea = "ChartArea1";
+      series7.Legend = "Legend1";
+      series7.Name = "Series2";
+      series8.ChartArea = "ChartArea1";
+      series8.Legend = "Legend1";
+      series8.Name = "Series3";
+      series9.ChartArea = "ChartArea1";
+      series9.Legend = "Legend1";
+      series9.Name = "Series4";
       this.jobChart.Series.Add(series6);
-      this.jobChart.Size = new System.Drawing.Size(293, 174);
+      this.jobChart.Series.Add(series7);
+      this.jobChart.Series.Add(series8);
+      this.jobChart.Series.Add(series9);
+      this.jobChart.Size = new System.Drawing.Size(280, 156);
       this.jobChart.TabIndex = 7;
       // 
-      // btnRestartService
-      // 
-      this.btnRestartService.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.btnRestartService.Location = new System.Drawing.Point(476, 119);
-      this.btnRestartService.Name = "btnRestartService";
-      this.btnRestartService.Size = new System.Drawing.Size(111, 28);
-      this.btnRestartService.TabIndex = 8;
-      this.btnRestartService.Text = "RestartService";
-      this.btnRestartService.UseVisualStyleBackColor = true;
-      this.btnRestartService.Click += new System.EventHandler(this.btnRestartService_Click);
+      // coresChart
+      // 
+      chartArea4.Name = "ChartArea1";
+      this.coresChart.ChartAreas.Add(chartArea4);
+      legend4.Name = "Legend1";
+      this.coresChart.Legends.Add(legend4);
+      this.coresChart.Location = new System.Drawing.Point(3, 165);
+      this.coresChart.Name = "coresChart";
+      series10.ChartArea = "ChartArea1";
+      series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
+      series10.Legend = "Legend1";
+      series10.Name = "Series1";
+      this.coresChart.Series.Add(series10);
+      this.coresChart.Size = new System.Drawing.Size(277, 135);
+      this.coresChart.TabIndex = 9;
+      // 
+      // btnStart
+      // 
+      this.btnStart.Location = new System.Drawing.Point(467, 111);
+      this.btnStart.Name = "btnStart";
+      this.btnStart.Size = new System.Drawing.Size(75, 23);
+      this.btnStart.TabIndex = 10;
+      this.btnStart.Text = "Start";
+      this.btnStart.UseVisualStyleBackColor = true;
+      this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+      // 
+      // btnStop
+      // 
+      this.btnStop.Location = new System.Drawing.Point(467, 82);
+      this.btnStop.Name = "btnStop";
+      this.btnStop.Size = new System.Drawing.Size(75, 23);
+      this.btnStop.TabIndex = 11;
+      this.btnStop.Text = "Stop";
+      this.btnStop.UseVisualStyleBackColor = true;
+      this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
+      // 
+      // btnKill
+      // 
+      this.btnKill.Location = new System.Drawing.Point(467, 53);
+      this.btnKill.Name = "btnKill";
+      this.btnKill.Size = new System.Drawing.Size(75, 23);
+      this.btnKill.TabIndex = 12;
+      this.btnKill.Text = "Kill";
+      this.btnKill.UseVisualStyleBackColor = true;
+      this.btnKill.Click += new System.EventHandler(this.btnKill_Click);
+      // 
+      // lblSlaveState
+      // 
+      this.lblSlaveState.Location = new System.Drawing.Point(370, 3);
+      this.lblSlaveState.Name = "lblSlaveState";
+      this.lblSlaveState.Size = new System.Drawing.Size(100, 23);
+      this.lblSlaveState.TabIndex = 13;
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(286, 3);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(62, 13);
+      this.label1.TabIndex = 14;
+      this.label1.Text = "Slave State";
       // 
       // SlaveView
@@ -132,14 +174,17 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.btnRestartService);
+      this.Controls.Add(this.label1);
+      this.Controls.Add(this.lblSlaveState);
+      this.Controls.Add(this.btnKill);
+      this.Controls.Add(this.btnStop);
+      this.Controls.Add(this.btnStart);
+      this.Controls.Add(this.coresChart);
       this.Controls.Add(this.jobChart);
-      this.Controls.Add(this.btnSleep);
-      this.Controls.Add(this.btnRestart);
-      this.Controls.Add(this.btnStopAll);
-      this.Controls.Add(this.btnPauseAll);
       this.Name = "SlaveView";
-      this.Size = new System.Drawing.Size(590, 426);
+      this.Size = new System.Drawing.Size(590, 313);
       ((System.ComponentModel.ISupportInitialize)(this.jobChart)).EndInit();
+      ((System.ComponentModel.ISupportInitialize)(this.coresChart)).EndInit();
       this.ResumeLayout(false);
+      this.PerformLayout();
 
     }
@@ -147,10 +192,11 @@
     #endregion
 
-    private System.Windows.Forms.Button btnPauseAll;
-    private System.Windows.Forms.Button btnStopAll;
-    private System.Windows.Forms.Button btnRestart;
-    private System.Windows.Forms.Button btnSleep;
     private System.Windows.Forms.DataVisualization.Charting.Chart jobChart;
-    private System.Windows.Forms.Button btnRestartService;
+    private System.Windows.Forms.DataVisualization.Charting.Chart coresChart;
+    private System.Windows.Forms.Button btnStart;
+    private System.Windows.Forms.Button btnStop;
+    private System.Windows.Forms.Button btnKill;
+    private System.Windows.Forms.Label lblSlaveState;
+    private System.Windows.Forms.Label label1;
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs	(revision 6257)
@@ -21,4 +21,6 @@
 
 using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
 using System.Security.Principal;
 using System.ServiceProcess;
@@ -47,11 +49,21 @@
     }
 
+    private SlaveDisplayStat lastSlaveDisplayStat;
+
+    [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
+    static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, IntPtr lParam);
+
+    const UInt32 BCM_SETSHIELD = 0x160C;
+
     public SlaveView() {
       InitializeComponent();
 
-      if (!CheckRunAsAdmin())
-        btnRestartService.Enabled = false;
-      btnRestart.Enabled = false;
-
+      this.btnKill.FlatStyle = FlatStyle.System;
+      SendMessage(btnKill.Handle, BCM_SETSHIELD, 0, (IntPtr)1);
+
+      lblSlaveState.Text = SlaveDisplayStat.NoService.ToString();
+      btnKill.Enabled = false;
+      btnStart.Enabled = false;
+      btnStop.Enabled = false;
     }
 
@@ -60,4 +72,6 @@
       Content.SlaveShutdown -= new System.EventHandler(Content_SlaveShutdown);
       Content.SlaveStatusChanged -= new System.EventHandler<EventArgs<StatusCommons>>(Content_SlaveStatusChanged);
+      Content.SlaveDisplayStateChanged -= new EventHandler<EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged);
+      Content.CoreConnectionChanged -= new EventHandler<EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
 
       base.DeregisterContentEvents();
@@ -69,4 +83,6 @@
       Content.SlaveShutdown += new System.EventHandler(Content_SlaveShutdown);
       Content.SlaveStatusChanged += new System.EventHandler<EventArgs<StatusCommons>>(Content_SlaveStatusChanged);
+      Content.SlaveDisplayStateChanged += new EventHandler<EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged);
+      Content.CoreConnectionChanged += new EventHandler<EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
     }
     #endregion
@@ -74,6 +90,10 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
+      btnKill.Enabled = false;
+      btnStart.Enabled = false;
+      btnStop.Enabled = false;
+
       if (Content == null) {
-        //nothing to do...        
+        //nothing to do...         
       } else {
         //try to establish a connection to the slave service 
@@ -104,5 +124,6 @@
     #region Event Handlers
     void Content_SlaveStatusChanged(object sender, EventArgs<StatusCommons> e) {
-      RenderChart(e.Value);
+      RenderJobChart(e.Value);
+      RenderCoreChart(e.Value);
     }
 
@@ -110,61 +131,81 @@
       Task.Factory.StartNew(Connector);
     }
+
+    void Content_SlaveDisplayStateChanged(object sender, EventArgs<SlaveDisplayStat> e) {
+      lblSlaveState.Text = e.Value.ToString();
+      lastSlaveDisplayStat = e.Value;
+
+      if (e.Value == SlaveDisplayStat.Asleep || e.Value == SlaveDisplayStat.NoService) {
+        btnKill.Enabled = false;
+        btnStart.Enabled = true;
+        btnStop.Enabled = false;
+      }
+
+      if (e.Value == SlaveDisplayStat.Busy || e.Value == SlaveDisplayStat.Idle || e.Value == SlaveDisplayStat.Offline) {
+        btnKill.Enabled = true;
+        btnStart.Enabled = false;
+        btnStop.Enabled = true;
+      }
+    }
+
+    void Content_CoreConnectionChanged(object sender, EventArgs<CoreConnection> e) {
+      if (e.Value == CoreConnection.Offline) {
+        btnKill.Enabled = false;
+        btnStart.Enabled = false;
+        btnStop.Enabled = false;
+      }
+    }
     #endregion
 
-    private void RenderChart(StatusCommons status) {
+    private void RenderJobChart(StatusCommons status) {
       jobChart.Series[0].Points.Clear();
-
-      DataPoint pJobs = new DataPoint(status.Jobs.Count, status.Jobs.Count);
-      DataPoint pJobsAborted = new DataPoint(status.JobsAborted, status.JobsAborted);
-      DataPoint pJobsDone = new DataPoint(status.JobsFinished, status.JobsFinished);
-      DataPoint pJobsFetched = new DataPoint(status.JobsFetched, status.JobsFetched);
+      jobChart.Series[1].Points.Clear();
+      jobChart.Series[2].Points.Clear();
+      jobChart.Series[3].Points.Clear();
+
+      DataPoint pJobs = new DataPoint(1, status.Jobs.Count);
+      DataPoint pJobsAborted = new DataPoint(2, status.JobsAborted);
+      DataPoint pJobsDone = new DataPoint(3, status.JobsFinished);
+      DataPoint pJobsFetched = new DataPoint(4, status.JobsFetched);
 
       pJobs.LegendText = "Current jobs: " + status.Jobs.Count;
       pJobs.Color = System.Drawing.Color.Orange;
+      pJobs.ToolTip = pJobs.LegendText;
+      jobChart.Series[0].LegendText = pJobs.LegendText;
+      jobChart.Series[0].Points.Add(pJobs);
+
       pJobsAborted.LegendText = "Aborted jobs: " + status.JobsAborted;
       pJobsAborted.Color = System.Drawing.Color.Red;
+      pJobsAborted.ToolTip = pJobsAborted.LegendText;
+      jobChart.Series[1].LegendText = pJobsAborted.LegendText;
+      jobChart.Series[1].Points.Add(pJobsAborted);
+
       pJobsDone.LegendText = "Finished jobs: " + status.JobsFinished;
       pJobsDone.Color = System.Drawing.Color.Green;
+      pJobsDone.ToolTip = pJobsDone.LegendText;
+      jobChart.Series[2].LegendText = pJobsDone.LegendText;
+      jobChart.Series[2].Points.Add(pJobsDone);
+
       pJobsFetched.LegendText = "Fetched jobs: " + status.JobsFetched;
+      pJobsFetched.ToolTip = pJobsFetched.LegendText;
       pJobsFetched.Color = System.Drawing.Color.Blue;
-
-      jobChart.Series[0].Points.Add(pJobs);
-      jobChart.Series[0].Points.Add(pJobsAborted);
-      jobChart.Series[0].Points.Add(pJobsDone);
-      jobChart.Series[0].Points.Add(pJobsFetched);
-    }
-
-    private void btnSoftPause_Click(object sender, System.EventArgs e) {
-      if (Content != null)
-        Content.PauseAll();
-    }
-
-    private void btnHardPause_Click(object sender, System.EventArgs e) {
-      if (Content != null)
-        Content.StopAll();
-    }
-
-    private void btnRestart_Click(object sender, System.EventArgs e) {
-      if (Content != null) {
-        Content.RestartCore();
-        btnRestart.Enabled = false;
-        btnSleep.Enabled = true;
-      }
-    }
-
-    private void btnSleep_Click(object sender, System.EventArgs e) {
-      if (Content != null) {
-        Content.Sleep();
-        btnRestart.Enabled = true;
-        btnSleep.Enabled = false;
-      }
-    }
-
-    private void btnRestartService_Click(object sender, EventArgs e) {
-      if (CheckRunAsAdmin()) {
-        RestartService();
-      } else {
-        MessageBox.Show("You need to run this application as Administrator to restart the service");
-      }
+      jobChart.Series[3].LegendText = pJobsFetched.LegendText;
+      jobChart.Series[3].Points.Add(pJobsFetched);
+    }
+
+    private void RenderCoreChart(StatusCommons statusCommons) {
+      int usedCores = statusCommons.TotalCores - statusCommons.FreeCores;
+      DataPoint pFreeCores = new DataPoint(statusCommons.FreeCores, statusCommons.FreeCores);
+      DataPoint pUsedCores = new DataPoint(usedCores, usedCores);
+
+      coresChart.Series[0].Points.Clear();
+
+      pFreeCores.LegendText = "Free cores: " + statusCommons.FreeCores;
+      pFreeCores.Color = System.Drawing.Color.Green;
+      pUsedCores.LegendText = "Used cores: " + usedCores;
+      pUsedCores.Color = System.Drawing.Color.Red;
+
+      coresChart.Series[0].Points.Add(pFreeCores);
+      coresChart.Series[0].Points.Add(pUsedCores);
     }
 
@@ -181,5 +222,24 @@
     }
 
-    private void RestartService() {
+    private void ElevateApplication() {
+      // Launch itself as administrator
+      ProcessStartInfo proc = new ProcessStartInfo(Application.ExecutablePath, "showui");
+      proc.UseShellExecute = true;
+      proc.WorkingDirectory = Environment.CurrentDirectory;
+      proc.FileName = Application.ExecutablePath;
+      proc.Verb = "runas";
+
+      try {
+        Process.Start(proc);
+      }
+      catch {
+        // The user refused to allow privileges elevation.
+        // Do nothing and return directly ...
+        return;
+      }
+      Application.Exit();  // Quit itself
+    }
+
+    private void StartService() {
       string serviceName = "HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService";
       TimeSpan timeout = TimeSpan.FromMilliseconds(5000);
@@ -202,4 +262,52 @@
       }
     }
+
+    private void StopService() {
+      string serviceName = "HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService";
+      TimeSpan timeout = TimeSpan.FromMilliseconds(5000);
+
+      ServiceController service = new ServiceController(serviceName);
+      try {
+        if (service.Status == ServiceControllerStatus.Running) {
+          service.Stop();
+          service.WaitForStatus(ServiceControllerStatus.Stopped, timeout);
+        }
+      }
+      catch (InvalidOperationException ex) {
+        MessageBox.Show("Error starting service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString());
+      }
+      catch (Exception ex) {
+        MessageBox.Show("Error starting service, exception is: " + Environment.NewLine + ex.ToString());
+      }
+    }
+
+    private void btnKill_Click(object sender, EventArgs e) {
+      if (CheckRunAsAdmin()) {
+        StopService();
+      } else {
+        ElevateApplication();
+      }
+
+    }
+
+    private void btnStop_Click(object sender, EventArgs e) {
+      if (Content != null) {
+        Content.Sleep();
+      }
+    }
+
+    private void btnStart_Click(object sender, EventArgs e) {
+      if (Content != null) {
+        if (lastSlaveDisplayStat == SlaveDisplayStat.Asleep) {
+          Content.RestartCore();
+        } else if (lastSlaveDisplayStat == SlaveDisplayStat.NoService) {
+          if (CheckRunAsAdmin()) {
+            StartService();
+          } else {
+            ElevateApplication();
+          }
+        }
+      }
+    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConfigManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConfigManager.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConfigManager.cs	(revision 6257)
@@ -41,4 +41,9 @@
     }
 
+    /// <summary>
+    /// if the Sleeping is true, the Slave won't accept any new jobs
+    /// </summary>
+    public bool Asleep { get; set; }
+
     public Core Core { get; set; }
     private Slave slave;
@@ -48,4 +53,5 @@
     /// </summary>
     private ConfigManager() {
+      Asleep = false;
       slave = new Slave();
       slave.Id = GetUniqueMachineId();
@@ -84,4 +90,5 @@
       st.TotalCores = slave.Cores.HasValue ? slave.Cores.Value : 0;
       st.FreeCores = GetFreeCores();
+      st.Asleep = ConfigManager.Instance.Asleep;
 
       st.JobsAborted = SlaveStatusInfo.JobsAborted;
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs	(revision 6257)
@@ -365,5 +365,5 @@
     private void DoStartSlave() {
       clientCom.LogMessage("Restart received");
-      StartHeartbeats();
+      ConfigManager.Instance.Asleep = false;
       clientCom.LogMessage("Restart done");
     }
@@ -374,10 +374,7 @@
     /// </summary>    
     private void Sleep() {
-      clientCom.LogMessage("Sleep received");
-      heartbeatManager.StopHeartBeat();
-      heartbeatManager = null;
-      DoStopAll();
-      WcfService.Instance.Disconnect();
-      clientCom.LogMessage("Sleep done");
+      clientCom.LogMessage("Sleep received - not accepting any new jobs");
+      ConfigManager.Instance.Asleep = true;
+      DoPauseAll(); //TODO: or stop? can't decide...      
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs	(revision 6257)
@@ -92,5 +92,5 @@
                 FreeMemory = ConfigManager.GetFreeMemory(),
                 JobProgress = ConfigManager.Instance.GetExecutionTimeOfAllJobs(),
-                AssignJob = true //TODO: check if we want another job
+                AssignJob = !ConfigManager.Instance.Asleep
               };
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/StatusCommons.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/StatusCommons.cs	(revision 6256)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/StatusCommons.cs	(revision 6257)
@@ -50,4 +50,6 @@
     [DataMember]
     public List<JobStatus> Jobs { get; set; }
+    [DataMember]
+    public bool Asleep { get; set; }
 
     public override string ToString() {
