md5sumchecker.py 2.22 KB
Newer Older
Jonathan Carter's avatar
Jonathan Carter committed
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python3

import sys
import pygame
import time

pygame.init()
pygame.font.init()


# Some initial variables
# TODO: Get from config file
SCREEN_WIDTH=1600
SCREEN_HEIGHT=900

SCREEN_WIDTH=1024
SCREEN_HEIGHT=768

size = width, height = SCREEN_WIDTH, SCREEN_HEIGHT
speed = [0, 0]
black = 0, 0, 0
grey = 40, 40, 40

# Set up window
pygame.display.set_caption('md5sumchecker')
# Set to pygame.FULLSCREEN for fullscreen
screen = pygame.display.set_mode((size), pygame.NOFRAME)
#screen = pygame.display.set_mode((size), pygame.FULLSCREEN)
screen.fill(grey)

# Load images

usbimg = pygame.image.load('usb.png')

def clear_screen():
    screen.fill(grey)


def drawcard_intro():
    clear_screen()
    pygame.draw.rect(screen, (180, 38, 34), (50, 50, SCREEN_WIDTH-110, 110))
    titlefont = pygame.font.SysFont("Cantarell Extra Bold", 120)
    label = titlefont.render("AIMS Desktop", 1, (255, 255, 255))
    text_rect = label.get_rect(center=(SCREEN_WIDTH/2, 105))
    screen.blit(label, text_rect)

    textfont = pygame.font.SysFont("Cantarell Bold", 40)
    label = textfont.render("This tool will check the integrity of files on this installation media.",
                            1, (200, 200, 200))
    text_rect = label.get_rect(center=(SCREEN_WIDTH/2, 240))
    screen.blit(label, text_rect)

    textfont = pygame.font.SysFont("Cantarell Bold", 40)
    label = textfont.render("To continue press space. To quit press ESC.", 1, (200, 200, 200))
    text_rect = label.get_rect(center=(SCREEN_WIDTH/2, 330))
    screen.blit(label, text_rect)

    img_rect = usbimg.get_rect(center=(SCREEN_WIDTH/2, 500))
    screen.blit(usbimg, img_rect)

    pygame.display.flip()


def drawcard_offair():
    clear_screen()
    pygame.draw.rect(screen, (40, 200, 200), (50, 50, 700, 110))
    myfont = pygame.font.SysFont("Cantarell Extra Bold", 120)
    label = myfont.render("TESTING", 1, (255, 255, 255))
    screen.blit(label, (225, 60))
    pygame.display.flip()


while True:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            if (event.key == pygame.K_ESCAPE):
                print("Escape pressed, exiting...")
                sys.exit()

        if event.type == pygame.QUIT:
            sys.exit()

    drawcard_intro()