Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show preferences when configured skin failed to load #3845

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,28 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) {
m_pVCManager,
m_pEffectsManager,
m_pRecordingManager);
// TODO(ronso0) After failed skin load user may just hit Okay without
// having chosen another skin. Show menubar so the user can quit or open
// the preferences again manually.
// #3839
if (!m_pWidgetParent) {
reportCriticalErrorAndQuit(
"default skin cannot be loaded see <b>mixxx</b> trace for more information.");

m_pWidgetParent = oldWidget;
//TODO (XXX) add dialog to warn user and launch skin choice page
QMessageBox::StandardButton btn = QMessageBox::warning(
this,
VersionStore::applicationName(),
tr("The configured skin <b>%1</b> can not be loaded.<br>"
"Choose another skin?")
.arg(pConfig->getValueString(ConfigKey("[Config]", "ResizableSkin"))),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Ok);
if (btn == QMessageBox::Ok) {
m_pPrefDlg->show();
m_pPrefDlg->showInterfacePage();
} else {
reportCriticalErrorAndQuit(tr(
"See the Mixxx log file for more information about the skin error.\n"
"Mixxx will now close"));
}
} else {
m_pMenuBar->setStyleSheet(m_pWidgetParent->styleSheet());
}
Expand Down
5 changes: 5 additions & 0 deletions src/preferences/dialog/dlgpreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ void DlgPreferences::showSoundHardwarePage() {
contentsTreeWidget->setCurrentItem(m_pSoundButton);
}

void DlgPreferences::showInterfacePage() {
switchToPage(m_interfacePage);
contentsTreeWidget->setCurrentItem(m_pInterfaceButton);
}

bool DlgPreferences::eventFilter(QObject* o, QEvent* e) {
// Send a close signal if dialog is closing
if (e->type() == QEvent::Hide) {
Expand Down
1 change: 1 addition & 0 deletions src/preferences/dialog/dlgpreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class DlgPreferences : public QDialog, public Ui::DlgPreferencesDlg {
public slots:
void changePage(QTreeWidgetItem* pCurrent, QTreeWidgetItem* pPrevious);
void showSoundHardwarePage();
void showInterfacePage();
void slotButtonPressed(QAbstractButton* pButton);
signals:
void closeDlg();
Expand Down