mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -07:00
Merge branch 'master' into cccolors
This commit is contained in:
commit
f29896d807
71 changed files with 865 additions and 219 deletions
7
.github/workflows/desktop-build.yml
vendored
7
.github/workflows/desktop-build.yml
vendored
|
|
@ -9,6 +9,7 @@ on:
|
||||||
- 'webclient/**'
|
- 'webclient/**'
|
||||||
- '.github/workflows/web-*.yml'
|
- '.github/workflows/web-*.yml'
|
||||||
- '.github/workflows/translations-*.yml'
|
- '.github/workflows/translations-*.yml'
|
||||||
|
- '.github/workflows/docker-release.yml'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
@ -132,7 +133,7 @@ jobs:
|
||||||
CACHE: /tmp/${{matrix.distro}}${{matrix.version}}-cache # ${{runner.temp}} does not work?
|
CACHE: /tmp/${{matrix.distro}}${{matrix.version}}-cache # ${{runner.temp}} does not work?
|
||||||
# Cache size over the entire repo is 10Gi:
|
# Cache size over the entire repo is 10Gi:
|
||||||
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
|
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
|
||||||
CCACHE_SIZE: 200M
|
CCACHE_SIZE: 500M
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -386,7 +387,9 @@ jobs:
|
||||||
tools: ${{matrix.qt_tools}}
|
tools: ${{matrix.qt_tools}}
|
||||||
modules: ${{matrix.qt_modules}}
|
modules: ${{matrix.qt_modules}}
|
||||||
|
|
||||||
- name: Run vcpkg
|
# TODO: re-enable when https://github.com/lukka/run-vcpkg/issues/243 is fixed
|
||||||
|
- if: false
|
||||||
|
name: Run vcpkg (disabled)
|
||||||
uses: lukka/run-vcpkg@v11
|
uses: lukka/run-vcpkg@v11
|
||||||
with:
|
with:
|
||||||
runVcpkgInstall: true
|
runVcpkgInstall: true
|
||||||
|
|
|
||||||
1
.github/workflows/desktop-lint.yml
vendored
1
.github/workflows/desktop-lint.yml
vendored
|
|
@ -7,6 +7,7 @@ on:
|
||||||
- 'webclient/**'
|
- 'webclient/**'
|
||||||
- '.github/workflows/web-*.yml'
|
- '.github/workflows/web-*.yml'
|
||||||
- '.github/workflows/translations-*.yml'
|
- '.github/workflows/translations-*.yml'
|
||||||
|
- '.github/workflows/docker-release.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
format:
|
format:
|
||||||
|
|
|
||||||
71
.github/workflows/docker-release.yml
vendored
Normal file
71
.github/workflows/docker-release.yml
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
name: Build Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*Release*'
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/docker-release.yml'
|
||||||
|
- 'CMakeLists.txt'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'servatrice/**'
|
||||||
|
- 'common/**'
|
||||||
|
- 'cmake/**'
|
||||||
|
- '!**.md'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
name: amd64 & arm64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Docker metadata
|
||||||
|
id: metadata
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/cockatrice/servatrice
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=Servatrice
|
||||||
|
org.opencontainers.image.url=https://cockatrice.github.io/
|
||||||
|
org.opencontainers.image.description=Server for Cockatrice, a cross-platform virtual tabletop for multiplayer card games
|
||||||
|
annotations: |
|
||||||
|
org.opencontainers.image.title=Servatrice
|
||||||
|
org.opencontainers.image.url=https://cockatrice.github.io/
|
||||||
|
org.opencontainers.image.description=Server for Cockatrice, a cross-platform virtual tabletop for multiplayer card games
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.ref_type == 'tag' }}
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
@ -16,7 +16,11 @@ RUN apt-get update && apt-get install -y\
|
||||||
qt6-tools-dev \
|
qt6-tools-dev \
|
||||||
qt6-tools-dev-tools
|
qt6-tools-dev-tools
|
||||||
|
|
||||||
COPY . /home/servatrice/code/
|
COPY ./CMakeLists.txt ./LICENSE ./README.md /home/servatrice/code/
|
||||||
|
COPY ./cmake /home/servatrice/code/cmake
|
||||||
|
COPY ./common /home/servatrice/code/common
|
||||||
|
COPY ./servatrice /home/servatrice/code/servatrice
|
||||||
|
|
||||||
WORKDIR /home/servatrice/code
|
WORKDIR /home/servatrice/code
|
||||||
|
|
||||||
WORKDIR build
|
WORKDIR build
|
||||||
|
|
|
||||||
18
README.md
18
README.md
|
|
@ -8,7 +8,7 @@
|
||||||
<a href="#related-repositories">Related</a> <b>|</b>
|
<a href="#related-repositories">Related</a> <b>|</b>
|
||||||
<a href="#community-resources-">Community</a> <b>|</b>
|
<a href="#community-resources-">Community</a> <b>|</b>
|
||||||
<a href="#contribute">Contribute</a> <b>|</b>
|
<a href="#contribute">Contribute</a> <b>|</b>
|
||||||
<a href="#build--">Build</a> <b>|</b>
|
<a href="#build---">Build</a> <b>|</b>
|
||||||
<a href="#run">Run</a>
|
<a href="#run">Run</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -38,8 +38,8 @@ Latest <kbd>stable</kbd> release:
|
||||||
</pre><pre>
|
</pre><pre>
|
||||||
Latest <kbd>beta</kbd> version:
|
Latest <kbd>beta</kbd> version:
|
||||||
[](https://github.com/cockatrice/cockatrice/releases)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0) [](https://github.com/Cockatrice/Cockatrice/pulls?q=is%3Apr+is%3Aclosed)
|
[](https://github.com/cockatrice/cockatrice/releases)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0) [](https://github.com/Cockatrice/Cockatrice/pulls?q=is%3Apr+is%3Aclosed)
|
||||||
<sub><i>While incorporating the latest fixes and features, beta builds may not be stable and/or contain new bugs!</i></sub>
|
<sub><i>While incorporating the latest fixes and features, beta builds may not be stable or contain new bugs!</i></sub>
|
||||||
<sub><b><i>Please report any findings when testing them!</i></b></sub>
|
<sub><b><i>Please report any findings and open new issues when testing them!</i></b></sub>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
# Related Repositories
|
# Related Repositories
|
||||||
|
|
@ -79,10 +79,11 @@ Cockatrice tries to use the [Google Developer Documentation Style Guide](https:/
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><b>Kudos to our amazing contributors ❤️</b></summary>
|
<summary><b>Kudos to our amazing contributors ❤️</b></summary>
|
||||||
|
<br>
|
||||||
<a href="https://github.com/Cockatrice/Cockatrice/graphs/contributors">
|
<a href="https://github.com/Cockatrice/Cockatrice/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=Cockatrice/Cockatrice" />
|
<img src="https://contrib.rocks/image?repo=Cockatrice/Cockatrice" />
|
||||||
</a><br>
|
</a><br>
|
||||||
<sub><i>Made with <a href="https://contrib.rocks">contrib.rocks</a>.</i></sub>
|
<sub><i>Made with <a href="https://contrib.rocks">contrib.rocks</a></i></sub>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Translations [](https://transifex.com/cockatrice/cockatrice/)
|
### Translations [](https://transifex.com/cockatrice/cockatrice/)
|
||||||
|
|
@ -92,7 +93,7 @@ Cockatrice uses Transifex to manage translations. You can help us bring <kbd>Coc
|
||||||
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about getting invovled, and join a group of hundreds of others!<br>
|
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about getting invovled, and join a group of hundreds of others!<br>
|
||||||
|
|
||||||
|
|
||||||
# Build [](https://github.com/Cockatrice/Cockatrice/actions/workflows/desktop-build.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/web-build.yml?query=branch%3Amaster+event%3Apush)
|
# Build [](https://github.com/Cockatrice/Cockatrice/actions/workflows/desktop-build.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/docker-release.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/web-build.yml?query=branch%3Amaster+event%3Apush)
|
||||||
|
|
||||||
Dependencies: *(for minimum versions search our [CMake file](https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt))*
|
Dependencies: *(for minimum versions search our [CMake file](https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt))*
|
||||||
- [Qt](https://www.qt.io/developers/)
|
- [Qt](https://www.qt.io/developers/)
|
||||||
|
|
@ -143,17 +144,16 @@ The following flags (with their non-default values) can be passed to `cmake`:
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
|
|
||||||
|
|
||||||
<kbd>Cockatrice</kbd> is the game client<br>
|
<kbd>Cockatrice</kbd> is the game client<br>
|
||||||
<kbd>Oracle</kbd> fetches card data<br>
|
<kbd>Oracle</kbd> fetches card data<br>
|
||||||
<kbd>Servatrice</kbd> is the server<br>
|
<kbd>Servatrice</kbd> is the server<br>
|
||||||
|
|
||||||
#### Docker
|
#### Docker
|
||||||
|
|
||||||
You can run an instance of <kbd>Servatrice</kbd> (the Cockatrice server) using [Docker](https://www.docker.com/resources/what-container/) and our Dockerfile.<br>
|
You can build an image & deploy a <kbd>Servatrice</kbd> (Cockatrice server) container using [Docker](https://www.docker.com/resources/what-container/) and our Dockerfile yourself.<br>
|
||||||
|
|
||||||
For more information, have a look in our wiki section on [Setting up Servatrice](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).<br>
|
For more details, look into our wiki section on [Setting up Servatrice](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).<br>
|
||||||
There, you'll also find more hints on our **docker-compose** file which will configure and run both a MySQL server and Servatrice.
|
You'll also find more hints on our **pre-build image** there, or the **docker-compose** file which will configure and run both a MySQL server and Servatrice.
|
||||||
|
|
||||||
|
|
||||||
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE)
|
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE)
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ set(cockatrice_SOURCES
|
||||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_item_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_item_widget.cpp
|
||||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp
|
||||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp
|
||||||
|
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp
|
||||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp
|
||||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp
|
||||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_tag_filter_widget.cpp
|
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_tag_filter_widget.cpp
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ AbstractTabDeckEditor::AbstractTabDeckEditor(TabSupervisor *_tabSupervisor) : Ta
|
||||||
printingSelectorDockWidget = new DeckEditorPrintingSelectorDockWidget(this);
|
printingSelectorDockWidget = new DeckEditorPrintingSelectorDockWidget(this);
|
||||||
|
|
||||||
connect(deckDockWidget, &DeckEditorDeckDockWidget::deckChanged, this, &AbstractTabDeckEditor::onDeckChanged);
|
connect(deckDockWidget, &DeckEditorDeckDockWidget::deckChanged, this, &AbstractTabDeckEditor::onDeckChanged);
|
||||||
|
connect(deckDockWidget, &DeckEditorDeckDockWidget::deckModified, this, &AbstractTabDeckEditor::onDeckModified);
|
||||||
connect(deckDockWidget, &DeckEditorDeckDockWidget::cardChanged, this, &AbstractTabDeckEditor::updateCard);
|
connect(deckDockWidget, &DeckEditorDeckDockWidget::cardChanged, this, &AbstractTabDeckEditor::updateCard);
|
||||||
connect(this, &AbstractTabDeckEditor::decrementCard, deckDockWidget, &DeckEditorDeckDockWidget::actDecrementCard);
|
connect(this, &AbstractTabDeckEditor::decrementCard, deckDockWidget, &DeckEditorDeckDockWidget::actDecrementCard);
|
||||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::cardChanged, this,
|
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::cardChanged, this,
|
||||||
|
|
@ -77,6 +78,10 @@ void AbstractTabDeckEditor::updateCard(CardInfoPtr _card)
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractTabDeckEditor::onDeckChanged()
|
void AbstractTabDeckEditor::onDeckChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbstractTabDeckEditor::onDeckModified()
|
||||||
{
|
{
|
||||||
setModified(!isBlankNewDeck());
|
setModified(!isBlankNewDeck());
|
||||||
deckMenu->setSaveStatus(!isBlankNewDeck());
|
deckMenu->setSaveStatus(!isBlankNewDeck());
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void onDeckChanged();
|
virtual void onDeckChanged();
|
||||||
|
virtual void onDeckModified();
|
||||||
void updateCard(CardInfoPtr _card);
|
void updateCard(CardInfoPtr _card);
|
||||||
void actAddCard(CardInfoPtr info);
|
void actAddCard(CardInfoPtr info);
|
||||||
void actAddCardToSideboard(CardInfoPtr info);
|
void actAddCardToSideboard(CardInfoPtr info);
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ void TabEdhRecMain::processAverageDeckResponse(QJsonObject reply)
|
||||||
{
|
{
|
||||||
EdhrecAverageDeckApiResponse deckData;
|
EdhrecAverageDeckApiResponse deckData;
|
||||||
deckData.fromJson(reply);
|
deckData.fromJson(reply);
|
||||||
tabSupervisor->addVisualDeckEditorTab(deckData.deck.deckLoader);
|
tabSupervisor->openDeckInNewTab(deckData.deck.deckLoader);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabEdhRecMain::prettyPrintJson(const QJsonValue &value, int indentLevel)
|
void TabEdhRecMain::prettyPrintJson(const QJsonValue &value, int indentLevel)
|
||||||
|
|
|
||||||
|
|
@ -590,7 +590,7 @@ void TabSupervisor::actTabDeckStorage(bool checked)
|
||||||
void TabSupervisor::openTabDeckStorage()
|
void TabSupervisor::openTabDeckStorage()
|
||||||
{
|
{
|
||||||
tabDeckStorage = new TabDeckStorage(this, client, userInfo);
|
tabDeckStorage = new TabDeckStorage(this, client, userInfo);
|
||||||
connect(tabDeckStorage, &TabDeckStorage::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
|
connect(tabDeckStorage, &TabDeckStorage::openDeckEditor, this, &TabSupervisor::openDeckInNewTab);
|
||||||
myAddTab(tabDeckStorage, aTabDeckStorage);
|
myAddTab(tabDeckStorage, aTabDeckStorage);
|
||||||
connect(tabDeckStorage, &Tab::closed, this, [this] {
|
connect(tabDeckStorage, &Tab::closed, this, [this] {
|
||||||
tabDeckStorage = nullptr;
|
tabDeckStorage = nullptr;
|
||||||
|
|
@ -691,7 +691,7 @@ void TabSupervisor::gameJoined(const Event_GameJoined &event)
|
||||||
auto *tab = new TabGame(this, QList<AbstractClient *>() << client, event, roomGameTypes);
|
auto *tab = new TabGame(this, QList<AbstractClient *>() << client, event, roomGameTypes);
|
||||||
connect(tab, &TabGame::gameClosing, this, &TabSupervisor::gameLeft);
|
connect(tab, &TabGame::gameClosing, this, &TabSupervisor::gameLeft);
|
||||||
connect(tab, &TabGame::openMessageDialog, this, &TabSupervisor::addMessageTab);
|
connect(tab, &TabGame::openMessageDialog, this, &TabSupervisor::addMessageTab);
|
||||||
connect(tab, &TabGame::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
|
connect(tab, &TabGame::openDeckEditor, this, &TabSupervisor::openDeckInNewTab);
|
||||||
myAddTab(tab);
|
myAddTab(tab);
|
||||||
gameTabs.insert(event.game_info().game_id(), tab);
|
gameTabs.insert(event.game_info().game_id(), tab);
|
||||||
setCurrentWidget(tab);
|
setCurrentWidget(tab);
|
||||||
|
|
@ -701,7 +701,7 @@ void TabSupervisor::localGameJoined(const Event_GameJoined &event)
|
||||||
{
|
{
|
||||||
auto *tab = new TabGame(this, localClients, event, QMap<int, QString>());
|
auto *tab = new TabGame(this, localClients, event, QMap<int, QString>());
|
||||||
connect(tab, &TabGame::gameClosing, this, &TabSupervisor::gameLeft);
|
connect(tab, &TabGame::gameClosing, this, &TabSupervisor::gameLeft);
|
||||||
connect(tab, &TabGame::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
|
connect(tab, &TabGame::openDeckEditor, this, &TabSupervisor::openDeckInNewTab);
|
||||||
myAddTab(tab);
|
myAddTab(tab);
|
||||||
gameTabs.insert(event.game_info().game_id(), tab);
|
gameTabs.insert(event.game_info().game_id(), tab);
|
||||||
setCurrentWidget(tab);
|
setCurrentWidget(tab);
|
||||||
|
|
@ -807,6 +807,29 @@ void TabSupervisor::talkLeft(TabMessage *tab)
|
||||||
removeTab(indexOf(tab));
|
removeTab(indexOf(tab));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new deck editor tab and loads the deck into it.
|
||||||
|
* Creates either a classic or visual deck editor tab depending on settings
|
||||||
|
* @param deckToOpen The deck to open in the tab. Creates a copy of the DeckLoader instance.
|
||||||
|
*/
|
||||||
|
void TabSupervisor::openDeckInNewTab(const DeckLoader *deckToOpen)
|
||||||
|
{
|
||||||
|
int type = SettingsCache::instance().getDefaultDeckEditorType();
|
||||||
|
switch (type) {
|
||||||
|
case ClassicDeckEditor:
|
||||||
|
addDeckEditorTab(deckToOpen);
|
||||||
|
break;
|
||||||
|
case VisualDeckEditor:
|
||||||
|
addVisualDeckEditorTab(deckToOpen);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
qCWarning(TabSupervisorLog) << "Unknown DeckEditorType [" << type
|
||||||
|
<< "]; opening ClassicDeckEditor as fallback";
|
||||||
|
addDeckEditorTab(deckToOpen);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new deck editor tab
|
* Creates a new deck editor tab
|
||||||
* @param deckToOpen The deck to open in the tab. Creates a copy of the DeckLoader instance.
|
* @param deckToOpen The deck to open in the tab. Creates a copy of the DeckLoader instance.
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,14 @@ protected:
|
||||||
class TabSupervisor : public QTabWidget
|
class TabSupervisor : public QTabWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum DeckEditorType
|
||||||
|
{
|
||||||
|
ClassicDeckEditor,
|
||||||
|
VisualDeckEditor
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ServerInfo_User *userInfo;
|
ServerInfo_User *userInfo;
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
|
|
@ -152,6 +160,7 @@ signals:
|
||||||
void showWindowIfHidden();
|
void showWindowIfHidden();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void openDeckInNewTab(const DeckLoader *deckToOpen);
|
||||||
TabDeckEditor *addDeckEditorTab(const DeckLoader *deckToOpen);
|
TabDeckEditor *addDeckEditorTab(const DeckLoader *deckToOpen);
|
||||||
TabDeckEditorVisual *addVisualDeckEditorTab(const DeckLoader *deckToOpen);
|
TabDeckEditorVisual *addVisualDeckEditorTab(const DeckLoader *deckToOpen);
|
||||||
TabVisualDatabaseDisplay *addVisualDatabaseDisplayTab();
|
TabVisualDatabaseDisplay *addVisualDatabaseDisplayTab();
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ void TabDeckEditorVisual::createCentralFrame()
|
||||||
|
|
||||||
void TabDeckEditorVisual::onDeckChanged()
|
void TabDeckEditorVisual::onDeckChanged()
|
||||||
{
|
{
|
||||||
AbstractTabDeckEditor::onDeckChanged();
|
AbstractTabDeckEditor::onDeckModified();
|
||||||
tabContainer->visualDeckView->decklistDataChanged(QModelIndex(), QModelIndex());
|
tabContainer->visualDeckView->decklistDataChanged(QModelIndex(), QModelIndex());
|
||||||
tabContainer->deckAnalytics->refreshDisplays(deckDockWidget->deckModel);
|
tabContainer->deckAnalytics->refreshDisplays(deckDockWidget->deckModel);
|
||||||
tabContainer->sampleHandWidget->setDeckModel(deckDockWidget->deckModel);
|
tabContainer->sampleHandWidget->setDeckModel(deckDockWidget->deckModel);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
|
TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
|
||||||
: Tab(_tabSupervisor), visualDeckStorageWidget(new VisualDeckStorageWidget(this))
|
: Tab(_tabSupervisor), visualDeckStorageWidget(new VisualDeckStorageWidget(this))
|
||||||
{
|
{
|
||||||
connect(this, &TabDeckStorageVisual::openDeckEditor, tabSupervisor, &TabSupervisor::addVisualDeckEditorTab);
|
connect(this, &TabDeckStorageVisual::openDeckEditor, tabSupervisor, &TabSupervisor::openDeckInNewTab);
|
||||||
connect(visualDeckStorageWidget, &VisualDeckStorageWidget::deckLoadRequested, this,
|
connect(visualDeckStorageWidget, &VisualDeckStorageWidget::deckLoadRequested, this,
|
||||||
&TabDeckStorageVisual::actOpenLocalDeck);
|
&TabDeckStorageVisual::actOpenLocalDeck);
|
||||||
connect(visualDeckStorageWidget, &VisualDeckStorageWidget::openDeckEditor, this,
|
connect(visualDeckStorageWidget, &VisualDeckStorageWidget::openDeckEditor, this,
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ void ManaSymbolWidget::loadManaIcon()
|
||||||
QString filename = "theme:icons/mana/";
|
QString filename = "theme:icons/mana/";
|
||||||
|
|
||||||
if (symbol == "W" || symbol == "U" || symbol == "B" || symbol == "R" || symbol == "G") {
|
if (symbol == "W" || symbol == "U" || symbol == "B" || symbol == "R" || symbol == "G") {
|
||||||
filename += symbol + ".svg";
|
filename += symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
manaIcon = QPixmap(filename);
|
manaIcon = QPixmap(filename);
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,12 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CardInfoPictureWidget::~CardInfoPictureWidget()
|
||||||
|
{
|
||||||
|
enlargedPixmapWidget->hide();
|
||||||
|
enlargedPixmapWidget->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the card to be displayed and updates the pixmap.
|
* @brief Sets the card to be displayed and updates the pixmap.
|
||||||
* @param card A shared pointer to the card information (CardInfoPtr).
|
* @param card A shared pointer to the card information (CardInfoPtr).
|
||||||
|
|
@ -341,6 +347,12 @@ void CardInfoPictureWidget::mousePressEvent(QMouseEvent *event)
|
||||||
emit cardClicked();
|
emit cardClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardInfoPictureWidget::hideEvent(QHideEvent *event)
|
||||||
|
{
|
||||||
|
enlargedPixmapWidget->hide();
|
||||||
|
QWidget::hideEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
QMenu *CardInfoPictureWidget::createRightClickMenu()
|
QMenu *CardInfoPictureWidget::createRightClickMenu()
|
||||||
{
|
{
|
||||||
auto *cardMenu = new QMenu(this);
|
auto *cardMenu = new QMenu(this);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ public:
|
||||||
explicit CardInfoPictureWidget(QWidget *parent = nullptr,
|
explicit CardInfoPictureWidget(QWidget *parent = nullptr,
|
||||||
bool hoverToZoomEnabled = false,
|
bool hoverToZoomEnabled = false,
|
||||||
bool raiseOnEnter = false);
|
bool raiseOnEnter = false);
|
||||||
|
~CardInfoPictureWidget();
|
||||||
CardInfoPtr getInfo()
|
CardInfoPtr getInfo()
|
||||||
{
|
{
|
||||||
return info;
|
return info;
|
||||||
|
|
@ -52,6 +53,7 @@ protected:
|
||||||
void moveEvent(QMoveEvent *event) override;
|
void moveEvent(QMoveEvent *event) override;
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
|
void hideEvent(QHideEvent *event) override;
|
||||||
void loadPixmap();
|
void loadPixmap();
|
||||||
[[nodiscard]] const QPixmap &getResizedPixmap() const
|
[[nodiscard]] const QPixmap &getResizedPixmap() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,7 @@ CardSizeWidget::CardSizeWidget(QWidget *parent, FlowWidget *_flowWidget, int def
|
||||||
|
|
||||||
// Debounce setup
|
// Debounce setup
|
||||||
debounceTimer.setSingleShot(true);
|
debounceTimer.setSingleShot(true);
|
||||||
connect(&debounceTimer, &QTimer::timeout, this, [this]() {
|
connect(&debounceTimer, &QTimer::timeout, this, [this] { emit cardSizeSettingUpdated(pendingValue); });
|
||||||
// Check the type of the parent widget
|
|
||||||
if (qobject_cast<PrintingSelector *>(parentWidget())) {
|
|
||||||
SettingsCache::instance().setPrintingSelectorCardSize(pendingValue);
|
|
||||||
} else if (qobject_cast<VisualDeckStorageWidget *>(parentWidget())) {
|
|
||||||
SettingsCache::instance().setVisualDeckStorageCardSize(pendingValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(cardSizeSlider, &QSlider::valueChanged, this, &CardSizeWidget::updateCardSizeSetting);
|
connect(cardSizeSlider, &QSlider::valueChanged, this, &CardSizeWidget::updateCardSizeSetting);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,17 @@ public:
|
||||||
explicit CardSizeWidget(QWidget *parent, FlowWidget *flowWidget = nullptr, int defaultValue = 100);
|
explicit CardSizeWidget(QWidget *parent, FlowWidget *flowWidget = nullptr, int defaultValue = 100);
|
||||||
[[nodiscard]] QSlider *getSlider() const;
|
[[nodiscard]] QSlider *getSlider() const;
|
||||||
|
|
||||||
public slots:
|
private slots:
|
||||||
void updateCardSizeSetting(int newValue);
|
void updateCardSizeSetting(int newValue);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/**
|
||||||
|
* Emitted when the slider value changes, but on a debounce timer.
|
||||||
|
* Any parents that care about saving the value to settings should use this signal to indicate when to save the new
|
||||||
|
* value to settings.
|
||||||
|
*/
|
||||||
|
void cardSizeSettingUpdated(int newValue);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *parent;
|
QWidget *parent;
|
||||||
FlowWidget *flowWidget;
|
FlowWidget *flowWidget;
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,25 @@ DeckAnalyticsWidget::DeckAnalyticsWidget(QWidget *parent, DeckListModel *_deckLi
|
||||||
mainLayout = new QVBoxLayout();
|
mainLayout = new QVBoxLayout();
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
scrollArea = new QScrollArea(this);
|
||||||
|
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||||
|
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
scrollArea->setWidgetResizable(true);
|
||||||
|
mainLayout->addWidget(scrollArea);
|
||||||
|
|
||||||
|
container = new QWidget(scrollArea);
|
||||||
|
containerLayout = new QVBoxLayout(container);
|
||||||
|
container->setLayout(containerLayout);
|
||||||
|
scrollArea->setWidget(container);
|
||||||
|
|
||||||
manaCurveWidget = new ManaCurveWidget(this, deckListModel);
|
manaCurveWidget = new ManaCurveWidget(this, deckListModel);
|
||||||
mainLayout->addWidget(manaCurveWidget);
|
containerLayout->addWidget(manaCurveWidget);
|
||||||
|
|
||||||
manaDevotionWidget = new ManaDevotionWidget(this, deckListModel);
|
manaDevotionWidget = new ManaDevotionWidget(this, deckListModel);
|
||||||
mainLayout->addWidget(manaDevotionWidget);
|
containerLayout->addWidget(manaDevotionWidget);
|
||||||
|
|
||||||
manaBaseWidget = new ManaBaseWidget(this, deckListModel);
|
manaBaseWidget = new ManaBaseWidget(this, deckListModel);
|
||||||
mainLayout->addWidget(manaBaseWidget);
|
containerLayout->addWidget(manaBaseWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckAnalyticsWidget::refreshDisplays(DeckListModel *_deckModel)
|
void DeckAnalyticsWidget::refreshDisplays(DeckListModel *_deckModel)
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@
|
||||||
#include "mana_devotion_widget.h"
|
#include "mana_devotion_widget.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <decklist.h>
|
#include <decklist.h>
|
||||||
#include <qscrollarea.h>
|
|
||||||
|
|
||||||
class DeckAnalyticsWidget : public QWidget
|
class DeckAnalyticsWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
|
@ -26,6 +27,11 @@ private:
|
||||||
DeckListModel *deckListModel;
|
DeckListModel *deckListModel;
|
||||||
QVBoxLayout *mainLayout;
|
QVBoxLayout *mainLayout;
|
||||||
|
|
||||||
|
QWidget *container;
|
||||||
|
QVBoxLayout *containerLayout;
|
||||||
|
|
||||||
|
QScrollArea *scrollArea;
|
||||||
|
|
||||||
ManaCurveWidget *manaCurveWidget;
|
ManaCurveWidget *manaCurveWidget;
|
||||||
ManaDevotionWidget *manaDevotionWidget;
|
ManaDevotionWidget *manaDevotionWidget;
|
||||||
ManaBaseWidget *manaBaseWidget;
|
ManaBaseWidget *manaBaseWidget;
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ void ManaCurveWidget::updateDisplay()
|
||||||
// Add new widgets to the layout in sorted order
|
// Add new widgets to the layout in sorted order
|
||||||
for (const auto &entry : sortedManaCurve) {
|
for (const auto &entry : sortedManaCurve) {
|
||||||
BarWidget *barWidget =
|
BarWidget *barWidget =
|
||||||
new BarWidget(QString::number(entry.first), entry.second, highestEntry, QColor(11, 11, 11), this);
|
new BarWidget(QString::number(entry.first), entry.second, highestEntry, QColor(122, 122, 122), this);
|
||||||
barLayout->addWidget(barWidget);
|
barLayout->addWidget(barWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ void DeckEditorDeckDockWidget::createDeckDock()
|
||||||
bannerCardLabel = new QLabel();
|
bannerCardLabel = new QLabel();
|
||||||
bannerCardLabel->setObjectName("bannerCardLabel");
|
bannerCardLabel->setObjectName("bannerCardLabel");
|
||||||
bannerCardLabel->setText(tr("Banner Card"));
|
bannerCardLabel->setText(tr("Banner Card"));
|
||||||
bannerCardLabel->setHidden(SettingsCache::instance().getDeckEditorBannerCardComboBoxVisible());
|
bannerCardLabel->setHidden(!SettingsCache::instance().getDeckEditorBannerCardComboBoxVisible());
|
||||||
bannerCardComboBox = new QComboBox(this);
|
bannerCardComboBox = new QComboBox(this);
|
||||||
connect(deckModel, &DeckListModel::dataChanged, this, [this]() {
|
connect(deckModel, &DeckListModel::dataChanged, this, [this]() {
|
||||||
// Delay the update to avoid race conditions
|
// Delay the update to avoid race conditions
|
||||||
|
|
@ -228,19 +228,22 @@ void DeckEditorDeckDockWidget::updateCard(const QModelIndex /*¤t*/, const
|
||||||
void DeckEditorDeckDockWidget::updateName(const QString &name)
|
void DeckEditorDeckDockWidget::updateName(const QString &name)
|
||||||
{
|
{
|
||||||
deckModel->getDeckList()->setName(name);
|
deckModel->getDeckList()->setName(name);
|
||||||
emit deckChanged();
|
emit nameChanged();
|
||||||
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::updateComments()
|
void DeckEditorDeckDockWidget::updateComments()
|
||||||
{
|
{
|
||||||
deckModel->getDeckList()->setComments(commentsEdit->toPlainText());
|
deckModel->getDeckList()->setComments(commentsEdit->toPlainText());
|
||||||
emit deckChanged();
|
emit commentsChanged();
|
||||||
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::updateHash()
|
void DeckEditorDeckDockWidget::updateHash()
|
||||||
{
|
{
|
||||||
hashLabel->setText(deckModel->getDeckList()->getDeckHash());
|
hashLabel->setText(deckModel->getDeckList()->getDeckHash());
|
||||||
emit deckChanged();
|
emit hashChanged();
|
||||||
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::updateBannerCardComboBox()
|
void DeckEditorDeckDockWidget::updateBannerCardComboBox()
|
||||||
|
|
@ -294,6 +297,10 @@ void DeckEditorDeckDockWidget::updateBannerCardComboBox()
|
||||||
int restoredIndex = bannerCardComboBox->findText(currentText);
|
int restoredIndex = bannerCardComboBox->findText(currentText);
|
||||||
if (restoredIndex != -1) {
|
if (restoredIndex != -1) {
|
||||||
bannerCardComboBox->setCurrentIndex(restoredIndex);
|
bannerCardComboBox->setCurrentIndex(restoredIndex);
|
||||||
|
if (deckModel->getDeckList()->getBannerCard().second !=
|
||||||
|
bannerCardComboBox->itemData(bannerCardComboBox->currentIndex()).toMap()["uuid"].toString()) {
|
||||||
|
setBannerCard(restoredIndex);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Add a placeholder "-" and set it as the current selection
|
// Add a placeholder "-" and set it as the current selection
|
||||||
int bannerIndex = bannerCardComboBox->findText(deckModel->getDeckList()->getBannerCard().first);
|
int bannerIndex = bannerCardComboBox->findText(deckModel->getDeckList()->getBannerCard().first);
|
||||||
|
|
@ -314,7 +321,7 @@ void DeckEditorDeckDockWidget::setBannerCard(int /* changedIndex */)
|
||||||
QVariantMap itemData = bannerCardComboBox->itemData(bannerCardComboBox->currentIndex()).toMap();
|
QVariantMap itemData = bannerCardComboBox->itemData(bannerCardComboBox->currentIndex()).toMap();
|
||||||
deckModel->getDeckList()->setBannerCard(
|
deckModel->getDeckList()->setBannerCard(
|
||||||
QPair<QString, QString>(itemData["name"].toString(), itemData["uuid"].toString()));
|
QPair<QString, QString>(itemData["name"].toString(), itemData["uuid"].toString()));
|
||||||
emit deckChanged();
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::updateShowBannerCardComboBox(const bool visible)
|
void DeckEditorDeckDockWidget::updateShowBannerCardComboBox(const bool visible)
|
||||||
|
|
@ -362,8 +369,12 @@ void DeckEditorDeckDockWidget::cleanDeck()
|
||||||
{
|
{
|
||||||
deckModel->cleanList();
|
deckModel->cleanList();
|
||||||
nameEdit->setText(QString());
|
nameEdit->setText(QString());
|
||||||
|
emit nameChanged();
|
||||||
commentsEdit->setText(QString());
|
commentsEdit->setText(QString());
|
||||||
|
emit commentsChanged();
|
||||||
hashLabel->setText(QString());
|
hashLabel->setText(QString());
|
||||||
|
emit hashChanged();
|
||||||
|
emit deckModified();
|
||||||
emit deckChanged();
|
emit deckChanged();
|
||||||
updateBannerCardComboBox();
|
updateBannerCardComboBox();
|
||||||
deckTagsDisplayWidget->connectDeckList(deckModel->getDeckList());
|
deckTagsDisplayWidget->connectDeckList(deckModel->getDeckList());
|
||||||
|
|
@ -422,7 +433,7 @@ void DeckEditorDeckDockWidget::actSwapCard()
|
||||||
deckView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
deckView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
if (isModified) {
|
if (isModified) {
|
||||||
emit deckChanged();
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
@ -517,7 +528,7 @@ void DeckEditorDeckDockWidget::actRemoveCard()
|
||||||
deckView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
deckView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
if (isModified) {
|
if (isModified) {
|
||||||
emit deckChanged();
|
emit deckModified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -535,7 +546,7 @@ void DeckEditorDeckDockWidget::offsetCountAtIndex(const QModelIndex &idx, int of
|
||||||
else
|
else
|
||||||
deckModel->setData(numberIndex, new_count, Qt::EditRole);
|
deckModel->setData(numberIndex, new_count, Qt::EditRole);
|
||||||
|
|
||||||
emit deckChanged();
|
emit deckModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::decklistCustomMenu(QPoint point)
|
void DeckEditorDeckDockWidget::decklistCustomMenu(QPoint point)
|
||||||
|
|
@ -563,6 +574,7 @@ void DeckEditorDeckDockWidget::retranslateUi()
|
||||||
setWindowTitle(tr("Deck"));
|
setWindowTitle(tr("Deck"));
|
||||||
|
|
||||||
nameLabel->setText(tr("Deck &name:"));
|
nameLabel->setText(tr("Deck &name:"));
|
||||||
|
quickSettingsWidget->setToolTip(tr("Banner Card/Tags Visibility Settings"));
|
||||||
showBannerCardCheckBox->setText(tr("Show banner card selection menu"));
|
showBannerCardCheckBox->setText(tr("Show banner card selection menu"));
|
||||||
showTagsWidgetCheckBox->setText(tr("Show tags selection menu"));
|
showTagsWidgetCheckBox->setText(tr("Show tags selection menu"));
|
||||||
commentsLabel->setText(tr("&Comments:"));
|
commentsLabel->setText(tr("&Comments:"));
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,11 @@ public slots:
|
||||||
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void nameChanged();
|
||||||
|
void commentsChanged();
|
||||||
|
void hashChanged();
|
||||||
void deckChanged();
|
void deckChanged();
|
||||||
|
void deckModified();
|
||||||
void cardChanged(CardInfoPtr _card);
|
void cardChanged(CardInfoPtr _card);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
||||||
|
|
||||||
cardSizeWidget =
|
cardSizeWidget =
|
||||||
new CardSizeWidget(displayOptionsWidget, flowWidget, SettingsCache::instance().getPrintingSelectorCardSize());
|
new CardSizeWidget(displayOptionsWidget, flowWidget, SettingsCache::instance().getPrintingSelectorCardSize());
|
||||||
|
connect(cardSizeWidget, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setPrintingSelectorCardSize);
|
||||||
|
|
||||||
displayOptionsWidget->addSettingsWidget(sortToolBar);
|
displayOptionsWidget->addSettingsWidget(sortToolBar);
|
||||||
displayOptionsWidget->addSettingsWidget(navigationCheckBox);
|
displayOptionsWidget->addSettingsWidget(navigationCheckBox);
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ void VisualDatabaseDisplayColorFilterWidget::retranslateUi()
|
||||||
toggleButton->setText(tr("Mode: Include/Exclude"));
|
toggleButton->setText(tr("Mode: Include/Exclude"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleButton->setToolTip(tr("Filter mode (AND/OR/NOT conjunctions of filters)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDatabaseDisplayColorFilterWidget::handleColorToggled(QChar color, bool active)
|
void VisualDatabaseDisplayColorFilterWidget::handleColorToggled(QChar color, bool active)
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ VisualDatabaseDisplayFilterSaveLoadWidget::VisualDatabaseDisplayFilterSaveLoadWi
|
||||||
void VisualDatabaseDisplayFilterSaveLoadWidget::retranslateUi()
|
void VisualDatabaseDisplayFilterSaveLoadWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
saveButton->setText(tr("Save Filter"));
|
saveButton->setText(tr("Save Filter"));
|
||||||
|
saveButton->setToolTip(tr("Save all currently applied filters to a file"));
|
||||||
filenameInput->setPlaceholderText(tr("Enter filename..."));
|
filenameInput->setPlaceholderText(tr("Enter filename..."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,14 @@ VisualDatabaseDisplayMainTypeFilterWidget::VisualDatabaseDisplayMainTypeFilterWi
|
||||||
|
|
||||||
createMainTypeButtons(); // Populate buttons initially
|
createMainTypeButtons(); // Populate buttons initially
|
||||||
updateFilterMode(false); // Initialize toggle button text
|
updateFilterMode(false); // Initialize toggle button text
|
||||||
|
|
||||||
|
retranslateUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VisualDatabaseDisplayMainTypeFilterWidget::retranslateUi()
|
||||||
|
{
|
||||||
|
spinBox->setToolTip(tr("Do not display card main-types with less than this amount of cards in the database"));
|
||||||
|
toggleButton->setToolTip(tr("Filter mode (AND/OR/NOT conjunctions of filters)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDatabaseDisplayMainTypeFilterWidget::createMainTypeButtons()
|
void VisualDatabaseDisplayMainTypeFilterWidget::createMainTypeButtons()
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ class VisualDatabaseDisplayMainTypeFilterWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VisualDatabaseDisplayMainTypeFilterWidget(QWidget *parent, FilterTreeModel *filterModel);
|
explicit VisualDatabaseDisplayMainTypeFilterWidget(QWidget *parent, FilterTreeModel *filterModel);
|
||||||
|
void retranslateUi();
|
||||||
void createMainTypeButtons();
|
void createMainTypeButtons();
|
||||||
void updateMainTypeButtonsVisibility();
|
void updateMainTypeButtonsVisibility();
|
||||||
int getMaxMainTypeCount() const;
|
int getMaxMainTypeCount() const;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ void VisualDatabaseDisplayNameFilterWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
searchBox->setPlaceholderText(tr("Filter by name..."));
|
searchBox->setPlaceholderText(tr("Filter by name..."));
|
||||||
loadFromDeckButton->setText(tr("Load from Deck"));
|
loadFromDeckButton->setText(tr("Load from Deck"));
|
||||||
|
loadFromDeckButton->setToolTip(tr("Apply all card names in currently loaded deck as exact match name filters"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDatabaseDisplayNameFilterWidget::actLoadFromDeck()
|
void VisualDatabaseDisplayNameFilterWidget::actLoadFromDeck()
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,14 @@ VisualDatabaseDisplaySubTypeFilterWidget::VisualDatabaseDisplaySubTypeFilterWidg
|
||||||
|
|
||||||
createSubTypeButtons(); // Populate buttons initially
|
createSubTypeButtons(); // Populate buttons initially
|
||||||
updateFilterMode(false); // Initialize the toggle button text
|
updateFilterMode(false); // Initialize the toggle button text
|
||||||
|
|
||||||
|
retranslateUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VisualDatabaseDisplaySubTypeFilterWidget::retranslateUi()
|
||||||
|
{
|
||||||
|
spinBox->setToolTip(tr("Do not display card sub-types with less than this amount of cards in the database"));
|
||||||
|
toggleButton->setToolTip(tr("Filter mode (AND/OR/NOT conjunctions of filters)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDatabaseDisplaySubTypeFilterWidget::createSubTypeButtons()
|
void VisualDatabaseDisplaySubTypeFilterWidget::createSubTypeButtons()
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ class VisualDatabaseDisplaySubTypeFilterWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VisualDatabaseDisplaySubTypeFilterWidget(QWidget *parent, FilterTreeModel *filterModel);
|
explicit VisualDatabaseDisplaySubTypeFilterWidget(QWidget *parent, FilterTreeModel *filterModel);
|
||||||
|
void retranslateUi();
|
||||||
void createSubTypeButtons();
|
void createSubTypeButtons();
|
||||||
void updateSubTypeButtonsVisibility();
|
void updateSubTypeButtonsVisibility();
|
||||||
int getMaxSubTypeCount() const;
|
int getMaxSubTypeCount() const;
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,18 @@ VisualDatabaseDisplayWidget::VisualDatabaseDisplayWidget(QWidget *parent,
|
||||||
|
|
||||||
connect(loadCardsTimer, &QTimer::timeout, this, [this]() { loadCurrentPage(); });
|
connect(loadCardsTimer, &QTimer::timeout, this, [this]() { loadCurrentPage(); });
|
||||||
loadCardsTimer->start(5000);
|
loadCardsTimer->start(5000);
|
||||||
|
|
||||||
|
retranslateUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VisualDatabaseDisplayWidget::retranslateUi()
|
||||||
|
{
|
||||||
|
clearFilterWidget->setToolTip(tr("Clear all filters"));
|
||||||
|
|
||||||
|
quickFilterSaveLoadWidget->setToolTip(tr("Save and load filters"));
|
||||||
|
quickFilterNameWidget->setToolTip(tr("Filter by exact card name"));
|
||||||
|
quickFilterSubTypeWidget->setToolTip(tr("Filter by card sub-type"));
|
||||||
|
quickFilterSetWidget->setToolTip(tr("Filter by set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDatabaseDisplayWidget::resizeEvent(QResizeEvent *event)
|
void VisualDatabaseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public:
|
||||||
AbstractTabDeckEditor *deckEditor,
|
AbstractTabDeckEditor *deckEditor,
|
||||||
CardDatabaseModel *database_model,
|
CardDatabaseModel *database_model,
|
||||||
CardDatabaseDisplayModel *database_display_model);
|
CardDatabaseDisplayModel *database_display_model);
|
||||||
|
void retranslateUi();
|
||||||
|
|
||||||
void adjustCardsPerPage();
|
void adjustCardsPerPage();
|
||||||
void populateCards();
|
void populateCards();
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "../../../../deck/deck_loader.h"
|
#include "../../../../deck/deck_loader.h"
|
||||||
#include "../../../../game/cards/card_database_manager.h"
|
#include "../../../../game/cards/card_database_manager.h"
|
||||||
|
#include "../../../../settings/cache_settings.h"
|
||||||
#include "../cards/card_info_picture_widget.h"
|
#include "../cards/card_info_picture_widget.h"
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
@ -12,23 +13,45 @@ VisualDeckEditorSampleHandWidget::VisualDeckEditorSampleHandWidget(QWidget *pare
|
||||||
layout = new QVBoxLayout(this);
|
layout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
|
resetAndHandSizeContainerWidget = new QWidget(this);
|
||||||
|
resetAndHandSizeLayout = new QHBoxLayout(resetAndHandSizeContainerWidget);
|
||||||
|
resetAndHandSizeContainerWidget->setLayout(resetAndHandSizeLayout);
|
||||||
|
|
||||||
resetButton = new QPushButton(this);
|
resetButton = new QPushButton(this);
|
||||||
connect(resetButton, SIGNAL(clicked()), this, SLOT(updateDisplay()));
|
connect(resetButton, SIGNAL(clicked()), this, SLOT(updateDisplay()));
|
||||||
layout->addWidget(resetButton);
|
resetAndHandSizeLayout->addWidget(resetButton);
|
||||||
|
|
||||||
|
handSizeSpinBox = new QSpinBox(this);
|
||||||
|
handSizeSpinBox->setValue(SettingsCache::instance().getVisualDeckEditorSampleHandSize());
|
||||||
|
handSizeSpinBox->setMinimum(1);
|
||||||
|
connect(handSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckEditorSampleHandSize);
|
||||||
|
connect(handSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
||||||
|
&VisualDeckEditorSampleHandWidget::updateDisplay);
|
||||||
|
resetAndHandSizeLayout->addWidget(handSizeSpinBox);
|
||||||
|
|
||||||
|
layout->addWidget(resetAndHandSizeContainerWidget);
|
||||||
|
|
||||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
||||||
layout->addWidget(flowWidget);
|
layout->addWidget(flowWidget);
|
||||||
|
|
||||||
for (CardInfoPtr card : getRandomCards(7)) {
|
cardSizeWidget = new CardSizeWidget(this, flowWidget);
|
||||||
|
layout->addWidget(cardSizeWidget);
|
||||||
|
|
||||||
|
for (CardInfoPtr card : getRandomCards(handSizeSpinBox->value())) {
|
||||||
auto displayWidget = new CardInfoPictureWidget(this);
|
auto displayWidget = new CardInfoPictureWidget(this);
|
||||||
displayWidget->setCard(card);
|
displayWidget->setCard(card);
|
||||||
|
displayWidget->setScaleFactor(cardSizeWidget->getSlider()->value());
|
||||||
flowWidget->addWidget(displayWidget);
|
flowWidget->addWidget(displayWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retranslateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDeckEditorSampleHandWidget::retranslateUi()
|
void VisualDeckEditorSampleHandWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
resetButton->setText(tr("Reset"));
|
resetButton->setText(tr("Draw a new sample hand"));
|
||||||
|
handSizeSpinBox->setToolTip(tr("Sample hand size"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDeckEditorSampleHandWidget::setDeckModel(DeckListModel *deckModel)
|
void VisualDeckEditorSampleHandWidget::setDeckModel(DeckListModel *deckModel)
|
||||||
|
|
@ -41,9 +64,12 @@ void VisualDeckEditorSampleHandWidget::setDeckModel(DeckListModel *deckModel)
|
||||||
void VisualDeckEditorSampleHandWidget::updateDisplay()
|
void VisualDeckEditorSampleHandWidget::updateDisplay()
|
||||||
{
|
{
|
||||||
flowWidget->clearLayout();
|
flowWidget->clearLayout();
|
||||||
for (CardInfoPtr card : getRandomCards(7)) {
|
for (CardInfoPtr card : getRandomCards(handSizeSpinBox->value())) {
|
||||||
auto displayWidget = new CardInfoPictureWidget(this);
|
auto displayWidget = new CardInfoPictureWidget(this);
|
||||||
displayWidget->setCard(card);
|
displayWidget->setCard(card);
|
||||||
|
displayWidget->setScaleFactor(cardSizeWidget->getSlider()->value());
|
||||||
|
connect(cardSizeWidget->getSlider(), &QSlider::valueChanged, displayWidget,
|
||||||
|
&CardInfoPictureWidget::setScaleFactor);
|
||||||
flowWidget->addWidget(displayWidget);
|
flowWidget->addWidget(displayWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
#ifndef VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
#ifndef VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
||||||
#define VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
#define VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
||||||
|
|
||||||
|
#include "../../../../client/ui/widgets/cards/card_size_widget.h"
|
||||||
#include "../../../../deck/deck_list_model.h"
|
#include "../../../../deck/deck_list_model.h"
|
||||||
#include "../general/layout_containers/flow_widget.h"
|
#include "../general/layout_containers/flow_widget.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class VisualDeckEditorSampleHandWidget : public QWidget
|
class VisualDeckEditorSampleHandWidget : public QWidget
|
||||||
|
|
@ -22,8 +24,12 @@ public slots:
|
||||||
private:
|
private:
|
||||||
DeckListModel *deckListModel;
|
DeckListModel *deckListModel;
|
||||||
QVBoxLayout *layout;
|
QVBoxLayout *layout;
|
||||||
|
QWidget *resetAndHandSizeContainerWidget;
|
||||||
|
QHBoxLayout *resetAndHandSizeLayout;
|
||||||
QPushButton *resetButton;
|
QPushButton *resetButton;
|
||||||
|
QSpinBox *handSizeSpinBox;
|
||||||
FlowWidget *flowWidget;
|
FlowWidget *flowWidget;
|
||||||
|
CardSizeWidget *cardSizeWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
#endif // VISUAL_DECK_EDITOR_SAMPLE_HAND_WIDGET_H
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,12 @@ void VisualDeckEditorWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
sortLabel->setText(tr("Click and drag to change the sort order within the groups"));
|
sortLabel->setText(tr("Click and drag to change the sort order within the groups"));
|
||||||
searchPushButton->setText(tr("Quick search and add card"));
|
searchPushButton->setText(tr("Quick search and add card"));
|
||||||
|
searchPushButton->setToolTip(tr("Search for closest match in the database (with auto-suggestions) and add "
|
||||||
|
"preferred printing to the deck on pressing enter"));
|
||||||
|
sortCriteriaButton->setToolTip(tr("Configure how cards are sorted within their groups"));
|
||||||
displayTypeButton->setText(tr("Flat Layout"));
|
displayTypeButton->setText(tr("Flat Layout"));
|
||||||
|
displayTypeButton->setToolTip(
|
||||||
|
tr("Change how cards are displayed within zones (i.e. overlapped or fully visible.)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDeckEditorWidget::updateZoneWidgets()
|
void VisualDeckEditorWidget::updateZoneWidgets()
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ void DeckPreviewColorIdentityFilterWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
// Set the toggle button text based on the current mode
|
// Set the toggle button text based on the current mode
|
||||||
toggleButton->setText(exactMatchMode ? tr("Mode: Exact Match") : tr("Mode: Includes"));
|
toggleButton->setText(exactMatchMode ? tr("Mode: Exact Match") : tr("Mode: Includes"));
|
||||||
|
toggleButton->setToolTip(tr("Color identity filter mode (AND/OR/NOT conjunctions of filters)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckPreviewColorIdentityFilterWidget::handleColorToggled(QChar color, bool active)
|
void DeckPreviewColorIdentityFilterWidget::handleColorToggled(QChar color, bool active)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
DeckPreviewTagDisplayWidget::DeckPreviewTagDisplayWidget(QWidget *parent, const QString &_tagName)
|
DeckPreviewTagDisplayWidget::DeckPreviewTagDisplayWidget(QWidget *parent, const QString &_tagName)
|
||||||
: QWidget(parent), tagName(_tagName), isSelected(false)
|
: QWidget(parent), tagName(_tagName), state(TagState::NotSelected)
|
||||||
{
|
{
|
||||||
// Create layout
|
// Create layout
|
||||||
auto *layout = new QHBoxLayout(this);
|
auto *layout = new QHBoxLayout(this);
|
||||||
|
|
@ -48,36 +48,58 @@ QSize DeckPreviewTagDisplayWidget::sizeHint() const
|
||||||
|
|
||||||
void DeckPreviewTagDisplayWidget::mousePressEvent(QMouseEvent *event)
|
void DeckPreviewTagDisplayWidget::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton) {
|
switch (event->button()) {
|
||||||
setSelected(!isSelected);
|
case Qt::LeftButton:
|
||||||
emit tagClicked();
|
setState(TagState::Selected);
|
||||||
|
break;
|
||||||
|
case Qt::RightButton:
|
||||||
|
setState(TagState::Excluded);
|
||||||
|
break;
|
||||||
|
case Qt::MiddleButton:
|
||||||
|
setState(TagState::NotSelected);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
QWidget::mousePressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DeckPreviewTagDisplayWidget::setSelected(bool selected)
|
emit tagClicked();
|
||||||
{
|
QWidget::mousePressEvent(event);
|
||||||
isSelected = selected;
|
|
||||||
update(); // Trigger a repaint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckPreviewTagDisplayWidget::paintEvent(QPaintEvent *event)
|
void DeckPreviewTagDisplayWidget::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
// Set background color
|
QColor backgroundColor;
|
||||||
QColor backgroundColor = isSelected ? QColor(173, 216, 230) : Qt::white;
|
QColor borderColor;
|
||||||
|
int borderWidth;
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
case TagState::Selected:
|
||||||
|
backgroundColor = QColor(173, 216, 230); // Light blue
|
||||||
|
borderColor = Qt::blue;
|
||||||
|
borderWidth = 2;
|
||||||
|
break;
|
||||||
|
case TagState::Excluded:
|
||||||
|
backgroundColor = QColor(255, 182, 193); // Light red/pink
|
||||||
|
borderColor = Qt::red;
|
||||||
|
borderWidth = 2;
|
||||||
|
break;
|
||||||
|
case TagState::NotSelected:
|
||||||
|
default:
|
||||||
|
backgroundColor = Qt::white;
|
||||||
|
borderColor = Qt::gray;
|
||||||
|
borderWidth = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
painter.setBrush(backgroundColor);
|
painter.setBrush(backgroundColor);
|
||||||
painter.setPen(Qt::NoPen);
|
painter.setPen(Qt::NoPen);
|
||||||
|
|
||||||
// Draw background
|
|
||||||
painter.drawRect(rect());
|
painter.drawRect(rect());
|
||||||
|
|
||||||
// Draw border
|
QPen borderPen(borderColor, borderWidth);
|
||||||
QColor borderColor = isSelected ? Qt::blue : Qt::gray;
|
|
||||||
QPen borderPen(borderColor, isSelected ? 2 : 1);
|
|
||||||
painter.setPen(borderPen);
|
painter.setPen(borderPen);
|
||||||
painter.drawRect(rect().adjusted(0, 0, -1, -1)); // Adjust for pen width
|
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||||
|
|
||||||
// Calculate font size based on widget height
|
// Calculate font size based on widget height
|
||||||
QFont font = painter.font();
|
QFont font = painter.font();
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
enum class TagState
|
||||||
|
{
|
||||||
|
NotSelected,
|
||||||
|
Selected,
|
||||||
|
Excluded
|
||||||
|
};
|
||||||
|
|
||||||
class DeckPreviewTagDisplayWidget : public QWidget
|
class DeckPreviewTagDisplayWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -22,16 +29,16 @@ public:
|
||||||
{
|
{
|
||||||
return tagName;
|
return tagName;
|
||||||
}
|
}
|
||||||
bool getSelected() const
|
TagState getState() const
|
||||||
{
|
{
|
||||||
return isSelected;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void setState(const TagState newState)
|
||||||
* @brief Sets the selected state of the tag.
|
{
|
||||||
* @param selected True if the tag is selected, false otherwise.
|
state = newState;
|
||||||
*/
|
update();
|
||||||
void setSelected(bool selected);
|
};
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,7 +68,7 @@ private:
|
||||||
QLabel *tagLabel; ///< Label for displaying the tag name.
|
QLabel *tagLabel; ///< Label for displaying the tag name.
|
||||||
QPushButton *closeButton; ///< Button to close/remove the tag.
|
QPushButton *closeButton; ///< Button to close/remove the tag.
|
||||||
QString tagName; ///< The name of the tag.
|
QString tagName; ///< The name of the tag.
|
||||||
bool isSelected; ///< Indicates whether the tag is selected.
|
TagState state; ///< Indicates whether the tag is unselected, selected, or excluded.
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DECK_PREVIEW_TAG_DISPLAY_WIDGET_H
|
#endif // DECK_PREVIEW_TAG_DISPLAY_WIDGET_H
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
#include "../visual_deck_storage_widget.h"
|
#include "../visual_deck_storage_widget.h"
|
||||||
#include "deck_preview_deck_tags_display_widget.h"
|
#include "deck_preview_deck_tags_display_widget.h"
|
||||||
|
|
||||||
|
#include <QAbstractItemView>
|
||||||
|
#include <QApplication>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
@ -74,7 +76,22 @@ protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override
|
bool eventFilter(QObject *obj, QEvent *event) override
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::Wheel) {
|
if (event->type() == QEvent::Wheel) {
|
||||||
return true; // Blocks the event
|
if (auto *combo = qobject_cast<QComboBox *>(obj)) {
|
||||||
|
// If popup is not open, forward event to parent scroll area
|
||||||
|
if (!combo->view()->isVisible()) {
|
||||||
|
// Try to find a scrollable parent and manually send the event
|
||||||
|
QWidget *parent = combo->parentWidget();
|
||||||
|
while (parent) {
|
||||||
|
if (auto *scroll = qobject_cast<QAbstractScrollArea *>(parent)) {
|
||||||
|
QApplication::sendEvent(scroll->viewport(), event);
|
||||||
|
return true; // Mark event as handled
|
||||||
|
}
|
||||||
|
parent = parent->parentWidget();
|
||||||
|
}
|
||||||
|
// If no scrollable parent found, just block
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return QObject::eventFilter(obj, event);
|
return QObject::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,9 @@ void VisualDeckStorageFolderDisplayWidget::createWidgetsForFiles()
|
||||||
&VisualDeckStorageWidget::deckLoadRequested);
|
&VisualDeckStorageWidget::deckLoadRequested);
|
||||||
connect(display, &DeckPreviewWidget::openDeckEditor, visualDeckStorageWidget,
|
connect(display, &DeckPreviewWidget::openDeckEditor, visualDeckStorageWidget,
|
||||||
&VisualDeckStorageWidget::openDeckEditor);
|
&VisualDeckStorageWidget::openDeckEditor);
|
||||||
connect(visualDeckStorageWidget->cardSizeWidget->getSlider(), &QSlider::valueChanged,
|
connect(visualDeckStorageWidget->settings(), &VisualDeckStorageQuickSettingsWidget::cardSizeChanged,
|
||||||
display->bannerCardDisplayWidget, &CardInfoPictureWidget::setScaleFactor);
|
display->bannerCardDisplayWidget, &CardInfoPictureWidget::setScaleFactor);
|
||||||
display->bannerCardDisplayWidget->setScaleFactor(visualDeckStorageWidget->cardSizeWidget->getSlider()->value());
|
display->bannerCardDisplayWidget->setScaleFactor(visualDeckStorageWidget->settings()->getCardSize());
|
||||||
allDecks.append(display);
|
allDecks.append(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
#include "visual_deck_storage_quick_settings_widget.h"
|
||||||
|
|
||||||
|
#include "../../../../settings/cache_settings.h"
|
||||||
|
#include "visual_deck_storage_widget.h"
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QSpinBox>
|
||||||
|
|
||||||
|
VisualDeckStorageQuickSettingsWidget::VisualDeckStorageQuickSettingsWidget(QWidget *parent)
|
||||||
|
: SettingsButtonWidget(parent)
|
||||||
|
{
|
||||||
|
// show folders checkbox
|
||||||
|
showFoldersCheckBox = new QCheckBox(this);
|
||||||
|
showFoldersCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowFolders());
|
||||||
|
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::showFoldersChanged);
|
||||||
|
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageShowFolders);
|
||||||
|
|
||||||
|
// show tag filter widget checkbox
|
||||||
|
showTagFilterCheckBox = new QCheckBox(this);
|
||||||
|
showTagFilterCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowTagFilter());
|
||||||
|
connect(showTagFilterCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::showTagFilterChanged);
|
||||||
|
connect(showTagFilterCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageShowTagFilter);
|
||||||
|
|
||||||
|
// show tags on DeckPreviewWidget checkbox
|
||||||
|
showTagsOnDeckPreviewsCheckBox = new QCheckBox(this);
|
||||||
|
showTagsOnDeckPreviewsCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowTagsOnDeckPreviews());
|
||||||
|
connect(showTagsOnDeckPreviewsCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::showTagsOnDeckPreviewsChanged);
|
||||||
|
connect(showTagsOnDeckPreviewsCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageShowTagsOnDeckPreviews);
|
||||||
|
|
||||||
|
// show banner card selector checkbox
|
||||||
|
showBannerCardComboBoxCheckBox = new QCheckBox(this);
|
||||||
|
showBannerCardComboBoxCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowBannerCardComboBox());
|
||||||
|
connect(showBannerCardComboBoxCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::showBannerCardComboBoxChanged);
|
||||||
|
connect(showBannerCardComboBoxCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageShowBannerCardComboBox);
|
||||||
|
|
||||||
|
// search folder names checkbox
|
||||||
|
searchFolderNamesCheckBox = new QCheckBox(this);
|
||||||
|
searchFolderNamesCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageSearchFolderNames());
|
||||||
|
connect(searchFolderNamesCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::searchFolderNamesChanged);
|
||||||
|
connect(searchFolderNamesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageSearchFolderNames);
|
||||||
|
|
||||||
|
// draw unused color identities checkbox
|
||||||
|
drawUnusedColorIdentitiesCheckBox = new QCheckBox(this);
|
||||||
|
drawUnusedColorIdentitiesCheckBox->setChecked(
|
||||||
|
SettingsCache::instance().getVisualDeckStorageDrawUnusedColorIdentities());
|
||||||
|
connect(drawUnusedColorIdentitiesCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::drawUnusedColorIdentitiesChanged);
|
||||||
|
connect(drawUnusedColorIdentitiesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageDrawUnusedColorIdentities);
|
||||||
|
|
||||||
|
// color identity opacity selector
|
||||||
|
auto unusedColorIdentityOpacityWidget = new QWidget(this);
|
||||||
|
|
||||||
|
unusedColorIdentitiesOpacityLabel = new QLabel(unusedColorIdentityOpacityWidget);
|
||||||
|
unusedColorIdentitiesOpacitySpinBox = new QSpinBox(unusedColorIdentityOpacityWidget);
|
||||||
|
|
||||||
|
unusedColorIdentitiesOpacitySpinBox->setMinimum(0);
|
||||||
|
unusedColorIdentitiesOpacitySpinBox->setMaximum(100);
|
||||||
|
unusedColorIdentitiesOpacitySpinBox->setValue(
|
||||||
|
SettingsCache::instance().getVisualDeckStorageUnusedColorIdentitiesOpacity());
|
||||||
|
connect(unusedColorIdentitiesOpacitySpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::unusedColorIdentitiesOpacityChanged);
|
||||||
|
connect(unusedColorIdentitiesOpacitySpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
|
&SettingsCache::instance(), &SettingsCache::setVisualDeckStorageUnusedColorIdentitiesOpacity);
|
||||||
|
|
||||||
|
unusedColorIdentitiesOpacityLabel->setBuddy(unusedColorIdentitiesOpacitySpinBox);
|
||||||
|
|
||||||
|
auto unusedColorIdentityOpacityLayout = new QHBoxLayout(unusedColorIdentityOpacityWidget);
|
||||||
|
unusedColorIdentityOpacityLayout->setContentsMargins(11, 0, 11, 0);
|
||||||
|
unusedColorIdentityOpacityLayout->addWidget(unusedColorIdentitiesOpacityLabel);
|
||||||
|
unusedColorIdentityOpacityLayout->addWidget(unusedColorIdentitiesOpacitySpinBox);
|
||||||
|
|
||||||
|
// card size slider
|
||||||
|
cardSizeWidget = new CardSizeWidget(this, nullptr, SettingsCache::instance().getVisualDeckStorageCardSize());
|
||||||
|
connect(cardSizeWidget->getSlider(), &QSlider::valueChanged, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::cardSizeChanged);
|
||||||
|
connect(cardSizeWidget, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setVisualDeckStorageCardSize);
|
||||||
|
|
||||||
|
// putting everything together
|
||||||
|
this->addSettingsWidget(showFoldersCheckBox);
|
||||||
|
this->addSettingsWidget(showTagFilterCheckBox);
|
||||||
|
this->addSettingsWidget(showTagsOnDeckPreviewsCheckBox);
|
||||||
|
this->addSettingsWidget(showBannerCardComboBoxCheckBox);
|
||||||
|
this->addSettingsWidget(searchFolderNamesCheckBox);
|
||||||
|
this->addSettingsWidget(drawUnusedColorIdentitiesCheckBox);
|
||||||
|
this->addSettingsWidget(unusedColorIdentityOpacityWidget);
|
||||||
|
this->addSettingsWidget(cardSizeWidget);
|
||||||
|
|
||||||
|
connect(&SettingsCache::instance(), &SettingsCache::langChanged, this,
|
||||||
|
&VisualDeckStorageQuickSettingsWidget::retranslateUi);
|
||||||
|
retranslateUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VisualDeckStorageQuickSettingsWidget::retranslateUi()
|
||||||
|
{
|
||||||
|
showFoldersCheckBox->setText(tr("Show Folders"));
|
||||||
|
showTagFilterCheckBox->setText(tr("Show Tag Filter"));
|
||||||
|
showTagsOnDeckPreviewsCheckBox->setText(tr("Show Tags On Deck Previews"));
|
||||||
|
showBannerCardComboBoxCheckBox->setText(tr("Show Banner Card Selection Option"));
|
||||||
|
searchFolderNamesCheckBox->setText(tr("Include Folder Names in Search"));
|
||||||
|
drawUnusedColorIdentitiesCheckBox->setText(tr("Draw unused Color Identities"));
|
||||||
|
unusedColorIdentitiesOpacityLabel->setText(tr("Unused Color Identities Opacity"));
|
||||||
|
unusedColorIdentitiesOpacitySpinBox->setSuffix("%");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getShowFolders() const
|
||||||
|
{
|
||||||
|
return showFoldersCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getDrawUnusedColorIdentities() const
|
||||||
|
{
|
||||||
|
return drawUnusedColorIdentitiesCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getShowBannerCardComboBox() const
|
||||||
|
{
|
||||||
|
return showBannerCardComboBoxCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getShowTagFilter() const
|
||||||
|
{
|
||||||
|
return showTagFilterCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getShowTagsOnDeckPreviews() const
|
||||||
|
{
|
||||||
|
return showTagsOnDeckPreviewsCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisualDeckStorageQuickSettingsWidget::getSearchFolderNames() const
|
||||||
|
{
|
||||||
|
return searchFolderNamesCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
int VisualDeckStorageQuickSettingsWidget::getUnusedColorIdentitiesOpacity() const
|
||||||
|
{
|
||||||
|
return unusedColorIdentitiesOpacitySpinBox->value();
|
||||||
|
}
|
||||||
|
|
||||||
|
int VisualDeckStorageQuickSettingsWidget::getCardSize() const
|
||||||
|
{
|
||||||
|
return cardSizeWidget->getSlider()->value();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
#ifndef VISUAL_DECK_STORAGE_QUICK_SETTINGS_WIDGET_H
|
||||||
|
#define VISUAL_DECK_STORAGE_QUICK_SETTINGS_WIDGET_H
|
||||||
|
|
||||||
|
#include "../quick_settings/settings_button_widget.h"
|
||||||
|
|
||||||
|
class CardSizeWidget;
|
||||||
|
class QLabel;
|
||||||
|
class QSpinBox;
|
||||||
|
class QCheckBox;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The VDS's quick settings menu.
|
||||||
|
* Manages the widgets in the quick settings menu dropdown, as well as syncing their values with SettingsCache.
|
||||||
|
* The current values of the settings are exposed through getters and signals.
|
||||||
|
*/
|
||||||
|
class VisualDeckStorageQuickSettingsWidget : public SettingsButtonWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
QCheckBox *showFoldersCheckBox;
|
||||||
|
QCheckBox *drawUnusedColorIdentitiesCheckBox;
|
||||||
|
QCheckBox *showBannerCardComboBoxCheckBox;
|
||||||
|
QCheckBox *showTagFilterCheckBox;
|
||||||
|
QCheckBox *showTagsOnDeckPreviewsCheckBox;
|
||||||
|
QCheckBox *searchFolderNamesCheckBox;
|
||||||
|
QLabel *unusedColorIdentitiesOpacityLabel;
|
||||||
|
QSpinBox *unusedColorIdentitiesOpacitySpinBox;
|
||||||
|
CardSizeWidget *cardSizeWidget;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit VisualDeckStorageQuickSettingsWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
void retranslateUi();
|
||||||
|
|
||||||
|
bool getShowFolders() const;
|
||||||
|
bool getDrawUnusedColorIdentities() const;
|
||||||
|
bool getShowBannerCardComboBox() const;
|
||||||
|
bool getShowTagFilter() const;
|
||||||
|
bool getShowTagsOnDeckPreviews() const;
|
||||||
|
bool getSearchFolderNames() const;
|
||||||
|
int getUnusedColorIdentitiesOpacity() const;
|
||||||
|
int getCardSize() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void showFoldersChanged(bool enabled);
|
||||||
|
void drawUnusedColorIdentitiesChanged(bool enabled);
|
||||||
|
void showBannerCardComboBoxChanged(bool enabled);
|
||||||
|
void showTagFilterChanged(bool enabled);
|
||||||
|
void showTagsOnDeckPreviewsChanged(bool enabled);
|
||||||
|
void searchFolderNamesChanged(bool enabled);
|
||||||
|
void unusedColorIdentitiesOpacityChanged(int opacity);
|
||||||
|
void cardSizeChanged(int scale);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // VISUAL_DECK_STORAGE_QUICK_SETTINGS_WIDGET_H
|
||||||
|
|
@ -33,32 +33,42 @@ void VisualDeckStorageTagFilterWidget::showEvent(QShowEvent *event)
|
||||||
|
|
||||||
void VisualDeckStorageTagFilterWidget::filterDecksBySelectedTags(const QList<DeckPreviewWidget *> &deckPreviews) const
|
void VisualDeckStorageTagFilterWidget::filterDecksBySelectedTags(const QList<DeckPreviewWidget *> &deckPreviews) const
|
||||||
{
|
{
|
||||||
// Collect selected tags from DeckPreviewTagDisplayWidget
|
|
||||||
QStringList selectedTags;
|
QStringList selectedTags;
|
||||||
|
QStringList excludedTags;
|
||||||
|
|
||||||
|
// Collect selected and excluded tags
|
||||||
for (DeckPreviewTagDisplayWidget *tagWidget : findChildren<DeckPreviewTagDisplayWidget *>()) {
|
for (DeckPreviewTagDisplayWidget *tagWidget : findChildren<DeckPreviewTagDisplayWidget *>()) {
|
||||||
if (tagWidget->getSelected()) {
|
switch (tagWidget->getState()) {
|
||||||
selectedTags.append(tagWidget->getTagName());
|
case TagState::Selected:
|
||||||
|
selectedTags.append(tagWidget->getTagName());
|
||||||
|
break;
|
||||||
|
case TagState::Excluded:
|
||||||
|
excludedTags.append(tagWidget->getTagName());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no tags are selected, set all decks as visible
|
// If no tags are selected or excluded, show all
|
||||||
if (selectedTags.isEmpty()) {
|
if (selectedTags.isEmpty() && excludedTags.isEmpty()) {
|
||||||
for (DeckPreviewWidget *deckPreview : deckPreviews) {
|
for (DeckPreviewWidget *deckPreview : deckPreviews) {
|
||||||
deckPreview->filteredByTags = false;
|
deckPreview->filteredByTags = false;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter DeckPreviewWidgets that contain all of the selected tags
|
|
||||||
QList<DeckPreviewWidget *> filteredDecks;
|
|
||||||
for (DeckPreviewWidget *deckPreview : deckPreviews) {
|
for (DeckPreviewWidget *deckPreview : deckPreviews) {
|
||||||
QStringList deckTags = deckPreview->deckLoader->getTags();
|
QStringList deckTags = deckPreview->deckLoader->getTags();
|
||||||
|
|
||||||
// Check if all selectedTags are in deckTags
|
bool hasAllSelected = std::all_of(selectedTags.begin(), selectedTags.end(),
|
||||||
bool allTagsPresent = std::all_of(selectedTags.begin(), selectedTags.end(),
|
|
||||||
[&deckTags](const QString &tag) { return deckTags.contains(tag); });
|
[&deckTags](const QString &tag) { return deckTags.contains(tag); });
|
||||||
|
|
||||||
deckPreview->filteredByTags = !allTagsPresent;
|
bool hasAnyExcluded = std::any_of(excludedTags.begin(), excludedTags.end(),
|
||||||
|
[&deckTags](const QString &tag) { return deckTags.contains(tag); });
|
||||||
|
|
||||||
|
// Filter out if any excluded tag is present or if any selected tag is missing
|
||||||
|
deckPreview->filteredByTags = !(hasAllSelected && !hasAnyExcluded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,13 +82,15 @@ void VisualDeckStorageTagFilterWidget::refreshTags()
|
||||||
|
|
||||||
void VisualDeckStorageTagFilterWidget::removeTagsNotInList(const QSet<QString> &tags)
|
void VisualDeckStorageTagFilterWidget::removeTagsNotInList(const QSet<QString> &tags)
|
||||||
{
|
{
|
||||||
// Iterate through all DeckPreviewTagDisplayWidgets
|
auto *flowWidget = findChild<FlowWidget *>();
|
||||||
|
|
||||||
for (DeckPreviewTagDisplayWidget *tagWidget : findChildren<DeckPreviewTagDisplayWidget *>()) {
|
for (DeckPreviewTagDisplayWidget *tagWidget : findChildren<DeckPreviewTagDisplayWidget *>()) {
|
||||||
// If the tag is not in the provided tags list, remove the widget
|
const QString &tagName = tagWidget->getTagName();
|
||||||
if (!tags.contains(tagWidget->getTagName())) {
|
|
||||||
auto *flowWidget = findChild<FlowWidget *>();
|
// Keep the tag widget if it is either selected or excluded
|
||||||
|
if (!tags.contains(tagName) && tagWidget->getState() == TagState::NotSelected) {
|
||||||
flowWidget->removeWidget(tagWidget);
|
flowWidget->removeWidget(tagWidget);
|
||||||
tagWidget->deleteLater(); // Safely delete the widget
|
tagWidget->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,79 +41,13 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
||||||
refreshButton->setFixedSize(32, 32);
|
refreshButton->setFixedSize(32, 32);
|
||||||
connect(refreshButton, &QPushButton::clicked, this, &VisualDeckStorageWidget::refreshIfPossible);
|
connect(refreshButton, &QPushButton::clicked, this, &VisualDeckStorageWidget::refreshIfPossible);
|
||||||
|
|
||||||
// quick settings menu
|
quickSettingsWidget = new VisualDeckStorageQuickSettingsWidget(this);
|
||||||
showFoldersCheckBox = new QCheckBox(this);
|
connect(quickSettingsWidget, &VisualDeckStorageQuickSettingsWidget::showFoldersChanged, this,
|
||||||
showFoldersCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowFolders());
|
&VisualDeckStorageWidget::updateShowFolders);
|
||||||
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &VisualDeckStorageWidget::updateShowFolders);
|
connect(quickSettingsWidget, &VisualDeckStorageQuickSettingsWidget::showTagFilterChanged, this,
|
||||||
connect(showFoldersCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
|
||||||
&SettingsCache::setVisualDeckStorageShowFolders);
|
|
||||||
|
|
||||||
tagFilterVisibilityCheckBox = new QCheckBox(this);
|
|
||||||
tagFilterVisibilityCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowTagFilter());
|
|
||||||
connect(tagFilterVisibilityCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
|
||||||
&VisualDeckStorageWidget::updateTagsVisibility);
|
&VisualDeckStorageWidget::updateTagsVisibility);
|
||||||
connect(tagFilterVisibilityCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
connect(quickSettingsWidget, &VisualDeckStorageQuickSettingsWidget::searchFolderNamesChanged, this,
|
||||||
&SettingsCache::setVisualDeckStorageShowTagFilter);
|
|
||||||
|
|
||||||
tagsOnWidgetsVisibilityCheckBox = new QCheckBox(this);
|
|
||||||
tagsOnWidgetsVisibilityCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageShowTagsOnDeckPreviews());
|
|
||||||
connect(tagsOnWidgetsVisibilityCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
|
||||||
&SettingsCache::setVisualDeckStorageShowTagsOnDeckPreviews);
|
|
||||||
|
|
||||||
drawUnusedColorIdentitiesCheckBox = new QCheckBox(this);
|
|
||||||
drawUnusedColorIdentitiesCheckBox->setChecked(
|
|
||||||
SettingsCache::instance().getVisualDeckStorageDrawUnusedColorIdentities());
|
|
||||||
connect(drawUnusedColorIdentitiesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
|
||||||
&SettingsCache::setVisualDeckStorageDrawUnusedColorIdentities);
|
|
||||||
|
|
||||||
bannerCardComboBoxVisibilityCheckBox = new QCheckBox(this);
|
|
||||||
bannerCardComboBoxVisibilityCheckBox->setChecked(
|
|
||||||
SettingsCache::instance().getVisualDeckStorageShowBannerCardComboBox());
|
|
||||||
connect(bannerCardComboBoxVisibilityCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
|
||||||
&SettingsCache::setVisualDeckStorageShowBannerCardComboBox);
|
|
||||||
|
|
||||||
searchFolderNamesCheckBox = new QCheckBox(this);
|
|
||||||
searchFolderNamesCheckBox->setChecked(SettingsCache::instance().getVisualDeckStorageSearchFolderNames());
|
|
||||||
connect(searchFolderNamesCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
|
||||||
&VisualDeckStorageWidget::updateSearchFilter);
|
&VisualDeckStorageWidget::updateSearchFilter);
|
||||||
connect(searchFolderNamesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
|
||||||
&SettingsCache::setVisualDeckStorageSearchFolderNames);
|
|
||||||
|
|
||||||
// color identity opacity selector
|
|
||||||
auto unusedColorIdentityOpacityWidget = new QWidget(this);
|
|
||||||
|
|
||||||
unusedColorIdentitiesOpacityLabel = new QLabel(unusedColorIdentityOpacityWidget);
|
|
||||||
unusedColorIdentitiesOpacitySpinBox = new QSpinBox(unusedColorIdentityOpacityWidget);
|
|
||||||
|
|
||||||
unusedColorIdentitiesOpacitySpinBox->setMinimum(0);
|
|
||||||
unusedColorIdentitiesOpacitySpinBox->setMaximum(100);
|
|
||||||
unusedColorIdentitiesOpacitySpinBox->setValue(
|
|
||||||
SettingsCache::instance().getVisualDeckStorageUnusedColorIdentitiesOpacity());
|
|
||||||
connect(unusedColorIdentitiesOpacitySpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
|
||||||
&SettingsCache::instance(), &SettingsCache::setVisualDeckStorageUnusedColorIdentitiesOpacity);
|
|
||||||
|
|
||||||
unusedColorIdentitiesOpacityLabel->setBuddy(unusedColorIdentitiesOpacitySpinBox);
|
|
||||||
|
|
||||||
unusedColorIdentitiesOpacitySpinBox->setValue(
|
|
||||||
SettingsCache::instance().getVisualDeckStorageUnusedColorIdentitiesOpacity());
|
|
||||||
|
|
||||||
auto unusedColorIdentityOpacityLayout = new QHBoxLayout(unusedColorIdentityOpacityWidget);
|
|
||||||
unusedColorIdentityOpacityLayout->setContentsMargins(11, 0, 11, 0);
|
|
||||||
unusedColorIdentityOpacityLayout->addWidget(unusedColorIdentitiesOpacityLabel);
|
|
||||||
unusedColorIdentityOpacityLayout->addWidget(unusedColorIdentitiesOpacitySpinBox);
|
|
||||||
|
|
||||||
// card size slider
|
|
||||||
cardSizeWidget = new CardSizeWidget(this, nullptr, SettingsCache::instance().getVisualDeckStorageCardSize());
|
|
||||||
|
|
||||||
quickSettingsWidget = new SettingsButtonWidget(this);
|
|
||||||
quickSettingsWidget->addSettingsWidget(showFoldersCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(tagFilterVisibilityCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(tagsOnWidgetsVisibilityCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(bannerCardComboBoxVisibilityCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(searchFolderNamesCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(drawUnusedColorIdentitiesCheckBox);
|
|
||||||
quickSettingsWidget->addSettingsWidget(unusedColorIdentityOpacityWidget);
|
|
||||||
quickSettingsWidget->addSettingsWidget(cardSizeWidget);
|
|
||||||
|
|
||||||
searchAndSortLayout->addWidget(deckPreviewColorIdentityFilterWidget);
|
searchAndSortLayout->addWidget(deckPreviewColorIdentityFilterWidget);
|
||||||
searchAndSortLayout->addWidget(sortWidget);
|
searchAndSortLayout->addWidget(sortWidget);
|
||||||
|
|
@ -186,14 +120,16 @@ void VisualDeckStorageWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
databaseLoadIndicator->setText(tr("Loading database ..."));
|
databaseLoadIndicator->setText(tr("Loading database ..."));
|
||||||
|
|
||||||
showFoldersCheckBox->setText(tr("Show Folders"));
|
refreshButton->setToolTip(tr("Refresh loaded files"));
|
||||||
tagFilterVisibilityCheckBox->setText(tr("Show Tag Filter"));
|
quickSettingsWidget->setToolTip(tr("Visual Deck Storage Settings"));
|
||||||
tagsOnWidgetsVisibilityCheckBox->setText(tr("Show Tags On Deck Previews"));
|
}
|
||||||
bannerCardComboBoxVisibilityCheckBox->setText(tr("Show Banner Card Selection Option"));
|
|
||||||
searchFolderNamesCheckBox->setText(tr("Include Folder Names in Search"));
|
/**
|
||||||
drawUnusedColorIdentitiesCheckBox->setText(tr("Draw unused Color Identities"));
|
* Gets a const pointer to the quick settings so that the values can be accessed.
|
||||||
unusedColorIdentitiesOpacityLabel->setText(tr("Unused Color Identities Opacity"));
|
*/
|
||||||
unusedColorIdentitiesOpacitySpinBox->setSuffix("%");
|
const VisualDeckStorageQuickSettingsWidget *VisualDeckStorageWidget::settings() const
|
||||||
|
{
|
||||||
|
return quickSettingsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -210,7 +146,7 @@ void VisualDeckStorageWidget::reapplySortAndFilters()
|
||||||
void VisualDeckStorageWidget::createRootFolderWidget()
|
void VisualDeckStorageWidget::createRootFolderWidget()
|
||||||
{
|
{
|
||||||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false,
|
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false,
|
||||||
showFoldersCheckBox->isChecked());
|
quickSettingsWidget->getShowFolders());
|
||||||
|
|
||||||
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
||||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||||
|
|
@ -261,7 +197,7 @@ void VisualDeckStorageWidget::updateSearchFilter()
|
||||||
{
|
{
|
||||||
if (folderWidget) {
|
if (folderWidget) {
|
||||||
searchWidget->filterWidgets(folderWidget->findChildren<DeckPreviewWidget *>(), searchWidget->getSearchText(),
|
searchWidget->filterWidgets(folderWidget->findChildren<DeckPreviewWidget *>(), searchWidget->getSearchText(),
|
||||||
searchFolderNamesCheckBox->isChecked());
|
quickSettingsWidget->getSearchFolderNames());
|
||||||
folderWidget->updateVisibility();
|
folderWidget->updateVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "deck_preview/deck_preview_color_identity_filter_widget.h"
|
#include "deck_preview/deck_preview_color_identity_filter_widget.h"
|
||||||
#include "deck_preview/deck_preview_widget.h"
|
#include "deck_preview/deck_preview_widget.h"
|
||||||
#include "visual_deck_storage_folder_display_widget.h"
|
#include "visual_deck_storage_folder_display_widget.h"
|
||||||
|
#include "visual_deck_storage_quick_settings_widget.h"
|
||||||
#include "visual_deck_storage_search_widget.h"
|
#include "visual_deck_storage_search_widget.h"
|
||||||
#include "visual_deck_storage_sort_widget.h"
|
#include "visual_deck_storage_sort_widget.h"
|
||||||
#include "visual_deck_storage_tag_filter_widget.h"
|
#include "visual_deck_storage_tag_filter_widget.h"
|
||||||
|
|
@ -29,10 +30,11 @@ public:
|
||||||
void refreshIfPossible();
|
void refreshIfPossible();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
||||||
CardSizeWidget *cardSizeWidget;
|
|
||||||
VisualDeckStorageTagFilterWidget *tagFilterWidget;
|
VisualDeckStorageTagFilterWidget *tagFilterWidget;
|
||||||
bool deckPreviewSelectionAnimationEnabled;
|
bool deckPreviewSelectionAnimationEnabled;
|
||||||
|
|
||||||
|
const VisualDeckStorageQuickSettingsWidget *settings() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void createRootFolderWidget(); // Refresh the display of cards based on the current sorting option
|
void createRootFolderWidget(); // Refresh the display of cards based on the current sorting option
|
||||||
void updateShowFolders(bool enabled);
|
void updateShowFolders(bool enabled);
|
||||||
|
|
@ -60,15 +62,7 @@ private:
|
||||||
VisualDeckStorageSearchWidget *searchWidget;
|
VisualDeckStorageSearchWidget *searchWidget;
|
||||||
DeckPreviewColorIdentityFilterWidget *deckPreviewColorIdentityFilterWidget;
|
DeckPreviewColorIdentityFilterWidget *deckPreviewColorIdentityFilterWidget;
|
||||||
QToolButton *refreshButton;
|
QToolButton *refreshButton;
|
||||||
SettingsButtonWidget *quickSettingsWidget;
|
VisualDeckStorageQuickSettingsWidget *quickSettingsWidget;
|
||||||
QCheckBox *showFoldersCheckBox;
|
|
||||||
QCheckBox *drawUnusedColorIdentitiesCheckBox;
|
|
||||||
QCheckBox *bannerCardComboBoxVisibilityCheckBox;
|
|
||||||
QCheckBox *tagFilterVisibilityCheckBox;
|
|
||||||
QCheckBox *tagsOnWidgetsVisibilityCheckBox;
|
|
||||||
QCheckBox *searchFolderNamesCheckBox;
|
|
||||||
QLabel *unusedColorIdentitiesOpacityLabel;
|
|
||||||
QSpinBox *unusedColorIdentitiesOpacitySpinBox;
|
|
||||||
QScrollArea *scrollArea;
|
QScrollArea *scrollArea;
|
||||||
VisualDeckStorageFolderDisplayWidget *folderWidget;
|
VisualDeckStorageFolderDisplayWidget *folderWidget;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "../client/network/release_channel.h"
|
#include "../client/network/release_channel.h"
|
||||||
#include "../client/network/spoiler_background_updater.h"
|
#include "../client/network/spoiler_background_updater.h"
|
||||||
#include "../client/sound_engine.h"
|
#include "../client/sound_engine.h"
|
||||||
|
#include "../client/tabs/tab_supervisor.h"
|
||||||
#include "../client/ui/picture_loader/picture_loader.h"
|
#include "../client/ui/picture_loader/picture_loader.h"
|
||||||
#include "../client/ui/theme_manager.h"
|
#include "../client/ui/theme_manager.h"
|
||||||
#include "../deck/custom_line_edit.h"
|
#include "../deck/custom_line_edit.h"
|
||||||
|
|
@ -686,6 +687,10 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
&SettingsCache::setCloseEmptyCardView);
|
&SettingsCache::setCloseEmptyCardView);
|
||||||
|
|
||||||
|
focusCardViewSearchBarCheckBox.setChecked(SettingsCache::instance().getFocusCardViewSearchBar());
|
||||||
|
connect(&focusCardViewSearchBarCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setFocusCardViewSearchBar);
|
||||||
|
|
||||||
annotateTokensCheckBox.setChecked(SettingsCache::instance().getAnnotateTokens());
|
annotateTokensCheckBox.setChecked(SettingsCache::instance().getAnnotateTokens());
|
||||||
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
&SettingsCache::setAnnotateTokens);
|
&SettingsCache::setAnnotateTokens);
|
||||||
|
|
@ -699,8 +704,9 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
||||||
generalGrid->addWidget(&playToStackCheckBox, 2, 0);
|
generalGrid->addWidget(&playToStackCheckBox, 2, 0);
|
||||||
generalGrid->addWidget(&closeEmptyCardViewCheckBox, 3, 0);
|
generalGrid->addWidget(&closeEmptyCardViewCheckBox, 3, 0);
|
||||||
generalGrid->addWidget(&annotateTokensCheckBox, 4, 0);
|
generalGrid->addWidget(&focusCardViewSearchBarCheckBox, 4, 0);
|
||||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 5, 0);
|
generalGrid->addWidget(&annotateTokensCheckBox, 5, 0);
|
||||||
|
generalGrid->addWidget(&useTearOffMenusCheckBox, 6, 0);
|
||||||
|
|
||||||
generalGroupBox = new QGroupBox;
|
generalGroupBox = new QGroupBox;
|
||||||
generalGroupBox->setLayout(generalGrid);
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
|
@ -756,12 +762,20 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
index == visualDeckStoragePromptForConversionIndexAlways);
|
index == visualDeckStoragePromptForConversionIndexAlways);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defaultDeckEditorTypeSelector.addItem(""); // these will be set in retranslateUI
|
||||||
|
defaultDeckEditorTypeSelector.addItem("");
|
||||||
|
defaultDeckEditorTypeSelector.setCurrentIndex(SettingsCache::instance().getDefaultDeckEditorType());
|
||||||
|
connect(&defaultDeckEditorTypeSelector, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
|
&SettingsCache::instance(), &SettingsCache::setDefaultDeckEditorType);
|
||||||
|
|
||||||
auto *deckEditorGrid = new QGridLayout;
|
auto *deckEditorGrid = new QGridLayout;
|
||||||
deckEditorGrid->addWidget(&openDeckInNewTabCheckBox, 0, 0);
|
deckEditorGrid->addWidget(&openDeckInNewTabCheckBox, 0, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStorageInGameCheckBox, 1, 0);
|
deckEditorGrid->addWidget(&visualDeckStorageInGameCheckBox, 1, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStorageSelectionAnimationCheckBox, 2, 0);
|
deckEditorGrid->addWidget(&visualDeckStorageSelectionAnimationCheckBox, 2, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionLabel, 3, 0);
|
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionLabel, 3, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionSelector, 3, 1);
|
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionSelector, 3, 1);
|
||||||
|
deckEditorGrid->addWidget(&defaultDeckEditorTypeLabel, 4, 0);
|
||||||
|
deckEditorGrid->addWidget(&defaultDeckEditorTypeSelector, 4, 1);
|
||||||
|
|
||||||
deckEditorGroupBox = new QGroupBox;
|
deckEditorGroupBox = new QGroupBox;
|
||||||
deckEditorGroupBox->setLayout(deckEditorGrid);
|
deckEditorGroupBox->setLayout(deckEditorGrid);
|
||||||
|
|
@ -811,6 +825,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
clickPlaysAllSelectedCheckBox.setText(tr("&Clicking plays all selected cards (instead of just the clicked card)"));
|
clickPlaysAllSelectedCheckBox.setText(tr("&Clicking plays all selected cards (instead of just the clicked card)"));
|
||||||
playToStackCheckBox.setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
playToStackCheckBox.setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
||||||
closeEmptyCardViewCheckBox.setText(tr("Close card view window when last card is removed"));
|
closeEmptyCardViewCheckBox.setText(tr("Close card view window when last card is removed"));
|
||||||
|
focusCardViewSearchBarCheckBox.setText(tr("Auto focus search bar when card view window is opened"));
|
||||||
annotateTokensCheckBox.setText(tr("Annotate card text on tokens"));
|
annotateTokensCheckBox.setText(tr("Annotate card text on tokens"));
|
||||||
useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen"));
|
useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen"));
|
||||||
notificationsGroupBox->setTitle(tr("Notifications settings"));
|
notificationsGroupBox->setTitle(tr("Notifications settings"));
|
||||||
|
|
@ -831,6 +846,9 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
tr("ask to convert to .cod"));
|
tr("ask to convert to .cod"));
|
||||||
visualDeckStoragePromptForConversionSelector.setItemText(visualDeckStoragePromptForConversionIndexAlways,
|
visualDeckStoragePromptForConversionSelector.setItemText(visualDeckStoragePromptForConversionIndexAlways,
|
||||||
tr("always convert to .cod"));
|
tr("always convert to .cod"));
|
||||||
|
defaultDeckEditorTypeLabel.setText(tr("Default deck editor type"));
|
||||||
|
defaultDeckEditorTypeSelector.setItemText(TabSupervisor::ClassicDeckEditor, tr("Classic Deck Editor"));
|
||||||
|
defaultDeckEditorTypeSelector.setItemText(TabSupervisor::VisualDeckEditor, tr("Visual Deck Editor"));
|
||||||
replayGroupBox->setTitle(tr("Replay settings"));
|
replayGroupBox->setTitle(tr("Replay settings"));
|
||||||
rewindBufferingMsLabel.setText(tr("Buffer time for backwards skip via shortcut:"));
|
rewindBufferingMsLabel.setText(tr("Buffer time for backwards skip via shortcut:"));
|
||||||
rewindBufferingMsBox.setSuffix(" ms");
|
rewindBufferingMsBox.setSuffix(" ms");
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ private:
|
||||||
QCheckBox clickPlaysAllSelectedCheckBox;
|
QCheckBox clickPlaysAllSelectedCheckBox;
|
||||||
QCheckBox playToStackCheckBox;
|
QCheckBox playToStackCheckBox;
|
||||||
QCheckBox closeEmptyCardViewCheckBox;
|
QCheckBox closeEmptyCardViewCheckBox;
|
||||||
|
QCheckBox focusCardViewSearchBarCheckBox;
|
||||||
QCheckBox annotateTokensCheckBox;
|
QCheckBox annotateTokensCheckBox;
|
||||||
QCheckBox useTearOffMenusCheckBox;
|
QCheckBox useTearOffMenusCheckBox;
|
||||||
QCheckBox tapAnimationCheckBox;
|
QCheckBox tapAnimationCheckBox;
|
||||||
|
|
@ -157,6 +158,8 @@ private:
|
||||||
QComboBox visualDeckStoragePromptForConversionSelector;
|
QComboBox visualDeckStoragePromptForConversionSelector;
|
||||||
QCheckBox visualDeckStorageInGameCheckBox;
|
QCheckBox visualDeckStorageInGameCheckBox;
|
||||||
QCheckBox visualDeckStorageSelectionAnimationCheckBox;
|
QCheckBox visualDeckStorageSelectionAnimationCheckBox;
|
||||||
|
QLabel defaultDeckEditorTypeLabel;
|
||||||
|
QComboBox defaultDeckEditorTypeSelector;
|
||||||
QLabel rewindBufferingMsLabel;
|
QLabel rewindBufferingMsLabel;
|
||||||
QSpinBox rewindBufferingMsBox;
|
QSpinBox rewindBufferingMsBox;
|
||||||
QGroupBox *generalGroupBox;
|
QGroupBox *generalGroupBox;
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,40 @@
|
||||||
#include "../settings/cache_settings.h"
|
#include "../settings/cache_settings.h"
|
||||||
#include "../utility/logger.h"
|
#include "../utility/logger.h"
|
||||||
|
|
||||||
|
#include <QClipboard>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QRegularExpression>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
|
DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
logArea = new QPlainTextEdit;
|
logArea = new QPlainTextEdit;
|
||||||
logArea->setReadOnly(true);
|
logArea->setReadOnly(true);
|
||||||
|
|
||||||
auto *mainLayout = new QVBoxLayout;
|
auto *mainLayout = new QVBoxLayout;
|
||||||
|
mainLayout->setSpacing(3);
|
||||||
|
mainLayout->setContentsMargins(20, 20, 20, 6);
|
||||||
|
|
||||||
mainLayout->addWidget(logArea);
|
mainLayout->addWidget(logArea);
|
||||||
|
|
||||||
|
auto *bottomLayout = new QHBoxLayout;
|
||||||
|
|
||||||
coClearLog = new QCheckBox;
|
coClearLog = new QCheckBox;
|
||||||
coClearLog->setText(tr("Clear log when closing"));
|
coClearLog->setText(tr("Clear log when closing"));
|
||||||
coClearLog->setChecked(SettingsCache::instance().servers().getClearDebugLogStatus(false));
|
coClearLog->setChecked(SettingsCache::instance().servers().getClearDebugLogStatus(false));
|
||||||
connect(coClearLog, &QCheckBox::toggled, this, &DlgViewLog::actCheckBoxChanged);
|
connect(coClearLog, &QCheckBox::toggled, this, &DlgViewLog::actCheckBoxChanged);
|
||||||
mainLayout->addWidget(coClearLog);
|
|
||||||
|
copyToClipboardButton = new QPushButton;
|
||||||
|
copyToClipboardButton->setText(tr("Copy to clipboard"));
|
||||||
|
copyToClipboardButton->setAutoDefault(false);
|
||||||
|
connect(copyToClipboardButton, &QPushButton::clicked, this, &DlgViewLog::actCopyToClipboard);
|
||||||
|
|
||||||
|
bottomLayout->addWidget(coClearLog);
|
||||||
|
bottomLayout->addStretch();
|
||||||
|
bottomLayout->addWidget(copyToClipboardButton);
|
||||||
|
|
||||||
|
mainLayout->addLayout(bottomLayout);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
|
@ -27,7 +44,7 @@ DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
|
||||||
resize(800, 500);
|
resize(800, 500);
|
||||||
|
|
||||||
loadInitialLogBuffer();
|
loadInitialLogBuffer();
|
||||||
connect(&Logger::getInstance(), &Logger::logEntryAdded, this, &DlgViewLog::logEntryAdded);
|
connect(&Logger::getInstance(), &Logger::logEntryAdded, this, &DlgViewLog::appendLogEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgViewLog::actCheckBoxChanged(bool abNewValue)
|
void DlgViewLog::actCheckBoxChanged(bool abNewValue)
|
||||||
|
|
@ -35,16 +52,26 @@ void DlgViewLog::actCheckBoxChanged(bool abNewValue)
|
||||||
SettingsCache::instance().servers().setClearDebugLogStatus(abNewValue);
|
SettingsCache::instance().servers().setClearDebugLogStatus(abNewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DlgViewLog::actCopyToClipboard()
|
||||||
|
{
|
||||||
|
QApplication::clipboard()->setText(logArea->toPlainText());
|
||||||
|
}
|
||||||
|
|
||||||
void DlgViewLog::loadInitialLogBuffer()
|
void DlgViewLog::loadInitialLogBuffer()
|
||||||
{
|
{
|
||||||
QList<QString> logBuffer = Logger::getInstance().getLogBuffer();
|
QList<QString> logBuffer = Logger::getInstance().getLogBuffer();
|
||||||
for (const QString &message : logBuffer)
|
for (const QString &message : logBuffer)
|
||||||
logEntryAdded(message);
|
appendLogEntry(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgViewLog::logEntryAdded(QString message)
|
void DlgViewLog::appendLogEntry(const QString &message)
|
||||||
{
|
{
|
||||||
logArea->appendPlainText(message);
|
static auto colorEscapeCodePattern = QRegularExpression("\033\\[\\d+m");
|
||||||
|
|
||||||
|
QString sanitizedMessage = message;
|
||||||
|
sanitizedMessage.replace(colorEscapeCodePattern, "");
|
||||||
|
|
||||||
|
logArea->appendPlainText(sanitizedMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgViewLog::closeEvent(QCloseEvent * /* event */)
|
void DlgViewLog::closeEvent(QCloseEvent * /* event */)
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@ protected:
|
||||||
private:
|
private:
|
||||||
QPlainTextEdit *logArea;
|
QPlainTextEdit *logArea;
|
||||||
QCheckBox *coClearLog;
|
QCheckBox *coClearLog;
|
||||||
|
QPushButton *copyToClipboardButton;
|
||||||
|
|
||||||
void loadInitialLogBuffer();
|
void loadInitialLogBuffer();
|
||||||
private slots:
|
private slots:
|
||||||
void logEntryAdded(QString message);
|
void appendLogEntry(const QString &message);
|
||||||
void actCheckBoxChanged(bool abNewValue);
|
void actCheckBoxChanged(bool abNewValue);
|
||||||
|
void actCopyToClipboard();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -19,6 +19,7 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item,
|
||||||
if (parentDrag) {
|
if (parentDrag) {
|
||||||
parentDrag->addChildDrag(this);
|
parentDrag->addChildDrag(this);
|
||||||
setZValue(2000000007 + hotSpot.x() * 1000000 + hotSpot.y() * 1000 + 1000);
|
setZValue(2000000007 + hotSpot.x() * 1000000 + hotSpot.y() * 1000 + 1000);
|
||||||
|
connect(parentDrag, &QObject::destroyed, this, &AbstractCardDragItem::deleteLater);
|
||||||
} else {
|
} else {
|
||||||
hotSpot = QPointF{qBound(0.0, hotSpot.x(), static_cast<qreal>(CARD_WIDTH - 1)),
|
hotSpot = QPointF{qBound(0.0, hotSpot.x(), static_cast<qreal>(CARD_WIDTH - 1)),
|
||||||
qBound(0.0, hotSpot.y(), static_cast<qreal>(CARD_HEIGHT - 1))};
|
qBound(0.0, hotSpot.y(), static_cast<qreal>(CARD_HEIGHT - 1))};
|
||||||
|
|
@ -39,12 +40,8 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item,
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
AbstractCardDragItem::~AbstractCardDragItem()
|
connect(item, &QObject::destroyed, this, &AbstractCardDragItem::deleteLater);
|
||||||
{
|
|
||||||
for (int i = 0; i < childDrags.size(); i++)
|
|
||||||
delete childDrags[i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPainterPath AbstractCardDragItem::shape() const
|
QPainterPath AbstractCardDragItem::shape() const
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ public:
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
||||||
~AbstractCardDragItem() override;
|
|
||||||
QRectF boundingRect() const override
|
QRectF boundingRect() const override
|
||||||
{
|
{
|
||||||
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,25 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||||
cursorZone = zoneViewZone;
|
cursorZone = zoneViewZone;
|
||||||
else if (cardZone)
|
else if (cardZone)
|
||||||
cursorZone = cardZone;
|
cursorZone = cardZone;
|
||||||
if (!cursorZone)
|
|
||||||
return;
|
// Always update the current zone, even if its null, to cancel the drag
|
||||||
|
// instead of dropping cards into an non-intuitive location.
|
||||||
currentZone = cursorZone;
|
currentZone = cursorZone;
|
||||||
|
|
||||||
|
if (!cursorZone) {
|
||||||
|
// Avoid the cards getting stuck visually when not over
|
||||||
|
// any zone.
|
||||||
|
QPointF newPos = cursorScenePos - hotSpot;
|
||||||
|
|
||||||
|
if (newPos != pos()) {
|
||||||
|
for (int i = 0; i < childDrags.size(); i++)
|
||||||
|
childDrags[i]->setPos(newPos + childDrags[i]->getHotSpot());
|
||||||
|
setPos(newPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QPointF zonePos = currentZone->scenePos();
|
QPointF zonePos = currentZone->scenePos();
|
||||||
QPointF cursorPosInZone = cursorScenePos - zonePos;
|
QPointF cursorPosInZone = cursorScenePos - zonePos;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
||||||
PileZone *sb = addZone(new PileZone(this, "sb", false, false, playerArea));
|
PileZone *sb = addZone(new PileZone(this, "sb", false, false, playerArea));
|
||||||
sb->setVisible(false);
|
sb->setVisible(false);
|
||||||
|
|
||||||
table = addZone(new TableZone(this, this));
|
table = addZone(new TableZone(this, "table", this));
|
||||||
connect(table, &TableZone::sizeChanged, this, &Player::updateBoundingRect);
|
connect(table, &TableZone::sizeChanged, this, &Player::updateBoundingRect);
|
||||||
|
|
||||||
stack = addZone(new StackZone(this, (int)table->boundingRect().height(), this));
|
stack = addZone(new StackZone(this, (int)table->boundingRect().height(), this));
|
||||||
|
|
@ -401,6 +401,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
||||||
sbMenu->addAction(aViewSideboard);
|
sbMenu->addAction(aViewSideboard);
|
||||||
sb->setMenu(sbMenu, aViewSideboard);
|
sb->setMenu(sbMenu, aViewSideboard);
|
||||||
|
|
||||||
|
mCustomZones = playerMenu->addMenu(QString());
|
||||||
|
mCustomZones->menuAction()->setVisible(false);
|
||||||
|
|
||||||
aUntapAll = new QAction(this);
|
aUntapAll = new QAction(this);
|
||||||
connect(aUntapAll, &QAction::triggered, this, &Player::actUntapAll);
|
connect(aUntapAll, &QAction::triggered, this, &Player::actUntapAll);
|
||||||
|
|
||||||
|
|
@ -458,6 +461,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
||||||
if (!local && !judge) {
|
if (!local && !judge) {
|
||||||
countersMenu = nullptr;
|
countersMenu = nullptr;
|
||||||
sbMenu = nullptr;
|
sbMenu = nullptr;
|
||||||
|
mCustomZones = nullptr;
|
||||||
aCreateAnotherToken = nullptr;
|
aCreateAnotherToken = nullptr;
|
||||||
createPredefinedTokenMenu = nullptr;
|
createPredefinedTokenMenu = nullptr;
|
||||||
mCardCounters = nullptr;
|
mCardCounters = nullptr;
|
||||||
|
|
@ -833,6 +837,11 @@ void Player::retranslateUi()
|
||||||
sbMenu->setTitle(tr("&Sideboard"));
|
sbMenu->setTitle(tr("&Sideboard"));
|
||||||
libraryMenu->setTitle(tr("&Library"));
|
libraryMenu->setTitle(tr("&Library"));
|
||||||
countersMenu->setTitle(tr("&Counters"));
|
countersMenu->setTitle(tr("&Counters"));
|
||||||
|
mCustomZones->setTitle(tr("C&ustom Zones"));
|
||||||
|
|
||||||
|
for (auto aViewZone : mCustomZones->actions()) {
|
||||||
|
aViewZone->setText(tr("View custom zone '%1'").arg(aViewZone->data().toString()));
|
||||||
|
}
|
||||||
|
|
||||||
aUntapAll->setText(tr("&Untap all permanents"));
|
aUntapAll->setText(tr("&Untap all permanents"));
|
||||||
aRollDie->setText(tr("R&oll die..."));
|
aRollDie->setText(tr("R&oll die..."));
|
||||||
|
|
@ -2726,19 +2735,79 @@ void Player::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*op
|
||||||
|
|
||||||
void Player::processPlayerInfo(const ServerInfo_Player &info)
|
void Player::processPlayerInfo(const ServerInfo_Player &info)
|
||||||
{
|
{
|
||||||
|
static QSet<QString> builtinZones{/* PileZones */
|
||||||
|
"deck", "grave", "rfg", "sb",
|
||||||
|
/* TableZone */
|
||||||
|
"table",
|
||||||
|
/* StackZone */
|
||||||
|
"stack",
|
||||||
|
/* HandZone */
|
||||||
|
"hand"};
|
||||||
clearCounters();
|
clearCounters();
|
||||||
clearArrows();
|
clearArrows();
|
||||||
|
|
||||||
QMapIterator<QString, CardZone *> zoneIt(zones);
|
QMutableMapIterator<QString, CardZone *> zoneIt(zones);
|
||||||
while (zoneIt.hasNext()) {
|
while (zoneIt.hasNext()) {
|
||||||
zoneIt.next().value()->clearContents();
|
zoneIt.next().value()->clearContents();
|
||||||
|
|
||||||
|
if (!builtinZones.contains(zoneIt.key())) {
|
||||||
|
zoneIt.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can be null if we are not the local player!
|
||||||
|
if (mCustomZones) {
|
||||||
|
mCustomZones->clear();
|
||||||
|
mCustomZones->menuAction()->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int zoneListSize = info.zone_list_size();
|
const int zoneListSize = info.zone_list_size();
|
||||||
for (int i = 0; i < zoneListSize; ++i) {
|
for (int i = 0; i < zoneListSize; ++i) {
|
||||||
const ServerInfo_Zone &zoneInfo = info.zone_list(i);
|
const ServerInfo_Zone &zoneInfo = info.zone_list(i);
|
||||||
CardZone *zone = zones.value(QString::fromStdString(zoneInfo.name()), 0);
|
|
||||||
|
QString zoneName = QString::fromStdString(zoneInfo.name());
|
||||||
|
CardZone *zone = zones.value(zoneName, 0);
|
||||||
if (!zone) {
|
if (!zone) {
|
||||||
|
// Create a new CardZone if it doesn't exist
|
||||||
|
|
||||||
|
if (zoneInfo.with_coords()) {
|
||||||
|
// Visibility not currently supported for TableZone
|
||||||
|
zone = addZone(new TableZone(this, zoneName, this));
|
||||||
|
} else {
|
||||||
|
// Zones without coordinats are always treated as non-shufflable
|
||||||
|
// PileZones, although supporting alternate hand or stack zones
|
||||||
|
// might make sense in some scenarios.
|
||||||
|
bool contentsKnown;
|
||||||
|
|
||||||
|
switch (zoneInfo.type()) {
|
||||||
|
case ServerInfo_Zone::PrivateZone:
|
||||||
|
contentsKnown = local || judge || (game->getSpectator() && game->getSpectatorsSeeEverything());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerInfo_Zone::PublicZone:
|
||||||
|
contentsKnown = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerInfo_Zone::HiddenZone:
|
||||||
|
contentsKnown = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
zone = addZone(new PileZone(this, zoneName, /* isShufflable */ false, contentsKnown, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Non-builtin zones are hidden by default and can't be interacted
|
||||||
|
// with, except through menus.
|
||||||
|
zone->setVisible(false);
|
||||||
|
|
||||||
|
if (mCustomZones) {
|
||||||
|
mCustomZones->menuAction()->setVisible(true);
|
||||||
|
QAction *aViewZone = mCustomZones->addAction(tr("View custom zone '%1'").arg(zoneName));
|
||||||
|
aViewZone->setData(zoneName);
|
||||||
|
connect(aViewZone, &QAction::triggered, this,
|
||||||
|
[zoneName, this]() { static_cast<GameScene *>(scene())->toggleZoneView(this, zoneName, -1); });
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ public:
|
||||||
private:
|
private:
|
||||||
TabGame *game;
|
TabGame *game;
|
||||||
QMenu *sbMenu, *countersMenu, *sayMenu, *createPredefinedTokenMenu, *mRevealLibrary, *mLendLibrary, *mRevealTopCard,
|
QMenu *sbMenu, *countersMenu, *sayMenu, *createPredefinedTokenMenu, *mRevealLibrary, *mLendLibrary, *mRevealTopCard,
|
||||||
*mRevealHand, *mRevealRandomHandCard, *mRevealRandomGraveyardCard, *mCardCounters;
|
*mRevealHand, *mRevealRandomHandCard, *mRevealRandomGraveyardCard, *mCustomZones, *mCardCounters;
|
||||||
TearOffMenu *moveGraveMenu, *moveRfgMenu, *graveMenu, *moveHandMenu, *handMenu, *libraryMenu, *topLibraryMenu,
|
TearOffMenu *moveGraveMenu, *moveRfgMenu, *graveMenu, *moveHandMenu, *handMenu, *libraryMenu, *topLibraryMenu,
|
||||||
*bottomLibraryMenu, *rfgMenu, *playerMenu;
|
*bottomLibraryMenu, *rfgMenu, *playerMenu;
|
||||||
QList<QMenu *> playerLists;
|
QList<QMenu *> playerLists;
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,10 @@ QString CardZone::getTranslatedName(bool theirOwn, GrammaticalCase gc) const
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return (theirOwn ? tr("their custom zone '%1'", "nominative").arg(name)
|
||||||
|
: tr("%1's custom zone '%2'", "nominative").arg(ownerName).arg(name));
|
||||||
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ const QColor TableZone::FADE_MASK = QColor(0, 0, 0, 80);
|
||||||
const QColor TableZone::GRADIENT_COLOR = QColor(255, 255, 255, 150);
|
const QColor TableZone::GRADIENT_COLOR = QColor(255, 255, 255, 150);
|
||||||
const QColor TableZone::GRADIENT_COLORLESS = QColor(255, 255, 255, 0);
|
const QColor TableZone::GRADIENT_COLORLESS = QColor(255, 255, 255, 0);
|
||||||
|
|
||||||
TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
TableZone::TableZone(Player *_p, const QString &name, QGraphicsItem *parent)
|
||||||
: SelectZone(_p, "table", true, false, true, parent), active(false)
|
: SelectZone(_p, name, true, false, true, parent), active(false)
|
||||||
{
|
{
|
||||||
connect(themeManager, &ThemeManager::themeChanged, this, &TableZone::updateBg);
|
connect(themeManager, &ThemeManager::themeChanged, this, &TableZone::updateBg);
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::invertVerticalCoordinateChanged, this,
|
connect(&SettingsCache::instance(), &SettingsCache::invertVerticalCoordinateChanged, this,
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public:
|
||||||
@param _p the Player
|
@param _p the Player
|
||||||
@param parent defaults to null
|
@param parent defaults to null
|
||||||
*/
|
*/
|
||||||
explicit TableZone(Player *_p, QGraphicsItem *parent = nullptr);
|
explicit TableZone(Player *_p, const QString &name, QGraphicsItem *parent = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return a QRectF of the TableZone bounding box.
|
@return a QRectF of the TableZone bounding box.
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
|
||||||
|
|
||||||
connect(help, &QAction::triggered, this, [this] { createSearchSyntaxHelpWindow(&searchEdit); });
|
connect(help, &QAction::triggered, this, [this] { createSearchSyntaxHelpWindow(&searchEdit); });
|
||||||
|
|
||||||
|
if (SettingsCache::instance().getFocusCardViewSearchBar()) {
|
||||||
|
this->setActive(true);
|
||||||
|
searchEdit.setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
QGraphicsProxyWidget *searchEditProxy = new QGraphicsProxyWidget;
|
QGraphicsProxyWidget *searchEditProxy = new QGraphicsProxyWidget;
|
||||||
searchEditProxy->setWidget(&searchEdit);
|
searchEditProxy->setWidget(&searchEdit);
|
||||||
searchEditProxy->setZValue(2000000007);
|
searchEditProxy->setZValue(2000000007);
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ QPair<QString, QString> MessageLogWidget::getFromStr(CardZone *zone, QString car
|
||||||
fromStr = tr(" from sideboard");
|
fromStr = tr(" from sideboard");
|
||||||
} else if (zoneName == STACK_ZONE_NAME) {
|
} else if (zoneName == STACK_ZONE_NAME) {
|
||||||
fromStr = tr(" from the stack");
|
fromStr = tr(" from the stack");
|
||||||
|
} else {
|
||||||
|
fromStr = tr(" from custom zone '%1'").arg(zoneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cardNameContainsStartZone) {
|
if (!cardNameContainsStartZone) {
|
||||||
|
|
@ -322,13 +324,16 @@ void MessageLogWidget::logMoveCard(Player *player,
|
||||||
} else if (targetZoneName == STACK_ZONE_NAME) {
|
} else if (targetZoneName == STACK_ZONE_NAME) {
|
||||||
soundEngine->playSound("play_card");
|
soundEngine->playSound("play_card");
|
||||||
finalStr = tr("%1 plays %2%3.");
|
finalStr = tr("%1 plays %2%3.");
|
||||||
|
} else {
|
||||||
|
finalStr = tr("%1 moves %2%3 to custom zone '%4'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usesNewX) {
|
if (usesNewX) {
|
||||||
appendHtmlServerMessage(
|
appendHtmlServerMessage(
|
||||||
finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second).arg(newX));
|
finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second).arg(newX));
|
||||||
} else {
|
} else {
|
||||||
appendHtmlServerMessage(finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second));
|
appendHtmlServerMessage(
|
||||||
|
finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second).arg(targetZoneName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ RemoteClient::RemoteClient(QObject *parent)
|
||||||
connect(socket, &QTcpSocket::connected, this, &RemoteClient::slotConnected);
|
connect(socket, &QTcpSocket::connected, this, &RemoteClient::slotConnected);
|
||||||
connect(socket, &QTcpSocket::readyRead, this, &RemoteClient::readData);
|
connect(socket, &QTcpSocket::readyRead, this, &RemoteClient::readData);
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||||
connect(socket, &QTcpSocket::errorOccurred, this, &RemoteClient::slotSocketError);
|
connect(socket, &QTcpSocket::errorOccurred, this, &RemoteClient::slotSocketError);
|
||||||
#else
|
#else
|
||||||
connect(socket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &RemoteClient::slotSocketError);
|
connect(socket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &RemoteClient::slotSocketError);
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,7 @@ SettingsCache::SettingsCache()
|
||||||
cardViewInitialRowsMax = settings->value("interface/cardViewInitialRowsMax", 14).toInt();
|
cardViewInitialRowsMax = settings->value("interface/cardViewInitialRowsMax", 14).toInt();
|
||||||
cardViewExpandedRowsMax = settings->value("interface/cardViewExpandedRowsMax", 20).toInt();
|
cardViewExpandedRowsMax = settings->value("interface/cardViewExpandedRowsMax", 20).toInt();
|
||||||
closeEmptyCardView = settings->value("interface/closeEmptyCardView", true).toBool();
|
closeEmptyCardView = settings->value("interface/closeEmptyCardView", true).toBool();
|
||||||
|
focusCardViewSearchBar = settings->value("interface/focusCardViewSearchBar", true).toBool();
|
||||||
|
|
||||||
showShortcuts = settings->value("menu/showshortcuts", true).toBool();
|
showShortcuts = settings->value("menu/showshortcuts", true).toBool();
|
||||||
displayCardNames = settings->value("cards/displaycardnames", true).toBool();
|
displayCardNames = settings->value("cards/displaycardnames", true).toBool();
|
||||||
|
|
@ -289,10 +290,12 @@ SettingsCache::SettingsCache()
|
||||||
visualDeckStorageInGame = settings->value("interface/visualdeckstorageingame", true).toBool();
|
visualDeckStorageInGame = settings->value("interface/visualdeckstorageingame", true).toBool();
|
||||||
visualDeckStorageSelectionAnimation =
|
visualDeckStorageSelectionAnimation =
|
||||||
settings->value("interface/visualdeckstorageselectionanimation", true).toBool();
|
settings->value("interface/visualdeckstorageselectionanimation", true).toBool();
|
||||||
|
defaultDeckEditorType = settings->value("interface/defaultDeckEditorType", 1).toInt();
|
||||||
visualDatabaseDisplayFilterToMostRecentSetsEnabled =
|
visualDatabaseDisplayFilterToMostRecentSetsEnabled =
|
||||||
settings->value("interface/visualdatabasedisplayfiltertomostrecentsetsenabled", true).toBool();
|
settings->value("interface/visualdatabasedisplayfiltertomostrecentsetsenabled", true).toBool();
|
||||||
visualDatabaseDisplayFilterToMostRecentSetsAmount =
|
visualDatabaseDisplayFilterToMostRecentSetsAmount =
|
||||||
settings->value("interface/visualdatabasedisplayfiltertomostrecentsetsamount", 10).toInt();
|
settings->value("interface/visualdatabasedisplayfiltertomostrecentsetsamount", 10).toInt();
|
||||||
|
visualDeckEditorSampleHandSize = settings->value("interface/visualdeckeditorsamplehandsize", 7).toInt();
|
||||||
horizontalHand = settings->value("hand/horizontal", true).toBool();
|
horizontalHand = settings->value("hand/horizontal", true).toBool();
|
||||||
invertVerticalCoordinate = settings->value("table/invert_vertical", false).toBool();
|
invertVerticalCoordinate = settings->value("table/invert_vertical", false).toBool();
|
||||||
minPlayersForMultiColumnLayout = settings->value("interface/min_players_multicolumn", 4).toInt();
|
minPlayersForMultiColumnLayout = settings->value("interface/min_players_multicolumn", 4).toInt();
|
||||||
|
|
@ -373,6 +376,12 @@ void SettingsCache::setCloseEmptyCardView(QT_STATE_CHANGED_T value)
|
||||||
settings->setValue("interface/closeEmptyCardView", closeEmptyCardView);
|
settings->setValue("interface/closeEmptyCardView", closeEmptyCardView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsCache::setFocusCardViewSearchBar(QT_STATE_CHANGED_T value)
|
||||||
|
{
|
||||||
|
focusCardViewSearchBar = value;
|
||||||
|
settings->setValue("interface/focusCardViewSearchBar", focusCardViewSearchBar);
|
||||||
|
}
|
||||||
|
|
||||||
void SettingsCache::setKnownMissingFeatures(const QString &_knownMissingFeatures)
|
void SettingsCache::setKnownMissingFeatures(const QString &_knownMissingFeatures)
|
||||||
{
|
{
|
||||||
knownMissingFeatures = _knownMissingFeatures;
|
knownMissingFeatures = _knownMissingFeatures;
|
||||||
|
|
@ -795,6 +804,12 @@ void SettingsCache::setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T va
|
||||||
emit visualDeckStorageSelectionAnimationChanged(visualDeckStorageSelectionAnimation);
|
emit visualDeckStorageSelectionAnimationChanged(visualDeckStorageSelectionAnimation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsCache::setDefaultDeckEditorType(int value)
|
||||||
|
{
|
||||||
|
defaultDeckEditorType = value;
|
||||||
|
settings->setValue("interface/defaultDeckEditorType", defaultDeckEditorType);
|
||||||
|
}
|
||||||
|
|
||||||
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T _enabled)
|
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T _enabled)
|
||||||
{
|
{
|
||||||
visualDatabaseDisplayFilterToMostRecentSetsEnabled = _enabled;
|
visualDatabaseDisplayFilterToMostRecentSetsEnabled = _enabled;
|
||||||
|
|
@ -811,6 +826,13 @@ void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int _am
|
||||||
emit visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(visualDatabaseDisplayFilterToMostRecentSetsAmount);
|
emit visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(visualDatabaseDisplayFilterToMostRecentSetsAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsCache::setVisualDeckEditorSampleHandSize(int _amount)
|
||||||
|
{
|
||||||
|
visualDeckEditorSampleHandSize = _amount;
|
||||||
|
settings->setValue("interface/visualdeckeditorsamplehandsize", visualDeckEditorSampleHandSize);
|
||||||
|
emit visualDeckEditorSampleHandSizeAmountChanged(visualDeckEditorSampleHandSize);
|
||||||
|
}
|
||||||
|
|
||||||
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T _horizontalHand)
|
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T _horizontalHand)
|
||||||
{
|
{
|
||||||
horizontalHand = static_cast<bool>(_horizontalHand);
|
horizontalHand = static_cast<bool>(_horizontalHand);
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ signals:
|
||||||
void visualDeckStorageSelectionAnimationChanged(bool enabled);
|
void visualDeckStorageSelectionAnimationChanged(bool enabled);
|
||||||
void visualDatabaseDisplayFilterToMostRecentSetsEnabledChanged(bool enabled);
|
void visualDatabaseDisplayFilterToMostRecentSetsEnabledChanged(bool enabled);
|
||||||
void visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(int amount);
|
void visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(int amount);
|
||||||
|
void visualDeckEditorSampleHandSizeAmountChanged(int amount);
|
||||||
void horizontalHandChanged();
|
void horizontalHandChanged();
|
||||||
void handJustificationChanged();
|
void handJustificationChanged();
|
||||||
void invertVerticalCoordinateChanged();
|
void invertVerticalCoordinateChanged();
|
||||||
|
|
@ -155,8 +156,10 @@ private:
|
||||||
bool visualDeckStorageAlwaysConvert;
|
bool visualDeckStorageAlwaysConvert;
|
||||||
bool visualDeckStorageInGame;
|
bool visualDeckStorageInGame;
|
||||||
bool visualDeckStorageSelectionAnimation;
|
bool visualDeckStorageSelectionAnimation;
|
||||||
|
int defaultDeckEditorType;
|
||||||
bool visualDatabaseDisplayFilterToMostRecentSetsEnabled;
|
bool visualDatabaseDisplayFilterToMostRecentSetsEnabled;
|
||||||
int visualDatabaseDisplayFilterToMostRecentSetsAmount;
|
int visualDatabaseDisplayFilterToMostRecentSetsAmount;
|
||||||
|
int visualDeckEditorSampleHandSize;
|
||||||
bool horizontalHand;
|
bool horizontalHand;
|
||||||
bool invertVerticalCoordinate;
|
bool invertVerticalCoordinate;
|
||||||
int minPlayersForMultiColumnLayout;
|
int minPlayersForMultiColumnLayout;
|
||||||
|
|
@ -185,6 +188,7 @@ private:
|
||||||
int cardViewInitialRowsMax;
|
int cardViewInitialRowsMax;
|
||||||
int cardViewExpandedRowsMax;
|
int cardViewExpandedRowsMax;
|
||||||
bool closeEmptyCardView;
|
bool closeEmptyCardView;
|
||||||
|
bool focusCardViewSearchBar;
|
||||||
int pixmapCacheSize;
|
int pixmapCacheSize;
|
||||||
int networkCacheSize;
|
int networkCacheSize;
|
||||||
int redirectCacheTtl;
|
int redirectCacheTtl;
|
||||||
|
|
@ -490,6 +494,10 @@ public:
|
||||||
{
|
{
|
||||||
return visualDeckStorageSelectionAnimation;
|
return visualDeckStorageSelectionAnimation;
|
||||||
}
|
}
|
||||||
|
int getDefaultDeckEditorType() const
|
||||||
|
{
|
||||||
|
return defaultDeckEditorType;
|
||||||
|
}
|
||||||
bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const
|
bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const
|
||||||
{
|
{
|
||||||
return visualDatabaseDisplayFilterToMostRecentSetsEnabled;
|
return visualDatabaseDisplayFilterToMostRecentSetsEnabled;
|
||||||
|
|
@ -498,6 +506,10 @@ public:
|
||||||
{
|
{
|
||||||
return visualDatabaseDisplayFilterToMostRecentSetsAmount;
|
return visualDatabaseDisplayFilterToMostRecentSetsAmount;
|
||||||
}
|
}
|
||||||
|
int getVisualDeckEditorSampleHandSize() const
|
||||||
|
{
|
||||||
|
return visualDeckEditorSampleHandSize;
|
||||||
|
}
|
||||||
bool getHorizontalHand() const
|
bool getHorizontalHand() const
|
||||||
{
|
{
|
||||||
return horizontalHand;
|
return horizontalHand;
|
||||||
|
|
@ -696,6 +708,7 @@ public:
|
||||||
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
|
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
|
||||||
void setCardViewExpandedRowsMax(int value);
|
void setCardViewExpandedRowsMax(int value);
|
||||||
void setCloseEmptyCardView(QT_STATE_CHANGED_T value);
|
void setCloseEmptyCardView(QT_STATE_CHANGED_T value);
|
||||||
|
void setFocusCardViewSearchBar(QT_STATE_CHANGED_T value);
|
||||||
QString getClientID()
|
QString getClientID()
|
||||||
{
|
{
|
||||||
return clientID;
|
return clientID;
|
||||||
|
|
@ -724,6 +737,10 @@ public:
|
||||||
{
|
{
|
||||||
return closeEmptyCardView;
|
return closeEmptyCardView;
|
||||||
}
|
}
|
||||||
|
bool getFocusCardViewSearchBar() const
|
||||||
|
{
|
||||||
|
return focusCardViewSearchBar;
|
||||||
|
}
|
||||||
ShortcutsSettings &shortcuts() const
|
ShortcutsSettings &shortcuts() const
|
||||||
{
|
{
|
||||||
return *shortcutsSettings;
|
return *shortcutsSettings;
|
||||||
|
|
@ -843,8 +860,10 @@ public slots:
|
||||||
void setVisualDeckStorageAlwaysConvert(bool _visualDeckStorageAlwaysConvert);
|
void setVisualDeckStorageAlwaysConvert(bool _visualDeckStorageAlwaysConvert);
|
||||||
void setVisualDeckStorageInGame(QT_STATE_CHANGED_T value);
|
void setVisualDeckStorageInGame(QT_STATE_CHANGED_T value);
|
||||||
void setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T value);
|
void setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T value);
|
||||||
|
void setDefaultDeckEditorType(int value);
|
||||||
void setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T _enabled);
|
void setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T _enabled);
|
||||||
void setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int _amount);
|
void setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int _amount);
|
||||||
|
void setVisualDeckEditorSampleHandSize(int _amount);
|
||||||
void setHorizontalHand(QT_STATE_CHANGED_T _horizontalHand);
|
void setHorizontalHand(QT_STATE_CHANGED_T _horizontalHand);
|
||||||
void setInvertVerticalCoordinate(QT_STATE_CHANGED_T _invertVerticalCoordinate);
|
void setInvertVerticalCoordinate(QT_STATE_CHANGED_T _invertVerticalCoordinate);
|
||||||
void setMinPlayersForMultiColumnLayout(int _minPlayersForMultiColumnLayout);
|
void setMinPlayersForMultiColumnLayout(int _minPlayersForMultiColumnLayout);
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ void ShortcutTreeView::currentChanged(const QModelIndex ¤t, const QModelIn
|
||||||
*/
|
*/
|
||||||
void ShortcutTreeView::updateSearchString(const QString &searchString)
|
void ShortcutTreeView::updateSearchString(const QString &searchString)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0)
|
||||||
const auto skipEmptyParts = Qt::SkipEmptyParts;
|
const auto skipEmptyParts = Qt::SkipEmptyParts;
|
||||||
#else
|
#else
|
||||||
const auto skipEmptyParts = QString::SkipEmptyParts;
|
const auto skipEmptyParts = QString::SkipEmptyParts;
|
||||||
|
|
|
||||||
|
|
@ -37,17 +37,17 @@ bool CardInfoComparator::compareVariants(const QVariant &a, const QVariant &b) c
|
||||||
|
|
||||||
// Perform type-specific comparison
|
// Perform type-specific comparison
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
switch (a.typeId()) {
|
switch (static_cast<int>(a.typeId())) {
|
||||||
#else
|
#else
|
||||||
switch (a.type()) {
|
switch (static_cast<int>(a.type())) {
|
||||||
#endif
|
#endif
|
||||||
case QMetaType::Int:
|
case static_cast<int>(QMetaType::Int):
|
||||||
return a.toInt() < b.toInt();
|
return a.toInt() < b.toInt();
|
||||||
case QMetaType::Double:
|
case static_cast<int>(QMetaType::Double):
|
||||||
return a.toDouble() < b.toDouble();
|
return a.toDouble() < b.toDouble();
|
||||||
case QMetaType::QString:
|
case static_cast<int>(QMetaType::QString):
|
||||||
return a.toString() < b.toString();
|
return a.toString() < b.toString();
|
||||||
case QMetaType::Bool:
|
case static_cast<int>(QMetaType::Bool):
|
||||||
return a.toBool() < b.toBool();
|
return a.toBool() < b.toBool();
|
||||||
default:
|
default:
|
||||||
// Default to comparing as strings
|
// Default to comparing as strings
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ void Logger::closeLogfileSession()
|
||||||
fileHandle.close();
|
fileHandle.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::log(QtMsgType /* type */, const QMessageLogContext & /* ctx */, const QString message)
|
void Logger::log(QtMsgType /* type */, const QMessageLogContext & /* ctx */, const QString &message)
|
||||||
{
|
{
|
||||||
QMetaObject::invokeMethod(this, "internalLog", Qt::QueuedConnection, Q_ARG(const QString &, message));
|
QMetaObject::invokeMethod(this, "internalLog", Qt::QueuedConnection, Q_ARG(const QString &, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::internalLog(QString message)
|
void Logger::internalLog(const QString &message)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void logToFile(bool enabled);
|
void logToFile(bool enabled);
|
||||||
void log(QtMsgType type, const QMessageLogContext &ctx, QString message);
|
void log(QtMsgType type, const QMessageLogContext &ctx, const QString &message);
|
||||||
QString getClientVersion();
|
QString getClientVersion();
|
||||||
QString getClientOperatingSystem();
|
QString getClientOperatingSystem();
|
||||||
QString getSystemArchitecture();
|
QString getSystemArchitecture();
|
||||||
|
|
@ -57,10 +57,10 @@ protected:
|
||||||
void closeLogfileSession();
|
void closeLogfileSession();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void internalLog(QString message);
|
void internalLog(const QString &message);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void logEntryAdded(QString message);
|
void logEntryAdded(const QString &message);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ message ServerInfo_Zone {
|
||||||
// setting beingLookedAt to true.
|
// setting beingLookedAt to true.
|
||||||
// Cards in a zone with the type HiddenZone are referenced by their
|
// Cards in a zone with the type HiddenZone are referenced by their
|
||||||
// list index, whereas cards in any other zone are referenced by their ids.
|
// list index, whereas cards in any other zone are referenced by their ids.
|
||||||
|
//
|
||||||
|
// WARNING: Adding new zone types will break compatibility with older
|
||||||
|
// clients. Older clients will read new zone types as PrivateZone, which
|
||||||
|
// is likely *NOT* what you want.
|
||||||
|
|
||||||
PrivateZone = 0;
|
PrivateZone = 0;
|
||||||
PublicZone = 1;
|
PublicZone = 1;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,9 @@ void SettingsCache::setCardViewExpandedRowsMax(int /* value */)
|
||||||
void SettingsCache::setCloseEmptyCardView(const QT_STATE_CHANGED_T /* value */)
|
void SettingsCache::setCloseEmptyCardView(const QT_STATE_CHANGED_T /* value */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setFocusCardViewSearchBar(QT_STATE_CHANGED_T /* value */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setKnownMissingFeatures(const QString & /* _knownMissingFeatures */)
|
void SettingsCache::setKnownMissingFeatures(const QString & /* _knownMissingFeatures */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -256,12 +259,18 @@ void SettingsCache::setVisualDeckStorageInGame(QT_STATE_CHANGED_T /* value */)
|
||||||
void SettingsCache::setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T /* value */)
|
void SettingsCache::setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T /* value */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setDefaultDeckEditorType(int /* value */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T /* _enabled */)
|
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T /* _enabled */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int /* _amount */)
|
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int /* _amount */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setVisualDeckEditorSampleHandSize(int /* _amount */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T /* _horizontalHand */)
|
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T /* _horizontalHand */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
<location filename="src/oraclewizard.cpp" line="287"/>
|
<location filename="src/oraclewizard.cpp" line="287"/>
|
||||||
<source>Sets file (%1)</source>
|
<source>Sets file (%1)</source>
|
||||||
<oldsource>Sets JSON file (%1)</oldsource>
|
<oldsource>Sets JSON file (%1)</oldsource>
|
||||||
<translation type="unfinished"/>
|
<translation>Arquivo de expansões (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/oraclewizard.cpp" line="317"/>
|
<location filename="src/oraclewizard.cpp" line="317"/>
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ void SettingsCache::setCardViewExpandedRowsMax(int /* value */)
|
||||||
void SettingsCache::setCloseEmptyCardView(QT_STATE_CHANGED_T /* value */)
|
void SettingsCache::setCloseEmptyCardView(QT_STATE_CHANGED_T /* value */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setFocusCardViewSearchBar(QT_STATE_CHANGED_T /* value */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setKnownMissingFeatures(const QString & /* _knownMissingFeatures */)
|
void SettingsCache::setKnownMissingFeatures(const QString & /* _knownMissingFeatures */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -260,12 +263,18 @@ void SettingsCache::setVisualDeckStorageInGame(QT_STATE_CHANGED_T /* value */)
|
||||||
void SettingsCache::setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T /* value */)
|
void SettingsCache::setVisualDeckStorageSelectionAnimation(QT_STATE_CHANGED_T /* value */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setDefaultDeckEditorType(int /* value */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T /* _enabled */)
|
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(QT_STATE_CHANGED_T /* _enabled */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int /* _amount */)
|
void SettingsCache::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int /* _amount */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setVisualDeckEditorSampleHandSize(int /* _amount */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T /* _horizontalHand */)
|
void SettingsCache::setHorizontalHand(QT_STATE_CHANGED_T /* _horizontalHand */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue