diff --git a/cv_engine/engine.py b/cv_engine/engine.py
index 2466274..3c11a68 100644
--- a/cv_engine/engine.py
+++ b/cv_engine/engine.py
@@ -2,10 +2,8 @@ import json
import os
import itertools
-from jsondiff import diff
-
from cv_engine.database import CardvaultDB
-from cv_engine.util import EngineConfig, Utilities
+from cv_engine.util import EngineConfig, EngineConstants, Utilities
class CardvaultEngine:
@@ -16,7 +14,7 @@ class CardvaultEngine:
"""
if config_file:
Utilities.apply_config(config_file)
- db_file_path = os.path.join(EngineConfig.config_path, EngineConfig.db_file)
+ db_file_path = os.path.join(EngineConstants.config_path, EngineConfig.db_file)
self.database = CardvaultDB(db_file_path)
def get_card(self, card_id):
diff --git a/cv_engine/util.py b/cv_engine/util.py
index d97d29c..e2780c1 100644
--- a/cv_engine/util.py
+++ b/cv_engine/util.py
@@ -14,8 +14,6 @@ class EngineConfig:
duplicate_names_in_search = True
# Log level for cv_engine
log_level = 0
- # Default path of cardvault configuration file
- config_path = os.path.join(os.path.expanduser('~'), '.config', 'cardvault')
# Name of the database file
db_file = 'cardvault.db'
# Default path to store temporary files
@@ -31,6 +29,16 @@ class EngineConstants:
engine_version = 0.1
# Location of manual wiki
manual_location = 'https://github.com/luxick/cardvault'
+ # Default path of cardvault configuration file
+ config_path = os.path.join(os.path.expanduser('~'), '.config', 'cardvault')
+
+
+class GTKConstants:
+ """
+ Constants for the GTK Ui
+ """
+ # Directory in witch glade ui files are stored
+ glade_files = '/gui'
class MTGConstants:
@@ -88,3 +96,13 @@ class Utilities:
cards.append(c)
output = output + cards
return output
+
+ @staticmethod
+ def expand_file_path(base_file, sub_dirs) -> str:
+ """
+ Get absolute file path relative to another file
+ :param base_file: Current file from witch to expand
+ :param sub_dirs: List of sub directories to desired file
+ :return: Full file path of chosen file
+ """
+ return os.path.join(os.path.dirname(base_file), *sub_dirs)
\ No newline at end of file
diff --git a/cv_gtk3/__init__.py b/cv_gtk3/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/cv_gtk3/gtkui.py b/cv_gtk3/gtkui.py
new file mode 100644
index 0000000..5927c4a
--- /dev/null
+++ b/cv_gtk3/gtkui.py
@@ -0,0 +1,44 @@
+import gi
+
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk
+
+from cv_engine import engine
+from cv_engine.util import Utilities
+
+from cv_gtk3.main_window import MainWindowFunctions
+from cv_gtk3.setting import GUISettings
+
+
+class CardvaultGTK(MainWindowFunctions):
+ """
+ Main UI class for the GTK interface
+ """
+ def __init__(self):
+ # Start engine (without config file)
+ self.engine = engine.CardvaultEngine()
+
+ # Load Glade files
+ glade_files = ['mainwindow.glade', 'overlays.glade', 'search.glade', 'dialogs.glade']
+ self.ui = Gtk.Builder()
+ for file in glade_files:
+ self.ui.add_from_file(Utilities.expand_file_path(__file__, ['gui', file]))
+
+ # Set pages for the ui to use
+ GUISettings.pages = {
+ "search": self.ui.get_object("searchView"),
+ }
+
+ # Call constructor of superclasses
+ MainWindowFunctions.__init__(self, self.ui)
+
+ self.ui.get_object('mainWindow').connect('delete-event', Gtk.main_quit)
+ self.ui.get_object('mainWindow').show_all()
+ self.hide_initial_widgets()
+
+ self.switch_page('search')
+
+if __name__ == '__main__':
+ CardvaultGTK()
+ Gtk.main()
+
diff --git a/cv_gtk3/gui/cardtree.glade b/cv_gtk3/gui/cardtree.glade
new file mode 100644
index 0000000..bfdd2bf
--- /dev/null
+++ b/cv_gtk3/gui/cardtree.glade
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
diff --git a/cv_gtk3/gui/detailswindow.glade b/cv_gtk3/gui/detailswindow.glade
new file mode 100644
index 0000000..e42900d
--- /dev/null
+++ b/cv_gtk3/gui/detailswindow.glade
@@ -0,0 +1,387 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ 600
+
+
+ True
+ False
+ True
+ True
+ 5
+ 5
+
+
+ True
+ False
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ center
+ vertical
+
+
+ 1
+ 0
+
+
+
+
+ True
+ False
+ True
+ vertical
+
+
+ True
+ False
+ Rulings
+
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ 200
+ True
+ True
+ True
+ True
+ in
+
+
+ True
+ True
+ rulesStore
+ False
+ False
+ False
+
+
+ none
+
+
+
+
+ autosize
+ Date
+
+
+
+ 0
+
+
+
+
+
+
+ Rule
+
+
+ word-char
+ 300
+
+
+ 1
+
+
+
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ 0
+ 1
+ 3
+
+
+
+
+ True
+ False
+ start
+ 10
+ 5
+
+
+ True
+ False
+ end
+ start
+ 2
+ Card Name:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ 0.10000000149011612
+
+
+
+
+
+
+ 1
+ 0
+
+
+
+
+ True
+ False
+ end
+ start
+ 2
+ Type:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ 0.10000000149011612
+
+
+ 1
+ 1
+
+
+
+
+ True
+ False
+ end
+ start
+ 2
+ Rarity:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 2
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ 0.10000000149011612
+
+
+ 1
+ 2
+
+
+
+
+ True
+ False
+ end
+ start
+ 2
+ Release:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 3
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ 0.10000000149011612
+
+
+ 1
+ 3
+
+
+
+
+ True
+ False
+ end
+ start
+ 2
+ Edition:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 4
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ 0.10000000149011612
+
+
+ 1
+ 4
+
+
+
+
+ True
+ False
+ end
+ start
+ 2
+ Other Printings:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 5
+
+
+
+
+ True
+ False
+ start
+ Loading...
+ True
+ 50
+ 0.10000000149011612
+
+
+ 1
+ 5
+
+
+
+
+ True
+ False
+ start
+ 2
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+ 6
+
+
+
+
+ True
+ False
+ end
+ start
+ Legality:
+ right
+ 0.89999997615814209
+
+
+ 0
+ 6
+
+
+
+
+ 2
+ 0
+
+
+
+
+
+
+
+
+
diff --git a/cv_gtk3/gui/dialogs.glade b/cv_gtk3/gui/dialogs.glade
new file mode 100644
index 0000000..ddc6573
--- /dev/null
+++ b/cv_gtk3/gui/dialogs.glade
@@ -0,0 +1,671 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ Export Data
+ True
+ 320
+ 260
+ dialog
+
+
+ False
+ vertical
+ 4
+
+
+ False
+ end
+
+
+ gtk-ok
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ start
+ Choose what to export
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+ export_treestore
+ False
+ False
+
+
+
+
+
+ 30
+
+
+
+
+
+ 1
+ 0
+
+
+
+
+
+
+ Element
+
+
+
+ 2
+
+
+
+
+
+
+ True
+ True
+ 2
+
+
+
+
+
+ export_ok
+ export_cancel
+
+
+
+
+
+
+ False
+ Download
+ False
+ True
+ center
+ 280
+ dialog
+ False
+
+
+ False
+ 5
+ 5
+ 5
+ 5
+ True
+ True
+ vertical
+ 15
+
+
+ False
+ end
+
+
+
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ vertical
+ 5
+
+
+ True
+ False
+ 5
+
+
+ True
+ False
+ Connecting to the Internet
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ True
+
+
+ False
+ True
+ end
+ 1
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ start
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+
+
+
+
+
+ False
+ False
+ True
+ dialog
+ False
+
+
+ False
+ vertical
+ 4
+
+
+ False
+ end
+
+
+ gtk-ok
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ True
+
+
+ False
+ True
+ 1
+
+
+
+
+
+ okButtonRename
+ cancelButtonRename
+
+
+
+
+
+
+
+
+
+
+
+
+ Last used view
+
+
+
+
+ False
+ Preferences
+ dialog
+
+
+ False
+ vertical
+ 2
+
+
+ False
+ end
+
+
+ gtk-ok
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ 5
+ 5
+
+
+ True
+ False
+
+
+ True
+ False
+ General
+
+
+
+
+
+ 0
+ 0
+ 2
+
+
+
+
+ True
+ False
+ end
+ Start View
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ views_store
+
+
+
+ 0
+
+
+
+
+ 1
+ 1
+
+
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ Search
+
+
+
+
+
+ 0
+ 0
+ 2
+
+
+
+
+ Show results from all sets
+ True
+ True
+ False
+ Display mutliple cards with the same name from diffrents sets in search results.
+ True
+
+
+ 0
+ 1
+ 2
+
+
+
+
+ 1
+ 0
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+
+ button1
+ button2
+
+
+
+
+
+
+ False
+ False
+ dialog
+ False
+
+
+ False
+ vertical
+ 15
+
+
+ False
+ end
+
+
+ gtk-yes
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ gtk-no
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ 2
+ 2
+ 2
+ 2
+ center
+
+
+ False
+ True
+ 1
+
+
+
+
+
+ yn_yes
+ yn_no
+
+
+
+
+
+
+ False
+ False
+ dialog
+ False
+
+
+ False
+ vertical
+ 15
+
+
+ False
+ end
+
+
+ gtk-yes
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ gtk-no
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 2
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ 2
+ 2
+ 2
+ 2
+ center
+
+
+ False
+ True
+ 1
+
+
+
+
+
+ ync_yes
+ ync_no
+ ync_cancel
+
+
+
+
+
+
diff --git a/cv_gtk3/gui/library.glade b/cv_gtk3/gui/library.glade
new file mode 100644
index 0000000..d207ef9
--- /dev/null
+++ b/cv_gtk3/gui/library.glade
@@ -0,0 +1,346 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tagStore
+ 0
+
+
+
+ 0
+
+
+
+
+ Library
+ True
+ True
+
+
+
+ True
+ False
+ vertical
+ 4
+
+
+ True
+ True
+ True
+ True
+ in
+
+
+ True
+ False
+ True
+ tagStore
+ 1
+
+
+
+
+
+
+
+ False
+ tag
+
+
+
+
+ Tags
+ True
+ 0.5
+ True
+ 0
+
+
+
+ 1
+
+
+
+
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ Untagged
+ True
+ True
+ True
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ All
+ True
+ True
+ True
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ False
+
+
+ True
+ True
+ True
+ New Tag
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ Add
+ True
+ False
+ True
+ True
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ vertical
+ 4
+
+
+ True
+ False
+ 2
+ 2
+ False
+ 2
+
+
+ True
+ False
+ Showing:
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 5
+ 5
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+ edit-find-symbolic
+ False
+ False
+ Search
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ True
+ False
+ True
+
+
+ True
+ True
+ False
+ Tag selected cards
+ tagCompleter
+
+
+
+
+ False
+ True
+ 3
+
+
+
+
+ Tag card(s)
+ True
+ True
+ True
+
+
+
+ False
+ True
+ 4
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ True
+ True
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+
+
+
+
diff --git a/cv_gtk3/gui/mainwindow.glade b/cv_gtk3/gui/mainwindow.glade
new file mode 100644
index 0000000..012b07d
--- /dev/null
+++ b/cv_gtk3/gui/mainwindow.glade
@@ -0,0 +1,298 @@
+
+
+
+
+
+ Card Vault
+ False
+ Card Vault
+ 900
+ 700
+ cardvault
+
+
+
+ True
+ False
+ vertical
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ contentPage
+ True
+ False
+ vertical
+
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ statusBar
+ True
+ False
+ 5
+ 5
+ 10
+ 10
+ 5
+ 5
+ 2
+
+
+ True
+ False
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+ 2
+
+
+
+
+ True
+ False
+ True
+
+
+ False
+ True
+ 3
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+
+
+
+
+
diff --git a/cv_gtk3/gui/overlays.glade b/cv_gtk3/gui/overlays.glade
new file mode 100644
index 0000000..d0f3e0f
--- /dev/null
+++ b/cv_gtk3/gui/overlays.glade
@@ -0,0 +1,281 @@
+
+
+
+
+
+ True
+ False
+ 10
+ True
+ True
+
+
+ True
+ False
+ start
+ Loading Image
+ True
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ center
+ end
+ True
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ center
+ center
+ True
+
+
+ True
+ False
+ True
+ end
+ 100
+ edit-find-symbolic
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ True
+ start
+ Use the Search View to add cards to your library
+
+
+ 0
+ 2
+
+
+
+
+ True
+ False
+ True
+ center
+ No cards in library
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ center
+ center
+ True
+
+
+ True
+ False
+ True
+ end
+ 100
+ edit-find-symbolic
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ True
+ center
+ No Results
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ True
+ start
+ No cards found
+
+
+ 0
+ 2
+
+
+
+
+ Not Found
+ True
+ False
+ center
+ center
+ 10
+ True
+ True
+
+
+ True
+ False
+ end
+ 100
+ edit-find-symbolic
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ start
+ Page not found
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ True
+ center
+ center
+ 10
+ True
+
+
+ True
+ False
+ True
+ center
+ Search
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ True
+ start
+ Use the entry on the left to search for cards
+
+
+ 0
+ 2
+
+
+
+
+ True
+ False
+ True
+ end
+ 100
+ edit-find-symbolic
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ center
+ center
+ vertical
+ 10
+ True
+
+
+ True
+ False
+ True
+ end
+ 100
+ edit-find-symbolic
+
+
+ 0
+ 0
+
+
+
+
+ True
+ False
+ True
+ center
+ No Results
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+ True
+ start
+ Use the Search function to add cards to your wants
+
+
+ 0
+ 2
+
+
+
+
diff --git a/cv_gtk3/gui/search.glade b/cv_gtk3/gui/search.glade
new file mode 100644
index 0000000..0a124be
--- /dev/null
+++ b/cv_gtk3/gui/search.glade
@@ -0,0 +1,415 @@
+
+
+
+
+
+
+ Search
+ True
+ True
+
+
+ leftPane
+ True
+ False
+ 5
+ 5
+ 5
+ 5
+ vertical
+ 2
+
+
+ searchBox
+ True
+ False
+ vertical
+ 2
+
+
+ True
+ True
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ Search
+ True
+ True
+ True
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+ 5
+ 1
+
+
+
+
+ filterGrid
+ True
+ False
+ center
+ 2
+ 2
+
+
+ True
+ False
+ Filters
+
+
+ 0
+ 0
+ 2
+
+
+
+
+ True
+ False
+ Mana Color
+
+
+ 0
+ 1
+
+
+
+
+ True
+ False
+
+
+ W
+ True
+ True
+ True
+ True
+
+
+ 0
+ 0
+
+
+
+
+ U
+ True
+ True
+ True
+
+
+ 1
+ 0
+
+
+
+
+ R
+ True
+ True
+ True
+
+
+ 0
+ 1
+
+
+
+
+ G
+ True
+ True
+ True
+
+
+ 1
+ 1
+
+
+
+
+ B
+ True
+ True
+ True
+
+
+ 2
+ 0
+
+
+
+
+ gtk-clear
+ True
+ True
+ True
+ True
+
+
+
+ 2
+ 1
+
+
+
+
+ 1
+ 1
+
+
+
+
+ True
+ False
+ Rarity
+
+
+ 0
+ 2
+
+
+
+
+ True
+ False
+ 0
+
+
+ 1
+ 2
+
+
+
+
+ True
+ False
+ Type
+
+
+ 0
+ 3
+
+
+
+
+ True
+ False
+ 0
+
+
+ 1
+ 3
+
+
+
+
+ True
+ False
+ Edition
+
+
+ 0
+ 4
+
+
+
+
+ True
+ True
+ gtk-clear
+
+
+
+ 1
+ 4
+
+
+
+
+ Clear All
+ True
+ True
+ True
+
+
+
+ 1
+ 5
+
+
+
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ vertical
+ 2
+
+
+ False
+ 2
+ 2
+ 2
+
+
+ False
+ True
+ Showing results for:
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 2
+ 2
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ Add to Library
+ True
+ False
+ True
+ True
+
+
+
+ False
+ True
+ end
+ 2
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ True
+ True
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+
+
+
+
diff --git a/cv_gtk3/gui/wants.glade b/cv_gtk3/gui/wants.glade
new file mode 100644
index 0000000..9ae4038
--- /dev/null
+++ b/cv_gtk3/gui/wants.glade
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wants
+ True
+ True
+
+
+
+ True
+ False
+ vertical
+
+
+ True
+ True
+ never
+ in
+
+
+ True
+ True
+ True
+ True
+ wantsListsStore
+ 0
+
+
+
+
+
+
+
+ Wants List
+
+
+
+ 1
+
+
+
+
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ True
+ True
+ New Wants List
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ Add
+ True
+ True
+ True
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ vertical
+
+
+ True
+ False
+ 2
+ 2
+ 2
+
+
+ True
+ False
+ Showing:
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ 2
+ 2
+
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ True
+ True
+
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+
+
+
+
+
+
diff --git a/cv_gtk3/main_window.py b/cv_gtk3/main_window.py
new file mode 100644
index 0000000..c476775
--- /dev/null
+++ b/cv_gtk3/main_window.py
@@ -0,0 +1,48 @@
+from cv_gtk3.setting import GUISettings
+
+
+class MainWindowFunctions:
+ """
+ Class for holding general functions of the main window container
+ such as controlling the status and menu bar .
+ """
+ def __init__(self, ui):
+ self.ui = ui
+
+ def hide_initial_widgets(self):
+ self.ui.get_object('statusbar_spinner').set_visible(False)
+ self.ui.get_object('statusbar_label').set_visible(False)
+
+ def show_status(self, message):
+ """
+ Display a massage in the status bar alon with an animated spinner
+ :param message: The text to display
+ """
+ spinner = self.ui.get_object('statusbar_spinner')
+ label = self.ui.get_object('statusbar_label')
+ spinner.set_visible(True)
+ label.set_visible(True)
+ label.set_text(message)
+
+ def clear_status(self):
+ """
+ Hides the message an spinner in the status bar
+ """
+ self.ui.get_object('statusbar_spinner').set_visible(False)
+ self.ui.get_object('statusbar_label').set_visible(False)
+
+ def switch_page(self, page):
+ """
+ Switch active page
+ :param page: name of the new page
+ """
+ container = self.ui.get_object("contentPage")
+ new_page = GUISettings.pages[page]
+ if GUISettings.current_page:
+ container.remove(GUISettings.current_page)
+ GUISettings.current_page = new_page
+ container.pack_start(GUISettings.current_page, True, True, 0)
+ container.show_all()
+ GUISettings.current_page.emit('show')
+ app_title = GUISettings.current_page.get_name() + " - " +GUISettings.application_title
+ self.ui.get_object("mainWindow").set_title(app_title)
\ No newline at end of file
diff --git a/cv_gtk3/resources/images/demo.jpg b/cv_gtk3/resources/images/demo.jpg
new file mode 100644
index 0000000..8770dcf
Binary files /dev/null and b/cv_gtk3/resources/images/demo.jpg differ
diff --git a/cv_gtk3/resources/images/dummy.jpg b/cv_gtk3/resources/images/dummy.jpg
new file mode 100644
index 0000000..db96d70
Binary files /dev/null and b/cv_gtk3/resources/images/dummy.jpg differ
diff --git a/cv_gtk3/resources/images/dummy_315x450.png b/cv_gtk3/resources/images/dummy_315x450.png
new file mode 100644
index 0000000..4c2170c
Binary files /dev/null and b/cv_gtk3/resources/images/dummy_315x450.png differ
diff --git a/cv_gtk3/resources/mana/0.png b/cv_gtk3/resources/mana/0.png
new file mode 100644
index 0000000..ccf4745
Binary files /dev/null and b/cv_gtk3/resources/mana/0.png differ
diff --git a/cv_gtk3/resources/mana/1.png b/cv_gtk3/resources/mana/1.png
new file mode 100644
index 0000000..25910d5
Binary files /dev/null and b/cv_gtk3/resources/mana/1.png differ
diff --git a/cv_gtk3/resources/mana/10.png b/cv_gtk3/resources/mana/10.png
new file mode 100644
index 0000000..0c7df91
Binary files /dev/null and b/cv_gtk3/resources/mana/10.png differ
diff --git a/cv_gtk3/resources/mana/11.png b/cv_gtk3/resources/mana/11.png
new file mode 100644
index 0000000..8981a63
Binary files /dev/null and b/cv_gtk3/resources/mana/11.png differ
diff --git a/cv_gtk3/resources/mana/12.png b/cv_gtk3/resources/mana/12.png
new file mode 100644
index 0000000..491f57c
Binary files /dev/null and b/cv_gtk3/resources/mana/12.png differ
diff --git a/cv_gtk3/resources/mana/13.png b/cv_gtk3/resources/mana/13.png
new file mode 100644
index 0000000..9bf560d
Binary files /dev/null and b/cv_gtk3/resources/mana/13.png differ
diff --git a/cv_gtk3/resources/mana/14.png b/cv_gtk3/resources/mana/14.png
new file mode 100644
index 0000000..5b3d3e1
Binary files /dev/null and b/cv_gtk3/resources/mana/14.png differ
diff --git a/cv_gtk3/resources/mana/15.png b/cv_gtk3/resources/mana/15.png
new file mode 100644
index 0000000..c141fc1
Binary files /dev/null and b/cv_gtk3/resources/mana/15.png differ
diff --git a/cv_gtk3/resources/mana/16.png b/cv_gtk3/resources/mana/16.png
new file mode 100644
index 0000000..9cedaab
Binary files /dev/null and b/cv_gtk3/resources/mana/16.png differ
diff --git a/cv_gtk3/resources/mana/17.png b/cv_gtk3/resources/mana/17.png
new file mode 100644
index 0000000..151ed3b
Binary files /dev/null and b/cv_gtk3/resources/mana/17.png differ
diff --git a/cv_gtk3/resources/mana/18.png b/cv_gtk3/resources/mana/18.png
new file mode 100644
index 0000000..3570589
Binary files /dev/null and b/cv_gtk3/resources/mana/18.png differ
diff --git a/cv_gtk3/resources/mana/19.png b/cv_gtk3/resources/mana/19.png
new file mode 100644
index 0000000..03a11f8
Binary files /dev/null and b/cv_gtk3/resources/mana/19.png differ
diff --git a/cv_gtk3/resources/mana/2.png b/cv_gtk3/resources/mana/2.png
new file mode 100644
index 0000000..ba97c06
Binary files /dev/null and b/cv_gtk3/resources/mana/2.png differ
diff --git a/cv_gtk3/resources/mana/20.png b/cv_gtk3/resources/mana/20.png
new file mode 100644
index 0000000..d26b949
Binary files /dev/null and b/cv_gtk3/resources/mana/20.png differ
diff --git a/cv_gtk3/resources/mana/2b.png b/cv_gtk3/resources/mana/2b.png
new file mode 100644
index 0000000..d43c422
Binary files /dev/null and b/cv_gtk3/resources/mana/2b.png differ
diff --git a/cv_gtk3/resources/mana/2g.png b/cv_gtk3/resources/mana/2g.png
new file mode 100644
index 0000000..dfb55de
Binary files /dev/null and b/cv_gtk3/resources/mana/2g.png differ
diff --git a/cv_gtk3/resources/mana/2r.png b/cv_gtk3/resources/mana/2r.png
new file mode 100644
index 0000000..d96ae08
Binary files /dev/null and b/cv_gtk3/resources/mana/2r.png differ
diff --git a/cv_gtk3/resources/mana/2u.png b/cv_gtk3/resources/mana/2u.png
new file mode 100644
index 0000000..139cd80
Binary files /dev/null and b/cv_gtk3/resources/mana/2u.png differ
diff --git a/cv_gtk3/resources/mana/2w.png b/cv_gtk3/resources/mana/2w.png
new file mode 100644
index 0000000..cc94187
Binary files /dev/null and b/cv_gtk3/resources/mana/2w.png differ
diff --git a/cv_gtk3/resources/mana/3.png b/cv_gtk3/resources/mana/3.png
new file mode 100644
index 0000000..e17feb1
Binary files /dev/null and b/cv_gtk3/resources/mana/3.png differ
diff --git a/cv_gtk3/resources/mana/4.png b/cv_gtk3/resources/mana/4.png
new file mode 100644
index 0000000..5c0ff85
Binary files /dev/null and b/cv_gtk3/resources/mana/4.png differ
diff --git a/cv_gtk3/resources/mana/5.png b/cv_gtk3/resources/mana/5.png
new file mode 100644
index 0000000..fbaaea9
Binary files /dev/null and b/cv_gtk3/resources/mana/5.png differ
diff --git a/cv_gtk3/resources/mana/6.png b/cv_gtk3/resources/mana/6.png
new file mode 100644
index 0000000..44685bd
Binary files /dev/null and b/cv_gtk3/resources/mana/6.png differ
diff --git a/cv_gtk3/resources/mana/7.png b/cv_gtk3/resources/mana/7.png
new file mode 100644
index 0000000..65ceb52
Binary files /dev/null and b/cv_gtk3/resources/mana/7.png differ
diff --git a/cv_gtk3/resources/mana/8.png b/cv_gtk3/resources/mana/8.png
new file mode 100644
index 0000000..81817e5
Binary files /dev/null and b/cv_gtk3/resources/mana/8.png differ
diff --git a/cv_gtk3/resources/mana/9.png b/cv_gtk3/resources/mana/9.png
new file mode 100644
index 0000000..33cd6df
Binary files /dev/null and b/cv_gtk3/resources/mana/9.png differ
diff --git a/cv_gtk3/resources/mana/B-G.png b/cv_gtk3/resources/mana/B-G.png
new file mode 100644
index 0000000..16ff5a1
Binary files /dev/null and b/cv_gtk3/resources/mana/B-G.png differ
diff --git a/cv_gtk3/resources/mana/B-P.png b/cv_gtk3/resources/mana/B-P.png
new file mode 100644
index 0000000..b8a95ab
Binary files /dev/null and b/cv_gtk3/resources/mana/B-P.png differ
diff --git a/cv_gtk3/resources/mana/B-R.png b/cv_gtk3/resources/mana/B-R.png
new file mode 100644
index 0000000..9206ae0
Binary files /dev/null and b/cv_gtk3/resources/mana/B-R.png differ
diff --git a/cv_gtk3/resources/mana/B.png b/cv_gtk3/resources/mana/B.png
new file mode 100644
index 0000000..9bdeb95
Binary files /dev/null and b/cv_gtk3/resources/mana/B.png differ
diff --git a/cv_gtk3/resources/mana/B_alt.png b/cv_gtk3/resources/mana/B_alt.png
new file mode 100644
index 0000000..245051e
Binary files /dev/null and b/cv_gtk3/resources/mana/B_alt.png differ
diff --git a/cv_gtk3/resources/mana/C.png b/cv_gtk3/resources/mana/C.png
new file mode 100644
index 0000000..2694fd8
Binary files /dev/null and b/cv_gtk3/resources/mana/C.png differ
diff --git a/cv_gtk3/resources/mana/C_alt.png b/cv_gtk3/resources/mana/C_alt.png
new file mode 100644
index 0000000..b60f4a8
Binary files /dev/null and b/cv_gtk3/resources/mana/C_alt.png differ
diff --git a/cv_gtk3/resources/mana/G-P.png b/cv_gtk3/resources/mana/G-P.png
new file mode 100644
index 0000000..6505e9d
Binary files /dev/null and b/cv_gtk3/resources/mana/G-P.png differ
diff --git a/cv_gtk3/resources/mana/G-U.png b/cv_gtk3/resources/mana/G-U.png
new file mode 100644
index 0000000..d5534df
Binary files /dev/null and b/cv_gtk3/resources/mana/G-U.png differ
diff --git a/cv_gtk3/resources/mana/G-W.png b/cv_gtk3/resources/mana/G-W.png
new file mode 100644
index 0000000..58ecb1b
Binary files /dev/null and b/cv_gtk3/resources/mana/G-W.png differ
diff --git a/cv_gtk3/resources/mana/G.png b/cv_gtk3/resources/mana/G.png
new file mode 100644
index 0000000..0b9de84
Binary files /dev/null and b/cv_gtk3/resources/mana/G.png differ
diff --git a/cv_gtk3/resources/mana/G_alt.png b/cv_gtk3/resources/mana/G_alt.png
new file mode 100644
index 0000000..b41ccd9
Binary files /dev/null and b/cv_gtk3/resources/mana/G_alt.png differ
diff --git a/cv_gtk3/resources/mana/R-G.png b/cv_gtk3/resources/mana/R-G.png
new file mode 100644
index 0000000..28352fc
Binary files /dev/null and b/cv_gtk3/resources/mana/R-G.png differ
diff --git a/cv_gtk3/resources/mana/R-P.png b/cv_gtk3/resources/mana/R-P.png
new file mode 100644
index 0000000..a4c609f
Binary files /dev/null and b/cv_gtk3/resources/mana/R-P.png differ
diff --git a/cv_gtk3/resources/mana/R-W.png b/cv_gtk3/resources/mana/R-W.png
new file mode 100644
index 0000000..299bae4
Binary files /dev/null and b/cv_gtk3/resources/mana/R-W.png differ
diff --git a/cv_gtk3/resources/mana/R.png b/cv_gtk3/resources/mana/R.png
new file mode 100644
index 0000000..aae184b
Binary files /dev/null and b/cv_gtk3/resources/mana/R.png differ
diff --git a/cv_gtk3/resources/mana/R_alt.png b/cv_gtk3/resources/mana/R_alt.png
new file mode 100644
index 0000000..5263bd1
Binary files /dev/null and b/cv_gtk3/resources/mana/R_alt.png differ
diff --git a/cv_gtk3/resources/mana/S.png b/cv_gtk3/resources/mana/S.png
new file mode 100644
index 0000000..6800592
Binary files /dev/null and b/cv_gtk3/resources/mana/S.png differ
diff --git a/cv_gtk3/resources/mana/T.png b/cv_gtk3/resources/mana/T.png
new file mode 100644
index 0000000..4237b55
Binary files /dev/null and b/cv_gtk3/resources/mana/T.png differ
diff --git a/cv_gtk3/resources/mana/U-B.png b/cv_gtk3/resources/mana/U-B.png
new file mode 100644
index 0000000..a51d5c8
Binary files /dev/null and b/cv_gtk3/resources/mana/U-B.png differ
diff --git a/cv_gtk3/resources/mana/U-P.png b/cv_gtk3/resources/mana/U-P.png
new file mode 100644
index 0000000..8305d69
Binary files /dev/null and b/cv_gtk3/resources/mana/U-P.png differ
diff --git a/cv_gtk3/resources/mana/U-R.png b/cv_gtk3/resources/mana/U-R.png
new file mode 100644
index 0000000..97042c2
Binary files /dev/null and b/cv_gtk3/resources/mana/U-R.png differ
diff --git a/cv_gtk3/resources/mana/U.png b/cv_gtk3/resources/mana/U.png
new file mode 100644
index 0000000..add2250
Binary files /dev/null and b/cv_gtk3/resources/mana/U.png differ
diff --git a/cv_gtk3/resources/mana/U_alt.png b/cv_gtk3/resources/mana/U_alt.png
new file mode 100644
index 0000000..a0ccba1
Binary files /dev/null and b/cv_gtk3/resources/mana/U_alt.png differ
diff --git a/cv_gtk3/resources/mana/W-B.png b/cv_gtk3/resources/mana/W-B.png
new file mode 100644
index 0000000..921efb0
Binary files /dev/null and b/cv_gtk3/resources/mana/W-B.png differ
diff --git a/cv_gtk3/resources/mana/W-P.png b/cv_gtk3/resources/mana/W-P.png
new file mode 100644
index 0000000..b9530f1
Binary files /dev/null and b/cv_gtk3/resources/mana/W-P.png differ
diff --git a/cv_gtk3/resources/mana/W-U.png b/cv_gtk3/resources/mana/W-U.png
new file mode 100644
index 0000000..59afef4
Binary files /dev/null and b/cv_gtk3/resources/mana/W-U.png differ
diff --git a/cv_gtk3/resources/mana/W.png b/cv_gtk3/resources/mana/W.png
new file mode 100644
index 0000000..2c84442
Binary files /dev/null and b/cv_gtk3/resources/mana/W.png differ
diff --git a/cv_gtk3/resources/mana/W_alt.png b/cv_gtk3/resources/mana/W_alt.png
new file mode 100644
index 0000000..4ff6c41
Binary files /dev/null and b/cv_gtk3/resources/mana/W_alt.png differ
diff --git a/cv_gtk3/resources/mana/X.png b/cv_gtk3/resources/mana/X.png
new file mode 100644
index 0000000..1be868c
Binary files /dev/null and b/cv_gtk3/resources/mana/X.png differ
diff --git a/cv_gtk3/resources/mana/Y.png b/cv_gtk3/resources/mana/Y.png
new file mode 100644
index 0000000..53e453b
Binary files /dev/null and b/cv_gtk3/resources/mana/Y.png differ
diff --git a/cv_gtk3/resources/mana/Z.png b/cv_gtk3/resources/mana/Z.png
new file mode 100644
index 0000000..d0f1963
Binary files /dev/null and b/cv_gtk3/resources/mana/Z.png differ
diff --git a/cv_gtk3/resources/mana/flip.png b/cv_gtk3/resources/mana/flip.png
new file mode 100644
index 0000000..cacd12f
Binary files /dev/null and b/cv_gtk3/resources/mana/flip.png differ
diff --git a/cv_gtk3/resources/mana/half.png b/cv_gtk3/resources/mana/half.png
new file mode 100644
index 0000000..89a03ba
Binary files /dev/null and b/cv_gtk3/resources/mana/half.png differ
diff --git a/cv_gtk3/resources/mana/infinite.png b/cv_gtk3/resources/mana/infinite.png
new file mode 100644
index 0000000..963d7fa
Binary files /dev/null and b/cv_gtk3/resources/mana/infinite.png differ
diff --git a/cv_gtk3/resources/mana/tap_old.png b/cv_gtk3/resources/mana/tap_old.png
new file mode 100644
index 0000000..1ab17d4
Binary files /dev/null and b/cv_gtk3/resources/mana/tap_old.png differ
diff --git a/cv_gtk3/resources/mana/untap.png b/cv_gtk3/resources/mana/untap.png
new file mode 100644
index 0000000..7dc4008
Binary files /dev/null and b/cv_gtk3/resources/mana/untap.png differ
diff --git a/cv_gtk3/setting.py b/cv_gtk3/setting.py
new file mode 100644
index 0000000..3d897f6
--- /dev/null
+++ b/cv_gtk3/setting.py
@@ -0,0 +1,10 @@
+class GUISettings:
+ """
+ Settings for the GUI
+ """
+ # Collection of all pages the UI can use
+ pages = {}
+ # Currently viewed page
+ current_page = ''
+ # Title for the GTK window
+ application_title = 'Cardvault'
diff --git a/cv_gtk3/signal_handlers/__init__.py b/cv_gtk3/signal_handlers/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/cv_gtk3/signal_handlers/handlers.py b/cv_gtk3/signal_handlers/handlers.py
new file mode 100644
index 0000000..57f7bcb
--- /dev/null
+++ b/cv_gtk3/signal_handlers/handlers.py
@@ -0,0 +1,10 @@
+class Handlers:
+ """
+ Class containing all signal handlers for the GTK GUI
+ """
+ def __init__(self, app):
+ """
+ Initialize handler class
+ :param app: reference to an CardvaultGTK object
+ """
+ self.app = app