Commit b46eb951 authored by Jürgen Herrmann's avatar Jürgen Herrmann

fixed bug in insertion method

ported to pyqt5

will be released as version 0.26
parent e324e5c0
......@@ -5,7 +5,7 @@
<excludeFolder url="file://$MODULE_DIR$/builds" />
<excludeFolder url="file://$MODULE_DIR$/debian" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5.2 (/usr/bin/python3)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
0.24
\ No newline at end of file
0.25
\ No newline at end of file
designer_qt4/PAPEq_rc/
\ No newline at end of file
designer_qt5/PAPEq_rc
\ No newline at end of file
from designer_qt4.Ui_AboutDialog import Ui_AboutDialog
from designer_qt5.Ui_AboutDialog import Ui_AboutDialog
from helpers.constants import *
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import QDesktopServices
from PyQt5.QtWidgets import QDialog
import os
import sys
class AboutDialog(QtGui.QDialog, Ui_AboutDialog):
class AboutDialog(QDialog, Ui_AboutDialog):
def __init__(self):
super(AboutDialog, self).__init__()
self.setupUi(self)
......
import base64
import binascii
from DataClasses.Preset import Preset
from designer_qt4.Ui_MainWindow import Ui_MainWindow
from designer_qt5.Ui_MainWindow import Ui_MainWindow
import glob
from helpers.functions import *
from io import BytesIO
......@@ -11,7 +11,8 @@ from matplotlib.figure import Figure
import mmap
import numpy
import os
from PyQt4 import QtGui, QtCore
from PyQt5.QtWidgets import QMainWindow
from PyQt5 import QtCore
import re
from scipy import signal
import struct
......@@ -19,7 +20,7 @@ from time import time
from WindowClasses.AboutDialog import AboutDialog
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super(MainWindow, self).__init__()
......@@ -98,13 +99,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# setup auto-apply timer
self._timerApplyEq = QtCore.QTimer(self)
self._timerApplyEq.setInterval(50)
self.connect(self._timerApplyEq, QtCore.SIGNAL("timeout()"), self._applyEq)
self._timerApplyEq.timeout.connect(self._applyEq)
self._timerApplyEq.start()
# setup update ui timer
self._needRedraw = True
self._timerUpdateUi = QtCore.QTimer(self)
self._timerUpdateUi.setInterval(50)
self.connect(self._timerUpdateUi, QtCore.SIGNAL("timeout()"), self._updateFrGraph)
self._timerUpdateUi.timeout.connect(self._updateFrGraph)
self._timerUpdateUi.start()
......@@ -316,6 +317,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self._modifyDefaultPa(action="insert")
self._setupMmaps()
self._needApply = True
else:
self._modifyDefaultPa(action="remove")
def onPresetComboBoxSelected(self):
......@@ -559,7 +562,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if content and content[-2:] != "\n\n":
content += "\n"
content += "### BEGIN: Parametric equalizer configuration\n"
content += "### Generated from: pulseaudio-parameq\n"
content += "### Generated by: pulseaudio-parameq\n"
content += "load-module module-ladspa-sink sink_name=%s " % LADSPA_SINK_NAME
content += "sink_master=%s plugin=%s label=%s " % (masterSinkName,
LADSPA_LIBRARY,
......@@ -679,7 +682,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self._disablePresetsComboboxHandler = False
def _pulseaudioMasterSink(self):
@staticmethod
def _pulseaudioMasterSink():
""" return name of pulseaudio master sink """
ret = os.popen('pacmd stat|grep "Default sink name"').read().replace("\n", "").replace("Default sink name: ", "")
if ret == LADSPA_SINK_NAME:
......
......@@ -4,11 +4,11 @@ for ui in *.ui; do
echo reading $ui...
py=`echo $ui | sed s#.ui#.py#`
echo writing $py...
pyuic4 $ui -o $py
pyuic5 $ui -o $py
done
echo
cd res
pyrcc4 -py3 -o ../PAPEq_rc/__init__.py PAPEq.qrc
pyrcc4 -py3 -o ../PAPEq_rc/darkstyle_icons.py darkstyle_icons.qrc
pyrcc5 -o ../PAPEq_rc/__init__.py PAPEq.qrc
pyrcc5 -o ../PAPEq_rc/darkstyle_icons.py darkstyle_icons.qrc
cd ..
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,87 +2,74 @@
# Form implementation generated from reading ui file 'Ui_AboutDialog.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_AboutDialog(object):
def setupUi(self, AboutDialog):
AboutDialog.setObjectName(_fromUtf8("AboutDialog"))
AboutDialog.setObjectName("AboutDialog")
AboutDialog.resize(403, 381)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/MainWindow/Icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon.addPixmap(QtGui.QPixmap(":/MainWindow/Icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AboutDialog.setWindowIcon(icon)
AboutDialog.setStyleSheet(_fromUtf8("background-color: #333;"))
self.buttonBox = QtGui.QDialogButtonBox(AboutDialog)
AboutDialog.setStyleSheet("background-color: #333;")
self.buttonBox = QtWidgets.QDialogButtonBox(AboutDialog)
self.buttonBox.setGeometry(QtCore.QRect(30, 340, 341, 32))
self.buttonBox.setStyleSheet(_fromUtf8(""))
self.buttonBox.setStyleSheet("")
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close)
self.buttonBox.setCenterButtons(True)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.label = QtGui.QLabel(AboutDialog)
self.buttonBox.setObjectName("buttonBox")
self.label = QtWidgets.QLabel(AboutDialog)
self.label.setGeometry(QtCore.QRect(10, 240, 381, 21))
self.label.setStyleSheet(_fromUtf8(""))
self.label.setStyleSheet("")
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.label_2 = QtGui.QLabel(AboutDialog)
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(AboutDialog)
self.label_2.setGeometry(QtCore.QRect(40, 260, 321, 21))
self.label_2.setStyleSheet(_fromUtf8(""))
self.label_2.setStyleSheet("")
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.label_4 = QtGui.QLabel(AboutDialog)
self.label_2.setObjectName("label_2")
self.label_4 = QtWidgets.QLabel(AboutDialog)
self.label_4.setGeometry(QtCore.QRect(40, 280, 321, 21))
font = QtGui.QFont()
font.setUnderline(True)
self.label_4.setFont(font)
self.label_4.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.label_4.setStyleSheet(_fromUtf8("color: #55f;"))
self.label_4.setStyleSheet("color: #55f;")
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.label_3 = QtGui.QLabel(AboutDialog)
self.label_4.setObjectName("label_4")
self.label_3 = QtWidgets.QLabel(AboutDialog)
self.label_3.setGeometry(QtCore.QRect(10, 10, 381, 220))
self.label_3.setText(_fromUtf8(""))
self.label_3.setPixmap(QtGui.QPixmap(_fromUtf8(":/AboutDialog/About.png")))
self.label_3.setText("")
self.label_3.setPixmap(QtGui.QPixmap(":/AboutDialog/About.png"))
self.label_3.setScaledContents(True)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.label_5 = QtGui.QLabel(AboutDialog)
self.label_3.setObjectName("label_3")
self.label_5 = QtWidgets.QLabel(AboutDialog)
self.label_5.setGeometry(QtCore.QRect(40, 300, 321, 21))
font = QtGui.QFont()
font.setUnderline(True)
self.label_5.setFont(font)
self.label_5.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.label_5.setStyleSheet(_fromUtf8("color: #55f;"))
self.label_5.setStyleSheet("color: #55f;")
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.label_5.setObjectName("label_5")
self.retranslateUi(AboutDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), AboutDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), AboutDialog.reject)
self.buttonBox.accepted.connect(AboutDialog.accept)
self.buttonBox.rejected.connect(AboutDialog.reject)
QtCore.QMetaObject.connectSlotsByName(AboutDialog)
def retranslateUi(self, AboutDialog):
AboutDialog.setWindowTitle(_translate("AboutDialog", "About Pulseaudio Parametric Equalizer", None))
self.label.setText(_translate("AboutDialog", "Pulseaudio Parametric Equalizer Version $version", None))
self.label_2.setText(_translate("AboutDialog", "© 2018- Jürgen \"T5!\" Herrmann", None))
self.label_4.setText(_translate("AboutDialog", "t-5@t-5.eu", None))
self.label_5.setText(_translate("AboutDialog", "Licence: 3-Clause BSD Licence", None))
_translate = QtCore.QCoreApplication.translate
AboutDialog.setWindowTitle(_translate("AboutDialog", "About Pulseaudio Parametric Equalizer"))
self.label.setText(_translate("AboutDialog", "Pulseaudio Parametric Equalizer Version $version"))
self.label_2.setText(_translate("AboutDialog", "© 2018- Jürgen \"T5!\" Herrmann"))
self.label_4.setText(_translate("AboutDialog", "t-5@gmx.de"))
self.label_5.setText(_translate("AboutDialog", "Licence: 3-Clause BSD Licence"))
import PAPEq_rc
......@@ -3,7 +3,7 @@ import os
from PAPEq_rc import darkstyle_icons
CURRENT_VERSION = "0.25"
CURRENT_VERSION = "0.26"
DIALSTEPS = 10000
......
......@@ -9,13 +9,13 @@ GIT: https://gitlab.com/t-5/PulseaudioParametricEq.git
"""
from helpers.constants import GLOBAL_CSS
from PyQt4 import QtGui
import sys
from PyQt5.QtWidgets import QApplication
from WindowClasses.MainWindow import MainWindow
def main():
app = QtGui.QApplication(sys.argv)
app = QApplication(sys.argv)
app.setStyleSheet(GLOBAL_CSS)
form = MainWindow()
form.show()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment