Skip to content

Commit

Permalink
Merge branch 'release/2.4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jan 21, 2025
2 parents 63f7e0a + 3ed2b09 commit 992794c
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 44 deletions.
13 changes: 11 additions & 2 deletions AEMManager/AemInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,22 @@ private void InitializeNotifyIcon() {

this.NotifyIcon.ContextMenu = contextMenu;

mNotifyIcon.Text = this.Name;
SetNotifyIconText(this.Name);
mNotifyIcon.Visible = this.ShowInTaskbar;

string trayIcon = "trayicon_disabled";
mNotifyIcon.Icon = IconCache.GetIcon(this.IconSet, this.CustomIconPath, trayIcon);
}

private void SetNotifyIconText(String text)
{
if (text.Length > 64)
{
text = text.Substring(0, 62) + "…";
}
mNotifyIcon.Text = text;
}

void propertiesMenuItem_Click(object sender, EventArgs e) {
AemInstanceDialog dialog = new AemInstanceDialog(this);
dialog.StartPosition = FormStartPosition.CenterScreen;
Expand Down Expand Up @@ -542,7 +551,7 @@ public void UpdateNofiyIconText(BundleStatus pBundleStatus) {
break;
}

this.NotifyIcon.Text = this.Name + " (" + statusText + ")";
SetNotifyIconText(this.Name + " (" + statusText + ")");
this.NotifyIcon.Icon = IconCache.GetIcon(this.IconSet, this.CustomIconPath, trayIcon);

// show baloon message if instance was started up
Expand Down
6 changes: 3 additions & 3 deletions AEMManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("wcm.io")]
[assembly: AssemblyProduct("wcm.io AEM Manager")]
[assembly: AssemblyCopyright("©2010-2024 diva-e, wcm.io")]
[assembly: AssemblyCopyright("©2010-2025 diva-e, wcm.io")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -28,8 +28,8 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.4.1.0")]
[assembly: AssemblyFileVersion("2.4.1.0")]
[assembly: AssemblyVersion("2.4.2.0")]
[assembly: AssemblyFileVersion("2.4.2.0")]

// Configure log4net using the .config file
[assembly: log4net.Config.XmlConfiguratorAttribute(Watch = true)]
110 changes: 72 additions & 38 deletions AEMManager/util/SystemUtil.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.Win32;

namespace AEMManager.Util {
namespace AEMManager.Util
{

static class SystemUtil {
static class SystemUtil
{

/// <summary>
/// Saved current position/state of given form in registry.
/// </summary>
/// <param name="pfrm">Form instance</param>
public static void SaveWindowPos(Form pfrm) {
public static void SaveWindowPos(Form pfrm)
{
RegistryKey key = RegistryUtil.GetUserKey(pfrm);

if (pfrm.MaximizeBox) {
if (pfrm.WindowState != FormWindowState.Minimized) {
if (IsMaximizable(pfrm))
{
if (pfrm.WindowState != FormWindowState.Minimized)
{
key.SetValue("WindowPos_WindowState", (int)pfrm.WindowState);
}
pfrm.WindowState = FormWindowState.Normal;
Expand All @@ -26,7 +29,8 @@ public static void SaveWindowPos(Form pfrm) {
key.SetValue("WindowPos_WindowX", pfrm.Location.X);
key.SetValue("WindowPos_WindowY", pfrm.Location.Y);

if (pfrm.FormBorderStyle == FormBorderStyle.Sizable || pfrm.FormBorderStyle == FormBorderStyle.SizableToolWindow) {
if (IsSizable(pfrm))
{
key.SetValue("WindowPos_WindowWidth", pfrm.Size.Width);
key.SetValue("WindowPos_WindowHeight", pfrm.Size.Height);
}
Expand All @@ -38,51 +42,81 @@ public static void SaveWindowPos(Form pfrm) {
/// Restores the last saved position/state of given form from the registry.
/// </summary>
/// <param name="pfrm">Form instance</param>
public static void RestoreWindowPos(Form pfrm, int left = 0, int top = 0, int width = 0, int height = 0, FormWindowState windowState = FormWindowState.Normal) {
public static void RestoreWindowPos(Form pfrm)
{
int screenWidth = SystemInformation.WorkingArea.Width;
int screenHeight = SystemInformation.WorkingArea.Height;
int left = 0;
int top = 0;
int width = 0;
int height = 0;
FormWindowState windowState = FormWindowState.Normal;

// read saved values from registry
RegistryKey key = RegistryUtil.GetUserKey(pfrm);
try {
pfrm.Location = new Point((int)key.GetValue("WindowPos_WindowX", left), (int)key.GetValue("WindowPos_WindowY", top));
if (pfrm.FormBorderStyle == FormBorderStyle.Sizable || pfrm.FormBorderStyle == FormBorderStyle.SizableToolWindow) {
pfrm.Size = new Size((int)key.GetValue("WindowPos_WindowWidth", width), (int)key.GetValue("WindowPos_WindowHeight", height));
try
{
left = (int)key.GetValue("WindowPos_WindowX", 0);
top = (int)key.GetValue("WindowPos_WindowY", 0);
if (IsSizable(pfrm))
{
width = (int)key.GetValue("WindowPos_WindowWidth", width);
height = (int)key.GetValue("WindowPos_WindowHeight", height);
}
if (pfrm.MaximizeBox) {
pfrm.WindowState = (FormWindowState)key.GetValue("WindowPos_WindowState", windowState);
if (IsMaximizable(pfrm))
{
windowState = (FormWindowState)key.GetValue("WindowPos_WindowState", windowState);
}
}
catch (Exception) {
if (left > 0 && top > 0) {
pfrm.Location = new Point(left, top);
}
if (pfrm.FormBorderStyle == FormBorderStyle.Sizable || pfrm.FormBorderStyle == FormBorderStyle.SizableToolWindow) {
if (width > 0 && height > 0) {
pfrm.Size = new Size(width, height);
}
}
if (pfrm.MaximizeBox) {
pfrm.WindowState = windowState;
}
catch (Exception)
{
// ignore
}
finally {
finally
{
key.Close();
}

if (pfrm.FormBorderStyle == FormBorderStyle.Sizable || pfrm.FormBorderStyle == FormBorderStyle.SizableToolWindow) {
if (pfrm.Width > SystemInformation.VirtualScreen.Width) {
pfrm.Width = SystemInformation.VirtualScreen.Width - 20;
// restore window position (with ensuring window stays in virtual screen size)
if (IsSizable(pfrm) && width > 0 && height > 0)
{
if (width > screenWidth)
{
width = screenWidth - 20;
}
if (pfrm.Height > SystemInformation.VirtualScreen.Height) {
pfrm.Height = SystemInformation.VirtualScreen.Height - 20;
if (height > screenHeight)
{
height = screenHeight - 20;
}
pfrm.Size = new Size(width, height);
}
if (pfrm.Left + pfrm.Width > SystemInformation.VirtualScreen.Width) {
pfrm.Left = SystemInformation.VirtualScreen.Width - pfrm.Width - 10;
if (left > 0 && top > 0)
{
if (left + pfrm.Width > screenWidth)
{
left = 10;
}
if (top + pfrm.Height > screenHeight)
{
top = 10;
}
pfrm.Location = new Point(left, top);
}
if (pfrm.Top + pfrm.Height > SystemInformation.VirtualScreen.Height) {
pfrm.Top = SystemInformation.VirtualScreen.Height - pfrm.Height - 10;
if (IsMaximizable(pfrm))
{
pfrm.WindowState = windowState;
}
}

private static bool IsSizable(Form pfrm)
{
return pfrm.FormBorderStyle == FormBorderStyle.Sizable || pfrm.FormBorderStyle == FormBorderStyle.SizableToolWindow;
}

}
private static bool IsMaximizable(Form pfrm)
{
return pfrm.MaximizeBox;
}

}
}
2 changes: 1 addition & 1 deletion AEMManagerSetup/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="AEM Manager" Language="1033" UpgradeCode="58391141-13e1-403c-9fa6-3759099bdb29" Manufacturer="wcm.io" Version="2.4.1.0" InstallerVersion="200">
<Package Name="AEM Manager" Language="1033" UpgradeCode="58391141-13e1-403c-9fa6-3759099bdb29" Manufacturer="wcm.io" Version="2.4.2.0" InstallerVersion="200">


<MajorUpgrade DowngradeErrorMessage="A newer version of AEM Manager is already installed." />
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,17 @@ From the AEM Manager window you can configure preferences via File > Preferences
It is recommended to install [Otros Log Viewer](https://github.com/otros-systems/otroslogviewer) and configure it in the preference dialog.

Here you will find a customized Log-importer configuration so Otros Log Viewer will understand the default AEM log file format by default: [otros-config](https://github.com/wcm-io/wcm-io-tooling/tree/develop/misc/log-analysis/otros-config).


Trouble Shooting
-----------

If AEM Manager is running and the window disappears - try this:

1. Move the mouse cursor over the icon in the taskbar and click the right mouse button. The following pop-up should appear:

![Popup Taskbar](/resources/doc-images/aem-manager-pop-up-taskbar.png)

2. Click on "Move" and on the right arrow key of your keyboard while holding the drag and drop cursor.

The AEM Manager Window should appear again
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 992794c

Please sign in to comment.