Skip to content

Commit

Permalink
QFileDialog now opens in the user's home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakama3942 committed Oct 5, 2022
1 parent fd61fd6 commit fdddfa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from PyQt6 import QtWidgets
from PyQt6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
from PyQt6.QtCore import QDir
from PyQt6.QtGui import QPixmap

from ui.raw.ui_sender import Ui_Sender
Expand Down Expand Up @@ -106,7 +107,7 @@ def toolAddImage_Clicked(self):
It opens a file dialog, sets the text of the imageAddress line edit to the path of the selected file, and
enables/disables the appropriate buttons
"""
self.imageAddress.setText(QFileDialog.getOpenFileName(self, caption="Selecting an image", filter="Images (*.png *.xpm *.jpg)")[0])
self.imageAddress.setText(QFileDialog.getOpenFileName(self, caption="Selecting an image", directory=str(QDir.homePath()), filter="Images (*.png *.xpm *.jpg)")[0])
self.toolAddImage.setEnabled(False)
self.toolResetImage.setEnabled(True)

Expand Down

0 comments on commit fdddfa4

Please sign in to comment.