cherry-picking upstream version 0.9.0+20151024.

ubuntu/bionic
Alf Gaida 9 years ago
parent e1cbc09a41
commit 5e62c03710

@ -25,6 +25,8 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
SOURCES
${${PROJECT_NAME}_DESKTOP_FILES_IN}
)
lxqt_plugin_translation_loader(QM_LOADER ${NAME} "lxqt-panel")
#************************************************
file (GLOB CONFIG_FILES resources/*.conf)
@ -42,7 +44,7 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
endif()
list(FIND STATIC_PLUGINS ${NAME} IS_STATIC)
set(SRC ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES})
set(SRC ${HEADERS} ${SOURCES} ${QM_LOADER} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES})
if (${IS_STATIC} EQUAL -1) # not static
add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules
install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file

6
debian/changelog vendored

@ -1,7 +1,7 @@
lxqt-panel (0.9.0+20150925-1) experimental; urgency=medium
lxqt-panel (0.9.0+20151024-1) experimental; urgency=medium
[ Alf Gaida ]
* Cherry-picked upstream version 0.9.0+20150925.
* Cherry-picked upstream version 0.9.0+20151024.
* Cleaned up debian/.gitignore
* Switched to experimental because of LXQt namespace change
* Added minimum version for liblxqt0-dev (>= 0.9.0+20150911)
@ -21,4 +21,4 @@ lxqt-panel (0.9.0+20150925-1) experimental; urgency=medium
* Sorting build-depends.
* Removing whitespaces at EOL and EOF.
-- Alf Gaida <agaida@siduction.org> Sat, 26 Sep 2015 03:39:36 +0200
-- Alf Gaida <agaida@siduction.org> Sun, 25 Oct 2015 02:27:12 +0200

@ -97,10 +97,11 @@ void AddPluginDialog::filter()
{
const LXQt::PluginInfo &plugin = mPlugins.at(i);
QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(),
QString s = QStringLiteral("%1 %2 %3 %4 %5").arg(plugin.name(),
plugin.comment(),
plugin.value("Name").toString(),
plugin.value("Comment").toString());
plugin.value("Comment").toString(),
plugin.id());
if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive))
continue;
@ -110,10 +111,10 @@ void AddPluginDialog::filter()
{
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text));
item->setText(QStringLiteral("<b>%1</b><br>%2<br><small>%3</small>")
.arg(plugin.name(), plugin.comment(), tr("(only one instance can run at a time)")));
item->setText(QStringLiteral("<b>%1</b> (%2)<br>%3<br><small>%4</small>")
.arg(plugin.name(), plugin.id(), plugin.comment(), tr("(only one instance can run at a time)")));
} else
item->setText(QStringLiteral("<b>%1</b><br>%2").arg(plugin.name(), plugin.comment()));
item->setText(QStringLiteral("<b>%1</b> (%2)<br>%3").arg(plugin.name(), plugin.id(), plugin.comment()));
item->setIcon(plugin.icon(fallIco));
item->setData(INDEX_ROLE, i);
}

@ -35,7 +35,6 @@
#include "popupmenu.h"
#include "plugin.h"
#include "panelpluginsmodel.h"
#include <LXQt/Settings>
#include <LXQt/PluginInfo>
#include <QScreen>
@ -112,8 +111,9 @@ QString LXQtPanel::positionToStr(ILXQtPanel::Position position)
/************************************************
************************************************/
LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) :
LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidget *parent) :
QFrame(parent),
mSettings(settings),
mConfigGroup(configGroup),
mPlugins{nullptr},
mPanelSize(0),
@ -123,6 +123,7 @@ LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) :
mAlignment(AlignmentLeft),
mPosition(ILXQtPanel::PositionBottom),
mScreenNum(0), //whatever (avoid conditional on uninitialized value)
mActualScreenNum(0),
mHidable(false),
mHidden(false)
{
@ -174,8 +175,6 @@ LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) :
connect(LXQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update()));
connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign()));
LXQtPanelApplication *app = reinterpret_cast<LXQtPanelApplication*>(qApp);
mSettings = app->settings();
readSettings();
// the old position might be on a visible screen
ensureVisible();
@ -213,7 +212,8 @@ void LXQtPanel::readSettings()
mSettings->value(CFG_KEY_PERCENT, true).toBool(),
false);
setPosition(mSettings->value(CFG_KEY_SCREENNUM, QApplication::desktop()->primaryScreen()).toInt(),
mScreenNum = mSettings->value(CFG_KEY_SCREENNUM, QApplication::desktop()->primaryScreen()).toInt();
setPosition(mScreenNum,
strToPosition(mSettings->value(CFG_KEY_POSITION).toString(), PositionBottom),
false);
@ -283,6 +283,8 @@ void LXQtPanel::ensureVisible()
{
if (!canPlacedOn(mScreenNum, mPosition))
setPosition(findAvailableScreen(mPosition), mPosition, true);
else
mActualScreenNum = mScreenNum;
// the screen size might be changed, let's update the reserved screen space.
updateWmStrut();
@ -352,7 +354,7 @@ int LXQtPanel::getReserveDimension()
void LXQtPanel::setPanelGeometry()
{
const QRect currentScreen = QApplication::desktop()->screenGeometry(mScreenNum);
const QRect currentScreen = QApplication::desktop()->screenGeometry(mActualScreenNum);
QRect rect;
if (isHorizontal())
@ -731,7 +733,7 @@ void LXQtPanel::setPosition(int screen, ILXQtPanel::Position position, bool save
mPosition == position)
return;
mScreenNum = screen;
mActualScreenNum = screen;
mPosition = position;
mLayout->setPosition(mPosition);

@ -33,6 +33,7 @@
#include <QString>
#include <QTimer>
#include <QPointer>
#include <LXQt/Settings>
#include "ilxqtpanel.h"
#include "lxqtpanelglobals.h"
@ -59,6 +60,8 @@ class LXQT_PANEL_API LXQtPanel : public QFrame, public ILXQtPanel
// for configuration dialog
friend class ConfigPanelWidget;
friend class ConfigPluginsWidget;
friend class ConfigPanelDialog;
friend class PanelPluginsModel;
public:
enum Alignment {
@ -67,7 +70,7 @@ public:
AlignmentRight = 1
};
LXQtPanel(const QString &configGroup, QWidget *parent = 0);
LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidget *parent = 0);
virtual ~LXQtPanel();
QString name() { return mConfigGroup; }
@ -104,8 +107,6 @@ public:
int opacity() const { return mOpacity; };
bool hidable() const { return mHidable; }
LXQt::Settings *settings() const { return mSettings; }
bool isPluginSingletonAndRunnig(QString const & pluginId) const;
public slots:
@ -142,6 +143,7 @@ protected:
public slots:
void showConfigDialog();
private slots:
void showAddPluginDialog();
void realign();
@ -173,7 +175,8 @@ private:
Alignment mAlignment;
ILXQtPanel::Position mPosition;
int mScreenNum;
int mScreenNum; //!< configured screen (user preference)
int mActualScreenNum; //!< panel currently shown at (if the configured screen is not available)
QTimer mDelaySave;
bool mHidable;
bool mHidden;
@ -187,6 +190,9 @@ private:
QPointer<ConfigPanelDialog> mConfigDialog;
void updateStyleSheet();
// settings should be kept private for security
LXQt::Settings *settings() const { return mSettings; }
};

@ -107,11 +107,11 @@ void LXQtPanelApplication::addNewPanel()
LXQtPanel* LXQtPanelApplication::addPanel(const QString& name)
{
LXQtPanel *panel = new LXQtPanel(name);
LXQtPanel *panel = new LXQtPanel(name, mSettings);
mPanels << panel;
connect(panel, SIGNAL(deletedByUser(LXQtPanel*)),
this, SLOT(removePanel(LXQtPanel*)));
//reemit signals
// reemit signals
connect(panel, &LXQtPanel::deletedByUser, this, &LXQtPanelApplication::removePanel);
connect(panel, &LXQtPanel::pluginAdded, this, &LXQtPanelApplication::pluginAdded);
connect(panel, &LXQtPanel::pluginRemoved, this, &LXQtPanelApplication::pluginRemoved);

@ -47,7 +47,6 @@ public:
~LXQtPanelApplication();
int count() { return mPanels.count(); }
LXQt::Settings *settings() { return mSettings; }
bool isPluginSingletonAndRunnig(QString const & pluginId) const;
public slots:

@ -96,7 +96,7 @@ QStringList PanelPluginsModel::pluginNames() const
QStringList names;
for (auto const & p : mPlugins)
names.append(p.first);
return std::move(names);
return names;
}
QList<Plugin *> PanelPluginsModel::plugins() const
@ -105,7 +105,7 @@ QList<Plugin *> PanelPluginsModel::plugins() const
for (auto const & p : mPlugins)
if (!p.second.isNull())
plugins.append(p.second.data());
return std::move(plugins);
return plugins;
}
Plugin* PanelPluginsModel::pluginByName(QString name) const
@ -246,9 +246,19 @@ QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType)
groups.sort();
// Generate new section name
QString pluginName = QStringLiteral("%1").arg(pluginType);
if (!groups.contains(pluginName))
return pluginName;
else
{
for (int i = 2; true; ++i)
if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i)))
return QStringLiteral("%1%2").arg(pluginType).arg(i);
{
pluginName = QStringLiteral("%1%2").arg(pluginType).arg(i);
if (!groups.contains(pluginName))
return pluginName;
}
}
}
void PanelPluginsModel::onActivatedIndex(QModelIndex const & index)

