Added a link to the Android app from the KCM

This commit is contained in:
Albert Vaca 2015-03-23 00:39:36 -07:00
parent 60d85932db
commit f237a659ec
2 changed files with 83 additions and 4 deletions

View file

@ -63,6 +63,10 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
kcmUi->progressBar->setVisible(false);
kcmUi->messages->setVisible(false);
//Workaround: If we set this directly (or if we set it in the .ui file), the layout breaks
kcmUi->noDeviceLinks->setWordWrap(false);
QTimer::singleShot(0, [this] { kcmUi->noDeviceLinks->setWordWrap(true); });
kcmUi->rename_label->setText(daemon->announcedName());
kcmUi->rename_edit->setText(daemon->announcedName());
setRenameMode(false);
@ -133,6 +137,8 @@ void KdeConnectKcm::resetSelection()
void KdeConnectKcm::deviceSelected(const QModelIndex& current)
{
kcmUi->noDevicePlaceholder->setVisible(false);
if (currentDevice) {
disconnect(currentDevice,SIGNAL(pairingSuccesful()),
this, SLOT(pairingSuccesful()));
@ -181,7 +187,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
//KPluginSelector has no way to remove a list of plugins and load another, so we need to destroy and recreate it each time
delete kcmUi->pluginSelector;
kcmUi->pluginSelector = new KPluginSelector(this);
kcmUi->verticalLayout_2->addWidget(kcmUi->pluginSelector);
kcmUi->deviceInfo_layout->addWidget(kcmUi->pluginSelector);
kcmUi->pluginSelector->setConfigurationArguments(QStringList(currentDevice->id()));

View file

@ -111,14 +111,14 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="deviceInfoBorder_2">
<widget class="QGroupBox" name="deviceInfoBorder">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="deviceInfoBorder">
<layout class="QVBoxLayout" name="deviceInfoBorder_layout">
<item>
<widget class="QWidget" name="deviceInfo" native="true">
<property name="sizePolicy">
@ -127,7 +127,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="deviceInfo_layout">
<item>
<widget class="QWidget" name="header_2" native="true">
<property name="sizePolicy">
@ -260,6 +260,79 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="noDevicePlaceholder" native="true">
<layout class="QVBoxLayout" name="noDevicePlaceholder_layout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="noDeviceLabel">
<property name="text">
<string>No device selected.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="noDeviceLinks">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>If you have an Android phone, make sure to install the &lt;a href=&quot;https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;KDE Connect Android app&lt;/span&gt;&lt;/a&gt; (also available &lt;a href=&quot;https://f-droid.org/repository/browse/?fdid=org.kde.kdeconnect_tp&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;from F-Droid&lt;/span&gt;&lt;/a&gt;).</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>40</number>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>