From c6c98c9cb79c9e49a9cb4f6e359e4a4f3d110e78 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 2 Jul 2024 21:18:20 +0200 Subject: [PATCH] Formatting --- miller.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/miller.py b/miller.py index 3363cfb..fec64dd 100644 --- a/miller.py +++ b/miller.py @@ -4,7 +4,7 @@ import os from PyQt6.QtWidgets import ( QApplication, QMainWindow, QHBoxLayout, QListView, - QWidget, QAbstractItemView, QMenuBar, QMenu, QToolBar, + QWidget, QAbstractItemView, QMenu, QToolBar, QMessageBox, QLineEdit ) from PyQt6.QtCore import QModelIndex, QSettings, QByteArray, Qt @@ -30,7 +30,7 @@ def __init__(self): self.setCentralWidget(self.central_widget) self.layout = QHBoxLayout(self.central_widget) - + self.columns = [] self.file_model = QFileSystemModel() self.file_model.setRootPath('') @@ -50,12 +50,11 @@ def show_context_menu(self, pos, column_view): index = column_view.indexAt(pos) if index.isValid(): file_path = self.file_model.filePath(index) - is_directory = self.file_model.isDir(index) if os.name == 'nt': self.show_windows_context_menu(file_path) return - + context_menu = QMenu() open_action = context_menu.addAction("Open") @@ -73,7 +72,7 @@ def show_context_menu(self, pos, column_view): properties_action = context_menu.addAction("Properties") properties_action.triggered.connect(lambda: self.show_properties(index)) - + if os.name == 'nt': context_menu.addSeparator() show_windows_context_menu = context_menu.addAction("Show Windows Context Menu") @@ -276,7 +275,7 @@ def on_selection_changed(self, current: QModelIndex, previous: QModelIndex): column_to_remove = self.columns.pop() self.layout.removeWidget(column_to_remove) column_to_remove.deleteLater() - + # Add a new column if the selected item is a directory if self.file_model.isDir(current): self.add_column(current)