@ -50,15 +50,25 @@
// statically linked built-in plugins
#include "../plugin-clock/lxqtclock.h" // clock
extern void * loadPluginTranslation_clock_helper;
#include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch
extern void * loadPluginTranslation_desktopswitch_helper;
#include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu
extern void * loadPluginTranslation_mainmenu_helper;
#include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch
extern void * loadPluginTranslation_quicklaunch_helper;
#include "../plugin-showdesktop/showdesktop.h" // showdesktop
extern void * loadPluginTranslation_showdesktop_helper;
#include "../plugin-spacer/spacer.h" // spacer
extern void * loadPluginTranslation_spacer_helper;
#include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier
extern void * loadPluginTranslation_statusnotifier_helper;
#include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar
extern void * loadPluginTranslation_taskbar_helper;
#include "../plugin-tray/lxqttrayplugin.h" // tray
extern void * loadPluginTranslation_tray_helper;
#include "../plugin-worldclock/lxqtworldclock.h" // worldclock
extern void * loadPluginTranslation_worldclock_helper;
QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255);
@ -119,9 +129,6 @@ Plugin::Plugin(const LXQt::PluginInfo &desktopFile, const QString &settingsFile,
return;
}
// Load plugin translations
LXQt::Translator::translatePlugin(desktopFile.id(), QLatin1String("lxqt-panel"));
setObjectName(mPlugin->themeId() + "Plugin");
// plugin handle for easy context menu
@ -185,50 +192,52 @@ namespace
{
//helper types for static plugins storage & binary search
typedef std::unique_ptr<ILXQtPanelPluginLibrary> plugin_ptr_t;
typedef std::pair<QString, plugin_ptr_t > plugin_pair_t;
typedef std::tuple<QString, plugin_ptr_t, void *> plugin_tuple_t;
//NOTE: Please keep the plugins sorted by name while adding new plugins.
static plugin_pair_t const static_plugins[] = {
//NOTE2: we need to reference some (dummy) symbol from (autogenerated) LXQtPluginTranslationLoader.cpp
// to be not stripped (as unused/unreferenced) in static linking time
static plugin_tuple_t const static_plugins[] = {
#if defined(WITH_CLOCK_PLUGIN)
{ QStringLiteral("clock"), plugin_ptr_t{new LXQtClockPluginLibrary} },// clock
std::make_tuple(QStringLiteral("clock"), plugin_ptr_t{new LXQtClockPluginLibrary}, loadPluginTranslation_clock_helper),// clock
#endif
#if defined(WITH_DESKTOPSWITCH_PLUGIN)
{ QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary} },// desktopswitch
std::make_tuple(QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary}, loadPluginTranslation_desktopswitch_helper),// desktopswitch
#endif
#if defined(WITH_MAINMENU_PLUGIN)
{ QStringLiteral("mainmenu"), plugin_ptr_t{new LXQtMainMenuPluginLibrary} },// mainmenu
std::make_tuple(QStringLiteral("mainmenu"), plugin_ptr_t{new LXQtMainMenuPluginLibrary}, loadPluginTranslation_mainmenu_helper),// mainmenu
#endif
#if defined(WITH_QUICKLAUNCH_PLUGIN)
{ QStringLiteral("quicklaunch"), plugin_ptr_t{new LXQtQuickLaunchPluginLibrary} },// quicklaunch
std::make_tuple(QStringLiteral("quicklaunch"), plugin_ptr_t{new LXQtQuickLaunchPluginLibrary}, loadPluginTranslation_quicklaunch_helper),// quicklaunch
#endif
#if defined(WITH_SHOWDESKTOP_PLUGIN)
{ QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary} },// showdesktop
std::make_tuple(QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary}, loadPluginTranslation_showdesktop_helper),// showdesktop
#endif
#if defined(WITH_SPACER_PLUGIN)
{ QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary} },// spacer
std::make_tuple(QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary}, loadPluginTranslation_spacer_helper),// spacer
#endif
#if defined(WITH_STATUSNOTIFIER_PLUGIN)
{ QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary} },// statusnotifier
std::make_tuple(QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary}, loadPluginTranslation_statusnotifier_helper),// statusnotifier
#endif
#if defined(WITH_TASKBAR_PLUGIN)
{ QStringLiteral("taskbar"), plugin_ptr_t{new LXQtTaskBarPluginLibrary} },// taskbar
std::make_tuple(QStringLiteral("taskbar"), plugin_ptr_t{new LXQtTaskBarPluginLibrary}, loadPluginTranslation_taskbar_helper),// taskbar
#endif
#if defined(WITH_TRAY_PLUGIN)
{ QStringLiteral("tray"), plugin_ptr_t{new LXQtTrayPluginLibrary} },// tray
std::make_tuple(QStringLiteral("tray"), plugin_ptr_t{new LXQtTrayPluginLibrary}, loadPluginTranslation_tray_helper),// tray
#endif
#if defined(WITH_WORLDCLOCK_PLUGIN)
{ QStringLiteral("worldclock"), plugin_ptr_t{new LXQtWorldClockLibrary} },// worldclock
std::make_tuple(QStringLiteral("worldclock"), plugin_ptr_t{new LXQtWorldClockLibrary}, loadPluginTranslation_worldclock_helper),// worldclock
#endif
};
static constexpr plugin_pair_t const * const plugins_begin = static_plugins;
static constexpr plugin_pair_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]);
static constexpr plugin_tuple_t const * const plugins_begin = static_plugins;
static constexpr plugin_tuple_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]);
struct assert_helper
{
assert_helper()
{
Q_ASSERT(std::is_sorted(plugins_begin, plugins_end
, [] (plugin_pair_t const & p1, plugin_pair_t const & p2) -> bool { return p1.first < p2.first; }));
, [] (plugin_tuple_t const & p1, plugin_tuple_t const & p2) -> bool { return std::get<0>(p1) < std::get<0>(p2); }));
}
};
static assert_helper h;
@ -237,10 +246,10 @@ namespace
ILXQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName)
{
// find a static plugin library by name -> binary search
plugin_pair_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName
, [] (plugin_pair_t const & plugin, QString const & name) -> bool { return plugin.first < name; });
if (plugins_end != plugin && libraryName == plugin->first)
return plugin->second.get();
plugin_tuple_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName
, [] (plugin_tuple_t const & plugin, QString const & name) -> bool { return std::get<0>(plugin) < name; });
if (plugins_end != plugin && libraryName == std::get<0>(*plugin))
return std::get<1>(*plugin).get();
return nullptr;
}

