scroll bars in screenshot view as needed; keyboard shortcuts in screenshot view;...
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 17 Sep 2016 13:22:23 +0000 (16:22 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 17 Sep 2016 13:22:23 +0000 (16:22 +0300)
13 files changed:
src/java/netxms-eclipse/AgentManager/plugin.xml
src/java/netxms-eclipse/AgentManager/src/org/netxms/ui/eclipse/agentmanager/views/ScreenshotView.java
webui/webapp/AgentManager/META-INF/MANIFEST.MF
webui/webapp/AgentManager/plugin.xml
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_cs.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_de.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_es.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_fr.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_pt.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_ru.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/messages_zh_CN.properties
webui/webapp/AgentManager/src/org/netxms/ui/eclipse/agentmanager/views/ScreenshotView.java

index 56cf86f..5528888 100644 (file)
             id="org.netxms.ui.eclipse.agentmanager.commands.open_agent_configuration_manager"
             name="Agent configuration manager">
       </command>
+      <command
+            id="org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"
+            name="Save screenshot">
+      </command>
+      <command
+            id="org.netxms.ui.eclipse.agentmanager.commands.copy_screenshot"
+            name="Copy screenshot">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.contexts">
+      <context
+            id="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            name="Screenshot view"
+            parentId="org.eclipse.ui.contexts.window">
+      </context>
+   </extension>
+   <extension
+         point="org.eclipse.ui.bindings">
+      <key
+            commandId="org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"
+            contextId="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            schemeId="org.netxms.ui.eclipse.defaultKeyBinding"
+            sequence="M1+S">
+      </key>
+      <key
+            commandId="org.netxms.ui.eclipse.agentmanager.commands.copy_screenshot"
+            contextId="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            schemeId="org.netxms.ui.eclipse.defaultKeyBinding"
+            sequence="M1+C">
+      </key>
    </extension>
 
 </plugin>
index 98b85a7..978c436 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2014 Victor Kirhenshtein
+ * Copyright (C) 2003-2016 Victor Kirhenshtein
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,15 +28,21 @@ import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.dnd.Clipboard;
 import org.eclipse.swt.dnd.ImageTransfer;
 import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
@@ -44,8 +50,11 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.netxms.client.NXCSession;
+import org.netxms.client.Table;
 import org.netxms.ui.eclipse.actions.RefreshAction;
 import org.netxms.ui.eclipse.agentmanager.Activator;
 import org.netxms.ui.eclipse.agentmanager.Messages;
@@ -53,6 +62,7 @@ import org.netxms.ui.eclipse.console.resources.SharedIcons;
 import org.netxms.ui.eclipse.jobs.ConsoleJob;
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;
 import org.netxms.ui.eclipse.tools.MessageDialogHelper;
+import org.netxms.ui.eclipse.tools.WidgetHelper;
 
 /**
  * Screenshot view
@@ -63,7 +73,12 @@ public class ScreenshotView extends ViewPart
 
    private NXCSession session;
    private long nodeId;
+   private String userSession;
+   private String userName;
    private Image image;
+   private String errorMessage;
+   private String imageInfo;
+   private ScrolledComposite scroller;
    private Canvas canvas;
    private byte[] byteImage;
    private Action actionRefresh;
@@ -95,42 +110,185 @@ public class ScreenshotView extends ViewPart
    public void createPartControl(Composite parent)
    {
       parent.setLayout(new FillLayout());
-      canvas = new Canvas(parent, SWT.NONE);
+      
+      scroller = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+      
+      canvas = new Canvas(scroller, SWT.NONE);
       canvas.addPaintListener(new PaintListener() {
          public void paintControl(PaintEvent e)
          {
+            GC gc = e.gc;
             if (image != null)
             {
-               GC gc = e.gc;
-               gc.drawImage(image, 10, 10);
+               gc.drawImage(image, 0, 0);
+               gc.drawText(imageInfo, 10, image.getImageData().height + 10);
+            }
+            else if (errorMessage != null)
+            {
+               gc.setForeground(canvas.getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
+               gc.setFont(JFaceResources.getBannerFont());
+               gc.drawText(errorMessage, 10, 10, true);
             }
          }
       });
+      
+      scroller.setContent(canvas);
+      scroller.setExpandVertical(true);
+      scroller.setExpandHorizontal(true);
+      scroller.getVerticalBar().setIncrement(20);
+      scroller.getHorizontalBar().setIncrement(20);
+      scroller.addControlListener(new ControlAdapter() {
+         public void controlResized(ControlEvent e)
+         {
+            updateScrollerSize();
+         }
+      });
+      
+      activateContext();
       createActions();
       contributeToActionBars();
       refresh();
    }
-
+   
+   /**
+    * Update scroller size 
+    */
+   private void updateScrollerSize()
+   {
+      if (image != null)
+      {
+         ImageData d = image.getImageData();
+         Point pt = WidgetHelper.getTextExtent(canvas, imageInfo);
+         scroller.setMinSize(new Point(Math.max(d.width, pt.x + 20), d.height + pt.y + 15));
+      }
+      else if (errorMessage != null)
+      {
+         Point pt = WidgetHelper.getTextExtent(canvas, errorMessage);
+         scroller.setMinSize(new Point(pt.x + 20, pt.y + 20));
+      }
+      else
+      {
+         scroller.setMinSize(new Point(0, 0));
+      }
+   }
+   
+   /**
+    * Activate context
+    */
+   private void activateContext()
+   {
+      IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+      if (contextService != null)
+      {
+         contextService.activateContext("org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"); //$NON-NLS-1$
+      }
+   }
+   
    /**
     * Get new screenshot and refresh image
     */
    public void refresh()
    {
       final NXCSession session = (NXCSession)ConsoleSharedData.getSession();
-      new ConsoleJob(Messages.get().ScreenshotView_JobTitle, this, Activator.PLUGIN_ID, null) {
+      ConsoleJob job = new ConsoleJob(Messages.get().ScreenshotView_JobTitle, this, Activator.PLUGIN_ID, null) {
          @Override
          protected void runInternal(IProgressMonitor monitor) throws Exception
          {
-            byteImage = session.takeScreenshot(nodeId, "Console"); //$NON-NLS-1$
-            final ImageData data = new ImageData(new ByteArrayInputStream(byteImage));
-            runInUIThread(new Runnable() {
-               @Override
-               public void run()
+            try
+            {
+               if (userSession == null)
+               {
+                  Table sessions = session.queryAgentTable(nodeId, "Agent.SessionAgents");
+                  if ((sessions != null) && (sessions.getRowCount() > 0))
+                  {
+                     int colIndexName = sessions.getColumnIndex("SESSION_NAME");
+                     int colIndexUser = sessions.getColumnIndex("USER_NAME");
+                     for(int i = 0; i < sessions.getRowCount(); i++)
+                     {
+                        String n = sessions.getCellValue(i, colIndexName);
+                        if ("Console".equalsIgnoreCase(n))
+                        {
+                           userSession = n;
+                           userName = sessions.getCellValue(i, colIndexUser);
+                           break;
+                        }
+                     }
+                     
+                     if (userSession == null)
+                     {
+                        // Console session not found, use first available
+                        userSession = sessions.getCellValue(0, colIndexName);
+                        userName = sessions.getCellValue(0, colIndexUser);
+                     }
+                  }
+               }
+               
+               if (userSession == null)
                {
-                  image = new Image(getDisplay(), data);
-                  canvas.redraw();
+                  // Cannot find any connected sessions
+                  runInUIThread(new Runnable() {
+                     @Override
+                     public void run()
+                     {
+                        if (image != null)
+                           image.dispose();
+                        
+                        image = null;
+                        errorMessage = "ERROR (No active sessions or session agent is not running)";
+                        canvas.redraw();
+                        
+                        actionCopyToClipboard.setEnabled(false);
+                        actionSave.setEnabled(false);
+                        
+                        updateScrollerSize();
+                     }
+                  });
+                  return;
                }
-            });
+               
+               byteImage = session.takeScreenshot(nodeId, userSession);
+               final ImageData data = new ImageData(new ByteArrayInputStream(byteImage));
+               runInUIThread(new Runnable() {
+                  @Override
+                  public void run()
+                  {
+                     if (image != null)
+                        image.dispose();
+                     
+                     image = new Image(getDisplay(), data);
+                     imageInfo = userName + "@" + userSession;
+                     errorMessage = null;
+                     canvas.redraw();
+
+                     actionCopyToClipboard.setEnabled(true);
+                     actionSave.setEnabled(true);
+                     
+                     updateScrollerSize();
+                  }
+               });
+            }
+            catch(Exception e)
+            {
+               byteImage = null;
+               final String emsg = e.getLocalizedMessage();
+               runInUIThread(new Runnable() {
+                  @Override
+                  public void run()
+                  {
+                     if (image != null)
+                        image.dispose();
+                     
+                     image = null;
+                     errorMessage = (emsg != null) ? String.format("ERROR (%s)", emsg) : "ERROR";
+                     canvas.redraw();
+                     
+                     actionCopyToClipboard.setEnabled(false);
+                     actionSave.setEnabled(false);
+                     
+                     updateScrollerSize();
+                  }
+               });
+            }
          }
 
          @Override
@@ -138,7 +296,9 @@ public class ScreenshotView extends ViewPart
          {
             return Messages.get().ScreenshotView_JobError;
          }
-      }.start();
+      };
+      job.setUser(false);
+      job.start();
    }
    
    /**
@@ -146,8 +306,9 @@ public class ScreenshotView extends ViewPart
     */
    private void createActions()
    {      
-      actionRefresh = new RefreshAction()
-      { 
+      final IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
+      
+      actionRefresh = new RefreshAction(this) { 
          @Override
          public void run()
          {
@@ -159,11 +320,16 @@ public class ScreenshotView extends ViewPart
          @Override
          public void run()
          {
+            if (image == null)
+               return;
             ImageTransfer imageTransfer = ImageTransfer.getInstance();
             final Clipboard clipboard = new Clipboard(canvas.getDisplay());
             clipboard.setContents(new Object[] { image.getImageData() }, new Transfer[] { imageTransfer });
          }
       };
+      actionCopyToClipboard.setActionDefinitionId("org.netxms.ui.eclipse.agentmanager.commands.copy_screenshot"); //$NON-NLS-1$
+      handlerService.activateHandler(actionCopyToClipboard.getActionDefinitionId(), new ActionHandler(actionCopyToClipboard));
+      actionCopyToClipboard.setEnabled(false);
       
       actionSave = new Action(Messages.get().ScreenshotView_Save, SharedIcons.SAVE) {
          @Override
@@ -171,7 +337,10 @@ public class ScreenshotView extends ViewPart
          {
             saveImage();
          }
-      }; 
+      };
+      actionSave.setActionDefinitionId("org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"); //$NON-NLS-1$
+      handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
+      actionSave.setEnabled(false);
    }
    
    /**
@@ -179,6 +348,9 @@ public class ScreenshotView extends ViewPart
     */
    private void saveImage()
    {
+      if (byteImage == null)
+         return;
+      
       FileDialog fd = new FileDialog(getSite().getShell(), SWT.SAVE);
       fd.setText(Messages.get().ScreenshotView_SaveScreenshot);
       fd.setFilterExtensions(new String[] { "*.png", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
@@ -260,4 +432,15 @@ public class ScreenshotView extends ViewPart
       manager.add(new Separator());
       manager.add(actionRefresh);
    }
+
+   /* (non-Javadoc)
+    * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+    */
+   @Override
+   public void dispose()
+   {
+      if (image != null)
+         image.dispose();
+      super.dispose();
+   }
 }
index 04bf03d..4e8cc50 100644 (file)
@@ -2,16 +2,16 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Agent Management Plug-In for NXMC
 Bundle-SymbolicName: org.netxms.ui.eclipse.agentmanager;singleton:=true
-Bundle-Version: 2.0.1
+Bundle-Version: 2.1.0
 Bundle-Activator: org.netxms.ui.eclipse.agentmanager.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.rap.ui;bundle-version="2.3.1",
  org.eclipse.rap.ui.forms;bundle-version="2.3.1",
- org.eclipse.core.runtime;bundle-version="3.8.0",
- org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.0",
- org.netxms.webui.core;bundle-version="2.0.0",
- org.netxms.ui.eclipse.objectbrowser;bundle-version="2.0.0",
- org.netxms.ui.eclipse.nxsl;bundle-version="2.0.0",
+ org.eclipse.core.runtime;bundle-version="3.12.0",
+ org.netxms.ui.eclipse.clientlibrary;bundle-version="2.1.0",
+ org.netxms.webui.core;bundle-version="2.1.0",
+ org.netxms.ui.eclipse.objectbrowser;bundle-version="2.1.0",
+ org.netxms.ui.eclipse.nxsl;bundle-version="2.0.7",
  org.eclipse.rap.filedialog;bundle-version="3.1.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 56cf86f..5528888 100644 (file)
             id="org.netxms.ui.eclipse.agentmanager.commands.open_agent_configuration_manager"
             name="Agent configuration manager">
       </command>
+      <command
+            id="org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"
+            name="Save screenshot">
+      </command>
+      <command
+            id="org.netxms.ui.eclipse.agentmanager.commands.copy_screenshot"
+            name="Copy screenshot">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.contexts">
+      <context
+            id="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            name="Screenshot view"
+            parentId="org.eclipse.ui.contexts.window">
+      </context>
+   </extension>
+   <extension
+         point="org.eclipse.ui.bindings">
+      <key
+            commandId="org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"
+            contextId="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            schemeId="org.netxms.ui.eclipse.defaultKeyBinding"
+            sequence="M1+S">
+      </key>
+      <key
+            commandId="org.netxms.ui.eclipse.agentmanager.commands.copy_screenshot"
+            contextId="org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"
+            schemeId="org.netxms.ui.eclipse.defaultKeyBinding"
+            sequence="M1+C">
+      </key>
    </extension>
 
 </plugin>
index ba9befe..030c918 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete configuration
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get configuration content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get configurations list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save configuration
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 69254f8..42cc45f 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete config list
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get config content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get config list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save config
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 7bb387d..9350163 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete config list
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get config content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get config list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save config
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 605d03f..02a1494 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete config list
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get config content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get config list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save config
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 65434dc..e9885cc 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete configuration
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get configuration content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get configurations list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save configuration
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 65434dc..e9885cc 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete configuration
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get configuration content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get configurations list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save configuration
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 2cbf17d..52d9fda 100644 (file)
@@ -1,7 +1,7 @@
 AgentConfigEditorView_Error=\u041e\u0448\u0438\u0431\u043a\u0430
-AgentConfigEditorView_PartName=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 -
+AgentConfigEditorView_PartName=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 - 
 AgentConfigEditorView_Save=&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c
-AgentConfigEditorView_SaveError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u0433\u0435\u043d\u0442\u0430:
+AgentConfigEditorView_SaveError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u0433\u0435\u043d\u0442\u0430: 
 DeploymentStatusLabelProvider_Completed=\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e
 DeploymentStatusLabelProvider_Failed=\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u043e
 DeploymentStatusLabelProvider_Init=\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f
@@ -20,7 +20,7 @@ OpenPackageManager_ErrorOpenView=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u04
 PackageDeploymentMonitor_ColumnMessage=\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435
 PackageDeploymentMonitor_ColumnNode=\u0423\u0437\u0435\u043b
 PackageDeploymentMonitor_ColumnStatus=\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435
-PackageDeploymentMonitor_RestartFailedInstallation=\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043d\u0435\u0441\u043e\u0441\u0442\u043e\u044f\u0432\u0448\u0438\u0435\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438
+PackageDeploymentMonitor_RestartFailedInstallation=\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439
 PackageManager_ColumnDescription=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
 PackageManager_ColumnFile=\u0424\u0430\u0439\u043b
 PackageManager_ColumnID=\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440
@@ -47,26 +47,26 @@ PackageManager_OpenDatabase=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0431\u0
 PackageManager_OpenError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430
 PackageManager_PkgDeleteError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
 PackageManager_PkgDepCompleted=\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e
-PackageManager_PkgFileOpenError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0430\u043a\u0435\u0442\u0435:
-PackageManager_PkgListLoadError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
+PackageManager_PkgFileOpenError=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0430\u043a\u0435\u0442\u0435:
+PackageManager_PkgListLoadError=\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
 PackageManager_RemoveAction=&\u0423\u0434\u0430\u043b\u0438\u0442\u044c
 PackageManager_SelectFile=\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u0430\u043a\u0435\u0442\u0430
 PackageManager_UnlockDatabase=\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430
 PackageManager_UploadPackage=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u0430\u043a\u0435\u0442\u0430
 SaveConfigDialog_Cancel=\u041f\u0440\u0435\u0440\u0432\u0430\u0442\u044c
 SaveConfigDialog_Discard=&\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c
-SaveConfigDialog_ModifiedMessage=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0432 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:\n\t"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"\t\t\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\n\t"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"\t\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445\n\t"\u041d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c"\t\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\n\t"\u041e\u0442\u043c\u0435\u043d\u0430"\t\t\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a
+SaveConfigDialog_ModifiedMessage=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:\n\t"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"\t\t\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\n\t"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"\t\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445\n\t"\u041d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c"\t\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\n\t"\u041e\u0442\u043c\u0435\u043d\u0430"\t\t\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a
 SaveConfigDialog_Save=&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c
 SaveConfigDialog_SaveApply=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 &\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c
 SaveConfigDialog_UnsavedChanges=\u041d\u0435\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f
-SaveStoredConfigDialog_SaveWarning=\u0424\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d. \n \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435, \u043e\u0442\u0432\u0440\u0433\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.
+SaveStoredConfigDialog_SaveWarning=\u0424\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d. \n \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435, \u043b\u0438\u0431\u043e \u043e\u0442\u0432\u0440\u0433\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.
 ScreenshotView_AllFiles=\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b
 ScreenshotView_CannotCreateFile=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 %s: %s
-ScreenshotView_CannotSaveImage=\u041e\u0448\u0438\u0431\u043a\u0430 \u0444\u043e\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 %s: %s
+ScreenshotView_CannotSaveImage=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 %s: %s
 ScreenshotView_CopyToClipboard=\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c
 ScreenshotView_Error=\u041e\u0448\u0438\u0431\u043a\u0430
 ScreenshotView_JobError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u0430
-ScreenshotView_JobTitle=\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u0430
+ScreenshotView_JobTitle=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043d\u0438\u043c\u043a\u0430 \u044d\u043a\u0440\u0430\u043d\u0430
 ScreenshotView_PartTitle=\u0421\u043d\u0438\u043c\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u0430 - %s
 ScreenshotView_PngFiles=PNG \u0444\u0430\u0439\u043b
 ScreenshotView_Save=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c...
@@ -74,13 +74,17 @@ ScreenshotView_SaveScreenshot=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u
 ServerStoredAgentConfigEditorView_ConfigFile=\u0424\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
 ServerStoredAgentConfigEditorView_Delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
 ServerStoredAgentConfigEditorView_Filter=\u0424\u0438\u043b\u044c\u0442\u0440
+ServerStoredAgentConfigEditorView_JobDelete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e
 ServerStoredAgentConfigEditorView_JobError_Delete=\u041e\u0448\u0438\u0431\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
 ServerStoredAgentConfigEditorView_JobError_GetContent=\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430
 ServerStoredAgentConfigEditorView_JobError_GetList=\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
 ServerStoredAgentConfigEditorView_JobError_MoveDown=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u043d\u0438\u0437
 ServerStoredAgentConfigEditorView_JobError_MoveUp=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0432\u0435\u0440\u0445
 ServerStoredAgentConfigEditorView_JobError_Save=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
-ServerStoredAgentConfigEditorView_JobTitle_CreateNew=\u0421\u043e\u0445\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e
+ServerStoredAgentConfigEditorView_JobMoveDown=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432\u043d\u0438\u0437
+ServerStoredAgentConfigEditorView_JobMoveUp=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432\u0432\u0435\u0440\u0445
+ServerStoredAgentConfigEditorView_JobSave=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e
+ServerStoredAgentConfigEditorView_JobTitle_CreateNew=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430
 ServerStoredAgentConfigEditorView_MoveDown=\u0412\u043d\u0438\u0437
 ServerStoredAgentConfigEditorView_MoveUp=\u0412\u0432\u0435\u0440\u0445
index d5d2e0c..0530ad6 100644 (file)
@@ -74,12 +74,16 @@ ScreenshotView_SaveScreenshot=Save Screenshot
 ServerStoredAgentConfigEditorView_ConfigFile=Configuration File
 ServerStoredAgentConfigEditorView_Delete=Delete
 ServerStoredAgentConfigEditorView_Filter=Filter
+ServerStoredAgentConfigEditorView_JobDelete=Delete configuration
 ServerStoredAgentConfigEditorView_JobError_Delete=Cannot delete configuration
 ServerStoredAgentConfigEditorView_JobError_GetContent=Cannot get configuration content
 ServerStoredAgentConfigEditorView_JobError_GetList=Cannot get configuration list
 ServerStoredAgentConfigEditorView_JobError_MoveDown=Cannot move element down
 ServerStoredAgentConfigEditorView_JobError_MoveUp=Cannot move element up
 ServerStoredAgentConfigEditorView_JobError_Save=Cannot save configuration
+ServerStoredAgentConfigEditorView_JobMoveDown=Move configuration down
+ServerStoredAgentConfigEditorView_JobMoveUp=Move configuration up
+ServerStoredAgentConfigEditorView_JobSave=Save configuration
 ServerStoredAgentConfigEditorView_JobTitle_CreateNew=Create new configuration
 ServerStoredAgentConfigEditorView_JobTitle_GetContent=Get configuration file content
 ServerStoredAgentConfigEditorView_MoveDown=Move down
index 964101c..39b902c 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2014 Victor Kirhenshtein
+ * Copyright (C) 2003-2016 Victor Kirhenshtein
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,22 +24,31 @@ import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.rap.rwt.RWT;
 import org.eclipse.rap.rwt.client.service.JavaScriptExecutor;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.netxms.client.NXCSession;
+import org.netxms.client.Table;
 import org.netxms.ui.eclipse.actions.RefreshAction;
 import org.netxms.ui.eclipse.agentmanager.Activator;
 import org.netxms.ui.eclipse.agentmanager.Messages;
@@ -47,6 +56,7 @@ import org.netxms.ui.eclipse.console.DownloadServiceHandler;
 import org.netxms.ui.eclipse.console.resources.SharedIcons;
 import org.netxms.ui.eclipse.jobs.ConsoleJob;
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;
+import org.netxms.ui.eclipse.tools.WidgetHelper;
 
 /**
  * Screenshot view
@@ -57,7 +67,12 @@ public class ScreenshotView extends ViewPart
 
    private NXCSession session;
    private long nodeId;
+   private String userSession;
+   private String userName;
    private Image image;
+   private String errorMessage;
+   private String imageInfo;
+   private ScrolledComposite scroller;
    private Canvas canvas;
    private byte[] byteImage;
    private Action actionRefresh;
@@ -88,42 +103,180 @@ public class ScreenshotView extends ViewPart
    public void createPartControl(Composite parent)
    {
       parent.setLayout(new FillLayout());
-      canvas = new Canvas(parent, SWT.NONE);
+      
+      scroller = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+      
+      canvas = new Canvas(scroller, SWT.NONE);
       canvas.addPaintListener(new PaintListener() {
          public void paintControl(PaintEvent e)
          {
+            GC gc = e.gc;
             if (image != null)
             {
-               GC gc = e.gc;
-               gc.drawImage(image, 10, 10);
+               gc.drawImage(image, 0, 0);
+               gc.drawText(imageInfo, 10, image.getImageData().height + 10);
+            }
+            else if (errorMessage != null)
+            {
+               gc.setForeground(canvas.getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
+               gc.setFont(JFaceResources.getBannerFont());
+               gc.drawText(errorMessage, 10, 10, true);
             }
          }
       });
+      
+      scroller.setContent(canvas);
+      scroller.setExpandVertical(true);
+      scroller.setExpandHorizontal(true);
+      scroller.addControlListener(new ControlAdapter() {
+         public void controlResized(ControlEvent e)
+         {
+            updateScrollerSize();
+         }
+      });
+      
+      activateContext();
       createActions();
       contributeToActionBars();
       refresh();
    }
-
+   
+   /**
+    * Update scroller size 
+    */
+   private void updateScrollerSize()
+   {
+      if (image != null)
+      {
+         ImageData d = image.getImageData();
+         Point pt = WidgetHelper.getTextExtent(canvas, imageInfo);
+         scroller.setMinSize(new Point(Math.max(d.width, pt.x + 20), d.height + pt.y + 15));
+      }
+      else if (errorMessage != null)
+      {
+         Point pt = WidgetHelper.getTextExtent(canvas, errorMessage);
+         scroller.setMinSize(new Point(pt.x + 20, pt.y + 20));
+      }
+      else
+      {
+         scroller.setMinSize(new Point(0, 0));
+      }
+   }
+   
+   /**
+    * Activate context
+    */
+   private void activateContext()
+   {
+      IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+      if (contextService != null)
+      {
+         contextService.activateContext("org.netxms.ui.eclipse.agentmanager.context.ScreenshotView"); //$NON-NLS-1$
+      }
+   }
+   
    /**
     * Get new screenshot and refresh image
     */
    public void refresh()
    {
       final NXCSession session = (NXCSession)ConsoleSharedData.getSession();
-      new ConsoleJob(Messages.get().ScreenshotView_JobTitle, this, Activator.PLUGIN_ID, null) {
+      ConsoleJob job = new ConsoleJob(Messages.get().ScreenshotView_JobTitle, this, Activator.PLUGIN_ID, null) {
          @Override
          protected void runInternal(IProgressMonitor monitor) throws Exception
          {
-            byteImage = session.takeScreenshot(nodeId, "Console"); //$NON-NLS-1$
-            final ImageData data = new ImageData(new ByteArrayInputStream(byteImage));
-            runInUIThread(new Runnable() {
-               @Override
-               public void run()
+            try
+            {
+               if (userSession == null)
+               {
+                  Table sessions = session.queryAgentTable(nodeId, "Agent.SessionAgents");
+                  if ((sessions != null) && (sessions.getRowCount() > 0))
+                  {
+                     int colIndexName = sessions.getColumnIndex("SESSION_NAME");
+                     int colIndexUser = sessions.getColumnIndex("USER_NAME");
+                     for(int i = 0; i < sessions.getRowCount(); i++)
+                     {
+                        String n = sessions.getCellValue(i, colIndexName);
+                        if ("Console".equalsIgnoreCase(n))
+                        {
+                           userSession = n;
+                           userName = sessions.getCellValue(i, colIndexUser);
+                           break;
+                        }
+                     }
+                     
+                     if (userSession == null)
+                     {
+                        // Console session not found, use first available
+                        userSession = sessions.getCellValue(0, colIndexName);
+                        userName = sessions.getCellValue(0, colIndexUser);
+                     }
+                  }
+               }
+               
+               if (userSession == null)
                {
-                  image = new Image(getDisplay(), data);
-                  canvas.redraw();
+                  // Cannot find any connected sessions
+                  runInUIThread(new Runnable() {
+                     @Override
+                     public void run()
+                     {
+                        if (image != null)
+                           image.dispose();
+                        
+                        image = null;
+                        errorMessage = "ERROR (No active sessions or session agent is not running)";
+                        canvas.redraw();
+                        
+                        actionSave.setEnabled(false);
+                        
+                        updateScrollerSize();
+                     }
+                  });
+                  return;
                }
-            });
+               
+               byteImage = session.takeScreenshot(nodeId, userSession);
+               final ImageData data = new ImageData(new ByteArrayInputStream(byteImage));
+               runInUIThread(new Runnable() {
+                  @Override
+                  public void run()
+                  {
+                     if (image != null)
+                        image.dispose();
+                     
+                     image = new Image(getDisplay(), data);
+                     imageInfo = userName + "@" + userSession;
+                     errorMessage = null;
+                     canvas.redraw();
+
+                     actionSave.setEnabled(true);
+                     
+                     updateScrollerSize();
+                  }
+               });
+            }
+            catch(Exception e)
+            {
+               byteImage = null;
+               final String emsg = e.getLocalizedMessage();
+               runInUIThread(new Runnable() {
+                  @Override
+                  public void run()
+                  {
+                     if (image != null)
+                        image.dispose();
+                     
+                     image = null;
+                     errorMessage = (emsg != null) ? String.format("ERROR (%s)", emsg) : "ERROR";
+                     canvas.redraw();
+                     
+                     actionSave.setEnabled(false);
+                     
+                     updateScrollerSize();
+                  }
+               });
+            }
          }
 
          @Override
@@ -131,7 +284,9 @@ public class ScreenshotView extends ViewPart
          {
             return Messages.get().ScreenshotView_JobError;
          }
-      }.start();
+      };
+      job.setUser(false);
+      job.start();
    }
    
    /**
@@ -139,8 +294,9 @@ public class ScreenshotView extends ViewPart
     */
    private void createActions()
    {      
-      actionRefresh = new RefreshAction()
-      {
+      final IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
+      
+      actionRefresh = new RefreshAction(this) { 
          @Override
          public void run()
          {
@@ -154,7 +310,10 @@ public class ScreenshotView extends ViewPart
          {
             saveImage();
          }
-      }; 
+      };
+      actionSave.setActionDefinitionId("org.netxms.ui.eclipse.agentmanager.commands.save_screenshot"); //$NON-NLS-1$
+      handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
+      actionSave.setEnabled(false);
    }
    
    /**
@@ -229,4 +388,15 @@ public class ScreenshotView extends ViewPart
       manager.add(new Separator());
       manager.add(actionRefresh);
    }
+
+   /* (non-Javadoc)
+    * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+    */
+   @Override
+   public void dispose()
+   {
+      if (image != null)
+         image.dispose();
+      super.dispose();
+   }
 }