Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd committed Jul 2, 2024
1 parent 61ad8f9 commit c6c98c9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions miller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('')
Expand All @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c6c98c9

Please sign in to comment.