[-]
[+]
|
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">502ccec97663504dd9eeb552d4aaae7e3d408b1f</param>
+ <param name="revision">407a118c595c6f91931ca41d510b2f98c4551219</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/daemon/src/tohkeyboard.cpp
^
|
@@ -526,6 +526,18 @@
}
}
+ /* Catch ctrl-alt-del (Works only from left ctrl) */
+
+ if (keymap->altPressed && keymap->ctrlPressed && keyCode.at(0).first == KEY_DELETE)
+ {
+ printf("Requesting user daemon to reset with remorse.\n");
+
+ tohkbd2user->call(QDBus::AutoDetect, "resetWithRemorse");
+
+ keyIsPressed = true;
+ return;
+ }
+
if (processAllKeys)
{
for (int i=0; i<keyCode.count(); i++)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/config/com.kimmoli.tohkbd2user.xml
^
|
@@ -22,6 +22,7 @@
<method name="showTaskSwitcher" />
<method name="nextAppTaskSwitcher" />
<method name="hideTaskSwitcher" />
+ <method name="resetWithRemorse" />
<method name="getVersion">
<arg name="value" type="s" direction="out" />
</method>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/qml/taskswitcher.qml
^
|
@@ -10,32 +10,42 @@
height: Screen.height
rotation: 0
- property int currentApp: viewHelper.currentApp
- property int numberOfApps: viewHelper.numberOfApps
-
- onCurrentAppChanged:
+ Connections
{
- appName.text = appsModel.get(viewHelper.currentApp).name
- }
+ target: viewHelper
- onNumberOfAppsChanged:
- {
- if (numberOfApps > 0)
+ onCurrentAppChanged:
{
- updateAppsModel()
appName.text = appsModel.get(viewHelper.currentApp).name
+ }
+
+ onNumberOfAppsChanged:
+ {
+ if (viewHelper.numberOfApps > 0)
+ {
+ updateAppsModel()
+ appName.text = appsModel.get(viewHelper.currentApp).name
+
+ viewHelper.setTouchRegion(Qt.rect(taskSwitchBackground.x,
+ taskSwitchBackground.y,
+ taskSwitchBackground.width,
+ taskSwitchBackground.height))
+ }
+ }
+
+ onStartRebootRemorse:
+ {
+ rebootRemorse.execute(remorsePlaceholder, qsTr("Rebooting"))
- viewHelper.setTouchRegion(Qt.rect(taskSwitchBackground.x,
- taskSwitchBackground.y,
- taskSwitchBackground.width,
- taskSwitchBackground.height))
+ /* Block all other touches */
+ viewHelper.setTouchRegion(Qt.rect(0,0,root.width, root.height))
}
}
Sensors.OrientationSensor
{
id: rotationSensor
- active: viewHelper.visible
+ active: viewHelper.visible || rebootRemorse.visible
property int angle: active ? reading.orientation : 0
onAngleChanged:
{
@@ -72,9 +82,31 @@
opacity: 0.5
}
+ Item
+ {
+ anchors.centerIn: root
+ rotation: 90
+ width: root.height
+ height: Theme.itemSizeLarge
+
+ Item
+ {
+ id: remorsePlaceholder
+ anchors.fill: parent
+ }
+ }
+
+ RemorseItem
+ {
+ id: rebootRemorse
+ onTriggered: viewHelper.reboot()
+ onCanceled: viewHelper.cancelReboot()
+ }
+
Rectangle
{
id: taskSwitchBackground
+ visible: viewHelper.visible
anchors.centerIn: root
anchors.horizontalCenterOffset: Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
@@ -82,66 +114,66 @@
width: Theme.itemSizeLarge * taskSwitchGrid.rows + 2 * Theme.paddingLarge
height: Theme.itemSizeLarge * taskSwitchGrid.columns + Theme.paddingLarge
clip: true
- }
-
- Label
- {
- id: appName
- rotation: 90
- anchors.centerIn: taskSwitchBackground
- anchors.horizontalCenterOffset: Theme.paddingSmall + (Theme.itemSizeLarge * (taskSwitchGrid.rows/2))
- text: "???"
- font.pixelSize: Theme.fontSizeSmall
- color: Theme.primaryColor
- }
- Grid
- {
- id: taskSwitchGrid
- anchors.centerIn: taskSwitchBackground
- anchors.horizontalCenterOffset: -Theme.paddingLarge/2
- rotation: 90
- property int i : appsModel.count
- columns: (i<6) ? i : ((i<12) ? ((i%2 == 0) ? i/2 : i/2 +1) : ((i%3 == 0) ? i/3 : i/3 +1))
- rows: (i<6) ? 1 : ((i<12) ? 2 : 3)
+ Label
+ {
+ id: appName
+ rotation: 90
+ anchors.centerIn: taskSwitchBackground
+ anchors.horizontalCenterOffset: Theme.paddingSmall + (Theme.itemSizeLarge * (taskSwitchGrid.rows/2))
+ text: "???"
+ font.pixelSize: Theme.fontSizeSmall
+ color: Theme.primaryColor
+ }
- Repeater
+ Grid
{
- id: appIconRepeater
- model: appsModel
+ id: taskSwitchGrid
+ anchors.centerIn: taskSwitchBackground
+ anchors.horizontalCenterOffset: -Theme.paddingLarge/2
+ rotation: 90
+ property int i : appsModel.count
+ columns: (i<6) ? i : ((i<12) ? ((i%2 == 0) ? i/2 : i/2 +1) : ((i%3 == 0) ? i/3 : i/3 +1))
+ rows: (i<6) ? 1 : ((i<12) ? 2 : 3)
- Item
+ Repeater
{
- width: Theme.itemSizeLarge
- height: Theme.itemSizeLarge
+ id: appIconRepeater
+ model: appsModel
- Rectangle
+ Item
{
- id: appIconBackground
- anchors.fill: parent
- color: viewHelper.currentApp === index ? Theme.highlightColor : "transparent"
- opacity: 0.7
- radius: Theme.paddingSmall
- }
+ width: Theme.itemSizeLarge
+ height: Theme.itemSizeLarge
- Image
- {
- id: appIcon
- anchors.centerIn: appIconBackground
- source: iconId
- property real size: Theme.iconSizeLauncher
-
- sourceSize.width: size
- sourceSize.height: size
- width: size
- height: size
- }
-
- MouseArea
- {
- anchors.fill: parent
- onPressed: viewHelper.setCurrentApp(index)
- onClicked: viewHelper.launchApplication(index)
+ Rectangle
+ {
+ id: appIconBackground
+ anchors.fill: parent
+ color: viewHelper.currentApp === index ? Theme.highlightColor : "transparent"
+ opacity: 0.7
+ radius: Theme.paddingSmall
+ }
+
+ Image
+ {
+ id: appIcon
+ anchors.centerIn: appIconBackground
+ source: iconId
+ property real size: Theme.iconSizeLauncher
+
+ sourceSize.width: size
+ sourceSize.height: size
+ width: size
+ height: size
+ }
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/applauncher.cpp
^
|
@@ -3,12 +3,8 @@
#include <mlite5/MDesktopEntry>
#include <QSharedPointer>
-#ifdef USECONTENTACTION
- #include <contentaction5/contentaction.h>
-#else
- #include <QThread>
- #include <QProcess>
-#endif
+#include <QThread>
+#include <QProcess>
AppLauncher::AppLauncher(QObject *parent) :
QObject(parent)
@@ -32,15 +28,9 @@
emit launchSuccess(app->name());
-#ifdef USECONTENTACTION
- ContentAction::Action action;
- action = ContentAction::Action::launcherAction(app, QStringList());
- action.trigger();
-#else
QProcess proc;
proc.startDetached("/usr/bin/xdg-open" , QStringList() << desktopFilename);
QThread::msleep(100);
-#endif
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/tohkbd2user.cpp
^
|
@@ -26,6 +26,9 @@
int main(int argc, char **argv)
{
+ /* To make remorse timer run without steroids */
+ setenv("QSG_RENDER_LOOP", "basic", 1);
+
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
QScopedPointer<QQuickView> view(SailfishApp::createView());
QObject::connect(view->engine(), SIGNAL(quit()), app.data(), SLOT(quit()));
@@ -60,6 +63,7 @@
QObject::connect(&rw, SIGNAL(_showTaskSwitcher()), helper.data(), SLOT(showWindow()));
QObject::connect(&rw, SIGNAL(_hideTaskSwitcher()), helper.data(), SLOT(hideWindow()));
QObject::connect(&rw, SIGNAL(_nextAppTaskSwitcher()), helper.data(), SLOT(nextApp()));
+ QObject::connect(&rw, SIGNAL(_requestReboot()), helper.data(), SLOT(requestReboot()));
AppLauncher al;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/userdaemon.cpp
^
|
@@ -148,3 +148,10 @@
notification.setImage(SailfishApp::pathTo("/icon-system-keyboard.png").toLocalFile());
notification.publish();
}
+
+void UserDaemon::resetWithRemorse()
+{
+ printf("tohkbd2-user: reset requested\n");
+
+ emit _requestReboot();
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/userdaemon.h
^
|
@@ -25,6 +25,7 @@
void _nextAppTaskSwitcher();
void _hideTaskSwitcher();
void _lauchApplication(const QString &desktoFilename);
+ void _requestReboot();
public slots:
QString getActiveLayout();
@@ -37,7 +38,9 @@
void showTaskSwitcher() { emit _showTaskSwitcher(); }
void nextAppTaskSwitcher() { emit _nextAppTaskSwitcher(); }
void hideTaskSwitcher() { emit _hideTaskSwitcher(); }
+ void resetWithRemorse();
void quit();
+
void launchSuccess(const QString &appName);
void launchFailed();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/viewhelper.cpp
^
|
@@ -250,3 +250,32 @@
{
return apps;
}
+
+/*
+ * Reboot related stuff
+ */
+void ViewHelper::requestReboot()
+{
+ view->showFullScreen();
+
+ emit startRebootRemorse();
+}
+
+void ViewHelper::cancelReboot()
+{
+ printf("tohkbd2-user: reboot cancelled\n");
+
+ view->hide();
+}
+
+void ViewHelper::reboot()
+{
+ printf("tohkbd2-user: rebooting!\n");
+
+ view->hide();
+
+ QProcess proc;
+ proc.startDetached("/usr/sbin/dsmetool" , QStringList() << QString("--reboot"));
+
+ QThread::msleep(100);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/src/viewhelper.h
^
|
@@ -24,18 +24,22 @@
Q_INVOKABLE void setCurrentApp(int n);
Q_INVOKABLE void setNumberOfApps(int n);
Q_INVOKABLE void setTouchRegion(const QRect &rect);
+ Q_INVOKABLE void reboot();
+ Q_INVOKABLE void cancelReboot();
signals:
void currentAppChanged();
void numberOfAppsChanged();
void visibleChanged();
void _launchApplication(const QString &desktopFilename);
+ void startRebootRemorse();
public slots:
void detachWindow();
void hideWindow();
void showWindow();
void nextApp();
+ void requestReboot();
private:
void setMouseRegion(const QRegion ®ion);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.3.tar.bz2/user-daemon/user-daemon.pro
^
|
@@ -3,9 +3,6 @@
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp mlite5
-# PKGCONFIG += contentaction5
-# DEFINES += USECONTENTACTION
-
QT += dbus gui-private
# DBus
|