Commit graph

4062 commits

Author SHA1 Message Date
ebbit1q
c7b8f3e923 Corrections to 3438 (#3452)
* correct previous misstake in #3438

wrong, this fixes that.

* add checking for second argument to --package

nice to have

* split find result into path and file
2018-11-22 17:32:18 -05:00
ebbit1q
964bb0974c add more clang-format focus to CONTRIBUTING.md (#3442)
* add more clang-format focus to CONTRIBUTING.md

Add more clang-format instructions and instructions on clangify.sh.
Move clang-format instructions to the section Formatting and make other format topics a subheader of it to articulate focus on it.
Add section about our ci formatting for people that look at this file after their test failed.
fixes #3065
also fixes #3340

* grammar

* grammar
2018-11-21 23:00:35 +01:00
ebbit1q
3f40a51cdb move package files to unique name (#3438) 2018-11-21 22:59:46 +01:00
tooomm
d9b11858fb exclude mac debug on tagged release (#3443)
leftover from #3433
2018-11-21 22:57:16 +01:00
ebbit1q
ec61d1f012 travis ci format check hotfix (#3449)
* set error message to be conditional

#3443 fails on the git merge base for "some reason" but at least this error message should be clearer.

* fix issues created earlier in #3433

split version from actual diff
remove --color-diff argument as apparently it isn't supported
2018-11-21 21:18:01 +01:00
Zach H
af2bce7141
add token creations from graveyard/exile (#3445) 2018-11-21 03:53:35 -05:00
ebbit1q
6b6c6c71ca add ccache to docker compilation (#3446)
* add ccache to docker image

* test commit please ignore
2018-11-20 14:55:20 +01:00
ebbit1q
57f15a9e98 fix building packages on travis-docker (#3441)
* add docker compilation to travis

add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh

* enable debugging on travis-compile.sh

* set ubuntu16 buildtype to "Debug"

set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh

* make output prettier

edit the format warning message and clangify.sh output

* fix clangify.sh

fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help

* test making packages

move dockerfile for bionic to make room for possibly other files
add missing file dependency
set macos brew to use protobuf --without-python@2

* remove test

* rm old Dockerfile
2018-11-16 18:32:00 +01:00
ebbit1q
72ed98e404 add docker compilation to travis (#3433)
* add docker compilation to travis

add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh

* enable debugging on travis-compile.sh

* set ubuntu16 buildtype to "Debug"

set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh

* make output prettier

edit the format warning message and clangify.sh output

* fix clangify.sh

fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help
2018-11-16 15:44:22 +01:00
ebbit1q
f70699d3de Improve clangify.sh (#3435)
* Improve clangify.sh

Separated from #3433 merge this branch first!

* fix error codes on -n and -t

fix output on -n
format -h message

* separate color diff from diff
2018-11-13 09:21:08 +01:00
ctrlaltca
638ee1af4a
This should fix appveyor compilation (#3434) 2018-11-12 18:50:38 +01:00
ebbit1q
8028bad7b1 set common protobuf files to compile with other tags in debug (#3432)
* set common protobuf files to compile with other tags in debug

force the same flags as release on debug builds
fixes #3431

* check for version first

* use Protobuf_VERSION instead of calling protoc --version

* lower verion requirement

* set tags to disable certain warnings instead of removing all
2018-11-09 11:05:11 +01:00
ebbit1q
e1e9caf0ef Load plain improvements (#3422)
* improve loading from plain text

Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.

* clang format comments

apparently clang-format even complains about the spacing in your
comments

* refactor loading_from_clipboard tests

Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.

* fix compatibility with more formats

skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.

* remove bugged test

The current load from plain is simply broken, removed checking the
comments for correct contents.

* rework load_from_clipboard tests again

rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase

* improve loading from plain text

Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.

* clang format comments

apparently clang-format even complains about the spacing in your
comments

* refactor loading_from_clipboard tests

Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.

* fix compatibility with more formats

skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.

* remove bugged test

The current load from plain is simply broken, removed checking the
comments for correct contents.

* rework load_from_clipboard tests again

rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase

* remove forcing of lowercase cardnames

Cardnames in DeckList::loadFromStream_Plain will no longer be forced
lowercase if they aren't found in the database.
Empty lines in the comments of plaintext decklists will not be skipped.
The loading_from_clipboard_test gets its functions declared in a
separate header "clipboard_testing.h".
Add more edgecase tests.
Refactor code.

* add old QHash version support

QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using inserts
instead of a const with initializer list.

* add old QHash version support

QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using [] access
instead of a const with initializer list.

* add qHash on QRegularExpression below QT 5.6

Apparently QRegularExpression can't be hashed in lower QT versions,
so we add our own hash function, and everyone lived happily ever after,
and none the wiser.

* add header guards to clipboard_testing.h
2018-11-07 06:05:25 -05:00
tooomm
8b7a287b44 clarify min req (#3426) 2018-11-07 08:32:20 +01:00
tooomm
0cd671c022 Improve hints for manage sets dialog (#3419) 2018-10-31 21:14:47 -04:00
ebbit1q
051fcff284 add more precise rules to CONTRIBUTING.md (#3423)
Add extra rules that clang-format enforces, like the order of includes and the way single line comments should be formatted.
Correct some grammar ( what is up with the translation section ordering steps out of order?? ).
This is a web edit.
2018-10-31 21:14:05 -04:00
ebbit1q
4e3d499162 improve translating section of CONTRIBUTING.md (#3424)
Remove the weird out of order numbering and replace it with just chapters for specific users.
Add a bit of explanation to adding translations as a developer.

This is just a recommendation for an improvement, jumplist could be added and/or #3423 merged with this. (it fixes the typos)
2018-10-30 17:45:04 -04:00
tooomm
7e6c4d8a6c fix appveyor dependencies (#3420)
ty @ctrlaltca
2018-10-28 13:11:51 -04:00
ebbit1q
986e405ca7 add new brace guidelines and clang-format info (#3414)
Add new brace guidelines, correct code sample.
Add detail to indentation guidelines.
Add basic clang-format information and a link to the documentation on llvm.

closes #3413 
A quick edit to the contributing guide from the web ui, hope it comes out right.
2018-10-25 09:54:17 -04:00
ebbit1q
75203cf385 add reset power and toughness option #3402 (#3412)
* add reset power and toughness function on cards

Add actResetPT to set the power and toughness in the same way as
actSetPT but instead of prompting the user it will fetch the original
pt from the card info for each card.
Add the new command to the card rmb list, keybinds and settings.

* changed style to .clang-format

Please change the contributing guidelines to use this style instead.
2018-10-20 23:33:35 -04:00
Dane Johnson
bc2cb59c50 Fix blank line between comments issue (#3407)
* Added failing test to demonstrate issue with dec loading

* Prevents empty lines between comments from being interpreted as the start of the sideboard
2018-10-08 11:26:08 -04:00
Henry Lancelle
cf9fdcd09e Translate curly apostrophe to ASCII apostrophe (#3395) (#3401)
* Translate curly apostrophe to ASCII apostrophe (#3395)

Treats the curly apostrophe as a straight apostrophe when searching in
the deck editor search bar.

* Moved logic for handeling translation to CardDatabaseDisplayModel.

This implementation was done with strings instead of characters because
the curly apostrophes and quotes are considered multi-characters.
Thus, the method of iterating through the string and replacing
the characters with the proper translations was difficult to cleanly
implement.

* clang-tidy modifications

* Implemented faster algorithm for string translation.

Optimized the algorithm for string translation, before it would compute
in O(N*M) time where N is the size of the string and M is the size of
the translation table.  Now it will compute in O(N) time where N is the
length of the string.

* Renaming variables and methods.

* Fixed character literal type, was unicode, is now wide.
2018-10-03 09:15:02 +02:00
Lee Tran
eb4b1e74f1 Disable saving of decks when the deck is empty (#3384)
* Disable saving of decks when the deck is empty

* Replace tabs with spaces to conform with coding conventions

* Remove whitespace at end of line to satisfy the CI robot overlords

* Improve logic to check if deck is empty, fix functionality when a deck is loaded

* Fix code style issues

* Disable more menus when the deck is empty

* Streamline code for disabling save menus when the deck is empty

* Fix save-disabling when loading a deck from the clipboard

* Enable saving deck directly after loading deck
2018-09-21 10:46:31 -04:00
Lee Tran
70005a6f1d Enable the creation and using of shortcuts to move cards from the top of the library to play face down. (#3388) 2018-09-07 09:14:34 +02:00
ctrlaltca
1415a4dafa
Fix servatrice linking under FreeBSD - fix #3376 (#3377)
Fix servatrice linking under FreeBSD - fix #3376
2018-09-06 12:20:20 +02:00
tooomm
8b567427c2 update proto links (#3380)
repo moved, see https://github.com/protocolbuffers/protobuf/issues/4796
2018-09-01 13:27:41 -04:00
tooomm
3605a2ca0e bump min qt requirement (#3375) 2018-08-30 02:08:48 -04:00
Alessandro Marzialetti
c58abadff1 fix: cockatrice quits properly when the window is closed (#3329) 2018-08-27 15:01:53 +02:00
tooomm
135c02ea41 travis: more cleanup (#3336)
* add links to build image update history

* remove cmake from apt

* remove bc from apt

* remove clang-format from apt

* test clang-format

* Revert "test clang-format"

This reverts commit b2f12da4276095bbd7442d171c81479a3939e312.

* remove protobuf from apt

* Revert "remove protobuf from apt"

This reverts commit 9162c8800c10b958e132aa0d68322fd03942660f.

* remove qt from apt

* test with versions which differ from what xenial provides

* Revert "test with versions which differ from what xenial provides"

This reverts commit 6192e581696d5493920dd08d4c142b1ba53cf5b0.

* Revert "remove qt from apt"

This reverts commit 0d9aff1c4c9bb19dd9da0b41769f4fad197046cc.

* conditions v1 are the default now

https://blog.travis-ci.com/2018-07-18-build-stages-officially-released

* add new job names

https://docs.travis-ci.com/user/customizing-the-build/?utm_source=blog&utm_medium=web&utm_campaign=build_stages_ga#Naming-Jobs-within-Matrices

* disable mail

* clang-format version

* remove clang source

* cmake version

* macOS: remove clang-format

formatting only checked on linux build

* add compiler info

* cmake version2

* remove fast_finish

only useful if allowed failures are configured in the matrix:
https://docs.travis-ci.com/user/customizing-the-build/#fast-finishing
2018-08-27 10:50:55 +02:00
Andrew Zwicky
ed01752cb4 [WIP] Card image loading: Fallback on 404 (#3367)
* 2479: Running clang-format

Reformatting files to be in line with style guidelines.

* 2479: Updates to remove set/url indices

This change removes set and Url indices in favor
of check for empty lists and removing items from them
instead.

* 2479: TransformUrl will now error on missing fields

If transformUrl is called with a template, and the card/set
is missing something required by that template, it will now
return an empty string, instead of the template with an empty
string substituted in.

* 2479: clang-format updates

* 2479: Fixing omission of ! from two properties

* 2479: Adding prefix on debug messages

Adding PictureLoader: to the front of each debug message
from this file, so that it can be more easily filtered out
by grep in the log of a running application.

* 2479: Remove outdated comment

* 2479: Remove unused method from intermediate work

* 2479: Updating QDebug messages to be more consistent

* 2479: clang-format updates

* 2479: Remove repeated code, replace with call to nextUrl

This removes some redundant code that is better replaced with a call
to nextUrl, in case the code needed to populate the nextUrl changes
significantly.

* 2479: Adding more detailed comments

* 2479: Refactor transformUrl

Refactor transformUrl to do everything in a single loop instead
of two almost identical loops.  set information is populated if
present, but is added with empty strings if absent.
2018-08-22 09:52:38 +02:00
Zach H
e341337ce0
Revert "[WIP] Fallback on 404" (#3364) 2018-08-11 09:06:18 -04:00
Zach H
e09ea1e683
Merge pull request #3363 from andrewzwicky/fallback_on_404 2018-08-11 09:05:21 -04:00
Andrew Zwicky
cbd430555f 2479: Working Url traversal
Url checking is now working as expected.  In set order,
starting with custom sets, then going in priority
order by url template order, Urls will checked, and the
first successful one will be used.
2018-08-09 23:50:01 -05:00
Andrew Zwicky
8239539946 2479:
Initial work on downloading cards through fallback URLs.

This change will add in the ability to proceed to the next URL
should the first one fail.  First trial shows that it's working,
but needs more refinement.
2018-08-08 22:42:22 -05:00
Andrew Zwicky
e467698d72 2497: Forgot to check in .h file 2018-08-05 17:43:28 -05:00
Andrew Zwicky
846b426a7c 2497: Start to implement fallback on card image urls
Return a list instead of a single url.  This is the start
of getting many possible urls instead of one.  Functionally
identical except that the primary url will be attempted for
cards without a muid.
2018-08-05 16:21:53 -05:00
tooomm
f1eab4e26a remove unused beta file endings (#3338) 2018-08-02 21:31:32 +02:00
David Szabo
283ce23111 Manage sets window: "Enable all/selected" button toggling never disabled (#3337)
## Related Ticket(s)
- Fixes #3314 

## Short roundup of the initial problem
When the view was sorted in the manage sets window, the "Enable/Disable All" buttons never toggled to "Enable/Disable selected" buttons, even when more sets were selected.

## What will change with this Pull Request?
- Selected sets can be enabled/disabled in sorted view as well
2018-07-25 14:39:42 +02:00
tooomm
451e1874a7 UI dialog tweaks: filter + create game(s) (#3351)
* vbox --> grid layout
2018-07-25 08:21:29 +02:00
tooomm
69c103ede3
missing features dlg: better update hint (#3352)
## Short roundup of the initial problem
People missed the hint on how to resolve missing features on their own, because update hint was hidden behind the `Show details` label.

## What will change with this Pull Request?
- Update hint is more prominently placed and not hidden behind a label
- It's translatable now
- Wording update to reflect UI change

## Screenshots
<!-- simply drag & drop image files directly into this description! -->
- before
![missing_features](https://user-images.githubusercontent.com/9874850/43153756-74cfd9f0-8f72-11e8-9e0f-fbf47b13f324.png)
- after
![missing_features_new](https://user-images.githubusercontent.com/9874850/43153761-78bec4e0-8f72-11e8-9853-ccc1ecb7f558.png)
2018-07-24 21:05:42 +02:00
tooomm
ac0f92bac6 bump to 2.6.1 (#3342) 2018-07-21 10:56:39 -04:00
Zach H
aa308717de
translation pulls (#3335) 2018-07-17 20:19:40 -04:00
tooomm
2d0d29fb5c appveyor: version updates + tweaks (#3334)
* version updates

- qt to 5.11.x
- openssl to 1.0.2o
- protobuf to 3.6

* undo protobuf change

* reapply with proper semver

* only qt latest

* combined env, protobuf 3.6

* slim build matrix config down

* fix env

* test

* fix env -eq

* test if script changes work

* /2

* enable cache again

* fix

* final
2018-07-17 20:12:39 -04:00
tooomm
cba1ca8d5b remove Qt guards (#3328)
* remove version guards

* clangify

* [skip ci] README wording

* add cmake requirement to readme

* remove return

* remove min req from README
2018-07-17 20:08:42 -04:00
tooomm
c12c3c071f
NSIS: Show hint when user installs 32bit Cockatrice on 64bit Windows (#3331)
* hint for 32bit

* final wording
2018-07-17 07:40:45 +02:00
tooomm
d37d73017f
nsis: add sleep timer to ensure unlocking of vc_redist (#3325)
* add 3s sleep + log hint
2018-07-14 15:49:41 +02:00
tooomm
a766aa7d8a
appveyor: reduce version string to basic info (#3324)
## Short roundup of the initial problem
It was mostly out of date because we have to manually update it with our current version number.
The use of that is suspect anyway, since it only displays in the appveyor build overview.
It also had a redundant info about the branch.

## What will change with this Pull Request?
- remove hard coded version number
- remove branch
- cleanup build trigger from [#3300](https://github.com/Cockatrice/Cockatrice/pull/3300/files#diff-11c909939117928998b102a1fff7d363)
- more readable style

## Screenshots
I did some tests, so don't be confused about the different styles displayed in the history:
<!-- simply drag & drop image files directly into this description! -->
![version](https://user-images.githubusercontent.com/9874850/42664150-876175ac-8639-11e8-9df5-3fdd775440ed.png)
2018-07-13 17:29:16 +02:00
ctrlaltca
b61c07a205
Check for both 32 and 64bit cockatrice when uninstalling (#3323) 2018-07-12 23:58:56 +02:00
ctrlaltca
c01aad6767
Travis: minor changes (#3321)
Use the xenial version of llvm's toolchain for clang-format
Add qt5.5's websocket library for servatrice
2018-07-11 17:43:33 +02:00
tooomm
d0d662f73a switch to xenial (#3320) 2018-07-11 14:52:19 +02:00