@ -30,7 +30,7 @@
#include <QEvent>
CalendarPopup::CalendarPopup(QWidget *parent):
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
{
setLayout(new QHBoxLayout(this));
layout()->setMargin(1);
@ -51,14 +51,6 @@ void CalendarPopup::show()
QDialog::show();
}
bool CalendarPopup::event(QEvent *event)
{
if (event->type() == QEvent::WindowDeactivate)
hide();
return QDialog::event(event);
}
void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday)
{
cal->setFirstDayOfWeek(wday);

@ -42,9 +42,6 @@ public:
void show();
protected:
virtual bool event(QEvent* );
private:
QCalendarWidget *cal;
};

@ -40,20 +40,23 @@ Content::Content(bool layoutEnabled):
box->setSpacing(0);
setLayout(box);
m_capsLock = new QLabel("C");
m_capsLock = new QLabel(tr("C", "Label for CapsLock indicator"));
m_capsLock->setObjectName("CapsLockLabel");
m_capsLock->setAlignment(Qt::AlignCenter);
m_capsLock->setToolTip(tr("CapsLock", "Tooltip for CapsLock indicator"));
m_capsLock->installEventFilter(this);
layout()->addWidget(m_capsLock);
m_numLock = new QLabel("N");
m_numLock = new QLabel(tr("N", "Label for NumLock indicator"));
m_numLock->setObjectName("NumLockLabel");
m_numLock->setToolTip(tr("NumLock", "Tooltip for NumLock indicator"));
m_numLock->setAlignment(Qt::AlignCenter);
m_numLock->installEventFilter(this);
layout()->addWidget(m_numLock);
m_scrollLock = new QLabel("S");
m_scrollLock = new QLabel(tr("S", "Label for ScrollLock indicator"));
m_scrollLock->setObjectName("ScrollLockLabel");
m_scrollLock->setToolTip(tr("ScrollLock", "Tooltip for ScrollLock indicator"));
m_scrollLock->setAlignment(Qt::AlignCenter);
m_scrollLock->installEventFilter(this);
layout()->addWidget(m_scrollLock);

