88
88
# Set up logging.
89
89
logger = logging .getLogger (__name__ )
90
90
logging .basicConfig ()
91
+ logger .setLevel (logging .WARNING )
91
92
92
93
93
94
# Qt.py compatibility: HACK for missing QUrl.path in PySide2 build.
@@ -141,11 +142,14 @@ class UsdMngrWindow(QtWidgets.QMainWindow):
141
142
- Mac could use more testing and work with icons and theme.
142
143
143
144
- Remember scroll position per file so going back in history jumps you to approximately where you were before.
145
+ - Add Browse... buttons to select default applications.
146
+ - Set consistent cross-platform read/write/execute permissions when saving new files
144
147
145
148
Known issues:
146
149
147
150
- AddressBar file completer has problems occasionally.
148
151
- Figure out why network printers aren't showing up. Linux or DWA issue? macOS and Windows are fine.
152
+ - Save As... doesn't add file to recent files or history menus.
149
153
- Qt.py problems:
150
154
151
155
- PyQt5
@@ -291,7 +295,11 @@ def setupUi(self):
291
295
self .exitAction .setIcon (ft ("application-exit" ))
292
296
self .documentationAction .setIcon (ft ("help-browser" ))
293
297
self .aboutAction .setIcon (ft ("help-about" ))
294
- self .buttonCloseFind .setIcon (ft ("window-close" )) # TODO: Need mac icon
298
+ icon = ft ("window-close" )
299
+ if icon .isNull ():
300
+ self .buttonCloseFind .setText ("x" )
301
+ else :
302
+ self .buttonCloseFind .setIcon (ft ("window-close" ))
295
303
296
304
# Try for standard name, then fall back to crystal_project name.
297
305
self .actionBrowse .setIcon (ft ("applications-internet" , ft ("Globe" )))
@@ -2769,7 +2777,7 @@ def setSource(self, link, isNewFile=True, newTab=False, hScrollPos=0, vScrollPos
2769
2777
# Read in the file.
2770
2778
usd = False
2771
2779
try :
2772
- if self .validateFileSize (fileStr ):
2780
+ if self .validateFileSize (fileInfo ):
2773
2781
if utils .queryItemBoolValue (link , "binary" ) or ext == "usdc" :
2774
2782
# Treat this file as a binary USD crate file. Don't bother
2775
2783
# checking the first line. If this is a valid ASCII USD
@@ -3043,18 +3051,18 @@ def setSources(self, files):
3043
3051
for path in files :
3044
3052
self .setSource (utils .expandUrl (path , prevPath ), newTab = True )
3045
3053
3046
- def validateFileSize (self , path ):
3054
+ def validateFileSize (self , info ):
3047
3055
""" If a file's size is above a certain threshold, confirm the user still wants to open the file.
3048
3056
3049
3057
:Parameters:
3050
- path : `str `
3051
- File path
3058
+ info : `QtCore.QFileInfo `
3059
+ File info object
3052
3060
:Returns:
3053
3061
If we should open the file or not
3054
3062
:Rtype:
3055
3063
`bool`
3056
3064
"""
3057
- size = QtCore . QFileInfo ( path ) .size ()
3065
+ size = info .size ()
3058
3066
if size >= 104857600 : # 100 MB
3059
3067
self .restoreOverrideCursor ()
3060
3068
try :
@@ -3126,9 +3134,9 @@ def goPressed(self, *args):
3126
3134
""" Handle loading the current path in the address bar.
3127
3135
"""
3128
3136
# Check if text has changed.
3129
- text = utils .expandUrl (self .addressBar .text ().strip ())
3130
- if text != self .currTab .getCurrentUrl ():
3131
- self .setSource (text )
3137
+ url = utils .expandUrl (self .addressBar .text ().strip ())
3138
+ if url != self .currTab .getCurrentUrl ():
3139
+ self .setSource (url )
3132
3140
else :
3133
3141
self .refreshTab ()
3134
3142
@@ -3786,7 +3794,6 @@ def __init__(self, parent=None):
3786
3794
self .tabBar = TabBar (self )
3787
3795
self .tabBar .tabMoveRequested .connect (self .moveTab )
3788
3796
self .setTabBar (self .tabBar )
3789
- QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+Tab" ), self , self .nextTab )
3790
3797
3791
3798
@Slot (int , int )
3792
3799
def moveTab (self , fromIndex , toIndex ):
@@ -3805,12 +3812,6 @@ def moveTab(self, fromIndex, toIndex):
3805
3812
self .insertTab (toIndex , widget , icon , text )
3806
3813
self .setCurrentIndex (toIndex )
3807
3814
3808
- def nextTab (self ):
3809
- """ Switch to the next tab. If on the last tab, go back to the first.
3810
- """
3811
- i = self .currentIndex () + 1
3812
- self .setCurrentIndex (0 if i == self .count () else i )
3813
-
3814
3815
def setTabIcon (self , index , icon ):
3815
3816
""" Override the default method to set the same icon on our custom action that focuses on or re-opens the
3816
3817
widget at the given index.
@@ -4585,7 +4586,6 @@ def _set_log_level(self):
4585
4586
4586
4587
Call this after each component in the case of misbehaving libraries.
4587
4588
"""
4588
- logger .setLevel (logging .WARNING )
4589
4589
if self .opts ['info' ]:
4590
4590
logger .setLevel (logging .INFO )
4591
4591
if self .opts ['debug' ]:
@@ -4650,6 +4650,7 @@ def onExit(self):
4650
4650
"""
4651
4651
App ._eventLoopStarted = False
4652
4652
self .cleanup ()
4653
+ logging .shutdown ()
4653
4654
4654
4655
4655
4656
class Settings (QtCore .QSettings ):
0 commit comments