Skip to content

Commit

Permalink
more GUI work, icons and screenshot added
Browse files Browse the repository at this point in the history
  • Loading branch information
OxPoly committed May 24, 2014
1 parent 07df864 commit 932069d
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 30 deletions.
2 changes: 1 addition & 1 deletion centry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
import hashlib
import socket

#TODO: Implement ECC restart option
parser = argparse.ArgumentParser(prog="Centry",description='Pythonic Panic Program for the Security Minded',epilog="Version 0.1")
parser.add_argument("-d", "--daemon", help="Run as a daemon in the background", action='store_true')
parser.add_argument("--paranoid", help='Activates paranoid mode. Default: Off', action='store_true')
Expand Down
68 changes: 39 additions & 29 deletions gui.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
#!/usr/bin/python3
from tkinter import *

import tkinter as tk

class Application(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.pack()
self.createWidgets()

def createWidgets(self):
self.title=tk.Label(self)
self.title["text"] = "Centry"
self.title["font"] = ('',26,'bold')
self.title.pack(side='top')
self.hi_there = tk.Button(self)
# self.hi_there["text"] = "Hello World\n(click me)"
# self.hi_there["command"] = self.say_hi
# self.hi_there.pack(side="right")

self.QUIT = tk.Button(self, text="PANIC",font=('',32,''), bg="red", fg="black",
command=root.destroy)
self.QUIT.pack(side="bottom")

def say_hi(self):
print("hi there, everyone!")

root = tk.Tk()
app = Application(master=root)
app.master.title("Centry Panic Systems")
app.master.geometry("400x300")
def fire():
print("FIREIFREFIRE")
app = Tk()

mainframe = Frame()

header = Frame(mainframe)
title=Label(header)
title["text"] = "Centry"
title["font"] = ('',32,'bold')
title.pack(side="left", anchor='e',padx=90)
photo = PhotoImage(file="settings.gif")
settings = Button(header)
settings["image"] = photo
settings.pack(side="right",fill='both', anchor="e",pady=5,padx=5)
header.pack(side="top",fill=X)

body = Frame(mainframe)

separator = Frame(body,height=2, bd=1, relief=SUNKEN)
separator.pack(side='top',fill=X, padx=5, pady=5)

status=Label(body)
status["text"] = "Status: Armed (Paranoid)"
status['font'] = ('', 14,'')
status.pack(fill="both")
body.pack(fill="both")

mainframe.pack(side='top', fill="both")

panicf = Frame()
panic = Button(panicf, text="PANIC",font=('',28,''), bg="#db0303", fg="black",activebackground="red", command=fire)
panic.pack(side="bottom", fill='both')
panicf.pack(fill=X, padx=5, pady=5,side='bottom')

app.title("Centry")
app.geometry("400x165")
app.iconbitmap("@icon.xbm")
app.mainloop()
46 changes: 46 additions & 0 deletions icon.xbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#define icon_width 64
#define icon_height 64
static unsigned char icon_bits[] = {
0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f,
0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xc0, 0x0f, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x01, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x00, 0x3e, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x78, 0x00, 0x00,
0x00, 0x00, 0x1f, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x0f, 0xf0, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xff, 0xf3, 0x00, 0x00,
0x00, 0x00, 0xef, 0xff, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xff, 0x3f, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f,
0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0xf8, 0xff, 0x00, 0x00,
0x00, 0x80, 0xff, 0x03, 0xc0, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0x01,
0x80, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, 0xff, 0x03, 0x00,
0x00, 0xe0, 0x7f, 0xc0, 0x03, 0xfe, 0x07, 0x00, 0x00, 0xe0, 0x3f, 0xc0,
0x03, 0xfc, 0x07, 0x00, 0x00, 0xe0, 0x1f, 0xc0, 0x03, 0xf8, 0x07, 0x00,
0x00, 0xe0, 0x1f, 0xf0, 0x0f, 0xf8, 0x07, 0x00, 0x00, 0xf0, 0x1f, 0xf8,
0x1f, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0xf8, 0x1f, 0xf0, 0x0f, 0x00,
0x00, 0xf0, 0x0f, 0xfc, 0x3f, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0xfc,
0x3f, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0xfc, 0x3f, 0xf0, 0x0f, 0x00,
0x00, 0xf0, 0x0f, 0xfc, 0x3f, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0xf8,
0x1f, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x1f, 0xf8, 0x1f, 0xf8, 0x0f, 0x00,
0x00, 0xf0, 0x1f, 0xf0, 0x0f, 0xf8, 0x0f, 0x00, 0x00, 0xe0, 0x1f, 0xc0,
0x03, 0xf8, 0x07, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xfc, 0x07, 0x00,
0x00, 0xe0, 0x7f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x00,
0x00, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x80, 0xff, 0x03, 0x00,
0x00, 0x80, 0xff, 0x03, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0x1f,
0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00 };
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added settings.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 932069d

Please sign in to comment.