@ -4,12 +4,48 @@
<context>
<name>Content</name>
<message>
<location filename="../src/content.cpp" line="60"/>
<location filename="../src/content.cpp" line="17"/>
<source>C</source>
<comment>Label for CapsLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="20"/>
<source>CapsLock</source>
<comment>Tooltip for CapsLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="24"/>
<source>N</source>
<comment>Label for NumLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="26"/>
<source>NumLock</source>
<comment>Tooltip for NumLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="31"/>
<source>S</source>
<comment>Label for ScrollLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="33"/>
<source>ScrollLock</source>
<comment>Tooltip for ScrollLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="63"/>
<source>Layout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="60"/>
<location filename="../src/content.cpp" line="63"/>
<source>Variant</source>
<translation type="unfinished"></translation>
</message>
@ -18,12 +54,12 @@
<name>KbdStateConfig</name>
<message>
<location filename="../src/kbdstateconfig.ui" line="14"/>
<source>Dialog</source>
<source>Keyboard indicator settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="20"/>
<source>Leds</source>
<source>LEDs</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -73,7 +109,7 @@
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="152"/>
<source>Configure layouts</source>
<source>Configure layouts...</source>
<translation type="unfinished"></translation>
</message>
</context>

@ -4,12 +4,51 @@
<context>
<name>Content</name>
<message>
<location filename="../src/content.cpp" line="60"/>
<location filename="../src/content.cpp" line="43"/>
<source>C</source>
<comment>Label for CapsLock indicator</comment>
<translatorcomment>This capital letter is printed on my keyboard.</translatorcomment>
<translation>A</translation>
</message>
<message>
<location filename="../src/content.cpp" line="46"/>
<source>CapsLock</source>
<comment>Tooltip for CapsLock indicator</comment>
<translation>Großbuchstaben</translation>
</message>
<message>
<location filename="../src/content.cpp" line="50"/>
<source>N</source>
<comment>Label for NumLock indicator</comment>
<translatorcomment>This digit is printed on my keyboard.</translatorcomment>
<translation>1</translation>
</message>
<message>
<location filename="../src/content.cpp" line="52"/>
<source>NumLock</source>
<comment>Tooltip for NumLock indicator</comment>
<translation>Ziffern</translation>
</message>
<message>
<location filename="../src/content.cpp" line="57"/>
<source>S</source>
<comment>Label for ScrollLock indicator</comment>
<translatorcomment>From the word &quot;Rollen&quot;.</translatorcomment>
<translation>R</translation>
</message>
<message>
<location filename="../src/content.cpp" line="59"/>
<source>ScrollLock</source>
<comment>Tooltip for ScrollLock indicator</comment>
<translation>Rollen</translation>
</message>
<message>
<location filename="../src/content.cpp" line="90"/>
<source>Layout</source>
<translation>Layout</translation>
</message>
<message>
<location filename="../src/content.cpp" line="60"/>
<location filename="../src/content.cpp" line="90"/>
<source>Variant</source>
<translation>Variante</translation>
</message>
@ -18,13 +57,13 @@
<name>KbdStateConfig</name>
<message>
<location filename="../src/kbdstateconfig.ui" line="14"/>
<source>Dialog</source>
<translation>Tastatur</translation>
<source>Keyboard state settings</source>
<translation>Tastaturstatus - Einstellungen</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="20"/>
<source>Leds</source>
<translation>LEDs</translation>
<source>Lock Indicators</source>
<translation>Schalteranzeigen</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="26"/>
@ -42,39 +81,34 @@
<translation>Rollen-Taste anzeigen</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="74"/>
<source>Show keyboard layout</source>
<location filename="../src/kbdstateconfig.ui" line="50"/>
<source>Keyboard Layout Indicator</source>
<translation>Tastatur-Layout anzeigen</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="99"/>
<source>Show flags instead labels</source>
<translation>Flaggen statt Kennung anzeigen</translation>
<location filename="../src/kbdstateconfig.ui" line="62"/>
<source>Switching policy</source>
<translation>Umschaltrichtlinie</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="106"/>
<source>Layout mode:</source>
<translation>Layout-Modus:</translation>
<location filename="../src/kbdstateconfig.ui" line="102"/>
<source>Configure layouts</source>
<translation>Layout konfigurieren</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="116"/>
<location filename="../src/kbdstateconfig.ui" line="69"/>
<source>Global</source>
<translation>Global</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="129"/>
<location filename="../src/kbdstateconfig.ui" line="79"/>
<source>Window</source>
<translation>Fenster</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="142"/>
<location filename="../src/kbdstateconfig.ui" line="89"/>
<source>Application</source>
<translation>Anwendung</translation>
</message>
<message>
<location filename="../src/kbdstateconfig.ui" line="152"/>
<source>Configure layouts</source>
<translation>Layout konfigurieren...</translation>
</message>
</context>
</TS>

@ -53,7 +53,7 @@ static bool hasRemovableParent(Solid::Device device)
}
Popup::Popup(ILXQtPanelPlugin * plugin, QWidget* parent):
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint),
QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint),
mPlugin(plugin),
mPlaceholder(nullptr),
mDisplayCount(0)

@ -1,7 +1,7 @@
set(PLUGIN "statusnotifier")
find_package(dbusmenu-qt5 REQUIRED QUIET)
find_package(dbusmenu-qt5 REQUIRED)
set(HEADERS
statusnotifier.h
@ -30,7 +30,6 @@ qt5_add_dbus_adaptor(SOURCES
)
set(LIBRARIES
lxqt
dbusmenu-qt5
)

@ -53,6 +53,7 @@ namespace
{
const char * loc;
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu0");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu1");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu2");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu3");
@ -62,6 +63,7 @@ namespace
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu7");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu8");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu9");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu10");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu11");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu12");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu13");
@ -75,7 +77,6 @@ namespace
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu21");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu22");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu23");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu24");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "memory");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "swap");
static_cast<void>(t);//avoid unused variable warning

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<TS version="2.1">
<context>
<name>LXQtSysStatColours</name>
<message>
@ -113,11 +113,41 @@
</context>
<context>
<name>LXQtSysStatConfiguration</name>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="14"/>
<source>System Statistics Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="22"/>
<source>Graph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="34"/>
<source>&amp;Minimal size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="44"/>
<source>Update &amp;interval</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="54"/>
<source>&amp;Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="64"/>
<source>&amp;Grid lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="80"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimal width if the panel is horizontal.&lt;/p&gt;&lt;p&gt;Minimal height is the panel is vertical.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="83"/>
<source> px</source>
@ -134,103 +164,241 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="14"/>
<source>System Statistics Settings</source>
<location filename="../lxqtsysstatconfiguration.ui" line="149"/>
<source>Use &amp;frequency</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="34"/>
<source>&amp;Minimal size</source>
<location filename="../lxqtsysstatconfiguration.ui" line="207"/>
<source>Ma&amp;ximum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="44"/>
<source>Update &amp;interval</source>
<location filename="../lxqtsysstatconfiguration.ui" line="222"/>
<source>XXX KBs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="54"/>
<source>&amp;Title</source>
<location filename="../lxqtsysstatconfiguration.ui" line="241"/>
<source>Lo&amp;garithmic scale</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="64"/>
<source>&amp;Grid lines</source>
<location filename="../lxqtsysstatconfiguration.ui" line="248"/>
<source> steps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="80"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimal width if the panel is horizontal.&lt;/p&gt;&lt;p&gt;Minimal height is the panel is vertical.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<location filename="../lxqtsysstatconfiguration.ui" line="286"/>
<source>&amp;Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="149"/>
<source>Use &amp;frequency</source>
<location filename="../lxqtsysstatconfiguration.ui" line="296"/>
<source>T&amp;ype</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="207"/>
<source>Ma&amp;ximum</source>
<location filename="../lxqtsysstatconfiguration.ui" line="312"/>
<source>Colours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="241"/>
<source>Lo&amp;garithmic scale</source>
<location filename="../lxqtsysstatconfiguration.ui" line="327"/>
<source>Use t&amp;heme colours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="337"/>
<source>Use c&amp;ustom colours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="290"/>
<location filename="../lxqtsysstatconfiguration.ui" line="344"/>
<source>Custom colour ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="41"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="295"/>
<location filename="../lxqtsysstatconfiguration.cpp" line="42"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="300"/>
<location filename="../lxqtsysstatconfiguration.cpp" line="43"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="308"/>
<source>&amp;Source</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="55"/>
<source>cpu</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="318"/>
<source>T&amp;ype</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="56"/>
<source>cpu0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="334"/>
<source>Colours</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="57"/>
<source>cpu1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="349"/>
<source>Use t&amp;heme colours</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="58"/>
<source>cpu2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="359"/>
<source>Use c&amp;ustom colours</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="59"/>
<source>cpu3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="366"/>
<source>Custom colour ...</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="60"/>
<source>cpu4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="222"/>
<source>XXX KBs</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="61"/>
<source>cpu5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="248"/>
<source> steps</source>
<location filename="../lxqtsysstatconfiguration.cpp" line="62"/>
<source>cpu6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="63"/>
<source>cpu7</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="64"/>
<source>cpu8</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="65"/>
<source>cpu9</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="66"/>
<source>cpu10</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="67"/>
<source>cpu11</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="68"/>
<source>cpu12</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="69"/>
<source>cpu13</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="70"/>
<source>cpu14</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="71"/>
<source>cpu15</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="72"/>
<source>cpu16</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="73"/>
<source>cpu17</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="74"/>
<source>cpu18</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="75"/>
<source>cpu19</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="76"/>
<source>cpu20</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="77"/>
<source>cpu21</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="78"/>
<source>cpu22</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="79"/>
<source>cpu23</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="80"/>
<source>memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="81"/>
<source>swap</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LXQtSysStatContent</name>
<message>
<location filename="../lxqtsysstat.cpp" line="397"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: %5%</source>
<comment>CPU tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="446"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: n/a</source>
<comment>CPU tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="488"/>
<source>apps: %1%&lt;br&gt;buffers: %2%&lt;br&gt;cached: %3%</source>
<comment>Memory tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="522"/>
<source>used: %1%</source>
<comment>Swap tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="552"/>
<source>min: %1%&lt;br&gt;max: %2%</source>
<comment>Network tooltip information</comment>
<translation type="unfinished"></translation>
</message>
</context>

@ -189,49 +189,217 @@
<translation> Schritte</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="290"/>
<source>CPU</source>
<translation>Prozessor</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="295"/>
<source>Memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="300"/>
<source>Network</source>
<translation>Netzwerk</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="308"/>
<location filename="../lxqtsysstatconfiguration.ui" line="286"/>
<source>&amp;Source</source>
<translation>&amp;Quelle</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="318"/>
<location filename="../lxqtsysstatconfiguration.ui" line="296"/>
<source>T&amp;ype</source>
<translation>T&amp;yp</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="334"/>
<location filename="../lxqtsysstatconfiguration.ui" line="312"/>
<source>Colours</source>
<translation>Farben</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="349"/>
<location filename="../lxqtsysstatconfiguration.ui" line="327"/>
<source>Use t&amp;heme colours</source>
<translation>Farben des Farbsc&amp;hemas</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="359"/>
<location filename="../lxqtsysstatconfiguration.ui" line="337"/>
<source>Use c&amp;ustom colours</source>
<translation>&amp;Eigene Farben</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="366"/>
<location filename="../lxqtsysstatconfiguration.ui" line="344"/>
<source>Custom colour ...</source>
<translation>auswählen...</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="41"/>
<source>CPU</source>
<translation>Prozessor</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="42"/>
<source>Memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="43"/>
<source>Network</source>
<translation>Netzwerk</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="55"/>
<source>cpu</source>
<translation>CPU</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="56"/>
<source>cpu0</source>
<translation>CPU0</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="57"/>
<source>cpu1</source>
<translation>CPU1</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="58"/>
<source>cpu2</source>
<translation>CPU2</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="59"/>
<source>cpu3</source>
<translation>CPU3</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="60"/>
<source>cpu4</source>
<translation>CPU4</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="61"/>
<source>cpu5</source>
<translation>CPU5</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="62"/>
<source>cpu6</source>
<translation>CPU6</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="63"/>
<source>cpu7</source>
<translation>CPU7</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="64"/>
<source>cpu8</source>
<translation>CPU8</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="65"/>
<source>cpu9</source>
<translation>CPU9</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="66"/>
<source>cpu10</source>
<translation>CPU10</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="67"/>
<source>cpu11</source>
<translation>CPU11</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="68"/>
<source>cpu12</source>
<translation>CPU12</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="69"/>
<source>cpu13</source>
<translation>CPU13</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="70"/>
<source>cpu14</source>
<translation>CPU14</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="71"/>
<source>cpu15</source>
<translation>CPU15</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="72"/>
<source>cpu16</source>
<translation>CPU16</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="73"/>
<source>cpu17</source>
<translation>CPU17</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="74"/>
<source>cpu18</source>
<translation>CPU18</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="75"/>
<source>cpu19</source>
<translation>CPU19</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="76"/>
<source>cpu20</source>
<translation>CPU20</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="77"/>
<source>cpu21</source>
<translation>CPU21</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="78"/>
<source>cpu22</source>
<translation>CPU22</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="79"/>
<source>cpu23</source>
<translation>CPU23</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="80"/>
<source>memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="81"/>
<source>swap</source>
<translation>Ausgelagert</translation>
</message>
</context>
<context>
<name>LXQtSysStatContent</name>
<message>
<location filename="../lxqtsysstat.cpp" line="397"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: %5%</source>
<comment>CPU tooltip information</comment>
<translation>System: %1%&lt;br&gt;Nutzer: %2%&lt;br&gt;Priorität: %3%&lt;br&gt;Andere: %4%&lt;br&gt;Freq: %5%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="446"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: n/a</source>
<comment>CPU tooltip information</comment>
<translation>System: %1%&lt;br&gt;Nutzer: %2%&lt;br&gt;Priorität: %3%&lt;br&gt;Andere: %4%&lt;br&gt;Freq: n/a</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="488"/>
<source>apps: %1%&lt;br&gt;buffers: %2%&lt;br&gt;cached: %3%</source>
<comment>Memory tooltip information</comment>
<translation>Anwendungen: %1%&lt;br&gt;Puffer: %2%&lt;br&gt;Cache: %3%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="522"/>
<source>used: %1%</source>
<comment>Swap tooltip information</comment>
<translation>Benutzt: %1%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="552"/>
<source>min: %1%&lt;br&gt;max: %2%</source>
<comment>Network tooltip information</comment>
<translation>Min: %1%&lt;br&gt;Max: %2%</translation>
</message>
</context>
</TS>

@ -67,12 +67,11 @@ LXQtGroupPopup::~LXQtGroupPopup()
void LXQtGroupPopup::dropEvent(QDropEvent *event)
{
qlonglong temp;
WId window;
QDataStream stream(event->mimeData()->data(LXQtTaskButton::mimeDataFormat()));
stream >> temp;
window = (WId) temp;
WId window = (WId) temp;
LXQtTaskButton *button;
LXQtTaskButton *button = nullptr;
int oldIndex(0);
// get current position of the button being dragged
for (int i = 0; i < layout()->count(); i++)
@ -86,6 +85,9 @@ void LXQtGroupPopup::dropEvent(QDropEvent *event)
}
}
if (button == nullptr)
return;
int newIndex = -1;
// find the new position to place it in
for (int i = 0; i < oldIndex && newIndex == -1; i++)
@ -109,6 +111,7 @@ void LXQtGroupPopup::dropEvent(QDropEvent *event)
l->takeAt(oldIndex);
l->insertWidget(newIndex, button);
l->invalidate();
}
void LXQtGroupPopup::dragEnterEvent(QDragEnterEvent *event)

@ -140,8 +140,10 @@ bool LXQtTaskBar::acceptWindow(WId window) const
void LXQtTaskBar::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasFormat(LXQtTaskGroup::mimeDataFormat()))
{
event->acceptProposedAction();
else
buttonMove(nullptr, LXQtTaskGroup::mimeDataData(event->mimeData()), event->pos());
} else
event->ignore();
QWidget::dragEnterEvent(event);
}
@ -149,56 +151,70 @@ void LXQtTaskBar::dragEnterEvent(QDragEnterEvent* event)
/************************************************
************************************************/
void LXQtTaskBar::dropEvent(QDropEvent* event)
void LXQtTaskBar::dragMoveEvent(QDragMoveEvent * event)
{
if (!event->mimeData()->hasFormat(LXQtTaskGroup::mimeDataFormat()))
{
event->ignore();
return;
}
//we don't get any dragMoveEvents if dragEnter wasn't accepted
buttonMove(nullptr, LXQtTaskGroup::mimeDataData(event->mimeData()), event->pos());
QWidget::dragMoveEvent(event);
}
QString data;
QDataStream stream(event->mimeData()->data(LXQtTaskGroup::mimeDataFormat()));
stream >> data;
/************************************************
LXQtTaskGroup *group = mGroupsHash.value(data, NULL);
if (!group)
************************************************/
void LXQtTaskBar::buttonMove(LXQtTaskGroup * dst, QString const & srcWindow, QPoint const & pos)
{
LXQtTaskGroup *src_group = mGroupsHash.value(srcWindow, nullptr);
if (!src_group)
{
qDebug() << "Dropped invalid";
return;
}
int droppedIndex = mLayout->indexOf(group);
int newPos = -1;
const int src_index = mLayout->indexOf(src_group);
const int size = mLayout->count();
Q_ASSERT(0 < size);
//dst is nullptr in case the drop occured on empty space in taskbar
int dst_index;
if (nullptr == dst)
{
//moving based on taskbar (not signaled by button)
QRect occupied = mLayout->occupiedGeometry();
QRect last_empty_row{occupied};
if (mPlugin->panel()->isHorizontal())
{
for (int i = 0; i < droppedIndex && newPos == -1; i++)
if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x())
newPos = i;
for (int i = size - 1; i > droppedIndex && newPos == -1; i--)
if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x())
newPos = i;
}
else
last_empty_row.setTopLeft(mLayout->itemAt(size - 1)->geometry().topRight());
} else
{
for (int i = 0; i < droppedIndex && newPos == -1; i++)
if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 > event->pos().y())
newPos = i;
for (int i = size - 1; i > droppedIndex && newPos == -1; i--)
if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 < event->pos().y())
newPos = i;
last_empty_row.setTopLeft(mLayout->itemAt(size - 1)->geometry().bottomLeft());
}
if (newPos == -1 || droppedIndex == newPos)
if (occupied.contains(pos) && !last_empty_row.contains(pos))
return;
mLayout->moveItem(droppedIndex, newPos);
mLayout->invalidate();
dst_index = size;
} else
{
//moving based on signal from child button
dst_index = mLayout->indexOf(dst);
if (mPlugin->panel()->isHorizontal())
{
if (dst->rect().center().x() < pos.x())
++dst_index;
} else
{
if (dst->rect().center().y() < pos.y())
++dst_index;
}
}
//moving lower index to higher one => consider as the QList::move => insert(to, takeAt(from))
if (src_index < dst_index)
--dst_index;
if (dst_index == src_index)
return;
QWidget::dropEvent(event);
mLayout->moveItem(src_index, dst_index, true);
}
/************************************************
@ -229,6 +245,9 @@ void LXQtTaskBar::addWindow(WId window, QString const & groupId)
connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility()));
connect(group, &LXQtTaskGroup::popupShown, this, &LXQtTaskBar::groupPopupShown);
connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList()));
connect(group, &LXQtTaskButton::dragging, this, [this] (QString const & mimeWindow, QPoint const & pos) {
buttonMove(qobject_cast<LXQtTaskGroup *>(sender()), mimeWindow, pos);
});
mLayout->addWidget(group);
mGroupsHash.insert(groupId, group);

@ -82,7 +82,7 @@ public slots:
protected:
virtual void dragEnterEvent(QDragEnterEvent * event);
virtual void dropEvent(QDropEvent * event);
virtual void dragMoveEvent(QDragMoveEvent * event);
private slots:
void refreshIconGeometry();
@ -95,6 +95,7 @@ private slots:
private:
void addWindow(WId window, QString const & groupId);
void buttonMove(LXQtTaskGroup * dst, QString const & srcWindow, QPoint const & pos);
private:
QHash<QString, LXQtTaskGroup*> mGroupsHash;

@ -70,6 +70,17 @@ void LeftAlignedTextStyle::drawItemText(QPainter * painter, const QRect & rect,
}
/************************************************
************************************************/
QString LXQtTaskButton::mimeDataData(QMimeData const * mime)
{
QString data;
QDataStream stream(mime->data(mimeDataFormat()));
stream >> data;
return data;
}
/************************************************
************************************************/
@ -157,31 +168,44 @@ void LXQtTaskButton::refreshIconGeometry(QRect const & geom)
************************************************/
void LXQtTaskButton::dragEnterEvent(QDragEnterEvent *event)
{
// It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called
// on the other hand drop and dragmove events of parent widget won't be called
event->acceptProposedAction();
if (event->mimeData()->hasFormat(mimeDataFormat()))
{
event->ignore();
return;
}
emit dragging(mimeDataData(event->mimeData()), event->pos());
setAttribute(Qt::WA_UnderMouse, false);
} else
{
mDNDTimer->start();
}
// It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called
// on the other hand drop and dragmove events of parent widget won't be called
event->accept();
QToolButton::dragEnterEvent(event);
}
void LXQtTaskButton::dragMoveEvent(QDragMoveEvent * event)
{
if (event->mimeData()->hasFormat(mimeDataFormat()))
{
emit dragging(mimeDataData(event->mimeData()), event->pos());
setAttribute(Qt::WA_UnderMouse, false);
}
}
void LXQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event)
{
mDNDTimer->stop();
event->ignore();
QToolButton::dragLeaveEvent(event);
}
void LXQtTaskButton::dropEvent(QDropEvent *event)
{
mDNDTimer->stop();
event->ignore();
if (event->mimeData()->hasFormat(mimeDataFormat()))
{
emit dropped(mimeDataData(event->mimeData()), event->pos());
setAttribute(Qt::WA_UnderMouse, false);
}
QToolButton::dropEvent(event);
}
@ -241,12 +265,8 @@ void LXQtTaskButton::mouseMoveEvent(QMouseEvent* event)
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData());
//fixme when vertical panel, pixmap is empty
QPixmap pixmap = grab();
drag->setPixmap(pixmap);
drag->setHotSpot(QPoint(mapTo(this, event->pos())));
QIcon ico = icon();
drag->setPixmap(ico.pixmap(ico.actualSize({32, 32})));
sDraggging = true;
drag->exec();

