From 466f5ae5e1ecf637e691a2a0f36a4ef66ee25c68 Mon Sep 17 00:00:00 2001 From: Mawu3n4 Date: Wed, 10 Sep 2014 20:48:40 +0200 Subject: [PATCH 01/15] add: FR translations and fix bad grammar --- cockatrice/translations/cockatrice_fr.ts | 91 ++++++++++-------------- 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index 6d205092..1b11b172 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -43,48 +43,23 @@ Path to hand background: - Chemin pour les images de fond de main: + Chemin vers l'image de fond de la zone de main: Path to stack background: - Chemin pour les images de fond de pile: + Chemin pour l'image de fond de la pile: Path to table background: - Chemin pour les images d'arrière-plan: + Chemin vers l'image de fond de la zone de jeu: Path to player info background: - Chemin pour les images de fond d'affichage d'informations: + Chemin vers l'image de fond d'affichage d'informations: Path to picture of card back: - Chemin pour les images de dos des cartes: - - - - Hand background: - - - - - Stack background: - - - - - Table background: - - - - - Player info background: - - - - - Card back: - + Chemin vers l'image de dos des cartes: @@ -104,7 +79,7 @@ Display hand horizontally (wastes space) - Montrer la main horizontalement + Afficher la main horizontalement (perte d'espace) @@ -124,7 +99,7 @@ Zone view layout - Voir disposition de la zone + Disposition de la zone d'aperçu @@ -151,60 +126,60 @@ Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Entrez la durée de temps du ban (en minutes). -Entrez 0 pour une durée illimitée du ban. + Entrez la durée de temps de blocage (en minutes). +Entrez 0 pour un blocage permanent. ban &user name - + bloquer &nom d'utilisateur ban &IP address - + bloquer &adresse IP Ban type - + Type du blocage &permanent ban - + &blocage permanent &temporary ban - + &blocage temporaire &Days: - + &Jours: &Hours: - + &Heures: &Minutes: - + &Minutes: Duration of the ban - + Durée du blocage Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. - Veuillez expliquer la raison du ban. -Cette information ne sera consultable que par les modérateurs. + Veuillez expliquer la raison du blocage. +Cette information sera consultable uniquement par les modérateurs. @@ -229,12 +204,12 @@ Cette information ne sera consultable que par les modérateurs. Error - Erreur + Érreur You have to select a name-based or IP-based ban, or both. - + Vous devez choisir un blocage à partir du nom ou de l'IP, ou des deux. @@ -369,6 +344,12 @@ Cette information ne sera consultable que par les modérateurs. &Clone &Copier une carte + &Copier une carte + + + + Ctrl+H + Ctrl+H &Attach to card... @@ -384,16 +365,16 @@ Cette information ne sera consultable que par les modérateurs. Set &P/T... - Fixer &F/E... + Définir &F/E... &Draw arrow... &Tracer une flèche... - - &Power / toughness - F&orce / Endurance + + &Power / Toughness + &Force / Endurance &Increase power @@ -445,7 +426,7 @@ Cette information ne sera consultable que par les modérateurs. Set &power and toughness... - Fi&xer la force et l'endurance... + Dé&finir la force et l'endurance... Ctrl+P @@ -477,7 +458,7 @@ Cette information ne sera consultable que par les modérateurs. &Set counters (%1)... - &Fixer marqueurs (%1)... + &Définir marqueurs (%1)... &top of library @@ -497,7 +478,7 @@ Cette information ne sera consultable que par les modérateurs. &exile - &exiler + &exile @@ -2225,7 +2206,7 @@ Would you like to change your database location setting? Italian: - + Italien: From 54e3867c72c3d8bde254ac4091c1fdb612c4ae69 Mon Sep 17 00:00:00 2001 From: Mawu3n4 Date: Thu, 11 Sep 2014 09:59:49 +0200 Subject: [PATCH 02/15] finish fr translation --- cockatrice/translations/cockatrice_fr.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index 1b11b172..555921ba 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -5690,6 +5690,12 @@ Entrez 0 pour une durée illimitée du ban. &Commentaires: + + Hash: + Empreinte: + + + &Update prices Mettre à &jour les prix From 8928a699f99aad254c79d71404b66803f8119e92 Mon Sep 17 00:00:00 2001 From: Zack Dibe Date: Thu, 11 Sep 2014 23:44:52 +0200 Subject: [PATCH 03/15] fix: grammar in french translation --- cockatrice/translations/cockatrice_fr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index 555921ba..3c68cd30 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -47,7 +47,7 @@ Path to stack background: - Chemin pour l'image de fond de la pile: + Chemin vers l'image de fond de la pile: Path to table background: From 2c74524f594e6e67b80a24f9b2fb075c136f9720 Mon Sep 17 00:00:00 2001 From: Zack Date: Sun, 12 Oct 2014 16:43:35 +0200 Subject: [PATCH 04/15] fix: missing message closing tag --- cockatrice/translations/cockatrice_fr.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index 68c590f0..31aa65da 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -60,6 +60,7 @@ Path to picture of card back: Chemin vers l'image de dos des cartes: + Hand background: From 8ca0b96d1093c20750875cb21228853667759acb Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 8 Nov 2014 15:08:49 +0100 Subject: [PATCH 05/15] Rework the picture download behavior Should fix #412 --- cockatrice/src/carddatabase.cpp | 107 +++++++++++++++++--------------- cockatrice/src/carddatabase.h | 6 +- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/cockatrice/src/carddatabase.cpp b/cockatrice/src/carddatabase.cpp index cdacf008..f0704a40 100644 --- a/cockatrice/src/carddatabase.cpp +++ b/cockatrice/src/carddatabase.cpp @@ -101,6 +101,14 @@ QString PictureToLoad::getSetName() const return QString(""); } +CardSet *PictureToLoad::getCurrentSet() const +{ + if (setIndex < sortedSets.size()) + return sortedSets[setIndex]; + else + return 0; +} + PictureLoader::PictureLoader(const QString &__picsPath, bool _picDownload, bool _picDownloadHq, QObject *parent) : QObject(parent), _picsPath(__picsPath), picDownload(_picDownload), picDownloadHq(_picDownloadHq), @@ -134,15 +142,17 @@ void PictureLoader::processLoadQueue() PictureToLoad ptl = loadQueue.takeFirst(); mutex.unlock(); - //The list of paths to the folders in which to search for images - QList picsPaths = QList() << _picsPath + "/CUSTOM/" + ptl.getCard()->getCorrectedName(); - - QString setName=ptl.getSetName(); + QString correctedCardname=ptl.getCard()->getCorrectedName(); + qDebug() << "Trying to load picture (set: " << setName << " card: " << correctedCardname << ")"; + + //The list of paths to the folders in which to search for images + QList picsPaths = QList() << _picsPath + "/CUSTOM/" + correctedCardname; + if(!setName.isEmpty()) { - picsPaths << _picsPath + "/" + setName + "/" + ptl.getCard()->getCorrectedName() - << _picsPath + "/downloadedPics/" + setName + "/" + ptl.getCard()->getCorrectedName(); + picsPaths << _picsPath + "/" + setName + "/" + correctedCardname + << _picsPath + "/downloadedPics/" + setName + "/" + correctedCardname; } QImage image; @@ -154,12 +164,14 @@ void PictureLoader::processLoadQueue() for (int i = 0; i < picsPaths.length() && !found; i ++) { imgReader.setFileName(picsPaths.at(i)); if (imgReader.read(&image)) { + qDebug() << "Picture found on disk (set: " << setName << " card: " << correctedCardname << ")"; emit imageLoaded(ptl.getCard(), image); found = true; break; } imgReader.setFileName(picsPaths.at(i) + ".full"); if (imgReader.read(&image)) { + qDebug() << "Picture.full found on disk (set: " << setName << " card: " << correctedCardname << ")"; emit imageLoaded(ptl.getCard(), image); found = true; } @@ -167,24 +179,32 @@ void PictureLoader::processLoadQueue() if (!found) { if (picDownload) { + qDebug() << "Picture NOT found, trying to download (set: " << setName << " card: " << correctedCardname << ")"; cardsToDownload.append(ptl); if (!downloadRunning) startNextPicDownload(); } else { if (ptl.nextSet()) + { + qDebug() << "Picture NOT found and download disabled, moving to next set (newset: " << setName << " card: " << correctedCardname << ")"; + mutex.lock(); loadQueue.prepend(ptl); - else + mutex.unlock(); + } else { + qDebug() << "Picture NOT found, download disabled, no more sets to try: BAILING OUT (oldset: " << setName << " card: " << correctedCardname << ")"; emit imageLoaded(ptl.getCard(), QImage()); + } } } } } -QString PictureLoader::getPicUrl(CardInfo *card) +QString PictureLoader::getPicUrl() { if (!picDownload) return QString(""); - CardSet *set = card->getPreferredSet(); + CardInfo *card = cardBeingDownloaded.getCard(); + CardSet *set=cardBeingDownloaded.getCurrentSet(); QString picUrl = QString(""); // if sets have been defined for the card, they can contain custom picUrls @@ -211,10 +231,10 @@ QString PictureLoader::getPicUrl(CardInfo *card) if (set) { picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName())); picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName())); + int muid = card->getMuId(set->getShortName()); + if (muid) + picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid))); } - int muid = card->getPreferredMuId(); - if (muid) - picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid))); if (picUrl.contains("!name!") || picUrl.contains("!setcode!") || @@ -239,19 +259,33 @@ void PictureLoader::startNextPicDownload() cardBeingDownloaded = cardsToDownload.takeFirst(); - QString picUrl = getPicUrl(cardBeingDownloaded.getCard()); + QString picUrl = getPicUrl(); if (picUrl.isEmpty()) { - qDebug() << "No url for" << cardBeingDownloaded.getCard()->getName(); - cardBeingDownloaded = 0; downloadRunning = false; - return; + picDownloadFailed(); + } else { + QUrl url(picUrl); + + QNetworkRequest req(url); + qDebug() << "starting picture download:" << cardBeingDownloaded.getCard()->getName() << "Url:" << req.url(); + networkManager->get(req); } +} - QUrl url(picUrl); - - QNetworkRequest req(url); - qDebug() << "starting picture download:" << cardBeingDownloaded.getCard()->getName() << "Url:" << req.url(); - networkManager->get(req); +void PictureLoader::picDownloadFailed() +{ + if (cardBeingDownloaded.nextSet()) + { + qDebug() << "Picture NOT found, download failed, moving to next set (newset: " << cardBeingDownloaded.getSetName() << " card: " << cardBeingDownloaded.getCard()->getCorrectedName() << ")"; + mutex.lock(); + loadQueue.prepend(cardBeingDownloaded); + mutex.unlock(); + emit startLoadQueue(); + } else { + qDebug() << "Picture NOT found, download failed, no more sets to try: BAILING OUT (oldset: " << cardBeingDownloaded.getSetName() << " card: " << cardBeingDownloaded.getCard()->getCorrectedName() << ")"; + cardBeingDownloaded = 0; + emit imageLoaded(cardBeingDownloaded.getCard(), QImage()); + } } void PictureLoader::picDownloadFinished(QNetworkReply *reply) @@ -288,21 +322,9 @@ void PictureLoader::picDownloadFinished(QNetworkReply *reply) } emit imageLoaded(cardBeingDownloaded.getCard(), testImage); - } else if (cardBeingDownloaded.getHq()) { - qDebug() << "HQ: received invalid picture. URL:" << reply->request().url(); - cardBeingDownloaded.setHq(false); - cardsToDownload.prepend(cardBeingDownloaded); } else { - qDebug() << "LQ: received invalid picture. URL:" << reply->request().url(); - if (cardBeingDownloaded.nextSet()) { - cardBeingDownloaded.setHq(true); - mutex.lock(); - loadQueue.prepend(cardBeingDownloaded); - mutex.unlock(); - emit startLoadQueue(); - } else - emit imageLoaded(cardBeingDownloaded.getCard(), QImage()); - } + picDownloadFailed(); + } reply->deleteLater(); startNextPicDownload(); @@ -497,21 +519,6 @@ void CardInfo::updatePixmapCache() emit pixmapUpdated(); } -CardSet* CardInfo::getPreferredSet() -{ - if(sets.isEmpty()) - return 0; - SetList sortedSets = sets; - sortedSets.sortByKey(); - return sortedSets.first(); -} - -int CardInfo::getPreferredMuId() -{ - CardSet *set = getPreferredSet(); - return set ? muIds[set->getShortName()] : 0; -} - QString CardInfo::simplifyName(const QString &name) { QString simpleName(name); diff --git a/cockatrice/src/carddatabase.h b/cockatrice/src/carddatabase.h index cbb25f3e..af5a16f1 100644 --- a/cockatrice/src/carddatabase.h +++ b/cockatrice/src/carddatabase.h @@ -53,6 +53,7 @@ private: public: PictureToLoad(CardInfo *_card = 0, bool _hq = true); CardInfo *getCard() const { return card; } + CardSet *getCurrentSet() const; QString getSetName() const; bool nextSet(); bool getHq() const { return hq; } @@ -70,7 +71,7 @@ private: PictureToLoad cardBeingDownloaded; bool picDownload, picDownloadHq, downloadRunning, loadQueueRunning; void startNextPicDownload(); - QString getPicUrl(CardInfo* card); + QString getPicUrl(); public: PictureLoader(const QString &__picsPath, bool _picDownload, bool _picDownloadHq, QObject *parent = 0); ~PictureLoader(); @@ -80,6 +81,7 @@ public: void loadImage(CardInfo *card); private slots: void picDownloadFinished(QNetworkReply *reply); + void picDownloadFailed(); public slots: void processLoadQueue(); signals: @@ -163,8 +165,6 @@ public: void clearPixmapCache(); void clearPixmapCacheMiss(); void imageLoaded(const QImage &image); - CardSet *getPreferredSet(); - int getPreferredMuId(); /** * Simplify a name to have no punctuation and lowercase all letters, for From 4b8ac99370b0a2680132c1ebfbd39a99dabeb3c4 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 8 Nov 2014 15:52:04 +0100 Subject: [PATCH 06/15] Corrected spacing --- cockatrice/src/carddatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/carddatabase.cpp b/cockatrice/src/carddatabase.cpp index f0704a40..25886d18 100644 --- a/cockatrice/src/carddatabase.cpp +++ b/cockatrice/src/carddatabase.cpp @@ -142,8 +142,8 @@ void PictureLoader::processLoadQueue() PictureToLoad ptl = loadQueue.takeFirst(); mutex.unlock(); - QString setName=ptl.getSetName(); - QString correctedCardname=ptl.getCard()->getCorrectedName(); + QString setName = ptl.getSetName(); + QString correctedCardname = ptl.getCard()->getCorrectedName(); qDebug() << "Trying to load picture (set: " << setName << " card: " << correctedCardname << ")"; //The list of paths to the folders in which to search for images From 0589f02ca27803eb95107ef7c052facb0d243ed0 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Sun, 9 Nov 2014 11:23:45 +0100 Subject: [PATCH 07/15] Partial Card Name Search + Card searches now do partial string matches, rather than needing to match the beginning of the string. --- cockatrice/src/tab_deck_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/tab_deck_editor.cpp b/cockatrice/src/tab_deck_editor.cpp index 82a356d1..c68b562b 100644 --- a/cockatrice/src/tab_deck_editor.cpp +++ b/cockatrice/src/tab_deck_editor.cpp @@ -365,7 +365,7 @@ void TabDeckEditor::updateCardInfoRight(const QModelIndex ¤t, const QModel void TabDeckEditor::updateSearch(const QString &search) { - databaseDisplayModel->setCardNameBeginning(search); + databaseDisplayModel->setCardName(search); QModelIndexList sel = databaseView->selectionModel()->selectedRows(); if (sel.isEmpty() && databaseDisplayModel->rowCount()) databaseView->selectionModel()->setCurrentIndex(databaseDisplayModel->index(0, 0), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); From a716d73a42e61329eb8e61386f6e276b077fc0bf Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 9 Nov 2014 21:03:10 +0100 Subject: [PATCH 08/15] OSX: Add proper infos to info.plist fixes #411 --- cockatrice/CMakeLists.txt | 7 +++++++ oracle/CMakeLists.txt | 7 +++++++ servatrice/CMakeLists.txt | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index af031ab0..50f02357 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -242,6 +242,13 @@ endif() if(UNIX) if(APPLE) + set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) + set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) + set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}) + INSTALL(TARGETS cockatrice BUNDLE DESTINATION ./) INSTALL(FILES ${cockatrice_QM} DESTINATION ./cockatrice.app/Contents/Resources/translations) else() diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index c14b0cf6..3ec383f5 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -111,6 +111,13 @@ endif() if(UNIX) if(APPLE) + set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) + set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) + set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}) + INSTALL(TARGETS oracle BUNDLE DESTINATION ./) else() # Assume linux diff --git a/servatrice/CMakeLists.txt b/servatrice/CMakeLists.txt index 83fc7900..383cd303 100644 --- a/servatrice/CMakeLists.txt +++ b/servatrice/CMakeLists.txt @@ -108,6 +108,13 @@ endif() # install rules if(UNIX) if(APPLE) + set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) + set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) + set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}) + INSTALL(TARGETS servatrice BUNDLE DESTINATION ./) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/) From cb055055a9afcb9bd71cde379cf005bbdd1f1713 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 9 Nov 2014 21:15:31 +0100 Subject: [PATCH 09/15] Oracle: add button to restore default download url Should avoid the problem explained in #414 --- oracle/src/oraclewizard.cpp | 19 ++++++++++++++----- oracle/src/oraclewizard.h | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/oracle/src/oraclewizard.cpp b/oracle/src/oraclewizard.cpp index 79ad5414..b9a13eee 100644 --- a/oracle/src/oraclewizard.cpp +++ b/oracle/src/oraclewizard.cpp @@ -103,17 +103,21 @@ LoadSetsPage::LoadSetsPage(QWidget *parent) urlRadioButton->setChecked(true); + urlButton = new QPushButton(tr("Restore default url"), this); + connect(urlButton, SIGNAL(clicked()), this, SLOT(actRestoreDefaultUrl())); + fileButton = new QPushButton(tr("Choose file..."), this); connect(fileButton, SIGNAL(clicked()), this, SLOT(actLoadSetsFile())); QGridLayout *layout = new QGridLayout(this); layout->addWidget(urlRadioButton, 0, 0); layout->addWidget(urlLineEdit, 0, 1); - layout->addWidget(fileRadioButton, 1, 0); - layout->addWidget(fileLineEdit, 1, 1); - layout->addWidget(fileButton, 2, 1, Qt::AlignRight); - layout->addWidget(progressLabel, 3, 0); - layout->addWidget(progressBar, 3, 1); + layout->addWidget(urlButton, 1, 1, Qt::AlignRight); + layout->addWidget(fileRadioButton, 2, 0); + layout->addWidget(fileLineEdit, 2, 1); + layout->addWidget(fileButton, 3, 1, Qt::AlignRight); + layout->addWidget(progressLabel, 4, 0); + layout->addWidget(progressBar, 4, 1); connect(&watcher, SIGNAL(finished()), this, SLOT(importFinished())); @@ -128,6 +132,11 @@ void LoadSetsPage::initializePage() progressBar->hide(); } +void LoadSetsPage::actRestoreDefaultUrl() +{ + urlLineEdit->setText(ALLSETS_URL); +} + void LoadSetsPage::actLoadSetsFile() { QFileDialog dialog(this, tr("Load sets file")); diff --git a/oracle/src/oraclewizard.h b/oracle/src/oraclewizard.h index 6e6a6ea8..f3255f8e 100644 --- a/oracle/src/oraclewizard.h +++ b/oracle/src/oraclewizard.h @@ -63,6 +63,7 @@ private: QRadioButton *fileRadioButton; QLineEdit *urlLineEdit; QLineEdit *fileLineEdit; + QPushButton *urlButton; QPushButton *fileButton; QLabel *progressLabel; QProgressBar * progressBar; @@ -72,6 +73,7 @@ private: QFuture future; private slots: void actLoadSetsFile(); + void actRestoreDefaultUrl(); void actDownloadProgressSetsFile(qint64 received, qint64 total); void actDownloadFinishedSetsFile(); void importFinished(); From da46996294d71b3fd157d9d52de11efb9f0a0566 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 9 Nov 2014 22:12:55 +0100 Subject: [PATCH 10/15] Fix #408 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gray out "only buddies/only reg users" in the “create game” dialog if the user is unregistered --- cockatrice/src/dlg_creategame.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cockatrice/src/dlg_creategame.cpp b/cockatrice/src/dlg_creategame.cpp index fc62df7d..65b340bb 100644 --- a/cockatrice/src/dlg_creategame.cpp +++ b/cockatrice/src/dlg_creategame.cpp @@ -56,7 +56,12 @@ void DlgCreateGame::sharedCtor() onlyBuddiesCheckBox = new QCheckBox(tr("Only &buddies can join")); onlyRegisteredCheckBox = new QCheckBox(tr("Only ®istered users can join")); if (room && room->getUserInfo()->user_level() & ServerInfo_User::IsRegistered) + { onlyRegisteredCheckBox->setChecked(true); + } else { + onlyBuddiesCheckBox->setEnabled(false); + onlyRegisteredCheckBox->setEnabled(false); + } QGridLayout *joinRestrictionsLayout = new QGridLayout; joinRestrictionsLayout->addWidget(passwordLabel, 0, 0); From c0ee060af47b040d2b6462c0c05b6566006efc40 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 9 Nov 2014 23:14:36 +0100 Subject: [PATCH 11/15] Fixed vendor name --- cockatrice/CMakeLists.txt | 2 +- oracle/CMakeLists.txt | 2 +- servatrice/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index 50f02357..b127e414 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -243,7 +243,7 @@ endif() if(UNIX) if(APPLE) set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 3ec383f5..344488b3 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -112,7 +112,7 @@ endif() if(UNIX) if(APPLE) set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) diff --git a/servatrice/CMakeLists.txt b/servatrice/CMakeLists.txt index 383cd303..4f407658 100644 --- a/servatrice/CMakeLists.txt +++ b/servatrice/CMakeLists.txt @@ -109,7 +109,7 @@ endif() if(UNIX) if(APPLE) set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.daenyth.${PROJECT_NAME}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}") set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) From fc1d06e13b0b51b58129795c67aa18b80cc62f51 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 10 Nov 2014 00:23:41 +0100 Subject: [PATCH 12/15] Add fallback urls for cards without a muId set We only have a good HQ source for them; any idea on a low-quality source? --- cockatrice/src/carddatabase.cpp | 14 ++++++++------ cockatrice/src/settingscache.cpp | 14 ++++++++++++++ cockatrice/src/settingscache.h | 8 ++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/cockatrice/src/carddatabase.cpp b/cockatrice/src/carddatabase.cpp index 25886d18..f34a0725 100644 --- a/cockatrice/src/carddatabase.cpp +++ b/cockatrice/src/carddatabase.cpp @@ -224,16 +224,18 @@ QString PictureLoader::getPicUrl() return picUrl; } - // otherwise, fallback to the default url - picUrl = picDownloadHq ? settingsCache->getPicUrlHq() : settingsCache->getPicUrl(); - picUrl.replace("!name!", QUrl::toPercentEncoding(card->getCorrectedName())); + // if a card has a muid, use the default url; if not, use the fallback + int muid = set ? muid = card->getMuId(set->getShortName()) : 0; + if(muid) + picUrl = picDownloadHq ? settingsCache->getPicUrlHq() : settingsCache->getPicUrl(); + else + picUrl = picDownloadHq ? settingsCache->getPicUrlHqFallback() : settingsCache->getPicUrlFallback(); + picUrl.replace("!name!", QUrl::toPercentEncoding(card->getCorrectedName())); + picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid))); if (set) { picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName())); picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName())); - int muid = card->getMuId(set->getShortName()); - if (muid) - picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid))); } if (picUrl.contains("!name!") || diff --git a/cockatrice/src/settingscache.cpp b/cockatrice/src/settingscache.cpp index 5821d352..8374bdb5 100644 --- a/cockatrice/src/settingscache.cpp +++ b/cockatrice/src/settingscache.cpp @@ -25,6 +25,8 @@ SettingsCache::SettingsCache() picDownloadHq = settings->value("personal/picturedownloadhq", false).toBool(); picUrl = settings->value("personal/picUrl", PIC_URL_DEFAULT).toString(); picUrlHq = settings->value("personal/picUrlHq", PIC_URL_HQ_DEFAULT).toString(); + picUrlFallback = settings->value("personal/picUrlFallback", PIC_URL_FALLBACK).toString(); + picUrlHqFallback = settings->value("personal/picUrlHqFallback", PIC_URL_HQ_FALLBACK).toString(); mainWindowGeometry = settings->value("interface/main_window_geometry").toByteArray(); notificationsEnabled = settings->value("interface/notificationsenabled", true).toBool(); @@ -153,6 +155,18 @@ void SettingsCache::setPicUrlHq(const QString &_picUrlHq) settings->setValue("personal/picUrlHq", picUrlHq); } +void SettingsCache::setPicUrlFallback(const QString &_picUrlFallback) +{ + picUrlFallback = _picUrlFallback; + settings->setValue("personal/picUrlFallback", picUrlFallback); +} + +void SettingsCache::setPicUrlHqFallback(const QString &_picUrlHqFallback) +{ + picUrlHqFallback = _picUrlHqFallback; + settings->setValue("personal/picUrlHqFallback", picUrlHqFallback); +} + void SettingsCache::setNotificationsEnabled(int _notificationsEnabled) { notificationsEnabled = _notificationsEnabled; diff --git a/cockatrice/src/settingscache.h b/cockatrice/src/settingscache.h index b222a58b..3b1908a9 100644 --- a/cockatrice/src/settingscache.h +++ b/cockatrice/src/settingscache.h @@ -4,7 +4,9 @@ #include #define PIC_URL_DEFAULT "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!cardid!&type=card" +#define PIC_URL_FALLBACK "http://mtgimage.com/set/!setcode!/!name!.jpg" #define PIC_URL_HQ_DEFAULT "http://mtgimage.com/multiverseid/!cardid!.jpg" +#define PIC_URL_HQ_FALLBACK "http://mtgimage.com/set/!setcode!/!name!.jpg" class QSettings; @@ -57,6 +59,8 @@ private: bool ignoreUnregisteredUsers; QString picUrl; QString picUrlHq; + QString picUrlFallback; + QString picUrlHqFallback; bool attemptAutoConnect; public: SettingsCache(); @@ -93,6 +97,8 @@ public: bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; } QString getPicUrl() const { return picUrl; } QString getPicUrlHq() const { return picUrlHq; } + QString getPicUrlFallback() const { return picUrlFallback; } + QString getPicUrlHqFallback() const { return picUrlHqFallback; } void copyPath(const QString &src, const QString &dst); bool getAutoConnect() const { return attemptAutoConnect; } public slots: @@ -129,6 +135,8 @@ public slots: void setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers); void setPicUrl(const QString &_picUrl); void setPicUrlHq(const QString &_picUrlHq); + void setPicUrlFallback(const QString &_picUrlFallback); + void setPicUrlHqFallback(const QString &_picUrlHqFallback); void setAutoConnect(const bool &_autoConnect); }; From 84a5117b4c7bed6731303578423fbe64817c7546 Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Tue, 11 Nov 2014 14:15:02 -0500 Subject: [PATCH 13/15] Default logging to enable with no config file If no configuration file is found, default the logger to logging enabled. --- servatrice/src/server_logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servatrice/src/server_logger.cpp b/servatrice/src/server_logger.cpp index 1a1e4bed..4896852a 100644 --- a/servatrice/src/server_logger.cpp +++ b/servatrice/src/server_logger.cpp @@ -50,7 +50,7 @@ void ServerLogger::logMessage(QString message, void *caller) callerString = QString::number((qulonglong) caller, 16) + " "; //filter out all log entries based on values in configuration file - bool shouldWeWriteLog = settingsCache->value("server/writelog").toBool(); + bool shouldWeWriteLog = settingsCache->value("server/writelog",1).toBool(); QString logFilters = settingsCache->value("server/logfilters").toString(); QStringList listlogFilters = logFilters.split(",", QString::SkipEmptyParts); bool shouldWeSkipLine = false; From c93fdbefe2e3fbc499fd1a90a05ba7aeccd024fe Mon Sep 17 00:00:00 2001 From: Gavin Bisesi Date: Fri, 14 Nov 2014 10:52:39 -0500 Subject: [PATCH 14/15] Update travis build badge link for org change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f67c6fcc..7ce4292e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Chat with the Cockatrice developers on Gitter. Come here to talk about the appli # Building -[![Build Status](https://travis-ci.org/Daenyth/Cockatrice.svg?branch=master)](https://travis-ci.org/Daenyth/Cockatrice) +[![Build Status](https://travis-ci.org/Cockatrice/Cockatrice.svg?branch=master)](https://travis-ci.org/Cockatrice/Cockatrice) Dependencies: From b351abcce43969aebbd1b025d1c44a7964e6ce28 Mon Sep 17 00:00:00 2001 From: Gavin Bisesi Date: Fri, 14 Nov 2014 10:54:02 -0500 Subject: [PATCH 15/15] Update gitter chat room for org change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ce4292e..9b88f18d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ a network interface as well. Both client and server are written in Qt, supportin Chat with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. For support regarding specific servers, please contact that server's admin or forum for support rather than asking here. -[![Gitter chat](https://badges.gitter.im/Daenyth/Cockatrice.png)](https://gitter.im/Daenyth/Cockatrice) +[![Gitter chat](https://badges.gitter.im/Cockatrice/Cockatrice.png)](https://gitter.im/Cockatrice/Cockatrice) # Building