diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 555fae6..17deb6a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ master - make it possible to set default filter corners via config file (see #66) - enable parallel event upload/replacement/deletion on seishub and jane (see #67) + - fix Qt application Window icon (see #68) 0.5.0 - add support for magnitude estimation for data fetched from an FDSN server diff --git a/obspyck/obspyck.py b/obspyck/obspyck.py index a2b8eb1..7afd157 100755 --- a/obspyck/obspyck.py +++ b/obspyck/obspyck.py @@ -62,6 +62,8 @@ NAMESPACE = "http://erdbeben-in-bayern.de/xmlns/0.1" NSMAP = {"edb": NAMESPACE} +ICON_PATH = os.path.join(os.path.dirname( + sys.modules[__name__].__file__), 'obspyck{}.gif') if map(int, obspy.__version__.split('.')[:2]) < [1, 1]: msg = "Needing ObsPy version >= 1.1.0 (current version is: {})" @@ -117,6 +119,15 @@ def __init__(self, clients, streams, options, keys, config): self.widgets = Ui_qMainWindow_obsPyck() self.widgets.setupUi(self) + # set icon + app_icon = QtGui.QIcon() + app_icon.addFile(ICON_PATH.format("_16x16"), QtCore.QSize(16, 16)) + app_icon.addFile(ICON_PATH.format("_24x42"), QtCore.QSize(24, 24)) + app_icon.addFile(ICON_PATH.format("_32x32"), QtCore.QSize(32, 32)) + app_icon.addFile(ICON_PATH.format("_48x48"), QtCore.QSize(48, 48)) + app_icon.addFile(ICON_PATH.format(""), QtCore.QSize(64, 64)) + self.setWindowIcon(app_icon) + # Create little color icons in front of the phase type combo box. # Needs to be done pretty much at the beginning because some other # stuff relies on the phase type being set. @@ -647,7 +658,13 @@ def on_qToolButton_replaceEvent_clicked(self, *args): except: user = None qMessageBox = QtGui.QMessageBox() - qMessageBox.setWindowIcon(QtGui.QIcon(QtGui.QPixmap("obspyck.gif"))) + app_icon = QtGui.QIcon() + app_icon.addFile(ICON_PATH.format("_16x16"), QtCore.QSize(16, 16)) + app_icon.addFile(ICON_PATH.format("_24x42"), QtCore.QSize(24, 24)) + app_icon.addFile(ICON_PATH.format("_32x32"), QtCore.QSize(32, 32)) + app_icon.addFile(ICON_PATH.format("_48x48"), QtCore.QSize(48, 48)) + app_icon.addFile(ICON_PATH.format(""), QtCore.QSize(64, 64)) + qMessageBox.setWindowIcon(app_icon) qMessageBox.setIcon(QtGui.QMessageBox.Warning) qMessageBox.setWindowTitle("Replace?") qMessageBox.setText("Overwrite event in database?") @@ -681,7 +698,13 @@ def on_qToolButton_deleteEvent_clicked(self, *args): except: user = None qMessageBox = QtGui.QMessageBox() - qMessageBox.setWindowIcon(QtGui.QIcon(QtGui.QPixmap("obspyck.gif"))) + app_icon = QtGui.QIcon() + app_icon.addFile(ICON_PATH.format("_16x16"), QtCore.QSize(16, 16)) + app_icon.addFile(ICON_PATH.format("_24x42"), QtCore.QSize(24, 24)) + app_icon.addFile(ICON_PATH.format("_32x32"), QtCore.QSize(32, 32)) + app_icon.addFile(ICON_PATH.format("_48x48"), QtCore.QSize(48, 48)) + app_icon.addFile(ICON_PATH.format(""), QtCore.QSize(64, 64)) + qMessageBox.setWindowIcon(app_icon) qMessageBox.setIcon(QtGui.QMessageBox.Warning) qMessageBox.setWindowTitle("Delete?") qMessageBox.setText("Delete event from database?") @@ -4531,7 +4554,13 @@ def checkForSysopEventDuplicates(self, starttime, endtime): self.error(err) self.error(errlist) qMessageBox = QtGui.QMessageBox() - qMessageBox.setWindowIcon(QtGui.QIcon(QtGui.QPixmap("obspyck.gif"))) + app_icon = QtGui.QIcon() + app_icon.addFile(ICON_PATH.format("_16x16"), QtCore.QSize(16, 16)) + app_icon.addFile(ICON_PATH.format("_24x42"), QtCore.QSize(24, 24)) + app_icon.addFile(ICON_PATH.format("_32x32"), QtCore.QSize(32, 32)) + app_icon.addFile(ICON_PATH.format("_48x48"), QtCore.QSize(48, 48)) + app_icon.addFile(ICON_PATH.format(""), QtCore.QSize(64, 64)) + qMessageBox.setWindowIcon(app_icon) qMessageBox.setIcon(QtGui.QMessageBox.Critical) qMessageBox.setWindowTitle("Possible Duplicate Public Event!") qMessageBox.setText(err) @@ -4576,7 +4605,13 @@ def popupBadEventError(self, msg): " %s." % msg) self.error(err) qMessageBox = QtGui.QMessageBox() - qMessageBox.setWindowIcon(QtGui.QIcon(QtGui.QPixmap("obspyck.gif"))) + app_icon = QtGui.QIcon() + app_icon.addFile(ICON_PATH.format("_16x16"), QtCore.QSize(16, 16)) + app_icon.addFile(ICON_PATH.format("_24x42"), QtCore.QSize(24, 24)) + app_icon.addFile(ICON_PATH.format("_32x32"), QtCore.QSize(32, 32)) + app_icon.addFile(ICON_PATH.format("_48x48"), QtCore.QSize(48, 48)) + app_icon.addFile(ICON_PATH.format(""), QtCore.QSize(64, 64)) + qMessageBox.setWindowIcon(app_icon) qMessageBox.setIcon(QtGui.QMessageBox.Critical) qMessageBox.setWindowTitle("Public Event with Missing Information!") qMessageBox.setText(err) diff --git a/obspyck/obspyck_16x16.gif b/obspyck/obspyck_16x16.gif new file mode 100644 index 0000000..66d237f Binary files /dev/null and b/obspyck/obspyck_16x16.gif differ diff --git a/obspyck/obspyck_24x24.gif b/obspyck/obspyck_24x24.gif new file mode 100644 index 0000000..258cf2a Binary files /dev/null and b/obspyck/obspyck_24x24.gif differ diff --git a/obspyck/obspyck_32x32.gif b/obspyck/obspyck_32x32.gif new file mode 100644 index 0000000..9a1668b Binary files /dev/null and b/obspyck/obspyck_32x32.gif differ diff --git a/obspyck/obspyck_48x48.gif b/obspyck/obspyck_48x48.gif new file mode 100644 index 0000000..a0efda5 Binary files /dev/null and b/obspyck/obspyck_48x48.gif differ diff --git a/setup.py b/setup.py index 0bbbaf1..a5ac3f7 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,8 @@ ] } PACKAGE_DATA = { - 'obspyck': ['example.cfg', 'obspyck.gif']} + 'obspyck': ['example.cfg', 'obspyck.gif', 'obspyck_16x16.gif', + 'obspyck_24x24.gif', 'obspyck_32x32.gif', 'obspyck_48x48.gif']} SETUP_DIRECTORY = os.path.dirname(os.path.abspath(inspect.getfile( inspect.currentframe())))