summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlli Werwolff <qt-info@nokia.com>2011-04-26 14:38:24 +0200
committerOlli Werwolff <qt-info@nokia.com>2011-04-26 14:38:24 +0200
commit8ff2d677873c3dcce1cd471ecfbc4251765c4b25 (patch)
tree0dc4e4aa057d90b50977ed38c6c06e04c5f84743 /src
parentf5e8d10f8a3e4c841985a3a28642a457c856ae80 (diff)
parent558c8ba1ca2978575c7f377167c5e0e641376c7c (diff)
Merge remote branch 'public/1.1'
Conflicts: src/main.cpp src/ui/configurationwidget.cpp src/ui/configurationwidget.h
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/ui/cameraui.cpp7
-rw-r--r--src/ui/cameraui.h2
-rw-r--r--src/ui/configurationwidget.cpp1
-rw-r--r--src/ui/mainwindow.cpp4
-rw-r--r--src/ui/sensorsui.cpp3
-rw-r--r--src/ui/systeminfostorageui.cpp22
-rw-r--r--src/ui/systeminfostorageui.h5
-rw-r--r--src/ui/viewconfiguration.cpp3
9 files changed, 35 insertions, 14 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3ce9aa0..261a4c4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -85,7 +85,7 @@ static void registerSimulator(const QString &location)
settings->beginGroup(SIMULATOR_APP_QT_VERSIONS_KEY);
QList<QString> supportedQtVersion;
- supportedQtVersion << "4.7.2.1";
+ supportedQtVersion << "4.7.4.0";
foreach(const QString &version, supportedQtVersion) {
QList<QString> simulators;
QVariant value = settings->value(version);
diff --git a/src/ui/cameraui.cpp b/src/ui/cameraui.cpp
index 55da83d..1aa127c 100644
--- a/src/ui/cameraui.cpp
+++ b/src/ui/cameraui.cpp
@@ -54,6 +54,7 @@ CameraUi::CameraUi(QWidget *parent)
: ToolBoxPage(parent)
{
qRegisterMetaType<CameraUi::CameraData>("CameraUi::CameraData");
+ qRegisterMetaType<CameraUi::CameraData::CameraDetails>("CameraUi::CameraData::CameraDetails");
mScriptInterface = new CameraScriptInterface(this);
QStringList tags;
@@ -150,7 +151,11 @@ void CameraUi::emitCameraDataChange() const
void CameraUi::showCameraInfo()
{
bool editingEnabled = mCameras->count() != 0;
- enableCameraControls(editingEnabled);
+ // workaround for calling this from another thread (scripts):
+ // always perform the setEnabled calls in the gui thread -
+ // setEnabled calls sendEvent!
+ QMetaObject::invokeMethod(this, "enableCameraControls", Qt::QueuedConnection,
+ Q_ARG(bool, editingEnabled));
if (!editingEnabled)
return;
diff --git a/src/ui/cameraui.h b/src/ui/cameraui.h
index f05e0c1..38cf177 100644
--- a/src/ui/cameraui.h
+++ b/src/ui/cameraui.h
@@ -115,7 +115,7 @@ private slots:
void removeCameraClicked();
private:
- void enableCameraControls(bool enabled);
+ Q_INVOKABLE void enableCameraControls(bool enabled);
friend class CameraScriptInterface;
CameraScriptInterface *mScriptInterface;
diff --git a/src/ui/configurationwidget.cpp b/src/ui/configurationwidget.cpp
index 668fe44..f82519f 100644
--- a/src/ui/configurationwidget.cpp
+++ b/src/ui/configurationwidget.cpp
@@ -49,3 +49,4 @@ void ConfigurationWidget::closeEvent(QCloseEvent *event)
event->ignore();
emit closeMainWindow();
}
+
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index 9a4475a..3e07a7e 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -89,9 +89,9 @@
const VersionStruct simulatorVersion(1, 1, 0, 1);
// Increment this value if the scripts that come bundled with the Simulator
-// have changed and the user should be asked whehter he wants to copy them
+// have changed and the user should be asked whether he wants to copy them
// to his user script directory.
-const int scriptVersion = 0;
+const int scriptVersion = 1;
MainWindow::MainWindow(QWidget *parent)
: QWidget(parent)
diff --git a/src/ui/sensorsui.cpp b/src/ui/sensorsui.cpp
index bfffef7..323a702 100644
--- a/src/ui/sensorsui.cpp
+++ b/src/ui/sensorsui.cpp
@@ -171,7 +171,8 @@ SensorsUi::SensorsUi(QWidget *parent)
mAccelerometerControl = new AccelerometerControl();
mAccelerometerControl->setMinimumHeight(150);
connect(mAccelerometerControl, SIGNAL(valueChanged(QVector3D)), this, SLOT(setAccelerometerValue(QVector3D)));
- vlayout->addWidget(mAccelerometerControl);
+ if (mAccelerometerControl->isValid())
+ vlayout->addWidget(mAccelerometerControl);
QHBoxLayout *hlayout = new QHBoxLayout;
vlayout->addLayout(hlayout);
diff --git a/src/ui/systeminfostorageui.cpp b/src/ui/systeminfostorageui.cpp
index 6b3b8e2..93a698d 100644
--- a/src/ui/systeminfostorageui.cpp
+++ b/src/ui/systeminfostorageui.cpp
@@ -53,8 +53,8 @@ void StorageSystemInfoUi::initializeStorage()
tags << tr("drives") << tr("memory") << tr("storage");
systemInfoDrives = new QComboBox();
- QPushButton *systemInfoChangeDriveName = new QPushButton(tr("Change Name"));
- QPushButton *systemInfoRemoveDrive = new QPushButton(tr("Remove"));
+ systemInfoChangeDriveName = new QPushButton(tr("Change Name"));
+ systemInfoRemoveDrive = new QPushButton(tr("Remove"));
QPushButton *systemInfoAddDrive = new QPushButton(tr("Add"));
QHBoxLayout *hLayout = new QHBoxLayout();
hLayout->addWidget(systemInfoChangeDriveName);
@@ -154,9 +154,12 @@ void StorageSystemInfoUi::emitStorageDataChange()
void StorageSystemInfoUi::showDriveInfo()
{
bool editingEnabled = systemInfoDrives->count() != 0;
- systemInfoDriveType->setEnabled(editingEnabled);
- systemInfoDriveAvailableSpace->setEnabled(editingEnabled);
- systemInfoDriveTotalSpace->setEnabled(editingEnabled);
+
+ // workaround for calling this from another thread (scripts):
+ // always perform the setEnabled calls in the gui thread -
+ // setEnabled calls sendEvent!
+ QMetaObject::invokeMethod(this, "enableDriveControls", Qt::QueuedConnection,
+ Q_ARG(bool, editingEnabled));
if (!editingEnabled)
return;
@@ -394,3 +397,12 @@ bool StorageSystemInfoScriptInterface::setAvailableSpace(const QString &name, qi
}
return true;
}
+
+void StorageSystemInfoUi::enableDriveControls(bool enabled)
+{
+ systemInfoDriveType->setEnabled(enabled);
+ systemInfoDriveAvailableSpace->setEnabled(enabled);
+ systemInfoDriveTotalSpace->setEnabled(enabled);
+ systemInfoRemoveDrive->setEnabled(enabled);
+ systemInfoChangeDriveName->setEnabled(enabled);
+}
diff --git a/src/ui/systeminfostorageui.h b/src/ui/systeminfostorageui.h
index 33702d2..de55ebe 100644
--- a/src/ui/systeminfostorageui.h
+++ b/src/ui/systeminfostorageui.h
@@ -41,6 +41,7 @@
class QLineEdit;
class QComboBox;
+class QPushButton;
class StorageSystemInfoUi;
@@ -127,13 +128,15 @@ private slots:
private:
void initializeStorage();
void initializeStorageOptions();
-
+ Q_INVOKABLE void enableDriveControls(bool enabled);
private:
QComboBox *systemInfoDrives;
QComboBox *systemInfoDriveType;
QLineEdit *systemInfoDriveTotalSpace;
QLineEdit *systemInfoDriveAvailableSpace;
+ QPushButton *systemInfoRemoveDrive;
+ QPushButton *systemInfoChangeDriveName;
StorageData mData;
diff --git a/src/ui/viewconfiguration.cpp b/src/ui/viewconfiguration.cpp
index 052452b..cbe133e 100644
--- a/src/ui/viewconfiguration.cpp
+++ b/src/ui/viewconfiguration.cpp
@@ -86,8 +86,7 @@ void ViewConfiguration::updateLine()
lineWidth = qApp->desktop()->logicalDpiX() / 2.54 * 10 * mCurrentCorrectionFactor;
else
lineWidth = qApp->desktop()->logicalDpiX() * 4 * mCurrentCorrectionFactor;
- mRulerWidget->setFixedWidth(lineWidth);
- ui.scrollArea->setMinimumWidth(lineWidth);
+ ui.scrollArea->setFixedWidth(lineWidth);
mRulerWidget->updateCorrectionFactor(ui.horizontalSlider->value() / 100.);
}