diff --git a/picard/ui/options/general.py b/picard/ui/options/general.py index bb4e6e81d..0f8d82797 100644 --- a/picard/ui/options/general.py +++ b/picard/ui/options/general.py @@ -17,7 +17,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from PyQt4 import QtCore from picard import config from picard.ui.options import OptionsPage, register_options_page from picard.ui.ui_options_general import Ui_GeneralOptionsPage @@ -39,8 +38,6 @@ class GeneralOptionsPage(OptionsPage): config.PasswordOption("setting", "password", ""), config.BoolOption("setting", "analyze_new_files", False), config.BoolOption("setting", "ignore_file_mbids", False), - config.BoolOption("setting", "browser_integration", True), - config.IntOption("setting", "browser_integration_port", 8000), ] def __init__(self, parent=None): @@ -51,7 +48,6 @@ class GeneralOptionsPage(OptionsPage): "musicbrainz.org", ] self.ui.server_host.addItems(sorted(mirror_servers)) - self.ui.browser_integration.clicked.connect(self.update_browser_integration) def load(self): self.ui.server_host.setEditText(config.setting["server_host"]) @@ -60,11 +56,6 @@ class GeneralOptionsPage(OptionsPage): self.ui.password.setText(config.setting["password"]) self.ui.analyze_new_files.setChecked(config.setting["analyze_new_files"]) self.ui.ignore_file_mbids.setChecked(config.setting["ignore_file_mbids"]) - self.ui.browser_integration.setChecked(config.setting["browser_integration"]) - self.ui.browser_integration_port.setValue(config.setting["browser_integration_port"]) - QtCore.QObject.connect(self.ui.browser_integration_port, - QtCore.SIGNAL('valueChanged(int)'), - self.change_browser_integration_port) def save(self): config.setting["server_host"] = unicode(self.ui.server_host.currentText()).strip() @@ -74,16 +65,5 @@ class GeneralOptionsPage(OptionsPage): config.setting["password"] = rot13(unicode(self.ui.password.text())) config.setting["analyze_new_files"] = self.ui.analyze_new_files.isChecked() config.setting["ignore_file_mbids"] = self.ui.ignore_file_mbids.isChecked() - config.setting["browser_integration"] = self.ui.browser_integration.isChecked() - config.setting["browser_integration_port"] = self.ui.browser_integration_port.value() - - def update_browser_integration(self): - if self.ui.browser_integration.isChecked(): - self.tagger.browser_integration.start() - else: - self.tagger.browser_integration.stop() - - def change_browser_integration_port(self, port): - config.setting["browser_integration_port"] = self.ui.browser_integration_port.value() register_options_page(GeneralOptionsPage) diff --git a/picard/ui/options/network.py b/picard/ui/options/network.py index 27c21f616..5da16febf 100644 --- a/picard/ui/options/network.py +++ b/picard/ui/options/network.py @@ -17,6 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +from PyQt4 import QtCore from picard import config from picard.ui.options import OptionsPage, register_options_page from picard.ui.ui_options_network import Ui_NetworkOptionsPage @@ -36,12 +37,15 @@ class NetworkOptionsPage(OptionsPage): config.IntOption("setting", "proxy_server_port", 80), config.TextOption("setting", "proxy_username", ""), config.TextOption("setting", "proxy_password", ""), + config.BoolOption("setting", "browser_integration", True), + config.IntOption("setting", "browser_integration_port", 8000), ] def __init__(self, parent=None): super(NetworkOptionsPage, self).__init__(parent) self.ui = Ui_NetworkOptionsPage() self.ui.setupUi(self) + self.ui.browser_integration.clicked.connect(self.update_browser_integration) def load(self): self.ui.web_proxy.setChecked(config.setting["use_proxy"]) @@ -49,6 +53,11 @@ class NetworkOptionsPage(OptionsPage): self.ui.server_port.setValue(config.setting["proxy_server_port"]) self.ui.username.setText(config.setting["proxy_username"]) self.ui.password.setText(config.setting["proxy_password"]) + self.ui.browser_integration.setChecked(config.setting["browser_integration"]) + self.ui.browser_integration_port.setValue(config.setting["browser_integration_port"]) + QtCore.QObject.connect(self.ui.browser_integration_port, + QtCore.SIGNAL('valueChanged(int)'), + self.change_browser_integration_port) def save(self): config.setting["use_proxy"] = self.ui.web_proxy.isChecked() @@ -57,6 +66,17 @@ class NetworkOptionsPage(OptionsPage): config.setting["proxy_username"] = unicode(self.ui.username.text()) config.setting["proxy_password"] = unicode(self.ui.password.text()) self.tagger.xmlws.setup_proxy() + config.setting["browser_integration"] = self.ui.browser_integration.isChecked() + config.setting["browser_integration_port"] = self.ui.browser_integration_port.value() + + def update_browser_integration(self): + if self.ui.browser_integration.isChecked(): + self.tagger.browser_integration.start() + else: + self.tagger.browser_integration.stop() + + def change_browser_integration_port(self, port): + config.setting["browser_integration_port"] = self.ui.browser_integration_port.value() register_options_page(NetworkOptionsPage) diff --git a/picard/ui/ui_options_general.py b/picard/ui/ui_options_general.py index f341f2b15..f5aaa0550 100644 --- a/picard/ui/ui_options_general.py +++ b/picard/ui/ui_options_general.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/options_general.ui' # -# Created: Mon Aug 5 15:32:27 2013 +# Created: Mon Aug 5 21:56:23 2013 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! @@ -77,41 +77,6 @@ class Ui_GeneralOptionsPage(object): self.ignore_file_mbids.setObjectName(_fromUtf8("ignore_file_mbids")) self.verticalLayout.addWidget(self.ignore_file_mbids) self.vboxlayout.addWidget(self.groupBox_2) - self.groupBox_3 = QtGui.QGroupBox(GeneralOptionsPage) - self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) - self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_3) - self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) - self.browser_integration = QtGui.QCheckBox(self.groupBox_3) - self.browser_integration.setChecked(True) - self.browser_integration.setObjectName(_fromUtf8("browser_integration")) - self.verticalLayout_2.addWidget(self.browser_integration) - self.widget = QtGui.QWidget(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth()) - self.widget.setSizePolicy(sizePolicy) - self.widget.setObjectName(_fromUtf8("widget")) - self.horizontalLayout = QtGui.QHBoxLayout(self.widget) - self.horizontalLayout.setContentsMargins(6, 0, 0, 0) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.label_2 = QtGui.QLabel(self.widget) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) - self.label_2.setSizePolicy(sizePolicy) - self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.horizontalLayout.addWidget(self.label_2) - self.browser_integration_port = QtGui.QSpinBox(self.widget) - self.browser_integration_port.setMinimum(1) - self.browser_integration_port.setMaximum(65535) - self.browser_integration_port.setProperty("value", 8000) - self.browser_integration_port.setObjectName(_fromUtf8("browser_integration_port")) - self.horizontalLayout.addWidget(self.browser_integration_port) - self.verticalLayout_2.addWidget(self.widget) - self.vboxlayout.addWidget(self.groupBox_3) spacerItem = QtGui.QSpacerItem(181, 21, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.vboxlayout.addItem(spacerItem) self.label_5.setBuddy(self.password) @@ -133,7 +98,4 @@ class Ui_GeneralOptionsPage(object): self.groupBox_2.setTitle(_("General")) self.analyze_new_files.setText(_("Automatically scan all new files")) self.ignore_file_mbids.setText(_("Ignore MBIDs when loading new files")) - self.groupBox_3.setTitle(_("Browser Integration")) - self.browser_integration.setText(_("Enable browser integration")) - self.label_2.setText(_("Default listening port:")) diff --git a/picard/ui/ui_options_network.py b/picard/ui/ui_options_network.py index 6916ac7c5..d1c82a9b5 100644 --- a/picard/ui/ui_options_network.py +++ b/picard/ui/ui_options_network.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/options_network.ui' # -# Created: Mon Aug 5 21:44:20 2013 +# Created: Mon Aug 5 22:00:12 2013 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! @@ -58,6 +58,39 @@ class Ui_NetworkOptionsPage(object): self.label.setObjectName(_fromUtf8("label")) self.gridlayout.addWidget(self.label, 0, 0, 1, 1) self.vboxlayout.addWidget(self.web_proxy) + self.browser_integration = QtGui.QGroupBox(NetworkOptionsPage) + self.browser_integration.setCheckable(True) + self.browser_integration.setChecked(True) + self.browser_integration.setObjectName(_fromUtf8("browser_integration")) + self.verticalLayout_2 = QtGui.QVBoxLayout(self.browser_integration) + self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.widget = QtGui.QWidget(self.browser_integration) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth()) + self.widget.setSizePolicy(sizePolicy) + self.widget.setObjectName(_fromUtf8("widget")) + self.horizontalLayout = QtGui.QHBoxLayout(self.widget) + self.horizontalLayout.setContentsMargins(6, 0, 0, 0) + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.label_2 = QtGui.QLabel(self.widget) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(sizePolicy) + self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_2.setObjectName(_fromUtf8("label_2")) + self.horizontalLayout.addWidget(self.label_2) + self.browser_integration_port = QtGui.QSpinBox(self.widget) + self.browser_integration_port.setMinimum(1) + self.browser_integration_port.setMaximum(65535) + self.browser_integration_port.setProperty("value", 8000) + self.browser_integration_port.setObjectName(_fromUtf8("browser_integration_port")) + self.horizontalLayout.addWidget(self.browser_integration_port) + self.verticalLayout_2.addWidget(self.widget) + self.vboxlayout.addWidget(self.browser_integration) spacerItem = QtGui.QSpacerItem(101, 31, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.vboxlayout.addItem(spacerItem) self.label_5.setBuddy(self.password) @@ -76,4 +109,6 @@ class Ui_NetworkOptionsPage(object): self.label_6.setText(_("Username:")) self.label_7.setText(_("Port:")) self.label.setText(_("Server address:")) + self.browser_integration.setTitle(_("Browser Integration")) + self.label_2.setText(_("Default listening port:")) diff --git a/ui/options_general.ui b/ui/options_general.ui index 76fdf2012..638fb49ac 100644 --- a/ui/options_general.ui +++ b/ui/options_general.ui @@ -128,78 +128,6 @@ - - - - Browser Integration - - - - - - Enable browser integration - - - true - - - - - - - - 0 - 0 - - - - - 6 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - Default listening port: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 1 - - - 65535 - - - 8000 - - - - - - - - - diff --git a/ui/options_network.ui b/ui/options_network.ui index b76d42128..8d9a5751e 100644 --- a/ui/options_network.ui +++ b/ui/options_network.ui @@ -97,6 +97,74 @@ + + + + Browser Integration + + + true + + + true + + + + + + + 0 + 0 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Default listening port: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 1 + + + 65535 + + + 8000 + + + + + + + + +