def opencase(self): gui = self gui.geometry("400x250") gui.title("HOAX") self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) gui.iconbitmap('Hoax.ico') new_case_label = Label(gui, text="Load Case", width=9, font=("bold", 15)) new_case_label.place(x=148, y=53) c = Label(gui, text="Case Name:", width=15) c.place(x=15, y=130) cb = Entry(gui) cb.place(x=136, y=130) e = ttk.Button(gui, text="Open Case", width=11, command=lambda: [setCaseName(getCaseName())]) e.place(x=185, y=200) def getCaseName(): name = cb.get() return name f = ttk.Button(gui, text="Go Back", width=7, command=lambda: [menuV1.Homepage(), self.destroy()]) f.place(x=125, y=200) def setCaseName(input_name): global caseId name = input_name #check of de naam bestaat print(DatabaseManager.getCaseId(DatabaseManager, name)) print( DatabaseManager.getCaseFolder( DatabaseManager, DatabaseManager.getCaseId(DatabaseManager, name))) if DatabaseManager.getCaseId(DatabaseManager, name) == False: tm.showerror("Error", "Incorrect case name") else: caseId = DatabaseManager.getCaseId(DatabaseManager, name) print(DatabaseManager.getCaseId(DatabaseManager, name)) menuV1.Homepage.set_Opencase_True(self) self.destroy() menuV1.Homepage()
def logoutwindow(self): gui = self gui.geometry("400x250") gui.title("HOAX") logout_label = Label(gui, text="Log out", width=6, font=("bold", 15)) logout_label.place(x=160, y=53) a = Label(gui, text="Are you sure you want to log out as the current user?", width=64) a.place(x=-10, y=110) e = ttk.Button(gui, text="YES", width=10, command=lambda: [self.destroy(), test(), P2.HOAX()])#[P2.HOAX(), self.destroy()]) e.place(x=205, y=175) f = ttk.Button(gui, text="NO", width=10, command=lambda: [self.destroy(), menuV1.Homepage()]) #, test(), menuV1.Homepage()]) #, menuV1.Homepage()) #, menuV1.Homepage.delete, menuV1.Homepage()]) f.place(x=120, y=175)
def setCaseName(input_name): global caseId name = input_name #check of de naam bestaat print(DatabaseManager.getCaseId(DatabaseManager, name)) print( DatabaseManager.getCaseFolder( DatabaseManager, DatabaseManager.getCaseId(DatabaseManager, name))) if DatabaseManager.getCaseId(DatabaseManager, name) == False: tm.showerror("Error", "Incorrect case name") else: caseId = DatabaseManager.getCaseId(DatabaseManager, name) print(DatabaseManager.getCaseId(DatabaseManager, name)) menuV1.Homepage.set_Opencase_True(self) self.destroy() menuV1.Homepage()
def newclasscreated(self): gui = self gui.geometry("500x250") gui.title("HOAX") self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) gui.iconbitmap('Hoax.ico') new_class_label = Label(gui, text="New Case", width=14, font=("bold", 15)) new_class_label.place(x=170, y=53) a = Label( gui, text= "The new case has been created. \n You can now either close this window or click next to add an image.", width=102) a.place(x=-105, y=110) global casename b = ttk.Button(gui, text="Add Image", width=11, command=lambda: [ AddImageV2.AddImage.save_casename(casename), self.destroy(), AddImageV2.AddImage() ]) b.place(x=235, y=175) c = ttk.Button(gui, text="Close", width=7, command=lambda: [ menuV1.Homepage.save_casename(casename), menuV1.Homepage(), self.destroy() ]) c.place(x=170, y=175)
def closecasewindow(self): gui = self gui.geometry("400x250") gui.title("HOAX") self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) gui.iconbitmap('Hoax.ico') close_label = Label(gui, text="Close Case", width=10, font=("bold", 15)) close_label.place(x=148, y=40) a = Label(gui, text="Are you sure you want to close this case?", width=41) a.place(x=60, y=110) b = ttk.Button(gui, text="YES", width=10, command=lambda: [setZero(), self.destroy()]) #[P2.HOAX(self.geometry("500x500")), self.destroy()]) #geometry niet werkend b.place(x=205, y=175) def setZero(): OpenCaseV1.caseId = 0 test() P2.HOAX() menuV1.Homepage.set_Opencase_True(self) c = ttk.Button(gui, text="NO", width=10, command=lambda: [menuV1.Homepage(), self.destroy()]) c.place(x=120, y=175)
def verifyimage(self): gui = self gui.geometry("500x250") gui.title("HOAX") gui.iconbitmap('Hoax.ico') self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) new_case_label = Label(gui, text="Verify your image", width=17, font=("bold", 15)) new_case_label.place(x=148, y=43) a = Label( gui, text= "To verify the image(s) you've added to this case, click the button below. \n " "It will hash the images to ensure nothing has changed.", width=128) a.place(x=-200, y=100) cc = Button(gui, text="Verify your raw type image(s)", command=lambda: [self.destroy( ), verifydd()]) # command=lambda: verifyTest.Listbox) cc.place(x=165, y=146) cc = Button(gui, text="Verify your E01 type image(s)" ) # command=lambda: verifyTest.Listbox) cc.place(x=165, y=176) back_button = ttk.Button( gui, text="Go Back", width=10, command=lambda: [self.destroy(), menuV1.Homepage()]) back_button.place(x=213, y=206)
def createnewcase(self): gui = self gui.geometry("600x425") gui.title("HOAX") self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) gui.iconbitmap('Hoax.ico') new_case_label = Label(gui, text="New Case", width=14, font=("bold", 15)) new_case_label.place(x=215, y=53) a = Label(gui, text="Case Name:", width=10) a.place(x=110, y=130) ab = Entry(gui) ab.place(x=230, y=130) def getcasename(): casename = ab.get() return casename c = Label(gui, text="Employee number:", width=14) c.place(x=100, y=180) cb = Entry(gui) cb.place(x=230, y=180) def getimagelocation(): imagelocation = cb.get() return imagelocation d = Label(gui, text="Case Summary:", width=13) d.place(x=105, y=230) db = Entry(gui) db.place(x=230, y=230) def getcasesummary(): casesummary = db.get() return casesummary #cInfo = ab.get() #cFolder = cb.get() #cSummary = db.get() con = sqlite3.connect("database.db") cur = con.cursor() e = ttk.Button( gui, text="Create Case", width=11, command=lambda: [ DatabaseManager.createCase(DatabaseManager, getcasename( ), 0, getimagelocation(), 0, 0, datetime.datetime.now(), datetime.datetime.now()), CaseCreatedV1.NewClassCreated.save_casename(getcasename()), print(getcasename()), menuV1.Homepage.set_Opencase_False(self), self.destroy(), CaseCreatedV1.NewClassCreated() ] ) #"#, print(getcasename(),getcasesummary(), getimagelocation(), datetime.datetime.now())]) e.place(x=285, y=300) f = ttk.Button(gui, text="Go Back", width=7, command=lambda: [menuV1.Homepage(), self.destroy()]) f.place(x=205, y=300)
def addimagewindow(self): gui = self gui.geometry("600x425") self.attributes("-topmost", True) self.after_idle(self.attributes, '-topmost', False) gui.title("HOAX") gui.iconbitmap('Hoax.ico') new_case_label = Label(gui, text="Add an Image", width=12, font=("bold", 15)) new_case_label.place(x=230, y=53) g = Label(gui, text="Image number: ", width=14) g.place(x=111, y=120) gb = Entry(gui) gb.place(x=236, y=120) def getimagename(): imagename = gb.get() return imagename def getimagenumber(): imagenumber = gb.get() return imagenumber a = Label(gui, text="Image Location:", width=15) a.place(x=108, y=170) ac = Button(gui, text="Browse..", command=lambda: browsefunction(self)) ac.place(x=372, y=166) self.directorypath = StringVar() ab = Entry(gui, textvariable=self.directorypath) ab.place(x=236, y=170) global image_inside image_inside = '' def set_image_inside(): global image_inside image_inside = ab.get() def getimagepath(): imagepath = ab.get() return imagepath b = Label(gui, text="Serial number: ", width=15) b.place(x=104, y=220) bb = Entry(gui) bb.place(x=236, y=220) def getserialnumber(): serialname = bb.get() return serialname h = Label(gui, text="Data carrier number: ", width=21) h.place(x=98, y=270) hb = Entry(gui) hb.place(x=236, y=270) def getdatacarriernumber(): datacarriernumber = hb.get() return datacarriernumber image_opener = iterating_image_files.image_stored_list([]) b = ttk.Button(gui, text="Add Image", width=11, command=lambda: [image_opener.open_iterater_image(getimagepath(),'test'), defineImageList(self), image_loaded_true(), menuV1.Homepage.set_Opencase_False(self), menuV1.Homepage.save_casename(casename), set_image_inside(), set_image_info_db(), self.after(1000, self.destroy(), menuV1.Homepage())]) #, menuV1.Homepage().update)]) #, menuV1.Homepage().update)]) b.place(x=295, y=345) c = ttk.Button(gui, text="Go Back", width=7, command=lambda: [menuV1.Homepage(), self.destroy()]) c.place(x=220, y=345) def set_image_info_db(): DatabaseManager.createEvidence(DatabaseManager, getimagenumber(), 0, 0, getserialnumber(), getdatacarriernumber()) global casename if casename == '': casename = menuV1.Homepage.get_case_name_global(self) def image_loaded_true(): global image_loaded image_loaded = True return image_loaded def defineImageList(self): global image_list image_list = image_opener.get_list() return image_list def get_image_list(self): return image_list