Merge branch 'master' of https://github.com/OpenMW/openmw into osg

Conflicts:
	apps/launcher/CMakeLists.txt
	apps/opencs/CMakeLists.txt
	apps/opencs/view/render/worldspacewidget.cpp
	apps/openmw/CMakeLists.txt
	components/CMakeLists.txt
	extern/osg-ffmpeg-videoplayer/CMakeLists.txt
c++11
scrawl 10 years ago
commit f70250a296

@ -100,25 +100,29 @@ endif()
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
# Sound setup # Sound setup
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
unset(FFMPEG_LIBRARIES CACHE) unset(FFMPEG_LIBRARIES CACHE)
find_package(FFmpeg)
find_package(FFmpeg REQUIRED)
set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARY})
if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND ) if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND )
message(FATAL_ERROR "FFmpeg component required, but not found!") message(FATAL_ERROR "FFmpeg component required, but not found!")
endif() endif()
set(SOUND_INPUT_INCLUDES ${FFMPEG_INCLUDE_DIRS}) set(SOUND_INPUT_INCLUDES ${FFMPEG_INCLUDE_DIRS})
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
if( SWRESAMPLE_FOUND ) if( SWRESAMPLE_FOUND )
add_definitions(-DHAVE_LIBSWRESAMPLE) add_definitions(-DHAVE_LIBSWRESAMPLE)
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES}) set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES})
else() else()
if( AVRESAMPLE_FOUND ) if( AVRESAMPLE_FOUND )
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES}) set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES})
else() else()
message(FATAL_ERROR "Install either libswresample (FFmpeg) or libavresample (Libav).") message(FATAL_ERROR "Install either libswresample (FFmpeg) or libavresample (Libav).")
endif() endif()
endif() endif()
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES})
# TinyXML # TinyXML
option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF) option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF)
if(USE_SYSTEM_TINYXML) if(USE_SYSTEM_TINYXML)
@ -150,6 +154,20 @@ endif()
# Dependencies # Dependencies
set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)")
message(STATUS "Using Qt${DESIRED_QT_VERSION}")
if (DESIRED_QT_VERSION MATCHES 4)
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL)
else()
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5OpenGL REQUIRED)
# Instruct CMake to run moc automatically when needed.
#set(CMAKE_AUTOMOC ON)
endif()
# Fix for not visible pthreads functions for linker with glibc 2.15 # Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
find_package (Threads) find_package (Threads)
@ -170,7 +188,7 @@ if (HAVE_UNORDERED_MAP)
endif () endif ()
set(BOOST_COMPONENTS system filesystem program_options) set(BOOST_COMPONENTS system filesystem program_options thread)
if(WIN32) if(WIN32)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale) set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
endif(WIN32) endif(WIN32)

@ -9,7 +9,8 @@ add_executable(bsatool
) )
target_link_libraries(bsatool target_link_libraries(bsatool
${Boost_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
components components
) )

@ -13,7 +13,7 @@ add_executable(esmtool
) )
target_link_libraries(esmtool target_link_libraries(esmtool
${Boost_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
components components
) )

@ -33,7 +33,8 @@ add_executable(openmw-essimporter
) )
target_link_libraries(openmw-essimporter target_link_libraries(openmw-essimporter
${Boost_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
components components
) )

@ -57,7 +57,6 @@ set(LAUNCHER_UI
source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER}) source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER})
find_package(Qt4 REQUIRED)
set(QT_USE_QTGUI 1) set(QT_USE_QTGUI 1)
# Set some platform specific settings # Set some platform specific settings
@ -66,12 +65,17 @@ if(WIN32)
set(QT_USE_QTMAIN TRUE) set(QT_USE_QTMAIN TRUE)
endif(WIN32) endif(WIN32)
QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc) if (DESIRED_QT_VERSION MATCHES 4)
QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC}) include(${QT_USE_FILE})
QT4_WRAP_UI(UI_HDRS ${LAUNCHER_UI}) QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc)
QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
QT4_WRAP_UI(UI_HDRS ${LAUNCHER_UI})
else()
QT5_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc)
QT5_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
QT5_WRAP_UI(UI_HDRS ${LAUNCHER_UI})
endif()
include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(NOT WIN32) if(NOT WIN32)
include_directories(${LIBUNSHIELD_INCLUDE_DIR}) include_directories(${LIBUNSHIELD_INCLUDE_DIR})
@ -88,15 +92,19 @@ add_executable(openmw-launcher
) )
target_link_libraries(openmw-launcher target_link_libraries(openmw-launcher
${Boost_LIBRARIES}
${SDL2_LIBRARY_ONLY} ${SDL2_LIBRARY_ONLY}
${QT_LIBRARIES}
components components
) )
if (DESIRED_QT_VERSION MATCHES 4)
target_link_libraries(openmw-launcher ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
else()
qt5_use_modules(openmw-launcher Widgets Core)
endif()
if (BUILD_WITH_CODE_COVERAGE) if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage) add_definitions (--coverage)
target_link_libraries(openmw-launcher gcov) target_link_libraries(openmw-launcher gcov)
endif() endif()

