diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/src/mainmenu.h b/applications/Photoframe/src/mainmenu.h index 436b4d7..3ddec71 100755 --- a/applications/Photoframe/src/mainmenu.h +++ b/applications/Photoframe/src/mainmenu.h @@ -32,6 +32,7 @@ AnimatedIcon *icon; Text *item1, *item2; int direction; + bool animateIcons; }; diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/src/mainmenu.h b/applications/Photoframe/src/mainmenu.h index 436b4d7..3ddec71 100755 --- a/applications/Photoframe/src/mainmenu.h +++ b/applications/Photoframe/src/mainmenu.h @@ -32,6 +32,7 @@ AnimatedIcon *icon; Text *item1, *item2; int direction; + bool animateIcons; }; diff --git a/applications/Photoframe/src/manager.cpp b/applications/Photoframe/src/manager.cpp index e774dd8..940939d 100755 --- a/applications/Photoframe/src/manager.cpp +++ b/applications/Photoframe/src/manager.cpp @@ -1,3 +1,4 @@ +#include #include #include "intro.h" #include "manager.h" @@ -105,7 +106,8 @@ break; case 6: // Turn Off - exit(0); + // system("shutdown -t now"); + qApp->quit(); break; default: return; diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/src/mainmenu.h b/applications/Photoframe/src/mainmenu.h index 436b4d7..3ddec71 100755 --- a/applications/Photoframe/src/mainmenu.h +++ b/applications/Photoframe/src/mainmenu.h @@ -32,6 +32,7 @@ AnimatedIcon *icon; Text *item1, *item2; int direction; + bool animateIcons; }; diff --git a/applications/Photoframe/src/manager.cpp b/applications/Photoframe/src/manager.cpp index e774dd8..940939d 100755 --- a/applications/Photoframe/src/manager.cpp +++ b/applications/Photoframe/src/manager.cpp @@ -1,3 +1,4 @@ +#include #include #include "intro.h" #include "manager.h" @@ -105,7 +106,8 @@ break; case 6: // Turn Off - exit(0); + // system("shutdown -t now"); + qApp->quit(); break; default: return; diff --git a/applications/Photoframe/src/menuitem.cpp b/applications/Photoframe/src/menuitem.cpp index f447b4e..4649ca9 100755 --- a/applications/Photoframe/src/menuitem.cpp +++ b/applications/Photoframe/src/menuitem.cpp @@ -10,8 +10,8 @@ item->setGeometry(x, y, 400, 50); y -= 6; - new Text(p, x + 21, y+1, t, 30, QColor(0,0,64,128)); - t2 = new Text(p, x + 19, y-1, t, 30, QColor()); + new Text(p, 10 + x + 21, 1+y+1, t, 30, QColor(0,0,64,128)); + t2 = new Text(p, 10 + x + 19, 1+y-1, t, 30, QColor()); timerId = 0; unselect(); diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/src/mainmenu.h b/applications/Photoframe/src/mainmenu.h index 436b4d7..3ddec71 100755 --- a/applications/Photoframe/src/mainmenu.h +++ b/applications/Photoframe/src/mainmenu.h @@ -32,6 +32,7 @@ AnimatedIcon *icon; Text *item1, *item2; int direction; + bool animateIcons; }; diff --git a/applications/Photoframe/src/manager.cpp b/applications/Photoframe/src/manager.cpp index e774dd8..940939d 100755 --- a/applications/Photoframe/src/manager.cpp +++ b/applications/Photoframe/src/manager.cpp @@ -1,3 +1,4 @@ +#include #include #include "intro.h" #include "manager.h" @@ -105,7 +106,8 @@ break; case 6: // Turn Off - exit(0); + // system("shutdown -t now"); + qApp->quit(); break; default: return; diff --git a/applications/Photoframe/src/menuitem.cpp b/applications/Photoframe/src/menuitem.cpp index f447b4e..4649ca9 100755 --- a/applications/Photoframe/src/menuitem.cpp +++ b/applications/Photoframe/src/menuitem.cpp @@ -10,8 +10,8 @@ item->setGeometry(x, y, 400, 50); y -= 6; - new Text(p, x + 21, y+1, t, 30, QColor(0,0,64,128)); - t2 = new Text(p, x + 19, y-1, t, 30, QColor()); + new Text(p, 10 + x + 21, 1+y+1, t, 30, QColor(0,0,64,128)); + t2 = new Text(p, 10 + x + 19, 1+y-1, t, 30, QColor()); timerId = 0; unselect(); diff --git a/applications/Photoframe/src/photolist.cpp b/applications/Photoframe/src/photolist.cpp index b7cc496..a4a3790 100755 --- a/applications/Photoframe/src/photolist.cpp +++ b/applications/Photoframe/src/photolist.cpp @@ -40,8 +40,10 @@ { if (dir == "Network") { qDebug("BLAH"); - //thumbs->changeDirectory(dir); - thumbs->getMachineList(); + //thumbs->changeDirectory(dir); +#ifndef _WIN32 + thumbs->getMachineList(); +#endif } else thumbs->changeDirectory(dir); } diff --git a/applications/Photoframe/pics/item-bg.png b/applications/Photoframe/pics/item-bg.png index ebedfe8..842a57f 100755 --- a/applications/Photoframe/pics/item-bg.png +++ b/applications/Photoframe/pics/item-bg.png Binary files differ diff --git a/applications/Photoframe/pics/sel-item-bg.png b/applications/Photoframe/pics/sel-item-bg.png index cb837bf..691dcfb 100755 --- a/applications/Photoframe/pics/sel-item-bg.png +++ b/applications/Photoframe/pics/sel-item-bg.png Binary files differ diff --git a/applications/Photoframe/src/devicelist.cpp b/applications/Photoframe/src/devicelist.cpp index e98c0a3..ea90824 100755 --- a/applications/Photoframe/src/devicelist.cpp +++ b/applications/Photoframe/src/devicelist.cpp @@ -77,7 +77,7 @@ emit deviceChanged(deviceNames[curItem]); // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { - if ( deviceNames[curItem] == "Back" ) { + if (std::string(deviceNames[curItem]) == "Back") { emit setStage(-2); //items[curItem]->unselect(); //curItem = 0; diff --git a/applications/Photoframe/src/intro.cpp b/applications/Photoframe/src/intro.cpp index 88f8fc5..1483d5a 100755 --- a/applications/Photoframe/src/intro.cpp +++ b/applications/Photoframe/src/intro.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "intro.h" @@ -8,7 +9,11 @@ resize(800,480); frame = 0; timerId = startTimer(10); - QSound::play("sounds/Startup.wav"); + introEnabled = QSettings("dpf.ini", QSettings::IniFormat).value("ShowIntro", true).toBool(); + if (introEnabled) + { + QSound::play("sounds/Startup.wav"); + } } @@ -63,18 +68,16 @@ { update(); frame++; -#define ENABLE_INTRO_ANIMATION 1 -#if defined(ENABLE_INTRO_ANIMATION) - if (frame == 300) { + + const int lastFrame = (introEnabled) ? 300 : 1; + if (frame == lastFrame) + { emit setStage(-2); } - if (frame > 380) { -#else - if (frame > 0) { -// emit setStage(-2); -#endif + + if (frame > lastFrame) + { killTimer(timerId); hide(); } } - diff --git a/applications/Photoframe/src/intro.h b/applications/Photoframe/src/intro.h index e9723cf..a80b820 100755 --- a/applications/Photoframe/src/intro.h +++ b/applications/Photoframe/src/intro.h @@ -19,6 +19,7 @@ void setStage(int); private: + bool introEnabled; int timerId; int frame; }; diff --git a/applications/Photoframe/src/main.cpp b/applications/Photoframe/src/main.cpp index 3030832..766b622 100755 --- a/applications/Photoframe/src/main.cpp +++ b/applications/Photoframe/src/main.cpp @@ -1,22 +1,51 @@ #include #include +#include #include #include +#include #include "manager.h" +void initWorkingDirectory() +{ + QDir dir(QDir::currentPath()); +#if defined(Q_OS_MAC) + if (dir.dirName() == "MacOS") + { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } +#endif + if (dir.dirName().toLower() == "build") + { + dir.cdUp(); + } + QDir::setCurrent(dir.absolutePath()); +} + + +void initLanguage() +{ + /* ### could defer this defaults loading to during the intro */ + QSettings settings("dpf.ini", QSettings::IniFormat); + QString lang = settings.value("Language").toString(); + QTranslator translator; + translator.load("DPF_" + lang, "i18n"); + qApp->installTranslator(&translator); + + QString fnt = settings.value("Font").toString(); + QFontDatabase::addApplicationFont("fonts/" + fnt + ".ttf"); + qApp->setFont(QFont(fnt, 25)); +} + + int main(int argc, char *argv[]) { QApplication app(argc, argv); - - /* ### could defer this defaults loading to during the intro */ - QSettings settings("dpf.ini", QSettings::IniFormat); - QString fnt = settings.value("Font").toString(); - QString lang = settings.value("Language").toString(); - QTranslator translator; - translator.load("DPF_" + lang, "i18n"); - app.installTranslator(&translator); - app.setFont(QFont(fnt, 25)); + initWorkingDirectory(); + initLanguage(); Manager manager(0); manager.show(); diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index a06f7e3..a16485d 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -62,10 +62,42 @@ } void paintEvent(QPaintEvent *pe) { QPainter p(this); - p.setOpacity((20-frame)/20.0); - p.drawPixmap(160-frame*10, 0, a); + QTransform trans; + float scale = 1.0; + + // Draw icon 'a' + trans.reset(); + scale = 0.5 + 0.5 * ((20.0 - frame) / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); + p.setOpacity((20 - frame) / 20.0); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, 0, a); + p.resetTransform(); + + // Draw icon 'a' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * ((20 - frame) / 20.0)); + p.drawPixmap(480 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.resetTransform(); + + // Draw icon 'b' + trans.reset(); + scale = 0.5 + 0.5 * (frame / 20.0); + trans.scale(scale, scale); + p.setWorldTransform(trans); p.setOpacity(frame/20.0); - p.drawPixmap(360-frame*10, 0, b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, 0, b); + p.resetTransform(); + + // Draw icon 'b' reflected + trans.reset(); + trans.scale(scale, -scale); + p.setWorldTransform(trans); + p.setOpacity(0.3 * (frame / 20.0)); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.resetTransform(); } QPixmap a, b; int frame; @@ -74,31 +106,35 @@ MainMenu::MainMenu(QWidget *parent) : Stage(parent) { - curItem = 0; - items = new MenuItem*[menuSize]; - for (int i = 0; i < menuSize; i++) - items[i] = new MenuItem(this, 60, 80+i*50, menuItems[i]); - items[curItem]->select(); - timerId = 0; - frame = 0; + static const bool labelAbove = true; + static const bool menuLeft = false; - QTimer::singleShot(0, this, SLOT(init())); + animateIcons = QSettings("dpf.ini", QSettings::IniFormat).value("AnimateIcons", true).toBool(); + + curItem = 0; icon = new AnimatedIcon(this); icon->setFrame(0); icon->setPixmaps(1,0); - icon->setGeometry(320,80,640,300); + icon->setGeometry(menuLeft ? 320 : -70, labelAbove ? 150 : 80, 640, 600); icon->show(); icon->setPixmaps(0, 0); icon->setFrame(0); icon->update(); - item1 = new Text(this, 432, 342, "", 40, QColor(0,0,0,128)); + item1 = new Text(this, menuLeft ? 432 : 82, labelAbove ? 52: 342, "", 40, QColor(0, 0, 0, 128)); item1->setText(nameMap[curItem]); - item2 = new Text(this, 430, 340, "", 40, QColor(255,255,255)); + item2 = new Text(this, menuLeft ? 430 : 80, labelAbove ? 50 : 340, "", 40, QColor(255, 255, 255)); item2->setText(nameMap[curItem]); - //animate(1, menuSize-1, 0); + items = new MenuItem * [menuSize]; + for (int i = 0; i < menuSize; i++) + items[i] = new MenuItem(this, menuLeft ? 60 : 450, 80 + i * 50, menuItems[i]); + items[curItem]->select(); + timerId = 0; + frame = 0; + + QTimer::singleShot(0, this, SLOT(init())); } @@ -132,6 +168,9 @@ frame = 20; else frame = 0; + + icon->setFrame(frame); + icon->update(); if (dir == -1) { item1->setText(nameMap[before]); item2->setText(nameMap[before]); @@ -139,6 +178,7 @@ item1->setText(nameMap[now]); item2->setText(nameMap[now]); } + timerId = startTimer(15); icon->setPixmaps(before, now); } @@ -168,6 +208,11 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(-1, curItem, prevItem); + if (!animateIcons) { + icon->setFrame(0); + icon->update(); + killTimer(timerId); + } } else if ( ke->key() == Qt::Key_Down ) { items[curItem]->unselect(); curItem++; @@ -179,7 +224,12 @@ QSound::play("sounds/Next.wav"); items[curItem]->select(); animate(1, prevItem, curItem); -// } else if ( ke->key() == Qt::Key_Select ) { + if (!animateIcons) { + icon->setFrame(20); + icon->update(); + killTimer(timerId); + } + // } else if ( ke->key() == Qt::Key_Select ) { } else if ( ke->key() == Qt::Key_Return ) { QSound::play("sounds/Select.wav"); emit setStage(curItem); diff --git a/applications/Photoframe/src/mainmenu.h b/applications/Photoframe/src/mainmenu.h index 436b4d7..3ddec71 100755 --- a/applications/Photoframe/src/mainmenu.h +++ b/applications/Photoframe/src/mainmenu.h @@ -32,6 +32,7 @@ AnimatedIcon *icon; Text *item1, *item2; int direction; + bool animateIcons; }; diff --git a/applications/Photoframe/src/manager.cpp b/applications/Photoframe/src/manager.cpp index e774dd8..940939d 100755 --- a/applications/Photoframe/src/manager.cpp +++ b/applications/Photoframe/src/manager.cpp @@ -1,3 +1,4 @@ +#include #include #include "intro.h" #include "manager.h" @@ -105,7 +106,8 @@ break; case 6: // Turn Off - exit(0); + // system("shutdown -t now"); + qApp->quit(); break; default: return; diff --git a/applications/Photoframe/src/menuitem.cpp b/applications/Photoframe/src/menuitem.cpp index f447b4e..4649ca9 100755 --- a/applications/Photoframe/src/menuitem.cpp +++ b/applications/Photoframe/src/menuitem.cpp @@ -10,8 +10,8 @@ item->setGeometry(x, y, 400, 50); y -= 6; - new Text(p, x + 21, y+1, t, 30, QColor(0,0,64,128)); - t2 = new Text(p, x + 19, y-1, t, 30, QColor()); + new Text(p, 10 + x + 21, 1+y+1, t, 30, QColor(0,0,64,128)); + t2 = new Text(p, 10 + x + 19, 1+y-1, t, 30, QColor()); timerId = 0; unselect(); diff --git a/applications/Photoframe/src/photolist.cpp b/applications/Photoframe/src/photolist.cpp index b7cc496..a4a3790 100755 --- a/applications/Photoframe/src/photolist.cpp +++ b/applications/Photoframe/src/photolist.cpp @@ -40,8 +40,10 @@ { if (dir == "Network") { qDebug("BLAH"); - //thumbs->changeDirectory(dir); - thumbs->getMachineList(); + //thumbs->changeDirectory(dir); +#ifndef _WIN32 + thumbs->getMachineList(); +#endif } else thumbs->changeDirectory(dir); } diff --git a/applications/Photoframe/src/settings.cpp b/applications/Photoframe/src/settings.cpp index 0166a79..ccedf42 100755 --- a/applications/Photoframe/src/settings.cpp +++ b/applications/Photoframe/src/settings.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "manager.h" #include "settings.h" @@ -105,7 +106,8 @@ { QSettings settings("dpf.ini", QSettings::IniFormat); settings.setValue("Font", f); - qApp->setFont(QFont(f,20)); + QFontDatabase::addApplicationFont("fonts/" + f + ".ttf"); + qApp->setFont(QFont(f, 25)); g_Manager->emitFontChanged(f); }