Fixed issue where deleting lines while buffer was empty would crash mudlet.
Merge branch 'developmentGH' into mudletDev
Keyboard navigation support for saveVar. Some changes to code formatting for consistency
update to readme pointing to wiki
Build Enhancement: Accommodate Qt Creator Shadow building

Shadow building (compile with multiple Qt Library Versions and types
{Release vs Build}) of object code in directories separate but along-side
the source requires a couple of small changes in Lua subsystem.

Also updates .gitignore to disregard typical object code build directories.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Enhancement: Improved/extended exits GUI for 2D mapper

The GUI formed by dlgRoomExits.{cpp|h} and room_exits.ui combined now
provide full control and aim to enforce relational consistency between the
data items that provide all the exits from a particular room.  All controls
should have tool-tips - some context sensitive and provide support for some
aspects that are not yet implemented in other parts of the code e.g. door
markers for the mapper on exits not in the XY-Plane.  As the controls for
each normal exit are duplicated, labels are not given for the individual
components to save space, instead an expanded disabled dummy with labels
is provided as a Key.  Unfortunately even after this the dialogue is still
a little large and it has been suggested to replace the four radio buttons
that provide control over the door item with a combo-box with the four
fixed values...

Following support methods have been changed/added:
bool TRoom::hasExitStub(int) - modified, to provide a Boolean type result
consistent with functionality.

void TRoom::setExitStub(int, bool) - modified, remove ALL existing stub
entries for the given direction code if the second argument is false, only
adds a new entry if a corresponding one was not present - this is required
for the data storage type (QList) for stubs which could otherwise take
multiple entries for the same key (exit).  Changed second argument to
Boolean type to reflect its functionality.

bool TRoom::hasExitWeight(QString) - new, needed for the GUI to determine
source of weight data for exit.  Normally that detail is hidden from
consumers of this data.

void TRoom::setExitWeight(QString, int) - modified, to permit it to remove
data item for an exit.  Uses zero or negative weight value which
additionally aides route-finding code that consumes this data but requires
only positive weight data.  Removal of specific exit weight data permits
reversion to use of overall weight value set in ROOM's weight.

void TRoom::setDoor(QString, int) - new, implemented previously declared
but not defined code.  First argument as lower case initials for normal
exits in XY-plane and "up", "down", "in", "out" for other normal exits.
Supports special exits though no support at this point in 2D mapper for
these or non-XY-plane exits. Second argument is door type (0=none, 1=open,
2=closed, 3=locked) and value of 0 will remove instance data of any of the
other type.

int TRoom::getDoor(QString) - new, companion to setDoor, uses same first
argument to determine exit to return door code of.  Returns zero for any
exit specified which does not have a door explicitly set.

Note: Parts of code-base still access door data directly at this point,
further work required before that data could be made private to TRoom
class.

void TRoom::setArea(int) - modified, warning for room not having valid
previous area enabled.

bool TRoom::hasExit(int) - modified, method not being in use, re-purposed
to use to test for an actual exit in given normal exit direction.  Test
used is simple, fast and may produce false positives (checks only for exit
to room Id NOT being -1).  A more thorough check would be to check that
mpRoomDB->getRoom( exitId ) != 0 where exitId is value already determined
not to be -1.

bool TRoom::setExit(int, int) - new, uses a direction code as a first
argument to set the exit to the exitId given as second.  Intended to
replace individual setNorth()...setOut() series of methods in cases
requiring iteration through all normal exits.

int TRoom::getExit(int) - new, companion to the new setExit().

bool TRoom::setSpecialExitLock(QString, bool) - new, substitute for
other version which does not need to have the destination room supplied.
Unlike the void method it supplants, it provides a bool return, true on
success.

void TRoom::setSpecialExit(int, QString) - replacement for addSpecialExit()
renamed because now capable of removing a special exit if the first
argument, the exit to room Id is less than one.  Lua command
removeSpecialExit( fromRoomId, cmd ) with no normal return value added for
users' use, eliminating the need to remove all exits and re-adding all
others in order to remove or change just one.  Corresponding
addSpecialExit( fromRoomId, toRoomId, cmd ) now able to change the
toRoomId for an existing exit "cmd" from given fromRoomId room.