@ -54,9 +54,6 @@ int main(int argc, char *argv[])
QDir::setCurrent(dir.absolutePath()); QDir::setCurrent(dir.absolutePath());
// Support non-latin characters
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
Launcher::MainDialog mainWin; Launcher::MainDialog mainWin;
Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog(); Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog();

@ -14,10 +14,16 @@ add_executable(openmw-iniimporter
) )
target_link_libraries(openmw-iniimporter target_link_libraries(openmw-iniimporter
${Boost_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
components components
) )
if (WIN32)
target_link_libraries(openmw-iniimporter
${Boost_LOCALE_LIBRARY})
endif()
if (MINGW) if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode")
endif() endif()

@ -153,19 +153,16 @@ if(WIN32)
set(QT_USE_QTMAIN TRUE) set(QT_USE_QTMAIN TRUE)
endif(WIN32) endif(WIN32)
set(BOOST_COMPONENTS system filesystem program_options thread) if (DESIRED_QT_VERSION MATCHES 4)
if(WIN32) include(${QT_USE_FILE})
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale) qt4_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
endif(WIN32) qt4_wrap_cpp(OPENCS_MOC_SRC ${OPENCS_HDR_QT})
qt4_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) else()
qt5_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL REQUIRED) qt5_wrap_cpp(OPENCS_MOC_SRC ${OPENCS_HDR_QT})
include(${QT_USE_FILE}) qt5_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
endif()
qt4_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
qt4_wrap_cpp(OPENCS_MOC_SRC ${OPENCS_HDR_QT})
qt4_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
# for compiled .ui files # for compiled .ui files
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
@ -202,11 +199,27 @@ endif(APPLE)
target_link_libraries(openmw-cs target_link_libraries(openmw-cs
${OPENSCENEGRAPH_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES}
${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY}
${QT_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
components components
) )
if (DESIRED_QT_VERSION MATCHES 4)
target_link_libraries(openmw-cs
${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTOPENGL_LIBRARY})
else()
qt5_use_modules(openmw-cs Widgets Core Network OpenGL)
endif()
if (WIN32)
target_link_libraries(openmw-cs ${Boost_LOCALE_LIBRARY})
endif()
if(APPLE) if(APPLE)
INSTALL(TARGETS openmw-cs BUNDLE DESTINATION OpenMW COMPONENT BUNDLE) INSTALL(TARGETS openmw-cs BUNDLE DESTINATION OpenMW COMPONENT BUNDLE)
endif() endif()

@ -298,12 +298,12 @@ bool CS::Editor::makeIPCServer()
mServer->close(); mServer->close();
fullPath.remove(QRegExp("dummy$")); fullPath.remove(QRegExp("dummy$"));
fullPath += mIpcServerName; fullPath += mIpcServerName;
if(boost::filesystem::exists(fullPath.toStdString().c_str())) if(boost::filesystem::exists(fullPath.toUtf8().constData()))
{ {
// TODO: compare pid of the current process with that in the file // TODO: compare pid of the current process with that in the file
std::cout << "Detected unclean shutdown." << std::endl; std::cout << "Detected unclean shutdown." << std::endl;
// delete the stale file // delete the stale file
if(remove(fullPath.toStdString().c_str())) if(remove(fullPath.toUtf8().constData()))
std::cerr << "ERROR removing stale connection file" << std::endl; std::cerr << "ERROR removing stale connection file" << std::endl;
} }
} }

