Skip to content
Snippets Groups Projects
Commit 9a85c4b8 authored by Toumji Abdallah's avatar Toumji Abdallah
Browse files

Merge remote-tracking branch 'origin/master'

parents 54092b75 e9b5dc37
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import json
import os
import shutil
import tkinter as tk
import platform
from pathlib import Path
from tkinter import ttk, messagebox
......@@ -554,8 +555,12 @@ class Application(tk.Frame):
command=self.actual_project_state)
self.show_project_button.pack()
if platform.system() == 'Windows':
open_project_button = tk.Button(self.integrate_sidecar_frame, text='Open project',
command=lambda: os.startfile(self.project_directory))
else:
open_project_button = tk.Button(self.integrate_sidecar_frame, text='Open project',
command=lambda: os.system('xdg-open ' + self.project_directory))
open_project_button.pack()
self.previous_directory = None
......
......@@ -14,6 +14,7 @@ Functions:
import json
import os
from re import search
import platform
def get_entities(experiments_files, project_directory):
......@@ -386,7 +387,10 @@ class Tools:
The metadata of the file in json format
"""
if platform.system() == 'Windows':
layout_path = path.replace('/', '\\')
else:
layout_path = path
metadata = self.layout.get()[self.layout.get(return_type='filename').index(layout_path)].get_metadata()
metadata = json.dumps(metadata,
skipkeys=True,
......@@ -405,7 +409,10 @@ class Tools:
The pybids bids file
"""
if platform.system() == 'Windows':
layout_path = path.replace('/', '\\')
else:
layout_path = path
return self.layout.get()[self.layout.get(return_type='filename').index(layout_path)]
......@@ -9,6 +9,7 @@ Methods:
"""
import tkinter as tk
import platform
from BIDSHandler.MainApplication import Application as MainApplication
......@@ -32,7 +33,11 @@ class BIDSViewer:
""" The constructor of the class, it instantiates the main window of the application.
"""
root = tk.Tk()
if platform.system() == 'Windows':
root.state('zoomed')
else:
root.attributes('-zoomed', True)
root.title('BIDS Handler')
self.app = MainApplication(root)
def show(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment