From 846476c4ad00c92caa97c5974cadc9adb1ae051a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 25 Nov 2016 15:58:33 +0200 Subject: [PATCH] Stop wizards from resizing themselves based on the contents of comboboxes --- openlp/core/ui/lib/wizard.py | 1 + .../plugins/bibles/forms/bibleimportform.py | 33 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/lib/wizard.py b/openlp/core/ui/lib/wizard.py index 68efc43c1..06225a376 100644 --- a/openlp/core/ui/lib/wizard.py +++ b/openlp/core/ui/lib/wizard.py @@ -96,6 +96,7 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties): super(OpenLPWizard, self).__init__(parent) self.plugin = plugin self.with_progress_page = add_progress_page + self.setFixedWidth(640) self.setObjectName(name) self.open_icon = build_icon(':/general/general_open.png') self.delete_icon = build_icon(':/general/general_delete.png') diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index d7eae281f..564474271 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -162,6 +162,7 @@ class BibleImportForm(OpenLPWizard): self.osis_file_layout = QtWidgets.QHBoxLayout() self.osis_file_layout.setObjectName('OsisFileLayout') self.osis_file_edit = QtWidgets.QLineEdit(self.osis_widget) + self.osis_file_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.osis_file_edit.setObjectName('OsisFileEdit') self.osis_file_layout.addWidget(self.osis_file_edit) self.osis_browse_button = QtWidgets.QToolButton(self.osis_widget) @@ -181,6 +182,7 @@ class BibleImportForm(OpenLPWizard): self.csv_books_layout = QtWidgets.QHBoxLayout() self.csv_books_layout.setObjectName('CsvBooksLayout') self.csv_books_edit = QtWidgets.QLineEdit(self.csv_widget) + self.csv_books_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.csv_books_edit.setObjectName('CsvBooksEdit') self.csv_books_layout.addWidget(self.csv_books_edit) self.csv_books_button = QtWidgets.QToolButton(self.csv_widget) @@ -193,6 +195,7 @@ class BibleImportForm(OpenLPWizard): self.csv_verses_layout = QtWidgets.QHBoxLayout() self.csv_verses_layout.setObjectName('CsvVersesLayout') self.csv_verses_edit = QtWidgets.QLineEdit(self.csv_widget) + self.csv_verses_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.csv_verses_edit.setObjectName('CsvVersesEdit') self.csv_verses_layout.addWidget(self.csv_verses_edit) self.csv_verses_button = QtWidgets.QToolButton(self.csv_widget) @@ -212,6 +215,7 @@ class BibleImportForm(OpenLPWizard): self.open_song_file_layout = QtWidgets.QHBoxLayout() self.open_song_file_layout.setObjectName('OpenSongFileLayout') self.open_song_file_edit = QtWidgets.QLineEdit(self.open_song_widget) + self.open_song_file_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.open_song_file_edit.setObjectName('OpenSongFileEdit') self.open_song_file_layout.addWidget(self.open_song_file_edit) self.open_song_browse_button = QtWidgets.QToolButton(self.open_song_widget) @@ -301,55 +305,58 @@ class BibleImportForm(OpenLPWizard): self.sword_widget = QtWidgets.QWidget(self.select_page) self.sword_widget.setObjectName('SwordWidget') self.sword_layout = QtWidgets.QVBoxLayout(self.sword_widget) + self.sword_layout.setContentsMargins(0, 0, 0, 0) self.sword_layout.setObjectName('SwordLayout') self.sword_tab_widget = QtWidgets.QTabWidget(self.sword_widget) self.sword_tab_widget.setObjectName('SwordTabWidget') self.sword_folder_tab = QtWidgets.QWidget(self.sword_tab_widget) self.sword_folder_tab.setObjectName('SwordFolderTab') - self.sword_folder_tab_layout = QtWidgets.QGridLayout(self.sword_folder_tab) + self.sword_folder_tab_layout = QtWidgets.QFormLayout(self.sword_folder_tab) self.sword_folder_tab_layout.setObjectName('SwordTabFolderLayout') self.sword_folder_label = QtWidgets.QLabel(self.sword_folder_tab) self.sword_folder_label.setObjectName('SwordSourceLabel') - self.sword_folder_tab_layout.addWidget(self.sword_folder_label, 0, 0) self.sword_folder_label.setObjectName('SwordFolderLabel') self.sword_folder_edit = QtWidgets.QLineEdit(self.sword_folder_tab) + self.sword_folder_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.sword_folder_edit.setObjectName('SwordFolderEdit') self.sword_browse_button = QtWidgets.QToolButton(self.sword_folder_tab) self.sword_browse_button.setIcon(self.open_icon) self.sword_browse_button.setObjectName('SwordBrowseButton') - self.sword_folder_tab_layout.addWidget(self.sword_folder_edit, 0, 1) - self.sword_folder_tab_layout.addWidget(self.sword_browse_button, 0, 2) + self.sword_folder_layout = QtWidgets.QHBoxLayout() + self.sword_folder_layout.addWidget(self.sword_folder_edit) + self.sword_folder_layout.addWidget(self.sword_browse_button) + self.sword_folder_tab_layout.addRow(self.sword_folder_label, self.sword_folder_layout) self.sword_bible_label = QtWidgets.QLabel(self.sword_folder_tab) self.sword_bible_label.setObjectName('SwordBibleLabel') - self.sword_folder_tab_layout.addWidget(self.sword_bible_label, 1, 0) self.sword_bible_combo_box = QtWidgets.QComboBox(self.sword_folder_tab) self.sword_bible_combo_box.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) self.sword_bible_combo_box.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically) self.sword_bible_combo_box.setObjectName('SwordBibleComboBox') - self.sword_folder_tab_layout.addWidget(self.sword_bible_combo_box, 1, 1) + self.sword_folder_tab_layout.addRow(self.sword_bible_label, self.sword_bible_combo_box) self.sword_tab_widget.addTab(self.sword_folder_tab, '') self.sword_zip_tab = QtWidgets.QWidget(self.sword_tab_widget) self.sword_zip_tab.setObjectName('SwordZipTab') - self.sword_zip_layout = QtWidgets.QGridLayout(self.sword_zip_tab) + self.sword_zip_layout = QtWidgets.QFormLayout(self.sword_zip_tab) self.sword_zip_layout.setObjectName('SwordZipLayout') self.sword_zipfile_label = QtWidgets.QLabel(self.sword_zip_tab) self.sword_zipfile_label.setObjectName('SwordZipFileLabel') self.sword_zipfile_edit = QtWidgets.QLineEdit(self.sword_zip_tab) + self.sword_zipfile_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.sword_zipfile_edit.setObjectName('SwordZipFileEdit') self.sword_zipbrowse_button = QtWidgets.QToolButton(self.sword_zip_tab) self.sword_zipbrowse_button.setIcon(self.open_icon) self.sword_zipbrowse_button.setObjectName('SwordZipBrowseButton') + self.sword_zipfile_layout = QtWidgets.QHBoxLayout() + self.sword_zipfile_layout.addWidget(self.sword_zipfile_edit) + self.sword_zipfile_layout.addWidget(self.sword_zipbrowse_button) + self.sword_zip_layout.addRow(self.sword_zipfile_label, self.sword_zipfile_layout) self.sword_zipbible_label = QtWidgets.QLabel(self.sword_folder_tab) self.sword_zipbible_label.setObjectName('SwordZipBibleLabel') self.sword_zipbible_combo_box = QtWidgets.QComboBox(self.sword_zip_tab) self.sword_zipbible_combo_box.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) self.sword_zipbible_combo_box.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically) self.sword_zipbible_combo_box.setObjectName('SwordZipBibleComboBox') - self.sword_zip_layout.addWidget(self.sword_zipfile_label, 0, 0) - self.sword_zip_layout.addWidget(self.sword_zipfile_edit, 0, 1) - self.sword_zip_layout.addWidget(self.sword_zipbrowse_button, 0, 2) - self.sword_zip_layout.addWidget(self.sword_zipbible_label, 1, 0) - self.sword_zip_layout.addWidget(self.sword_zipbible_combo_box, 1, 1) + self.sword_zip_layout.addRow(self.sword_zipbible_label, self.sword_zipbible_combo_box) self.sword_tab_widget.addTab(self.sword_zip_tab, '') self.sword_layout.addWidget(self.sword_tab_widget) self.sword_disabled_label = QtWidgets.QLabel(self.sword_widget) @@ -366,6 +373,7 @@ class BibleImportForm(OpenLPWizard): self.wordproject_file_layout = QtWidgets.QHBoxLayout() self.wordproject_file_layout.setObjectName('WordProjectFileLayout') self.wordproject_file_edit = QtWidgets.QLineEdit(self.wordproject_widget) + self.wordproject_file_edit.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) self.wordproject_file_edit.setObjectName('WordProjectFileEdit') self.wordproject_file_layout.addWidget(self.wordproject_file_edit) self.wordproject_browse_button = QtWidgets.QToolButton(self.wordproject_widget) @@ -490,6 +498,7 @@ class BibleImportForm(OpenLPWizard): """ Validate the current page before moving on to the next page. """ + log.debug(self.size()) if self.currentPage() == self.welcome_page: return True elif self.currentPage() == self.select_page: