Skip to content

Commit

Permalink
Pre-release minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Dec 18, 2016
1 parent 80fca76 commit aec36a2
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 109 deletions.
2 changes: 1 addition & 1 deletion deploy/gedkeeper.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ MimeType=application/x-gedkeeper
Icon=/usr/share/pixmaps/gedkeeper.png
Terminal=false
Type=Application
Categories=Office;Hobby
Categories=Office
StartupNotify=true

11 changes: 10 additions & 1 deletion deploy/gk2_linux_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ cp $DEV_PATH/LICENSE ~/$LIB_PATH
cp -r $DEV_PATH/locales/ ~/$LIB_PATH/
cp -r $DEV_PATH/plugins/ ~/$LIB_PATH/
cp -r $DEV_PATH/scripts/ ~/$LIB_PATH/
cp -r $DEV_PATH/samples/ ~/$LIB_PATH/

chmod -x $LIB_PATH/GKCommon.dll
chmod -x $LIB_PATH/ArborGVT.dll
Expand All @@ -56,9 +57,17 @@ chmod -x $LIB_PATH/LICENSE
find $LIB_PATH/locales -type f -exec chmod -x '{}' \;
find $LIB_PATH/plugins -type f -exec chmod -x '{}' \;
find $LIB_PATH/scripts -type f -exec chmod -x '{}' \;
find $LIB_PATH/samples -type f -exec chmod -x '{}' \;

chmod -x $LIB_PATH/gedkeeper.png
chmod -x $PACK_PATH/usr/share/pixmaps/gedkeeper.png
chmod -x $PACK_PATH/usr/share/applications/gedkeeper.desktop
chmod -x $PACK_PATH/usr/share/mime/packages/application-x-gedkeeper.xml

cd ~/$PACK_PATH
md5deep -r -l usr > DEBIAN/md5sums
#md5deep -r -l usr > DEBIAN/md5sums
#hashdeep -rlc md5 usr > DEBIAN/md5sums
hashdeep -rlc md5 usr | tail -n +6 | awk -F',' '{ print $2 " " $3 }' > DEBIAN/md5sums
cd ..

fakeroot dpkg-deb -b ~/$PACK_PATH/ .
2 changes: 1 addition & 1 deletion locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<h1>Change log</h1>

<p><b>??.12.2016 [v2.9.0]</b><ul>
<p><b>18.12.2016 [v2.9.0]</b><ul>
<li>(+) Added localization for Polish (Jacek).
<li>(*) Fixed problems with European encodings of GEDCOM files.
<li>(*) Small adaptation of import from the Ahnenblatt.
Expand Down
2 changes: 1 addition & 1 deletion locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<h1>История версий</h1>

<p><b>??.12.2016 [v2.9.0]</b><ul>
<p><b>18.12.2016 [v2.9.0]</b><ul>
<li>(+) Добавлена локализация на польский язык (Jacek).
<li>(*) Исправлены проблемы с европейскими кодировками GEDCOM-файлов.
<li>(*) Небольшая адаптация загрузки файлов из программы Ahnenblatt.
Expand Down
16 changes: 8 additions & 8 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ Szukaj patriarchów
Szukaj linki
Archiwum nie znaleziono, dane nie jest załadowany
Skali
Pliki GEDKeeper GEDCOM (*.ged) | * .ged | GEDKeeper GEDCOM zaszyfrowanych plików (*.geds) | * .geds
Wszystkie pliki (*. *) | *. *
Obrazy (*.bmp; *.gif; *.png; *.jpg) | * .bmp; *.gif; *.png, *.jpg
Skrypty (*.lua) | * .lua
Pliki BMP (*.bmp) | * .bmp | Pliki JPEG (*.jpg) | * jpg | Pliki EMF (*.EMF) | * .emf | Pliki PNG (*.png) | * PNG | Pliki GIF (*.gif) | * .gif
Pliki GEDKeeper GEDCOM (*.ged)|*.ged|GEDKeeper GEDCOM zaszyfrowanych plików (*.geds)|*.geds
Wszystkie pliki (*.*)|*.*
Obrazy (*.bmp;*.gif;*.png;*.jpg)|*.bmp;*.gif;*.png;*.jpg
Skrypty (*.lua)|*.lua
Pliki BMP (*.bmp)|*.bmp|Pliki JPEG (*.jpg)|*.jpg|Pliki EMF (*.emf)|*.emf|Pliki PNG (*.png)|*.png|Pliki GIF (*.gif)|*.gif
Przyczyny śmierci
Rodowód
Parametr
Expand All @@ -490,9 +490,9 @@ Mężczyźni
Kobiety
Pole filtra
Rok
Pliki PDF (*.pdf) | * .pdf
Pliki RTF (*.rtf) | * .rtf
Pliki HTML (*.html) | * .html
Pliki PDF (*.pdf)|*.pdf
Pliki RTF (*.rtf)|*.rtf
Pliki HTML (*.html)|*.html
Pliki kopii zapasowej
Tylko poprzedni plik
Odcinając gałęzie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public MessageEventArgs(object message)
if (message == null)
throw new ArgumentNullException("message", @"message cannot be null.");

