Skip to content

Commit

Permalink
Added share ui
Browse files Browse the repository at this point in the history
  • Loading branch information
R1tschY committed Sep 24, 2018
1 parent c354dca commit 3f1459d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
3 changes: 2 additions & 1 deletion harbour-sailfishconnect.pro
Expand Up @@ -90,7 +90,8 @@ DISTFILES += \
src/plugins/touchpad/metadata.json \
qml/components/Touchpad.qml \
qml/components/TouchpadPage.qml \
src/plugins/share/metadata.json
src/plugins/share/metadata.json \
qml/components/ShareUi.qml

SAILFISHAPP_ICONS = 86x86 108x108 128x128

Expand Down
1 change: 1 addition & 0 deletions qml/pages/DevicePage.qml
Expand Up @@ -134,6 +134,7 @@ Page {

// Plugin UIs

ShareUi { id: shareUi }
MprisUi { id: mprisUi }
Touchpad { id: touchpad }
ClipboardUi { id: clipboardUi }
Expand Down
15 changes: 13 additions & 2 deletions src/plugins/share/shareplugin.cpp
Expand Up @@ -24,6 +24,7 @@
#include <QDateTime>
#include <QTemporaryFile>
#include <QDesktopServices>
#include <QtQml>

#include <core/downloadjob.h>
#include <utils/filehelper.h>
Expand Down Expand Up @@ -67,7 +68,9 @@ bool SharePlugin::receivePackage(const NetworkPackage& np)
incomingPath() + "/" + filename);
job->setParent(this);
connect(job, &Job::finished, this, &SharePlugin::finishedFileTransfer);
// daemon->addJob(job);
// TODO: daemon->addJob(job);
// TODO: add to a job queue in which only x downloads/uploads are
// running in parallel
job->start();
} else if (np.has(QStringLiteral("text"))) {
auto text = np.get<QString>(QStringLiteral("text"));
Expand Down Expand Up @@ -134,14 +137,22 @@ QString SharePluginFactory::name() const

QString SharePluginFactory::description() const
{
return tr("Share files and URLs.");
return tr("Send and receive files and URLs.");
}

QString SharePluginFactory::iconUrl() const
{
return "image://theme/icon-m-share";
}

void SharePluginFactory::registerTypes()
{
qmlRegisterUncreatableType<SharePlugin>(
"SailfishConnect.Share", 0, 2, "SharePlugin",
QStringLiteral("not intented to be created from users"));
}

} // namespace SailfishConnect

Q_IMPORT_PLUGIN(SharePluginFactory)

2 changes: 2 additions & 0 deletions src/plugins/share/shareplugin.h
Expand Up @@ -61,6 +61,8 @@ class SharePluginFactory :
QString name() const override;
QString description() const override;
QString iconUrl() const override;

void registerTypes() override;
};

} // namespace SailfishConnect
23 changes: 15 additions & 8 deletions translations/harbour-sailfishconnect.ts
Expand Up @@ -193,13 +193,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanUploadJob</name>
<message>
<source>Couldn&apos;t find an available port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MprisUi</name>
<message>
Expand Down Expand Up @@ -286,6 +279,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SailfishConnect::LanUploadJob</name>
<message>
<source>Couldn&apos;t find an available port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SailfishConnect::MprisRemotePluginFactory</name>
<message>
Expand Down Expand Up @@ -326,7 +326,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Share files and URLs.</source>
<source>Send and receive files and URLs.</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down Expand Up @@ -367,6 +367,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShareUi</name>
<message>
<source>Share</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Touchpad</name>
<message>
Expand Down

0 comments on commit 3f1459d

Please sign in to comment.