Single card window
This commit is contained in:
92
.gitignore
vendored
Normal file
92
.gitignore
vendored
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
env/
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*,cover
|
||||||
|
.hypothesis/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# IPython Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule
|
||||||
|
|
||||||
|
# dotenv
|
||||||
|
.env
|
||||||
|
|
||||||
|
# virtualenv
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
.idea
|
||||||
@@ -8,22 +8,11 @@
|
|||||||
<object class="GtkGrid">
|
<object class="GtkGrid">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
|
||||||
<object class="GtkImage" id="bigCard">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="pixbuf">../resources/images/dummy_315x450.png</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid">
|
<object class="GtkGrid">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="column_homogeneous">True</property>
|
<property name="halign">start</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -183,6 +172,8 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">Loading...</property>
|
<property name="label" translatable="yes">Loading...</property>
|
||||||
|
<property name="wrap">True</property>
|
||||||
|
<property name="max_width_chars">50</property>
|
||||||
<property name="xalign">0.10000000149011612</property>
|
<property name="xalign">0.10000000149011612</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -234,6 +225,19 @@
|
|||||||
<property name="top_attach">0</property>
|
<property name="top_attach">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkOverlay" id="imageContainer">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ def _get_filters(app):
|
|||||||
output["type"] = _get_combo_value(combo)
|
output["type"] = _get_combo_value(combo)
|
||||||
# Set
|
# Set
|
||||||
name = app.ui.get_object("setEntry").get_text()
|
name = app.ui.get_object("setEntry").get_text()
|
||||||
|
output["set"] = ""
|
||||||
for set in util.set_list:
|
for set in util.set_list:
|
||||||
if set.name == name:
|
if set.name == name:
|
||||||
output["set"] = set.code
|
output["set"] = set.code
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ gi.require_version('Gtk', '3.0')
|
|||||||
imagecache = {}
|
imagecache = {}
|
||||||
manaicons = {}
|
manaicons = {}
|
||||||
set_list = []
|
set_list = []
|
||||||
|
set_dict = {}
|
||||||
|
|
||||||
# Card library object
|
# Card library object
|
||||||
library = {}
|
library = {}
|
||||||
@@ -139,6 +140,7 @@ def load_sets():
|
|||||||
# Sort the loaded sets based on the sets name
|
# Sort the loaded sets based on the sets name
|
||||||
for set in sorted(sets, key=lambda x: x.name):
|
for set in sorted(sets, key=lambda x: x.name):
|
||||||
set_list.append(set)
|
set_list.append(set)
|
||||||
|
set_dict[set.code] = set
|
||||||
|
|
||||||
|
|
||||||
def reload_image_cache():
|
def reload_image_cache():
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class MainWindow:
|
|||||||
self.ui.add_from_file("gui/mainwindow.glade")
|
self.ui.add_from_file("gui/mainwindow.glade")
|
||||||
self.ui.add_from_file("gui/overlays.glade")
|
self.ui.add_from_file("gui/overlays.glade")
|
||||||
self.ui.add_from_file("gui/search.glade")
|
self.ui.add_from_file("gui/search.glade")
|
||||||
self.ui.add_from_file("gui/detailswindow.glade")
|
|
||||||
window = self.ui.get_object("mainWindow")
|
window = self.ui.get_object("mainWindow")
|
||||||
self.current_page = None
|
self.current_page = None
|
||||||
util.app = self
|
util.app = self
|
||||||
@@ -53,8 +52,41 @@ class MainWindow:
|
|||||||
status_bar.push(0, msg)
|
status_bar.push(0, msg)
|
||||||
|
|
||||||
def show_card_details(self, card):
|
def show_card_details(self, card):
|
||||||
print("Show", card.name)
|
builder = Gtk.Builder()
|
||||||
pass
|
builder.add_from_file("gui/detailswindow.glade")
|
||||||
|
builder.add_from_file("gui/overlays.glade")
|
||||||
|
window = builder.get_object("cardDetails")
|
||||||
|
window.set_title(card.name)
|
||||||
|
# Card Image
|
||||||
|
container = builder.get_object("imageContainer")
|
||||||
|
pixbuf = util.load_card_image(card, 63 * 5, 88 * 5)
|
||||||
|
image = Gtk.Image().new_from_pixbuf(pixbuf)
|
||||||
|
container.add(image)
|
||||||
|
|
||||||
|
|
||||||
|
# Name
|
||||||
|
builder.get_object("cardName").set_text(card.name)
|
||||||
|
# Types
|
||||||
|
supertypes = ""
|
||||||
|
if card.subtypes is not None:
|
||||||
|
supertypes = " - " + " ".join(card.subtypes)
|
||||||
|
types = " ".join(card.types) + supertypes
|
||||||
|
builder.get_object("cardTypes").set_text(types)
|
||||||
|
# Rarity
|
||||||
|
builder.get_object("cardRarity").set_text(card.rarity if card.rarity else "")
|
||||||
|
# Release
|
||||||
|
builder.get_object("cardReleaseDate").set_text(card.release_date if card.release_date else "")
|
||||||
|
# Set
|
||||||
|
builder.get_object("cardSet").set_text(card.set_name)
|
||||||
|
# Printings
|
||||||
|
prints = []
|
||||||
|
for set in card.printings:
|
||||||
|
prints.append(util.set_dict[set].name)
|
||||||
|
|
||||||
|
builder.get_object("cardPrintings").set_text(", ".join(prints))
|
||||||
|
# Legalities
|
||||||
|
#builder.get_object("cardLegalities").set_text(", ".join(card.legalities))
|
||||||
|
window.show_all()
|
||||||
|
|
||||||
|
|
||||||
win = MainWindow()
|
win = MainWindow()
|
||||||
|
|||||||
Reference in New Issue
Block a user