=== modified file 'mixxx/res/mixxx.qrc' --- mixxx/res/mixxx.qrc 2012-05-24 06:07:13 +0000 +++ mixxx/res/mixxx.qrc 2012-06-16 20:58:39 +0000 @@ -17,6 +17,7 @@ images/preferences/ic_preferences_sampler.png images/preferences/ic_preferences_soundhardware.png images/preferences/ic_preferences_vinyl.png + images/preferences/ic_preferences_warning.png images/library/crates_art.png images/library/ic_library_autodj.png images/library/ic_library_browse.png === modified file 'mixxx/src/dlgprefcontrols.cpp' --- mixxx/src/dlgprefcontrols.cpp 2012-05-30 18:26:44 +0000 +++ mixxx/src/dlgprefcontrols.cpp 2012-06-16 21:09:01 +0000 @@ -136,14 +136,6 @@ SliderRateRampSensitivity->setEnabled(true); SpinBoxRateRampSensitivity->setEnabled(true); - // - // Skin configurations - // - ComboBoxSkinconf->clear(); - - QString qSkinPath(pConfig->getValueString(ConfigKey("[Config]","Path"))); - QDir dir(qSkinPath.append("skins/")); - dir.setFilter(QDir::Dirs); // // Override Playing Track on Track Load @@ -214,6 +206,16 @@ //NOTE: for CueRecall, 0 means ON.... connect(ComboBoxCueRecall, SIGNAL(activated(int)), this, SLOT(slotSetCueRecall(int))); + // + // Skin configurations + // + ComboBoxSkinconf->clear(); + + QDir dir(m_pConfig->getConfigPath() + "skins/"); + dir.setFilter(QDir::Dirs); + + QString configuredSkinPath = m_pSkinLoader->getConfiguredSkinPath(); + QList list = dir.entryInfoList(); int j=0; for (int i=0; iaddItem(list.at(i).fileName()); - if (list.at(i).fileName() == pConfig->getValueString(ConfigKey("[Config]","Skin"))) + if (list.at(i).filePath() == configuredSkinPath) { ComboBoxSkinconf->setCurrentIndex(j); + } ++j; } } - // #endif - - // Detect small display and prompt user to use small skin. - if (QApplication::desktop()->width() >= 800 && QApplication::desktop()->height() == 480 && pConfig->getValueString(ConfigKey("[Config]","Skin"))!= "Outline800x480-WVGA") { - int ret = QMessageBox::warning(this, tr("Mixxx Detected a WVGA Screen"), tr("Mixxx has detected that your screen has a resolution of ") + - QString::number(QApplication::desktop()->width()) + " x " + QString::number(QApplication::desktop()->height()) + ". " + - tr("The only skin compatiable with this size display is Outline800x480-WVGA. Would you like to use that skin?"), - QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - if (ret == QMessageBox::Yes) { - pConfig->set(ConfigKey("[Config]","Skin"), ConfigValue("Outline800x480-WVGA")); - pConfig->Save(); - ComboBoxSkinconf->setCurrentIndex(ComboBoxSkinconf->findText(pConfig->getValueString(ConfigKey("[Config]","Skin")))); - qDebug() << "Retrieved skin:" << pConfig->getValueString(ConfigKey("[Config]","Skin")) << "ComboBoxSkinconf:" << ComboBoxSkinconf->currentText(); - slotSetSkin(1); - } - } connect(ComboBoxSkinconf, SIGNAL(activated(int)), this, SLOT(slotSetSkin(int))); @@ -277,6 +264,7 @@ connect(ComboBoxTooltips, SIGNAL(activated(int)), this, SLOT(slotSetTooltips(int))); + checkSkinResolution(); slotUpdateSchemes(); slotUpdate(); @@ -445,6 +433,7 @@ { m_pConfig->set(ConfigKey("[Config]","Skin"), ComboBoxSkinconf->currentText()); m_mixxx->rebootMixxxView(); + checkSkinResolution(); slotUpdateSchemes(); } @@ -662,3 +651,26 @@ this,SLOT(slotSetNormalizeOverview(bool))); } + +void DlgPrefControls::checkSkinResolution() +{ + QString warningString = "" + +tr("The selected skin is bigger than your screen resolution"); + warningLabel->setText(warningString); + + int screenWidth = QApplication::desktop()->width(); + int screenHeight = QApplication::desktop()->height(); + + QString skin = ComboBoxSkinconf->currentText(); + QString skinName = skin.left(skin.indexOf(QRegExp("\\d"))); + QString resName = skin.right(skin.count()-skinName.count()); + QString res = resName.left(resName.lastIndexOf(QRegExp("\\d"))+1); + QString skinWidth = res.left(res.indexOf("x")); + QString skinHeight = res.right(res.count()-skinWidth.count()-1); + + if (skinWidth.toInt() > screenWidth || skinHeight.toInt() > screenHeight) + warningLabel->show(); + else + warningLabel->hide(); + +} === modified file 'mixxx/src/dlgprefcontrols.h' --- mixxx/src/dlgprefcontrols.h 2012-05-30 18:26:44 +0000 +++ mixxx/src/dlgprefcontrols.h 2012-06-16 19:55:37 +0000 @@ -82,6 +82,7 @@ private: void initWaveformControl(); void notifyRebootNecessary(); + void checkSkinResolution(); private: /** Pointer to ConfigObject */ === modified file 'mixxx/src/dlgprefcontrolsdlg.ui' --- mixxx/src/dlgprefcontrolsdlg.ui 2012-05-30 18:26:44 +0000 +++ mixxx/src/dlgprefcontrolsdlg.ui 2012-06-16 19:45:52 +0000 @@ -7,7 +7,7 @@ 0 0 519 - 698 + 728 @@ -48,7 +48,7 @@ - + true @@ -67,7 +67,7 @@ - + @@ -80,7 +80,7 @@ - + true @@ -99,7 +99,7 @@ - + @@ -112,7 +112,7 @@ - + true @@ -131,7 +131,7 @@ - + @@ -154,7 +154,7 @@ - + true @@ -173,7 +173,7 @@ - + @@ -186,7 +186,7 @@ - + true @@ -205,7 +205,7 @@ - + @@ -218,7 +218,7 @@ - + Track load behaviour @@ -228,10 +228,10 @@ - + - + Cue behaviour @@ -241,10 +241,10 @@ - + - + Auto Recall Cue @@ -254,10 +254,10 @@ - + - + Locale @@ -267,9 +267,19 @@ - + + + + + + + + Qt::AlignJustify|Qt::AlignVCenter + + + === modified file 'mixxx/src/skin/skinloader.cpp' --- mixxx/src/skin/skinloader.cpp 2012-04-27 07:47:21 +0000 +++ mixxx/src/skin/skinloader.cpp 2012-06-16 21:17:35 +0000 @@ -23,27 +23,34 @@ } QString SkinLoader::getConfiguredSkinPath() { - const QString defaultSkin = "Deere1280x800-WXGA";//XXX: App Store //"Outline1024x600-Netbook"; QString qSkinPath = m_pConfig->getConfigPath(); qSkinPath.append("skins/"); + QString configSkin = m_pConfig->getValueString(ConfigKey("[Config]","Skin")); + QString qThisSkin = qSkinPath + configSkin; + QDir thisSkin(qThisSkin); + + if (configSkin.length() > 0 && thisSkin.exists()) { + qSkinPath = qThisSkin; + } else { + // Fall back to default skin + QString defaultSkin; + QRect screenGeo = QApplication::desktop()->screenGeometry(); + if (screenGeo.width() >= 1280 && screenGeo.height() >= 800) { + defaultSkin = "Deere1280x800-WXGA"; + } + else if (screenGeo.width() >= 1024 && screenGeo.height() >= 600) { + defaultSkin = "ShadeDark1024x600-Netbook"; + } + else { + defaultSkin = "Outline800x480-WVGA"; // Mixxx's smallest Skin + } + qSkinPath.append(defaultSkin); + } + QDir skinPath(qSkinPath); - - if (skinPath.exists()) { - // Is the skin listed in the config database there? If not, use default skin. - - QString configSkin = m_pConfig->getValueString(ConfigKey("[Config]","Skin")); - QString qThisSkin = qSkinPath + configSkin; - QDir thisSkin(qThisSkin); - - if (configSkin.length() > 0 && thisSkin.exists()) { - qSkinPath = qThisSkin; - } else { - m_pConfig->set(ConfigKey("[Config]","Skin"), ConfigValue(defaultSkin)); - qSkinPath.append(defaultSkin); - } - } else { + if (!skinPath.exists()) { qCritical() << "Skin directory does not exist:" << qSkinPath; }