Skip to content

Commit dd6ab9d

Browse files
committed
fixed dialog cancellation causing current working directory to be set for sorting, set GUI to prefer monospace fonts
1 parent ee569d0 commit dd6ab9d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

WallPaperSort.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import collections
44
import shutil
5-
import faulthandler
65
from PyQt5 import QtCore, QtGui, QtWidgets
76
from PIL import Image
87

@@ -31,12 +30,13 @@ def __init__(self):
3130
font.setBold(False)
3231
font.setWeight(50)
3332
font.setKerning(False)
33+
font.setStyleHint(QtGui.QFont.Monospace)
3434
self.label.setFont(font)
3535
self.label.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
3636
self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
3737
self.label.setLineWidth(1)
3838
self.label.setText("<html><head/><body><pre style=\" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a name=\"maincontent\"/><span style=\" font-family:\'SF Mono\';\"> _</span><span style=\" font-family:\'SF Mono\';\">_ __ _ _ _____ _____ _______ </span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> \\ \\ / / | | | __ \\ / ____| |__ __|</span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> \\ \\ /\\ / /_ _| | | |__) |_ _ _ __ ___ _ _| (___ ___ _ __| | </span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> \\ \\/ \\/ / _` | | | ___/ _` | \'_ \\ / _ \\ \'__\\___ \\ / _ \\| \'__| | </span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> \\ /\\ / (_| | | | | | (_| | |_) | __/ | ____) | (_) | | | | </span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> \\/ \\/ \\__,_|_|_|_| \\__,_| .__/ \\___|_| |_____/ \\___/|_| |_| </span></pre><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> | | </span></pre><pre style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SF Mono\';\"> |_| </span></pre><p><br/></p></body></html>")
39-
self.label.setTextFormat(QtCore.Qt.AutoText)
39+
self.label.setTextFormat(QtCore.Qt.RichText)
4040
self.label.setScaledContents(False)
4141
self.label.setAlignment(QtCore.Qt.AlignCenter)
4242
self.label.setWordWrap(False)
@@ -87,6 +87,10 @@ def center_on_screen(self):
8787

8888
def get_directory(self):
8989
file = str(QtWidgets.QFileDialog.getExistingDirectory(self, 'Select Directory to Sort'))
90+
if file is '':
91+
self.full_file_path = None
92+
return
93+
9094
self.label_2_text = "Path Set: {}".format(file)
9195
self.label_2.show()
9296
self.retranslate_ui()

0 commit comments

Comments
 (0)