void TRoom::removeAllSpecialExitsToRoom(int) - modified, now ensures the
corresponding TArea::exits is updated upon removal of all the special exits
from a room.

void TRoom::auditExits() - modified, missing checks added for up and down
normal exits, and reporting for all normal exits. Code restructured to
avoid use of two "goto" commands and consequent restarts in checking of
special exits if they were to be executed.

int TRoomDB::getArea(TArea *) - commented out prior to removal, it is
mis-named as it returned an integer area Id not a TArea value, pointer or
reference.  Also it's given functionality is already provided by
int TRoomDB::getAreaID(TArea *) and the implied action by
TArea * TRoomDB::getArea(int).


Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Fixup: Add new distinct icon for Room Exits' Dialog

Was unable to insert the icon in previous commit as it was tucked away in
a different prototyping branch and not then accessible!

Modify some tool-tip code to handle unnamed exit rooms better, and correct
erroneous application of tool-tips to the frame for the group of controls
for each exit.

Also adjust spacing on some bits for consistency with rest of file.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Bug Fix: Correct code block in wrong branch of if/else & wrong fixed string

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Enhancement: Room Exits GUI - monitor/detect changes in exit data.

Restores "<dummy>" text items to special exits' room Id and command column
entries if any entry is deleted during editing.

Correctly utilises Dialog modified flag (e.g. * in dialog title) and only
enables save button if actual changes have been made. Defines a TExit class (only internally used at
moment) to record details and provide equality and inequality test
operators.

Abstract details of initialising dialog controls {to
void dlgRoomExits::initExit(...) and TExit * makeExitFromControls(...)} to
reduce the amount of code that would have to be explicitly duplicated but
modified for each exit.

Disables sorting of special exit items in table widget otherwise entries
rearrange themselves as the (sorted) data item is edited.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Merge pull request #30 from SlySven/mudletDev_exitsDialog

Mudlet dev exits dialog
BugFix/Enhancement: Custom Line context menu/GUI

The ability to draw new custom exit lines had been lost in the previous
SF Git master.  This reverts the GUI changes previously made and enhances
the results.  The former dialog is now more intuitive.  It is now possible
to (repetitively) undo line segments placed during the drawing operation
and to modify the characteristics of the line both during drawing and
subsequently.  It is also now possible to modify an existing line by adding
or removing segments also via an enhanced context menu.

Also to aide editing and drawing new lines, a bright yellow target is drawn
around the destination room!  When editing an existing line, the currently
selected custom line vertex is also drawn in yellow rather than orange so
the user knows which point will be modified if a vertex is added or
removed.  The help message used during some 2D mapper operations including
some custom line actions is now positioned centrally at the bottom of the
screen (in a somewhat smaller font size) so it no longer clashes with the
map info display.  It now also appears at the correct point in drawing
custom lines whereas previously it only appeared after the first point was
created by left clicking on the map.

A minor edit to TLUaInterpreter::addCustomLine() now adds support to all
five standard line styles available in current Qt version.

An Icon for the new dialog (custom_lines_properties.ui) has been added to
the resources file and a related icon also created for the custom_lines.ui.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Enhancement: Centralised control of Mudlet version.

Setting the (pre-existing) VERSION qmake variable to a 1.2.3
(major.minor.revision) form and the BUILD variable to nothing (for a
release build) or some non-empty string (possibly with a leading '-'
to act as a separator) creates version information that is uniformly
presented in several places.  This includes on the splash screen, in the
"About Mudlet" dialog, in some communications with the MUD server, and
additionally now within the Lua system for script writers.

In addition I have updated and tidied some detail of, and added myself to
the listed Mudlet contributors in, the "About Mudlet" dialog.

In reviewing the other tab of the "About" dialog that gives a reference to
the Licensing terms it became clear that its claim that Mudlet was
Licensed to GPL version 3 or greater was inconsistent with the text header
of most of the source files which explicitly state version 2 or greater.
To rationalise this I changed the dialog to also say version 2 or later and
then provide the full and exact text of the "current" version 3.  I also
changed that tab's type so that the hyperlinks are now functional.

