forked from mirror/openmw-tes3mp
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
This commit is contained in:
commit
f70250a296
40 changed files with 215 additions and 180 deletions
|
@ -100,25 +100,29 @@ endif()
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
# Sound setup
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
|
||||
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 )
|
||||
message(FATAL_ERROR "FFmpeg component required, but not found!")
|
||||
endif()
|
||||
set(SOUND_INPUT_INCLUDES ${FFMPEG_INCLUDE_DIRS})
|
||||
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
|
||||
if( SWRESAMPLE_FOUND )
|
||||
add_definitions(-DHAVE_LIBSWRESAMPLE)
|
||||
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES})
|
||||
set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES})
|
||||
else()
|
||||
if( AVRESAMPLE_FOUND )
|
||||
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES})
|
||||
set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES})
|
||||
else()
|
||||
message(FATAL_ERROR "Install either libswresample (FFmpeg) or libavresample (Libav).")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES})
|
||||
|
||||
# TinyXML
|
||||
option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF)
|
||||
if(USE_SYSTEM_TINYXML)
|
||||
|
@ -150,6 +154,20 @@ endif()
|
|||
|
||||
# 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
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package (Threads)
|
||||
|
@ -170,7 +188,7 @@ if (HAVE_UNORDERED_MAP)
|
|||
endif ()
|
||||
|
||||
|
||||
set(BOOST_COMPONENTS system filesystem program_options)
|
||||
set(BOOST_COMPONENTS system filesystem program_options thread)
|
||||
if(WIN32)
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
|
||||
endif(WIN32)
|
||||
|
|
|
@ -9,7 +9,8 @@ add_executable(bsatool
|
|||
)
|
||||
|
||||
target_link_libraries(bsatool
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
components
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ add_executable(esmtool
|
|||
)
|
||||
|
||||
target_link_libraries(esmtool
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
components
|
||||
)
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ add_executable(openmw-essimporter
|
|||
)
|
||||
|
||||
target_link_libraries(openmw-essimporter
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
components
|
||||
)
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ set(LAUNCHER_UI
|
|||
|
||||
source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER})
|
||||
|
||||
find_package(Qt4 REQUIRED)
|
||||
set(QT_USE_QTGUI 1)
|
||||
|
||||
# Set some platform specific settings
|
||||
|
@ -66,12 +65,17 @@ if(WIN32)
|
|||
set(QT_USE_QTMAIN TRUE)
|
||||
endif(WIN32)
|
||||
|
||||
if (DESIRED_QT_VERSION MATCHES 4)
|
||||
include(${QT_USE_FILE})
|
||||
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})
|
||||
if(NOT WIN32)
|
||||
include_directories(${LIBUNSHIELD_INCLUDE_DIR})
|
||||
|
@ -88,15 +92,19 @@ add_executable(openmw-launcher
|
|||
)
|
||||
|
||||
target_link_libraries(openmw-launcher
|
||||
${Boost_LIBRARIES}
|
||||
${SDL2_LIBRARY_ONLY}
|
||||
${QT_LIBRARIES}
|
||||
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)
|
||||
add_definitions (--coverage)
|
||||
target_link_libraries(openmw-launcher gcov)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -54,9 +54,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
QDir::setCurrent(dir.absolutePath());
|
||||
|
||||
// Support non-latin characters
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
Launcher::MainDialog mainWin;
|
||||
|
||||
Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog();
|
||||
|
|
|
@ -14,10 +14,16 @@ add_executable(openmw-iniimporter
|
|||
)
|
||||
|
||||
target_link_libraries(openmw-iniimporter
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
components
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(openmw-iniimporter
|
||||
${Boost_LOCALE_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode")
|
||||
endif()
|
||||
|
|
|
@ -153,19 +153,16 @@ if(WIN32)
|
|||
set(QT_USE_QTMAIN TRUE)
|
||||
endif(WIN32)
|
||||
|
||||
set(BOOST_COMPONENTS system filesystem program_options thread)
|
||||
if(WIN32)
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
|
||||
endif(WIN32)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL REQUIRED)
|
||||
if (DESIRED_QT_VERSION MATCHES 4)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
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})
|
||||
else()
|
||||
qt5_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
|
||||
qt5_wrap_cpp(OPENCS_MOC_SRC ${OPENCS_HDR_QT})
|
||||
qt5_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
|
||||
endif()
|
||||
|
||||
# for compiled .ui files
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -202,11 +199,27 @@ endif(APPLE)
|
|||
|
||||
target_link_libraries(openmw-cs
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
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)
|
||||
INSTALL(TARGETS openmw-cs BUNDLE DESTINATION OpenMW COMPONENT BUNDLE)
|
||||
endif()
|
||||
|
|
|
@ -298,12 +298,12 @@ bool CS::Editor::makeIPCServer()
|
|||
mServer->close();
|
||||
fullPath.remove(QRegExp("dummy$"));
|
||||
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
|
||||
std::cout << "Detected unclean shutdown." << std::endl;
|
||||
// delete the stale file
|
||||
if(remove(fullPath.toStdString().c_str()))
|
||||
if(remove(fullPath.toUtf8().constData()))
|
||||
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))
|
||||
{
|
||||
destination << std::ifstream(customFiltersPath.c_str(), std::ios::binary).rdbuf();
|
||||
destination << std::ifstream(customFiltersPath.string().c_str(), std::ios::binary).rdbuf();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -21,21 +21,17 @@ void CSMWorld::IdTableProxyModel::updateColumnMap()
|
|||
}
|
||||
}
|
||||
|
||||
bool CSMWorld::IdTableProxyModel::filterAcceptsColumn (int sourceColumn, const QModelIndex& sourceParent)
|
||||
const
|
||||
{
|
||||
int flags =
|
||||
sourceModel()->headerData (sourceColumn, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags).toInt();
|
||||
|
||||
if (flags & CSMWorld::ColumnBase::Flag_Table)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CSMWorld::IdTableProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent)
|
||||
const
|
||||
{
|
||||
// It is not possible to use filterAcceptsColumn() and check for
|
||||
// sourceModel()->headerData (sourceColumn, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags)
|
||||
// because the sourceColumn parameter excludes the hidden columns, i.e. wrong columns can
|
||||
// be rejected. Workaround by disallowing tree branches (nested columns), which are not meant
|
||||
// to be visible, from the filter.
|
||||
if (sourceParent.isValid())
|
||||
return false;
|
||||
|
||||
if (!mFilter)
|
||||
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)
|
||||
{
|
||||
beginResetModel();
|
||||
mFilter = filter;
|
||||
updateColumnMap();
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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));
|
||||
|
||||
if (iter!=mColours.end())
|
||||
return QBrush (
|
||||
QColor (iter->second>>24, (iter->second>>16) & 255, (iter->second>>8) & 255,
|
||||
iter->second & 255));
|
||||
return QBrush (QColor (iter->second & 0xff,
|
||||
(iter->second >> 8) & 0xff,
|
||||
(iter->second >> 16) & 0xff));
|
||||
|
||||
if (cell->second.mRegion.empty())
|
||||
return QBrush (Qt::Dense6Pattern); // no region
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <QMenuBar>
|
||||
#include <QMdiArea>
|
||||
#include <QDockWidget>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScrollArea>
|
||||
#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.
|
||||
// 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);
|
||||
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);
|
||||
|
@ -614,6 +612,17 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
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()
|
||||
{
|
||||
mViewManager.addView (mDocument);
|
||||
|
|
|
@ -233,6 +233,8 @@ namespace CSVDoc
|
|||
void stop();
|
||||
|
||||
void closeRequest (SubView *subView);
|
||||
|
||||
void moveScrollBarToEnd(int min, int max);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "../../model/doc/documentmanager.hpp"
|
||||
#include "../../model/doc/document.hpp"
|
||||
|
@ -24,10 +26,6 @@
|
|||
|
||||
#include "view.hpp"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
void CSVDoc::ViewManager::updateIndices()
|
||||
{
|
||||
std::map<CSMDoc::Document *, std::pair<int, int> > documents;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <osgGA/TrackballManipulator>
|
||||
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QEvent>
|
||||
|
||||
#include <components/sceneutil/util.hpp>
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QEvent>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDragMoveEvent>
|
||||
#include <QDropEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgGA/FirstPersonManipulator>
|
||||
|
|
|
@ -8,19 +8,12 @@
|
|||
#include <QStackedWidget>
|
||||
#include <QtGui>
|
||||
#include <QSplitter>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include "../../model/settings/usersettings.hpp"
|
||||
|
||||
#include "page.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include <QTreeView>
|
||||
#include <QListView>
|
||||
#include <QTableView>
|
||||
|
||||
#include <QStandardItemModel>
|
||||
#include <QStandardItem>
|
||||
|
||||
CSVSettings::Dialog::Dialog(QMainWindow *parent)
|
||||
: SettingWindow (parent), mStackedWidget (0), mDebugMode (false)
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "settingwindow.hpp"
|
||||
#include "resizeablestackedwidget.hpp"
|
||||
#include <QStandardItem>
|
||||
|
||||
class QStackedWidget;
|
||||
class QListWidget;
|
||||
|
@ -26,10 +25,6 @@ namespace CSVSettings {
|
|||
|
||||
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:
|
||||
|
||||
/// Settings are written on close
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <QStyledItemDelegate>
|
||||
#include <QTextDocument>
|
||||
#include <QPainter>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "../../model/tools/reportmodel.hpp"
|
||||
|
||||
|
@ -121,7 +123,11 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
|
|||
const CSMWorld::UniversalId& id, bool richTextDescription, QWidget *parent)
|
||||
: 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);
|
||||
#endif
|
||||
horizontalHeader()->setStretchLastSection (true);
|
||||
verticalHeader()->hide();
|
||||
setSortingEnabled (true);
|
||||
|
|
|
@ -65,8 +65,13 @@ CSVWidget::SceneToolRun::SceneToolRun (SceneToolbar *parent, const QString& tool
|
|||
mTable->setShowGrid (false);
|
||||
mTable->verticalHeader()->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 (1, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
mTable->setSelectionMode (QAbstractItemView::NoSelection);
|
||||
|
||||
layout->addWidget (mTable);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <QDrag>
|
||||
#include <QDragEnterEvent>
|
||||
|
||||
#include "../../model/world/tablemimedata.hpp"
|
||||
#include "dragrecordtable.hpp"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define CSV_WORLD_DRAGRECORDTABLE_H
|
||||
|
||||
#include <QTableView>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QEvent>
|
||||
|
||||
class QWidget;
|
||||
class QAction;
|
||||
|
|
|
@ -23,7 +23,11 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
|
|||
setSelectionBehavior (QAbstractItemView::SelectRows);
|
||||
setSelectionMode (QAbstractItemView::ExtendedSelection);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
|
||||
#else
|
||||
horizontalHeader()->setResizeMode (QHeaderView::Interactive);
|
||||
#endif
|
||||
verticalHeader()->hide();
|
||||
|
||||
int columns = model->columnCount(QModelIndex());
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define CSV_WORLD_NESTEDTABLE_H
|
||||
|
||||
#include <QTableView>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QEvent>
|
||||
|
||||
class QUndoStack;
|
||||
class QAction;
|
||||
|
|
|
@ -282,7 +282,11 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
|||
mDispatcher = new CSMWorld::CommandDispatcher (document, id, this);
|
||||
|
||||
setModel (mProxyModel);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
|
||||
#else
|
||||
horizontalHeader()->setResizeMode (QHeaderView::Interactive);
|
||||
#endif
|
||||
verticalHeader()->hide();
|
||||
setSortingEnabled (sorting);
|
||||
setSelectionBehavior (QAbstractItemView::SelectRows);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QEvent>
|
||||
|
||||
#include "../../model/filter/node.hpp"
|
||||
#include "../../model/world/columnbase.hpp"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <QHeaderView>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDropEvent>
|
||||
|
||||
#include "../../model/doc/document.hpp"
|
||||
#include "../../model/world/tablemimedata.hpp"
|
||||
|
|
|
@ -95,17 +95,6 @@ add_openmw_dir (mwbase
|
|||
)
|
||||
|
||||
# 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)
|
||||
add_executable(openmw
|
||||
|
@ -127,7 +116,10 @@ include_directories(${SOUND_INPUT_INCLUDES})
|
|||
|
||||
target_link_libraries(openmw
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${OPENAL_LIBRARY}
|
||||
${SOUND_INPUT_LIBRARY}
|
||||
${BULLET_LIBRARIES}
|
||||
|
|
|
@ -295,9 +295,12 @@ namespace MWGui
|
|||
mCurrent = mCommandHistory.end();
|
||||
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("");
|
||||
|
||||
execute (cm);
|
||||
}
|
||||
|
||||
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})
|
||||
|
||||
find_package(Qt4 REQUIRED)
|
||||
set(QT_USE_QTGUI 1)
|
||||
|
||||
# Set some platform specific settings
|
||||
|
@ -90,12 +89,17 @@ if(WIN32)
|
|||
set(QT_USE_QTMAIN TRUE)
|
||||
endif(WIN32)
|
||||
|
||||
if (DESIRED_QT_VERSION MATCHES 4)
|
||||
include(${QT_USE_FILE})
|
||||
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})
|
||||
|
||||
if (OPENMW_USE_UNSHIELD)
|
||||
|
@ -112,11 +116,17 @@ add_executable(openmw-wizard
|
|||
)
|
||||
|
||||
target_link_libraries(openmw-wizard
|
||||
${Boost_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
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)
|
||||
target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARY})
|
||||
endif()
|
||||
|
|
|
@ -38,9 +38,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
QDir::setCurrent(dir.absolutePath());
|
||||
|
||||
// Support non-latin characters
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
Wizard::MainWizard wizard;
|
||||
|
||||
wizard.show();
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <QWriteLocker>
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QFileInfoListIterator>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
#include <QTextCodec>
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace Wizard
|
|||
class UnshieldWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(Wizard::Component)
|
||||
|
||||
public:
|
||||
UnshieldWorker(QObject *parent = 0);
|
||||
|
|
|
@ -135,12 +135,6 @@ add_component_dir (version
|
|||
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
|
||||
)
|
||||
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui)
|
||||
if(MINGW)
|
||||
find_package(Bullet REQUIRED COMPONENTS Collision)
|
||||
endif()
|
||||
|
||||
if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY)
|
||||
add_component_qt_dir (contentselector
|
||||
model/modelitem model/esmfile
|
||||
model/naturalsort model/contentmodel
|
||||
|
@ -157,10 +151,14 @@ if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY)
|
|||
processinvoker
|
||||
)
|
||||
|
||||
if (DESIRED_QT_VERSION MATCHES 4)
|
||||
include(${QT_USE_FILE})
|
||||
QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI})
|
||||
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_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})
|
||||
|
||||
target_link_libraries(components
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${BULLET_LIBRARIES}
|
||||
${SDL2_LIBRARY}
|
||||
|
@ -181,14 +182,23 @@ target_link_libraries(components
|
|||
${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)
|
||||
add_dependencies (components git-version)
|
||||
endif (GIT_CHECKOUT)
|
||||
|
||||
if(MINGW)
|
||||
target_link_libraries(components ${QT_LIBRARIES} ${BULLET_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(components shlwapi)
|
||||
endif()
|
||||
|
|
|
@ -291,9 +291,9 @@ bool Config::GameSettings::writeFileWithComments(QFile &file)
|
|||
stream << key << "=" << value << "\n";
|
||||
}
|
||||
|
||||
// new entries
|
||||
if (!userSettingsCopy.empty())
|
||||
{
|
||||
stream << "# new entries" << "\n";
|
||||
QMap<QString, QString>::const_iterator it = userSettingsCopy.begin();
|
||||
for (; it != userSettingsCopy.end(); ++it)
|
||||
{
|
||||
|
|
|
@ -30,17 +30,6 @@ ContentSelectorModel::ContentModel::~ContentModel()
|
|||
void ContentSelectorModel::ContentModel::setEncoding(const QString &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
|
||||
|
|
|
@ -81,7 +81,6 @@ namespace ContentSelectorModel
|
|||
ContentFileList mFiles;
|
||||
QHash<QString, Qt::CheckState> mCheckStates;
|
||||
QSet<QString> mPluginsWithLoadOrderError;
|
||||
QTextCodec *mCodec;
|
||||
QString mEncoding;
|
||||
QIcon mWarningIcon;
|
||||
|
||||
|
|
27
extern/osg-ffmpeg-videoplayer/CMakeLists.txt
vendored
27
extern/osg-ffmpeg-videoplayer/CMakeLists.txt
vendored
|
@ -11,32 +11,7 @@ set(OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES
|
|||
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})
|
||||
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})
|
||||
|
|
Loading…
Reference in a new issue