@ -2270,7 +2270,7 @@ CSMDoc::Document::Document (const VFS::Manager* vfs, const Files::ConfigurationM
if (boost::filesystem::exists (customFiltersPath)) if (boost::filesystem::exists (customFiltersPath))
{ {
destination << std::ifstream(customFiltersPath.c_str(), std::ios::binary).rdbuf(); destination << std::ifstream(customFiltersPath.string().c_str(), std::ios::binary).rdbuf();
} }
else else
{ {

@ -21,21 +21,17 @@ void CSMWorld::IdTableProxyModel::updateColumnMap()
} }
} }
bool CSMWorld::IdTableProxyModel::filterAcceptsColumn (int sourceColumn, const QModelIndex& sourceParent) bool CSMWorld::IdTableProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent)
const const
{ {
int flags = // It is not possible to use filterAcceptsColumn() and check for
sourceModel()->headerData (sourceColumn, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags).toInt(); // sourceModel()->headerData (sourceColumn, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags)
// because the sourceColumn parameter excludes the hidden columns, i.e. wrong columns can
if (flags & CSMWorld::ColumnBase::Flag_Table) // be rejected. Workaround by disallowing tree branches (nested columns), which are not meant
return true; // to be visible, from the filter.
else if (sourceParent.isValid())
return false; return false;
}
bool CSMWorld::IdTableProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent)
const
{
if (!mFilter) if (!mFilter)
return true; return true;
@ -56,9 +52,10 @@ QModelIndex CSMWorld::IdTableProxyModel::getModelIndex (const std::string& id, i
void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr<CSMFilter::Node>& filter) void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr<CSMFilter::Node>& filter)
{ {
beginResetModel();
mFilter = filter; mFilter = filter;
updateColumnMap(); updateColumnMap();
reset(); endResetModel();
} }
bool CSMWorld::IdTableProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const bool CSMWorld::IdTableProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const

@ -39,8 +39,6 @@ namespace CSMWorld
bool lessThan(const QModelIndex &left, const QModelIndex &right) const; bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const; virtual bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const;
virtual bool filterAcceptsColumn (int sourceColumn, const QModelIndex& sourceParent) const;
}; };
} }

@ -334,9 +334,9 @@ QVariant CSMWorld::RegionMap::data (const QModelIndex& index, int role) const
mColours.find (Misc::StringUtils::lowerCase (cell->second.mRegion)); mColours.find (Misc::StringUtils::lowerCase (cell->second.mRegion));
if (iter!=mColours.end()) if (iter!=mColours.end())
return QBrush ( return QBrush (QColor (iter->second & 0xff,
QColor (iter->second>>24, (iter->second>>16) & 255, (iter->second>>8) & 255, (iter->second >> 8) & 0xff,
iter->second & 255)); (iter->second >> 16) & 0xff));
if (cell->second.mRegion.empty()) if (cell->second.mRegion.empty())
return QBrush (Qt::Dense6Pattern); // no region return QBrush (Qt::Dense6Pattern); // no region

@ -7,7 +7,7 @@
#include <QMenuBar> #include <QMenuBar>
#include <QMdiArea> #include <QMdiArea>
#include <QDockWidget> #include <QDockWidget>
#include <QtGui/QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QScrollArea> #include <QScrollArea>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -515,6 +515,10 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
} }
} }
if (mScroll)
QObject::connect(mScroll->horizontalScrollBar(),
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int)));
// User setting for limiting the number of sub views per top level view. // User setting for limiting the number of sub views per top level view.
// Automatically open a new top level view if this number is exceeded // Automatically open a new top level view if this number is exceeded
// //
@ -586,12 +590,6 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth); mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth);
move(0, y()); move(0, y());
} }
// Make the new subview visible, setFocus() or raise() don't seem to work
// On Ubuntu the scrollbar does not go right to the end, even if using
// mScroll->horizontalScrollBar()->setValue(mScroll->horizontalScrollBar()->maximum());
if (mSubViewWindow.width() > rect.width())
mScroll->horizontalScrollBar()->setValue(mSubViewWindow.width());
} }
mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view); mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view);
@ -614,6 +612,17 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
view->useHint (hint); view->useHint (hint);
} }
void CSVDoc::View::moveScrollBarToEnd(int min, int max)
{
if (mScroll)
{
mScroll->horizontalScrollBar()->setValue(max);
QObject::disconnect(mScroll->horizontalScrollBar(),
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int)));
}
}
void CSVDoc::View::newView() void CSVDoc::View::newView()
{ {
mViewManager.addView (mDocument); mViewManager.addView (mDocument);

@ -233,6 +233,8 @@ namespace CSVDoc
void stop(); void stop();
void closeRequest (SubView *subView); void closeRequest (SubView *subView);
void moveScrollBarToEnd(int min, int max);
}; };
} }

