Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust log window height in GUI according to OS #447

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion aleappGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ def pickModules():
# All the stuff inside your window.

normal_font = ("Helvetica", 12)

if is_platform_macos():
log_window_height = 29
elif is_platform_linux():
log_window_height = 23
else:
log_window_height = 20

loader: typing.Optional[plugin_loader.PluginLoader] = None
mlist = []
# go through list of available modules and confirm they exist on the disk
Expand Down Expand Up @@ -196,7 +204,7 @@ def pickModules():
sg.Text('Timezone Offset (Not Implemented Yet):', font=("Helvetica", 14)),
sg.Combo(list(tzvalues), size=(20,15), key='timezone',readonly=True)
],
[sg.Column(mlist, size=(300,310), scrollable=True), sg.Output(size=(85,29))],
[sg.Column(mlist, size=(300,310), scrollable=True), sg.Output(size=(85,log_window_height))],
[sg.ProgressBar(max_value=GuiWindow.progress_bar_total, orientation='h', size=(86, 7), key='PROGRESSBAR', bar_color=('DarkGreen', 'White'))],
[sg.Submit('Process', font=normal_font), sg.Button('Close', font=normal_font)] ]

Expand Down
11 changes: 9 additions & 2 deletions scripts/ilapfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ def convert_ts_int_to_utc(ts): #This int timestamp to human format & utc
timestamp = datetime.fromtimestamp(ts, tz=timezone.utc)
return timestamp

def is_platform_linux():
'''Returns True if running on Linux'''
return sys.platform == 'linux'

def is_platform_macos():
'''Returns True if running on macOS'''
return sys.platform == 'darwin'

def is_platform_windows():
'''Returns True if running on Windows'''
return os.name == 'nt'

return sys.platform == 'win32'

def sanitize_file_path(filename, replacement_char='_'):
'''
Expand Down
3 changes: 2 additions & 1 deletion scripts/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,8 @@ def create_index_html(reportfolderbase, time_in_secs, time_HMS, extraction_type,

if len(casedata) > 0:
for key, value in casedata.items():
case_list.append([key, value])
if value:
case_list.append([key, value])

case_list += [
['Extraction location', image_input_path],
Expand Down