[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/kimmoli/tohkbd2.git</param>
<param name="branch">master</param>
- <param name="revision">ed75647ba5746d50621d7ca7a526d7e57f8a0701</param>
+ <param name="revision">9a7715a5912efed61c425427a1f22c53e00c298e</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/daemon/src/tohkeyboard.cpp
^
|
@@ -868,7 +868,7 @@
for (int i = 0 ; i<FKEYS.length() ; i++)
{
- printf("app shortcut %d F%d : %s\n", FKEYS.at(i), i+1, qPrintable(applicationShortcuts[FKEYS.at(i)]));
+ printf("Shortcut F%d : %s\n", i+1, qPrintable(applicationShortcuts[FKEYS.at(i)]));
/* Write them back, as we need default values there in settings app */
settings.setValue(QString("KEY_F%1").arg(i+1), applicationShortcuts[FKEYS.at(i)]);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/qml/taskswitcher.qml
^
|
@@ -33,7 +33,7 @@
{
id: rotationSensor
active: viewHelper.visible
- property int angle: reading.orientation
+ property int angle: active ? reading.orientation : 0
onAngleChanged:
{
if (reading.orientation === 3) /* Landscape inverted */
|
[-]
[+]
|
Added |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/applauncher.cpp
^
|
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include "applauncher.h"
+#include <mlite5/MDesktopEntry>
+#include <contentaction5/contentaction.h>
+
+AppLauncher::AppLauncher(QObject *parent) :
+ QObject(parent)
+{
+}
+
+void AppLauncher::launchApplication(const QString &desktopFilename)
+{
+ QSharedPointer<MDesktopEntry> app;
+
+ app = QSharedPointer<MDesktopEntry>(new MDesktopEntry(desktopFilename));
+
+ if (!app->isValid())
+ {
+ printf("tohkbd2-user: AppLauncher: invalid application: %s\n", qPrintable(desktopFilename));
+ emit launchFailed();
+ return;
+ }
+
+ printf("tohkbd2-user: AppLauncher: starting: %s\n" ,qPrintable(app->name()));
+
+ emit launchSuccess(app->name());
+
+ ContentAction::Action action;
+ action = ContentAction::Action::launcherAction(app, QStringList());
+ action.trigger();
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/applauncher.h
^
|
@@ -0,0 +1,21 @@
+#ifndef APPLAUNCHER_H
+#define APPLAUNCHER_H
+
+#include <QObject>
+
+class AppLauncher : public QObject
+{
+ Q_OBJECT
+public:
+ explicit AppLauncher(QObject *parent = 0);
+
+
+public slots:
+ void launchApplication(const QString &desktopFilename);
+
+signals:
+ void launchSuccess(const QString &appName);
+ void launchFailed();
+};
+
+#endif // APPLAUNCHER_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/tohkbd2user.cpp
^
|
@@ -22,7 +22,7 @@
#include "userdaemon.h"
#include "adaptor.h"
#include "viewhelper.h"
-
+#include "applauncher.h"
int main(int argc, char **argv)
{
@@ -61,6 +61,13 @@
QObject::connect(&rw, SIGNAL(_hideTaskSwitcher()), helper.data(), SLOT(hideWindow()));
QObject::connect(&rw, SIGNAL(_nextAppTaskSwitcher()), helper.data(), SLOT(nextApp()));
+ AppLauncher al;
+
+ QObject::connect(&al, SIGNAL(launchSuccess(QString)), &rw, SLOT(launchSuccess(QString)));
+ QObject::connect(&al, SIGNAL(launchFailed()), &rw, SLOT(launchFailed()));
+ QObject::connect(&rw, SIGNAL(_lauchApplication(QString)), &al, SLOT(launchApplication(QString)));
+ QObject::connect(helper.data(), SIGNAL(_launchApplication(QString)), &al, SLOT(launchApplication(QString)));
+
QTranslator translator;
translator.load(QLocale::system().name(), "/usr/share/harbour-tohkbd2-user/i18n");
app->installTranslator(&translator);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/userdaemon.cpp
^
|
@@ -9,6 +9,7 @@
QObject(parent)
{
m_dbusRegistered = false;
+ m_launchPending = false;
}
UserDaemon::~UserDaemon()
@@ -109,16 +110,8 @@
void UserDaemon::launchApplication(const QString &desktopFilename)
{
- MDesktopEntry app(desktopFilename);
-
- printf("tohkbd2-user: starting \"%s\"\n" ,qPrintable(app.name()));
-
- showNotification(tr("Starting %1...").arg(app.name()));
-
- QProcess proc;
- proc.startDetached("/usr/bin/xdg-open" , QStringList() << desktopFilename);
-
- QThread::msleep(100);
+ m_launchPending = true;
+ emit _lauchApplication(desktopFilename);
}
void UserDaemon::showKeyboardConnectionNotification(const bool &connected)
@@ -134,12 +127,22 @@
return QString(APPVERSION);
}
+void UserDaemon::launchSuccess(const QString &appName)
+{
+ if (m_launchPending)
+ showNotification(tr("Starting %1...").arg(appName));
-/******** PRIV *********/
+ m_launchPending = false;
+}
+
+void UserDaemon::launchFailed()
+{
+ m_launchPending = false;
+}
/* show notification
*/
-void UserDaemon::showNotification(QString text)
+void UserDaemon::showNotification(const QString &text)
{
MNotification notification(MNotification::DeviceEvent, "", text);
notification.setImage(SailfishApp::pathTo("/icon-system-keyboard.png").toLocalFile());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/userdaemon.h
^
|
@@ -24,6 +24,7 @@
void _showTaskSwitcher();
void _nextAppTaskSwitcher();
void _hideTaskSwitcher();
+ void _lauchApplication(const QString &desktoFilename);
public slots:
QString getActiveLayout();
@@ -37,11 +38,13 @@
void nextAppTaskSwitcher() { emit _nextAppTaskSwitcher(); }
void hideTaskSwitcher() { emit _hideTaskSwitcher(); }
void quit();
+ void launchSuccess(const QString &appName);
+ void launchFailed();
private:
+ void showNotification(const QString &text);
bool m_dbusRegistered;
- void showNotification(QString text);
-
+ bool m_launchPending;
};
#endif // UserDaemon_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/viewhelper.cpp
^
|
@@ -212,9 +212,7 @@
view->hide();
- QProcess proc;
- proc.startDetached("/usr/bin/xdg-open" , QStringList() << appsDesktopFiles.at(n));
- QThread::msleep(100);
+ emit _launchApplication(appsDesktopFiles.at(n));
}
QVariantList ViewHelper::getCurrentApps()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/src/viewhelper.h
^
|
@@ -29,6 +29,7 @@
void currentAppChanged();
void numberOfAppsChanged();
void visibleChanged();
+ void _launchApplication(const QString &desktopFilename);
public slots:
void detachWindow();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.2.4.tar.bz2/user-daemon/user-daemon.pro
^
|
@@ -1,7 +1,7 @@
TARGET = harbour-tohkbd2-user
CONFIG += sailfishapp link_pkgconfig
-PKGCONFIG += sailfishapp mlite5
+PKGCONFIG += sailfishapp mlite5 contentaction5
QT += dbus gui-private
@@ -34,7 +34,8 @@
src/tohkbd2user.cpp \
src/adaptor.cpp \
src/userdaemon.cpp \
- src/viewhelper.cpp
+ src/viewhelper.cpp \
+ src/applauncher.cpp
OTHER_FILES += \
config/com.kimmoli.tohkbd2user.service \
@@ -46,4 +47,5 @@
HEADERS += \
src/adaptor.h \
src/userdaemon.h \
- src/viewhelper.h
+ src/viewhelper.h \
+ src/applauncher.h
|