diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index cd121c2ef..dd343525d 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -294,6 +294,10 @@ class Settings(QtCore.QSettings): 'user interface/preview panel': True, 'user interface/preview splitter geometry': QtCore.QByteArray(), 'projector/db type': 'sqlite', + 'projector/db username': '', + 'projector/db password': '', + 'projector/db hostname': '', + 'projector/db database': '', 'projector/enable': True, 'projector/connect on start': False, 'projector/last directory import': '', diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index e089cd8a4..e1c9c9117 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -106,9 +106,6 @@ def init_url(plugin_name, db_file_name=None): urlquote(settings.value('db password')), urlquote(settings.value('db hostname')), urlquote(settings.value('db database'))) - if db_type == 'mysql': - db_encoding = settings.value('db encoding') - db_url += '?charset=%s' % urlquote(db_encoding) settings.endGroup() return db_url diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 0a8adf23b..9517f1aa0 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -112,6 +112,10 @@ __default_settings__ = { 'alerts/font face': QtGui.QFont().family(), 'alerts/font size': 40, 'alerts/db type': 'sqlite', + 'alerts/db username': '', + 'alerts/db password': '', + 'alerts/db hostname': '', + 'alerts/db database': '', 'alerts/location': AlertLocation.Bottom, 'alerts/background color': '#660000', 'alerts/font color': '#ffffff', diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 6bb977e09..acc9e8440 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -37,6 +37,10 @@ log = logging.getLogger(__name__) __default_settings__ = { 'bibles/db type': 'sqlite', + 'bibles/db username': '', + 'bibles/db password': '', + 'bibles/db hostname': '', + 'bibles/db database': '', 'bibles/last search type': BibleSearch.Reference, 'bibles/verse layout style': LayoutStyle.VersePerSlide, 'bibles/book name language': LanguageSelection.Bible, diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 1320503d2..e2087b92a 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -36,6 +36,10 @@ log = logging.getLogger(__name__) __default_settings__ = { 'custom/db type': 'sqlite', + 'custom/db username': '', + 'custom/db password': '', + 'custom/db hostname': '', + 'custom/db database': '', 'custom/last search type': CustomSearch.Titles, 'custom/display footer': True, 'custom/add custom from service': True diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 197ed6c02..743c20ad9 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -35,6 +35,10 @@ log = logging.getLogger(__name__) __default_settings__ = { 'images/db type': 'sqlite', + 'images/db username': '', + 'images/db password': '', + 'images/db hostname': '', + 'images/db database': '', 'images/background color': '#000000', } diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index e341dfd54..9205539a5 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -312,7 +312,7 @@ def init_schema(url): 'authors_songs', metadata, Column('author_id', types.Integer(), ForeignKey('authors.id'), primary_key=True), Column('song_id', types.Integer(), ForeignKey('songs.id'), primary_key=True), - Column('author_type', types.String(), primary_key=True, nullable=False, server_default=text('""')) + Column('author_type', types.Unicode(255), primary_key=True, nullable=False, server_default=text('""')) ) # Definition of the "songs_topics" table diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index a3556e456..21d488b88 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -109,7 +109,7 @@ def upgrade_4(session, metadata): op.create_table('authors_songs_tmp', Column('author_id', types.Integer(), ForeignKey('authors.id'), primary_key=True), Column('song_id', types.Integer(), ForeignKey('songs.id'), primary_key=True), - Column('author_type', types.String(), primary_key=True, + Column('author_type', types.Unicode(255), primary_key=True, nullable=False, server_default=text('""'))) op.execute('INSERT INTO authors_songs_tmp SELECT author_id, song_id, "" FROM authors_songs') op.drop_table('authors_songs') diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 333611996..f7f2741f9 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -50,6 +50,10 @@ from openlp.plugins.songs.lib.songstab import SongsTab log = logging.getLogger(__name__) __default_settings__ = { 'songs/db type': 'sqlite', + 'songs/db username': '', + 'songs/db password': '', + 'songs/db hostname': '', + 'songs/db database': '', 'songs/last search type': SongSearch.Entire, 'songs/last import type': SongFormat.OpenLyrics, 'songs/update service on edit': False, diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 1cae4fbb1..c267f9294 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -43,6 +43,10 @@ if QtCore.QDate().currentDate().month() < 9: __default_settings__ = { 'songusage/db type': 'sqlite', + 'songusage/db username': '', + 'songuasge/db password': '', + 'songuasge/db hostname': '', + 'songuasge/db database': '', 'songusage/active': False, 'songusage/to date': QtCore.QDate(YEAR, 8, 31), 'songusage/from date': QtCore.QDate(YEAR - 1, 9, 1), diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index dc2284427..0fb99a79f 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -83,7 +83,7 @@ MODULES = [ OPTIONAL_MODULES = [ - ('MySQLdb', '(MySQL support)', True), + ('mysql.connector', '(MySQL support)', True), ('psycopg2', '(PostgreSQL support)', True), ('nose', '(testing framework)', True), ('mock', '(testing module)', sys.version_info[1] < 3),