Commit 4265474a authored by Tony Murray's avatar Tony Murray
Browse files

Browse for media share directory

parent d9797f47
......@@ -26,8 +26,6 @@
#include "settings.h"
#include <QDesktopWidget>
static const QStringList keymaps = (QStringList()
<< QStringLiteral("ar")
<< QStringLiteral("cs")
......@@ -99,6 +97,7 @@ QWidget* RdpHostPreferences::createProtocolSpecificConfigPage()
rdpUi.setupUi(rdpPage);
connect(rdpUi.kcfg_Sound, SIGNAL(currentIndexChanged(int)), SLOT(updateSoundSystem(int)));
connect(rdpUi.browseMediaButton, SIGNAL(released()), SLOT(browseMedia()));
rdpUi.loginGroupBox->setVisible(false);
......@@ -188,6 +187,14 @@ void RdpHostPreferences::updateSoundSystem(int index)
}
}
void RdpHostPreferences::browseMedia()
{
QString shareDir = QFileDialog::getExistingDirectory(rdpUi.browseMediaButton, i18n("Browse to media share path"), rdpUi.kcfg_ShareMedia->text());
if (!shareDir.isNull()) {
rdpUi.kcfg_ShareMedia->setText(shareDir);
}
}
void RdpHostPreferences::acceptConfig()
{
HostPreferences::acceptConfig();
......
......@@ -28,6 +28,9 @@
#include "hostpreferences.h"
#include "ui_rdppreferences.h"
#include <QDesktopWidget>
#include <QFileDialog>
class RdpHostPreferences : public HostPreferences
{
Q_OBJECT
......@@ -67,6 +70,7 @@ private:
private Q_SLOTS:
void updateWidthHeight(int index);
void updateSoundSystem(int index);
void browseMedia();
};
#endif
......@@ -43,6 +43,8 @@ RdpPreferences::RdpPreferences(QWidget *parent, const QVariantList &args)
rdpUi.kcfg_Width->setEnabled(true);
rdpUi.heightLabel->setEnabled(true);
rdpUi.widthLabel->setEnabled(true);
rdpUi.browseMediaButton->hide();
addConfig(Settings::self(), this);
}
......
......@@ -547,20 +547,34 @@
</widget>
</item>
<item row="6" column="1">
<widget class="KLineEdit" name="kcfg_ShareMedia">
<property name="minimumSize">
<size>
<width>280</width>
<height>0</height>
</size>
</property>
<property name="whatsThis">
<string>Share a local media directory with the remote host.</string>
</property>
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
</widget>
<layout class="QHBoxLayout" name="mediaLayout">
<item>
<widget class="KLineEdit" name="kcfg_ShareMedia">
<property name="minimumSize">
<size>
<width>280</width>
<height>0</height>
</size>
</property>
<property name="whatsThis">
<string>Share a local media directory with the remote host.</string>
</property>
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="browseMediaButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="folder"/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment