parent
d83d7be5b0
commit
a3ae6e682e
@ -0,0 +1,134 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXQt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "ui_addplugindialog.h"
|
||||
#include "addplugindialog.h"
|
||||
#include "plugin.h"
|
||||
#include "../lxqtpanelapplication.h"
|
||||
|
||||
#include <LXQt/HtmlDelegate>
|
||||
#include <XdgIcon>
|
||||
#include <XdgDirs>
|
||||
|
||||
#include <QString>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidgetItem>
|
||||
#include <QIcon>
|
||||
|
||||
#define SEARCH_ROLE Qt::UserRole
|
||||
#define INDEX_ROLE SEARCH_ROLE+1
|
||||
|
||||
AddPluginDialog::AddPluginDialog(QWidget *parent):
|
||||
QDialog(parent),
|
||||
ui(new Ui::AddPluginDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QStringList desktopFilesDirs;
|
||||
desktopFilesDirs << QString(getenv("LXQT_PANEL_PLUGINS_DIR")).split(':', QString::SkipEmptyParts);
|
||||
desktopFilesDirs << QString("%1/%2").arg(XdgDirs::dataHome(), "/lxqt/lxqt-panel");
|
||||
desktopFilesDirs << PLUGIN_DESKTOPS_DIR;
|
||||
|
||||
mPlugins = LxQt::PluginInfo::search(desktopFilesDirs, QStringLiteral("LxQtPanel/Plugin"), QStringLiteral("*"));
|
||||
std::sort(mPlugins.begin(), mPlugins.end(), [](const LxQt::PluginInfo &p1, const LxQt::PluginInfo &p2) {
|
||||
return p1.name() < p2.name() || (p1.name() == p2.name() && p1.comment() < p2.comment());
|
||||
});
|
||||
|
||||
ui->pluginList->setItemDelegate(new LxQt::HtmlDelegate(QSize(32, 32), ui->pluginList));
|
||||
ui->pluginList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
filter();
|
||||
|
||||
// search
|
||||
mSearchTimer.setInterval(300);
|
||||
mSearchTimer.setSingleShot(true);
|
||||
connect(ui->searchEdit, &QLineEdit::textEdited,
|
||||
&mSearchTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
connect(&mSearchTimer, &QTimer::timeout, this, &AddPluginDialog::filter);
|
||||
connect(ui->pluginList, &QListWidget::doubleClicked, this, &AddPluginDialog::emitPluginSelected);
|
||||
connect(ui->addButton, &QPushButton::clicked, this, &AddPluginDialog::emitPluginSelected);
|
||||
|
||||
connect(dynamic_cast<LxQtPanelApplication *>(qApp), &LxQtPanelApplication::pluginAdded
|
||||
, this, &AddPluginDialog::filter);
|
||||
connect(dynamic_cast<LxQtPanelApplication *>(qApp), &LxQtPanelApplication::pluginRemoved
|
||||
, this, &AddPluginDialog::filter);
|
||||
}
|
||||
|
||||
AddPluginDialog::~AddPluginDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AddPluginDialog::filter()
|
||||
{
|
||||
QListWidget* pluginList = ui->pluginList;
|
||||
|
||||
const int curr_item = 0 < pluginList->count() ? pluginList->currentRow() : 0;
|
||||
pluginList->clear();
|
||||
|
||||
static QIcon fallIco = XdgIcon::fromTheme("preferences-plugin");
|
||||
|
||||
int pluginCount = mPlugins.length();
|
||||
for (int i = 0; i < pluginCount; ++i)
|
||||
{
|
||||
const LxQt::PluginInfo &plugin = mPlugins.at(i);
|
||||
|
||||
QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(),
|
||||
plugin.comment(),
|
||||
plugin.value("Name").toString(),
|
||||
plugin.value("Comment").toString());
|
||||
if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem(ui->pluginList);
|
||||
// disable single-instances plugins already in use
|
||||
if (dynamic_cast<LxQtPanelApplication const *>(qApp)->isPluginSingletonAndRunnig(plugin.id()))
|
||||
{
|
||||
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)")));
|
||||
} else
|
||||
item->setText(QStringLiteral("<b>%1</b><br>%2").arg(plugin.name(), plugin.comment()));
|
||||
item->setIcon(plugin.icon(fallIco));
|
||||
item->setData(INDEX_ROLE, i);
|
||||
}
|
||||
|
||||
if (pluginCount > 0)
|
||||
ui->pluginList->setCurrentRow(curr_item < pluginCount ? curr_item : pluginCount - 1);
|
||||
}
|
||||
|
||||
void AddPluginDialog::emitPluginSelected()
|
||||
{
|
||||
QListWidget* pluginList = ui->pluginList;
|
||||
if (pluginList->currentItem() && pluginList->currentItem()->isSelected())
|
||||
{
|
||||
LxQt::PluginInfo plugin = mPlugins.at(pluginList->currentItem()->data(INDEX_ROLE).toInt());
|
||||
emit pluginSelected(plugin);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXQt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#ifndef LXQT_ADDPLUGINDIALOG_H
|
||||
#define LXQT_ADDPLUGINDIALOG_H
|
||||
|
||||
#include <LXQt/PluginInfo>
|
||||
#include <QDialog>
|
||||
#include <QTimer>
|
||||
|
||||
#define SEARCH_DELAY 125
|
||||
|
||||
namespace Ui {
|
||||
class AddPluginDialog;
|
||||
}
|
||||
|
||||
class AddPluginDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AddPluginDialog(QWidget *parent = 0);
|
||||
~AddPluginDialog();
|
||||
|
||||
signals:
|
||||
void pluginSelected(const LxQt::PluginInfo &plugin);
|
||||
|
||||
private:
|
||||
Ui::AddPluginDialog *ui;
|
||||
LxQt::PluginInfoList mPlugins;
|
||||
QTimer mSearchTimer;
|
||||
|
||||
private slots:
|
||||
void filter();
|
||||
void emitPluginSelected();
|
||||
};
|
||||
|
||||
#endif // LXQT_ADDPLUGINDIALOG_H
|
@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AddPluginDialog</class>
|
||||
<widget class="QDialog" name="AddPluginDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>359</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add Plugins</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="searchLabel">
|
||||
<property name="text">
|
||||
<string>Search:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="searchEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="pluginList">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
<property name="movement">
|
||||
<enum>QListView::Static</enum>
|
||||
</property>
|
||||
<property name="flow">
|
||||
<enum>QListView::TopToBottom</enum>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>QListView::Adjust</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="selectionRectVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentRow">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="text">
|
||||
<string>Add Widget</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeButton">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>pluginList</tabstop>
|
||||
<tabstop>addButton</tabstop>
|
||||
<tabstop>closeButton</tabstop>
|
||||
<tabstop>searchEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>closeButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>AddPluginDialog</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>380</x>
|
||||
<y>279</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>118</x>
|
||||
<y>270</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -1,474 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigPanelWidget</class>
|
||||
<widget class="QWidget" name="ConfigPanelWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>365</width>
|
||||
<height>462</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure panel</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_size">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Size</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="spinBox_panelSize">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="label_iconSize">
|
||||
<property name="text">
|
||||
<string>Icon size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_length">
|
||||
<property name="text">
|
||||
<string>Length:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6">
|
||||
<widget class="QSpinBox" name="spinBox_lineCount">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QSpinBox" name="spinBox_iconSize">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>128</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_length">
|
||||
<property name="toolTip">
|
||||
<string><p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_lenghtType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>px</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QLabel" name="label_lineCount">
|
||||
<property name="text">
|
||||
<string>Rows count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Alignment && position</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="comboBox_alignment">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Center</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_alignment">
|
||||
<property name="text">
|
||||
<string>Alignment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="comboBox_position"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_position">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Styling</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_customFontColor">
|
||||
<property name="text">
|
||||
<string>Custom font color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_customBgImage">
|
||||
<property name="text">
|
||||
<string>Custom background image:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit_customBgImage">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_customBgColor">
|
||||
<property name="text">
|
||||
<string>Custom background color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="pushButton_customBgImage">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="insert-image">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton_customFontColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="color-picker">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_customBgColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="color-picker">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Opacity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="slider_opacity">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customBgColor</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>144</x>
|
||||
<y>332</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>350</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgImage</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>lineEdit_customBgImage</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>137</x>
|
||||
<y>403</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>149</x>
|
||||
<y>440</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgImage</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customBgImage</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>125</x>
|
||||
<y>403</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>441</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customFontColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customFontColor</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>190</x>
|
||||
<y>294</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>312</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>slider_opacity</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>99</x>
|
||||
<y>333</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>114</x>
|
||||
<y>367</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label_2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>34</x>
|
||||
<y>341</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>32</x>
|
||||
<y>362</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -0,0 +1,394 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Marat "Morion" Talipov <morion.self@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "configpanelwidget.h"
|
||||
#include "ui_configpanelwidget.h"
|
||||
|
||||
#include "../lxqtpanellimits.h"
|
||||
|
||||
#include <KWindowSystem/KWindowSystem>
|
||||
#include <QDebug>
|
||||
#include <QListView>
|
||||
#include <QDesktopWidget>
|
||||
#include <QWindow>
|
||||
#include <QColorDialog>
|
||||
#include <QFileDialog>
|
||||
#include <QStandardPaths>
|
||||
|
||||
using namespace LxQt;
|
||||
|
||||
struct ScreenPosition
|
||||
{
|
||||
int screen;
|
||||
ILxQtPanel::Position position;
|
||||
};
|
||||
Q_DECLARE_METATYPE(ScreenPosition)
|
||||
|
||||
ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ConfigPanelWidget),
|
||||
mPanel(panel)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
fillComboBox_position();
|
||||
fillComboBox_alignment();
|
||||
|
||||
mOldPanelSize = mPanel->panelSize();
|
||||
mOldIconSize = mPanel->iconSize();
|
||||
mOldLineCount = mPanel->lineCount();
|
||||
|
||||
mOldLength = mPanel->length();
|
||||
mOldLengthInPercents = mPanel->lengthInPercents();
|
||||
|
||||
mOldAlignment = mPanel->alignment();
|
||||
|
||||
mOldScreenNum = mPanel->screenNum();
|
||||
mScreenNum = mOldScreenNum;
|
||||
|
||||
mOldPosition = mPanel->position();
|
||||
mPosition = mOldPosition;
|
||||
|
||||
mOldHidable = mPanel->hidable();
|
||||
|
||||
ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE);
|
||||
ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE);
|
||||
|
||||
mOldFontColor = mPanel->fontColor();
|
||||
mFontColor = mOldFontColor;
|
||||
mOldBackgroundColor = mPanel->backgroundColor();
|
||||
mBackgroundColor = mOldBackgroundColor;
|
||||
mOldBackgroundImage = mPanel->backgroundImage();
|
||||
mOldOpacity = mPanel->opacity();
|
||||
|
||||
// reset configurations from file
|
||||
reset();
|
||||
|
||||
connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged()));
|
||||
connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged()));
|
||||
connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged()));
|
||||
|
||||
connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged()));
|
||||
connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged()));
|
||||
|
||||
connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged()));
|
||||
connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged()));
|
||||
connect(ui->checkBox_hidable, SIGNAL(toggled(bool)), this, SLOT(editChanged()));
|
||||
|
||||
connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged()));
|
||||
connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor()));
|
||||
connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged()));
|
||||
connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor()));
|
||||
connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged()));
|
||||
connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged()));
|
||||
connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage()));
|
||||
connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged()));
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::reset()
|
||||
{
|
||||
ui->spinBox_panelSize->setValue(mOldPanelSize);
|
||||
ui->spinBox_iconSize->setValue(mOldIconSize);
|
||||
ui->spinBox_lineCount->setValue(mOldLineCount);
|
||||
|
||||
ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition));
|
||||
|
||||
ui->checkBox_hidable->setChecked(mOldHidable);
|
||||
|
||||
fillComboBox_alignment();
|
||||
ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1);
|
||||
|
||||
ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1);
|
||||
widthTypeChanged();
|
||||
ui->spinBox_length->setValue(mOldLength);
|
||||
|
||||
mFontColor.setNamedColor(mOldFontColor.name());
|
||||
ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name()));
|
||||
mBackgroundColor.setNamedColor(mOldBackgroundColor.name());
|
||||
ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name()));
|
||||
ui->lineEdit_customBgImage->setText(mOldBackgroundImage);
|
||||
ui->slider_opacity->setValue(mOldOpacity);
|
||||
|
||||
ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid());
|
||||
ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid());
|
||||
ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists());
|
||||
|
||||
// update position
|
||||
positionChanged();
|
||||
}
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::fillComboBox_position()
|
||||
{
|
||||
int screenCount = QApplication::desktop()->screenCount();
|
||||
if (screenCount == 1)
|
||||
{
|
||||
addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop);
|
||||
addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft);
|
||||
addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight);
|
||||
addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int screenNum = 0; screenNum < screenCount; screenNum++)
|
||||
{
|
||||
if (screenNum)
|
||||
ui->comboBox_position->insertSeparator(9999);
|
||||
|
||||
addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop);
|
||||
addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft);
|
||||
addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight);
|
||||
addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::fillComboBox_alignment()
|
||||
{
|
||||
ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft));
|
||||
ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter));
|
||||
ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight));
|
||||
|
||||
|
||||
if (mPosition == ILxQtPanel::PositionTop ||
|
||||
mPosition == ILxQtPanel::PositionBottom)
|
||||
{
|
||||
ui->comboBox_alignment->setItemText(0, tr("Left"));
|
||||
ui->comboBox_alignment->setItemText(1, tr("Center"));
|
||||
ui->comboBox_alignment->setItemText(2, tr("Right"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->comboBox_alignment->setItemText(0, tr("Top"));
|
||||
ui->comboBox_alignment->setItemText(1, tr("Center"));
|
||||
ui->comboBox_alignment->setItemText(2, tr("Bottom"));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position)
|
||||
{
|
||||
if (LxQtPanel::canPlacedOn(screen, position))
|
||||
ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position}));
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position)
|
||||
{
|
||||
for (int i = 0; i < ui->comboBox_position->count(); i++)
|
||||
{
|
||||
ScreenPosition sp = ui->comboBox_position->itemData(i).value<ScreenPosition>();
|
||||
if (screen == sp.screen && position == sp.position)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
ConfigPanelWidget::~ConfigPanelWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::editChanged()
|
||||
{
|
||||
mPanel->setPanelSize(ui->spinBox_panelSize->value(), true);
|
||||
mPanel->setIconSize(ui->spinBox_iconSize->value(), true);
|
||||
mPanel->setLineCount(ui->spinBox_lineCount->value(), true);
|
||||
|
||||
mPanel->setLength(ui->spinBox_length->value(),
|
||||
ui->comboBox_lenghtType->currentIndex() == 0,
|
||||
true);
|
||||
|
||||
LxQtPanel::Alignment align = LxQtPanel::Alignment(
|
||||
ui->comboBox_alignment->itemData(
|
||||
ui->comboBox_alignment->currentIndex()
|
||||
).toInt());
|
||||
|
||||
mPanel->setAlignment(align, true);
|
||||
mPanel->setPosition(mScreenNum, mPosition, true);
|
||||
mPanel->setHidable(ui->checkBox_hidable->isChecked(), true);
|
||||
|
||||
mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true);
|
||||
if (ui->checkBox_customBgColor->isChecked())
|
||||
{
|
||||
mPanel->setBackgroundColor(mBackgroundColor, true);
|
||||
mPanel->setOpacity(ui->slider_opacity->value(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mPanel->setBackgroundColor(QColor(), true);
|
||||
mPanel->setOpacity(100, true);
|
||||
}
|
||||
|
||||
QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString();
|
||||
mPanel->setBackgroundImage(image, true);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::widthTypeChanged()
|
||||
{
|
||||
int max = getMaxLength();
|
||||
|
||||
if (ui->comboBox_lenghtType->currentIndex() == 0)
|
||||
{
|
||||
// Percents .............................
|
||||
int v = ui->spinBox_length->value() * 100.0 / max;
|
||||
ui->spinBox_length->setRange(1, 100);
|
||||
ui->spinBox_length->setValue(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pixels ...............................
|
||||
int v = max / 100.0 * ui->spinBox_length->value();
|
||||
ui->spinBox_length->setRange(-max, max);
|
||||
ui->spinBox_length->setValue(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
int ConfigPanelWidget::getMaxLength()
|
||||
{
|
||||
QDesktopWidget* dw = QApplication::desktop();
|
||||
|
||||
if (mPosition == ILxQtPanel::PositionTop ||
|
||||
mPosition == ILxQtPanel::PositionBottom)
|
||||
return dw->screenGeometry(mScreenNum).width();
|
||||
else
|
||||
return dw->screenGeometry(mScreenNum).height();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::positionChanged()
|
||||
{
|
||||
ScreenPosition sp = ui->comboBox_position->itemData(
|
||||
ui->comboBox_position->currentIndex()).value<ScreenPosition>();
|
||||
|
||||
bool updateAlig = (sp.position == ILxQtPanel::PositionTop ||
|
||||
sp.position == ILxQtPanel::PositionBottom) !=
|
||||
(mPosition == ILxQtPanel::PositionTop ||
|
||||
mPosition == ILxQtPanel::PositionBottom);
|
||||
|
||||
int oldMax = getMaxLength();
|
||||
mPosition = sp.position;
|
||||
mScreenNum = sp.screen;
|
||||
int newMax = getMaxLength();
|
||||
|
||||
if (ui->comboBox_lenghtType->currentIndex() == 1 &&
|
||||
oldMax != newMax)
|
||||
{
|
||||
// Pixels ...............................
|
||||
int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax;
|
||||
ui->spinBox_length->setMaximum(newMax);
|
||||
ui->spinBox_length->setValue(v);
|
||||
}
|
||||
|
||||
if (updateAlig)
|
||||
fillComboBox_alignment();
|
||||
|
||||
editChanged();
|
||||
}
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::pickFontColor()
|
||||
{
|
||||
QColorDialog d(QColor(mFontColor.name()), this);
|
||||
d.setWindowTitle(tr("Pick color"));
|
||||
d.setWindowModality(Qt::WindowModal);
|
||||
if (d.exec() && d.currentColor().isValid())
|
||||
{
|
||||
mFontColor.setNamedColor(d.currentColor().name());
|
||||
ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name()));
|
||||
editChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::pickBackgroundColor()
|
||||
{
|
||||
QColorDialog d(QColor(mBackgroundColor.name()), this);
|
||||
d.setWindowTitle(tr("Pick color"));
|
||||
d.setWindowModality(Qt::WindowModal);
|
||||
if (d.exec() && d.currentColor().isValid())
|
||||
{
|
||||
mBackgroundColor.setNamedColor(d.currentColor().name());
|
||||
ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name()));
|
||||
editChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************
|
||||
*
|
||||
************************************************/
|
||||
void ConfigPanelWidget::pickBackgroundImage()
|
||||
{
|
||||
QString picturesLocation;
|
||||
picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
||||
|
||||
QFileDialog* d = new QFileDialog(this, tr("Pick image"), picturesLocation, tr("Images (*.png *.gif *.jpg)"));
|
||||
d->setAttribute(Qt::WA_DeleteOnClose);
|
||||
d->setWindowModality(Qt::WindowModal);
|
||||
connect(d, &QFileDialog::fileSelected, ui->lineEdit_customBgImage, &QLineEdit::setText);
|
||||
d->show();
|
||||
}
|
||||
|
@ -0,0 +1,99 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Marat "Morion" Talipov <morion.self@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#ifndef CONFIGPANELWIDGET_H
|
||||
#define CONFIGPANELWIDGET_H
|
||||
|
||||
#include "../lxqtpanel.h"
|
||||
#include <QSettings>
|
||||
#include <QTimer>
|
||||
#include <LXQt/ConfigDialog>
|
||||
|
||||
class LxQtPanel;
|
||||
|
||||
namespace Ui {
|
||||
class ConfigPanelWidget;
|
||||
}
|
||||
|
||||
class ConfigPanelWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0);
|
||||
~ConfigPanelWidget();
|
||||
|
||||
int screenNum() const { return mScreenNum; }
|
||||
ILxQtPanel::Position position() const { return mPosition; }
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
public slots:
|
||||
void reset();
|
||||
|
||||
private slots:
|
||||
void editChanged();
|
||||
void widthTypeChanged();
|
||||
void positionChanged();
|
||||
void pickFontColor();
|
||||
void pickBackgroundColor();
|
||||
void pickBackgroundImage();
|
||||
|
||||
private:
|
||||
Ui::ConfigPanelWidget *ui;
|
||||
LxQtPanel *mPanel;
|
||||
int mScreenNum;
|
||||
ILxQtPanel::Position mPosition;
|
||||
|
||||
void addPosition(const QString& name, int screen, LxQtPanel::Position position);
|
||||
void fillComboBox_position();
|
||||
void fillComboBox_alignment();
|
||||
int indexForPosition(int screen, ILxQtPanel::Position position);
|
||||
int getMaxLength();
|
||||
|
||||
// new values
|
||||
QColor mFontColor;
|
||||
QColor mBackgroundColor;
|
||||
|
||||
// old values for reset
|
||||
int mOldPanelSize;
|
||||
int mOldIconSize;
|
||||
int mOldLineCount;
|
||||
int mOldLength;
|
||||
bool mOldLengthInPercents;
|
||||
LxQtPanel::Alignment mOldAlignment;
|
||||
ILxQtPanel::Position mOldPosition;
|
||||
bool mOldHidable;
|
||||
int mOldScreenNum;
|
||||
QColor mOldFontColor;
|
||||
QColor mOldBackgroundColor;
|
||||
QString mOldBackgroundImage;
|
||||
int mOldOpacity;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,619 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigPanelWidget</class>
|
||||
<widget class="QWidget" name="ConfigPanelWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<height>397</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure panel</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_size">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Size</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_8" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spinBox_length">
|
||||
<property name="toolTip">
|
||||
<string><p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_length">
|
||||
<property name="text">
|
||||
<string>Length:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="comboBox_lenghtType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>px</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="spinBox_panelSize">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_9" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spinBox_iconSize">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>128</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_iconSize">
|
||||
<property name="text">
|
||||
<string>Icon size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_lineCount">
|
||||
<property name="text">
|
||||
<string>Rows count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spinBox_lineCount">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Alignment && position</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_position">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="comboBox_position"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_alignment">
|
||||
<property name="text">
|
||||
<string>Alignment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QWidget" name="widget_7" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_alignment">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Center</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>15</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_hidable">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-hide</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Custom styling</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="5">
|
||||
<widget class="QWidget" name="widget_6" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_customFontColor">
|
||||
<property name="text">
|
||||
<string>Font color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_customFontColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="color-picker">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_customBgColor">
|
||||
<property name="text">
|
||||
<string>Background color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_customBgColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="color-picker">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Background opacity:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="slider_opacity">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="5">
|
||||
<widget class="QLabel" name="compositingL">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><small>Compositing is required for panel transparency.</small></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_customBgImage">
|
||||
<property name="text">
|
||||
<string>Background image:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_customBgImage">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_customBgImage">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="insert-image">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customBgColor</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>144</x>
|
||||
<y>332</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>350</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgImage</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>lineEdit_customBgImage</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>137</x>
|
||||
<y>403</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>149</x>
|
||||
<y>440</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgImage</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customBgImage</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>125</x>
|
||||
<y>403</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>441</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customFontColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>pushButton_customFontColor</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>190</x>
|
||||
<y>294</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>312</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>slider_opacity</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>99</x>
|
||||
<y>333</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>114</x>
|
||||
<y>367</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label_2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>34</x>
|
||||
<y>341</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>32</x>
|
||||
<y>362</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_customBgColor</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>compositingL</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -0,0 +1,119 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://lxqt.org
|
||||
*
|
||||
* Copyright: 2015 LXQt team
|
||||
* Authors:
|
||||
* Paulo Lieuthier <paulolieuthier@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "configpluginswidget.h"
|
||||
#include "ui_configpluginswidget.h"
|
||||
#include "addplugindialog.h"
|
||||
#include "panelpluginsmodel.h"
|
||||
#include "../plugin.h"
|
||||
#include "../ilxqtpanelplugin.h"
|
||||
|
||||
#include <HtmlDelegate>
|
||||
#include <QPushButton>
|
||||
#include <QItemSelectionModel>
|
||||
|
||||
ConfigPluginsWidget::ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ConfigPluginsWidget),
|
||||
mPanel(panel)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
PanelPluginsModel * plugins = mPanel->mPlugins.data();
|
||||
{
|
||||
QScopedPointer<QItemSelectionModel> m(ui->listView_plugins->selectionModel());
|
||||
ui->listView_plugins->setModel(plugins);
|
||||
}
|
||||
{
|
||||
QScopedPointer<QAbstractItemDelegate> d(ui->listView_plugins->itemDelegate());
|
||||
ui->listView_plugins->setItemDelegate(new LxQt::HtmlDelegate(QSize(16, 16), ui->listView_plugins));
|
||||
}
|
||||
|
||||
resetButtons();
|
||||
|
||||
connect(ui->listView_plugins, &QListView::activated, plugins, &PanelPluginsModel::onActivatedIndex);
|
||||
connect(ui->listView_plugins->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||
this, &ConfigPluginsWidget::resetButtons);
|
||||
|
||||
connect(ui->pushButton_moveUp, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginUp);
|
||||
connect(ui->pushButton_moveDown, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginDown);
|
||||
|
||||
connect(ui->pushButton_addPlugin, &QPushButton::clicked, this, &ConfigPluginsWidget::showAddPluginDialog);
|
||||
connect(ui->pushButton_removePlugin, &QToolButton::clicked, plugins, &PanelPluginsModel::onRemovePlugin);
|
||||
|
||||
connect(ui->pushButton_pluginConfig, &QToolButton::clicked, plugins, &PanelPluginsModel::onConfigurePlugin);
|
||||
|
||||
connect(plugins, &PanelPluginsModel::pluginAdded, this, &ConfigPluginsWidget::resetButtons);
|
||||
connect(plugins, &PanelPluginsModel::pluginRemoved, this, &ConfigPluginsWidget::resetButtons);
|
||||
connect(plugins, &PanelPluginsModel::pluginMoved, this, &ConfigPluginsWidget::resetButtons);
|
||||
}
|
||||
|
||||
ConfigPluginsWidget::~ConfigPluginsWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ConfigPluginsWidget::reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ConfigPluginsWidget::showAddPluginDialog()
|
||||
{
|
||||
if (mAddPluginDialog.isNull())
|
||||
{
|
||||
mAddPluginDialog.reset(new AddPluginDialog);
|
||||
connect(mAddPluginDialog.data(), &AddPluginDialog::pluginSelected,
|
||||
mPanel->mPlugins.data(), &PanelPluginsModel::addPlugin);
|
||||
}
|
||||
mAddPluginDialog->show();
|
||||
mAddPluginDialog->raise();
|
||||
mAddPluginDialog->activateWindow();
|
||||
}
|
||||
|
||||
void ConfigPluginsWidget::resetButtons()
|
||||
{
|
||||
PanelPluginsModel *model = mPanel->mPlugins.data();
|
||||
QItemSelectionModel *selectionModel = ui->listView_plugins->selectionModel();
|
||||
bool hasSelection = selectionModel->hasSelection();
|
||||
bool isFirstSelected = selectionModel->isSelected(model->index(0));
|
||||
bool isLastSelected = selectionModel->isSelected(model->index(model->rowCount() - 1));
|
||||
|
||||
bool hasConfigDialog = false;
|
||||
if (hasSelection)
|
||||
{
|
||||
Plugin const * plugin
|
||||
= ui->listView_plugins->model()->data(selectionModel->currentIndex(), Qt::UserRole).value<Plugin const *>();
|
||||
if (nullptr != plugin)
|
||||
hasConfigDialog = plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::HaveConfigDialog);
|
||||
}
|
||||
|
||||
ui->pushButton_removePlugin->setEnabled(hasSelection);
|
||||
ui->pushButton_moveUp->setEnabled(hasSelection && !isFirstSelected);
|
||||
ui->pushButton_moveDown->setEnabled(hasSelection && !isLastSelected);
|
||||
ui->pushButton_pluginConfig->setEnabled(hasSelection && hasConfigDialog);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://lxqt.org
|
||||
*
|
||||
* Copyright: 2015 LXQt team
|
||||
* Authors:
|
||||
* Paulo Lieuthier <paulolieuthier@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#ifndef CONFIGPLUGINSWIDGET_H
|
||||
#define CONFIGPLUGINSWIDGET_H
|
||||
|
||||
#include "../lxqtpanel.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigPluginsWidget;
|
||||
}
|
||||
class AddPluginDialog;
|
||||
|
||||
class ConfigPluginsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent = 0);
|
||||
~ConfigPluginsWidget();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
public slots:
|
||||
void reset();
|
||||
|
||||
private slots:
|
||||
void showAddPluginDialog();
|
||||
void resetButtons();
|
||||
|
||||
private:
|
||||
Ui::ConfigPluginsWidget *ui;
|
||||
QScopedPointer<AddPluginDialog> mAddPluginDialog;
|
||||
LxQtPanel *mPanel;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigPluginsWidget</class>
|
||||
<widget class="QWidget" name="ConfigPluginsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>339</width>
|
||||
<height>220</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure Plugins</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="listView_plugins">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
<property name="flow">
|
||||
<enum>QListView::TopToBottom</enum>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>QListView::Adjust</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="selectionRectVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Note: changes made in this page cannot be reset.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_5" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushButton_moveUp">
|
||||
<property name="toolTip">
|
||||
<string>Move up</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-up">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushButton_moveDown">
|
||||
<property name="toolTip">
|
||||
<string>Move down</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-down">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushButton_addPlugin">
|
||||
<property name="toolTip">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-add">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushButton_removePlugin">
|
||||
<property name="toolTip">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushButton_pluginConfig">
|
||||
<property name="toolTip">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="preferences-other">
|
||||
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,331 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXQt - a lightweight, Qt based, desktop toolset
|
||||
* http://lxqt.org
|
||||
*
|
||||
* Copyright: 2015 LXQt team
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "panelpluginsmodel.h"
|
||||
#include "plugin.h"
|
||||
#include "ilxqtpanelplugin.h"
|
||||
#include "lxqtpanel.h"
|
||||
#include "lxqtpanelapplication.h"
|
||||
#include <QPointer>
|
||||
#include <XdgIcon>
|
||||
#include <LXQt/Settings>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
PanelPluginsModel::PanelPluginsModel(LxQtPanel * panel,
|
||||
QString const & namesKey,
|
||||
QStringList const & desktopDirs,
|
||||
QObject * parent/* = nullptr*/)
|
||||
: QAbstractListModel{parent},
|
||||
mNamesKey(namesKey),
|
||||
mPanel(panel)
|
||||
{
|
||||
loadPlugins(desktopDirs);
|
||||
}
|
||||
|
||||
PanelPluginsModel::~PanelPluginsModel()
|
||||
{
|
||||
qDeleteAll(plugins());
|
||||
}
|
||||
|
||||
int PanelPluginsModel::rowCount(const QModelIndex & parent/* = QModelIndex()*/) const
|
||||
{
|
||||
return QModelIndex() == parent ? mPlugins.size() : 0;
|
||||
}
|
||||
|
||||
|
||||
QVariant PanelPluginsModel::data(const QModelIndex & index, int role/* = Qt::DisplayRole*/) const
|
||||
{
|
||||
Q_ASSERT(QModelIndex() == index.parent()
|
||||
&& 0 == index.column()
|
||||
&& mPlugins.size() > index.row()
|
||||
);
|
||||
|
||||
pluginslist_t::const_reference plugin = mPlugins[index.row()];
|
||||
QVariant ret;
|
||||
switch (role)
|
||||
{
|
||||
case Qt::DisplayRole:
|
||||
if (plugin.second.isNull())
|
||||
ret = QStringLiteral("<b>Unknown</b> (%1)").arg(plugin.first);
|
||||
else
|
||||
ret = QStringLiteral("<b>%1</b> (%2)").arg(plugin.second->name(), plugin.first);
|
||||
break;
|
||||
case Qt::DecorationRole:
|
||||
if (plugin.second.isNull())
|
||||
ret = XdgIcon::fromTheme("preferences-plugin");
|
||||
else
|
||||
ret = plugin.second->desktopFile().icon(XdgIcon::fromTheme("preferences-plugin"));
|
||||
break;
|
||||
case Qt::UserRole:
|
||||
ret = QVariant::fromValue(const_cast<Plugin const *>(plugin.second.data()));
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Qt::ItemFlags PanelPluginsModel::flags(const QModelIndex & index) const
|
||||
{
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemNeverHasChildren;
|
||||
}
|
||||
|
||||
QStringList PanelPluginsModel::pluginNames() const
|
||||
{
|
||||
QStringList names;
|
||||
for (auto const & p : mPlugins)
|
||||
names.append(p.first);
|
||||
return std::move(names);
|
||||
}
|
||||
|
||||
QList<Plugin *> PanelPluginsModel::plugins() const
|
||||
{
|
||||
QList<Plugin *> plugins;
|
||||
for (auto const & p : mPlugins)
|
||||
if (!p.second.isNull())
|
||||
plugins.append(p.second.data());
|
||||
return std::move(plugins);
|
||||
}
|
||||
|
||||
Plugin* PanelPluginsModel::pluginByName(QString name) const
|
||||
{
|
||||
for (auto const & p : mPlugins)
|
||||
if (p.first == name)
|
||||
return p.second.data();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Plugin const * PanelPluginsModel::pluginByID(QString id) const
|
||||
{
|
||||
for (auto const & p : mPlugins)
|
||||
{
|
||||
Plugin *plugin = p.second.data();
|
||||
if (plugin && plugin->desktopFile().id() == id)
|
||||
return plugin;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PanelPluginsModel::addPlugin(const LxQt::PluginInfo &desktopFile)
|
||||
{
|
||||
if (dynamic_cast<LxQtPanelApplication const *>(qApp)->isPluginSingletonAndRunnig(desktopFile.id()))
|
||||
return;
|
||||
|
||||
QString name = findNewPluginSettingsGroup(desktopFile.id());
|
||||
|
||||
QPointer<Plugin> plugin = loadPlugin(desktopFile, name);
|
||||
if (plugin.isNull())
|
||||
return;
|
||||
|
||||
beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size());
|
||||
mPlugins.append({name, plugin});
|
||||
endInsertRows();
|
||||
mPanel->settings()->setValue(mNamesKey, pluginNames());
|
||||
emit pluginAdded(plugin.data());
|
||||
}
|
||||
|
||||
void PanelPluginsModel::removePlugin(pluginslist_t::iterator plugin)
|
||||
{
|
||||
if (mPlugins.end() != plugin)
|
||||
{
|
||||
mPanel->settings()->remove(plugin->first);
|
||||
Plugin * p = plugin->second.data();
|
||||
const int row = plugin - mPlugins.begin();
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
mPlugins.erase(plugin);
|
||||
endRemoveRows();
|
||||
mActive = mPlugins.isEmpty() ? QModelIndex() : createIndex(mPlugins.size() > row ? row : row - 1, 0);
|
||||
emit pluginRemoved(p); // p can be nullptr
|
||||
mPanel->settings()->setValue(mNamesKey, pluginNames());
|
||||
if (nullptr != p)
|
||||
p->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
void PanelPluginsModel::removePlugin()
|
||||
{
|
||||
Plugin * p = qobject_cast<Plugin*>(sender());
|
||||
auto plugin = std::find_if(mPlugins.begin(), mPlugins.end(),
|
||||
[p] (pluginslist_t::const_reference obj) { return p == obj.second; });
|
||||
removePlugin(std::move(plugin));
|
||||
}
|
||||
|
||||
void PanelPluginsModel::movePlugin(Plugin * plugin, QString const & nameAfter)
|
||||
{
|
||||
//merge list of plugins (try to preserve original position)
|
||||
const int from =
|
||||
std::find_if(mPlugins.begin(), mPlugins.end(), [plugin] (pluginslist_t::const_reference obj) { return plugin == obj.second.data(); })
|
||||
- mPlugins.begin();
|
||||
const int to =
|
||||
std::find_if(mPlugins.begin(), mPlugins.end(), [nameAfter] (pluginslist_t::const_reference obj) { return nameAfter == obj.first; })
|
||||
- mPlugins.begin();
|
||||
const int to_plugins = from < to ? to - 1 : to;
|
||||
|
||||
if (from != to && from != to_plugins)
|
||||
{
|
||||
beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
|
||||
mPlugins.move(from, to_plugins);
|
||||
endMoveRows();
|
||||
emit pluginMoved(plugin);
|
||||
mPanel->settings()->setValue(mNamesKey, pluginNames());
|
||||
}
|
||||
}
|
||||
|
||||
void PanelPluginsModel::loadPlugins(QStringList const & desktopDirs)
|
||||
{
|
||||
QStringList plugin_names = mPanel->settings()->value(mNamesKey).toStringList();
|
||||
|
||||
#ifdef DEBUG_PLUGIN_LOADTIME
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
qint64 lastTime = 0;
|
||||
#endif
|
||||
for (auto const & name : plugin_names)
|
||||
{
|
||||
pluginslist_t::iterator i = mPlugins.insert(mPlugins.end(), {name, nullptr});
|
||||
QString type = mPanel->settings()->value(name + "/type").toString();
|
||||
if (type.isEmpty())
|
||||
{
|
||||
qWarning() << QString("Section \"%1\" not found in %2.").arg(name, mPanel->settings()->fileName());
|
||||
continue;
|
||||
}
|
||||
|
||||
LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type));
|
||||
if( !list.count())
|
||||
{
|
||||
qWarning() << QString("Plugin \"%1\" not found.").arg(type);
|
||||
continue;
|
||||
}
|
||||
|
||||
i->second = loadPlugin(list.first(), name);
|
||||
#ifdef DEBUG_PLUGIN_LOADTIME
|
||||
qDebug() << "load plugin" << type << "takes" << (timer.elapsed() - lastTime) << "ms";
|
||||
lastTime = timer.elapsed();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
QPointer<Plugin> PanelPluginsModel::loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup)
|
||||
{
|
||||
std::unique_ptr<Plugin> plugin(new Plugin(desktopFile, mPanel->settings()->fileName(), settingsGroup, mPanel));
|
||||
if (plugin->isLoaded())
|
||||
{
|
||||
connect(mPanel, &LxQtPanel::realigned, plugin.get(), &Plugin::realign);
|
||||
connect(plugin.get(), &Plugin::remove,
|
||||
this, static_cast<void (PanelPluginsModel::*)()>(&PanelPluginsModel::removePlugin));
|
||||
return plugin.release();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType) const
|
||||
{
|
||||
QStringList groups = mPanel->settings()->childGroups();
|
||||
groups.sort();
|
||||
|
||||
// Generate new section name
|
||||
for (int i = 2; true; ++i)
|
||||
if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i)))
|
||||
return QStringLiteral("%1%2").arg(pluginType).arg(i);
|
||||
}
|
||||
|
||||
void PanelPluginsModel::onActivatedIndex(QModelIndex const & index)
|
||||
{
|
||||
mActive = index;
|
||||
}
|
||||
|
||||
bool PanelPluginsModel::isActiveIndexValid() const
|
||||
{
|
||||
return mActive.isValid() && QModelIndex() == mActive.parent()
|
||||
&& 0 == mActive.column() && mPlugins.size() > mActive.row();
|
||||
}
|
||||
|
||||
void PanelPluginsModel::onMovePluginUp()
|
||||
{
|
||||
if (!isActiveIndexValid())
|
||||
return;
|
||||
|
||||
const int row = mActive.row();
|
||||
if (0 >= row)
|
||||
return; //can't move up
|
||||
|
||||
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1);
|
||||
mPlugins.swap(row - 1, row);
|
||||
endMoveRows();
|
||||
pluginslist_t::const_reference moved_plugin = mPlugins[row - 1];
|
||||
pluginslist_t::const_reference prev_plugin = mPlugins[row];
|
||||
|
||||
emit pluginMoved(moved_plugin.second.data());
|
||||
//emit signal for layout only in case both plugins are loaded/displayed
|
||||
if (!moved_plugin.second.isNull() && !prev_plugin.second.isNull())
|
||||
emit pluginMovedUp(moved_plugin.second.data());
|
||||
|
||||
mPanel->settings()->setValue(mNamesKey, pluginNames());
|
||||
}
|
||||
|
||||
void PanelPluginsModel::onMovePluginDown()
|
||||
{
|
||||
if (!isActiveIndexValid())
|
||||
return;
|
||||
|
||||
const int row = mActive.row();
|
||||
if (mPlugins.size() <= row + 1)
|
||||
return; //can't move down
|
||||
|
||||
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2);
|
||||
mPlugins.swap(row, row + 1);
|
||||
endMoveRows();
|
||||
pluginslist_t::const_reference moved_plugin = mPlugins[row + 1];
|
||||
pluginslist_t::const_reference next_plugin = mPlugins[row];
|
||||
|
||||
emit pluginMoved(moved_plugin.second.data());
|
||||
//emit signal for layout only in case both plugins are loaded/displayed
|
||||
if (!moved_plugin.second.isNull() && !next_plugin.second.isNull())
|
||||
emit pluginMovedUp(next_plugin.second.data());
|
||||
|
||||
mPanel->settings()->setValue(mNamesKey, pluginNames());
|
||||
}
|
||||
|
||||
void PanelPluginsModel::onConfigurePlugin()
|
||||
{
|
||||
if (!isActiveIndexValid())
|
||||
return;
|
||||
|
||||
Plugin * const plugin = mPlugins[mActive.row()].second.data();
|
||||
if (nullptr != plugin && (ILxQtPanelPlugin::HaveConfigDialog & plugin->iPlugin()->flags()))
|
||||
plugin->showConfigureDialog();
|
||||
}
|
||||
|
||||
void PanelPluginsModel::onRemovePlugin()
|
||||
{
|
||||
if (!isActiveIndexValid())
|
||||
return;
|
||||
|
||||
auto plugin = mPlugins.begin() + mActive.row();
|
||||
if (plugin->second.isNull())
|
||||
removePlugin(std::move(plugin));
|
||||
else
|
||||
plugin->second->requestRemove();
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXQt - a lightweight, Qt based, desktop toolset
|
||||
* http://lxqt.org
|
||||
*
|
||||
* Copyright: 2015 LXQt team
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#ifndef PANELPLUGINSMODEL_H
|
||||
#define PANELPLUGINSMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <memory>
|
||||
|
||||
namespace LxQt
|
||||
{
|
||||
class PluginInfo;
|
||||
struct PluginData;
|
||||
}
|
||||
|
||||
class LxQtPanel;
|
||||
class Plugin;
|
||||
|
||||
class PanelPluginsModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PanelPluginsModel(LxQtPanel * panel,
|
||||
QString const & namesKey,
|
||||
QStringList const & desktopDirs,
|
||||
QObject * parent = nullptr);
|
||||
~PanelPluginsModel();
|
||||
|
||||
virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override;
|
||||
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex & index) const override;
|
||||
|
||||
QStringList pluginNames() const;
|
||||
QList<Plugin *> plugins() const;
|
||||
Plugin *pluginByName(QString name) const;
|
||||
Plugin const *pluginByID(QString id) const;
|
||||
|
||||
/*!
|
||||
* \param plugin plugin that has been moved
|
||||
* \param nameAfter name of plugin that is right after moved plugin
|
||||
*/
|
||||
void movePlugin(Plugin * plugin, QString const & nameAfter);
|
||||
|
||||
signals:
|
||||
void pluginAdded(Plugin * plugin);
|
||||
void pluginRemoved(Plugin * plugin);
|
||||
void pluginMoved(Plugin * plugin); //plugin can be nullptr in case of move of not loaded plugin
|
||||
/*!
|
||||
* Emiting only move-up for simplification of using (and problematic layout/list move)
|
||||
*/
|
||||
void pluginMovedUp(Plugin * plugin);
|
||||
|
||||
public slots:
|
||||
void addPlugin(const LxQt::PluginInfo &desktopFile);
|
||||
void removePlugin();
|
||||
|
||||
// slots for configuration dialog
|
||||
void onActivatedIndex(QModelIndex const & index);
|
||||
void onMovePluginUp();
|
||||
void onMovePluginDown();
|
||||
void onConfigurePlugin();
|
||||
void onRemovePlugin();
|
||||
|
||||
private:
|
||||
typedef QList<QPair <QString/*name*/, QPointer<Plugin> > > pluginslist_t;
|
||||
|
||||
private:
|
||||
void loadPlugins(QStringList const & desktopDirs);
|
||||
QPointer<Plugin> loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup);
|
||||
QString findNewPluginSettingsGroup(const QString &pluginType) const;
|
||||
bool isActiveIndexValid() const;
|
||||
void removePlugin(pluginslist_t::iterator plugin);
|
||||
|
||||
const QString mNamesKey;
|
||||
pluginslist_t mPlugins;
|
||||
LxQtPanel * mPanel;
|
||||
QPersistentModelIndex mActive;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Plugin const *)
|
||||
|
||||
#endif // PANELPLUGINSMODEL_H
|
@ -1,353 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>ConfigPanelDialog</name>
|
||||
<message>
|
||||
<source>Configure panel</source>
|
||||
<translation type="vanished">Panel konfigurieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Panel size</source>
|
||||
<translation type="vanished">Panelgröße</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Size:</source>
|
||||
<translation type="vanished">Größe:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>px</source>
|
||||
<translation type="vanished">px</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use automatic sizing</source>
|
||||
<translation type="vanished">Größe automatisch anpassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Panel length && position</source>
|
||||
<translation type="vanished">Panel Länge && Position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left</source>
|
||||
<translation type="vanished">Links</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Center</source>
|
||||
<translation type="vanished">Mitte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right</source>
|
||||
<translation type="vanished">Rechts</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%</source>
|
||||
<translation type="vanished">%</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alignment:</source>
|
||||
<translation type="vanished">Ausrichtung:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Length:</source>
|
||||
<translation type="vanished">Länge:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Position:</source>
|
||||
<translation type="vanished">Position:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Top of desktop</source>
|
||||
<translation type="vanished">Oben auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left of desktop</source>
|
||||
<translation type="vanished">Links auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right of desktop</source>
|
||||
<translation type="vanished">Rechts auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bottom of desktop</source>
|
||||
<translation type="vanished">Unten auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Top of desktop %1</source>
|
||||
<translation type="vanished">Oben auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left of desktop %1</source>
|
||||
<translation type="vanished">Links auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right of desktop %1</source>
|
||||
<translation type="vanished">Rechts auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bottom of desktop %1</source>
|
||||
<translation type="vanished">Unten auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="80"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="86"/>
|
||||
<source>Configure Panel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConfigPanelWidget</name>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="20"/>
|
||||
<source>Configure panel</source>
|
||||
<translation type="unfinished">Panel konfigurieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="32"/>
|
||||
<source>Size</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="41"/>
|
||||
<source>Size:</source>
|
||||
<translation type="unfinished">Größe:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="48"/>
|
||||
<location filename="../config/configpaneldialog.ui" line="82"/>
|
||||
<source> px</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="58"/>
|
||||
<source>Icon size:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="65"/>
|
||||
<source>Length:</source>
|
||||
<translation type="unfinished">Länge:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="110"/>
|
||||
<source><p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="124"/>
|
||||
<source>%</source>
|
||||
<translation type="unfinished">%</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="129"/>
|
||||
<source>px</source>
|
||||
<translation type="unfinished">px</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="140"/>
|
||||
<source>Rows count:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="172"/>
|
||||
<source>Alignment && position</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="182"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="229"/>
|
||||
<source>Left</source>
|
||||
<translation type="unfinished">Links</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="187"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="230"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="236"/>
|
||||
<source>Center</source>
|
||||
<translation type="unfinished">Mitte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="192"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="231"/>
|
||||
<source>Right</source>
|
||||
<translation type="unfinished">Rechts</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="200"/>
|
||||
<source>Alignment:</source>
|
||||
<translation type="unfinished">Ausrichtung:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="210"/>
|
||||
<source>Position:</source>
|
||||
<translation type="unfinished">Position:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="226"/>
|
||||
<source>Styling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="232"/>
|
||||
<source>Custom font color:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="239"/>
|
||||
<source>Custom background image:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="253"/>
|
||||
<source>Custom background color:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.ui" line="344"/>
|
||||
<source>Opacity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="195"/>
|
||||
<source>Top of desktop</source>
|
||||
<translation type="unfinished">Oben auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="196"/>
|
||||
<source>Left of desktop</source>
|
||||
<translation type="unfinished">Links auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="197"/>
|
||||
<source>Right of desktop</source>
|
||||
<translation type="unfinished">Rechts auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="198"/>
|
||||
<source>Bottom of desktop</source>
|
||||
<translation type="unfinished">Unten auf dem Desktop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="207"/>
|
||||
<source>Top of desktop %1</source>
|
||||
<translation type="unfinished">Oben auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="208"/>
|
||||
<source>Left of desktop %1</source>
|
||||
<translation type="unfinished">Links auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="209"/>
|
||||
<source>Right of desktop %1</source>
|
||||
<translation type="unfinished">Rechts auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="210"/>
|
||||
<source>Bottom of desktop %1</source>
|
||||
<translation type="unfinished">Unten auf dem Desktop %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="235"/>
|
||||
<source>Top</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="237"/>
|
||||
<source>Bottom</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="391"/>
|
||||
<location filename="../config/configpaneldialog.cpp" line="405"/>
|
||||
<source>Pick color</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../config/configpaneldialog.cpp" line="425"/>
|
||||
<source>Images (*.png *.gif *.jpg)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LxQtPanel</name>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="605"/>
|
||||
<source>Add Panel Widgets</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="929"/>
|
||||
<location filename="../lxqtpanel.cpp" line="948"/>
|
||||
<source>Panel</source>
|
||||
<translation>Anwendungsmenü</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="950"/>
|
||||
<source>Configure Panel...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="955"/>
|
||||
<source>Add Panel Widgets...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="960"/>
|
||||
<source>Add Panel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtpanel.cpp" line="966"/>
|
||||
<source>Remove Panel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure panel...</source>
|
||||
<translation type="vanished">Konfiguriere Panel...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add plugins ...</source>
|
||||
<translation type="vanished">Plugins hinzufügen ...</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LxQtPanelPlugin</name>
|
||||
<message>
|
||||
<source>Configure</source>
|
||||
<translation type="vanished">Konfigurieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Move</source>
|
||||
<translation type="vanished">Bewegen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="vanished">Entfernen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LxQtPanelPrivate</name>
|
||||
<message>
|
||||
<source>Configure panel</source>
|
||||
<translation type="vanished">Panel konfigurieren</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Plugin</name>
|
||||
<message>
|
||||
<location filename="../plugin.cpp" line="309"/>
|
||||
<source>Configure "%1"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugin.cpp" line="314"/>
|
||||
<source>Move "%1"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugin.cpp" line="320"/>
|
||||
<source>Remove "%1"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -1,12 +1,2 @@
|
||||
[Desktop Entry]
|
||||
Type=Service
|
||||
ServiceTypes=LxQtPanel/Plugin
|
||||
Name=Date & time
|
||||
Comment=Displays the current time. Comes with a calendar.
|
||||
|
||||
#TRANSLATIONS_DIR=../translations
|
||||
|
||||
|
||||
# Translations
|
||||
Comment[de]=Uhr und Kalender
|
||||
Name[de]=Uhr
|
||||
Name[de]=Uhr und Kalender
|
||||
Comment[de]=Zeigt die aktuelle Uhrzeit. Ein Kalender ist auch enthalten.
|
||||
|
@ -1,12 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Service
|
||||
ServiceTypes=LxQtPanel/Plugin
|
||||
Name=Date & time
|
||||
Comment=Displays the current time. Comes with a calendar.
|
||||
|
||||
#TRANSLATIONS_DIR=../translations
|
||||
|
||||
|
||||
# Translations
|
||||
Comment[de_DE]=Uhr und Kalender
|
||||
Name[de_DE]=Uhr
|
@ -1,168 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>LxQtClockConfiguration</name>
|
||||
<message>
|
||||
<source>LxQt Clock Settings</source>
|
||||
<translation type="vanished">LxQt-Uhr Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="14"/>
|
||||
<source>Clock Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="20"/>
|
||||
<source>Time</source>
|
||||
<translation>Zeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="26"/>
|
||||
<source>&Show seconds</source>
|
||||
<translation>&Sekunden anzeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="33"/>
|
||||
<source>12 &hour style</source>
|
||||
<translation>12 Stunden U&hr-Stil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="40"/>
|
||||
<source>&Use UTC</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="59"/>
|
||||
<source>Date &format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="76"/>
|
||||
<source>&Do not show date</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="86"/>
|
||||
<source>Show date &before time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="93"/>
|
||||
<source>Show date &after time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="100"/>
|
||||
<source>Show date below time on new &line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="110"/>
|
||||
<source>Orientation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="116"/>
|
||||
<source>Auto&rotate when the panel is vertical</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Font</source>
|
||||
<translation type="vanished">&Font</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Font</source>
|
||||
<translation type="vanished">Schriftart</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.ui" line="50"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show &date</source>
|
||||
<translation type="vanished">Zeige &Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>D&ate format</source>
|
||||
<translation type="vanished">D&atumsformat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Fon&t</source>
|
||||
<translation type="vanished">Schriftar&t</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show date in &new line</source>
|
||||
<translation type="vanished">Datum in &neuer Zeile zeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Use theme fonts</source>
|
||||
<translation type="vanished">Ben&utze System-Schriftart</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time font</source>
|
||||
<translation type="vanished">Zeit Schriftart</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Date font</source>
|
||||
<translation type="vanished">Datum Schriftart</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ultra light</source>
|
||||
<translation type="vanished">Ultra light</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Light</source>
|
||||
<translation type="vanished">Light</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ultra black</source>
|
||||
<translation type="vanished">Ultra schwarz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Black</source>
|
||||
<translation type="vanished">Schwarz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bold</source>
|
||||
<translation type="vanished">Fett</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Demi bold</source>
|
||||
<translation type="vanished">Halbfett</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Italic</source>
|
||||
<translation type="vanished">Kursiv</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.cpp" line="235"/>
|
||||
<source>Input custom date format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lxqtclockconfiguration.cpp" line="235"/>
|
||||
<source>Interpreted sequences of date format are:
|
||||
|
||||
d the day as number without a leading zero (1 to 31)
|
||||
dd the day as number with a leading zero (01 to 31)
|
||||
ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun').
|
||||
dddd the long localized day name (e.g. 'Monday' to 'Sunday').
|
||||
M the month as number without a leading zero (1-12)
|
||||
MM the month as number with a leading zero (01-12)
|
||||
MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec').
|
||||
MMMM the long localized month name (e.g. 'January' to 'December').
|
||||
yy the year as two digit number (00-99)
|
||||
yyyy the year as four digit number
|
||||
|
||||
All other input characters will be treated as text.
|
||||
Any sequence of characters that are enclosed in single quotes (')
|
||||
will also be treated as text and not be used as an expression.
|
||||
|
||||
|
||||
Custom date format:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue