Mac weirdness workaround
This commit is contained in:
parent
8877bfe71c
commit
50e85496fa
3 changed files with 7 additions and 9 deletions
|
@ -654,12 +654,12 @@ void DlgSettings::closeEvent(QCloseEvent *event)
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!QDir(settingsCache->getDeckPath()).exists())
|
if (!QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty())
|
||||||
if (QMessageBox::critical(this, tr("Error"), tr("The path to your deck directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
if (QMessageBox::critical(this, tr("Error"), tr("The path to your deck directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!QDir(settingsCache->getPicsPath()).exists())
|
if (!QDir(settingsCache->getPicsPath()).exists() || settingsCache->getPicsPath().isEmpty())
|
||||||
if (QMessageBox::critical(this, tr("Error"), tr("The path to your card pictures directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
if (QMessageBox::critical(this, tr("Error"), tr("The path to your card pictures directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -22,6 +22,8 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
|
||||||
aCloseMostRecentZoneView->setShortcut(tr("Esc"));
|
aCloseMostRecentZoneView->setShortcut(tr("Esc"));
|
||||||
connect(aCloseMostRecentZoneView, SIGNAL(triggered()), scene, SLOT(closeMostRecentZoneView()));
|
connect(aCloseMostRecentZoneView, SIGNAL(triggered()), scene, SLOT(closeMostRecentZoneView()));
|
||||||
addAction(aCloseMostRecentZoneView);
|
addAction(aCloseMostRecentZoneView);
|
||||||
|
|
||||||
|
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameView::resizeEvent(QResizeEvent *event)
|
void GameView::resizeEvent(QResizeEvent *event)
|
||||||
|
@ -43,7 +45,6 @@ void GameView::updateSceneRect(const QRectF &rect)
|
||||||
void GameView::startRubberBand(const QPointF &_selectionOrigin)
|
void GameView::startRubberBand(const QPointF &_selectionOrigin)
|
||||||
{
|
{
|
||||||
selectionOrigin = _selectionOrigin;
|
selectionOrigin = _selectionOrigin;
|
||||||
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
|
|
||||||
rubberBand->setGeometry(QRect(mapFromScene(selectionOrigin), QSize(0, 0)));
|
rubberBand->setGeometry(QRect(mapFromScene(selectionOrigin), QSize(0, 0)));
|
||||||
rubberBand->show();
|
rubberBand->show();
|
||||||
}
|
}
|
||||||
|
@ -56,8 +57,5 @@ void GameView::resizeRubberBand(const QPointF &cursorPoint)
|
||||||
|
|
||||||
void GameView::stopRubberBand()
|
void GameView::stopRubberBand()
|
||||||
{
|
{
|
||||||
if (rubberBand) {
|
rubberBand->hide();
|
||||||
rubberBand->deleteLater();
|
|
||||||
rubberBand = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,11 +108,11 @@ int main(int argc, char *argv[])
|
||||||
if (!QDir(settingsCache->getPicsPath()).exists())
|
if (!QDir(settingsCache->getPicsPath()).exists())
|
||||||
settingsCache->setPicsPath(baseDir.absolutePath() + "/pics");
|
settingsCache->setPicsPath(baseDir.absolutePath() + "/pics");
|
||||||
#endif
|
#endif
|
||||||
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || !QDir(settingsCache->getPicsPath()).exists()) {
|
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty() || settingsCache->getPicsPath().isEmpty() || !QDir(settingsCache->getPicsPath()).exists()) {
|
||||||
DlgSettings dlgSettings;
|
DlgSettings dlgSettings;
|
||||||
dlgSettings.show();
|
dlgSettings.show();
|
||||||
app.exec();
|
app.exec();
|
||||||
startMainProgram = (db->getLoadSuccess() && QDir(settingsCache->getDeckPath()).exists() && QDir(settingsCache->getPicsPath()).exists());
|
startMainProgram = (db->getLoadSuccess() && QDir(settingsCache->getDeckPath()).exists() && !settingsCache->getDeckPath().isEmpty() && QDir(settingsCache->getPicsPath()).exists() && !settingsCache->getPicsPath().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startMainProgram) {
|
if (startMainProgram) {
|
||||||
|
|
Loading…
Reference in a new issue