Compare commits

...
31 Commits
Author SHA1 Message Date
Chris Bessent f661415c23 Merge pull request #4 from ModOrganizer2/Develop
Stage for release 2.2.2
2020-01-06 05:12:31 -07:00
LostDragonist 027e07ef09 Update version to 1.1.0.0 2019-12-07 01:53:03 -07:00
Al 29b8a77baa Add support for json, log and cfg txt files previews 2019-10-02 23:52:17 +02:00
Al 02c564c53c Add support for ini files and remove support for dds files as preview_dds plugin will handle those from now on. 2019-10-02 23:41:27 +02:00
Jeremy Rimpo e387e6fdb2 Merge pull request #3 from ModOrganizer2/Develop
Stage for release 2.2.1
2019-07-14 18:02:45 -05:00
Silarn da3160e088 Set optimization for release builds 2019-05-22 02:04:30 -05:00
Brian Munro da9ce4a3ba Merge pull request #2 from Modorganizer2/Develop
Stage for 2.1.3 release
2018-05-08 12:33:09 +02:00
Silarn 0188c4b5e9 Updating gitignore 2018-05-04 00:28:44 -05:00
Brian Munro 9934cc4319 Merge pull request #1 from Modorganizer2/Develop
Merge to Master for Release
2018-04-13 08:51:13 +02:00
Jeremy Rimpo df3f5458f2 Remove extraneous search code 2018-04-13 00:38:23 -05:00
Silarn 1f3a5068f8 Prep for Qt 5.11 (backward-compatible) 2018-04-10 23:28:33 -05:00
Silarn 0eb25c6f75 Fix up CMAKE to use /MP and allow building through umbrella 2018-04-07 17:12:22 -05:00
LePresidente bfbfe2c7da Updated cmakelists to get the QT5 location from the QT_ROOT variable, instead of expecting it in DEPENDENCIES_DIR. 2017-09-21 16:47:16 +02:00
Tannin 0a83590936 translation 2016-06-04 19:47:34 +02:00
Tannin 9c29e470cd updated build scripts 2015-11-16 21:39:53 +01:00
Tannin 7a680df548 more work on build system 2015-10-09 19:58:14 +02:00
Tannin c31c70486f fixed build system 2015-09-26 23:59:50 +02:00
Tannin 1d77e869cd updated build system 2015-09-26 12:13:27 +02:00
convert-repo 72a8636f85 update tags 2015-09-07 17:41:42 +00:00
Tannin f77b5daf9d incorrect use of "complete" file suffixes 2015-06-09 20:40:13 +02:00
Tannin 1dc5a32871 Merge 2015-05-09 21:46:40 +02:00
Tannin db0a791155 Merge in changes by Tom Tanner 2015-03-27 18:24:37 +01:00
Tom Tanner 65ce23f906 Fixed Scons build for existing bits.
Changed pynedit.pro to fetch from 'standard' install location
Changed saveas code to use organizer report rather than uibase - this way it's
not dependant on the vagaries of the include path, and works the same as the
rest of the organiser directory
2015-03-20 10:34:30 +00:00
Tom Tanner 4fddc311c5 Merge with branch1.2 2015-03-18 17:40:29 +00:00
Tom Tanner c863a94793 Refactoring and cleanup. 2015-03-18 14:16:04 +00:00
Tom Tanner 77f074f59e Every plugin now built 2015-03-17 16:31:15 +00:00
Tannin b72216ad8c extended the game-plugin interface 2015-01-29 19:26:42 +01:00
Tannin 0a8bcff070 Merge with branch1.2 2015-01-03 15:58:52 +01:00
Tannin b8118074c0 - archive library can now query for password during extraction (seems to be necessary for rars)
- process blacklist is now taken from a file if there is one, not hardcoded
- removed workaround for the papyrus compiler
- updated loot client to work with the actual api
- loot client now links with loot32.dll at runtime
- loot client now produces its output in a (json-)file which includes all plugin messages and dirty flags
- fomod installer now tries to parse the xml with several encodings
- fomod installer will now display a diagnostics warning if the jpg imageformat isn't supported
- base preview plugin now tries to be a bit smarter about resizing images to fit the screen
- bugfix: fomod installer no longer tries to open an image even after detecting its invalid
- bugfix: potential null-pointer dereferentiation in getprivateprofile... hooks
- bugfix: potential null-pointer dereferentiation in download manager
- bugfix: internal origin name showed up in one more place
- bugfix: ToString function produced strings that were one (zero-termination-)character too long
2014-11-05 23:48:06 +01:00
Tannin 344965df52 - re-enabled building of loot_cli and started developing against the new api
- extended set of default categories
- more tolerand bbcode parser
- added a few colors for the bbcode parser
- more fixes to qt5 compatibility
- started work on ability to unloading (and thus re-loading) of plugins
- names of plugins are no longer localizable (because those names are also used to store settings)
- added settings to disable individual diagnosis settings
- path of dependencies is now configured in a .pri file instead of environment variablees
- bugfix: if the modid-input is canceled, the id was saved as -1 and wasn't re-requested from the user
- bugfix: moving files with the SHFileOperation-Api didn't update the vfs correctly (still not perfect but better)
- bugfix: attempt to remove the deleter-file seems to have caused error messages for some users
- bugfix: fixed a couple of cases that might have caused the tutorial to hang
2014-09-08 20:37:23 +02:00
TheBloke ff3b241f6c .pro files - formatting/consistency fixes
Many small formatting changes to the majority of .pro files
 Consistent style for Qt version checking, using greaterThan(QT_MAJOR_VERSION, 4)
  This seems safest, as would continue to work for a future Qt 6 etc.
  Note that this makes redudundant the commit before this one, to organizer.pro
 Consistent indenting
 Moved some file configuration sections to be together with related sections
 Moved some installation-related sections (e.g. OUTDIR/DSTDIR) to be at the bottom,
  immediately before the related POST_LINK install lines.
 Similarly, in some cases separated out CONFIG(debug,.. checks into separate
  LIB/INCLUDE sections (high in file) and installation directory sections (low
   in file)
2014-07-07 23:32:18 +01:00
8 changed files with 129 additions and 24 deletions
+5
View File
@@ -0,0 +1,5 @@
edit
CMakeLists.txt.user
/msbuild.log
/*std*.log
/*build
+14
View File
@@ -0,0 +1,14 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
ADD_COMPILE_OPTIONS($<$<CXX_COMPILER_ID:MSVC>:/MP> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELEASE>:/O2>> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELWITHDEBINFO>:/O2>>)
SET(PROJ_NAME preview_base)
PROJECT(${PROJ_NAME})
SET(DEPENDENCIES_DIR CACHE PATH "")
# hint to find qt in dependencies path
LIST(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
ADD_SUBDIRECTORY(src)
+54
View File
@@ -0,0 +1,54 @@
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11)
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0043 NEW)
FILE(GLOB ${PROJ_NAME}_SRCS *.cpp)
FILE(GLOB ${PROJ_NAME}_HDRS *.h)
FILE(GLOB ${PROJ_NAME}_FORMS *.ui)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
FIND_PACKAGE(Qt5Widgets REQUIRED)
QT5_WRAP_UI(${PROJ_NAME}_UIHDRS ${${PROJ_NAME}_FORMS})
FIND_PACKAGE(Qt5LinguistTools)
QT5_CREATE_TRANSLATION(${PROJ_NAME}_translations_qm ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/${PROJ_NAME}_en.ts)
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_RUNTIME OFF)
FIND_PACKAGE(Boost)
IF (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
ENDIF (Boost_FOUND)
SET(default_project_path "${CMAKE_SOURCE_DIR}/..")
GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH)
SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects")
SET(lib_path "${project_path}/../../install/libs")
INCLUDE_DIRECTORIES(${project_path}/uibase/src)
LINK_DIRECTORIES(${lib_path})
ADD_LIBRARY(${PROJ_NAME} SHARED ${${PROJ_NAME}_HDRS} ${${PROJ_NAME}_SRCS} ${${PROJ_NAME}_UIHDRS} ${${PROJ_NAME}_translations_qm})
TARGET_LINK_LIBRARIES(${PROJ_NAME}
Qt5::Widgets
${Boost_LIBRARIES}
uibase)
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES COMPILE_FLAGS /GL)
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/LTCG /LARGEADDRESSAWARE /OPT:REF /OPT:ICF")
###############
## Installation
INSTALL(TARGETS ${PROJ_NAME}
RUNTIME DESTINATION bin/plugins)
INSTALL(FILES $<TARGET_PDB_FILE:${PROJ_NAME}>
DESTINATION pdb)
+11
View File
@@ -0,0 +1,11 @@
Import('qt_env')
env = qt_env.Clone()
env.AppendUnique(CPPDEFINES = [ 'PREVIEWBASE_LIBRARY' ])
lib = env.SharedLibrary('previewBase', env.Glob('*.cpp'))
env.InstallModule(lib)
res = env['QT_USED_MODULES']
Return('res')
+3 -4
View File
@@ -10,9 +10,7 @@ TEMPLATE = lib
CONFIG += plugins
CONFIG += dll
contains(QT_VERSION, "^5.*") {
QT += widgets
}
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets gui
DEFINES += PREVIEWBASE_LIBRARY
@@ -24,4 +22,5 @@ HEADERS += previewbase.h
include(../plugin_template.pri)
OTHER_FILES += \
previewbase.json
previewbase.json\
SConscript
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>PreviewBase</name>
<message>
<location filename="previewbase.cpp" line="77"/>
<source>Supports previewing various types of data files</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
+30 -8
View File
@@ -25,6 +25,8 @@ along with Base Preview plugin. If not, see <http://www.gnu.org/licenses/>.
#include <QLabel>
#include <QTextEdit>
#include <QtPlugin>
#include <QApplication>
#include <QDesktopWidget>
using namespace MOBase;
@@ -36,11 +38,22 @@ PreviewBase::PreviewBase()
auto imageReader = std::bind(&PreviewBase::genImagePreview, this, std::placeholders::_1, std::placeholders::_2);
foreach (const QByteArray &fileType, QImageReader::supportedImageFormats()) {
m_PreviewGenerators[QString(fileType).toLower()] = imageReader;
auto strFileType = QString(fileType).toLower();
// skip dds as that one is handled by the dds preview plugin.
if (strFileType == "dds")
continue;
m_PreviewGenerators[strFileType] = imageReader;
}
m_PreviewGenerators["txt"]
= std::bind(&PreviewBase::genTxtPreview, this, std::placeholders::_1, std::placeholders::_2);
auto textReader = std::bind(&PreviewBase::genTxtPreview, this, std::placeholders::_1, std::placeholders::_2);
m_PreviewGenerators["txt"] = textReader;
m_PreviewGenerators["ini"] = textReader;
m_PreviewGenerators["json"] = textReader;
m_PreviewGenerators["log"] = textReader;
m_PreviewGenerators["cfg"] = textReader;
}
@@ -51,7 +64,7 @@ bool PreviewBase::init(MOBase::IOrganizer*)
QString PreviewBase::name() const
{
return tr("Preview Base");
return "Preview Base";
}
QString PreviewBase::author() const
@@ -66,7 +79,7 @@ QString PreviewBase::description() const
MOBase::VersionInfo PreviewBase::version() const
{
return VersionInfo(0, 1, 0, VersionInfo::RELEASE_BETA);
return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL);
}
bool PreviewBase::isActive() const
@@ -82,7 +95,7 @@ QList<MOBase::PluginSetting> PreviewBase::settings() const
std::set<QString> PreviewBase::supportedExtensions() const
{
std::set<QString> extensions;
foreach (const auto &generator, m_PreviewGenerators) {
for (const auto &generator : m_PreviewGenerators) {
extensions.insert(generator.first);
}
@@ -91,7 +104,7 @@ std::set<QString> PreviewBase::supportedExtensions() const
QWidget *PreviewBase::genFilePreview(const QString &fileName, const QSize &maxSize) const
{
auto iter = m_PreviewGenerators.find(QFileInfo(fileName).completeSuffix().toLower());
auto iter = m_PreviewGenerators.find(QFileInfo(fileName).suffix().toLower());
if (iter != m_PreviewGenerators.end()) {
return iter->second(fileName, maxSize);
} else {
@@ -102,7 +115,16 @@ QWidget *PreviewBase::genFilePreview(const QString &fileName, const QSize &maxSi
QWidget *PreviewBase::genImagePreview(const QString &fileName, const QSize&) const
{
QLabel *label = new QLabel();
label->setPixmap(QPixmap(fileName));
QPixmap pic = QPixmap(fileName);
QSize screenSize = QApplication::desktop()->screenGeometry().size();
// ensure the output image is no more than 80% of the screen height.
// If the aspect ratio is higher than that of the screen this would still allow the image to extend
// beyond the screen but it ensures you can drag the window and close it
int maxHeight = static_cast<int>(screenSize.height() * 0.8f);
if (pic.size().height() > maxHeight) {
pic = pic.scaledToHeight(maxHeight, Qt::SmoothTransformation);
}
label->setPixmap(pic);
return label;
}
-12
View File
@@ -1,12 +0,0 @@
#ifndef PREVIEWBASE_GLOBAL_H
#define PREVIEWBASE_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(PREVIEWBASE_LIBRARY)
# define PREVIEWBASESHARED_EXPORT Q_DECL_EXPORT
#else
# define PREVIEWBASESHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // PREVIEWBASE_GLOBAL_H