@ -6,6 +6,8 @@
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QMessageBox>
#include <QPushButton>
#include "../../model/doc/documentmanager.hpp" #include "../../model/doc/documentmanager.hpp"
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
@ -24,10 +26,6 @@
#include "view.hpp" #include "view.hpp"
#include <QMessageBox>
#include <QPushButton>
#include <QtGui/QApplication>
void CSVDoc::ViewManager::updateIndices() void CSVDoc::ViewManager::updateIndices()
{ {
std::map<CSMDoc::Document *, std::pair<int, int> > documents; std::map<CSMDoc::Document *, std::pair<int, int> > documents;

@ -5,7 +5,7 @@
#include <osgGA/TrackballManipulator> #include <osgGA/TrackballManipulator>
#include <QtGui/qevent.h> #include <QEvent>
#include <components/sceneutil/util.hpp> #include <components/sceneutil/util.hpp>

@ -3,7 +3,12 @@
#include <algorithm> #include <algorithm>
#include <QtGui/qevent.h> #include <QEvent>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QMouseEvent>
#include <QKeyEvent>
#include <osgGA/TrackballManipulator> #include <osgGA/TrackballManipulator>
#include <osgGA/FirstPersonManipulator> #include <osgGA/FirstPersonManipulator>

@ -8,19 +8,12 @@
#include <QStackedWidget> #include <QStackedWidget>
#include <QtGui> #include <QtGui>
#include <QSplitter> #include <QSplitter>
#include <QDesktopWidget>
#include "../../model/settings/usersettings.hpp" #include "../../model/settings/usersettings.hpp"
#include "page.hpp" #include "page.hpp"
#include <QApplication>
#include <QTreeView>
#include <QListView>
#include <QTableView>
#include <QStandardItemModel>
#include <QStandardItem>
CSVSettings::Dialog::Dialog(QMainWindow *parent) CSVSettings::Dialog::Dialog(QMainWindow *parent)
: SettingWindow (parent), mStackedWidget (0), mDebugMode (false) : SettingWindow (parent), mStackedWidget (0), mDebugMode (false)

@ -3,7 +3,6 @@
#include "settingwindow.hpp" #include "settingwindow.hpp"
#include "resizeablestackedwidget.hpp" #include "resizeablestackedwidget.hpp"
#include <QStandardItem>
class QStackedWidget; class QStackedWidget;
class QListWidget; class QListWidget;
@ -26,10 +25,6 @@ namespace CSVSettings {
explicit Dialog (QMainWindow *parent = 0); explicit Dialog (QMainWindow *parent = 0);
///Enables setting debug mode. When the dialog opens, a page is created
///which displays the SettingModel's contents in a Tree view.
void enableDebugMode (bool state, QStandardItemModel *model = 0);
protected: protected:
/// Settings are written on close /// Settings are written on close

@ -9,6 +9,8 @@
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
#include <QTextDocument> #include <QTextDocument>
#include <QPainter> #include <QPainter>
#include <QContextMenuEvent>
#include <QMouseEvent>
#include "../../model/tools/reportmodel.hpp" #include "../../model/tools/reportmodel.hpp"
@ -121,7 +123,11 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
const CSMWorld::UniversalId& id, bool richTextDescription, QWidget *parent) const CSMWorld::UniversalId& id, bool richTextDescription, QWidget *parent)
: CSVWorld::DragRecordTable (document, parent), mModel (document.getReport (id)) : CSVWorld::DragRecordTable (document, parent), mModel (document.getReport (id))
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
#else
horizontalHeader()->setResizeMode (QHeaderView::Interactive); horizontalHeader()->setResizeMode (QHeaderView::Interactive);
#endif
horizontalHeader()->setStretchLastSection (true); horizontalHeader()->setStretchLastSection (true);
verticalHeader()->hide(); verticalHeader()->hide();
setSortingEnabled (true); setSortingEnabled (true);

@ -65,8 +65,13 @@ CSVWidget::SceneToolRun::SceneToolRun (SceneToolbar *parent, const QString& tool
mTable->setShowGrid (false); mTable->setShowGrid (false);
mTable->verticalHeader()->hide(); mTable->verticalHeader()->hide();
mTable->horizontalHeader()->hide(); mTable->horizontalHeader()->hide();
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
mTable->horizontalHeader()->setSectionResizeMode (0, QHeaderView::Stretch);
mTable->horizontalHeader()->setSectionResizeMode (1, QHeaderView::ResizeToContents);
#else
mTable->horizontalHeader()->setResizeMode (0, QHeaderView::Stretch); mTable->horizontalHeader()->setResizeMode (0, QHeaderView::Stretch);
mTable->horizontalHeader()->setResizeMode (1, QHeaderView::ResizeToContents); mTable->horizontalHeader()->setResizeMode (1, QHeaderView::ResizeToContents);
#endif
mTable->setSelectionMode (QAbstractItemView::NoSelection); mTable->setSelectionMode (QAbstractItemView::NoSelection);
layout->addWidget (mTable); layout->addWidget (mTable);

@ -1,4 +1,5 @@
#include <QDrag> #include <QDrag>
#include <QDragEnterEvent>
#include "../../model/world/tablemimedata.hpp" #include "../../model/world/tablemimedata.hpp"
#include "dragrecordtable.hpp" #include "dragrecordtable.hpp"

@ -2,7 +2,7 @@
#define CSV_WORLD_DRAGRECORDTABLE_H #define CSV_WORLD_DRAGRECORDTABLE_H
#include <QTableView> #include <QTableView>
#include <QtGui/qevent.h> #include <QEvent>
class QWidget; class QWidget;
class QAction; class QAction;

@ -23,7 +23,11 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
setSelectionBehavior (QAbstractItemView::SelectRows); setSelectionBehavior (QAbstractItemView::SelectRows);
setSelectionMode (QAbstractItemView::ExtendedSelection); setSelectionMode (QAbstractItemView::ExtendedSelection);
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
#else
horizontalHeader()->setResizeMode (QHeaderView::Interactive); horizontalHeader()->setResizeMode (QHeaderView::Interactive);
#endif
verticalHeader()->hide(); verticalHeader()->hide();
int columns = model->columnCount(QModelIndex()); int columns = model->columnCount(QModelIndex());

@ -2,7 +2,7 @@
#define CSV_WORLD_NESTEDTABLE_H #define CSV_WORLD_NESTEDTABLE_H
#include <QTableView> #include <QTableView>
#include <QtGui/qevent.h> #include <QEvent>
class QUndoStack; class QUndoStack;
class QAction; class QAction;

@ -282,7 +282,11 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
mDispatcher = new CSMWorld::CommandDispatcher (document, id, this); mDispatcher = new CSMWorld::CommandDispatcher (document, id, this);
setModel (mProxyModel); setModel (mProxyModel);
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
#else
horizontalHeader()->setResizeMode (QHeaderView::Interactive); horizontalHeader()->setResizeMode (QHeaderView::Interactive);
#endif
verticalHeader()->hide(); verticalHeader()->hide();
setSortingEnabled (sorting); setSortingEnabled (sorting);
setSelectionBehavior (QAbstractItemView::SelectRows); setSelectionBehavior (QAbstractItemView::SelectRows);

@ -4,7 +4,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <QtGui/qevent.h> #include <QEvent>
#include "../../model/filter/node.hpp" #include "../../model/filter/node.hpp"
#include "../../model/world/columnbase.hpp" #include "../../model/world/columnbase.hpp"

@ -6,6 +6,7 @@
#include <QHeaderView> #include <QHeaderView>
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QDropEvent>
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
#include "../../model/world/tablemimedata.hpp" #include "../../model/world/tablemimedata.hpp"

@ -95,17 +95,6 @@ add_openmw_dir (mwbase
) )
# Main executable # Main executable
if (ANDROID)
set(BOOST_COMPONENTS system filesystem program_options thread atomic)
else ()
set(BOOST_COMPONENTS system filesystem program_options thread)
endif ()
if(WIN32)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
endif(WIN32)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
if (NOT ANDROID) if (NOT ANDROID)
add_executable(openmw add_executable(openmw
@ -127,7 +116,10 @@ include_directories(${SOUND_INPUT_INCLUDES})
target_link_libraries(openmw target_link_libraries(openmw
${OPENSCENEGRAPH_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES}
${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${OPENAL_LIBRARY} ${OPENAL_LIBRARY}
${SOUND_INPUT_LIBRARY} ${SOUND_INPUT_LIBRARY}
${BULLET_LIBRARIES} ${BULLET_LIBRARIES}

@ -295,9 +295,12 @@ namespace MWGui
mCurrent = mCommandHistory.end(); mCurrent = mCommandHistory.end();
mEditString.clear(); mEditString.clear();
execute (cm); // Reset the command line before the command execution.
// It prevents the re-triggering of the acceptCommand() event for the same command
// during the actual command execution
mCommandLine->setCaption(""); mCommandLine->setCaption("");
execute (cm);
} }
std::string Console::complete( std::string input, std::vector<std::string> &matches ) std::string Console::complete( std::string input, std::vector<std::string> &matches )

@ -81,7 +81,6 @@ endif (OPENMW_USE_UNSHIELD)
source_group(wizard FILES ${WIZARD} ${WIZARD_HEADER}) source_group(wizard FILES ${WIZARD} ${WIZARD_HEADER})
find_package(Qt4 REQUIRED)
set(QT_USE_QTGUI 1) set(QT_USE_QTGUI 1)
# Set some platform specific settings # Set some platform specific settings
@ -90,12 +89,17 @@ if(WIN32)
set(QT_USE_QTMAIN TRUE) set(QT_USE_QTMAIN TRUE)
endif(WIN32) endif(WIN32)
QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/wizard/wizard.qrc) if (DESIRED_QT_VERSION MATCHES 4)
QT4_WRAP_CPP(MOC_SRCS ${WIZARD_HEADER_MOC}) include(${QT_USE_FILE})
QT4_WRAP_UI(UI_HDRS ${WIZARD_UI}) QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/wizard/wizard.qrc)
QT4_WRAP_CPP(MOC_SRCS ${WIZARD_HEADER_MOC})
QT4_WRAP_UI(UI_HDRS ${WIZARD_UI})
else()
QT5_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/wizard/wizard.qrc)
QT5_WRAP_CPP(MOC_SRCS ${WIZARD_HEADER_MOC})
QT5_WRAP_UI(UI_HDRS ${WIZARD_UI})
endif()
include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (OPENMW_USE_UNSHIELD) if (OPENMW_USE_UNSHIELD)
@ -112,11 +116,17 @@ add_executable(openmw-wizard
) )
target_link_libraries(openmw-wizard target_link_libraries(openmw-wizard
${Boost_LIBRARIES}
${QT_LIBRARIES}
components components
) )
if (DESIRED_QT_VERSION MATCHES 4)
target_link_libraries(openmw-wizard
${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY})
else()
qt5_use_modules(openmw-wizard Widgets Core)
endif()
if (OPENMW_USE_UNSHIELD) if (OPENMW_USE_UNSHIELD)
target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARY}) target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARY})
endif() endif()