Whilst paying attention to the GPL text it became clear that some tweaks
to the application start up process was needed to bring Mudlet's behaviour
to that which users of GPL software expect.  This includes responding to
the standard "h / help" and "v / version" arguments when Mudlet is started
from a command line and displaying some specific pieces of text during
normal start-up.  To placate a user that does not wish to be bothered with
the slightly longer splash-screen display process Mudlet now also accepts a
"q / quiet" argument to hide it altogether, or, as is standard for
QtSplashScreen they can also click on it to achieve a similar result.  To
cover the hiatus during start-up the cursor will now change to the OS
standard "Wait" one until the main event loop starts.

THE CORRECTION IN LICENCE TEXT NEEDS TO BE CHECKED BY HEIKO AS IT IS DONE
IN HIS NAME. 8-)

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
BugFix: correct wrong cursor shape setting in part of dialog

Part of the dialog had the cursor set to be "UpArrowCursor" rather than
the desired "ArrowCursor" which cause a unstable (constantly changing size)
cursor with the version/OS-type Qt Libraries I was using.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Merge Prepare: Rearrange project file to make it more merge-able

In preparation for use as Pull Request #32 on:
http://github.com/Chris7/Mudlet2/mudletDev reorganise src.pro so that it
more closely matches my branch
http://github.com/Slysven/Mudlet2/mudletDev_fileLocation
which is lined up as Pull Request #31 on the same one of Chris's branch.

There should not be any change in overall functionality (the qmake'ed
Makefile should produce the same executable both before and after this
commit).

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Tweaks: some small changes to custom line drawing code

Change the circles around custom line points when selected to be solid
instead of dotted - looks better under a wider range of room and exit
size settings.  Simplify the target drawing code to indicated the target
room of a custom exit line - also looks better.

Added code for the first segment of a custom exit line, was previously
explicitly not handled because of the extra code that it would require.

Status bar messages for various custom line exit situations extended to
cover corner cases.

NB. StatusBar is NOT currently showing on at least Qt 5.1 / GNU/Linux
platform.  A code lines or two is needed in mudlet.cpp to generate it.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Merge Prep: Update README & add merge guidance comment to src.pro

As the changes to the project file won't auto-merge I have tested
what needs to be done with meld or kdiff3 to combine the two specified
branches in the proposed order and provided guidance as a (deleted after
performing) comment at the top of the file.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Merge pull request #32 from SlySven/mudletDev_customExitsFixAndEnhance

BugFix/Enhancement: Custom Line context menu/GUI
BugFix: replace global gSysMessage with per Host message stack

The prior system of pushing Error/OK type messages into a global
gSysMessage QStringList where the messages came from cTelnet and
TLuaInterpreter classes as they and the profile were initialised was flawed
because the profile from which they came was not recorded and messages
from one profile leaked into the start up messages of a second, later
profile connection.

This commit uses a QStringList in the cTelnet class which receives messages
via the postMessage(QString) method which has been made public where it was
previously private.  As the destination is the TConsole class which has not
being instantiated at the point that the first messages are created the
postMessage() method stores the messages it receives until one is received
where the TConsole class DOES exist at which time it displays in order all
the stored messages.

The message format that this method processes, with a first line of the
form ".*[.*tag.*].*- +message" tags which correspond to "ERROR","OK",
"INFO","WARN","ALERT" in a case insensitive form are specially coloured.
The tag are converted to all upper case.  If the message has additional
lines they are indented to the same position as the first non-space
character after the hyphen delimiter in the first line, this and at least
one following space must be present (as well as the '[' and ']'
characters).

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
BugFix: correct indexing into Lua state when retrieving Error messages

When multiple errors were encountered during the start up of the lua
subsystem use of a positive (absolute?) index caused only the first error
message to be retrieved, changing to the negative (relative) reference
allows all of them to be collected.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
BugFix: correct indexing into Lua state when retrieving Error messages

When multiple errors were encountered during the start up of the lua
subsystem use of a positive (absolute?) index caused only the first error
message to be retrieved, changing to the negative (relative) reference
allows all of them to be collected.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>