Testing a merge.
authorZorg <zorgiepoo@gmail.com>
Tue, 05 Apr 2011 16:05:41 -0400
changeset 5105 79faa1130011
parent 5085 e8944ed92b61 (current diff)
parent 5104 e31409482740 (diff)
child 5108 b7483e29ea8c
Testing a merge.
QTfrontend/M3Panel.mm
--- a/QTfrontend/CocoaInitializer.h	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/CocoaInitializer.h	Tue Apr 05 16:05:41 2011 -0400
@@ -1,7 +1,23 @@
 /*
- * Copyright (C) 2008 Remko Troncon
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+// see original example here http://el-tramo.be/blog/mixing-cocoa-and-qt
+
 #ifndef COCOAINITIALIZER_H
 #define COCOAINITIALIZER_H
 
@@ -13,8 +29,7 @@
 
     private:
         class Private;
-        Private* d;
-                Private* c;
+        Private* c;
 };
 
 #endif
--- a/QTfrontend/CocoaInitializer.mm	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/CocoaInitializer.mm	Tue Apr 05 16:05:41 2011 -0400
@@ -1,7 +1,23 @@
 /*
- * Copyright (C) 2008 Remko Troncon
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+// see original example here http://el-tramo.be/blog/mixing-cocoa-and-qt
+
 #include "CocoaInitializer.h"
 
 #include <AppKit/AppKit.h>
@@ -10,23 +26,19 @@
 
 class CocoaInitializer::Private
 {
-	public:
-		NSAutoreleasePool* autoReleasePool_;
+    public:
+        NSAutoreleasePool* pool;
 };
 
 CocoaInitializer::CocoaInitializer()
 {
-	d = new CocoaInitializer::Private();
-        c = new CocoaInitializer::Private();
-	NSApplicationLoad();
-        c->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
-	d->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
+    c = new CocoaInitializer::Private();
+    NSApplicationLoad();
+    c->pool = [[NSAutoreleasePool alloc] init];
 }
 
 CocoaInitializer::~CocoaInitializer()
 {
-	[d->autoReleasePool_ release];
-        [c->autoReleasePool_ release];
-	delete c;
-	delete d;
+    [c->pool release];
+    delete c;
 }
--- a/QTfrontend/InstallController.h	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/InstallController.h	Tue Apr 05 16:05:41 2011 -0400
@@ -20,11 +20,11 @@
 #define INSTALLCONTROLLER_H
 
 class InstallController
-        {
+{
     public:
         virtual ~InstallController();
 
         virtual void showInstallController() = 0;
-        };
+};
 
 #endif
--- a/QTfrontend/M3Panel.h	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/M3Panel.h	Tue Apr 05 16:05:41 2011 -0400
@@ -22,7 +22,7 @@
 #include "InstallController.h"
 
 class M3Panel : public InstallController
-        {
+{
     public:
         M3Panel(void);
         ~M3Panel();
@@ -32,6 +32,6 @@
     private:
         class Private;
         Private* c;
-        };
+};
 
 #endif
--- a/QTfrontend/M3Panel.mm	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/M3Panel.mm	Tue Apr 05 16:05:41 2011 -0400
@@ -23,26 +23,25 @@
 
 class M3Panel::Private
 {
-public:
+    public:
         M3InstallController *install;
 };
 
 M3Panel::M3Panel(void)
 {
-	c = new Private;
+    c = new Private;
 
-	c->install = [[M3InstallController alloc] init];
-	[c->install retain];
-
+    c->install = [[M3InstallController alloc] init];
+    [c->install retain];
 }
 
 M3Panel::~M3Panel()
 {
-	[c->install release];
-	delete c;
+    [c->install release];
+    delete c;
 }
 
 void M3Panel::showInstallController()
 {
-        [c->install displayInstaller];
+    [c->install displayInstaller];
 }
--- a/QTfrontend/SparkleAutoUpdater.mm	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/SparkleAutoUpdater.mm	Tue Apr 05 16:05:41 2011 -0400
@@ -1,7 +1,23 @@
 /*
- * Copyright (C) 2008 Remko Troncon
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+// see original example here http://el-tramo.be/blog/mixing-cocoa-and-qt
+
 #include "SparkleAutoUpdater.h"
 
 #include <Cocoa/Cocoa.h>
@@ -9,29 +25,28 @@
 
 class SparkleAutoUpdater::Private
 {
-	public:
-		SUUpdater* updater;
+    public:
+        SUUpdater* updater;
 };
 
 SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
 {
-	d = new Private;
+    d = new Private;
 
-	d->updater = [SUUpdater sharedUpdater];
-	[d->updater retain];
+    d->updater = [SUUpdater sharedUpdater];
+    [d->updater retain];
 
-	NSURL* url = [NSURL URLWithString:
-			[NSString stringWithUTF8String: aUrl.toUtf8().data()]];
-	[d->updater setFeedURL: url];
+    NSURL* url = [NSURL URLWithString:[NSString stringWithUTF8String:aUrl.toUtf8().data()]];
+    [d->updater setFeedURL:url];
 }
 
 SparkleAutoUpdater::~SparkleAutoUpdater()
 {
-	[d->updater release];
-	delete d;
+    [d->updater release];
+    delete d;
 }
 
 void SparkleAutoUpdater::checkForUpdates()
 {
-	[d->updater checkForUpdatesInBackground];
+    [d->updater checkForUpdatesInBackground];
 }
--- a/QTfrontend/chatwidget.cpp	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/chatwidget.cpp	Tue Apr 05 16:05:41 2011 -0400
@@ -31,6 +31,7 @@
 #include <QCursor>
 #include <QScrollBar>
 #include <QItemSelectionModel>
+#include <QLabel>
 
 #include "hwconsts.h"
 #include "SDLs.h"
@@ -142,7 +143,7 @@
     chatEditLine->setMaxLength(300);
     connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
 
-    mainLayout.addWidget(chatEditLine, 1, 0);
+    mainLayout.addWidget(chatEditLine, 2, 0);
 
     chatText = new QTextBrowser(this);
     chatText->document()->setDefaultStyleSheet(STYLE);
@@ -152,7 +153,7 @@
     chatText->setOpenLinks(false);
     connect(chatText, SIGNAL(anchorClicked(const QUrl&)),
         this, SLOT(linkClicked(const QUrl&)));
-    mainLayout.addWidget(chatText, 0, 0);
+    mainLayout.addWidget(chatText, 0, 0, 2, 1);
 
     chatNicks = new QListWidget(this);
     chatNicks->setMinimumHeight(10);
@@ -165,7 +166,12 @@
     connect(chatNicks, SIGNAL(currentRowChanged(int)),
         this, SLOT(chatNickSelected(int)));
 
-    mainLayout.addWidget(chatNicks, 0, 1, -1, 1);
+    mainLayout.addWidget(chatNicks, 1, 1, 2, 1);
+
+    lblCount = new QLabel(this);
+    mainLayout.addWidget(lblCount, 0, 1);
+    lblCount->setText("0");
+    lblCount->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
 
     acInfo = new QAction(QAction::tr("Info"), chatNicks);
     acInfo->setIcon(QIcon(":/res/info.png"));
@@ -393,6 +399,8 @@
     updateNickItem(item);
     chatNicks->addItem(item);
 
+    lblCount->setText(QString::number(chatNicks->count()));
+
     if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool()) {
        Mix_PlayChannel(-1, sound[rand()%4], 0);
     }
@@ -405,6 +413,8 @@
         chatNicks->takeItem(chatNicks->row(*it));
         ++it;
     }
+
+    lblCount->setText(QString::number(chatNicks->count()));
 }
 
 void HWChatWidget::clear()
--- a/QTfrontend/chatwidget.h	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/chatwidget.h	Tue Apr 05 16:05:41 2011 -0400
@@ -34,6 +34,7 @@
 class QListWidget;
 class QSettings;
 class SDLInteraction;
+class QLabel;
 
 // this class is for custom nick sorting
 class ListWidgetNickItem : public QListWidgetItem
@@ -101,6 +102,7 @@
   QAction * acIgnore;
   QAction * acFriend;
   QSettings * gameSettings;
+  QLabel * lblCount;
   SDLInteraction * sdli;
   Mix_Chunk *sound[4];
   bool notify;
--- a/QTfrontend/hwform.cpp	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/hwform.cpp	Tue Apr 05 16:05:41 2011 -0400
@@ -61,7 +61,6 @@
 #include "drawmapwidget.h"
 
 #ifdef __APPLE__
-#include "CocoaInitializer.h"
 #include "M3Panel.h"
 #ifdef SPARKLE_ENABLED
 #define SPARKLE_APPCAST_URL "http://www.hedgewars.org/download/appcast.xml"
@@ -98,13 +97,17 @@
 
 #ifdef __APPLE__
     panel = new M3Panel;
+
 #ifdef SPARKLE_ENABLED
     AutoUpdater* updater;
-    CocoaInitializer initializer;
+
     updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
     if (updater && config->isAutoUpdateEnabled())
         updater->checkForUpdates();
 #endif
+
+    QShortcut *hideFrontend = new QShortcut(QKeySequence("Ctrl+M"), this);
+    connect (hideFrontend, SIGNAL(activated()), this, SLOT(showMinimized()));
 #else
     // ctrl+q closes frontend for consistency
     QShortcut *closeFrontend = new QShortcut(QKeySequence("Ctrl+Q"), this);
--- a/QTfrontend/main.cpp	Tue Apr 05 16:02:26 2011 -0400
+++ b/QTfrontend/main.cpp	Tue Apr 05 16:05:41 2011 -0400
@@ -31,6 +31,9 @@
 #ifdef _WIN32
 #include <Shlobj.h>
 #endif
+#ifdef __APPLE__
+#include "CocoaInitializer.h"
+#endif
 
 bool checkForDir(const QString & dir)
 {
@@ -425,6 +428,10 @@
         registry_hklm.setValue("Software/Hedgewars/Path", bindir->absolutePath().replace("/", "\\"));
     }
 #endif
+#ifdef __APPLE__
+    // this creates the autoreleasepool that prevents leaking
+    CocoaInitializer initializer;
+#endif
 
     HWForm *Form = new HWForm();
 
--- a/gameServer/Actions.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/Actions.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -127,6 +127,7 @@
 
     chan <- client's sendChan
     clNick <- client's nick
+    loggedIn <- client's logonPassed
 
     when (ri /= lobbyId) $ do
         processAction $ MoveToLobby ("quit: " `B.append` msg)
@@ -137,7 +138,7 @@
         infoM "Clients" (show ci ++ " quits: " ++ B.unpack msg)
 
     processAction $ AnswerClients [chan] ["BYE", msg]
-    processAction $ AnswerClients clientsChans ["LOBBY:LEFT", clNick, msg]
+    when loggedIn $ processAction $ AnswerClients clientsChans ["LOBBY:LEFT", clNick, msg]
 
     s <- get
     put $! s{removedClients = ci `Set.insert` removedClients s}
@@ -218,9 +219,10 @@
         moveClientToLobby rnc ci
 
 processAction ChangeMaster = do
+    (Just ci) <- gets clientIndex
     ri <- clientRoomA
     rnc <- gets roomsClients
-    newMasterId <- liftM head . io $ roomClientsIndicesM rnc ri
+    newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
     newMaster <- io $ client'sM rnc id newMasterId
     let newRoomName = nick newMaster
     mapM_ processAction [
@@ -395,7 +397,7 @@
     si <- gets serverInfo
     newClId <- io $ do
         ci <- addClient rnc cl
-        _ <- Exception.block . forkIO $ clientRecvLoop (clientSocket cl) (coreChan si) (sendChan cl) ci
+        _ <- Exception.mask (forkIO . clientRecvLoop (clientSocket cl) (coreChan si) (sendChan cl) ci)
 
         infoM "Clients" (show ci ++ ": New client. Time: " ++ show (connectTime cl))
 
--- a/gameServer/ClientIO.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/ClientIO.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -1,4 +1,4 @@
-{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-}
+{-# LANGUAGE ScopedTypeVariables, OverloadedStrings, Rank2Types #-}
 module ClientIO where
 
 import qualified Control.Exception as Exception
@@ -30,7 +30,7 @@
             return (B.splitWith (== '\n') packet : packets)
 
 listenLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO ()
-listenLoop sock chan ci = Exception.unblock $ recieveWithBufferLoop B.empty
+listenLoop sock chan ci = recieveWithBufferLoop B.empty
     where
         recieveWithBufferLoop recvBuf = do
             recvBS <- recv sock 4096
@@ -41,11 +41,11 @@
 
         sendPacket packet = writeChan chan $ ClientMessage (ci, packet)
 
-clientRecvLoop :: Socket -> Chan CoreMessage -> Chan [B.ByteString] -> ClientIndex -> IO ()
-clientRecvLoop s chan clChan ci =
+clientRecvLoop :: Socket -> Chan CoreMessage -> Chan [B.ByteString] -> ClientIndex -> (forall a. IO a -> IO a) -> IO ()
+clientRecvLoop s chan clChan ci restore =
     myThreadId >>=
-    \t -> forkIO (clientSendLoop s t clChan ci) >>
-    (listenLoop s chan ci >> return "Connection closed")
+    \t -> (restore $ forkIO (clientSendLoop s t clChan ci) >>
+        listenLoop s chan ci >> return "Connection closed")
         `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
         `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
         >>= clientOff >> remove
--- a/gameServer/HWProtoInRoomState.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/HWProtoInRoomState.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -242,6 +242,20 @@
             [ModifyRoom (\r -> r{isRestrictedTeams = not $ isRestrictedTeams r})]
 
 
+handleCmd_inRoom ["ROOM_NAME", newName] = do
+    cl <- thisClient
+    rs <- allRoomInfos
+    
+    return $
+        if not $ isMaster cl then
+            [ProtocolError "Not room master"]
+        else
+        if isJust $ find (\r -> newName == name r) rs then
+            [Warning "Room with such name already exists"]
+        else
+            [ModifyRoom (\r -> r{name = newName})]
+
+
 handleCmd_inRoom ["KICK", kickNick] = do
     (thisClientId, rnc) <- ask
     maybeClientId <- clientByNick kickNick
--- a/gameServer/HWProtoLobbyState.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/HWProtoLobbyState.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -6,7 +6,6 @@
 import Data.Maybe
 import Data.List
 import Control.Monad.Reader
-import qualified Data.ByteString.Char8 as B
 --------------------------------------
 import CoreTypes
 import Actions
--- a/gameServer/HWProtoNEState.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/HWProtoNEState.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -35,9 +35,7 @@
                 AnswerClients [sendChan cl] ["PROTO", showB parsedProto] :
                 [CheckRegistered | not . B.null $ nick cl]
     where
-        parsedProto = case B.readInt protoNum of
-                           Just (i, t) | B.null t -> fromIntegral i
-                           _ -> 0
+        parsedProto = readInt_ protoNum
 
 
 handleCmd_NotEntered ["PASSWORD", passwd] = do
--- a/gameServer/ServerCore.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/ServerCore.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -42,11 +42,10 @@
 
         ClientMessage (ci, cmd) -> do
             liftIO $ debugM "Clients" $ show ci ++ ": " ++ show cmd
-
+            
             removed <- gets removedClients
             unless (ci `Set.member` removed) $ do
-                as <- get
-                put $! as{clientIndex = Just ci}
+                modify (\s -> s{clientIndex = Just ci})
                 reactCmd cmd
 
         Remove ci ->
@@ -56,8 +55,7 @@
             rnc <- gets roomsClients
             exists <- liftIO $ clientExists rnc ci
             when exists $ do
-                as <- get
-                put $! as{clientIndex = Just ci}
+                modify (\s -> s{clientIndex = Just ci})
                 uid' <- client's clUID
                 when (uid == hashUnique uid') $ processAction (ProcessAccountInfo info)
                 return ()
--- a/gameServer/hedgewars-server.cabal	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/hedgewars-server.cabal	Tue Apr 05 16:05:41 2011 -0400
@@ -15,21 +15,18 @@
   main-is: hedgewars-server.hs
 
   Build-depends:
-    base >= 4,
+    base >= 4.3,
     unix,
     containers,
     array,
     bytestring,
     bytestring-show,
-    network-bytestring,
-    network,
+    network >= 2.3,
     time,
-    stm,
     mtl >= 2,
     dataenc,
     hslogger,
     process,
-    deepseq,
-    tconfig
+    deepseq
 
   ghc-options: -O2
--- a/gameServer/stresstest.hs	Tue Apr 05 16:02:26 2011 -0400
+++ b/gameServer/stresstest.hs	Tue Apr 05 16:05:41 2011 -0400
@@ -40,7 +40,7 @@
     putStrLn "Finish"
 
 forks = forever $ do
-    delay <- randomRIO (30000::Int, 69000)
+    delay <- randomRIO (0::Int, 90000)
     threadDelay delay
     forkIO testing
 
--- a/hedgewars/LuaPas.pas	Tue Apr 05 16:02:26 2011 -0400
+++ b/hedgewars/LuaPas.pas	Tue Apr 05 16:05:41 2011 -0400
@@ -46,7 +46,7 @@
 *)
 type
   LUA_NUMBER_  = type Double;            // ending underscore is needed in Pascal
-  LUA_INTEGER_ = type LongInt;
+  LUA_INTEGER_ = type PtrInt;
 
 (*
 @@ LUA_IDSIZE gives the maximum size for the description of the source
@@ -681,10 +681,10 @@
                        extramsg : PChar): LongInt;
 function luaL_checkstring(L : Plua_State; n : LongInt) : PChar;
 function luaL_optstring(L : Plua_State; n : LongInt; d : PChar) : PChar;
-function luaL_checkint(L : Plua_State; n : LongInt) : LongInt;
-function luaL_optint(L : Plua_State; n, d : LongInt): LongInt;
-function luaL_checklong(L : Plua_State; n : LongInt) : LongInt;
-function luaL_optlong(L : Plua_State; n : LongInt; d : LongInt) : LongInt;
+function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
+function luaL_optint(L : Plua_State; n : LongInt; d : lua_Integer): lua_Integer;
+function luaL_checklong(L : Plua_State; n : LongInt) : lua_Integer;
+function luaL_optlong(L : Plua_State; n : LongInt; d : lua_Integer) : lua_Integer;
 
 function luaL_typename(L : Plua_State; idx : LongInt) : PChar;
 
@@ -935,22 +935,22 @@
   luaL_optstring := luaL_optlstring(L, n, d, nil);
 end;
 
-function luaL_checkint(L : Plua_State; n : LongInt) : LongInt;
+function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
 begin
   luaL_checkint := luaL_checkinteger(L, n);
 end;
 
-function luaL_optint(L : Plua_State; n, d : LongInt): LongInt;
+function luaL_optint(L : Plua_State; n : LongInt; d : lua_Integer): lua_Integer;
 begin
   luaL_optint := luaL_optinteger(L, n, d);
 end;
 
-function luaL_checklong(L : Plua_State; n : LongInt) : LongInt;
+function luaL_checklong(L : Plua_State; n : LongInt) : lua_Integer;
 begin
   luaL_checklong := luaL_checkinteger(L, n);
 end;
 
-function luaL_optlong(L : Plua_State; n : LongInt; d : LongInt) : LongInt;
+function luaL_optlong(L : Plua_State; n : LongInt; d : lua_Integer) : lua_Integer;
 begin
   luaL_optlong := luaL_optinteger(L, n, d);
 end;
--- a/hedgewars/SDLh.pas	Tue Apr 05 16:02:26 2011 -0400
+++ b/hedgewars/SDLh.pas	Tue Apr 05 16:05:41 2011 -0400
@@ -726,7 +726,8 @@
 procedure SDL_Quit; cdecl; external SDLLibName;
 
 function  SDL_VideoDriverName(var namebuf; maxlen: LongInt): PChar; cdecl; external SDLLibName;
-procedure SDL_EnableUNICODE(enable: LongInt); cdecl; external SDLLibName;
+function  SDL_EnableUNICODE(enable: LongInt): LongInt; cdecl; external SDLLibName;
+function  SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; cdecl; external SDLLibName;
 
 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName;
 function  SDL_GetTicks: Longword; cdecl; external SDLLibName;
--- a/hedgewars/uChat.pas	Tue Apr 05 16:02:26 2011 -0400
+++ b/hedgewars/uChat.pas	Tue Apr 05 16:05:41 2011 -0400
@@ -269,7 +269,13 @@
                 SetLine(InputStr, InputStr.s, true)
                 end;
         {Esc}
-        27: SetLine(InputStr, '', true);
+        27: if Length(InputStr.s) > 0 then SetLine(InputStr, '', true)
+            else
+                begin
+                FreezeEnterKey;
+                SDL_EnableKeyRepeat(0,0);
+                GameState:= gsGame;
+                end;
         {Return}
         3, 13, 271: begin
             if Length(InputStr.s) > 0 then
@@ -278,7 +284,8 @@
                 SetLine(InputStr, '', false)
                 end;
             FreezeEnterKey;
-            GameState:= gsGame
+            SDL_EnableKeyRepeat(0,0);
+            GameState:= gsGame;
             end;
     else
     if (Key < $80) then btw:= 1
@@ -339,10 +346,12 @@
 begin
     s:= s; // avoid compiler hint
     GameState:= gsChat;
+    SDL_EnableKeyRepeat(200,45);
     if length(s) = 0 then
-        KeyPressChat(27)
+        SetLine(InputStr, '', true)
     else
         begin
+        // err, does anyone have any documentation on this sequence?
         KeyPressChat(27);
         KeyPressChat(47);
         KeyPressChat(116);
--- a/hedgewars/uKeys.pas	Tue Apr 05 16:02:26 2011 -0400
+++ b/hedgewars/uKeys.pas	Tue Apr 05 16:05:41 2011 -0400
@@ -386,7 +386,9 @@
 
 procedure FreezeEnterKey;
 begin
+    tkbd[3]:= 1;
     tkbd[13]:= 1;
+    tkbd[27]:= 1;
     tkbd[271]:= 1;
 end;
 
--- a/project_files/hedgewars.pro	Tue Apr 05 16:02:26 2011 -0400
+++ b/project_files/hedgewars.pro	Tue Apr 05 16:05:41 2011 -0400
@@ -54,7 +54,7 @@
 	../QTfrontend/namegen.cpp ../QTfrontend/netregister.cpp \
 	../QTfrontend/netserver.cpp ../QTfrontend/netserverslist.cpp \
 	../QTfrontend/netudpserver.cpp ../QTfrontend/netudpwidget.cpp \
-	../QTfrontend/newnetclient.cpp ../QTfrontend/pages.cpp \
+        ../QTfrontend/newnetclient.cpp \
 	../QTfrontend/playrecordpage.cpp ../QTfrontend/proto.cpp \
 	../QTfrontend/selectWeapon.cpp ../QTfrontend/statsPage.cpp \
 	../QTfrontend/tcpBase.cpp ../QTfrontend/team.cpp \
@@ -65,7 +65,26 @@
     ../QTfrontend/hwconsts.cpp \
     ../QTfrontend/drawmapwidget.cpp \
     ../QTfrontend/drawmapscene.cpp \
-    ../QTfrontend/qaspectratiolayout.cpp
+    ../QTfrontend/qaspectratiolayout.cpp \
+    ../QTfrontend/pagetraining.cpp \
+    ../QTfrontend/pagesingleplayer.cpp \
+    ../QTfrontend/pageselectweapon.cpp \
+    ../QTfrontend/pagescheme.cpp \
+    ../QTfrontend/pageroomslist.cpp \
+    ../QTfrontend/pageoptions.cpp \
+    ../QTfrontend/pagenettype.cpp \
+    ../QTfrontend/pagenetserver.cpp \
+    ../QTfrontend/pagenetgame.cpp \
+    ../QTfrontend/pagenet.cpp \
+    ../QTfrontend/pagemultiplayer.cpp \
+    ../QTfrontend/pagemain.cpp \
+    ../QTfrontend/pageingame.cpp \
+    ../QTfrontend/pageinfo.cpp \
+    ../QTfrontend/pageeditteam.cpp \
+    ../QTfrontend/pagedrawmap.cpp \
+    ../QTfrontend/pageconnecting.cpp \
+    ../QTfrontend/pagecampaign.cpp \
+    ../QTfrontend/pageadmin.cpp
 
 win32 {
 	SOURCES += ../QTfrontend/xfire.cpp
--- a/share/hedgewars/Data/Sounds/voices/CMakeLists.txt	Tue Apr 05 16:02:26 2011 -0400
+++ b/share/hedgewars/Data/Sounds/voices/CMakeLists.txt	Tue Apr 05 16:05:41 2011 -0400
@@ -8,6 +8,7 @@
 	Russian
 	Singer
 	Surfer
+	Default_uk
 	)
 	add_subdirectory(${dir})
 endforeach(dir)
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Amazing.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Boring.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Brilliant.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Bugger.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Bungee.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Byebye.ogg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Sounds/voices/Default_uk/CMakeLists.txt	Tue Apr 05 16:05:41 2011 -0400
@@ -0,0 +1,5 @@
+file(GLOB BaseSounds *.ogg)
+
+install(FILES
+	${BaseSounds}
+	DESTINATION ${SHAREPATH}Data/Sounds/voices/Default_uk)
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Comeonthen.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Coward.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Cutitout.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Drat.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Enemydown.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Excellent.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Fire.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch4.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch5.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firepunch6.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Firstblood.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Flawless.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Gonnagetyou.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Grenade.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Hello.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Hmm.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Hurry.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Illgetyou.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Incoming.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Jump1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Jump2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Jump3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/JustYouwait.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Kamikaze.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Laugh.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Leavemealone.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Melon.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Missed.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Nooo.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Nutter.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ohdear.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ooff1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ooff2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ooff3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Oops.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ouch.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ow1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ow2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ow3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Ow4.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Perfect.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/PoisonCough.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/PoisonMoan.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Reinforcements.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Revenge.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Runaway.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Sameteam.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Solong.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Stupid.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Takecover.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Thisoneismine.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Traitor.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Uh-oh.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Victory.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Watchit.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Watchthis.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Whatthe.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Whoopsee.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Yessir.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Youllregretthat.ogg has changed
--- a/share/hedgewars/Data/Themes/CMakeLists.txt	Tue Apr 05 16:02:26 2011 -0400
+++ b/share/hedgewars/Data/Themes/CMakeLists.txt	Tue Apr 05 16:05:41 2011 -0400
@@ -9,7 +9,10 @@
 	Castle
 	Cheese
 	Christmas
+	Compost
 	Deepspace
+	Desert
+	Digital
 	City
 	CrazyMission
 	EarthRise
@@ -20,14 +23,12 @@
 	Island
 	Jungle
 	Nature
+	Olympics
 	Planes
 	Sheep
 	Snow
 	Stage
 	Underwater
-	Compost
-	Olympics
-	Desert
 	)
 	add_subdirectory(${dir})
 endforeach(dir)
Binary file share/hedgewars/Data/Themes/Digital/BlueWater.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Border.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Digital/CMakeLists.txt	Tue Apr 05 16:05:41 2011 -0400
@@ -0,0 +1,6 @@
+file(GLOB images *.png)
+
+install(FILES
+    theme.cfg
+    ${images}
+    DESTINATION ${SHAREPATH}Data/Themes/Digital)
Binary file share/hedgewars/Data/Themes/Digital/Chunk.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Clouds.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Droplet.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Dust.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileA.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileHello.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileHi.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileImg.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileMusic.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FileOmega.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Flake.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Flash.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Folder.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FolderDoc.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FolderImg.png has changed
Binary file share/hedgewars/Data/Themes/Digital/FolderMusic.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Girder.png has changed
Binary file share/hedgewars/Data/Themes/Digital/LandBackTex.png has changed
Binary file share/hedgewars/Data/Themes/Digital/LandTex.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Mouse.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Notebook.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Sky.png has changed
Binary file share/hedgewars/Data/Themes/Digital/Splash.png has changed
Binary file share/hedgewars/Data/Themes/Digital/horizont.png has changed
Binary file share/hedgewars/Data/Themes/Digital/icon.png has changed
Binary file share/hedgewars/Data/Themes/Digital/icon@2x.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Digital/theme.cfg	Tue Apr 05 16:05:41 2011 -0400
@@ -0,0 +1,21 @@
+sky = 0, 39, 4
+border = $FF, $00, $00
+water-top = 0, 0, 0
+water-bottom = 0, 0, 0
+water-opacity = 0
+music = Freeway.ogg
+clouds = 20
+object = Notebook, 2, 65, 258, 175, 2, 1, 0, 0, 240, 215
+object = Mouse, 2, 20, 0, 48, 1, 1, 25, 15, 50, 60
+object = Flash, 2, 0, 85, 30, 30, 2, 0, 0, 170, 70, 50, 70, 120, 40
+object = Folder, 2, 103, 120, 20, 70, 1, 0, 0, 204, 105
+object = FolderDoc, 2, 98, 124, 20, 36, 1, 0, 0, 218, 120
+object = FolderImg, 2, 114, 124, 20, 36, 1, 0, 0, 212, 115
+object = FolderMusic, 2, 69, 129, 20, 31, 1, 0, 0, 202, 125
+object = FileHello, 2, 83, 154, 20, 51, 1, 0, 0, 155, 145
+object = FileImg, 2, 95, 121, 20, 39, 1, 0, 0, 180, 115
+object = FileMusic, 2, 42, 150, 20, 20, 1, 0, 0, 134, 145
+object = FileOmega, 2, 66, 148, 20, 22, 1, 0, 0, 155, 145
+object = FileHi, 2, 51, 162, 20, 18, 1, 0, 0, 148, 155
+object = FileA, 2, 64, 145, 20, 15, 1, 0, 0, 137, 140
+flakes = 1024, 2, 65536, 0, 256
--- a/share/hedgewars/Data/Themes/themes.cfg	Tue Apr 05 16:02:26 2011 -0400
+++ b/share/hedgewars/Data/Themes/themes.cfg	Tue Apr 05 16:05:41 2011 -0400
@@ -9,6 +9,7 @@
 City
 Compost
 Desert
+Digital
 EarthRise
 Freeway
 Halloween
--- a/tools/CMakeLists.txt	Tue Apr 05 16:02:26 2011 -0400
+++ b/tools/CMakeLists.txt	Tue Apr 05 16:05:41 2011 -0400
@@ -28,6 +28,7 @@
 	string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}")
 	find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin NO_DEFAULT_PATH)
 
+	#this tool is present in qt 4.5 but only if you compile from sources; from qt 4.6 is present also in the binary version
 	if(NOT macdeployqt_EXE)
 		message(FATAL_ERROR "The utility macdeployqt is required to create the bundle!")
 	endif()
--- a/tools/CreateMacBundle.cmake.in	Tue Apr 05 16:02:26 2011 -0400
+++ b/tools/CreateMacBundle.cmake.in	Tue Apr 05 16:05:41 2011 -0400
@@ -2,11 +2,10 @@
 
 execute_process(COMMAND ls ${frameworks_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
 
-if(doBundle EQUAL 1)
-    execute_process(COMMAND mkdir -p ${frameworks_dir})
+execute_process(COMMAND mkdir -p ${frameworks_dir})
+execute_process(COMMAND ${macdeployqt_EXE} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET)
 
-    execute_process(COMMAND ${macdeployqt_EXE} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET)
-
+if(doBundle EQUAL 1)
     execute_process(COMMAND cp -pPR ${sdl_dir}          ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL.framework)
     execute_process(COMMAND cp -pPR ${SDLIMAGE_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_image.framework)
     execute_process(COMMAND cp -pPR ${SDLNET_LIBRARY}   ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_net.framework)