mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
Compare commits
No commits in common. "45d0cedb5c071ff8ab7b2f14d8390ccf3b3955b5" and "0f3e6fbe2605c896c628cf55c35f6629e678d612" have entirely different histories.
45d0cedb5c
...
0f3e6fbe26
13 changed files with 7 additions and 86 deletions
|
|
@ -117,22 +117,21 @@ ${If} $InstDir == ""
|
|||
; we need to set a default based on the install mode
|
||||
StrCpy $InstDir $0
|
||||
${EndIf}
|
||||
Call SetModeDestinationFromInstdir
|
||||
|
||||
; --- Detect portable install when using /R (must come BEFORE SetModeDestinationFromInstdir) ---
|
||||
; --- Detect portable install when using /R ---
|
||||
${If} $ReinstallMode = 1
|
||||
IfFileExists "$InstDir\portable.dat" 0 not_portable
|
||||
StrCpy $PortableMode 1
|
||||
Goto portable_done
|
||||
|
||||
not_portable:
|
||||
StrCpy $PortableMode 0
|
||||
|
||||
portable_done:
|
||||
${EndIf}
|
||||
|
||||
; Now that $PortableMode reflects reality, commit InstDir into the correct slot
|
||||
Call SetModeDestinationFromInstdir
|
||||
|
||||
${If} $ReinstallMode = 1
|
||||
${AndIf} $PortableMode = 0
|
||||
Call AutoUninstallIfNeeded
|
||||
${EndIf}
|
||||
|
||||
|
|
|
|||
|
|
@ -309,7 +309,6 @@ SettingsCache::SettingsCache()
|
|||
cardViewExpandedRowsMax = settings->value("interface/cardViewExpandedRowsMax", 20).toInt();
|
||||
closeEmptyCardView = settings->value("interface/closeEmptyCardView", true).toBool();
|
||||
focusCardViewSearchBar = settings->value("interface/focusCardViewSearchBar", true).toBool();
|
||||
keepGameChatFocus = settings->value("interface/keepGameChatFocus", false).toBool();
|
||||
|
||||
showDragSelectionCount = settings->value("interface/showlassoselectioncount", true).toBool();
|
||||
showTotalSelectionCount = settings->value("interface/showpersistentselectioncount", true).toBool();
|
||||
|
|
@ -458,13 +457,6 @@ void SettingsCache::setFocusCardViewSearchBar(QT_STATE_CHANGED_T value)
|
|||
settings->setValue("interface/focusCardViewSearchBar", focusCardViewSearchBar);
|
||||
}
|
||||
|
||||
void SettingsCache::setKeepGameChatFocus(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
keepGameChatFocus = value;
|
||||
settings->setValue("interface/keepGameChatFocus", keepGameChatFocus);
|
||||
emit keepGameChatFocusChanged(keepGameChatFocus);
|
||||
}
|
||||
|
||||
void SettingsCache::setKnownMissingFeatures(const QString &_knownMissingFeatures)
|
||||
{
|
||||
knownMissingFeatures = _knownMissingFeatures;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,6 @@ signals:
|
|||
void downloadSpoilerStatusChanged();
|
||||
void useTearOffMenusChanged(bool state);
|
||||
void roundCardCornersChanged(bool roundCardCorners);
|
||||
void keepGameChatFocusChanged(bool value);
|
||||
|
||||
private:
|
||||
QSettings *settings;
|
||||
|
|
@ -307,7 +306,6 @@ private:
|
|||
int cardViewExpandedRowsMax;
|
||||
bool closeEmptyCardView;
|
||||
bool focusCardViewSearchBar;
|
||||
bool keepGameChatFocus;
|
||||
int pixmapCacheSize;
|
||||
int networkCacheSize;
|
||||
int redirectCacheTtl;
|
||||
|
|
@ -937,7 +935,6 @@ public:
|
|||
void setCardViewExpandedRowsMax(int value);
|
||||
void setCloseEmptyCardView(QT_STATE_CHANGED_T value);
|
||||
void setFocusCardViewSearchBar(QT_STATE_CHANGED_T value);
|
||||
void setKeepGameChatFocus(QT_STATE_CHANGED_T value);
|
||||
QString getClientID() override
|
||||
{
|
||||
return clientID;
|
||||
|
|
@ -970,10 +967,6 @@ public:
|
|||
{
|
||||
return focusCardViewSearchBar;
|
||||
}
|
||||
[[nodiscard]] bool getKeepGameChatFocus() const
|
||||
{
|
||||
return keepGameChatFocus;
|
||||
}
|
||||
[[nodiscard]] ShortcutsSettings &shortcuts() const
|
||||
{
|
||||
return *shortcutsSettings;
|
||||
|
|
|
|||
|
|
@ -223,10 +223,6 @@ private:
|
|||
{"TabDeckEditor/aLoadDeck", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Load Deck..."),
|
||||
parseSequenceString("Ctrl+O"),
|
||||
ShortcutGroup::Deck_Editor)},
|
||||
{"TabDeckEditor/aLoadDeckFromWebsite",
|
||||
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Load deck from online service..."),
|
||||
parseSequenceString("Ctrl+Shift+O"),
|
||||
ShortcutGroup::Deck_Editor)},
|
||||
{"TabDeckEditor/aLoadDeckFromClipboard",
|
||||
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Load Deck from Clipboard..."),
|
||||
parseSequenceString("Ctrl+Shift+V"),
|
||||
|
|
@ -287,10 +283,6 @@ private:
|
|||
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Load Deck from Clipboard..."),
|
||||
parseSequenceString("Ctrl+Shift+V"),
|
||||
ShortcutGroup::Game_Lobby)},
|
||||
{"DeckViewContainer/loadFromWebsiteButton",
|
||||
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Load from website..."),
|
||||
parseSequenceString("Ctrl+Shift+O"),
|
||||
ShortcutGroup::Game_Lobby)},
|
||||
{"DeckViewContainer/unloadDeckButton", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Unload Deck"),
|
||||
parseSequenceString("Ctrl+Alt+U"),
|
||||
ShortcutGroup::Game_Lobby)},
|
||||
|
|
|
|||
|
|
@ -360,16 +360,6 @@ void DeckViewScene::rebuildTree()
|
|||
return;
|
||||
}
|
||||
|
||||
QStringList requiredZones = {DECK_ZONE_MAIN, DECK_ZONE_SIDE};
|
||||
|
||||
for (const QString &zoneName : requiredZones) {
|
||||
if (!cardContainers.contains(zoneName)) {
|
||||
auto *container = new DeckViewCardContainer(zoneName);
|
||||
cardContainers.insert(zoneName, container);
|
||||
addItem(container);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto *currentZone : deck->getZoneNodes()) {
|
||||
DeckViewCardContainer *container = cardContainers.value(currentZone->getName(), 0);
|
||||
if (!container) {
|
||||
|
|
|
|||
|
|
@ -209,7 +209,6 @@ void DeckViewContainer::refreshShortcuts()
|
|||
loadLocalButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/loadLocalButton"));
|
||||
loadRemoteButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/loadRemoteButton"));
|
||||
loadFromClipboardButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/loadFromClipboardButton"));
|
||||
loadFromWebsiteButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/loadFromWebsiteButton"));
|
||||
unloadDeckButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/unloadDeckButton"));
|
||||
readyStartButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/readyStartButton"));
|
||||
sideboardLockButton->setShortcut(shortcuts.getSingleShortcut("DeckViewContainer/sideboardLockButton"));
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, par
|
|||
{
|
||||
setBackgroundBrush(QBrush(QColor(0, 0, 0)));
|
||||
setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing);
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
setViewportUpdateMode(BoundingRectViewportUpdate);
|
||||
|
||||
connect(scene, &GameScene::sceneRectChanged, this, &GameView::updateSceneRect);
|
||||
|
|
@ -43,9 +44,6 @@ GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, par
|
|||
connect(scene, &GameScene::sigStopRubberBand, this, &GameView::stopRubberBand);
|
||||
connect(scene, &QGraphicsScene::selectionChanged, this, [this]() { updateTotalSelectionCount(); });
|
||||
|
||||
setFocusDisabled(SettingsCache::instance().getKeepGameChatFocus());
|
||||
connect(&SettingsCache::instance(), &SettingsCache::keepGameChatFocusChanged, this, &GameView::setFocusDisabled);
|
||||
|
||||
aCloseMostRecentZoneView = new QAction(this);
|
||||
|
||||
connect(aCloseMostRecentZoneView, &QAction::triggered, scene, &GameScene::closeMostRecentZoneView);
|
||||
|
|
@ -188,12 +186,3 @@ void GameView::updateTotalSelectionCount(const QSize &viewSize)
|
|||
totalCountLabel->hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disabling focus on the game view will allow chat to maintain the autofocusing behavior of pre 2.10.3,
|
||||
* at the cost of disabling the zone view search bar.
|
||||
*/
|
||||
void GameView::setFocusDisabled(bool disabled)
|
||||
{
|
||||
setFocusPolicy(disabled ? Qt::NoFocus : Qt::ClickFocus);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ private slots:
|
|||
void stopRubberBand();
|
||||
void refreshShortcuts();
|
||||
void updateTotalSelectionCount(const QSize &viewSize = QSize());
|
||||
void setFocusDisabled(bool disabled);
|
||||
public slots:
|
||||
void updateSceneRect(const QRectF &rect);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,11 +75,6 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
|
|||
searchEditProxy->setZValue(ZValues::DRAG_ITEM);
|
||||
vbox->addItem(searchEditProxy);
|
||||
|
||||
// hide search bar if chat autofocus setting is enabled, since typing into it will no longer work anyway
|
||||
searchEditProxy->setVisible(!SettingsCache::instance().getKeepGameChatFocus());
|
||||
connect(&SettingsCache::instance(), &SettingsCache::keepGameChatFocusChanged, searchEditProxy,
|
||||
[searchEditProxy](bool keepFocus) { searchEditProxy->setVisible(!keepFocus); });
|
||||
|
||||
// top row
|
||||
QGraphicsLinearLayout *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal);
|
||||
|
||||
|
|
|
|||
|
|
@ -219,25 +219,9 @@ void DlgUpdate::downloadError(const QString &errorString)
|
|||
void DlgUpdate::downloadSuccessful(const QUrl &filepath)
|
||||
{
|
||||
setLabel(tr("Installing..."));
|
||||
|
||||
QString installerPath = filepath.toLocalFile();
|
||||
|
||||
QString appDir = QDir::toNativeSeparators(QCoreApplication::applicationDirPath());
|
||||
QProcess process;
|
||||
process.setProgram(installerPath);
|
||||
|
||||
// NSIS needs the /D= argument to be an UNQUOTED string, even if it contains spaces. Qt likes to quote arguments if
|
||||
// they contain spaces, so we use the windows exclusive QProcess::setNativeArguments in the only case where this is
|
||||
// relevant, which preserves the argument unquoted.
|
||||
#ifdef Q_OS_WIN
|
||||
process.setNativeArguments(QString("/R /D=%1").arg(appDir));
|
||||
#else
|
||||
// Linux/macOS: normal argument passing (not relevant since they update differently.)
|
||||
process.setArguments({"/R", QString("/D=%1").arg(appDir)});
|
||||
#endif
|
||||
|
||||
// Try to open the installer. If it opens, quit Cockatrice
|
||||
if (process.startDetached()) {
|
||||
if (QProcess::startDetached(
|
||||
QString("\"%1\" /R /D=\"%2\"").arg(filepath.toLocalFile(), QCoreApplication::applicationDirPath()))) {
|
||||
QMetaObject::invokeMethod(static_cast<MainWindow *>(parent()), "close", Qt::QueuedConnection);
|
||||
qCInfo(DlgUpdateLog) << "Opened downloaded update file successfully - closing Cockatrice";
|
||||
close();
|
||||
|
|
|
|||
|
|
@ -193,8 +193,6 @@ void DeckEditorMenu::refreshShortcuts()
|
|||
aEditDeckInClipboardRaw->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aEditDeckInClipboardRaw"));
|
||||
aPrintDeck->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aPrintDeck"));
|
||||
|
||||
aLoadDeckFromWebsite->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aLoadDeckFromWebsite"));
|
||||
|
||||
aExportDeckDecklist->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aExportDeckDecklist"));
|
||||
aExportDeckDecklistXyz->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aExportDeckDecklistXyz"));
|
||||
aAnalyzeDeckDeckstats->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aAnalyzeDeck"));
|
||||
|
|
|
|||
|
|
@ -72,10 +72,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
[](const QT_STATE_CHANGED_T state) { SettingsCache::instance().setUseTearOffMenus(state == Qt::Checked); });
|
||||
|
||||
keepGameChatFocusCheckBox.setChecked(SettingsCache::instance().getKeepGameChatFocus());
|
||||
connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setKeepGameChatFocus);
|
||||
|
||||
auto *generalGrid = new QGridLayout;
|
||||
generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0);
|
||||
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
||||
|
|
@ -87,7 +83,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
generalGrid->addWidget(&showDragSelectionCountCheckBox, 7, 0);
|
||||
generalGrid->addWidget(&showTotalSelectionCountCheckBox, 8, 0);
|
||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 9, 0);
|
||||
generalGrid->addWidget(&keepGameChatFocusCheckBox, 10, 0);
|
||||
|
||||
generalGroupBox = new QGroupBox;
|
||||
generalGroupBox->setLayout(generalGrid);
|
||||
|
|
@ -212,9 +207,6 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
showDragSelectionCountCheckBox.setText(tr("Show selection counter during drag selection"));
|
||||
showTotalSelectionCountCheckBox.setText(tr("Show total selection counter"));
|
||||
useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen"));
|
||||
keepGameChatFocusCheckBox.setText(
|
||||
tr("Keep game chat focused when clicking in game (Note: disables card view search bar)"));
|
||||
|
||||
notificationsGroupBox->setTitle(tr("Notifications settings"));
|
||||
notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar"));
|
||||
specNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar for game events while you are spectating"));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ private:
|
|||
QCheckBox showDragSelectionCountCheckBox;
|
||||
QCheckBox showTotalSelectionCountCheckBox;
|
||||
QCheckBox useTearOffMenusCheckBox;
|
||||
QCheckBox keepGameChatFocusCheckBox;
|
||||
QCheckBox tapAnimationCheckBox;
|
||||
QCheckBox openDeckInNewTabCheckBox;
|
||||
QLabel visualDeckStoragePromptForConversionLabel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue