Merging upstream version 0.9.0+20150807.

parent 679dac90
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
project(lxqt-notificationd)
......@@ -7,6 +7,7 @@ option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" O
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5DBus REQUIRED QUIET)
......@@ -14,11 +15,9 @@ find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(KF5WindowSystem REQUIRED QUIET)
find_package(lxqt REQUIRED QUIET)
find_package(qt5xdg REQUIRED)
include(${LXQT_USE_FILE})
include(${QTXDG_USE_FILE})
include(GNUInstallDirs)
include(LXQtCompilerSettings NO_POLICY_SCOPE)
include(LXQtTranslate)
add_subdirectory(src)
......
project(lxqt-config-notificationd)
include_directories (
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
set(NOTIFICATIONS_CONF_SRC
advancedsettings.cpp
basicsettings.cpp
......@@ -19,8 +14,9 @@ set(NOTIFICATIONS_CONF_UI
# Translations **********************************
lxqt_translate_ts(NOTIFICATIONS_CONF_QM SOURCES
lxqt_translate_ts(NOTIFICATIONS_CONF_QM
UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
SOURCES
${NOTIFICATIONS_CONF_MOC}
${NOTIFICATIONS_CONF_SRC}
${NOTIFICATIONS_CONF_UI}
......@@ -31,11 +27,9 @@ lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME})
lxqt_translate_desktop(DESKTOP_FILES SOURCES lxqt-config-notificationd.desktop.in)
#************************************************
qt5_wrap_ui(NOTIFICATIONS_CONF_UI_CPP ${NOTIFICATIONS_CONF_UI})
add_executable(${PROJECT_NAME}
${NOTIFICATIONS_CONF_SRC}
${NOTIFICATIONS_CONF_UI_CPP}
${NOTIFICATIONS_CONF_QM}
${DESKTOP_FILES}
${QM_LOADER}
......@@ -44,8 +38,16 @@ add_executable(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
KF5::WindowSystem
Qt5::Widgets
${LXQT_LIBRARIES}
lxqt
)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(FILES ${DESKTOP_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
install(TARGETS
${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT Runtime
)
install(FILES
${DESKTOP_FILES}
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
COMPONENT Runtime
)
......@@ -92,6 +92,9 @@
<property name="suffix">
<string> sec</string>
</property>
<property name="maximum">
<number>7200</number>
</property>
</widget>
</item>
</layout>
......
......@@ -39,28 +39,26 @@ BasicSettings::BasicSettings(LxQt::Settings* settings, QWidget *parent) :
restoreSettings();
connect(topLeftButton, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(topRightButton, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(bottomRightButton, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(bottomLeftButton, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(topLeftRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(topCenterRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(topRightRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(centerLeftRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(centerCenterRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(centerRightRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(bottomLeftRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(bottomCenterRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
connect(bottomRightRB, SIGNAL(clicked()), this, SLOT(updateNotification()));
LxQt::Notification serverTest;
QString serverName = serverTest.serverInfo().name;
if (serverName != "lxqt-notificationd")
{
if (serverName.isEmpty())
{
warningLabel->setText(tr(
"<b>Warning:</b> No notifications daemon is running.\n"
"A fallback will be used."));
}
warningLabel->setText(tr("<b>Warning:</b> No notifications daemon is running.\n"
"A fallback will be used."));
else
{
warningLabel->setText(tr(
"<b>Warning:</b> A third-party notifications daemon (%1) is running.\n"
"These settings won't have any effect on it!"
).arg(serverName));
}
warningLabel->setText(tr("<b>Warning:</b> A third-party notifications daemon (%1) is running.\n"
"These settings won't have any effect on it!").arg(serverName));
}
}
......@@ -70,33 +68,53 @@ BasicSettings::~BasicSettings()
void BasicSettings::restoreSettings()
{
QString placement = mSettings->value("placement", "bottom-right").toString().toLower();
if (placement == "bottom-right")
bottomRightButton->setChecked(true);
else if (placement == "bottom-left")
bottomLeftButton->setChecked(true);
else if (placement == "top-right")
topRightButton->setChecked(true);
else if (placement == "top-left")
topLeftButton->setChecked(true);
else
bottomRightButton->setChecked(true);
QString placement = mSettings->value(QStringLiteral("placement"),
QStringLiteral("bottom-right")).toString().toLower();
if (QStringLiteral("top-left") == placement)
topLeftRB->setChecked(true);
else if (QStringLiteral("top-center") == placement)
topCenterRB->setChecked(true);
else if (QStringLiteral("top-right") == placement)
topRightRB->setChecked(true);
else if (QStringLiteral("center-left") == placement)
centerLeftRB->setChecked(true);
else if (QStringLiteral("center-center") == placement)
centerCenterRB->setChecked(true);
else if (QStringLiteral("center-right") == placement)
centerRightRB->setChecked(true);
else if (QStringLiteral("bottom-left") == placement)
bottomLeftRB->setChecked(true);
else if (QStringLiteral("bottom-center") == placement)
bottomCenterRB->setChecked(true);
else if (QStringLiteral("bottom-right") == placement)
bottomRightRB->setChecked(true);
}
void BasicSettings::updateNotification()
{
if (bottomRightButton->isChecked())
mSettings->setValue("placement", "bottom-right");
else if (bottomLeftButton->isChecked())
mSettings->setValue("placement", "bottom-left");
else if (topRightButton->isChecked())
mSettings->setValue("placement", "top-right");
else if (topLeftButton->isChecked())
mSettings->setValue("placement", "top-left");
QString align;
if (topLeftRB->isChecked())
align = QStringLiteral("top-left");
else if (topCenterRB->isChecked())
align = QStringLiteral("top-center");
else if (topRightRB->isChecked())
align = QStringLiteral("top-right");
else if (centerLeftRB->isChecked())
align = QStringLiteral("center-left");
else if (centerCenterRB->isChecked())
align = QStringLiteral("center-center");
else if (centerRightRB->isChecked())
align = QStringLiteral("center-right");
else if (bottomLeftRB->isChecked())
align = QStringLiteral("bottom-left");
else if (bottomCenterRB->isChecked())
align = QStringLiteral("bottom-center");
else // if (bottomRightRB->isChecked())
align = QStringLiteral("bottom-right");
LxQt::Notification::notify(//"lxqt-config-notificationd",
tr("Notification demo"),
tr("This is a test notification.\n"
"All notifications will now appear here on LXQt."),
"lxqt-logo.png");
mSettings->setValue(QStringLiteral("placement"), align);
LxQt::Notification::notify(tr("Notification demo ") + align,
tr("This is a test notification.\n All notifications will now appear here on LXQt."),
QStringLiteral("lxqt-logo.png"));
}
......@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>244</width>
<height>218</height>
<width>148</width>
<height>179</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
......@@ -24,44 +24,144 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Position on screen</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="topLeftButton">
<item row="2" column="4">
<widget class="QRadioButton" name="bottomRightRB">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="4">
<widget class="QRadioButton" name="centerRightRB">
<property name="text">
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="2">
<widget class="QRadioButton" name="centerCenterRB">
<property name="text">
<string>Top/Left</string>
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="topRightButton">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="topCenterRB">
<property name="text">
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="2" column="2">
<widget class="QRadioButton" name="bottomCenterRB">
<property name="text">
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="topLeftRB">
<property name="text">
<string>Top/Right</string>
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="4">
<widget class="QRadioButton" name="topRightRB">
<property name="text">
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="bottomLeftButton">
<widget class="QRadioButton" name="centerLeftRB">
<property name="text">
<string>Bottom/Left</string>
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="bottomRightButton">
<item row="2" column="0">
<widget class="QRadioButton" name="bottomLeftRB">
<property name="text">
<string>Bottom/Right</string>
<string/>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -74,7 +174,7 @@
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<item>
<widget class="QLabel" name="warningLabel">
<property name="wordWrap">
<bool>true</bool>
......@@ -85,4 +185,7 @@
</widget>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<TS version="2.1">
<context>
<name>AdvancedSettings</name>
<message>
<source>Menu Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification Duration</source>
<location filename="../advancedsettings.ui" line="17"/>
<source>Sizes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>For some the notification&apos;s expiration time is dependent on the notification server&apos;s settings.</source>
<location filename="../advancedsettings.ui" line="25"/>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&quot;Server Decides&quot; Time:</source>
<location filename="../advancedsettings.ui" line="32"/>
<location filename="../advancedsettings.ui" line="56"/>
<source> px</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> sec</source>
<location filename="../advancedsettings.ui" line="49"/>
<source>Spacing:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sizes</source>
<location filename="../advancedsettings.ui" line="68"/>
<source>Duration</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification Spacing:</source>
<location filename="../advancedsettings.ui" line="74"/>
<source>Some notifications set their own on-screen duration.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> px</source>
<location filename="../advancedsettings.ui" line="86"/>
<source>Default duration:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification Width:</source>
<location filename="../advancedsettings.ui" line="93"/>
<source> sec</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BasicSettings</name>
<message>
<location filename="../basicsettings.ui" line="23"/>
<source>Basic Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display Notifications</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Top/Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Top/Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bottom/Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bottom/Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Test Notification</source>
<location filename="../basicsettings.ui" line="30"/>
<source>Position on screen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="57"/>
<source>&lt;b&gt;Warning:&lt;/b&gt; No notifications daemon is running.
A fallback will be used.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="60"/>
<source>&lt;b&gt;Warning:&lt;/b&gt; A third-party notifications daemon (%1) is running.
These settings won&apos;t have an effect on it!</source>
These settings won&apos;t have any effect on it!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification Summary</source>
<location filename="../basicsettings.cpp" line="117"/>
<source>Notification demo </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification Body</source>
<location filename="../basicsettings.cpp" line="118"/>
<source>This is a test notification.
All notifications will now appear here on LXQt.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../mainwindow.cpp" line="40"/>
<source>Desktop Notifications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="43"/>
<source>Basic Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="47"/>
<source>Advanced Settings</source>
<translation type="unfinished"></translation>
</message>
......
# Translations
GenericName[de]=LxQt Konfigurations Center
Name[de]=LxQt Konfiguration
Name[de]=Mitteilungen der Arbeitsfläche
GenericName[de]=LxQt Mitteilungseinstellungen
Comment[de]=Konfiguration von Benachrichtigungen
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
<name>AdvancedSettings</name>
<message>
<location filename="../advancedsettings.ui" line="17"/>
<source>Sizes</source>
<translation>Größen</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="25"/>
<source>Width:</source>
<translation>Breite:</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="32"/>
<location filename="../advancedsettings.ui" line="56"/>
<source> px</source>
<translation> px</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="49"/>
<source>Spacing:</source>
<translation>Abstand:</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="68"/>
<source>Duration</source>
<translation>Dauer</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="74"/>
<source>Some notifications set their own on-screen duration.</source>
<translation>Einige Benachrichtigungen setzen ihre eigene Anzeigedauer.</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="86"/>
<source>Default duration:</source>
<translation>Standarddauer:</translation>
</message>
<message>
<location filename="../advancedsettings.ui" line="93"/>
<source> sec</source>
<translation> s</translation>
</message>
</context>
<context>
<name>BasicSettings</name>
<message>
<location filename="../basicsettings.ui" line="23"/>
<source>Basic Settings</source>
<translation>Grundeinstellungen</translation>
</message>
<message>
<location filename="../basicsettings.ui" line="30"/>
<source>Position on screen</source>
<translation>Position auf dem Bildschirm</translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="57"/>
<source>&lt;b&gt;Warning:&lt;/b&gt; No notifications daemon is running.
A fallback will be used.</source>
<translation>&lt;b&gt;Warnung:&lt;/b&gt; Es läuft kein Benachrichtigungsdaemon.
Ein Ersatz wird verwendet.</translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="60"/>
<source>&lt;b&gt;Warning:&lt;/b&gt; A third-party notifications daemon (%1) is running.
These settings won&apos;t have any effect on it!</source>
<translation>&lt;b&gt;Warnung:&lt;/b&gt; Ein anderer Benachrichtigungsdaemon (%1) läuft.
Diese Einstellungen wirken sich auf ihn nicht aus!</translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="117"/>
<source>Notification demo </source>
<translation>Testbenachrichtigung </translation>
</message>
<message>
<location filename="../basicsettings.cpp" line="118"/>
<source>This is a test notification.
All notifications will now appear here on LXQt.</source>
<translation>Dies ist eine Testbenachrichtigung.
Alle Benachrichtigungen erscheinen jetzt hier auf LXQt.</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../mainwindow.cpp" line="40"/>
<source>Desktop Notifications</source>
<translation>Arbeitsflächenbenachrichtigungen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="43"/>
<source>Basic Settings</source>
<translation>Grundeinstellungen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="47"/>
<source>Advanced Settings</source>
<translation>Erweiterte Einstellungen</translation>
</message>
</context>
</TS>
# Translations
GenericName[de_DE]=Anwendungsmenü
Name[de_DE]=LxQt Freedesktop Mitteilungen Konfiguration
Comment[de_DE]=Freedesktop Mitteilungen für LxQt Desktop konfigurieren
# Translations
GenericName[fr_FR]=Bloc-notes
Name[fr_FR]=Paramétreur de session LxQt
GenericName[fr_FR]=Paramétrage des notifications du bureau
Name[fr_FR]=Paramétrage notifications
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="hr_HR">
<context>
<name>AdvancedSettings</name>
<message>
<source>Menu Configuration</source>
<translation type="unfinished">Konfiguracija izbornika</translation>
</message>
<message>
<source>Notification Duration</source>
<translation type="unfinished">Trajanje obavijesti</translation>
</message>
<message>
<source>For some the notification&apos;s expiration time is dependent on the notification server&apos;s settings.</source>
<translation type="unfinished">Za neke obavijesti&apos;s vrijeme istjecanja ovisi o postavkama poslužitelja&apos;s obavijesti</translation>
</message>
<message>
<source>&quot;Server Decides&quot; Time:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> sec</source>
<translation type="unfinished">sek</translation>
</message>
<message>
<source>Sizes</source>
<translation type="unfinished">Veličine</translation>
</message>
<message>
<source>Notification Spacing:</source>
<translation type="unfinished">Razmak obavijesti</translation>
</message>
<message>
<source> px</source>
<translation type="