@ -38,9 +38,6 @@ int main(int argc, char *argv[])
QDir::setCurrent(dir.absolutePath()); QDir::setCurrent(dir.absolutePath());
// Support non-latin characters
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
Wizard::MainWizard wizard; Wizard::MainWizard wizard;
wizard.show(); wizard.show();

@ -6,7 +6,6 @@
#include <QWriteLocker> #include <QWriteLocker>
#include <QFileDialog> #include <QFileDialog>
#include <QFileInfo> #include <QFileInfo>
#include <QFileInfoListIterator>
#include <QStringList> #include <QStringList>
#include <QTextStream> #include <QTextStream>
#include <QTextCodec> #include <QTextCodec>

@ -24,7 +24,6 @@ namespace Wizard
class UnshieldWorker : public QObject class UnshieldWorker : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(Wizard::Component)
public: public:
UnshieldWorker(QObject *parent = 0); UnshieldWorker(QObject *parent = 0);

@ -135,32 +135,30 @@ add_component_dir (version
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
) )
find_package(Qt4 COMPONENTS QtCore QtGui) add_component_qt_dir (contentselector
if(MINGW) model/modelitem model/esmfile
find_package(Bullet REQUIRED COMPONENTS Collision) model/naturalsort model/contentmodel
endif() model/loadordererror
view/combobox view/contentselector
if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) )
add_component_qt_dir (contentselector add_component_qt_dir (config
model/modelitem model/esmfile gamesettings
model/naturalsort model/contentmodel launchersettings
model/loadordererror settingsbase
view/combobox view/contentselector
)
add_component_qt_dir (config
gamesettings
launchersettings
settingsbase
)
add_component_qt_dir (process
processinvoker
) )
include(${QT_USE_FILE}) add_component_qt_dir (process
processinvoker
)
if (DESIRED_QT_VERSION MATCHES 4)
include(${QT_USE_FILE})
QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI}) QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI})
QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
endif(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) else()
QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI})
QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
endif()
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE)
@ -173,7 +171,10 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR}) add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
target_link_libraries(components target_link_libraries(components
${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${OPENSCENEGRAPH_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES}
${BULLET_LIBRARIES} ${BULLET_LIBRARIES}
${SDL2_LIBRARY} ${SDL2_LIBRARY}
@ -181,14 +182,23 @@ target_link_libraries(components
${OPENGL_gl_LIBRARY} ${OPENGL_gl_LIBRARY}
) )
if (WIN32)
target_link_libraries(components
${Boost_LOCALE_LIBRARY})
endif()
if (DESIRED_QT_VERSION MATCHES 4)
target_link_libraries(components
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY})
else()
qt5_use_modules(components Widgets Core)
endif()
if (GIT_CHECKOUT) if (GIT_CHECKOUT)
add_dependencies (components git-version) add_dependencies (components git-version)
endif (GIT_CHECKOUT) endif (GIT_CHECKOUT)
if(MINGW)
target_link_libraries(components ${QT_LIBRARIES} ${BULLET_LIBRARIES})
endif()
if (WIN32) if (WIN32)
target_link_libraries(components shlwapi) target_link_libraries(components shlwapi)
endif() endif()

@ -291,9 +291,9 @@ bool Config::GameSettings::writeFileWithComments(QFile &file)
stream << key << "=" << value << "\n"; stream << key << "=" << value << "\n";
} }
// new entries
if (!userSettingsCopy.empty()) if (!userSettingsCopy.empty())
{ {
stream << "# new entries" << "\n";
QMap<QString, QString>::const_iterator it = userSettingsCopy.begin(); QMap<QString, QString>::const_iterator it = userSettingsCopy.begin();
for (; it != userSettingsCopy.end(); ++it) for (; it != userSettingsCopy.end(); ++it)
{ {

@ -30,17 +30,6 @@ ContentSelectorModel::ContentModel::~ContentModel()
void ContentSelectorModel::ContentModel::setEncoding(const QString &encoding) void ContentSelectorModel::ContentModel::setEncoding(const QString &encoding)
{ {
mEncoding = encoding; mEncoding = encoding;
if (encoding == QLatin1String("win1252"))
mCodec = QTextCodec::codecForName("windows-1252");
else if (encoding == QLatin1String("win1251"))
mCodec = QTextCodec::codecForName("windows-1251");
else if (encoding == QLatin1String("win1250"))
mCodec = QTextCodec::codecForName("windows-1250");
else
return; // This should never happen;
} }
int ContentSelectorModel::ContentModel::columnCount(const QModelIndex &parent) const int ContentSelectorModel::ContentModel::columnCount(const QModelIndex &parent) const

@ -81,7 +81,6 @@ namespace ContentSelectorModel
ContentFileList mFiles; ContentFileList mFiles;
QHash<QString, Qt::CheckState> mCheckStates; QHash<QString, Qt::CheckState> mCheckStates;
QSet<QString> mPluginsWithLoadOrderError; QSet<QString> mPluginsWithLoadOrderError;
QTextCodec *mCodec;
QString mEncoding; QString mEncoding;
QIcon mWarningIcon; QIcon mWarningIcon;

@ -11,32 +11,7 @@ set(OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES
audiofactory.hpp audiofactory.hpp
) )
# Find FFMPEG
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
unset(FFMPEG_LIBRARIES CACHE)
find_package(FFmpeg)
if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND )
message(FATAL_ERROR "FFmpeg component required, but not found!")
endif()
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
if( SWRESAMPLE_FOUND )
add_definitions(-DHAVE_LIBSWRESAMPLE)
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES})
else()
if( AVRESAMPLE_FOUND )
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES})
else()
message(FATAL_ERROR "Install either libswresample (FFmpeg) or libavresample (Libav).")
endif()
endif()
include_directories(${FFMPEG_INCLUDE_DIRS})
# Find Boost
set(BOOST_COMPONENTS thread)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
include_directories(${Boost_INCLUDE_DIRS})
add_library(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES}) add_library(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES})
target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${VIDEO_FFMPEG_LIBRARIES} ${Boost_LIBRARIES}) target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${FFMPEG_LIBRARIES} ${Boost_THREAD_LIBRARY})
link_directories(${CMAKE_CURRENT_BINARY_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR})

Loading…
Cancel
Save