1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-106 Add board picture to wizard controller page - Resize connection

diagram button
This commit is contained in:
Laurent Lalanne 2015-08-28 18:56:10 +02:00
parent a8bdf53ef8
commit 66aab9553e
3 changed files with 85 additions and 4 deletions

View File

@ -199,6 +199,35 @@ void ControllerPage::connectionStatusChanged()
SetupWizard::CONTROLLER_TYPE type = getControllerType();
setControllerType(type);
QPixmap boardPic;
QSize picSize = QSize(250,250);
switch (type) {
case SetupWizard::CONTROLLER_CC:
boardPic.load(":/configgadget/images/coptercontrol.svg");
ui->boardImg->setPixmap(boardPic.scaled(picSize, Qt::KeepAspectRatio));
break;
case SetupWizard::CONTROLLER_CC3D:
boardPic.load(":/configgadget/images/cc3d_top.png");
ui->boardImg->setPixmap(boardPic.scaled(picSize, Qt::KeepAspectRatio));
break;
case SetupWizard::CONTROLLER_REVO:
case SetupWizard::CONTROLLER_DISCOVERYF4:
boardPic.load(":/configgadget/images/revolution_top.png");
ui->boardImg->setPixmap(boardPic.scaled(picSize, Qt::KeepAspectRatio));
break;
case SetupWizard::CONTROLLER_NANO:
boardPic.load(":/configgadget/images/nano_top.png");
ui->boardImg->setPixmap(boardPic.scaled(picSize, Qt::KeepAspectRatio));
break;
default:
ui->boardImg->setPixmap(QPixmap());
break;
}
qDebug() << "Connection status changed: Connected, controller type: " << getControllerType();
} else {
ui->deviceCombo->setEnabled(true);
@ -206,6 +235,7 @@ void ControllerPage::connectionStatusChanged()
ui->boardTypeCombo->setEnabled(false);
ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(0, 0), QVariant(0), Qt::UserRole - 1);
setControllerType(SetupWizard::CONTROLLER_UNKNOWN);
ui->boardImg->setPixmap(QPixmap());
qDebug() << "Connection status changed: Disconnected";
}
emit completeChanged();

View File

@ -60,7 +60,58 @@ p, li { white-space: pre-wrap; }
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>9</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="boardImg">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>9</height>
</size>
</property>
</spacer>

View File

@ -44,7 +44,7 @@ p, li { white-space: pre-wrap; }
<property name="maximumSize">
<size>
<width>16777215</width>
<height>250</height>
<height>220</height>
</size>
</property>
<property name="font">
@ -80,8 +80,8 @@ p, li { white-space: pre-wrap; }
</property>
<property name="iconSize">
<size>
<width>120</width>
<height>120</height>
<width>170</width>
<height>170</height>
</size>
</property>
<property name="checkable">