Skip to content

Commit 5eb786c

Browse files
Add files via upload
1 parent 854d5ae commit 5eb786c

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

DBConverter.exe

11.8 MB
Binary file not shown.

DBConverter.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#V0.01.00
1+
#V1.00.00
22

3-
#Importing libraries for SQLite3 conversion
3+
#Importing libraries
44
import os
55
import sqlite3
66
import csv
@@ -85,6 +85,10 @@ def openFile():
8585
Checkbutton(fTable, text=table, variable = var).grid(row=rowPos, column=1, sticky="W")
8686
rowPos += 1
8787
updateScrollRegion()
88+
else: #Clears checklist if an existing database is replaced with an invalid file or no file
89+
checkbox_vars=[]
90+
for widget in fTable.winfo_children():
91+
widget.destroy()
8892

8993
my_text.configure(state="disabled")
9094

@@ -118,6 +122,7 @@ def ConversionWindow():
118122
def cancelProcess():
119123
mainWindow.destroy()
120124

125+
#Reads the states of the tickboxes in the checkWindow
121126
def readStates():
122127
global tickStates
123128
tickStates = []
@@ -131,8 +136,19 @@ def readStates():
131136

132137
mainWindow = Tk() #Opening window for file selection
133138

139+
windowWidth = 1200
140+
windowHeight = 300
141+
checkWidth = 300
142+
checkHeight = windowHeight
143+
screen_width = mainWindow.winfo_screenwidth()
144+
screen_height = mainWindow.winfo_screenheight()
145+
windowCornerH = (screen_width - windowWidth - checkWidth)/2
146+
windowCornerV = (screen_height - windowHeight)/2
147+
checkCornerH = windowCornerH + windowWidth
148+
checkCornerV = windowCornerV
149+
134150
#Basic window geometry
135-
mainWindow.geometry('%dx%d+%d+%d' % (1200, 300, 400, 400))
151+
mainWindow.geometry('%dx%d+%d+%d' % (windowWidth, windowHeight, windowCornerH, windowCornerV))
136152
mainWindow.resizable(False, False)
137153
mainWindow.title("SQLite3 Database (*.DB) Conversion Tool")
138154

@@ -174,8 +190,9 @@ def readStates():
174190
#Database table selection window
175191
tickWindow = Toplevel(mainWindow)
176192
tickWindow.title("Select tables to export")
177-
tickWindow.geometry('%dx%d+%d+%d' % (300, 300, 1600, 400))
193+
tickWindow.geometry('%dx%d+%d+%d' % (checkWidth, checkHeight, checkCornerH, checkCornerV))
178194
tickWindow.resizable(False, False)
195+
tickWindow.protocol("WM_DELETE_WINDOW", cancelProcess) #Closes main window when child window is closed
179196

180197
cTableContainer = Canvas(tickWindow)
181198
fTable = Frame(cTableContainer)
@@ -196,4 +213,4 @@ def createScrollableContainer():
196213
createScrollableContainer()
197214

198215
tickWindow.mainloop()
199-
mainWindow.mainloop()
216+
mainWindow.mainloop()

0 commit comments

Comments
 (0)