diff -r 627c4a0fd0e7 -r c3690ec91ef8 src/hbcore/utils/hbthetestwidget_p.cpp --- a/src/hbcore/utils/hbthetestwidget_p.cpp Fri Jun 11 13:58:22 2010 +0300 +++ b/src/hbcore/utils/hbthetestwidget_p.cpp Wed Jun 23 18:33:25 2010 +0300 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include // for qWarning @@ -68,6 +69,11 @@ // how much must button be dragged before it is actually moved const int KThreshold = 16; +const QString KDriveFPath("F:\\data\\log\\"); +const QString KDriveEPath("E:\\data\\log\\"); +const QString KDriveCPath("C:\\data\\log\\"); +const QString KTheAppLaunchConfigureFile("app_launch_config.txt"); + HbTheTestButton::HbTheTestButton(QGraphicsItem *parent) : HbToolButton(parent), mPressedDown(false) @@ -396,6 +402,62 @@ #endif } +void HbTheTestWidget::launchThemeChanger() +{ + QProcess::startDetached("hbthemechanger.exe"); +} + +void HbTheTestWidget::launchApplications() +{ + // Find config file + QString filePath = findAppLaunchConfigFile(); + + QStringList commandLines; + + if (!filePath.isEmpty()) { + // Try to read file + QFile file(filePath); + if (file.open(QIODevice::ReadOnly)) { + QString line; + + while (!file.atEnd()) { + QByteArray dirtyLine = file.readLine(); + line = QString(dirtyLine).trimmed(); + // Skip empty lines and comment lines + if (line.isEmpty() || line.at(0) == '#') { + continue; + } + commandLines.append(line); + } + } + } + + for (int i=0; iScreenDevice()->SizeInPixels(); -// TDisplayMode displayMode = CCoeEnv::Static()->ScreenDevice()->DisplayMode(); - -// CFbsBitmap *bitmap = new (ELeave) CFbsBitmap(); -// User::LeaveIfError(bitmap->Create(screenSize, displayMode)); - -// CCoeEnv::Static()->ScreenDevice()->CopyScreenToBitmap(bitmap); -// QPixmap screenPixmap = QPixmap::fromSymbianCFbsBitmap(bitmap); -//#else QPixmap screenPixmap = QPixmap::grabWindow( QApplication::activeWindow()->winId()); //krazy:exclude=qclasses -//#endif + QString format = "png"; screenPixmap.save(filePath.toLatin1(), format.toLatin1()); setVisible(true); @@ -472,4 +524,25 @@ dialog->show(); } +QString HbTheTestWidget::findAppLaunchConfigFile() +{ + QString filePath; +#if defined (Q_OS_SYMBIAN) + if (QFile::exists(KDriveFPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveFPath + KTheAppLaunchConfigureFile; + } else if (QFile::exists(KDriveEPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveEPath + KTheAppLaunchConfigureFile; + } else if (QFile::exists(KDriveCPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveCPath + KTheAppLaunchConfigureFile; + } +#elif defined (Q_OS_WIN32) + if (QFile::exists(KDriveCPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveCPath + KTheAppLaunchConfigureFile; + } + // only Symbian and Windows are supported +#endif + + return filePath; +} +