-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (37 loc) · 1.15 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
from Handler import Handler
from Config import Config
import gi
from Crawler import Crawler
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
title = "GameDotExe"
config_dir = 'GameDotExe'
class GameDotExe:
config = None
crawler = None
games_list = None
def initialize(self):
self.config = Config()
def __init__(self):
self.icon_list = None
self.initialize()
self.main()
def main(self):
games_path = self.config.get_path()
builder = Gtk.Builder()
dir_path = os.path.dirname(os.path.realpath(__file__))
builder.add_from_file(dir_path + "/gui.glade")
win = builder.get_object("mainWindow")
btn_quit = builder.get_object("btn_quit")
self.crawler = Crawler(games_path)
self.crawler.build_list()
self.games_list = self.crawler.get_list()
builder.connect_signals(Handler(Crawler))
icon_list = builder.get_object("game_icons")
icon_list.set_model(self.games_list)
icon_list.set_pixbuf_column(0)
icon_list.set_text_column(1)
win.show_all()
Gtk.main()
main = GameDotExe()