Skip to content

Commit

Permalink
Update GUI package
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan296 committed May 7, 2023
1 parent 345e193 commit fa63fe9
Show file tree
Hide file tree
Showing 16 changed files with 4,506 additions and 47,256 deletions.
2 changes: 1 addition & 1 deletion File_Manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ exe = EXE(
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['file_manager_icon.icns'],
icon=['Icon.icns'],
)
51 changes: 2 additions & 49 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ def search_file(self, name, filetype):
def list_files(self):
return os.listdir(self.root_path)

def get_user_name(self):
return getpass.getuser()


def move_file(filePath, folder_path):
shutil.move(filePath, folder_path)

Expand All @@ -56,24 +52,10 @@ def __init__(self):
layout = self.layout()

# Add widgets for file searching and manipulation
self.filename_input = QLineEdit()
layout.addWidget(self.filename_input)

self.filetype_combo = QLineEdit()
layout.addWidget(self.filetype_combo)

browse_button = QPushButton("Browse")
browse_button.clicked.connect(self.browse)
layout.addWidget(browse_button)

search_button = QPushButton("Search")
search_button.clicked.connect(self.search)
layout.addWidget(search_button)

move_button = QPushButton("Move File")
move_button.clicked.connect(self.move)
layout.addWidget(move_button)

open_button = QPushButton("Open")
open_button.clicked.connect(self.open)
layout.addWidget(open_button)
Expand All @@ -87,37 +69,8 @@ def browse(self):
folder_path = QFileDialog.getExistingDirectory()
if folder_path:
self.searcher = FileSearcher(folder_path)

def search(self):
filename = self.filename_input.text()
filetype = self.filetype_combo.text()
file_list = self.searcher.list_files()
filtered_files = [
f for f in file_list if f.endswith(filetype) and filename in f
]
if filtered_files:
self.selectFile(os.path.join(self.searcher.root_path, filtered_files[0]))
else:
QMessageBox.warning(self, "Warning", "No files found in the selected directory.")

def move(self):
if self.selectedFiles():
folder_path = QFileDialog.getExistingDirectory()
if folder_path:
for file_path in self.selectedFiles():
move_file(file_path, folder_path)
QMessageBox.information(
self,
"Information",
f"Your File has been moved succesfully from {file_path} to {folder_path}!",
)
self.selected_files.clear()
else:
QMessageBox.warning(
self,
"Warning"
"No files selected.",
)


if __name__ == '__main__':
app = QApplication(sys.argv)
dialog = FileDialog()
Expand Down
50 changes: 50 additions & 0 deletions GUI.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
['GUI.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='GUI',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='GUI',
)
Binary file added Icon.icns
Binary file not shown.
Loading

0 comments on commit fa63fe9

Please sign in to comment.