@ -85,6 +85,7 @@ public:
void refreshIconGeometry(QRect const & geom);
static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); }
static QString mimeDataData(QMimeData const * mime);
/*! \return true if this buttom received DragEnter event (and no DragLeave event yet)
* */
bool hasDragAndDropHover() const;
@ -104,6 +105,7 @@ public slots:
protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent * event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event);
void mousePressEvent(QMouseEvent *event);
@ -134,8 +136,8 @@ private slots:
void activateWithDraggable();
signals:
void dropped(QDropEvent * event);
void dragging(bool executing = false);
void dropped(QString const & mimeWindow, QPoint const & pos);
void dragging(QString const & mimeWindow, QPoint const & pos);
};
typedef QHash<WId,LXQtTaskButton*> LXQtTaskButtonHash;

@ -550,13 +550,12 @@ void LXQtTaskGroup::enterEvent(QEvent *event)
************************************************/
void LXQtTaskGroup::dragEnterEvent(QDragEnterEvent *event)
{
sDraggging = true;
// only show the popup if we aren't dragging a taskgroup
if (!event->mimeData()->hasFormat(mimeDataFormat()))
{
setPopupVisible(true);
LXQtTaskButton::dragEnterEvent(event);
}
LXQtTaskButton::dragEnterEvent(event);
}
/************************************************
@ -568,8 +567,6 @@ void LXQtTaskGroup::dragLeaveEvent(QDragLeaveEvent *event)
// do not close the popup
if (!sDraggging)
setPopupVisible(false);
else
sDraggging = false;
LXQtTaskButton::dragLeaveEvent(event);
}

@ -73,8 +73,6 @@ public:
void setPopupVisible(bool visible = true, bool fast = false);
static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskgroup"); }
protected:
QMimeData * mimeData();

@ -542,7 +542,7 @@ void ActiveLabel::mouseReleaseEvent(QMouseEvent* event)
}
LXQtWorldClockPopup::LXQtWorldClockPopup(QWidget *parent) :
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
{
setLayout(new QHBoxLayout(this));
layout()->setMargin(1);
@ -556,7 +556,7 @@ void LXQtWorldClockPopup::show()
bool LXQtWorldClockPopup::event(QEvent *event)
{
if (event->type() == QEvent::WindowDeactivate)
if (event->type() == QEvent::Close)
emit deactivated();
return QDialog::event(event);

Loading…
Cancel
Save