this.Message = message;
Message = message;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading;
using System.Xml.Serialization;

using GKCommon;
using GKUI;

namespace Externals.SingleInstancing
Expand Down Expand Up @@ -416,9 +415,10 @@ private static IpcParamEx LoadIpcInfoFile(int nId)
return ipcParam;
}

public static void ProcessGlobalMessage(int nId, MainWin mf)
public static void ProcessGlobalMessage(int nId, ISingleInstanceEnforcer mf)
{
if (mf == null) throw new ArgumentNullException("mf");
if (mf == null)
throw new ArgumentNullException("mf");

IpcParamEx ipcMsg = LoadIpcInfoFile(nId);

Expand All @@ -428,7 +428,7 @@ public static void ProcessGlobalMessage(int nId, MainWin mf)

if (vArgs != null) {
MessageEventArgs eArgs = new MessageEventArgs(vArgs);
((ISingleInstanceEnforcer)mf).OnMessageReceived(eArgs);
mf.OnMessageReceived(eArgs);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace Externals.SingleInstancing
/// </summary>
internal class SingleInstanceProxy : MarshalByRefObject
{
private readonly ISingleInstanceEnforcer enforcer;
private readonly ISingleInstanceEnforcer fEnforcer;

/// <summary>
/// Gets or sets the enforcer (first instance of the application) which will receive messages from the new instances of the application.
/// </summary>
public ISingleInstanceEnforcer Enforcer
{
get { return enforcer; }
get { return fEnforcer; }
}

/// <summary>
Expand All @@ -31,7 +31,7 @@ public SingleInstanceProxy(ISingleInstanceEnforcer enforcer)
if (enforcer == null)
throw new ArgumentNullException("enforcer", @"enforcer cannot be null.");

this.enforcer = enforcer;
fEnforcer = enforcer;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class SingleInstanceTracker : IDisposable
{
#region Member Variables

private bool disposed;
private Mutex singleInstanceMutex;
private bool isFirstInstance;
private IChannel ipcChannel;
private readonly SingleInstanceProxy proxy;
private bool fDisposed;
private IChannel fIpcChannel;
private readonly bool fIsFirstInstance;
private readonly SingleInstanceProxy fProxy;
private Mutex fSingleInstanceMutex;

#endregion

Expand All @@ -34,10 +34,10 @@ public bool IsFirstInstance
{
get
{
if (disposed)
if (fDisposed)
throw new ObjectDisposedException("The SingleInstanceTracker object has already been disposed.");

return isFirstInstance;
return fIsFirstInstance;
}
}

Expand All @@ -48,10 +48,10 @@ public ISingleInstanceEnforcer Enforcer
{
get
{
if (disposed)
if (fDisposed)
throw new ObjectDisposedException("The SingleInstanceTracker object has already been disposed.");

return proxy.Enforcer;
return fProxy.Enforcer;
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ public SingleInstanceTracker(string name, SingleInstanceEnforcerRetriever enforc

try
{
singleInstanceMutex = new Mutex(true, name, out isFirstInstance);
fSingleInstanceMutex = new Mutex(true, name, out fIsFirstInstance);

// Do not attempt to construct the IPC channel if there is no need for messages
if (enforcerRetriever != null)
Expand All @@ -94,12 +94,12 @@ public SingleInstanceTracker(string name, SingleInstanceEnforcerRetriever enforc
string proxyUri = "ipc://" + name + "/" + proxyObjectName;

// If no previous instance was found, create a server channel which will provide the proxy to the first created instance
if (isFirstInstance)
if (fIsFirstInstance)
{
// Create an IPC server channel to listen for SingleInstanceProxy object requests
ipcChannel = new IpcServerChannel(name);
fIpcChannel = new IpcServerChannel(name);
// Register the channel and get it ready for use
ChannelServices.RegisterChannel(ipcChannel, false);
ChannelServices.RegisterChannel(fIpcChannel, false);
// Register the service which gets the SingleInstanceProxy object, so it can be accessible by IPC client channels
RemotingConfiguration.RegisterWellKnownServiceType(typeof(SingleInstanceProxy), proxyObjectName, WellKnownObjectMode.Singleton);

Expand All @@ -110,22 +110,22 @@ public SingleInstanceTracker(string name, SingleInstanceEnforcerRetriever enforc
throw new InvalidOperationException("The method delegated by the enforcerRetriever argument returned null. The method must return an ISingleInstanceEnforcer object.");

// Create the first proxy object
proxy = new SingleInstanceProxy(enforcer);
fProxy = new SingleInstanceProxy(enforcer);
// Publish the first proxy object so IPC clients requesting a proxy would receive a reference to it
RemotingServices.Marshal(proxy, proxyObjectName);
RemotingServices.Marshal(fProxy, proxyObjectName);
}
else
{
// Create an IPC client channel to request the existing SingleInstanceProxy object.
ipcChannel = new IpcClientChannel();
fIpcChannel = new IpcClientChannel();
// Register the channel and get it ready for use
ChannelServices.RegisterChannel(ipcChannel, false);
ChannelServices.RegisterChannel(fIpcChannel, false);

// Retreive a reference to the proxy object which will be later used to send messages
proxy = (SingleInstanceProxy)Activator.GetObject(typeof(SingleInstanceProxy), proxyUri);
fProxy = (SingleInstanceProxy)Activator.GetObject(typeof(SingleInstanceProxy), proxyUri);

// Notify the first instance of the application that a new instance was created
proxy.Enforcer.OnNewInstanceCreated(new EventArgs());
fProxy.Enforcer.OnNewInstanceCreated(new EventArgs());
}
}
}
Expand All @@ -149,24 +149,24 @@ public SingleInstanceTracker(string name, SingleInstanceEnforcerRetriever enforc
/// <param name="disposing">true to dispose of managed resources; otherwise false.</param>
protected virtual void Dispose(bool disposing)
{
if (!disposed)
if (!fDisposed)
{
if (disposing)
{
if (singleInstanceMutex != null)
if (fSingleInstanceMutex != null)
{
singleInstanceMutex.Close();
singleInstanceMutex = null;
fSingleInstanceMutex.Close();
fSingleInstanceMutex = null;
}

if (ipcChannel != null)
if (fIpcChannel != null)
{
ChannelServices.UnregisterChannel(ipcChannel);
ipcChannel = null;
ChannelServices.UnregisterChannel(fIpcChannel);
fIpcChannel = null;
}
}

disposed = true;
fDisposed = true;
}
}

Expand All @@ -191,15 +191,15 @@ public void Dispose()
/// <exception cref="SingleInstancing.SingleInstancingException">The SingleInstanceInteractor has failed to send the message to the first application instance. The first instance might have terminated.</exception>
public void SendMessageToFirstInstance(object message)
{
if (disposed)
if (fDisposed)
throw new ObjectDisposedException("The SingleInstanceTracker object has already been disposed.");

if (ipcChannel == null)
if (fIpcChannel == null)
throw new InvalidOperationException("The object was constructed with the SingleInstanceTracker(string name) constructor overload, or with the SingleInstanceTracker(string name, SingleInstanceEnforcerRetriever enforcerRetriever) constructor overload, with enforcerRetriever set to null, thus you cannot send messages to the first instance.");

try
{
proxy.Enforcer.OnMessageReceived(new MessageEventArgs(message));
fProxy.Enforcer.OnMessageReceived(new MessageEventArgs(message));
}
catch (Exception ex)
{
Expand Down
67 changes: 34 additions & 33 deletions projects/GEDKeeper2/GKUI/Controls/GKMapBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,60 +365,61 @@ private static bool GetInetFile(string fileURL, out Stream stream)
public static void RequestGeoCoords(string searchValue, ExtList<GMapPoint> pointsList)
{
if (string.IsNullOrEmpty(searchValue))
{
throw new ArgumentNullException("searchValue");
}

if (pointsList == null)
{
throw new ArgumentNullException("pointsList");
}

Stream stm = null;
try
{
searchValue = searchValue.Trim().Replace(" ", "+");
Stream stm = null;
try
{
searchValue = searchValue.Trim().Replace(" ", "+");

string netQuery = "http://maps.googleapis.com/maps/api/geocode/xml?address={0}&sensor=false&language=ru";
netQuery = string.Format(netQuery, new object[] { searchValue });
string netQuery = "http://maps.googleapis.com/maps/api/geocode/xml?address={0}&sensor=false&language=ru&key=AIzaSyCo57eNeJx7-ws2eei6QgAVUxOnS95IqQM";
netQuery = string.Format(netQuery, new object[] { searchValue });

if (!GetInetFile(netQuery, out stm)) return;
if (!GetInetFile(netQuery, out stm)) return;

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(stm);
XmlNode node = xmlDocument.DocumentElement;
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(stm);
XmlNode node = xmlDocument.DocumentElement;

if (node != null && node.ChildNodes.Count > 0)
{
int num = node.ChildNodes.Count;
for (int i = 0; i < num; i++)
if (node != null && node.ChildNodes.Count > 0)
{
XmlNode xNode = node.ChildNodes[i];
if (xNode.Name == "result")
int num = node.ChildNodes.Count;
for (int i = 0; i < num; i++)
{
XmlNode addressNode = xNode["formatted_address"];
XmlNode geometry = xNode["geometry"];
XmlNode pointNode = geometry["location"];

if (addressNode != null && pointNode != null)
XmlNode xNode = node.ChildNodes[i];
if (xNode.Name == "result")
{
string ptHint = addressNode.InnerText;
double ptLongitude = SysUtils.ParseFloat(pointNode["lng"].InnerText, -1.0);
double ptLatitude = SysUtils.ParseFloat(pointNode["lat"].InnerText, -1.0);
XmlNode addressNode = xNode["formatted_address"];
XmlNode geometry = xNode["geometry"];
XmlNode pointNode = geometry["location"];

if (ptLatitude != -1.0 && ptLongitude != -1.0)
if (addressNode != null && pointNode != null)
{
GMapPoint pt = new GMapPoint(ptLatitude, ptLongitude, ptHint);
pointsList.Add(pt);
string ptHint = addressNode.InnerText;
double ptLongitude = SysUtils.ParseFloat(pointNode["lng"].InnerText, -1.0);
double ptLatitude = SysUtils.ParseFloat(pointNode["lat"].InnerText, -1.0);

if (ptLatitude != -1.0 && ptLongitude != -1.0)
{
GMapPoint pt = new GMapPoint(ptLatitude, ptLongitude, ptHint);
pointsList.Add(pt);
}
}
}
}
}
}
}
finally
{
if (stm != null) stm.Dispose();
finally
{
if (stm != null) stm.Dispose();
}
} catch (Exception ex) {
Logger.LogWrite("GKMapBrowser.RequestGeoCoords(): " + ex.Message);
}
}

Expand Down
Loading

0 comments on commit aec36a2

Please sign in to comment.