# HG changeset patch
# User koda
# Date 1371155243 -7200
# Node ID bce8cf41d666080d139c416e43a9488cf12a6c59
# Parent 71fc5893071cdd9d87908e198d5d5904d296e955# Parent 11438c0bd46bf567ce71d057e899092025d6a376
merge cmake_pascal branch in default
diff -r 11438c0bd46b -r bce8cf41d666 .hgignore
--- a/.hgignore Tue Apr 30 01:47:30 2013 +0200
+++ b/.hgignore Thu Jun 13 22:27:23 2013 +0200
@@ -3,6 +3,7 @@
glob:moc_*.cxx
glob:qrc_*.cxx
glob:*.o
+glob:*.a
glob:*.qm
glob:Makefile
glob:bin
@@ -54,8 +55,8 @@
glob:project_files/Android-build/SDL-android-project/.*
glob:project_files/Android-build/out
glob:project_files/Android-build/Makefile.android
-glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug
-glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release
+glob:hedgewars-build-desktop-Qt*
+glob:hedgewars-build-desktop-Qt*
glob:*.depends
glob:tools/build_windows_koda.bat
glob:share/hedgewars/Data/misc/hwengine.desktop
@@ -63,3 +64,5 @@
glob:_CPack_Packages/
glob:version_info.txt
glob:*.tar.*
+glob:*.or
+glob:*.res
\ No newline at end of file
diff -r 11438c0bd46b -r bce8cf41d666 .hgtags
--- a/.hgtags Tue Apr 30 01:47:30 2013 +0200
+++ b/.hgtags Thu Jun 13 22:27:23 2013 +0200
@@ -59,3 +59,4 @@
0000000000000000000000000000000000000000 0.9.18-release
0000000000000000000000000000000000000000 0.9.18-release
2fc02902c7cbf3c29bfe08a50e5f37983582b251 0.9.18-release
+1617149e01a4fa25637e2ab655d0287ef9c21b7c 0.9.19-release
diff -r 11438c0bd46b -r bce8cf41d666 CMakeLists.txt
--- a/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200
+++ b/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200
@@ -1,15 +1,8 @@
project(hedgewars)
#initialise cmake environment
-cmake_minimum_required(VERSION 2.6.0)
-if(CMAKE_VERSION VERSION_LESS "2.8")
- set(WARNING "WARNING: ")
- set(allow_parse_args FALSE)
-else()
- set(WARNING WARNING)
- set(allow_parse_args TRUE)
-endif()
-foreach(hwpolicy CMP0003 CMP0012 CMP0017)
+cmake_minimum_required(VERSION 2.6.4)
+foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018)
if(POLICY ${hwpolicy})
cmake_policy(SET ${hwpolicy} NEW)
endif()
@@ -23,14 +16,22 @@
option(NOPNG "Disable screenshoot compression (off)" OFF)
option(NOVIDEOREC "Disable video recording (off)" OFF)
+#libraries are built shared unless explicitly added as a static
+option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON)
#set this to ON when 2.1.0 becomes more widespread (and only for linux)
-option(SYSTEM_PHYSFS "Use system physfs (off)" OFF)
+option(PHYSFS_SYSTEM "Use system physfs (off)" OFF)
+
+if(WIN32 OR APPLE)
+ option(LUA_SYSTEM "Use system lua (off)" OFF)
+else()
+ option(LUA_SYSTEM "Use system lua (on)" ON)
+endif()
option(BUILD_ENGINE_LIBRARY "Enable hwengine library (off)" OFF)
option(ANDROID "Enable Android build (off)" OFF)
if(UNIX AND NOT APPLE)
- option(MINIMAL_CFLAGS "Respect system CFLAGS as much as possible (off)" OFF)
+ option(MINIMAL_FLAGS "Respect system flags as much as possible (off)" OFF)
else()
option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
endif()
@@ -42,167 +43,21 @@
endif()
-#detect Mercurial revision and init rev/hash information
-find_program(HGCOMMAND hg)
-if(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg))
- execute_process(COMMAND ${HGCOMMAND} identify -in
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE internal_version
- ERROR_QUIET
- )
- #check local repo status
- string(REGEX REPLACE "[^+]" "" HGCHANGED ${internal_version})
- string(REGEX REPLACE "[0-9a-zA-Z]+(.*) ([0-9]+)(.*)" "\\2" HEDGEWARS_REVISION ${internal_version})
- string(REGEX REPLACE "([0-9a-zA-Z]+)(.*) [0-9]+(.*)" "\\1" HEDGEWARS_HASH ${internal_version})
-
- if(HGCHANGED)
- message(${WARNING} "You have uncommitted changes in your repository!")
- endif()
- #let's assume that if you have hg you might be interested in debugging
- set(default_build_type "DEBUG")
- #write down hash and rev for easy picking should hg be missing
- file(WRITE "${CMAKE_SOURCE_DIR}/share/version_info.txt" "Hedgewars versioning information, do not modify\nrev ${HEDGEWARS_REVISION}\nhash ${HEDGEWARS_HASH}\n")
-else()
- set(default_build_type "RELEASE")
- # when compiling outside rev control, fetch revision and hash information from version_info.txt
- find_file(version_info version_info.txt PATH ${CMAKE_SOURCE_DIR}/share)
- if(version_info)
- file(STRINGS ${version_info} internal_version REGEX "rev")
- string(REGEX REPLACE "rev ([0-9]*)" "\\1" HEDGEWARS_REVISION ${internal_version})
- file(STRINGS ${version_info} internal_version REGEX "hash")
- string(REGEX REPLACE "hash ([a-zA-Z0-9]*)" "\\1" HEDGEWARS_HASH ${internal_version})
- else()
- message(${WARNING} "${CMAKE_SOURCE_DIR}/share/version_info.txt not found, revision information "
- "will be incorrect!!! Contact your source provider to fix this!")
- set(HEDGEWARS_REVISION "0000")
- set(HEDGEWARS_HASH "unknown")
- endif()
-endif()
-
-
#versioning
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 9)
-set(CPACK_PACKAGE_VERSION_PATCH 19)
-set(HEDGEWARS_PROTO_VER 44)
+set(CPACK_PACKAGE_VERSION_PATCH 20)
+set(HEDGEWARS_PROTO_VER 46)
set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+include(${CMAKE_MODULE_PATH}/revinfo.cmake)
message(STATUS "Building ${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION} (${HEDGEWARS_HASH})")
-
-#where to build libs and bins
-set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-#these variables are for non-makefile generators
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH})
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH})
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH})
-
-#resource paths
-if(UNIX AND NOT APPLE)
- set(target_binary_install_dir "bin")
- set(target_library_install_dir "lib")
-
- string(SUBSTRING "${DATA_INSTALL_DIR}" 0 1 sharepath_start)
- if (NOT (${sharepath_start} MATCHES "/"))
- set(HEDGEWARS_DATADIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/")
- else()
- set(HEDGEWARS_DATADIR "${DATA_INSTALL_DIR}/")
- endif()
- set(HEDGEWARS_FULL_DATADIR "${HEDGEWARS_DATADIR}")
-else()
- set(target_binary_install_dir "./")
-
- if(APPLE)
- set(target_library_install_dir "../Frameworks/")
- set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/")
- set(HEDGEWARS_DATADIR "../Resources/")
- set(HEDGEWARS_FULL_DATADIR "/Applications/${CMAKE_INSTALL_PREFIX}/${HEDGEWARS_DATADIR}")
- elseif(WIN32)
- set(target_library_install_dir "./")
- set(HEDGEWARS_DATADIR "./")
- set(HEDGEWARS_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/")
- link_directories("${EXECUTABLE_OUTPUT_PATH}" "${CMAKE_SOURCE_DIR}/misc/winutils/bin")
- endif()
-endif()
-
-
-if(APPLE)
- set(CMAKE_FIND_FRAMEWORK "FIRST")
-
- #what system are we building for
- set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET})
-
- #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version
- find_program(sw_vers sw_vers)
- if(sw_vers)
- execute_process(COMMAND ${sw_vers} "-productVersion"
- OUTPUT_VARIABLE current_macosx_version
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version})
- else()
- if(NOT minimum_macosx_version)
- message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set")
- else()
- message(${WARNING} "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable")
- set(current_macosx_version ${minimum_macosx_version})
- endif()
- endif()
-
- #if nothing is set, we deploy only for the current system
- if(NOT minimum_macosx_version)
- set(minimum_macosx_version ${current_macosx_version})
- endif()
-
- #lower systems don't have enough processing power anyway
- if (minimum_macosx_version VERSION_LESS "10.4")
- message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4")
- endif()
-
- #workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2)
- if(current_macosx_version VERSION_EQUAL "10.4")
- find_package(SDL_mixer REQUIRED)
- set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg")
- set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
- add_flag_append(CMAKE_C_FLAGS "${DYLIB_SMPEG} ${DYLIB_MIKMOD}")
- add_flag_append(CMAKE_Pascal_FLAGS "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}")
- endif()
-
- #CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking
- if(NOT CMAKE_OSX_ARCHITECTURES)
- if(current_macosx_version VERSION_LESS "10.6")
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
- set(CMAKE_OSX_ARCHITECTURES "ppc7400")
- else()
- set(CMAKE_OSX_ARCHITECTURES "i386")
- endif()
- else()
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
- endif()
- endif()
-
- #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
- #we need to provide the correct one when host and target differ
- if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version})
- if(minimum_macosx_version VERSION_EQUAL "10.4")
- set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
- set(CMAKE_C_COMPILER "gcc-4.0")
- set(CMAKE_CXX_COMPILER "g++-4.0")
- else()
- string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version})
- set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/")
- endif()
- endif()
-
- #set deployment target
- add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version} ")
-endif(APPLE)
+#general utilities
+include(${CMAKE_MODULE_PATH}/utils.cmake)
+#platform specific init code
+include(${CMAKE_MODULE_PATH}/platform.cmake)
+include(${CMAKE_MODULE_PATH}/paths.cmake)
#when build type is not specified, assume Debug/Release according to build version information
@@ -217,34 +72,25 @@
endif (CMAKE_BUILD_TYPE)
-#set default flags values for all projects (unless MINIMAL_CFLAGS is true)
-if(NOT ${MINIMAL_CFLAGS})
- add_flag_append(CMAKE_C_FLAGS "-pipe")
- add_flag_append(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer")
- add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -DDEBUG")
- add_flag_append(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
- add_flag_append(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
- add_flag_append(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+#perform safe check that enable/disable compilation features
+include(${CMAKE_MODULE_PATH}/compilerchecks.cmake)
+
+#set default flags values for all projects (unless MINIMAL_FLAGS is true)
+if(NOT ${MINIMAL_FLAGS})
+ set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}")
+ set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
+ set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g ${CMAKE_C_FLAGS_DEBUG}")
+ set(CMAKE_CXX_FLAGS "-pipe ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")
+ set(CMAKE_CXX_FLAGS_DEBUG "-Wall -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}")
else()
#CMake adds a lot of additional configuration flags, so let's clear them up
set(CMAKE_C_FLAGS_RELEASE "")
- set(CMAKE_C_FLAGS_DEBUG "-Wall -DDEBUG")
+ set(CMAKE_C_FLAGS_DEBUG "-Wall")
set(CMAKE_CXX_FLAGS_RELEASE "")
- set(CMAKE_CXX_FLAGS_DEBUG "-Wall -DDEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "-Wall")
endif()
-#TODO: find out why we need this...
-include(CheckCCompilerFlag)
-set(CMAKE_REQUIRED_FLAGS "-Wl,-z -Wl,noexecstack")
-check_c_compiler_flag("" HAVE_NOEXECSTACK) #empty because we are testing a linker flag
-if(HAVE_NOEXECSTACK)
- add_flag_append(CMAKE_Pascal_FLAGS "-k-z -knoexecstack")
- if(NOT ${MINIMAL_CFLAGS})
- add_flag_append(CMAKE_C_FLAGS ${CMAKE_REQUIRED_FLAGS})
- endif()
-endif()
-unset(CMAKE_REQUIRED_FLAGS)
-
#parse additional parameters
if(FPFLAGS)
add_flag_prepend(CMAKE_Pascal_FLAGS ${FPFLAGS})
@@ -279,18 +125,30 @@
)
endif()
+
#lua discovery
-find_package(Lua)
-if(LUA_FOUND)
- message(STATUS "Found LUA: ${LUA_DEFAULT}")
+if (${LUA_SYSTEM})
+ if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
+ find_package(Lua)
+ endif()
+
+ if (LUA_LIBRARY AND LUA_INCLUDE_DIR)
+ set(LUA_FOUND TRUE)
+ else()
+ message(FATAL_ERROR "Missing Lua! Rerun cmake with -DLUA_SYSTEM=off to build the internal version")
+ endif()
else()
- message(STATUS "LUA will be provided by the bundled sources")
+ if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
+ message(STATUS "LUA will be provided by the bundled sources")
+ endif()
+ set(lua_output_name "hwlua")
add_subdirectory(misc/liblua)
+ list(APPEND pascal_flags "-XLAlua=${lua_output_name}" "-dLUA_INTERNAL")
endif()
#physfs discovery
-if (${SYSTEM_PHYSFS})
+if (${PHYSFS_SYSTEM})
if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
find_package(PhysFS)
endif()
@@ -315,8 +173,10 @@
message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
endif()
else()
- message(STATUS "PhysFS will be provided by the bundled sources")
- set(physfs_output_name "hw_physfs")
+ if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
+ message(STATUS "PhysFS will be provided by the bundled sources")
+ endif()
+ set(physfs_output_name "hwphysfs")
add_subdirectory(misc/libphysfs)
endif()
@@ -348,5 +208,5 @@
endif()
-include(${CMAKE_MODULE_PATH}/CPackConfig.cmake)
+include(${CMAKE_MODULE_PATH}/cpackvars.cmake)
diff -r 11438c0bd46b -r bce8cf41d666 CREDITS
--- a/CREDITS Tue Apr 30 01:47:30 2013 +0200
+++ b/CREDITS Thu Jun 13 22:27:23 2013 +0200
@@ -6,6 +6,13 @@
- see Fonts_LICENSE.txt
==========
+= FORTS
+==========
+- Carlos Vives -> Tank (2010)
+- Dragonfly -> EvilChicken (2010)
+- Randy Broda -> SteelTower (2013)
+
+==========
= HATS
==========
- Robinator -> Terminator (2010)
@@ -66,4 +73,4 @@
http://www.freesound.org/people/Jovica/sounds/38317/
-ALL OTHER CONTENT IS PROPERTY OF Andrey Korotaev UNLESS OTHERWISE SPECIFIED
\ No newline at end of file
+ALL OTHER CONTENT IS PROPERTY OF Andrey Korotaev UNLESS OTHERWISE SPECIFIED
diff -r 11438c0bd46b -r bce8cf41d666 ChangeLog.txt
--- a/ChangeLog.txt Tue Apr 30 01:47:30 2013 +0200
+++ b/ChangeLog.txt Thu Jun 13 22:27:23 2013 +0200
@@ -1,10 +1,48 @@
+ features
* bugfixes
+0.9.19 -> ???:
+ * increase precision in damage calcs; extra damage affects fire properly now
+
+0.9.18 -> 0.9.19:
+ + New Freezer weapon - freezes terrain, water, hedgehogs, mines, cases, explosives
+ + Saucer can aim weapons and fire underwater
+ + Main graphical user interface overhaul
+ + Splashscreen on Windows *_*
+ + Up and down keys navigate in chat history
+ + Several commands from chat available
+ + Support hwplay:// scheme syntax
+ + Supply full revision and hash information in version tag
+ + Better set of options for driving engine
+ + Downloadable content can now be stored in packages for easy uninstall
+ + Lua scripts can load a sidecar overlay package of game resources
+ + Math improvements for better performance/reliability
+ + Smarter AI - now uses drill rocket accurately and is aware of barrels and dud mines. More aggressive in infinite attack, lua can tell to target specific hogs, such as in Mutant
+ + New fort, Steel Tower
+ + New theme, Fruit
+ + New hats - some national ones, Portal, harlequin, more animals...
+ + New maps based on StarBound. SB_Bones, SB_Crystal, SB_Grassy, SB_Grove, SB_Haunty, SB_Oaks, SB_Shrooms, SB_Tentacles
+ + Translation updates - Turkish, French, German, Japanese, Portuguese, Italian, Russian - Campaign french should work correctly now
+ + Theme object masks
+ + Easier weapon selection in shoppa. F1 will select from F5 if there are no weps in F1-F4
+ + Cleaver radius shrunk to improve usability on horizontal throws
+ + Map hog limit is now just a suggestion, not enforced
+ + Static map theme is now just the default, can be changed
+ + Themeable static maps (provide a mask.png without a map.png)
+ + Split seed with '|' to keep the land shape but change the hog placement
+ * You can now move out of the way when throwing a sticky mine or cleaver straight up
+ * Rope sliding should behave more like pre-0.9.18 again
+ * Forbid kicking on 1v1 matches
+ * Desync fixes
+ * Fixed fort mode
+ * Making very large maps now works properly with targeted weapons
+ * ParseCommand should be safe to use in Lua now, at any time
+ * Fixes to many weapons. Mudball, blowtorch, explosives, cluster bomb spread, portal.
+
0.9.17 -> 0.9.18:
+ 'A Classic Fairytale' Campaign
- + Video recorder (requires ffmpeg)
+ + Video recorder (requires ffmpeg/libav)
+ Cleaver weapon
+ AI is now aware of drowning and fall damage
+ AI learned how to use Sniper Rifle and Cake
@@ -24,6 +62,7 @@
+ Reduce amount of memory needed for engine to store land data
+ Countless other small fixes and improvements
+ Detect desyncs early
+ + Mudball will not cause any direct damage anymore
* Fix cake getting stuck in barrels, crates and hedgehogs
* Fix all knowns bugs which caused network game hang when players close engine or quit
* Fix drill strike bug when drill's timer gets ridiculously high value instead of explosion
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200
@@ -189,10 +189,6 @@
${hwfr_rez_src}
)
-if((UNIX AND NOT APPLE) AND ${BUILD_ENGINE_LIBRARY})
- set_target_properties(hedgewars PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}")
-endif()
-
list(APPEND HW_LINK_LIBS
${PHYSFS_LIBRARY}
${PHYSLAYER_LIBRARY}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/HWApplication.cpp
--- a/QTfrontend/HWApplication.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/HWApplication.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -18,15 +18,16 @@
#include "HWApplication.h"
#include
+#include
#include "hwform.h"
#include "MessageDialog.h"
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
#include "signal.h"
#endif
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
void terminateFrontend(int signal)
{
Q_UNUSED(signal);
@@ -34,10 +35,10 @@
}
#endif
-HWApplication::HWApplication(int &argc, char **argv):
+HWApplication::HWApplication(int &argc, char **argv) :
QApplication(argc, argv)
{
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
signal(SIGINT, &terminateFrontend);
#endif
#if 0
@@ -83,6 +84,8 @@
return true;
} else if (scheme == "hwplay") {
int port = openEvent->url().port(NETGAME_DEFAULT_PORT);
+ if (address == "")
+ address = NETGAME_DEFAULT_SERVER;
form->NetConnectQuick(address, (quint16) port);
return true;
} else {
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/HWApplication.h
--- a/QTfrontend/HWApplication.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/HWApplication.h Thu Jun 13 22:27:23 2013 +0200
@@ -20,10 +20,9 @@
#define HWAPP_H
#include
-#include
-#include
class HWForm;
+class QEvent;
/**
* @brief Main class of the Qt application.
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/KB.h
--- a/QTfrontend/KB.h Tue Apr 30 01:47:30 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
- *
- * 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
- */
-
-#ifndef KB_H
-#define KB_H
-
-#include
-
-const ulong KBmsgsCount = 1;
-
-const QString KBMessages[KBmsgsCount] =
-{
- QT_TRANSLATE_NOOP("KB", "SDL_ttf returned error while rendering text, "
- "most propably it is related to the bug "
- "in freetype2. It's recommended to update your "
- "freetype lib.")
-};
-
-#endif // KB_H
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/achievements.cpp
--- a/QTfrontend/achievements.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/achievements.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/achievements.h
--- a/QTfrontend/achievements.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/achievements.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/binds.cpp
--- a/QTfrontend/binds.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/binds.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/binds.h
--- a/QTfrontend/binds.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/binds.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/campaign.cpp
--- a/QTfrontend/campaign.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/campaign.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -16,43 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "campaign.h"
+
+#include "hwconsts.h"
+
#include
-#include "campaign.h"
-#include "gameuiconfig.h"
-#include "hwconsts.h"
-#include "gamecfgwidget.h"
-#include "bgwidget.h"
-#include "mouseoverfilter.h"
-#include "tcpBase.h"
-
-#include "DataManager.h"
-
-extern QString campaign, campaignTeam;
QStringList getCampMissionList(QString & campaign)
{
@@ -81,3 +50,14 @@
campfile.setIniCodec("UTF-8");
return campfile.value(QString("Mission %1/Script").arg(mNum)).toString();
}
+
+QString getCampaignImage(QString campaign, unsigned int mNum)
+{
+ return getCampaignScript(campaign,mNum).replace(QString(".lua"),QString(".png"));
+}
+
+QString getCampaignMissionName(QString campaign, unsigned int mNum)
+{
+ return getCampaignScript(campaign,mNum).replace(QString(".lua"),QString(""));
+}
+
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/campaign.h
--- a/QTfrontend/campaign.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/campaign.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -19,24 +19,13 @@
#ifndef CAMPAIGN_H
#define CAMPAIGN_H
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "netserver.h"
-#include "game.h"
-#include "ui_hwform.h"
-#include "SDLInteraction.h"
-#include "bgwidget.h"
+#include
+#include
QStringList getCampMissionList(QString & campaign);
unsigned int getCampProgress(QString & teamName, QString & campName);
QString getCampaignScript(QString campaign, unsigned int mNum);
+QString getCampaignImage(QString campaign, unsigned int mNum);
+QString getCampaignMissionName(QString campaign, unsigned int mNum);
#endif
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/drawmapscene.cpp
--- a/QTfrontend/drawmapscene.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/drawmapscene.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/drawmapscene.h
--- a/QTfrontend/drawmapscene.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/drawmapscene.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/game.cpp
--- a/QTfrontend/game.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/game.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -38,6 +38,13 @@
#include
#include "ThemeModel.h"
+// last game info
+QList lastGameStartArgs = QList();
+GameType lastGameType = gtNone;
+GameCFGWidget * lastGameCfg = NULL;
+QString lastGameAmmo = NULL;
+TeamSelWidget * lastGameTeamSel = NULL;
+
QString training, campaign, campaignScript, campaignTeam; // TODO: Cleaner solution?
HWGame::HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget) :
@@ -48,6 +55,10 @@
this->config = config;
this->gamecfg = gamecfg;
netSuspend = false;
+
+ lastGameCfg = gamecfg;
+ lastGameAmmo = ammo;
+ lastGameTeamSel = pTeamSelWidget;
}
HWGame::~HWGame()
@@ -142,7 +153,7 @@
HWProto::addStringToBuffer(teamscfg, "TL");
HWProto::addStringToBuffer(teamscfg, QString("etheme %1")
- .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data().toString() : "steel"));
+ .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data(ThemeModel::ActualNameRole).toString() : "steel"));
HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString());
HWProto::addStringToBuffer(teamscfg, "e$template_filter 2");
@@ -228,6 +239,7 @@
SendQuickConfig();
break;
}
+ case gtNone:
case gtSave:
case gtDemo:
break;
@@ -306,8 +318,8 @@
int size = msg.size();
QString newResolution = QString().append(msg.mid(2)).left(size - 4);
QStringList wh = newResolution.split('x');
- config->Form->ui.pageOptions->windowWidthEdit->setText(wh[0]);
- config->Form->ui.pageOptions->windowHeightEdit->setText(wh[1]);
+ config->Form->ui.pageOptions->windowWidthEdit->setValue(wh[0].toInt());
+ config->Form->ui.pageOptions->windowHeightEdit->setValue(wh[1].toInt());
break;
}
default:
@@ -343,7 +355,7 @@
readbuffer.remove(0, msglen + 1);
ParseMessage(msg);
}
-
+
flushNetBuffer();
}
@@ -352,7 +364,7 @@
if(m_netSendBuffer.size())
{
emit SendNet(m_netSendBuffer);
-
+
m_netSendBuffer.clear();
}
}
@@ -435,6 +447,9 @@
void HWGame::StartLocal()
{
+ lastGameStartArgs.clear();
+ lastGameType = gtLocal;
+
gameType = gtLocal;
demo.clear();
Start(false);
@@ -443,6 +458,9 @@
void HWGame::StartQuick()
{
+ lastGameStartArgs.clear();
+ lastGameType = gtQLocal;
+
gameType = gtQLocal;
demo.clear();
Start(false);
@@ -451,6 +469,10 @@
void HWGame::StartTraining(const QString & file)
{
+ lastGameStartArgs.clear();
+ lastGameStartArgs.append(file);
+ lastGameType = gtTraining;
+
gameType = gtTraining;
training = "Missions/Training/" + file + ".lua";
demo.clear();
@@ -460,6 +482,12 @@
void HWGame::StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam)
{
+ lastGameStartArgs.clear();
+ lastGameStartArgs.append(camp);
+ lastGameStartArgs.append(campScript);
+ lastGameStartArgs.append(campTeam);
+ lastGameType = gtCampaign;
+
gameType = gtCampaign;
campaign = camp;
campaignScript = "Missions/Campaign/" + camp + "/" + campScript;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/game.h
--- a/QTfrontend/game.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/game.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -29,6 +29,18 @@
class GameCFGWidget;
class TeamSelWidget;
+enum GameType
+{
+ gtNone = 0,
+ gtLocal = 1,
+ gtQLocal = 2,
+ gtDemo = 3,
+ gtNet = 4,
+ gtTraining = 5,
+ gtCampaign = 6,
+ gtSave = 7,
+};
+
enum GameState
{
gsNotStarted = 0,
@@ -49,6 +61,13 @@
bool checkForDir(const QString & dir);
+// last game info
+extern QList lastGameStartArgs;
+extern GameType lastGameType;
+extern GameCFGWidget * lastGameCfg;
+extern QString lastGameAmmo;
+extern TeamSelWidget * lastGameTeamSel;
+
class HWGame : public TCPBase
{
Q_OBJECT
@@ -86,16 +105,6 @@
void FromNetChat(const QString & msg);
private:
- enum GameType
- {
- gtLocal = 1,
- gtQLocal = 2,
- gtDemo = 3,
- gtNet = 4,
- gtTraining = 5,
- gtCampaign = 6,
- gtSave = 7,
- };
char msgbuf[MAXMSGCHARS];
QString ammostr;
GameUIConfig * config;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/gameuiconfig.cpp
--- a/QTfrontend/gameuiconfig.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/gameuiconfig.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include "gameuiconfig.h"
#include "hwform.h"
@@ -94,8 +95,8 @@
// If left blank reset the resolution to the default
wWidth = (wWidth == "" ? widthStr : wWidth);
wHeight = (wHeight == "" ? heightStr : wHeight);
- Form->ui.pageOptions->windowWidthEdit->setText(wWidth);
- Form->ui.pageOptions->windowHeightEdit->setText(wHeight);
+ Form->ui.pageOptions->windowWidthEdit->setValue(wWidth.toInt());
+ Form->ui.pageOptions->windowHeightEdit->setValue(wHeight.toInt());
Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 1 : t);
Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
@@ -111,7 +112,7 @@
Form->ui.pageOptions->CBFrontendMusic->setChecked(value("frontend/music", true).toBool());
Form->ui.pageOptions->SLVolume->setValue(value("audio/volume", 100).toUInt());
- QString netNick = value("net/nick", "").toString();
+ QString netNick = value("net/nick", tr("Guest")+QString("%1").arg(rand())).toString();
Form->ui.pageOptions->editNetNick->setText(netNick);
bool savePwd = value("net/savepassword",true).toBool();
Form->ui.pageOptions->CBSavePassword->setChecked(savePwd);
@@ -156,7 +157,7 @@
{ // load colors
QStandardItemModel * model = DataManager::instance().colorsModel();
for(int i = model->rowCount() - 1; i >= 0; --i)
- model->item(i)->setData(value(QString("colors/color%1").arg(i), model->item(i)->data()));
+ model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data()).toString()));
}
{ // load binds
@@ -217,12 +218,12 @@
void GameUIConfig::resizeToConfigValues()
{
// fill 2/3 of the screen desktop
- const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
+ const QRect deskSize = HWApplication::desktop()->screenGeometry(-1);
Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt());
// move the window to the center of the screen
- QPoint center = QApplication::desktop()->availableGeometry(-1).center();
+ QPoint center = HWApplication::desktop()->availableGeometry(-1).center();
center.setX(center.x() - (Form->width()/2));
center.setY(center.y() - (Form->height()/2));
Form->move(center);
@@ -319,7 +320,7 @@
{ // save colors
QStandardItemModel * model = DataManager::instance().colorsModel();
for(int i = model->rowCount() - 1; i >= 0; --i)
- setValue(QString("colors/color%1").arg(i), model->item(i)->data());
+ setValue(QString("colors/color%1").arg(i), model->item(i)->data().value().name());
}
sync();
@@ -520,14 +521,28 @@
setValue("net/passwordhash", QString());
setValue("net/passwordlength", 0);
setValue("net/savepassword", false); //changes the savepassword value to false in order to not let the user save an empty password in PAGE_SETUP
- reloadValues(); //reloads the values of PAGE_SETUP
+ Form->ui.pageOptions->editNetPassword->setEnabled(false);
+ Form->ui.pageOptions->editNetPassword->setText("");
}
void GameUIConfig::setPasswordHash(const QString & passwordhash)
{
setValue("net/passwordhash", passwordhash);
- setValue("net/passwordlength", passwordhash.size()/4);
- setNetPasswordLength(passwordhash.size()/4); //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW
+ if (passwordhash!=NULL && passwordhash.size() > 0)
+ {
+ // WTF - the whole point of "password length" was to have the dots match what they typed. This is totally pointless, and all hashes are the same length for a given hash so might as well hardcode it.
+ // setValue("net/passwordlength", passwordhash.size()/4);
+ setValue("net/passwordlength", 8);
+
+ // More WTF
+ //setNetPasswordLength(passwordhash.size()/4); //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW
+ setNetPasswordLength(8);
+ }
+ else
+ {
+ setValue("net/passwordlength", 0);
+ setNetPasswordLength(0);
+ }
}
QString GameUIConfig::passwordHash()
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/gameuiconfig.h
--- a/QTfrontend/gameuiconfig.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/gameuiconfig.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/hedgewars.qrc Thu Jun 13 22:27:23 2013 +0200
@@ -28,6 +28,16 @@
res/botlevels/net3.png
res/botlevels/net4.png
res/botlevels/net5.png
+ res/campaign/A Classic Fairytale/first_blood.png
+ res/campaign/A Classic Fairytale/shadow.png
+ res/campaign/A Classic Fairytale/journey.png
+ res/campaign/A Classic Fairytale/united.png
+ res/campaign/A Classic Fairytale/backstab.png
+ res/campaign/A Classic Fairytale/dragon.png
+ res/campaign/A Classic Fairytale/family.png
+ res/campaign/A Classic Fairytale/queen.png
+ res/campaign/A Classic Fairytale/enemy.png
+ res/campaign/A Classic Fairytale/epil.png
res/bonus.png
res/Hedgehog.png
res/net.png
@@ -133,6 +143,7 @@
res/StatsMostSelfDamage.png
res/StatsSelfKilled.png
res/StatsSkipped.png
+ res/StatsCustomAchievement.png
res/Start.png
res/mapRandom.png
res/mapMaze.png
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwconsts.cpp.in
--- a/QTfrontend/hwconsts.cpp.in Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/hwconsts.cpp.in Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwconsts.h
--- a/QTfrontend/hwconsts.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/hwconsts.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -67,6 +67,7 @@
#define SEASON_HWBDAY 4
#define SEASON_EASTER 8
+#define NETGAME_DEFAULT_SERVER "netserver.hedgewars.org"
#define NETGAME_DEFAULT_PORT 46631
#define HEDGEHOGS_PER_TEAM 8
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/hwform.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -45,6 +45,7 @@
#include
#include
#include
+#include
#if (QT_VERSION >= 0x040600)
#include
@@ -101,7 +102,7 @@
#include "DataManager.h"
#include "AutoUpdater.h"
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
#define WINVER 0x0500
#include
#else
@@ -109,7 +110,7 @@
#include
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include
#endif
@@ -150,9 +151,9 @@
ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
- config = new GameUIConfig(this, "physfs://hedgewars.ini");
+ config = new GameUIConfig(this, DataManager::instance().settingsFileName());
frontendEffects = config->value("frontend/effects", true).toBool();
- playerHash = QString(QCryptographicHash::hash(config->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
+ playerHash = QString(QCryptographicHash::hash(config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(), QCryptographicHash::Md5).toHex());
ui.pageRoomsList->setSettings(config);
ui.pageNetGame->setSettings(config);
@@ -193,6 +194,8 @@
//connect (updateData, SIGNAL(activated()), &DataManager::instance(), SLOT(reload()));
#endif
+ previousCampaignName = "";
+ previousTeamName = "";
UpdateTeamsLists();
InitCampaignPage();
UpdateCampaignPage(0);
@@ -285,6 +288,7 @@
connect(ui.pageInfo->BtnSnapshots, SIGNAL(clicked()), this, SLOT(OpenSnapshotFolder()));
connect(ui.pageGameStats, SIGNAL(saveDemoRequested()), this, SLOT(saveDemoWithCustomName()));
+ connect(ui.pageGameStats, SIGNAL(restartGameRequested()), this, SLOT(restartGame()));
connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame()));
connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
@@ -304,7 +308,7 @@
connect(ui.pageCampaign->BtnStartCampaign, SIGNAL(clicked()), this, SLOT(StartCampaign()));
connect(ui.pageCampaign->CBTeam, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int)));
connect(ui.pageCampaign->CBCampaign, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int)));
-
+ connect(ui.pageCampaign->CBMission, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPageMission(int)));
connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()),
ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first
@@ -317,8 +321,6 @@
connect(ui.pageMain->BtnNetLocal, SIGNAL(clicked()), this, SLOT(GoToNet()));
connect(ui.pageMain->BtnNetOfficial, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
- connect(ui.pageConnecting, SIGNAL(cancelConnection()), this, SLOT(GoBack()));
-
connect(ui.pageVideos, SIGNAL(goBack()), config, SLOT(SaveVideosOptions()));
ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini");
@@ -361,7 +363,7 @@
{
if(hwnet && (hwnet->clientState() != HWNewNet::Disconnected))
{
- xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("netserver.hedgewars.org:%1").arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii());
+ xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("%1:%2").arg(NETGAME_DEFAULT_SERVER).arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii());
switch(hwnet->clientState())
{
case HWNewNet::Connecting: // Connecting
@@ -470,7 +472,7 @@
if(teamslist.empty())
{
- QString currentNickName = config->value("net/nick","").toString().toUtf8();
+ QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8();
QString teamName;
if (currentNickName.isEmpty())
@@ -596,6 +598,10 @@
#endif
qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id)));
+ if (lastid == ID_PAGE_MAIN)
+ {
+ ui.pageMain->resetNetworkChoice();
+ }
// pageEnter and pageLeave events
((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave();
@@ -673,6 +679,21 @@
}
}
+ if (id == ID_PAGE_GAMESTATS)
+ {
+ switch(lastGameType) {
+ case gtLocal:
+ case gtQLocal:
+ case gtTraining:
+ case gtCampaign:
+ ui.pageGameStats->restartBtnVisible(true);
+ break;
+ default:
+ ui.pageGameStats->restartBtnVisible(false);
+ break;
+ }
+ }
+
if (id == ID_PAGE_MAIN)
{
ui.pageOptions->setTeamOptionsEnabled(true);
@@ -1014,7 +1035,7 @@
void HWForm::NetConnectOfficialServer()
{
- NetConnectServer("netserver.hedgewars.org", NETGAME_DEFAULT_PORT);
+ NetConnectServer(NETGAME_DEFAULT_SERVER, NETGAME_DEFAULT_PORT);
}
void HWForm::NetPassword(const QString & nick)
@@ -1246,20 +1267,20 @@
// room status stuff
connect(hwnet, SIGNAL(roomMaster(bool)),
- this, SLOT(NetGameChangeStatus(bool)), Qt::QueuedConnection);
+ this, SLOT(NetGameChangeStatus(bool)));
// net page stuff
connect(hwnet, SIGNAL(roomNameUpdated(const QString &)),
ui.pageNetGame, SLOT(setRoomName(const QString &)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(chatStringFromNet(const QString&)),
- ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
+ connect(hwnet, SIGNAL(roomChatAction(const QString&, const QString&)),
+ ui.pageNetGame->chatWidget, SLOT(onChatAction(const QString&, const QString&)), Qt::QueuedConnection);
+ connect(hwnet, SIGNAL(roomChatMessage(const QString&, const QString&)),
+ ui.pageNetGame->chatWidget, SLOT(onChatMessage(const QString&, const QString&)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(chatStringFromMe(const QString&)),
- ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(roomMaster(bool)),
ui.pageNetGame->chatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
connect(ui.pageNetGame->chatWidget, SIGNAL(chatLine(const QString&)),
- hwnet, SLOT(chatLineToNet(const QString&)));
+ hwnet, SLOT(chatLineToNetWithEcho(const QString&)));
connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
connect(hwnet, SIGNAL(setMyReadyStatus(bool)),
ui.pageNetGame, SLOT(setReadyStatus(bool)), Qt::QueuedConnection);
@@ -1286,25 +1307,38 @@
connect(ui.pageRoomsList->chatWidget, SIGNAL(consoleCommand(const QString&)),
hwnet, SLOT(consoleCommand(const QString&)));
+// player info
+ connect(hwnet, SIGNAL(playerInfo(const QString&, const QString&, const QString&, const QString&)),
+ ui.pageRoomsList->chatWidget, SLOT(onPlayerInfo(const QString&, const QString&, const QString&, const QString&)), Qt::QueuedConnection);
+ connect(hwnet, SIGNAL(playerInfo(const QString&, const QString&, const QString&, const QString&)),
+ ui.pageNetGame->chatWidget, SLOT(onPlayerInfo(const QString&, const QString&, const QString&, const QString&)), Qt::QueuedConnection);
+
// chatting
connect(ui.pageRoomsList->chatWidget, SIGNAL(chatLine(const QString&)),
hwnet, SLOT(chatLineToLobby(const QString&)));
- connect(hwnet, SIGNAL(chatStringLobby(const QString&)),
- ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(chatStringLobby(const QString&, const QString&)),
- ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&, const QString&)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(chatStringFromMeLobby(const QString&)),
- ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
+ connect(hwnet, SIGNAL(lobbyChatAction(const QString&,const QString&)),
+ ui.pageRoomsList->chatWidget, SLOT(onChatAction(const QString&,const QString&)), Qt::QueuedConnection);
+ connect(hwnet, SIGNAL(lobbyChatMessage(const QString&, const QString&)),
+ ui.pageRoomsList->chatWidget, SLOT(onChatMessage(const QString&, const QString&)), Qt::QueuedConnection);
// nick list stuff
- connect(hwnet, SIGNAL(nickAdded(const QString&, bool)),
- ui.pageNetGame->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(nickRemoved(const QString&)),
- ui.pageNetGame->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(nickAddedLobby(const QString&, bool)),
- ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
- connect(hwnet, SIGNAL(nickRemovedLobby(const QString&)),
- ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
+ {
+ QSortFilterProxyModel * playersSortFilterModel = qobject_cast(hwnet->lobbyPlayersModel());
+ if(playersSortFilterModel)
+ {
+ PlayersListModel * players = qobject_cast(playersSortFilterModel->sourceModel());
+ connect(players, SIGNAL(nickAdded(const QString&, bool)),
+ ui.pageNetGame->chatWidget, SLOT(nickAdded(const QString&, bool)));
+ connect(players, SIGNAL(nickRemoved(const QString&)),
+ ui.pageNetGame->chatWidget, SLOT(nickRemoved(const QString&)));
+ connect(players, SIGNAL(nickAddedLobby(const QString&, bool)),
+ ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)));
+ connect(players, SIGNAL(nickRemovedLobby(const QString&)),
+ ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&)));
+ connect(players, SIGNAL(nickRemovedLobby(const QString&, const QString&)),
+ ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&, const QString&)));
+ }
+ }
// teams selecting stuff
connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
@@ -1342,14 +1376,15 @@
connect(ui.pageNetGame->pGameCFG, SIGNAL(paramChanged(const QString &, const QStringList &)), hwnet, SLOT(onParamChanged(const QString &, const QStringList &)));
connect(hwnet, SIGNAL(configAsked()), ui.pageNetGame->pGameCFG, SLOT(fullNetConfig()));
- //nick and pass stuff
- QString nickname = config->value("net/nick", "").toString();
+ // using proxy slot to prevent loss of game messages when they're sent to not yet connected slot of game object
+ connect(hwnet, SIGNAL(FromNet(const QByteArray &)), this, SLOT(FromNetProxySlot(const QByteArray &)), Qt::QueuedConnection);
- hwnet->m_private_game = !(hostName == "netserver.hedgewars.org" && port == NETGAME_DEFAULT_PORT);
- if (hwnet->m_private_game == false)
- if (AskForNickAndPwd() != 0)
- return;
+ //nick and pass stuff
+ hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT);
+ if (hwnet->m_private_game == false && AskForNickAndPwd() != 0)
+ return;
+ QString nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
ui.pageRoomsList->setUser(nickname);
ui.pageNetGame->setUser(nickname);
@@ -1362,16 +1397,18 @@
config->clearTempHash();
//initialize
- QString hash = config->passwordHash();
- QString temphash = config->tempHash();
- QString nickname = config->value("net/nick", "").toString();
+ QString hash;
+ QString temphash;
+ QString nickname;
QString password;
- //if something from login is missing, start dialog loop
- if (nickname.isEmpty() || hash.isEmpty())
- {
- while (nickname.isEmpty() || (hash.isEmpty() && temphash.isEmpty())) //while a nickname, or both hashes are missing
- {
+ do {
+ nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString();
+ hash = config->passwordHash();
+ temphash = config->tempHash();
+
+ //if something from login is missing, start dialog loop
+ if (nickname.isEmpty() || hash.isEmpty()) {
//open dialog
HWPasswordDialog * pwDialog = new HWPasswordDialog(this);
// make the "new account" button dialog open a browser with the registration page
@@ -1388,62 +1425,54 @@
if (pwDialog->exec() != QDialog::Accepted) {
delete pwDialog;
GoBack();
- return -1;
+ break;
}
//set nick and pass from the dialog
nickname = pwDialog->leNickname->text();
password = pwDialog->lePassword->text();
+ bool save = pwDialog->cbSave->isChecked();
+ //clean up
+ delete pwDialog;
//check the nickname variable
if (nickname.isEmpty()) {
int retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied."));
GoBack();
- delete pwDialog;
if (retry) {
if (hwnet->m_private_game) {
QStringList list = hwnet->getHost().split(":");
NetConnectServer(list.at(0), list.at(1).toShort());
} else
NetConnectOfficialServer();
- }
- return -1;
+ }
+ break; //loop restart
+ } else {
+ //update nickname if it's fine
+ config->setValue("net/nick", nickname);
+ config->updNetNick();
}
- if (!password.isEmpty()) {
+ //check the password variable
+ if (password.isEmpty()) {
+ config->clearPasswordHash();
+ break;
+ } else {
//calculate temphash and set it into config
temphash = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Md5).toHex();
config->setTempHash(temphash);
//if user wants to save password
- bool save = pwDialog->cbSave->isChecked();
config->setValue("net/savepassword", save);
- if (save) // user wants to save password
- {
+ if (save) {
+ // user wants to save password
ui.pageOptions->CBSavePassword->setChecked(true);
config->setPasswordHash(temphash);
}
}
- else {
- delete pwDialog;
- config->setValue("net/nick", nickname);
- config->updNetNick();
- config->clearPasswordHash();
- break;
- }
-
- delete pwDialog;
+ }
+ } while (nickname.isEmpty() || (hash.isEmpty() && temphash.isEmpty())); //while a nickname, or both hashes are missing
- //update nickname
- config->setValue("net/nick", nickname);
- config->updNetNick();
-
- //and all the variables
- hash = config->passwordHash();
- temphash = config->tempHash();
- nickname = config->value("net/nick", "").toString();
- }
- }
return 0;
}
@@ -1516,7 +1545,7 @@
if (retry) {
if (hwnet->m_private_game) {
QStringList list = hwnet->getHost().split(":");
- NetConnectServer(list.at(0), list.at(1).toShort());
+ NetConnectServer(list.at(0), list.at(1).toUInt());
} else
NetConnectOfficialServer();
}
@@ -1702,6 +1731,11 @@
void HWForm::CreateNetGame()
{
+ // go back in pages to prevent user from being stuck on certain pages
+ if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS ||
+ ui.Pages->currentIndex() == ID_PAGE_INGAME)
+ GoBack();
+
QString ammo;
ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData(
ui.pageNetGame->pGameCFG->WeaponsName->currentIndex()
@@ -1712,7 +1746,6 @@
connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &)));
connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &)));
connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &)));
- connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection);
game->StartNet();
@@ -1740,9 +1773,6 @@
void HWForm::NetGameChangeStatus(bool isMaster)
{
- ui.pageNetGame->pGameCFG->setMaster(isMaster);
- ui.pageNetGame->pNetTeamsWidget->setInteractivity(isMaster);
-
if (isMaster)
NetGameMaster();
else
@@ -1794,6 +1824,7 @@
{
NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);
connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)), netAmmo, SLOT(setNetSchemeConfig(QStringList &)));
+
ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
ui.pageNetGame->setRoomName(hwnet->getRoom());
@@ -1806,6 +1837,13 @@
ui.pageNetGame->setMasterMode(false);
}
+void HWForm::FromNetProxySlot(const QByteArray & msg)
+{
+ if(game)
+ game->FromNet(msg);
+
+}
+
void HWForm::selectFirstNetScheme()
{
ui.pageNetGame->pGameCFG->GameSchemes->setCurrentIndex(0);
@@ -1866,10 +1904,72 @@
unsigned int n = missionEntries.count();
unsigned int m = getCampProgress(tName, campaignName);
+ // if the campaign name changes update the campaignMissionDescriptions list
+ // this will be used later in UpdateCampaignPageMission() to update
+ // the mission description in the campaign page
+ bool updateMissionList = false;
+ QSettings * m_info;
+ if(previousCampaignName.compare(campaignName)!=0 ||
+ previousTeamName.compare(tName) != 0)
+ {
+ if (previousTeamName.compare(tName) != 0 &&
+ previousTeamName.compare("") != 0)
+ index = qMin(m + 1, n);
+ previousCampaignName = campaignName;
+ previousTeamName = tName;
+ updateMissionList = true;
+ // the following code was based on pagetraining.cpp
+ DataManager & dataMgr = DataManager::instance();
+ // get locale
+ QSettings settings(dataMgr.settingsFileName(),
+ QSettings::IniFormat);
+ QString loc = settings.value("misc/locale", "").toString();
+ if (loc.isEmpty())
+ loc = QLocale::system().name();
+ QString campaignDescFile = QString("physfs://Locale/campaigns_" + loc + ".txt");
+ // if file is non-existant try with language only
+ if (!QFile::exists(campaignDescFile))
+ campaignDescFile = QString("physfs://Locale/campaigns_" + loc.remove(QRegExp("_.*$")) + ".txt");
+
+ // fallback if file for current locale is non-existant
+ if (!QFile::exists(campaignDescFile))
+ campaignDescFile = QString("physfs://Locale/campaigns_en.txt");
+
+ m_info = new QSettings(campaignDescFile, QSettings::IniFormat, this);
+ m_info->setIniCodec("UTF-8");
+ campaignMissionDescriptions.clear();
+ ui.pageCampaign->CBMission->clear();
+ }
+
for (unsigned int i = qMin(m + 1, n); i > 0; i--)
{
+ if(updateMissionList)
+ {
+ campaignMissionDescriptions += m_info->value(campaignName+"-"+ getCampaignMissionName(campaignName,i) + ".desc",
+ tr("No description available")).toString();
+ }
ui.pageCampaign->CBMission->addItem(QString("Mission %1: ").arg(i) + QString(missionEntries[i-1]), QString(missionEntries[i-1]));
}
+ if(updateMissionList)
+ delete m_info;
+
+ UpdateCampaignPageMission(index);
+}
+
+void HWForm::UpdateCampaignPageMission(int index)
+{
+ // update thumbnail
+ QString campaignName = ui.pageCampaign->CBCampaign->currentText();
+ unsigned int mNum = ui.pageCampaign->CBMission->count() - ui.pageCampaign->CBMission->currentIndex();
+ QString image = getCampaignImage(campaignName,mNum);
+ ui.pageCampaign->btnPreview->setIcon(QIcon((":/res/campaign/"+campaignName+"/"+image)));
+ // update description
+ // when campaign changes the UpdateCampaignPageMission is triggered with wrong values
+ // this will cause segfault. This check prevents illegal memory reads
+ if(index > -1 && index < campaignMissionDescriptions.count()) {
+ ui.pageCampaign->lbltitle->setText(""+ui.pageCampaign->CBMission->currentText()+"
");
+ ui.pageCampaign->lbldescription->setText(campaignMissionDescriptions[index]);
+ }
}
void HWForm::UpdateCampaignPageProgress(int index)
@@ -1887,7 +1987,7 @@
QString prefix = "\"" + datadir->absolutePath() + "\"";
QString userPrefix = "\"" + cfgdir->absolutePath() + "\"";
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
prefix = prefix.replace("/","\\");
userPrefix = userPrefix.replace("/","\\");
#endif
@@ -1928,7 +2028,7 @@
registry_hkcr.setValue("Hedgewars.Save/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hwengine.exe\" " + arguments + " %1");
// custom url scheme(s)
- registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Protocol\"");
+ registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Scheme\"");
registry_hkcr.setValue("hwplay/URL Protocol", "");
registry_hkcr.setValue("hwplay/DefaultIcon/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\",0");
registry_hkcr.setValue("hwplay/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\" %1");
@@ -1947,8 +2047,10 @@
if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share");
if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share/applications");
if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars-mimeinfo.xml "+QDir::home().absolutePath()+"/.local/share/mime/packages").toLocal8Bit().constData())==0;
+ if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hwengine.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0;
if (success) success = system(("update-mime-database "+QDir::home().absolutePath()+"/.local/share/mime").toLocal8Bit().constData())==0;
+ if (success) success = system("xdg-mime default hedgewars.desktop x-scheme-handler/hwplay")==0;
if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-demo")==0;
if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0;
// hack to add user's settings to hwengine. might be better at this point to read in the file, append it, and write it out to its new home. This assumes no spaces in the data dir path
@@ -2000,6 +2102,31 @@
}
}
+void HWForm::restartGame()
+{
+ // get rid off old game stats page
+ if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS)
+ GoBack();
+
+ CreateGame(lastGameCfg, lastGameTeamSel, lastGameAmmo);
+
+ switch(lastGameType) {
+ case gtTraining:
+ game->StartTraining(lastGameStartArgs.at(0).toString());
+ break;
+ case gtQLocal:
+ game->StartQuick();
+ break;
+ case gtCampaign:
+ game->StartCampaign(lastGameStartArgs.at(0).toString(), lastGameStartArgs.at(1).toString(), lastGameStartArgs.at(2).toString());
+ break;
+ case gtLocal:
+ game->StartLocal();
+ break;
+ default:
+ break;
+ }
+}
void HWForm::ShowErrorMessage(const QString & msg)
{
@@ -2008,8 +2135,22 @@
void HWForm::showFeedbackDialog()
{
- FeedbackDialog dialog(this);
- dialog.exec();
+ QNetworkRequest newRequest(QUrl("http://www.hedgewars.org"));
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+ QNetworkReply *reply = manager->get(newRequest);
+ connect(reply, SIGNAL(finished()), this, SLOT(showFeedbackDialogNetChecked()));
+}
+
+void HWForm::showFeedbackDialogNetChecked()
+{
+ QNetworkReply *reply = qobject_cast(sender());
+
+ if (reply && (reply->error() == QNetworkReply::NoError)) {
+ FeedbackDialog dialog(this);
+ dialog.exec();
+ } else
+ MessageDialog::ShowErrorMessage(tr("This page requires an internet connection."), this);
}
void HWForm::startGame()
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwform.h
--- a/QTfrontend/hwform.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/hwform.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -127,8 +127,10 @@
void Music(bool checked);
void UpdateCampaignPage(int index);
void UpdateCampaignPageProgress(int index);
+ void UpdateCampaignPageMission(int index);
void InitCampaignPage();
void showFeedbackDialog();
+ void showFeedbackDialogNetChecked();
void NetGameChangeStatus(bool isMaster);
void NetGameMaster();
@@ -142,6 +144,9 @@
void openRegistrationPage();
void startGame();
+ void restartGame();
+
+ void FromNetProxySlot(const QByteArray &);
private:
void _NetConnect(const QString & hostName, quint16 port, QString nick);
@@ -188,6 +193,9 @@
HWNamegen * namegen;
AmmoSchemeModel * ammoSchemeModel;
QStack PagesStack;
+ QString previousCampaignName;
+ QString previousTeamName;
+ QStringList campaignMissionDescriptions;
QTime eggTimer;
BGWidget * wBackground;
QSignalMapper * pageSwitchMapper;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/main.cpp
--- a/QTfrontend/main.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/main.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -20,7 +20,6 @@
#include
#include
-#include
#include
#include
#include
@@ -36,6 +35,7 @@
#include "DataManager.h"
#include "FileEngine.h"
+#include "MessageDialog.h"
#ifdef _WIN32
#include
@@ -99,12 +99,7 @@
if (!tmpdir.exists())
if (!tmpdir.mkpath(dir))
{
- QMessageBox directoryMsg(QApplication::activeWindow());
- directoryMsg.setIcon(QMessageBox::Warning);
- directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
- directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir));
- directoryMsg.setWindowModality(Qt::WindowModal);
- directoryMsg.exec();
+ MessageDialog::ShowErrorMessage(HWApplication::tr("Cannot create directory %1").arg(dir));
return false;
}
return true;
@@ -140,11 +135,11 @@
HWApplication app(argc, argv);
QLabel *splash = NULL;
-#if defined Q_WS_WIN
+#if defined Q_OS_WIN
QPixmap pixmap(":res/splash.png");
splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
splash->setAttribute(Qt::WA_TranslucentBackground);
- const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
+ const QRect deskSize = HWApplication::desktop()->screenGeometry(-1);
QPoint splashCenter = QPoint( (deskSize.width() - pixmap.width())/2,
(deskSize.height() - pixmap.height())/2 );
splash->move(splashCenter);
@@ -253,16 +248,9 @@
datadir->cd(bindir->absolutePath());
datadir->cd(*cDataDir);
- if(!datadir->cd("Data"))
+ if (!datadir->cd("Data"))
{
- QMessageBox missingMsg(QApplication::activeWindow());
- missingMsg.setIcon(QMessageBox::Critical);
- missingMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
- missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n"
- "Please check your installation!").
- arg(datadir->absolutePath()+"/Data"));
- missingMsg.setWindowModality(Qt::WindowModal);
- missingMsg.exec();
+ MessageDialog::ShowFatalMessage(HWApplication::tr("Failed to open data directory:\n%1\n\nPlease check your installation!").arg(datadir->absolutePath()+"/Data"));
return 1;
}
@@ -273,18 +261,24 @@
engine->setWriteDir(cfgdir->absolutePath());
engine->mountPacks();
- DataManager::ensureFileExists("physfs://hedgewars.ini");
-
QTranslator Translator;
{
- QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat);
+ QSettings settings(DataManager::instance().settingsFileName(), QSettings::IniFormat);
+ settings.setIniCodec("UTF-8");
+
QString cc = settings.value("misc/locale", QString()).toString();
- if(cc.isEmpty())
+ if (cc.isEmpty())
+ {
cc = QLocale::system().name();
+ // Fallback to current input locale if "C" locale is returned
+ if(cc == "C")
+ cc = HWApplication::keyboardInputLocale().name();
+ }
+
// load locale file into translator
- if(!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
- qWarning("Failed to install translation");
+ if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
+ qWarning("Failed to install translation (%s)", qPrintable(cc));
app.installTranslator(&Translator);
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/GameStyleModel.cpp
--- a/QTfrontend/model/GameStyleModel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/GameStyleModel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/GameStyleModel.h
--- a/QTfrontend/model/GameStyleModel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/GameStyleModel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/HatModel.cpp
--- a/QTfrontend/model/HatModel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/HatModel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/HatModel.h
--- a/QTfrontend/model/HatModel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/HatModel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/MapModel.cpp
--- a/QTfrontend/model/MapModel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/MapModel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/MapModel.h
--- a/QTfrontend/model/MapModel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/MapModel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ThemeModel.cpp
--- a/QTfrontend/model/ThemeModel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/ThemeModel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ThemeModel.h
--- a/QTfrontend/model/ThemeModel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/ThemeModel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ammoSchemeModel.cpp
--- a/QTfrontend/model/ammoSchemeModel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/ammoSchemeModel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -194,7 +194,7 @@
<< QVariant(false) // place hog 14
<< QVariant(true) // shared ammo 15
<< QVariant(true) // disable girders 16
- << QVariant(false) // disable land objects 17
+ << QVariant(true) // disable land objects 17
<< QVariant(false) // AI survival 18
<< QVariant(false) // inf. attack 19
<< QVariant(true) // reset weps 20
@@ -407,7 +407,7 @@
<< QVariant(true) // team divide 2
<< QVariant(false) // solid land 3
<< QVariant(false) // border 4
- << QVariant(true) // low gravity 5
+ << QVariant(false) // low gravity 5
<< QVariant(false) // laser sight 6
<< QVariant(false) // invulnerable 7
<< QVariant(false) // reset health 8
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ammoSchemeModel.h
--- a/QTfrontend/model/ammoSchemeModel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/ammoSchemeModel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/netserverslist.cpp
--- a/QTfrontend/model/netserverslist.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/netserverslist.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/netserverslist.h
--- a/QTfrontend/model/netserverslist.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/netserverslist.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/playerslistmodel.cpp
--- a/QTfrontend/model/playerslistmodel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/playerslistmodel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -84,7 +84,7 @@
}
-void PlayersListModel::addPlayer(const QString & nickname)
+void PlayersListModel::addPlayer(const QString & nickname, bool notify)
{
insertRow(rowCount());
@@ -92,11 +92,18 @@
setData(mi, nickname);
checkFriendIgnore(mi);
+
+ emit nickAddedLobby(nickname, notify);
}
-void PlayersListModel::removePlayer(const QString & nickname)
+void PlayersListModel::removePlayer(const QString & nickname, const QString &msg)
{
+ if(msg.isEmpty())
+ emit nickRemovedLobby(nickname);
+ else
+ emit nickRemovedLobby(nickname, msg);
+
QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
if(mil.size())
@@ -104,7 +111,7 @@
}
-void PlayersListModel::playerJoinedRoom(const QString & nickname)
+void PlayersListModel::playerJoinedRoom(const QString & nickname, bool notify)
{
QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
@@ -114,11 +121,15 @@
updateIcon(mil[0]);
updateSortData(mil[0]);
}
+
+ emit nickAdded(nickname, notify);
}
void PlayersListModel::playerLeftRoom(const QString & nickname)
{
+ emit nickRemoved(nickname);
+
QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
if(mil.size())
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/playerslistmodel.h
--- a/QTfrontend/model/playerslistmodel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/playerslistmodel.h Thu Jun 13 22:27:23 2013 +0200
@@ -41,13 +41,20 @@
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
public slots:
- void addPlayer(const QString & nickname);
- void removePlayer(const QString & nickname);
- void playerJoinedRoom(const QString & nickname);
+ void addPlayer(const QString & nickname, bool notify);
+ void removePlayer(const QString & nickname, const QString & msg = QString());
+ void playerJoinedRoom(const QString & nickname, bool notify);
void playerLeftRoom(const QString & nickname);
void resetRoomFlags();
void setNickname(const QString & nickname);
+signals:
+ void nickAdded(const QString& nick, bool notifyNick);
+ void nickRemoved(const QString& nick);
+ void nickAddedLobby(const QString& nick, bool notifyNick);
+ void nickRemovedLobby(const QString& nick);
+ void nickRemovedLobby(const QString& nick, const QString& message);
+
private:
QHash & m_icons();
typedef QHash DataEntry;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/roomslistmodel.cpp
--- a/QTfrontend/model/roomslistmodel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/roomslistmodel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/roomslistmodel.h
--- a/QTfrontend/model/roomslistmodel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/model/roomslistmodel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/hwmap.cpp
--- a/QTfrontend/net/hwmap.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/hwmap.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Ulyanov Igor
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/hwmap.h
--- a/QTfrontend/net/hwmap.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/hwmap.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netregister.cpp
--- a/QTfrontend/net/netregister.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netregister.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netregister.h
--- a/QTfrontend/net/netregister.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netregister.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netserver.cpp
--- a/QTfrontend/net/netserver.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netserver.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netserver.h
--- a/QTfrontend/net/netserver.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netserver.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpserver.cpp
--- a/QTfrontend/net/netudpserver.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netudpserver.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpserver.h
--- a/QTfrontend/net/netudpserver.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netudpserver.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpwidget.cpp
--- a/QTfrontend/net/netudpwidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netudpwidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpwidget.h
--- a/QTfrontend/net/netudpwidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/netudpwidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/newnetclient.cpp
--- a/QTfrontend/net/newnetclient.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/newnetclient.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -336,10 +336,24 @@
qWarning("Net: Empty CHAT message");
return;
}
+
+ QString action = HWProto::chatStringToAction(lst[2]);
+
if (netClientState == InLobby)
- emit chatStringLobby(lst[1], HWProto::formatChatMsgForFrontend(lst[2]));
+ {
+ if (action != NULL)
+ emit lobbyChatAction(lst[1], action);
+ else
+ emit lobbyChatMessage(lst[1], lst[2]);
+ }
else
+ {
emit chatStringFromNet(HWProto::formatChatMsg(lst[1], lst[2]));
+ if (action != NULL)
+ emit roomChatAction(lst[1], action);
+ else
+ emit roomChatMessage(lst[1], lst[2]);
+ }
return;
}
@@ -350,12 +364,13 @@
qWarning("Net: Malformed INFO message");
return;
}
- QStringList tmp = lst;
- tmp.removeFirst();
- if (netClientState == InLobby)
- emit chatStringLobby(tmp.join("\n").prepend('\x01'));
- else
- emit chatStringFromNet(tmp.join("\n").prepend('\x01'));
+ emit playerInfo(lst[1], lst[2], lst[3], lst[4]);
+ if (netClientState != InLobby)
+ {
+ QStringList tmp = lst;
+ tmp.removeFirst();
+ emit chatStringFromNet(tmp.join(" ").prepend('\x01'));
+ }
return;
}
@@ -410,8 +425,7 @@
{
if (nick == mynick)
{
- if (isChief && !setFlag) ToggleReady();
- else emit setMyReadyStatus(setFlag);
+ emit setMyReadyStatus(setFlag);
}
m_playersModel->setFlag(nick, PlayersListModel::Ready, setFlag);
}
@@ -490,9 +504,7 @@
emit connected();
}
- m_playersModel->addPlayer(lst[i]);
- emit nickAddedLobby(lst[i], false);
- emit chatStringLobby(lst[i], tr("%1 *** %2 has joined").arg('\x03').arg("|nick|"));
+ m_playersModel->addPlayer(lst[i], false);
}
return;
}
@@ -539,13 +551,11 @@
qWarning("Net: Bad LOBBY:LEFT message");
return;
}
- emit nickRemovedLobby(lst[1]);
+
if (lst.size() < 3)
- emit chatStringLobby(tr("%1 *** %2 has left").arg('\x03').arg(lst[1]));
+ m_playersModel->removePlayer(lst[1]);
else
- emit chatStringLobby(lst[1], tr("%1 *** %2 has left (%3)").arg('\x03').arg("|nick|", lst[2]));
-
- m_playersModel->removePlayer(lst[1]);
+ m_playersModel->removePlayer(lst[1], lst[2]);
return;
}
@@ -636,8 +646,8 @@
emit configAsked();
}
- m_playersModel->playerJoinedRoom(lst[i]);
- emit nickAdded(lst[i], isChief && (lst[i] != mynick));
+ m_playersModel->playerJoinedRoom(lst[i], isChief && (lst[i] != mynick));
+
emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
}
return;
@@ -769,9 +779,8 @@
for(int i = 1; i < lst.size(); ++i)
{
- emit nickAdded(lst[i], isChief && (lst[i] != mynick));
emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
- m_playersModel->playerJoinedRoom(lst[i]);
+ m_playersModel->playerJoinedRoom(lst[i], isChief && (lst[i] != mynick));
}
return;
}
@@ -783,7 +792,7 @@
qWarning("Net: Bad LEFT message");
return;
}
- emit nickRemoved(lst[1]);
+
if (lst.size() < 3)
emit chatStringFromNet(tr("%1 *** %2 has left").arg('\x03').arg(lst[1]));
else
@@ -836,12 +845,25 @@
);
}
+void HWNewNet::chatLineToNetWithEcho(const QString& str)
+{
+ if(str != "")
+ {
+ emit chatStringFromNet(HWProto::formatChatMsg(mynick, str));
+ chatLineToNet(str);
+ }
+}
+
void HWNewNet::chatLineToNet(const QString& str)
{
if(str != "")
{
RawSendNet(QString("CHAT") + delimeter + str);
- emit(chatStringFromMe(HWProto::formatChatMsg(mynick, str)));
+ QString action = HWProto::chatStringToAction(str);
+ if (action != NULL)
+ emit(roomChatAction(mynick, action));
+ else
+ emit(roomChatMessage(mynick, str));
}
}
@@ -850,7 +872,11 @@
if(str != "")
{
RawSendNet(QString("CHAT") + delimeter + str);
- emit chatStringLobby(mynick, HWProto::formatChatMsgForFrontend(str));
+ QString action = HWProto::chatStringToAction(str);
+ if (action != NULL)
+ emit(lobbyChatAction(mynick, action));
+ else
+ emit(lobbyChatMessage(mynick, str));
}
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/newnetclient.h
--- a/QTfrontend/net/newnetclient.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/newnetclient.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -99,10 +99,6 @@
void AuthFailed();
void EnteredGame();
void LeftRoom(const QString & reason);
- void nickAdded(const QString& nick, bool notifyNick);
- void nickRemoved(const QString& nick);
- void nickAddedLobby(const QString& nick, bool notifyNick);
- void nickRemovedLobby(const QString& nick);
void FromNet(const QByteArray & buf);
void adminAccess(bool);
void roomMaster(bool);
@@ -117,11 +113,16 @@
void RemoveNetTeam(const HWTeam&);
void hhnumChanged(const HWTeam&);
void teamColorChanged(const HWTeam&);
- void chatStringLobby(const QString&);
- void chatStringLobby(const QString&, const QString&);
+ void playerInfo(
+ const QString & nick,
+ const QString & ip,
+ const QString & version,
+ const QString & roomInfo);
+ void lobbyChatMessage(const QString & nick, const QString & message);
+ void lobbyChatAction(const QString & nick, const QString & action);
+ void roomChatMessage(const QString & nick, const QString & message);
+ void roomChatAction(const QString & nick, const QString & action);
void chatStringFromNet(const QString&);
- void chatStringFromMe(const QString&);
- void chatStringFromMeLobby(const QString&);
void roomsList(const QStringList&);
void serverMessage(const QString &);
@@ -137,6 +138,7 @@
public slots:
void ToggleReady();
void chatLineToNet(const QString& str);
+ void chatLineToNetWithEcho(const QString&);
void chatLineToLobby(const QString& str);
void SendTeamMessage(const QString& str);
void SendNet(const QByteArray & buf);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/proto.cpp
--- a/QTfrontend/net/proto.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/proto.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -45,11 +45,6 @@
return buf;
}
-QString HWProto::formatChatMsgForFrontend(const QString & msg)
-{
- return formatChatMsg("|nick|", msg);
-}
-
QString HWProto::formatChatMsg(const QString & nick, const QString & msg)
{
if(msg.left(4) == "/me ")
@@ -57,3 +52,11 @@
else
return QString("\x01%1: %2").arg(nick).arg(msg);
}
+
+QString HWProto::chatStringToAction(const QString & string)
+{
+ if(string.left(4) == "/me ")
+ return string.mid(4);
+ else
+ return NULL;
+}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/proto.h
--- a/QTfrontend/net/proto.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/proto.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -35,6 +35,12 @@
static QByteArray & addStringListToBuffer(QByteArray & buf, const QStringList & strList);
static QString formatChatMsg(const QString & nick, const QString & msg);
static QString formatChatMsgForFrontend(const QString & msg);
+ /**
+ * @brief Determines if a chat string represents a chat action and returns the action.
+ * @param string chat string
+ * @return the action-message or NULL if message is no action
+ */
+ static QString chatStringToAction(const QString & string);
};
#endif // _PROTO_H
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/recorder.cpp
--- a/QTfrontend/net/recorder.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/recorder.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/recorder.h
--- a/QTfrontend/net/recorder.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/recorder.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/tcpBase.cpp
--- a/QTfrontend/net/tcpBase.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/tcpBase.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -19,13 +19,12 @@
#include "tcpBase.h"
-#include
#include
-#include
#include
#include
#include "hwconsts.h"
+#include "MessageDialog.h"
#ifdef HWLIBRARY
extern "C" void Game(char**arguments);
@@ -89,13 +88,7 @@
IPCServer->setMaxPendingConnections(1);
if (!IPCServer->listen(QHostAddress::LocalHost))
{
- QMessageBox deniedMsg(QApplication::activeWindow());
- deniedMsg.setIcon(QMessageBox::Critical);
- deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error"));
- deniedMsg.setText(QMessageBox::tr("Unable to start the server: %1.").arg(IPCServer->errorString()));
- deniedMsg.setWindowModality(Qt::WindowModal);
- deniedMsg.exec();
-
+ MessageDialog::ShowFatalMessage(tr("Unable to start server at %1.").arg(IPCServer->errorString()));
exit(0); // FIXME - should be graceful exit here (lower Critical -> Warning above when implemented)
}
}
@@ -141,7 +134,7 @@
connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
QStringList arguments=getArguments();
-#ifdef DEBUG
+#ifdef QT_DEBUG
// redirect everything written on stdout/stderr
process->setProcessChannelMode(QProcess::ForwardedChannels);
#endif
@@ -172,14 +165,7 @@
void TCPBase::StartProcessError(QProcess::ProcessError error)
{
- QMessageBox deniedMsg(QApplication::activeWindow());
- deniedMsg.setIcon(QMessageBox::Critical);
- deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error"));
- deniedMsg.setText(QMessageBox::tr("Unable to run engine at ") + bindir->absolutePath() + "/hwengine\n" +
- QMessageBox::tr("Error code: %1").arg(error));
- deniedMsg.setWindowModality(Qt::WindowModal);
- deniedMsg.exec();
-
+ MessageDialog::ShowFatalMessage(tr("Unable to run engine at %1\nError code: %2").arg(bindir->absolutePath() + "/hwengine").arg(error));
ClientDisconnect();
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/tcpBase.h
--- a/QTfrontend/net/tcpBase.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/net/tcpBase.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/Hedgehog.png
Binary file QTfrontend/res/Hedgehog.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/StatsCustomAchievement.png
Binary file QTfrontend/res/StatsCustomAchievement.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/backstab.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/backstab.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/dragon.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/dragon.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/enemy.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/enemy.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/epil.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/epil.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/family.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/family.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/first_blood.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/first_blood.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/journey.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/journey.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/queen.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/queen.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/shadow.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/shadow.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/united.png
Binary file QTfrontend/res/campaign/A Classic Fairytale/united.png has changed
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/css/chat.css
--- a/QTfrontend/res/css/chat.css Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/res/css/chat.css Thu Jun 13 22:27:23 2013 +0200
@@ -61,15 +61,20 @@
.msg_FriendChat .nick { color: #30ff30; }
.msg_UserJoin { color: #c0c0c0; }
.msg_UserJoin .nick { color: #d0d0d0; }
+.msg_UserLeave { color: #b8b8b8; }
+.msg_UserLeave .nick { color: #c8c8c8; }
.msg_FriendJoin { font-weight: bold; color: #c0f0c0; }
.msg_FriendJoin .nick { color: #d8f0d8; }
+.msg_FriendLeave { font-weight: bold; color: #ffe090; }
+.msg_FriendLeave .nick { color: #f8e878; }
.msg_UserAction { color: #ff80ff; }
.msg_UserAction .nick { color: #ffa0ff;}
.msg_FriendAction { color: #ff00ff; }
.msg_FriendAction .nick { color: #ff30ff; }
-/* uncomment next line to disable join and leave messages of non-friends */
+/* uncomment next lines to disable join and leave messages of non-friends */
/* .msg_UserJoin { display:none; } */
+/* .msg_UserLeave { display:none; } */
/* timestamps */
.timestamp {
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/css/qt.css
--- a/QTfrontend/res/css/qt.css Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/res/css/qt.css Thu Jun 13 22:27:23 2013 +0200
@@ -179,6 +179,7 @@
QComboBox {
border-radius: 10px;
padding: 3px;
+height: 18px;
}
QComboBox:pressed{
border-color: white;
@@ -326,4 +327,8 @@
TeamSelWidget, #gameStackContainer, #GBoxOptions {
border-radius: 10px;
-}
\ No newline at end of file
+}
+
+PageMultiplayer TeamSelWidget {
+min-height: 500px;
+}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/html/about.html
--- a/QTfrontend/res/html/about.html Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/res/html/about.html Thu Jun 13 22:27:23 2013 +0200
@@ -34,6 +34,7 @@
Campaign support, first campaign: Szabolcs Orbàn <szabibibi@gmail.com>
Keybinds, feedback, maps and hats interfaces: Drew Gottlieb <gottlieb.drew@gmail.com>
Login dialogs, frontend improvements: Ondrej Skopek <skopekondrej@gmail.com>
+ Icegun weapon: Julia Struchenko <urbertar@gmail.com>
Art:
@@ -72,11 +73,11 @@
Chinese: Jie Luo <lililjlj@gmail.com>
English: Andrey Korotaev <unC0Rr@gmail.com>
Finnish: Nina Kuisma <ninnnu@gmail.com>
- French: Antoine Turmel <geekshadow@gmail.com>, Clement Woitrain <sphrixclement@gmail.com>
+ French: Antoine Turmel <geekshadow@gmail.com>, Clement Woitrain <sphrixclement@gmail.com>, Matisumi
German: Peter Hüwe <PeterHuewe@gmx.de>, Mario Liebisch <mario.liebisch@gmail.com>, Richard Karolyi <sheepluva@ercatec.net>
Greek: <talos_kriti@yahoo.gr>
- Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani
- Japanese: ADAM Etienne <etienne.adam@gmail.com>
+ Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani <m.bresciani@email.it>
+ Japanese: ADAM Etienne <etienne.adam@gmail.com>, Marco Bresciani <m.bresciani@email.it>, 梅津洋恵
Korean: Anthony Bellew <anthonyreflected@gmail.com>
Lithuanian: Lukas Urbonas <lukasu08@gmail.com>
Polish: Maciej Mroziński <mynick2@o2.pl>, Wojciech Latkowski <magik17l@gmail.com>, Piotr Mitana, Maciej Górny
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/xml/tips.xml
--- a/QTfrontend/res/xml/tips.xml Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/res/xml/tips.xml Thu Jun 13 22:27:23 2013 +0200
@@ -46,6 +46,7 @@
Like Hedgewars? Become a fan on Facebook or follow us on Twitter
Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.
Keep your video card drivers up to date to avoid issues playing the game.
+ Heads or tails? Type '/rnd' in lobby and you'll find out. Also '/rnd rock paper scissors' works!
You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.
The version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/sdlkeys.h
--- a/QTfrontend/sdlkeys.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/sdlkeys.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/team.cpp
--- a/QTfrontend/team.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/team.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/team.h
--- a/QTfrontend/team.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/team.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
* Copyright (c) 2007 Igor Ulyanov
*
* This program is free software; you can redistribute it and/or modify
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/ask_quit.cpp
--- a/QTfrontend/ui/dialog/ask_quit.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/ask_quit.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/ask_quit.h
--- a/QTfrontend/ui/dialog/ask_quit.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/ask_quit.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_ip.cpp
--- a/QTfrontend/ui/dialog/input_ip.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/input_ip.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_ip.h
--- a/QTfrontend/ui/dialog/input_ip.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/input_ip.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_password.cpp
--- a/QTfrontend/ui/dialog/input_password.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/input_password.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -29,18 +29,14 @@
{
setWindowTitle(tr("Login"));
- QString titleLabelText = "To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname.";
- QString nickLabelText = "Nickname:";
- QString passLabelText = "Password:";
-
QGridLayout * layout = new QGridLayout(this);
QLabel * titleLabel = new QLabel(this);
- titleLabel->setText(titleLabelText);
+ titleLabel->setText(tr("To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname."));
layout->addWidget(titleLabel, 0, 0);
QLabel * nickLabel = new QLabel(this);
- nickLabel->setText(nickLabelText);
+ nickLabel->setText(tr("Nickname:"));
layout->addWidget(nickLabel, 1, 0);
leNickname = new QLineEdit(this);
@@ -48,7 +44,7 @@
layout->addWidget(leNickname, 2, 0);
QLabel * passLabel = new QLabel(this);
- passLabel->setText(passLabelText);
+ passLabel->setText(tr("Password:"));
layout->addWidget(passLabel, 3, 0);
lePassword = new QLineEdit(this);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_password.h
--- a/QTfrontend/ui/dialog/input_password.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/input_password.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/upload_video.cpp
--- a/QTfrontend/ui/dialog/upload_video.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/upload_video.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/upload_video.h
--- a/QTfrontend/ui/dialog/upload_video.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/dialog/upload_video.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/mouseoverfilter.cpp
--- a/QTfrontend/ui/mouseoverfilter.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/mouseoverfilter.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -35,7 +35,6 @@
}
else if (event->type() == QEvent::FocusIn)
{
- QWidget * widget = dynamic_cast(dist);
abstractpage = qobject_cast(ui->Pages->currentWidget());
// play a sound when mouse hovers certain ui elements
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/AbstractPage.cpp
--- a/QTfrontend/ui/page/AbstractPage.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/AbstractPage.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/AbstractPage.h
--- a/QTfrontend/ui/page/AbstractPage.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/AbstractPage.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageadmin.cpp
--- a/QTfrontend/ui/page/pageadmin.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageadmin.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageadmin.h
--- a/QTfrontend/ui/page/pageadmin.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageadmin.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagecampaign.cpp
--- a/QTfrontend/ui/page/pagecampaign.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagecampaign.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include "pagecampaign.h"
@@ -31,18 +32,43 @@
pageLayout->setRowStretch(0, 1);
pageLayout->setRowStretch(3, 1);
+ QGridLayout * infoLayout = new QGridLayout();
+ infoLayout->setColumnStretch(0, 1);
+ infoLayout->setColumnStretch(1, 1);
+ infoLayout->setColumnStretch(2, 1);
+ infoLayout->setColumnStretch(3, 1);
+ infoLayout->setColumnStretch(4, 1);
+ infoLayout->setRowStretch(0, 1);
+ infoLayout->setRowStretch(1, 1);
+
+ // set this as default image first time page is created, this will change in hwform.cpp
+ btnPreview = formattedButton(":/res/campaign/A Classic Fairytale/first_blood.png", true);
+ infoLayout->setAlignment(btnPreview, Qt::AlignHCenter | Qt::AlignVCenter);
+
+ lbldescription = new QLabel();
+ lbldescription->setAlignment(Qt::AlignHCenter| Qt::AlignTop);
+ lbldescription->setWordWrap(true);
+
+ lbltitle = new QLabel();
+ lbltitle->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
+
CBTeam = new QComboBox(this);
CBMission = new QComboBox(this);
CBCampaign = new QComboBox(this);
- pageLayout->addWidget(CBTeam, 1, 1);
- pageLayout->addWidget(CBCampaign, 2, 1);
- pageLayout->addWidget(CBMission, 3, 1);
+ infoLayout->addWidget(btnPreview,0,1,2,1);
+ infoLayout->addWidget(lbltitle,0,2,1,2);
+ infoLayout->addWidget(lbldescription,1,2,1,2);
+
+ pageLayout->addLayout(infoLayout, 0, 0, 2, 3);
+ pageLayout->addWidget(CBTeam, 2, 1);
+ pageLayout->addWidget(CBCampaign, 3, 1);
+ pageLayout->addWidget(CBMission, 4, 1);
BtnStartCampaign = new QPushButton(this);
BtnStartCampaign->setFont(*font14);
BtnStartCampaign->setText(QPushButton::tr("Go!"));
- pageLayout->addWidget(BtnStartCampaign, 2, 2);
+ pageLayout->addWidget(BtnStartCampaign, 3, 2);
return pageLayout;
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagecampaign.h
--- a/QTfrontend/ui/page/pagecampaign.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagecampaign.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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,7 +28,10 @@
public:
PageCampaign(QWidget* parent = 0);
+ QPushButton *btnPreview;
QPushButton *BtnStartCampaign;
+ QLabel *lbldescription;
+ QLabel *lbltitle;
QComboBox *CBMission;
QComboBox *CBCampaign;
QComboBox *CBTeam;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageconnecting.cpp
--- a/QTfrontend/ui/page/pageconnecting.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageconnecting.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageconnecting.h
--- a/QTfrontend/ui/page/pageconnecting.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageconnecting.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedata.cpp
--- a/QTfrontend/ui/page/pagedata.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagedata.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -60,7 +60,10 @@
web->setOpenLinks(false);
// fetchList();
-
+ web->setHtml(QString(
+ "Hedgewars Downloadable Content
"
+ "%1")
+ .arg(tr("Loading, please wait.")));
m_contentDownloaded = false;
}
@@ -106,8 +109,7 @@
{
QNetworkReply * reply = qobject_cast(sender());
- if(reply)
- {
+ if (reply && (reply->error() == QNetworkReply::NoError)) {
QString html = QString::fromUtf8(reply->readAll());
int begin = html.indexOf("");
int end = html.indexOf("");
@@ -117,7 +119,11 @@
html.remove(0, begin);
}
web->setHtml(html);
- }
+ } else
+ web->setHtml(QString(
+ "Hedgewars Downloadable Content
"
+ "%1
")
+ .arg(tr("This page requires an internet connection.")));
}
void PageDataDownload::fileDownloaded()
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedata.h
--- a/QTfrontend/ui/page/pagedata.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagedata.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedrawmap.cpp
--- a/QTfrontend/ui/page/pagedrawmap.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagedrawmap.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedrawmap.h
--- a/QTfrontend/ui/page/pagedrawmap.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagedrawmap.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageeditteam.cpp
--- a/QTfrontend/ui/page/pageeditteam.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageeditteam.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -320,7 +320,7 @@
);
if (!list.isEmpty())
- SDLInteraction::instance().playSoundFile("physfs://" + voiceDir + "/" +
+ SDLInteraction::instance().playSoundFile("/" + voiceDir + "/" +
list[rand() % list.size()]);
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageeditteam.h
--- a/QTfrontend/ui/page/pageeditteam.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageeditteam.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagegamestats.cpp
--- a/QTfrontend/ui/page/pagegamestats.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagegamestats.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -40,10 +40,15 @@
QLayout * PageGameStats::bodyLayoutDefinition()
{
+ kindOfPoints = QString("");
+ defaultGraphTitle = true;
QGridLayout * pageLayout = new QGridLayout();
pageLayout->setSpacing(20);
pageLayout->setColumnStretch(0, 1);
pageLayout->setColumnStretch(1, 1);
+ pageLayout->setRowStretch(0, 1);
+ pageLayout->setRowStretch(1, 20);
+ //pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used
pageLayout->setContentsMargins(7, 7, 7, 0);
QGroupBox * gb = new QGroupBox(this);
@@ -61,15 +66,15 @@
gbl->addWidget(l);
gbl->addWidget(labelGameStats);
gb->setLayout(gbl);
- pageLayout->addWidget(gb, 1, 1, 1, 2);
+ pageLayout->addWidget(gb, 1, 1);
// graph
graphic = new FitGraphicsView(gb);
- l = new QLabel(this);
- l->setTextFormat(Qt::RichText);
- l->setText("
" + PageGameStats::tr("Health graph") + "
");
- l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- gbl->addWidget(l);
+ labelGraphTitle = new QLabel(this);
+ labelGraphTitle->setTextFormat(Qt::RichText);
+ labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
+ labelGraphTitle->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ gbl->addWidget(labelGraphTitle);
gbl->addWidget(graphic);
graphic->scale(1.0, -1.0);
graphic->setBackgroundBrush(QBrush(Qt::black));
@@ -97,13 +102,26 @@
return pageLayout;
}
+//TODO button placement, image etc
QLayout * PageGameStats::footerLayoutDefinition()
{
QHBoxLayout * bottomLayout = new QHBoxLayout();
+
+ mainNote = new QLabel(this);
+ mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ mainNote->setWordWrap(true);
+
+ bottomLayout->addWidget(mainNote, 0);
+ bottomLayout->setStretch(0,1);
- btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
+ btnRestart = addButton(":/res/Start.png", bottomLayout, 1, true);
+ btnRestart->setWhatsThis(tr("Play again"));
+ btnRestart->setFixedWidth(58);
+ btnRestart->setFixedHeight(81);
+ btnRestart->setStyleSheet("QPushButton{margin-top:24px}");
+ btnSave = addButton(":/res/Save.png", bottomLayout, 2, true);
+ btnSave->setWhatsThis(tr("Save"));
btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
- bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
return bottomLayout;
}
@@ -112,6 +130,7 @@
{
connect(this, SIGNAL(pageEnter()), this, SLOT(renderStats()));
connect(btnSave, SIGNAL(clicked()), this, SIGNAL(saveDemoRequested()));
+ connect(btnRestart, SIGNAL(clicked()), this, SIGNAL(restartGameRequested()));
}
PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
@@ -133,30 +152,48 @@
lastColor = 0;
}
+void PageGameStats::restartBtnVisible(bool visible)
+{
+ btnRestart->setVisible(visible);
+}
+
void PageGameStats::renderStats()
{
- QGraphicsScene * scene = new QGraphicsScene();
-
- QMap >::const_iterator i = healthPoints.constBegin();
- while (i != healthPoints.constEnd())
- {
- quint32 c = i.key();
- //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
- QVector hps = i.value();
+ graphic->show();
+ labelGraphTitle-> show();
+ if(defaultGraphTitle) {
+ labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
+ } else {
+ defaultGraphTitle = true;
+ }
+ // if not health data sent
+ if(healthPoints.size() == 0) {
+ labelGraphTitle->hide();
+ graphic->hide();
+ } else {
+ QGraphicsScene * scene = new QGraphicsScene();
- QPainterPath path;
- if (hps.size())
- path.moveTo(0, hps[0]);
+ QMap >::const_iterator i = healthPoints.constBegin();
+ while (i != healthPoints.constEnd())
+ {
+ quint32 c = i.key();
+ //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+ QVector hps = i.value();
- for(int t = 1; t < hps.size(); ++t)
- path.lineTo(t, hps[t]);
+ QPainterPath path;
+ if (hps.size())
+ path.moveTo(0, hps[0]);
- scene->addPath(path, QPen(c));
- ++i;
- }
+ for(int t = 1; t < hps.size(); ++t)
+ path.lineTo(t, hps[t]);
- graphic->setScene(scene);
- graphic->fitInView(graphic->sceneRect());
+ scene->addPath(path, QPen(c));
+ ++i;
+ }
+
+ graphic->setScene(scene);
+ graphic->fitInView(graphic->sceneRect());
+ }
}
void PageGameStats::GameStats(char type, const QString & info)
@@ -198,6 +235,13 @@
healthPoints[clan].append(hp);
break;
}
+ case 'g' :
+ {
+ // TODO: change default picture or add change pic capability
+ defaultGraphTitle = false;
+ labelGraphTitle->setText("
" + info + "
");
+ break;
+ }
case 'T': // local team stats
{
//AddStatText("local team: " + info + "
");
@@ -213,7 +257,11 @@
}
break;
}
-
+ case 'p' :
+ {
+ kindOfPoints = info;
+ break;
+ }
case 'P' :
{
int i = info.indexOf(' ');
@@ -250,7 +298,13 @@
}
QString message;
- QString killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+ QString killstring;
+ if(kindOfPoints.compare("") == 0) {
+ killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+ } else {
+ killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
+ kindOfPoints = QString("");
+ }
message = QString("%1 %2. %3 ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "
";
@@ -281,6 +335,12 @@
AddStatText(message);
break;
}
+ case 'c' :
+ {
+ QString message = " "+info+"
";
+ AddStatText(message);
+ break;
+ }
}
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagegamestats.h
--- a/QTfrontend/ui/page/pagegamestats.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagegamestats.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -44,18 +44,24 @@
PageGameStats(QWidget* parent = 0);
QPushButton *btnSave;
+ QPushButton *btnRestart;
+ QLabel *mainNote;
QLabel *labelGameStats;
QLabel *labelGameWin;
QLabel *labelGameRank;
+ QLabel *labelGraphTitle;
+ QString kindOfPoints;
FitGraphicsView * graphic;
public slots:
void GameStats(char type, const QString & info);
void clear();
void renderStats();
+ void restartBtnVisible(bool visible);
signals:
void saveDemoRequested();
+ void restartGameRequested();
private:
void AddStatText(const QString & msg);
@@ -63,6 +69,7 @@
QMap > healthPoints;
unsigned int playerPosition;
quint32 lastColor;
+ bool defaultGraphTitle;
protected:
QLayout * bodyLayoutDefinition();
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageinfo.cpp
--- a/QTfrontend/ui/page/pageinfo.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageinfo.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageinfo.h
--- a/QTfrontend/ui/page/pageinfo.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageinfo.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageingame.cpp
--- a/QTfrontend/ui/page/pageingame.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageingame.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageingame.h
--- a/QTfrontend/ui/page/pageingame.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageingame.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemain.cpp
--- a/QTfrontend/ui/page/pagemain.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagemain.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -120,8 +120,8 @@
void PageMain::connectSignals()
{
connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
- connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
- connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
+ //connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
+ //connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
// TODO: add signal-forwarding required by (currently missing) encapsulation
}
@@ -133,10 +133,10 @@
setAttribute(Qt::WA_NoSystemBackground, true);
mainNote->setOpenExternalLinks(true);
-#ifdef DEBUG
+#ifdef QT_DEBUG
setDefaultDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
#else
- setDefaultDescription(QLabel::tr("Tip: ") + randomTip());
+ setDefaultDescription(QLabel::tr("Tip: %1").arg(randomTip()));
#endif
}
@@ -189,3 +189,10 @@
if (visible) BtnNet->setIcon(originalNetworkIcon);
else BtnNet->setIcon(disabledNetworkIcon);
}
+
+void PageMain::resetNetworkChoice()
+{
+ BtnNetLocal->setVisible(false);
+ BtnNetOfficial->setVisible(false);
+ BtnNet->setIcon(originalNetworkIcon);
+}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemain.h
--- a/QTfrontend/ui/page/pagemain.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagemain.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -29,6 +29,7 @@
public:
PageMain(QWidget * parent = 0);
+ void resetNetworkChoice();
QPushButton * BtnSinglePlayer;
QPushButton * BtnNet;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemultiplayer.cpp
--- a/QTfrontend/ui/page/pagemultiplayer.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -31,15 +31,13 @@
QLayout * PageMultiplayer::bodyLayoutDefinition()
{
- QGridLayout * pageLayout = new QGridLayout();
+ QHBoxLayout * pageLayout = new QHBoxLayout();
gameCFG = new GameCFGWidget(this);
- pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
-
- pageLayout->setRowStretch(2, 1);
+ pageLayout->addWidget(gameCFG, 3, Qt::AlignTop);
teamsSelect = new TeamSelWidget(this);
- pageLayout->addWidget(teamsSelect, 0, 2, 3, 2);
+ pageLayout->addWidget(teamsSelect, 2, Qt::AlignTop);
return pageLayout;
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemultiplayer.h
--- a/QTfrontend/ui/page/pagemultiplayer.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagemultiplayer.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenet.cpp
--- a/QTfrontend/ui/page/pagenet.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenet.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -73,7 +73,7 @@
BtnNetSvrStart = formattedButton(QPushButton::tr("Start server"));
BtnNetSvrStart->setMinimumWidth(180);
QString serverPath = bindir->absolutePath() + "/hedgewars-server";
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
serverPath += + ".exe";
#endif
QFile server(serverPath);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenet.h
--- a/QTfrontend/ui/page/pagenet.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenet.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetgame.cpp
--- a/QTfrontend/ui/page/pagenetgame.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenetgame.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetgame.h
--- a/QTfrontend/ui/page/pagenetgame.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenetgame.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetserver.cpp
--- a/QTfrontend/ui/page/pagenetserver.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenetserver.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -79,6 +79,16 @@
BtnShare->setWhatsThis(QPushButton::tr("Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you."));
gbLayout->addWidget(BtnShare, 2, 1);
+ labelURL = new QLabel(gb);
+ labelURL->setText(
+ ""
+ "");
+ labelURL->setOpenExternalLinks(true);
+ gbLayout->addWidget(labelURL, 3, 1);
+
return pageLayout;
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetserver.h
--- a/QTfrontend/ui/page/pagenetserver.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagenetserver.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -32,8 +32,9 @@
QPushButton *BtnDefault;
QPushButton *BtnShare;
QLabel *labelSD;
+ QLabel *labelPort;
+ QLabel *labelURL;
QLineEdit *leServerDescr;
- QLabel *labelPort;
QSpinBox *sbPort;
protected:
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageoptions.cpp
--- a/QTfrontend/ui/page/pageoptions.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageoptions.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -275,11 +275,13 @@
winLabelX->setFixedWidth(40);
winLabelX->setAlignment(Qt::AlignCenter);
- windowWidthEdit = new QLineEdit(groupGame);
- windowWidthEdit->setValidator(new QIntValidator(this));
+ // TODO: less random max. also:
+ // make some min/max-consts, shared with engine?
+ windowWidthEdit = new QSpinBox(groupGame);
+ windowWidthEdit->setRange(640, 102400);
windowWidthEdit->setFixedSize(55, CBResolution->height());
- windowHeightEdit = new QLineEdit(groupGame);
- windowHeightEdit->setValidator(new QIntValidator(this));
+ windowHeightEdit = new QSpinBox(groupGame);
+ windowHeightEdit->setRange(480, 102400);
windowHeightEdit->setFixedSize(55, CBResolution->height());
winResLayout->addWidget(windowWidthEdit, 0);
@@ -585,13 +587,19 @@
CBLanguage = new QComboBox(groupMisc);
groupMisc->layout()->addWidget(CBLanguage, 0, 1);
QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
- CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
+ CBLanguage->addItem(QComboBox::tr("(System default)"), QString());
for(int i = 0; i < locs.count(); i++)
{
- QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
- CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
+ QString lname = locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1");
+ QLocale loc(lname);
+ CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", lname);
}
+ QLabel *restartNoticeLabel = new QLabel(groupMisc);
+ restartNoticeLabel->setText(QLabel::tr("This setting will be effective at next restart."));
+ groupMisc->layout()->addWidget(restartNoticeLabel, 1, 1);
+
+
// Divider
groupMisc->addDivider(); // row 1
@@ -600,14 +608,14 @@
CBNameWithDate = new QCheckBox(groupMisc);
CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
- groupMisc->layout()->addWidget(CBNameWithDate, 2, 0, 1, 2);
+ groupMisc->layout()->addWidget(CBNameWithDate, 3, 0, 1, 2);
// Associate file extensions
BtnAssociateFiles = new QPushButton(groupMisc);
BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
BtnAssociateFiles->setVisible(!custom_data && !custom_config);
- groupMisc->layout()->addWidget(BtnAssociateFiles, 3, 0, 1, 2);
+ groupMisc->layout()->addWidget(BtnAssociateFiles, 4, 0, 1, 2);
}
#ifdef __APPLE__
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageoptions.h
--- a/QTfrontend/ui/page/pageoptions.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageoptions.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -77,8 +77,8 @@
QComboBox *CBTeamName;
IconedGroupBox *AGGroupBox;
QComboBox *CBResolution;
- QLineEdit *windowWidthEdit;
- QLineEdit *windowHeightEdit;
+ QSpinBox *windowWidthEdit;
+ QSpinBox *windowHeightEdit;
QComboBox *CBStereoMode;
QCheckBox *CBFrontendSound;
QCheckBox *CBFrontendMusic;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageplayrecord.cpp
--- a/QTfrontend/ui/page/pageplayrecord.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageplayrecord.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageplayrecord.h
--- a/QTfrontend/ui/page/pageplayrecord.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageplayrecord.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageroomslist.cpp
--- a/QTfrontend/ui/page/pageroomslist.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageroomslist.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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,6 +28,7 @@
#include
#include
#include
+#include
#include
@@ -107,7 +108,18 @@
topLayout->setRowStretch(1, 0);
topLayout->setColumnStretch(3, 1);
+ // Rooms list and chat with splitter
+ m_splitter = new QSplitter();
+ m_splitter->setChildrenCollapsible(false);
+ pageLayout->addWidget(m_splitter, 100);
+
// Room list
+ QWidget * roomsListWidget = new QWidget(this);
+ m_splitter->setOrientation(Qt::Vertical);
+ m_splitter->addWidget(roomsListWidget);
+
+ QVBoxLayout * roomsLayout = new QVBoxLayout(roomsListWidget);
+ roomsLayout->setMargin(0);
roomsList = new RoomTableView(this);
roomsList->setSelectionBehavior(QAbstractItemView::SelectRows);
@@ -118,7 +130,7 @@
roomsList->setSelectionMode(QAbstractItemView::SingleSelection);
roomsList->setStyleSheet("QTableView { border-top-left-radius: 0px; }");
roomsList->setFocusPolicy(Qt::NoFocus);
- pageLayout->addWidget(roomsList, 200);
+ roomsLayout->addWidget(roomsList, 200);
// Room filters container
@@ -126,9 +138,9 @@
filtersContainer->setMaximumWidth(800);
filtersContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- pageLayout->addSpacing(7);
- pageLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter);
- pageLayout->addSpacing(7);
+ roomsLayout->addSpacing(7);
+ roomsLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter);
+ roomsLayout->addSpacing(7);
QHBoxLayout * filterLayout = new QHBoxLayout(filtersContainer);
filterLayout->setSpacing(0);
@@ -194,7 +206,7 @@
// Lobby chat
chatWidget = new HWChatWidget(this, false);
- pageLayout->addWidget(chatWidget, 350);
+ m_splitter->addWidget(chatWidget);
CBRules->addItem(QComboBox::tr("Any"));
@@ -251,6 +263,8 @@
void PageRoomsList::roomSelectionChanged(const QModelIndex & current, const QModelIndex & previous)
{
+ Q_UNUSED(previous);
+
BtnJoin->setEnabled(current.isValid());
}
@@ -732,14 +746,24 @@
bool PageRoomsList::restoreHeaderState()
{
- if (!m_gameSettings->contains("frontend/roomslist_header"))
- return false;
- return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
- (m_gameSettings->value("frontend/roomslist_header").toByteArray())));
+ if (m_gameSettings->contains("frontend/roomslist_splitter"))
+ {
+ m_splitter->restoreState(QByteArray::fromBase64(
+ (m_gameSettings->value("frontend/roomslist_splitter").toByteArray())));
+ }
+
+ if (m_gameSettings->contains("frontend/roomslist_header"))
+ {
+ return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
+ (m_gameSettings->value("frontend/roomslist_header").toByteArray())));
+ } else return false;
}
void PageRoomsList::saveHeaderState()
{
m_gameSettings->setValue("frontend/roomslist_header",
QString(roomsList->horizontalHeader()->saveState().toBase64()));
+
+ m_gameSettings->setValue("frontend/roomslist_splitter",
+ QString(m_splitter->saveState().toBase64()));
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageroomslist.h
--- a/QTfrontend/ui/page/pageroomslist.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageroomslist.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -27,6 +27,7 @@
class QTableView;
class RoomsListModel;
class QSortFilterProxyModel;
+class QSplitter;
class RoomTableView : public QTableView
{
@@ -101,6 +102,7 @@
QSortFilterProxyModel * weaponsFilteredModel;
QAction * showGamesInLobby;
QAction * showGamesInProgress;
+ QSplitter * m_splitter;
AmmoSchemeModel * ammoSchemeModel;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagescheme.cpp
--- a/QTfrontend/ui/page/pagescheme.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagescheme.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagescheme.h
--- a/QTfrontend/ui/page/pagescheme.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagescheme.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageselectweapon.cpp
--- a/QTfrontend/ui/page/pageselectweapon.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageselectweapon.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageselectweapon.h
--- a/QTfrontend/ui/page/pageselectweapon.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pageselectweapon.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagesingleplayer.cpp
--- a/QTfrontend/ui/page/pagesingleplayer.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagesingleplayer.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagesingleplayer.h
--- a/QTfrontend/ui/page/pagesingleplayer.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagesingleplayer.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagetraining.cpp
--- a/QTfrontend/ui/page/pagetraining.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagetraining.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -118,7 +118,7 @@
DataManager & dataMgr = DataManager::instance();
// get locale
- QSettings settings("physfs://hedgewars.ini",
+ QSettings settings(dataMgr.settingsFileName(),
QSettings::IniFormat);
QString loc = settings.value("misc/locale", "").toString();
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagetraining.h
--- a/QTfrontend/ui/page/pagetraining.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagetraining.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagevideos.cpp
--- a/QTfrontend/ui/page/pagevideos.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagevideos.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -414,7 +414,7 @@
setName(item, newName);
}
}
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
// there is a bug in qt, QDir::rename() doesn't fail on such names but damages files
if (newName.contains(QRegExp("[\"*:<>?\\/|]")))
{
@@ -508,8 +508,8 @@
else
{
QString path = item->path();
- desc += tr("Date: %1\n").arg(QFileInfo(path).created().toString(Qt::DefaultLocaleLongDate));
- desc += tr("Size: %1\n").arg(FileSizeStr(path));
+ desc += tr("Date: %1").arg(QFileInfo(path).created().toString(Qt::DefaultLocaleLongDate)) + "\n";
+ desc += tr("Size: %1").arg(FileSizeStr(path)) + "\n";
if (item->desc.isEmpty())
{
// Extract description from file;
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagevideos.h
--- a/QTfrontend/ui/page/pagevideos.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/page/pagevideos.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/qaspectratiolayout.cpp
--- a/QTfrontend/ui/qaspectratiolayout.cpp Tue Apr 30 01:47:30 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation.
- */
-
-#include "qaspectratiolayout.h"
-
-QAspectRatioLayout::QAspectRatioLayout(QWidget* parent, int spacing) : QLayout(parent)
-{
- init(spacing);
-}
-
-QAspectRatioLayout::QAspectRatioLayout(int spacing)
-{
- init(spacing);
-}
-
-QAspectRatioLayout::~QAspectRatioLayout()
-{
- delete item;
- delete lastReceivedRect;
- delete _geometry;
-}
-
-void QAspectRatioLayout::init(int spacing)
-{
- item = 0;
- lastReceivedRect = new QRect(0, 0, 0, 0);
- _geometry = new QRect(0, 0, 0, 0);
- setSpacing(spacing);
-}
-
-
-/* Adds item if place isn't already taken. */
-void QAspectRatioLayout::add(QLayoutItem* item)
-{
- if(!hasItem())
- {
- replaceItem(item);
- }
-}
-
-/* Adds item if place isn't already taken. */
-void QAspectRatioLayout::addItem(QLayoutItem* item)
-{
- if(!hasItem())
- {
- replaceItem(item);
- }
-}
-
-/* Adds widget if place isn't already taken. */
-void QAspectRatioLayout::addWidget(QWidget* widget)
-{
- if(!hasItem())
- {
- replaceItem(new QWidgetItem(widget));
- }
-}
-
-/* Returns the item pointer and dereferences it here. */
-QLayoutItem* QAspectRatioLayout::take()
-{
- QLayoutItem* item = 0;
- if(this->hasItem())
- {
- item = this->item;
- this->item = 0;
- }
- return item;
-}
-
-/* Returns the item pointer and dereferences it here. */
-QLayoutItem* QAspectRatioLayout::takeAt(int index)
-{
- if(index != 0)
- {
- return 0;
- }
- return this->take();
-}
-
-/* Returns the item pointer. */
-QLayoutItem* QAspectRatioLayout::itemAt(int index) const
-{
- if(index != 0)
- {
- return 0;
- }
- if(hasItem())
- {
- return this->item;
- }
- return 0;
-}
-
-/* Checks if we have an item. */
-bool QAspectRatioLayout::hasItem() const
-{
- return this->item != 0;
-}
-
-/* Returns the count of items which can be either 0 or 1. */
-int QAspectRatioLayout::count() const
-{
- int returnValue = 0;
- if(hasItem())
- {
- returnValue = 1;
- }
- return returnValue;
-}
-
-/* Replaces the item with the new and returns the old. */
-QLayoutItem* QAspectRatioLayout::replaceItem(QLayoutItem* item)
-{
- QLayoutItem* old = 0;
- if(this->hasItem())
- {
- old = this->item;
- }
- this->item = item;
- setGeometry(*this->_geometry);
- return old;
-}
-
-/* Tells which way layout expands. */
-Qt::Orientations QAspectRatioLayout::expandingDirections() const
-{
- return Qt::Horizontal | Qt::Vertical;
-}
-
-/* Tells which size is preferred. */
-QSize QAspectRatioLayout::sizeHint() const
-{
- return this->item->minimumSize();
-}
-
-/* Tells minimum size. */
-QSize QAspectRatioLayout::minimumSize() const
-{
- return this->item->minimumSize();
-}
-
-/*
- * Tells if heightForWidth calculations is handled.
- * It isn't since width isn't enough to calculate
- * proper size.
- */
-bool QAspectRatioLayout::hasHeightForWidth() const
-{
- return false;
-}
-
-/* Replaces lastReceivedRect. */
-void QAspectRatioLayout::setLastReceivedRect(const QRect& rect)
-{
- QRect* oldRect = this->lastReceivedRect;
- this->lastReceivedRect = new QRect(rect.topLeft(), rect.size());
- delete oldRect;
-}
-
-/* Returns geometry */
-QRect QAspectRatioLayout::geometry()
-{
- return QRect(*this->_geometry);
-}
-
-/* Sets geometry to given size. */
-void QAspectRatioLayout::setGeometry(const QRect& rect)
-{
- /*
- * We check if the item is set and
- * if size is the same previously received.
- * If either is false nothing is done.
- */
- if(!this->hasItem() ||
- areRectsEqual(*this->lastReceivedRect, rect))
- {
- return;
- }
- /* Replace the last received rectangle. */
- setLastReceivedRect(rect);
- /* Calculate proper size for the item relative to the received size. */
- QSize properSize = calculateProperSize(rect.size());
- /* Calculate center location in the rect and with item size. */
- QPoint properLocation = calculateCenterLocation(rect.size(), properSize);
- /* Set items geometry */
- this->item->setGeometry(QRect(properLocation, properSize));
- QRect* oldRect = this->_geometry;
- /* Cache the calculated geometry. */
- this->_geometry = new QRect(properLocation, properSize);
- delete oldRect;
- /* Super classes setGeometry */
- QLayout::setGeometry(*this->_geometry);
-}
-
-/* Takes the shortest side and creates QSize
- * with the shortest side as width and height. */
-QSize QAspectRatioLayout::calculateProperSize(QSize from) const
-{
- QSize properSize;
- if(from.height() * 2 < from.width())
- {
- properSize.setHeight(from.height() - this->margin());
- properSize.setWidth(from.height() * 2 - this->margin());
- }
- else
- {
- properSize.setWidth(from.width() - this->margin());
- properSize.setHeight(from.width() / 2 - this->margin());
- }
- return properSize;
-}
-
-/* Calculates center location from the given height and width for item size. */
-QPoint QAspectRatioLayout::calculateCenterLocation(QSize from,
- QSize itemSize) const
-{
- QPoint centerLocation;
- if((from.width() - itemSize.width()) > 0)
- {
- centerLocation.setX((from.width() - itemSize.width())/2);
- }
- if((from.height() - itemSize.height()) > 0)
- {
- centerLocation.setY((from.height() - itemSize.height())/2);
- }
- return centerLocation;
-}
-
-/* Compares if two QRects are equal. */
-bool QAspectRatioLayout::areRectsEqual(const QRect& a,
- const QRect& b) const
-{
- bool result = false;
- if(a.x() == b.x() &&
- a.y() == b.y() &&
- a.height() == b.height() &&
- a.width() == b.width())
- {
- result = true;
- }
- return result;
-}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/qaspectratiolayout.h
--- a/QTfrontend/ui/qaspectratiolayout.h Tue Apr 30 01:47:30 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation.
- */
-
-#ifndef QASPECTRATIOLAYOUT_H_
-#define QASPECTRATIOLAYOUT_H_
-
-#include
-#include
-#include
-#include
-#include
-
-
-class QAspectRatioLayout : public QLayout
-{
- Q_OBJECT
-
- public:
- QAspectRatioLayout(QWidget* parent, int spacing =-1);
- QAspectRatioLayout(int spacing = -1);
- ~QAspectRatioLayout();
-
- /* Convenience method */
- virtual void add(QLayoutItem* item);
-
- /* http://doc.trolltech.com/qlayout.html#addItem */
- virtual void addItem(QLayoutItem* item);
- /* http://doc.trolltech.com/qlayout.html#addWidget */
- virtual void addWidget(QWidget* widget);
- /* http://doc.trolltech.com/qlayout.html#takeAt */
- virtual QLayoutItem* takeAt(int index);
- /* http://doc.trolltech.com/qlayout.html#itemAt */
- virtual QLayoutItem* itemAt(int index) const;
- /* http://doc.trolltech.com/qlayout.html#count */
- virtual int count() const;
-
- /*
- * These are ours since we do have only one item.
- */
- virtual QLayoutItem* replaceItem(QLayoutItem* item);
- virtual QLayoutItem* take();
- virtual bool hasItem() const;
-
- /* http://doc.trolltech.com/qlayout.html#expandingDirections */
- virtual Qt::Orientations expandingDirections() const;
-
- /*
- * This method contains most of the juice of this article.
- * http://doc.trolltech.com/qlayoutitem.html#setGeometry
- */
- virtual void setGeometry(const QRect& rect);
- /* http://doc.trolltech.com/qlayoutitem.html#geometry */
- virtual QRect geometry();
-
- /* http://doc.trolltech.com/qlayoutitem.html#sizeHint */
- virtual QSize sizeHint() const;
- /* http://doc.trolltech.com/qlayout.html#minimumSize */
- virtual QSize minimumSize() const;
- /* http://doc.trolltech.com/qlayoutitem.html#hasHeightForWidth */
- virtual bool hasHeightForWidth() const;
-
- private:
- /* Saves the last received rect. */
- void setLastReceivedRect(const QRect& rect);
- /* Used to initialize the object. */
- void init(int spacing);
- /* Calculates the maximum size for the item from the assigned size. */
- QSize calculateProperSize(QSize from) const;
- /* Calculates the center location from the assigned size and
- * the items size. */
- QPoint calculateCenterLocation(QSize from, QSize itemSize) const;
- /* Check if two QRects are equal */
- bool areRectsEqual(const QRect& a, const QRect& b) const;
- /* Contains item reference */
- QLayoutItem* item;
- /*
- * Used for caching so we won't do calculations every time
- * setGeometry is called.
- */
- QRect* lastReceivedRect;
- /* Contains geometry */
- QRect* _geometry;
-
-};
-
-#endif /* QASPECTRATIOLAYOUT_H_ */
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/FreqSpinBox.cpp
--- a/QTfrontend/ui/widget/FreqSpinBox.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/FreqSpinBox.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/FreqSpinBox.h
--- a/QTfrontend/ui/widget/FreqSpinBox.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/FreqSpinBox.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/HistoryLineEdit.cpp
--- a/QTfrontend/ui/widget/HistoryLineEdit.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/HistoryLineEdit.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/HistoryLineEdit.h
--- a/QTfrontend/ui/widget/HistoryLineEdit.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/HistoryLineEdit.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SmartLineEdit.cpp
--- a/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/SmartLineEdit.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SmartLineEdit.h
--- a/QTfrontend/ui/widget/SmartLineEdit.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/SmartLineEdit.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SquareLabel.cpp
--- a/QTfrontend/ui/widget/SquareLabel.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/SquareLabel.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SquareLabel.h
--- a/QTfrontend/ui/widget/SquareLabel.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/SquareLabel.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/about.cpp
--- a/QTfrontend/ui/widget/about.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/about.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -52,11 +52,8 @@
QLabel *imageLabel = new QLabel;
QImage image(":/res/Hedgehog.png");
imageLabel->setPixmap(QPixmap::fromImage(image));
- imageLabel->setScaledContents(true);
- imageLabel->setMinimumWidth(2.8);
- imageLabel->setMaximumWidth(280);
- imageLabel->setMinimumHeight(30);
- imageLabel->setMaximumHeight(300);
+ imageLabel->setFixedWidth(273);
+ imageLabel->setFixedHeight(300);
leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
@@ -113,6 +110,7 @@
.arg(PHYSFS_VER_PATCH));
QLabel * lblLibInfo = new QLabel();
+ lblLibInfo->setOpenExternalLinks(true);
lblLibInfo->setText(libinfo);
lblLibInfo->setWordWrap(true);
lblLibInfo->setMaximumWidth(280);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/about.h
--- a/QTfrontend/ui/widget/about.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/about.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/bgwidget.cpp
--- a/QTfrontend/ui/widget/bgwidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/bgwidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2009 Kristian Lehmann
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/bgwidget.h
--- a/QTfrontend/ui/widget/bgwidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/bgwidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2009 Kristian Lehmann
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -37,7 +37,7 @@
#include "hwconsts.h"
#include "gameuiconfig.h"
#include "playerslistmodel.h"
-
+#include "HWApplication.h"
#include "chatwidget.h"
@@ -176,7 +176,7 @@
QWidget(parent),
mainLayout(this)
{
- this->gameSettings = gameSettings;
+ this->gameSettings = NULL;
this->notify = notify;
m_isAdmin = false;
@@ -295,9 +295,9 @@
void HWChatWidget::linkClicked(const QUrl & link)
{
- if (link.scheme() == "http")
+ if ((link.scheme() == "http") or (link.scheme() == "https"))
QDesktopServices::openUrl(link);
- if (link.scheme() == "hwnick")
+ else if (link.scheme() == "hwnick")
{
// decode nick
QString nick = QString::fromUtf8(QByteArray::fromBase64(link.encodedQuery()));
@@ -368,15 +368,43 @@
return QString("%1").arg(Qt::escape(nickname));
}
+const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http(s)?://)?(www\\.)?((hedgewars\\.org|code\\.google\\.com|googlecode\\.com|hh\\.unit22\\.org)(/[^ ]*)?)");
-void HWChatWidget::onChatString(const QString& str)
+bool HWChatWidget::containsHighlight(const QString & sender, const QString & message)
{
- onChatString("", str);
+ if ((sender != m_userNick) && (!m_userNick.isEmpty()))
+ {
+ QString lcStr = message.toLower();
+
+ foreach (const QRegExp & hl, m_highlights)
+ {
+ if (lcStr.contains(hl))
+ return true;
+ }
+ }
+ return false;
}
-const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http://)?(www\\.)?(hedgewars\\.org(/[^ ]*)?)");
+QString HWChatWidget::messageToHTML(const QString & message)
+{
+ QString formattedStr = Qt::escape(message);
+ // link some urls
+ formattedStr = formattedStr.replace(URLREGEXP, "\\4");
+ return formattedStr;
+}
-void HWChatWidget::onChatString(const QString& nick, const QString& str)
+void HWChatWidget::onChatAction(const QString & nick, const QString & action)
+{
+ printChatString(nick, "* " + linkedNick(nick) + " " + messageToHTML(action), "Action", containsHighlight(nick, action));
+}
+
+void HWChatWidget::onChatMessage(const QString & nick, const QString & message)
+{
+ printChatString(nick, linkedNick(nick) + ": " + messageToHTML(message), "Chat", containsHighlight(nick, message));
+}
+
+void HWChatWidget::printChatString(
+ const QString & nick, const QString & str, const QString & cssClassPart, bool highlight)
{
QSortFilterProxyModel * playersSortFilterModel = qobject_cast(chatNicks->model());
if(!playersSortFilterModel)
@@ -387,58 +415,15 @@
if(!players)
return;
- if (!nick.isEmpty())
- {
- // don't show chat lines that are from ignored nicks
- if (players->isFlagSet(nick, PlayersListModel::Ignore))
- return;
- }
+ // don't show chat lines that are from ignored nicks
+ if (players->isFlagSet(nick, PlayersListModel::Ignore))
+ return;
bool isFriend = (!nick.isEmpty()) && players->isFlagSet(nick, PlayersListModel::Friend);
- QString formattedStr = Qt::escape(str.mid(1));
- // make hedgewars.org urls actual links
- formattedStr = formattedStr.replace(URLREGEXP, "\\3");
-
- // link the nick
- if(!nick.isEmpty())
- formattedStr.replace("|nick|", linkedNick(nick));
-
- QString cssClass("msg_UserChat");
+ QString cssClass = (isFriend ? "msg_Friend" : "msg_User") + cssClassPart;
- // check first character for color code and set color properly
- char c = str[0].toAscii();
- switch (c)
- {
- case 3:
- cssClass = (isFriend ? "msg_FriendJoin" : "msg_UserJoin");
- break;
- case 2:
- cssClass = (isFriend ? "msg_FriendAction" : "msg_UserAction");
- break;
- default:
- if (isFriend)
- cssClass = "msg_FriendChat";
- }
-
- bool isHL = false;
-
- if ((c != 3) && (!nick.isEmpty()) &&
- (nick != m_userNick) && (!m_userNick.isEmpty()))
- {
- QString lcStr = str.toLower();
-
- foreach (const QRegExp & hl, m_highlights)
- {
- if (lcStr.contains(hl))
- {
- isHL = true;
- break;
- }
- }
- }
-
- addLine(cssClass, formattedStr, isHL);
+ addLine(cssClass, str, highlight);
}
void HWChatWidget::addLine(const QString & cssClass, QString line, bool isHighlight)
@@ -464,6 +449,7 @@
{
line = QString("%1").arg(line);
SDLInteraction::instance().playSoundFile(m_hilightSound);
+ HWApplication::alert(this, 800);
}
chatStrings.append(line);
@@ -512,6 +498,9 @@
emit nickCountUpdate(chatNicks->model()->rowCount());
+ if (!isIgnored)
+ printChatString(nick, QString("*** ") + tr("%1 has joined").arg(linkedNick(nick)), "Join", false);
+
if (notifyNick && notify && (m_helloSounds.size() > 0))
{
SDLInteraction::instance().playSoundFile(
@@ -521,9 +510,19 @@
void HWChatWidget::nickRemoved(const QString& nick)
{
+ nickRemoved(nick, "");
+}
+
+void HWChatWidget::nickRemoved(const QString& nick, const QString & message)
+{
chatEditLine->removeNickname(nick);
emit nickCountUpdate(chatNicks->model()->rowCount());
+
+ if (message.isEmpty())
+ printChatString(nick, QString("*** ") + tr("%1 has left").arg(linkedNick(nick)), "Leave", false);
+ else
+ printChatString(nick, QString("*** ") + tr("%1 has left (%2)").arg(linkedNick(nick)).arg(messageToHTML(message)), "Leave", false);
}
void HWChatWidget::clear()
@@ -582,6 +581,19 @@
}
}
+void HWChatWidget::onPlayerInfo(
+ const QString & nick,
+ const QString & ip,
+ const QString & version,
+ const QString & roomInfo)
+{
+ addLine("msg_PlayerInfo", QString(" >>> %1 - %2 %3 %4")
+ .arg(linkedNick(nick))
+ .arg(ip)
+ .arg(version)
+ .arg(roomInfo));
+}
+
void HWChatWidget::onKick()
{
QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/chatwidget.h
--- a/QTfrontend/ui/widget/chatwidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/chatwidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -86,14 +86,39 @@
void beforeContentAdd();
void afterContentAdd();
+ /**
+ * @brief Checks whether the message contains a highlight.
+ * @param sender the sender of the message
+ * @param message the message
+ * @return true if the sender is somebody else and the message contains a highlight, otherwise false
+ */
+ bool containsHighlight(const QString & sender, const QString & message);
+ /**
+ * @brief Escapes HTML chars in the message and converts URls to HTML links.
+ * @param message the message to be converted to HTML
+ * @return the HTML message
+ */
+ QString messageToHTML(const QString & message);
+ void printChatString(
+ const QString & nick,
+ const QString & str,
+ const QString & cssClassPart,
+ bool highlight);
+
public slots:
- void onChatString(const QString& str);
- void onChatString(const QString& nick, const QString& str);
+ void onChatAction(const QString & nick, const QString & str);
+ void onChatMessage(const QString & nick, const QString & str);
void onServerMessage(const QString& str);
void nickAdded(const QString& nick, bool notifyNick);
void nickRemoved(const QString& nick);
+ void nickRemoved(const QString& nick, const QString& message);
void clear();
void adminAccess(bool);
+ void onPlayerInfo(
+ const QString & nick,
+ const QString & ip,
+ const QString & version,
+ const QString & roomInfo);
signals:
void chatLine(const QString& str);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/databrowser.cpp
--- a/QTfrontend/ui/widget/databrowser.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/databrowser.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/databrowser.h
--- a/QTfrontend/ui/widget/databrowser.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/databrowser.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/drawmapwidget.cpp
--- a/QTfrontend/ui/widget/drawmapwidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/drawmapwidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -62,8 +62,43 @@
{
Q_UNUSED(event);
+ int height = this->height();
+ int width = this->width();
+
+ if ((m_scene->height() > 0) && (m_scene->width() > 0) && (height > 0))
+ {
+ qreal saspect = m_scene->width() / m_scene->height();
+
+ qreal h = height;
+ qreal w = width;
+ qreal waspect = w / h;
+
+ if (waspect < saspect)
+ {
+ h = w / saspect;
+ }
+ else if (waspect > saspect)
+ {
+ w = saspect * h;
+ }
+
+ int fixedh = (int)h;
+ int fixedw = (int)w;
+
+ if (ui->graphicsView->width() != fixedw)
+ {
+ ui->graphicsView->setFixedWidth(fixedw);
+ }
+
+ if (ui->graphicsView->height() != fixedh)
+ {
+ ui->graphicsView->setFixedHeight(fixedh);
+ }
+
+ }
+
if(ui->graphicsView && ui->graphicsView->scene())
- ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio);
+ ui->graphicsView->fitInView(m_scene->sceneRect(), Qt::KeepAspectRatio);
}
void DrawMapWidget::showEvent(QShowEvent * event)
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/drawmapwidget.h
--- a/QTfrontend/ui/widget/drawmapwidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/drawmapwidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -25,7 +25,6 @@
#include
#include
-#include "qaspectratiolayout.h"
#include "drawmapscene.h"
@@ -61,12 +60,13 @@
QVBoxLayout * vbox = new QVBoxLayout(drawMapWidget);
vbox->setMargin(0);
lblPoints = new QLabel("0", drawMapWidget);
- vbox->addWidget(lblPoints);
- QAspectRatioLayout * arLayout = new QAspectRatioLayout();
- arLayout->setMargin(0);
+ QLayout * arLayout = new QVBoxLayout();
+ arLayout->setAlignment(Qt::AlignCenter);
vbox->addLayout(arLayout);
graphicsView = new DrawMapView(drawMapWidget);
+ graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
arLayout->addWidget(graphicsView);
retranslateUi(drawMapWidget);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/feedbackdialog.cpp
--- a/QTfrontend/ui/widget/feedbackdialog.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/feedbackdialog.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -34,7 +34,7 @@
#include
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
#define WINVER 0x0500
#include
#else
@@ -42,8 +42,11 @@
#include
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include
+#ifndef _SC_NPROCESSORS_ONLN
+#define _SC_NPROCESSORS_ONLN 58
+#endif
#endif
#include
@@ -74,16 +77,22 @@
QHBoxLayout * systemLayout = new QHBoxLayout();
info = new QLabel();
- info->setText(
+ info->setText(QString(
""
- "Please give us feedback!
"
- "We are always happy about suggestions, ideas, or bug reports."
- "Your email address is optional, but we may want to contact you."
- "
"
+ "")
+ .arg(tr("Send us feedback!"))
+ .arg(tr("We are always happy about suggestions, ideas, or bug reports."))
+ .arg(tr("If you found a bug, you can see if it's already been reported here: "))
+ .arg(tr("Your email address is optional, but necessary if you want us to get back at you."))
);
+ info->setOpenExternalLinks(true);
pageLayout->addWidget(info);
QVBoxLayout * summaryEmailLayout = new QVBoxLayout();
@@ -198,7 +207,7 @@
QString processor_name = "Processor: ";
// platform specific code
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MACX
number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
uint64_t memsize;
@@ -231,19 +240,21 @@
default: os_version += "\"Unknown version\"\n"; break;
}
#endif
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
number_of_cores += QString::number(sysinfo.dwNumberOfProcessors) + "\n";
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
GlobalMemoryStatusEx(&status);
- total_ram += QString::number(status.ullTotalPhys) + "\n";
+ total_ram += QString::number(status.ullTotalPhys/1024/1024) + " MB\n";
- switch(QSysInfo::WinVersion())
+ switch(QSysInfo::windowsVersion())
{
+ case QSysInfo::WV_NT: os_version += "Windows NT\n"; break;
case QSysInfo::WV_2000: os_version += "Windows 2000\n"; break;
case QSysInfo::WV_XP: os_version += "Windows XP\n"; break;
+ case QSysInfo::WV_2003: os_version += "Windows Server 2003\n"; break;
case QSysInfo::WV_VISTA: os_version += "Windows Vista\n"; break;
case QSysInfo::WV_WINDOWS7: os_version += "Windows 7\n"; break;
//case QSysInfo::WV_WINDOWS8: os_version += "Windows 8\n"; break; //QT 5+
@@ -251,7 +262,7 @@
}
kernel_line += "Windows kernel\n";
#endif
-#ifdef Q_WS_X11
+#ifdef Q_OS_X11
number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
long pages = sysconf(_SC_PHYS_PAGES),
/*
@@ -260,13 +271,13 @@
#else
available_pages = 0,
#endif*/
- page_size = sysconf(_SC_PAGE_SIZE);
- total_ram += QString::number(pages * page_size) + "\n";
+ page_size = sysconf(_SC_PAGE_SIZE);
+ total_ram += QString::number(pages*page_size/1024/1024) + " MB\n";
os_version += "GNU/Linux or BSD\n";
#endif
// uname -a
-#if defined(Q_WS_X11) || defined(Q_WS_MACX)
+#if defined(Q_OS_X11) || defined(Q_OS_MAC)
QProcess *process = new QProcess();
QStringList arguments = QStringList("-a");
process->start("uname", arguments);
@@ -275,7 +286,7 @@
delete process;
#endif
-#if defined(__i386__) || defined(__x86_64__)
+#if (!defined(Q_OS_MAC) && defined(__i386__)) || defined(__x86_64__)
// cpu info
quint32 registers[4];
quint32 i;
@@ -450,7 +461,7 @@
QString email = this->email->text();
QString captchaCode = this->captcha_code->text();
QString captchaID = QString::number(this->captchaID);
- QString version = "HedgewarsFoundation-Hedgewars-v" + *cVersionString + "_r" +
+ QString version = "HedgewarsFoundation-Hedgewars-v" + *cVersionString + "_r" +
*cRevisionString + "|" + *cHashString;
if (summary.isEmpty() || description.isEmpty())
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/feedbackdialog.h
--- a/QTfrontend/ui/widget/feedbackdialog.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/feedbackdialog.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/fpsedit.cpp
--- a/QTfrontend/ui/widget/fpsedit.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/fpsedit.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/fpsedit.h
--- a/QTfrontend/ui/widget/fpsedit.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/fpsedit.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/frameTeam.cpp
--- a/QTfrontend/ui/widget/frameTeam.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/frameTeam.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/frameTeam.h
--- a/QTfrontend/ui/widget/frameTeam.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/frameTeam.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/gamecfgwidget.cpp
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -599,7 +599,7 @@
GameSchemes->setEnabled(false);
GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
}
- else
+ else if (m_master)
{
GameSchemes->setEnabled(true);
int num = GameSchemes->findText(scheme);
@@ -614,7 +614,7 @@
WeaponsName->setEnabled(false);
WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
}
- else
+ else if (m_master)
{
WeaponsName->setEnabled(true);
int num = WeaponsName->findText(weapons);
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/gamecfgwidget.h
--- a/QTfrontend/ui/widget/gamecfgwidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/gamecfgwidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatbutton.cpp
--- a/QTfrontend/ui/widget/hatbutton.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hatbutton.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatbutton.h
--- a/QTfrontend/ui/widget/hatbutton.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hatbutton.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatprompt.cpp
--- a/QTfrontend/ui/widget/hatprompt.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hatprompt.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatprompt.h
--- a/QTfrontend/ui/widget/hatprompt.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hatprompt.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hedgehogerWidget.cpp
--- a/QTfrontend/ui/widget/hedgehogerWidget.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Ulyanov Igor
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hedgehogerWidget.h
--- a/QTfrontend/ui/widget/hedgehogerWidget.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/hedgehogerWidget.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Ulyanov Igor
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/igbox.cpp
--- a/QTfrontend/ui/widget/igbox.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/igbox.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/igbox.h
--- a/QTfrontend/ui/widget/igbox.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/igbox.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/keybinder.cpp
--- a/QTfrontend/ui/widget/keybinder.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/keybinder.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/keybinder.h
--- a/QTfrontend/ui/widget/keybinder.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/keybinder.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/lineeditcursor.cpp
--- a/QTfrontend/ui/widget/lineeditcursor.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/lineeditcursor.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/lineeditcursor.h
--- a/QTfrontend/ui/widget/lineeditcursor.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/lineeditcursor.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/mapContainer.cpp
--- a/QTfrontend/ui/widget/mapContainer.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -75,8 +75,11 @@
/* Layouts */
- QHBoxLayout * typeLayout = new QHBoxLayout();
- QHBoxLayout * seedLayout = new QHBoxLayout();
+ QWidget * topWidget = new QWidget();
+ QHBoxLayout * topLayout = new QHBoxLayout(topWidget);
+ topWidget->setContentsMargins(0, 0, 0, 0);
+ topLayout->setContentsMargins(0, 0, 0, 0);
+
QHBoxLayout * twoColumnLayout = new QHBoxLayout();
QVBoxLayout * leftLayout = new QVBoxLayout();
QVBoxLayout * rightLayout = new QVBoxLayout();
@@ -84,15 +87,13 @@
twoColumnLayout->addStretch(1);
twoColumnLayout->addLayout(rightLayout, 0);
QVBoxLayout * drawnControls = new QVBoxLayout();
- leftLayout->addLayout(typeLayout, 0);
- rightLayout->addLayout(seedLayout, 0);
/* Map type combobox */
- typeLayout->setSpacing(10);
- typeLayout->addWidget(new QLabel(tr("Map type:")), 0);
+ topLayout->setSpacing(10);
+ topLayout->addWidget(new QLabel(tr("Map type:")), 0);
cType = new QComboBox(this);
- typeLayout->addWidget(cType, 1);
+ topLayout->addWidget(cType, 1);
cType->insertItem(0, tr("Image map"), MapModel::StaticMap);
cType->insertItem(1, tr("Mission map"), MapModel::MissionMap);
cType->insertItem(2, tr("Hand-drawn"), MapModel::HandDrawnMap);
@@ -103,7 +104,7 @@
/* Randomize button */
- seedLayout->addStretch(1);
+ topLayout->addStretch(1);
const QIcon& lp = QIcon(":/res/dice.png");
QSize sz = lp.actualSize(QSize(65535, 65535));
btnRandomize = new QPushButton();
@@ -117,15 +118,16 @@
m_childWidgets << btnRandomize;
btnRandomize->setStyleSheet("padding: 5px;");
btnRandomize->setFixedHeight(cType->height());
- seedLayout->addWidget(btnRandomize, 1);
+ topLayout->addWidget(btnRandomize, 1);
/* Seed button */
+
btnSeed = new QPushButton(parentWidget()->parentWidget());
btnSeed->setText(tr("Seed"));
btnSeed->setStyleSheet("padding: 5px;");
btnSeed->setFixedHeight(cType->height());
connect(btnSeed, SIGNAL(clicked()), this, SLOT(showSeedPrompt()));
- seedLayout->addWidget(btnSeed, 0);
+ topLayout->addWidget(btnSeed, 0);
/* Map preview label */
@@ -137,6 +139,7 @@
mapPreview = new QPushButton(this);
mapPreview->setObjectName("mapPreview");
+ mapPreview->setFlat(true);
mapPreview->setFixedSize(256, 128);
mapPreview->setContentsMargins(0, 0, 0, 0);
leftLayout->addWidget(mapPreview, 0);
@@ -240,13 +243,15 @@
/* Theme chooser */
btnTheme = new QPushButton();
+ btnTheme->setFlat(true);
connect(btnTheme, SIGNAL(clicked()), this, SLOT(showThemePrompt()));
m_childWidgets << btnTheme;
bottomLeftLayout->addWidget(btnTheme, 0);
/* Add everything to main layout */
- mainLayout.addLayout(twoColumnLayout, 0);
+ mainLayout.addWidget(topWidget, 0);
+ mainLayout.addLayout(twoColumnLayout, 1);
/* Set defaults */
@@ -463,7 +468,7 @@
void HWMapContainer::setRandomMap()
{
if (!m_master) return;
-
+
setRandomSeed();
switch(m_mapInfo.type)
{
@@ -796,7 +801,7 @@
btnTheme->setFixedHeight(64);
btnTheme->setIconSize(iconSize);
btnTheme->setIcon(icon);
- btnTheme->setText(tr("Theme: ") + current.data(Qt::DisplayRole).toString());
+ btnTheme->setText(tr("Theme: %1").arg(current.data(Qt::DisplayRole).toString()));
updateThemeButtonSize();
}
@@ -927,5 +932,5 @@
m_theme = name;
btnTheme->setIcon(QIcon());
- btnTheme->setText(tr("Theme: ") + name);
+ btnTheme->setText(tr("Theme: %1").arg(name));
}
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/mapContainer.h
--- a/QTfrontend/ui/widget/mapContainer.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/mapContainer.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/qpushbuttonwithsound.cpp
--- a/QTfrontend/ui/widget/qpushbuttonwithsound.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/qpushbuttonwithsound.h
--- a/QTfrontend/ui/widget/qpushbuttonwithsound.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/roomnameprompt.cpp
--- a/QTfrontend/ui/widget/roomnameprompt.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/roomnameprompt.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -62,7 +62,7 @@
QPushButton * btnOkay = new QPushButton(tr("Create room"));
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept()));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
buttonLayout->addWidget(btnCancel);
buttonLayout->addWidget(btnOkay);
#else
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/roomnameprompt.h
--- a/QTfrontend/ui/widget/roomnameprompt.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/roomnameprompt.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/seedprompt.cpp
--- a/QTfrontend/ui/widget/seedprompt.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/seedprompt.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
@@ -62,7 +62,7 @@
QPushButton * btnOkay = new QPushButton(tr("Set seed"));
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept()));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
buttonLayout->addWidget(btnCancel);
buttonLayout->addWidget(btnOkay);
#else
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/seedprompt.h
--- a/QTfrontend/ui/widget/seedprompt.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/seedprompt.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/selectWeapon.cpp
--- a/QTfrontend/ui/widget/selectWeapon.cpp Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/selectWeapon.cpp Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev
+ * Copyright (c) 2004-2013 Andrey Korotaev
*
* 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
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/selectWeapon.h
--- a/QTfrontend/ui/widget/selectWeapon.h Tue Apr 30 01:47:30 2013 +0200
+++ b/QTfrontend/ui/widget/selectWeapon.h Thu Jun 13 22:27:23 2013 +0200
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2012 Andrey Korotaev