mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -07:00
Merge remote-tracking branch 'upstream/master' into translation
This commit is contained in:
commit
66aba2eec7
12 changed files with 101 additions and 262 deletions
|
|
@ -263,15 +263,16 @@ if(APPLE)
|
|||
set(qtconf_dest_dir cockatrice.app/Contents/Resources)
|
||||
|
||||
# note: no codecs in qt5
|
||||
# note: phonon_backend => mediaservice
|
||||
# note: phonon_backend => audio | mediaservice
|
||||
# note: needs platform on osx
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
|
||||
else()
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib")
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*\\.dylib"
|
||||
REGEX ".*_debug\\.dylib" EXCLUDE)
|
||||
endif()
|
||||
|
||||
install(CODE "
|
||||
|
|
@ -296,15 +297,15 @@ if(WIN32)
|
|||
set(qtconf_dest_dir .)
|
||||
|
||||
# note: no codecs in qt5
|
||||
# note: phonon_backend => mediaservice
|
||||
# note: phonon_backend => audio | mediaservice
|
||||
# note: needs platform on osx
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*d\\.dll")
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*d\\.dll")
|
||||
else()
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*[^d]\\.dll")
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*[^d]\\.dll")
|
||||
endif()
|
||||
|
||||
install(CODE "
|
||||
|
|
@ -321,4 +322,8 @@ Data = Resources\")
|
|||
include(BundleUtilities)
|
||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
||||
" COMPONENT Runtime)
|
||||
|
||||
if(WIN32SSLRUNTIME_FOUND)
|
||||
install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION ./)
|
||||
endif()
|
||||
endif()
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 143 KiB |
|
|
@ -4,6 +4,9 @@
|
|||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QDebug>
|
||||
|
||||
static const float CARD_WIDTH_HALF = CARD_WIDTH / 2;
|
||||
static const float CARD_HEIGHT_HALF = CARD_HEIGHT / 2;
|
||||
|
||||
AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag)
|
||||
: QGraphicsItem(), item(_item), hotSpot(_hotSpot)
|
||||
{
|
||||
|
|
@ -22,7 +25,7 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPoint
|
|||
setZValue(2000000007);
|
||||
}
|
||||
if (item->getTapped())
|
||||
setTransform(QTransform().translate((float) CARD_WIDTH / 2, (float) CARD_HEIGHT / 2).rotate(90).translate((float) -CARD_WIDTH / 2, (float) -CARD_HEIGHT / 2));
|
||||
setTransform(QTransform().translate(CARD_WIDTH_HALF, CARD_HEIGHT_HALF).rotate(90).translate(-CARD_WIDTH_HALF, -CARD_HEIGHT_HALF));
|
||||
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,14 +263,14 @@ void PictureLoader::picDownloadFinished(QNetworkReply *reply)
|
|||
|
||||
const QByteArray &picData = reply->peek(reply->size()); //peek is used to keep the data in the buffer for use by QImageReader
|
||||
QImage testImage;
|
||||
|
||||
|
||||
QImageReader imgReader;
|
||||
imgReader.setDecideFormatFromContent(true);
|
||||
imgReader.setDevice(reply);
|
||||
QString extension = "." + imgReader.format(); //the format is determined prior to reading the QImageReader data into a QImage object, as that wipes the QImageReader buffer
|
||||
if (extension == ".jpeg")
|
||||
extension = ".jpg";
|
||||
|
||||
|
||||
if (imgReader.read(&testImage)) {
|
||||
QString setName = cardBeingDownloaded.getSetName();
|
||||
if(!setName.isEmpty())
|
||||
|
|
@ -493,7 +493,7 @@ void CardInfo::updatePixmapCache()
|
|||
qDebug() << "Updating pixmap cache for" << name;
|
||||
clearPixmapCache();
|
||||
loadPixmap();
|
||||
|
||||
|
||||
emit pixmapUpdated();
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +605,7 @@ CardDatabase::~CardDatabase()
|
|||
{
|
||||
clear();
|
||||
delete noCard;
|
||||
|
||||
|
||||
pictureLoader->deleteLater();
|
||||
pictureLoaderThread->wait();
|
||||
delete pictureLoaderThread;
|
||||
|
|
@ -619,7 +619,7 @@ void CardDatabase::clear()
|
|||
delete setIt.value();
|
||||
}
|
||||
sets.clear();
|
||||
|
||||
|
||||
QHashIterator<QString, CardInfo *> i(cards);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
|
|
@ -770,30 +770,11 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml, bool tokens)
|
|||
}
|
||||
}
|
||||
|
||||
CardInfo *CardNameMap::findByPrefix(const std::string &prefix) {
|
||||
int count = 0;
|
||||
CardInfo *found;
|
||||
|
||||
for (CardNameMap::iterator it = this->begin(); it != this->end(); ++it) {
|
||||
if (std::mismatch(prefix.begin(), prefix.end(),
|
||||
it.key().toStdString().begin()).first == prefix.end()) {
|
||||
count++;
|
||||
found = it.value();
|
||||
}
|
||||
}
|
||||
|
||||
return (count == 1 ? found : NULL);
|
||||
}
|
||||
|
||||
CardInfo *CardDatabase::getCardFromMap(CardNameMap &cardMap, const QString &cardName, bool createIfNotFound) {
|
||||
CardInfo *foundCard;
|
||||
|
||||
if (cardName.isEmpty())
|
||||
return noCard;
|
||||
else if (cardMap.contains(cardName))
|
||||
return cardMap.value(cardName);
|
||||
else if ((foundCard = cardMap.findByPrefix(cardName.toStdString())))
|
||||
return foundCard;
|
||||
else if (createIfNotFound) {
|
||||
CardInfo *newCard = new CardInfo(this, cardName, true);
|
||||
newCard->addToSet(getSet("TK"));
|
||||
|
|
|
|||
|
|
@ -180,13 +180,7 @@ signals:
|
|||
|
||||
enum LoadStatus { Ok, VersionTooOld, Invalid, NotLoaded, FileError, NoCards };
|
||||
|
||||
|
||||
class CardNameMap: public QHash<QString, CardInfo *>
|
||||
{
|
||||
public:
|
||||
CardInfo *findByPrefix(const std::string &prefix);
|
||||
};
|
||||
|
||||
typedef QHash<QString, CardInfo *> CardNameMap;
|
||||
typedef QHash<QString, CardSet *> SetNameMap;
|
||||
|
||||
class CardDatabase : public QObject {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "main.h"
|
||||
#include "settingscache.h"
|
||||
#include "priceupdater.h"
|
||||
#include "soundengine.h"
|
||||
|
||||
GeneralSettingsPage::GeneralSettingsPage()
|
||||
{
|
||||
|
|
@ -503,6 +504,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked()));
|
||||
QPushButton *soundPathButton = new QPushButton("...");
|
||||
connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked()));
|
||||
soundTestButton = new QPushButton();
|
||||
connect(soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(cuckoo()));
|
||||
|
||||
QGridLayout *soundGrid = new QGridLayout;
|
||||
soundGrid->addWidget(soundEnabledCheckBox, 0, 0, 1, 4);
|
||||
|
|
@ -510,6 +513,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
soundGrid->addWidget(soundPathEdit, 1, 1);
|
||||
soundGrid->addWidget(soundPathClearButton, 1, 2);
|
||||
soundGrid->addWidget(soundPathButton, 1, 3);
|
||||
soundGrid->addWidget(soundTestButton, 2, 1);
|
||||
|
||||
soundGroupBox = new QGroupBox;
|
||||
soundGroupBox->setLayout(soundGrid);
|
||||
|
|
@ -538,6 +542,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
tapAnimationCheckBox->setText(tr("&Tap/untap animation"));
|
||||
soundEnabledCheckBox->setText(tr("Enable &sounds"));
|
||||
soundPathLabel->setText(tr("Path to sounds directory:"));
|
||||
soundTestButton->setText(tr("Test system sound engine"));
|
||||
}
|
||||
|
||||
void UserInterfaceSettingsPage::soundPathClearButtonClicked()
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ private:
|
|||
QLabel *soundPathLabel;
|
||||
QLineEdit *soundPathEdit;
|
||||
QGroupBox *generalGroupBox, *animationGroupBox, *soundGroupBox;
|
||||
QPushButton *soundTestButton;
|
||||
public:
|
||||
UserInterfaceSettingsPage();
|
||||
void retranslateUi();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue