mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
Merge branch 'maintain/5.2'
Change-Id: I477c63aafbff41abae741bce7cb2a6066aed896a # Conflicts: # frame/window/mainwindow.cpp
This commit is contained in:
commit
b6503312cc
@ -32,7 +32,6 @@ DockItemManager *DockItemManager::INSTANCE = nullptr;
|
||||
|
||||
DockItemManager::DockItemManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_updatePluginsOrderTimer(new QTimer(this))
|
||||
, m_appInter(new DBusDock("com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this))
|
||||
, m_pluginsInter(new DockPluginsController(this))
|
||||
{
|
||||
@ -55,11 +54,6 @@ DockItemManager::DockItemManager(QObject *parent)
|
||||
|
||||
// 托盘区域和插件区域 由DockPluginsController获取
|
||||
|
||||
// 更新插件顺序
|
||||
m_updatePluginsOrderTimer->setSingleShot(true);
|
||||
m_updatePluginsOrderTimer->setInterval(1000);
|
||||
connect(m_updatePluginsOrderTimer, &QTimer::timeout, this, &DockItemManager::updatePluginsItemOrderKey);
|
||||
|
||||
// 应用信号
|
||||
connect(m_appInter, &DBusDock::EntryAdded, this, &DockItemManager::appItemAdded);
|
||||
connect(m_appInter, &DBusDock::EntryRemoved, this, static_cast<void (DockItemManager::*)(const QString &)>(&DockItemManager::appItemRemoved), Qt::QueuedConnection);
|
||||
@ -73,9 +67,6 @@ DockItemManager::DockItemManager(QObject *parent)
|
||||
|
||||
// 刷新图标
|
||||
QMetaObject::invokeMethod(this, "refershItemsIcon", Qt::QueuedConnection);
|
||||
|
||||
// 启动的时候把插件名写入配置(自动化测试需要)
|
||||
m_updatePluginsOrderTimer->start();
|
||||
}
|
||||
|
||||
DockItemManager *DockItemManager::instance(QObject *parent)
|
||||
@ -116,10 +107,12 @@ void DockItemManager::refershItemsIcon()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 将插件的参数(Order, Visible, etc)写入gsettings
|
||||
* 自动化测试需要通过dbus(GetPluginSettings)获取这些参数
|
||||
*/
|
||||
void DockItemManager::updatePluginsItemOrderKey()
|
||||
{
|
||||
Q_ASSERT(sender() == m_updatePluginsOrderTimer);
|
||||
|
||||
int index = 0;
|
||||
for (auto item : m_itemList) {
|
||||
if (item.isNull() || item->itemType() != DockItem::Plugins)
|
||||
@ -161,9 +154,10 @@ void DockItemManager::itemMoved(DockItem *const sourceItem, DockItem *const targ
|
||||
|
||||
// update plugins sort key if order changed
|
||||
if (moveType == DockItem::Plugins || replaceType == DockItem::Plugins
|
||||
|| moveType == DockItem::TrayPlugin || replaceType == DockItem::TrayPlugin
|
||||
|| moveType == DockItem::FixedPlugin || replaceType == DockItem::FixedPlugin)
|
||||
m_updatePluginsOrderTimer->start();
|
||||
|| moveType == DockItem::TrayPlugin || replaceType == DockItem::TrayPlugin
|
||||
|| moveType == DockItem::FixedPlugin || replaceType == DockItem::FixedPlugin) {
|
||||
updatePluginsItemOrderKey();
|
||||
}
|
||||
|
||||
// for app move, index 0 is launcher item, need to pass it.
|
||||
if (moveType == DockItem::App && replaceType == DockItem::App)
|
||||
@ -297,6 +291,7 @@ void DockItemManager::pluginItemInserted(PluginsItem *item)
|
||||
insertIndex ++;
|
||||
}
|
||||
|
||||
updatePluginsItemOrderKey();
|
||||
emit itemInserted(insertIndex - firstPluginPosition, item);
|
||||
}
|
||||
|
||||
@ -307,6 +302,8 @@ void DockItemManager::pluginItemRemoved(PluginsItem *item)
|
||||
emit itemRemoved(item);
|
||||
|
||||
m_itemList.removeOne(item);
|
||||
|
||||
updatePluginsItemOrderKey();
|
||||
}
|
||||
|
||||
void DockItemManager::reloadAppItems()
|
||||
|
@ -59,7 +59,6 @@ signals:
|
||||
public slots:
|
||||
void refershItemsIcon();
|
||||
void sortPluginItems();
|
||||
void updatePluginsItemOrderKey();
|
||||
void itemMoved(DockItem *const sourceItem, DockItem *const targetItem);
|
||||
void itemAdded(const QString &appDesktop, int idx);
|
||||
|
||||
@ -70,11 +69,11 @@ private:
|
||||
void appItemRemoved(AppItem *appItem);
|
||||
void pluginItemInserted(PluginsItem *item);
|
||||
void pluginItemRemoved(PluginsItem *item);
|
||||
void updatePluginsItemOrderKey();
|
||||
void reloadAppItems();
|
||||
void manageItem(DockItem *item);
|
||||
|
||||
private:
|
||||
QTimer *m_updatePluginsOrderTimer;
|
||||
DBusDock *m_appInter;
|
||||
DockPluginsController *m_pluginsInter;
|
||||
|
||||
|
@ -137,12 +137,16 @@ void AppDragWidget::mouseMoveEvent(QMouseEvent *event)
|
||||
void AppDragWidget::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
m_bDragDrop = true;
|
||||
}
|
||||
|
||||
void AppDragWidget::dragMoveEvent(QDragMoveEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
showRemoveTips();
|
||||
if (isRemoveItem() && m_bDragDrop) {
|
||||
emit requestRemoveItem();
|
||||
}
|
||||
}
|
||||
|
||||
const QPoint AppDragWidget::topleftPoint() const
|
||||
@ -191,6 +195,7 @@ const QPoint AppDragWidget::popupMarkPoint(Dock::Position pos)
|
||||
void AppDragWidget::dropEvent(QDropEvent *event)
|
||||
{
|
||||
m_followMouseTimer->stop();
|
||||
m_bDragDrop = false;
|
||||
|
||||
if (isRemoveAble()) {
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
@ -198,6 +203,7 @@ void AppDragWidget::dropEvent(QDropEvent *event)
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
emit animationFinished();
|
||||
AppItem *appItem = static_cast<AppItem *>(event->source());
|
||||
appItem->undock();
|
||||
m_popupWindow->setVisible(false);
|
||||
@ -261,6 +267,7 @@ void AppDragWidget::initAnimations()
|
||||
connect(m_animGroup, &QParallelAnimationGroup::stateChanged,
|
||||
this, &AppDragWidget::onRemoveAnimationStateChanged);
|
||||
connect(m_goBackAnim, &QPropertyAnimation::finished, this, &AppDragWidget::hide);
|
||||
connect(m_goBackAnim, &QPropertyAnimation::finished, this, &AppDragWidget::animationFinished);
|
||||
}
|
||||
|
||||
void AppDragWidget::initConfigurations()
|
||||
@ -304,6 +311,13 @@ void AppDragWidget::onRemoveAnimationStateChanged(QAbstractAnimation::State newS
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 判断图标拖到一定高度后是否可以移除
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool AppDragWidget::isRemoveAble()
|
||||
{
|
||||
const QPoint &p = QCursor::pos();
|
||||
@ -334,6 +348,40 @@ bool AppDragWidget::isRemoveAble()
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 判断应用区域图标是否拖出任务栏
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool AppDragWidget::isRemoveItem()
|
||||
{
|
||||
const QPoint &p = QCursor::pos();
|
||||
switch (m_dockPosition) {
|
||||
case Dock::Position::Left:
|
||||
if ((p.x() > m_dockGeometry.topRight().x())) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Top:
|
||||
if ((p.y() > m_dockGeometry.bottomLeft().y())) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Right:
|
||||
if ((m_dockGeometry.topLeft().x() > p.x())) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Bottom:
|
||||
if ((m_dockGeometry.topLeft().y() > p.y())) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AppDragWidget::enterEvent(QEvent *event)
|
||||
{
|
||||
if (m_goBackAnim->state() != QPropertyAnimation::State::Running
|
||||
@ -344,7 +392,7 @@ void AppDragWidget::enterEvent(QEvent *event)
|
||||
|
||||
void AppDragWidget::showRemoveTips()
|
||||
{
|
||||
bool model = true;
|
||||
bool model = true;
|
||||
Dock::Position pos = Dock::Position::Bottom;
|
||||
|
||||
DockPopupWindow *popup = m_popupWindow;
|
||||
@ -382,4 +430,4 @@ void AppDragWidget::moveEvent(QMoveEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
showRemoveTips();
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,10 @@ public:
|
||||
void setOriginPos(const QPoint position);
|
||||
bool isRemoveAble();
|
||||
|
||||
signals:
|
||||
void requestRemoveItem();
|
||||
void animationFinished();
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
@ -68,6 +72,7 @@ private:
|
||||
const QPoint popupMarkPoint(Dock::Position pos);
|
||||
const QPoint topleftPoint() const;
|
||||
void showRemoveTips();
|
||||
bool isRemoveItem();
|
||||
|
||||
private:
|
||||
AppGraphicsObject *m_object;
|
||||
@ -90,6 +95,8 @@ private:
|
||||
* dock栏上应用区驻留应用被拖拽远离dock的距离除以dock的宽或者高(更小的一个)的比值
|
||||
*/
|
||||
double m_distanceMultiple;
|
||||
|
||||
bool m_bDragDrop = false; // 图标是否被拖拽
|
||||
};
|
||||
|
||||
#endif /* APPDRAGWIDGET_H */
|
||||
|
@ -143,7 +143,18 @@ void PreviewContainer::adjustSize()
|
||||
if (!composite)
|
||||
{
|
||||
const int h = SNAP_HEIGHT_WITHOUT_COMPOSITE * count + MARGIN * 2 + SPACING * (count - 1);
|
||||
setFixedSize(SNAP_WIDTH, h);
|
||||
|
||||
//根据appitem title 设置自适应宽度
|
||||
auto appSnapshot = static_cast<AppSnapshot*>(this->layout()->itemAt(0)->widget());
|
||||
auto font = appSnapshot->layout()->itemAt(0)->widget()->font();
|
||||
QFontMetrics fontMetrics(font);
|
||||
const int fontSize = fontMetrics.boundingRect(appSnapshot->title()).width();
|
||||
//预留字体到边缘的间距,边缘距离10px,关闭按钮24px
|
||||
if (fontSize < SNAP_WIDTH - 44)
|
||||
setFixedSize(fontSize + 44, h);
|
||||
else
|
||||
setFixedSize(SNAP_WIDTH, h);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -277,11 +277,6 @@ void DockItem::showHoverTips()
|
||||
if (PopupWindow->model())
|
||||
return;
|
||||
|
||||
// if not in geometry area
|
||||
const QRect r(topleftPoint(), size());
|
||||
if (!r.contains(QCursor::pos()))
|
||||
return;
|
||||
|
||||
QWidget *const content = popupTips();
|
||||
if (!content)
|
||||
return;
|
||||
@ -376,61 +371,47 @@ bool DockItem::checkAndResetTapHoldGestureState()
|
||||
const QPoint DockItem::popupMarkPoint()
|
||||
{
|
||||
QPoint p(topleftPoint());
|
||||
int margin = PLUGIN_MARGIN;
|
||||
if (itemType() == Plugins){
|
||||
PluginsItem *pluginItem = dynamic_cast<PluginsItem*>(this);
|
||||
if (nullptr != pluginItem){
|
||||
if (pluginItem->pluginName() == "datetime")
|
||||
margin = 0;
|
||||
}
|
||||
}
|
||||
const QRect r = rect();
|
||||
switch (DockPosition) {
|
||||
case Top: {
|
||||
if (itemType() == Plugins) {
|
||||
p += QPoint(r.width() / 2, r.height() + margin);
|
||||
} else {
|
||||
p += QPoint(r.width() / 2, r.height());
|
||||
}
|
||||
case Top:
|
||||
p += QPoint(r.width() / 2, r.height());
|
||||
break;
|
||||
}
|
||||
case Bottom: {
|
||||
if (itemType() == Plugins) {
|
||||
p += QPoint(r.width() / 2, 0 - margin);
|
||||
} else {
|
||||
p += QPoint(r.width() / 2, 0);
|
||||
}
|
||||
case Bottom:
|
||||
p += QPoint(r.width() / 2, 0);
|
||||
break;
|
||||
}
|
||||
case Left: {
|
||||
if (itemType() == Plugins) {
|
||||
p += QPoint(r.width() + margin, r.height() / 2);
|
||||
} else {
|
||||
p += QPoint(r.width(), r.height() / 2);
|
||||
}
|
||||
case Left:
|
||||
p += QPoint(r.width(), r.height() / 2);
|
||||
break;
|
||||
}
|
||||
case Right: {
|
||||
if (itemType() == Plugins) {
|
||||
p += QPoint(0 - margin, r.height() / 2);
|
||||
} else {
|
||||
p += QPoint(0, r.height() / 2);
|
||||
}
|
||||
case Right:
|
||||
p += QPoint(0, r.height() / 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
const QPoint DockItem::topleftPoint() const
|
||||
{
|
||||
QPoint p;
|
||||
const QWidget *w = this;
|
||||
do {
|
||||
QPoint p = this->pos();
|
||||
/* 由于点击范围的问题,在图标的外面加了一层布局,这个布局的边距需要考虑 */
|
||||
switch (DockPosition) {
|
||||
case Top:
|
||||
p.setY(p.y() * 2);
|
||||
break;
|
||||
case Bottom:
|
||||
p.setY(0);
|
||||
break;
|
||||
case Left:
|
||||
p.setX(p.x() * 2);
|
||||
break;
|
||||
case Right:
|
||||
p.setX(0);
|
||||
break;
|
||||
}
|
||||
const QWidget *w = qobject_cast<QWidget *>(this->parent());
|
||||
while (w) {
|
||||
p += w->pos();
|
||||
w = qobject_cast<QWidget *>(w->parent());
|
||||
} while (w);
|
||||
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -461,4 +442,3 @@ bool DockItem::isDragging()
|
||||
{
|
||||
return m_draging;
|
||||
}
|
||||
|
||||
|
@ -111,20 +111,18 @@ void MainPanelControl::initUi()
|
||||
m_mainPanelLayout->addWidget(m_fixedAreaWidget);
|
||||
|
||||
m_fixedSpliter->setObjectName("spliter_fix");
|
||||
m_mainPanelLayout->addWidget(m_fixedSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->addWidget(m_fixedSpliter);
|
||||
|
||||
/* 应用程序区域 */
|
||||
m_appAreaWidget->setAccessibleName("AppFullArea");
|
||||
m_mainPanelLayout->addWidget(m_appAreaWidget);
|
||||
m_appAreaSonLayout->setSpacing(0);
|
||||
m_appAreaSonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_appAreaSonWidget->setObjectName("apparea");
|
||||
m_appAreaSonWidget->setLayout(m_appAreaSonLayout);
|
||||
m_appAreaSonLayout->setSpacing(0);
|
||||
m_appAreaSonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_appSpliter->setObjectName("spliter_app");
|
||||
m_mainPanelLayout->addWidget(m_appSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->addWidget(m_appSpliter);
|
||||
|
||||
/* 托盘区域 */
|
||||
m_trayAreaWidget->setObjectName("trayarea");
|
||||
@ -134,7 +132,7 @@ void MainPanelControl::initUi()
|
||||
m_mainPanelLayout->addWidget(m_trayAreaWidget);
|
||||
|
||||
m_traySpliter->setObjectName("spliter_tray");
|
||||
m_mainPanelLayout->addWidget(m_traySpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->addWidget(m_traySpliter);
|
||||
|
||||
/* 插件区域 */
|
||||
m_pluginAreaWidget->setObjectName("pluginarea");
|
||||
@ -148,6 +146,9 @@ void MainPanelControl::initUi()
|
||||
|
||||
m_mainPanelLayout->setSpacing(0);
|
||||
m_mainPanelLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_mainPanelLayout->setAlignment(m_fixedSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->setAlignment(m_appSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->setAlignment(m_traySpliter, Qt::AlignCenter);
|
||||
|
||||
connect(GSettingsByLaunch(), &QGSettings::changed, this, &MainPanelControl::onGSettingsChanged);
|
||||
}
|
||||
@ -341,6 +342,9 @@ void MainPanelControl::insertItem(int index, DockItem *item)
|
||||
break;
|
||||
}
|
||||
resizeDockIcon();
|
||||
QTimer::singleShot(0, [ = ] {
|
||||
updatePluginsLayout();
|
||||
});
|
||||
}
|
||||
|
||||
void MainPanelControl::removeItem(DockItem *item)
|
||||
@ -401,6 +405,9 @@ void MainPanelControl::moveItem(DockItem *sourceItem, DockItem *targetItem)
|
||||
removeItem(sourceItem);
|
||||
|
||||
// insert new position
|
||||
if (sourceItem->isDragging()) {
|
||||
m_dragIndex = idx;
|
||||
}
|
||||
insertItem(idx, sourceItem);
|
||||
}
|
||||
|
||||
@ -509,8 +516,10 @@ void MainPanelControl::handleDragMove(QDragMoveEvent *e, bool isFilter)
|
||||
|
||||
e->accept();
|
||||
|
||||
if (targetItem == sourceItem)
|
||||
if (targetItem == sourceItem) {
|
||||
m_dragIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
moveItem(sourceItem, targetItem);
|
||||
emit itemMoved(sourceItem, targetItem);
|
||||
@ -685,6 +694,25 @@ void MainPanelControl::startDrag(DockItem *item)
|
||||
m_appDragWidget = nullptr;
|
||||
});
|
||||
|
||||
connect(m_appDragWidget, &AppDragWidget::requestRemoveItem, this, [ = ] {
|
||||
if (-1 != m_appAreaSonLayout->indexOf(item)) {
|
||||
m_dragIndex = m_appAreaSonLayout->indexOf(item);
|
||||
removeItem(item);
|
||||
}
|
||||
});
|
||||
|
||||
connect(m_appDragWidget, &AppDragWidget::animationFinished, this, [ = ] {
|
||||
m_appDragWidget = nullptr;
|
||||
if (qobject_cast<AppItem *>(item)->isValid()) {
|
||||
if (-1 == m_appAreaSonLayout->indexOf(item) && m_dragIndex != -1) {
|
||||
insertItem(m_dragIndex, item);
|
||||
m_dragIndex = -1;
|
||||
}
|
||||
item->setDraging(false);
|
||||
item->update();
|
||||
}
|
||||
});
|
||||
|
||||
appDrag->appDragWidget()->setOriginPos((m_appAreaSonWidget->mapToGlobal(item->pos())));
|
||||
appDrag->appDragWidget()->setDockInfo(m_position, QRect(mapToGlobal(pos()), size()));
|
||||
const QPixmap &dragPix = qobject_cast<AppItem *>(item)->appIcon();
|
||||
@ -708,15 +736,11 @@ void MainPanelControl::startDrag(DockItem *item)
|
||||
drag->setMimeData(new QMimeData);
|
||||
drag->exec(Qt::MoveAction);
|
||||
|
||||
// app关闭特效情况下移除
|
||||
if (item->itemType() == DockItem::App && !DWindowManagerHelper::instance()->hasComposite()) {
|
||||
if (m_appDragWidget->isRemoveAble())
|
||||
qobject_cast<AppItem *>(item)->undock();
|
||||
if (item->itemType() != DockItem::App || m_dragIndex == -1) {
|
||||
m_appDragWidget = nullptr;
|
||||
item->setDraging(false);
|
||||
item->update();
|
||||
}
|
||||
|
||||
m_appDragWidget = nullptr;
|
||||
item->setDraging(false);
|
||||
item->update();
|
||||
}
|
||||
|
||||
DockItem *MainPanelControl::dropTargetItem(DockItem *sourceItem, QPoint point)
|
||||
@ -848,9 +872,22 @@ void MainPanelControl::moveAppSonWidget()
|
||||
m_appAreaSonWidget->move(rect.x(), rect.y());
|
||||
}
|
||||
|
||||
void MainPanelControl::updatePluginsLayout()
|
||||
{
|
||||
for (int i = 0; i < m_pluginLayout->count(); ++i) {
|
||||
QLayout *layout = m_pluginLayout->itemAt(i)->layout();
|
||||
if (layout) {
|
||||
PluginsItem *pItem = static_cast<PluginsItem *>(layout->itemAt(0)->widget());
|
||||
if (pItem && pItem->sizeHint().width() != -1) {
|
||||
pItem->updateGeometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainPanelControl::itemUpdated(DockItem *item)
|
||||
{
|
||||
item->parentWidget()->adjustSize();
|
||||
item->updateGeometry();
|
||||
resizeDockIcon();
|
||||
}
|
||||
|
||||
@ -1040,15 +1077,6 @@ void MainPanelControl::calcuDockIconSize(int w, int h, PluginsItem *trashPlugin,
|
||||
m_tray->centralWidget()->setProperty("iconSize", tray_item_size);
|
||||
}
|
||||
|
||||
if (shutdownPlugin)
|
||||
shutdownPlugin->setFixedSize(tray_item_size, tray_item_size);
|
||||
if (keyboardPlugin)
|
||||
keyboardPlugin->setFixedSize(tray_item_size, tray_item_size);
|
||||
if (notificationPlugin)
|
||||
notificationPlugin->setFixedSize(tray_item_size, tray_item_size);
|
||||
if (trashPlugin)
|
||||
trashPlugin->setFixedSize(tray_item_size, tray_item_size);
|
||||
|
||||
//因为日期时间大小和其他插件大小有异,为了设置边距,在各插件中增加了一层布局
|
||||
//因此需要通过多一层布局来获取各插件
|
||||
if ((m_position == Position::Top) || (m_position == Position::Bottom)) {
|
||||
@ -1057,18 +1085,9 @@ void MainPanelControl::calcuDockIconSize(int w, int h, PluginsItem *trashPlugin,
|
||||
QLayout *layout = m_pluginLayout->itemAt(i)->layout();
|
||||
if (layout) {
|
||||
PluginsItem *pItem = static_cast<PluginsItem *>(layout->itemAt(0)->widget());
|
||||
if (pItem && pItem != trashPlugin && pItem != shutdownPlugin && pItem != keyboardPlugin && pItem !=notificationPlugin) {
|
||||
// 根据大小策略控制插件大小
|
||||
switch (pItem->pluginSizePolicy()) {
|
||||
case PluginsItemInterface::System:
|
||||
if (pItem) {
|
||||
if (pItem->sizeHint().width() == -1) {
|
||||
pItem->setFixedSize(tray_item_size, tray_item_size);
|
||||
break;
|
||||
case PluginsItemInterface::Custom:
|
||||
pItem->setFixedSize(pItem->sizeHint().width(), h);
|
||||
break;
|
||||
default:
|
||||
pItem->setFixedSize(tray_item_size, tray_item_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1079,18 +1098,9 @@ void MainPanelControl::calcuDockIconSize(int w, int h, PluginsItem *trashPlugin,
|
||||
QLayout *layout = m_pluginLayout->itemAt(i)->layout();
|
||||
if (layout) {
|
||||
PluginsItem *pItem = static_cast<PluginsItem *>(layout->itemAt(0)->widget());
|
||||
if (pItem && pItem != trashPlugin && pItem != shutdownPlugin && pItem != keyboardPlugin && pItem !=notificationPlugin) {
|
||||
// 根据大小策略控制插件大小
|
||||
switch (pItem->pluginSizePolicy()) {
|
||||
case PluginsItemInterface::System:
|
||||
if (pItem) {
|
||||
if (pItem->sizeHint().width() == -1) {
|
||||
pItem->setFixedSize(tray_item_size, tray_item_size);
|
||||
break;
|
||||
case PluginsItemInterface::Custom:
|
||||
pItem->setFixedSize(w, pItem->sizeHint().height());
|
||||
break;
|
||||
default:
|
||||
pItem->setFixedSize(tray_item_size, tray_item_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ public:
|
||||
void setPositonValue(Position position);
|
||||
void setDisplayMode(DisplayMode dislayMode);
|
||||
void getTrayVisableItemCount();
|
||||
void updatePluginsLayout();
|
||||
|
||||
MainPanelDelegate *delegate() const;
|
||||
void setDelegate(MainPanelDelegate *delegate);
|
||||
@ -145,6 +146,7 @@ private:
|
||||
bool m_isHover; // 判断鼠标是否移到desktop区域
|
||||
bool m_needRecoveryWin; // 判断鼠标移出desktop区域是否恢复之前窗口
|
||||
bool m_isEnableLaunch; // 判断是否使能了com.deepin.dde.dock.module.launcher
|
||||
int m_dragIndex = -1; // 记录应用区域被拖拽图标的位置
|
||||
};
|
||||
|
||||
#endif // MAINPANELCONTROL_H
|
||||
|
@ -52,16 +52,35 @@ void AbstractPluginsController::saveValue(PluginsItemInterface *const itemInter,
|
||||
{
|
||||
// is it necessary?
|
||||
// refreshPluginSettings();
|
||||
int fixedPluginCount(0); // FixPlugin Counts
|
||||
|
||||
// save to local cache
|
||||
QJsonObject localObject = m_pluginSettingsObject.value(itemInter->pluginName()).toObject();
|
||||
localObject.insert(key, QJsonValue::fromVariant(value)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
m_pluginSettingsObject.insert(itemInter->pluginName(), localObject);
|
||||
|
||||
// save to daemon
|
||||
QJsonObject remoteObject, remoteObjectInter;
|
||||
remoteObjectInter.insert(key, QJsonValue::fromVariant(value)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
remoteObject.insert(itemInter->pluginName(), remoteObjectInter);
|
||||
|
||||
if (itemInter->type() == PluginsItemInterface::Fixed && key == "enable" && !value.toBool()) {
|
||||
// 遍历FixPlugin插件个数
|
||||
for (auto it(m_pluginsMap.begin()); it != m_pluginsMap.end();) {
|
||||
if (it.key()->type() == PluginsItemInterface::Fixed) {
|
||||
fixedPluginCount++;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
// 修改插件的order值,位置为队尾
|
||||
QString name = localObject.keys().last();
|
||||
localObject.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
|
||||
// daemon中同样修改
|
||||
remoteObjectInter.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
remoteObject.insert(itemInter->pluginName(), remoteObjectInter);
|
||||
}
|
||||
|
||||
m_pluginSettingsObject.insert(itemInter->pluginName(), localObject);
|
||||
m_dockDaemonInter->MergePluginSettings(QJsonDocument(remoteObject).toJson(QJsonDocument::JsonFormat::Compact));
|
||||
}
|
||||
|
||||
|
@ -183,19 +183,29 @@ void MultiScreenWorker::handleDbusSignal(QDBusMessage msg)
|
||||
return;
|
||||
// 返回的数据中,这一部分对应的是数据发送方的interfacename,可判断是否是自己需要的服务
|
||||
QString interfaceName = msg.arguments().at(0).toString();
|
||||
if (interfaceName != "com.deepin.dde.daemon.Dock")
|
||||
return;
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
QStringList keys = changedProps.keys();
|
||||
foreach (const QString &prop, keys) {
|
||||
if (prop == "Position") {
|
||||
onPositionChanged();
|
||||
} else if (prop == "DisplayMode") {
|
||||
onDisplayModeChanged();
|
||||
} else if (prop == "HideMode") {
|
||||
onHideModeChanged();
|
||||
} else if (prop == "HideState") {
|
||||
onHideStateChanged();
|
||||
if (interfaceName == "com.deepin.dde.daemon.Dock") {
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
QStringList keys = changedProps.keys();
|
||||
foreach (const QString &prop, keys) {
|
||||
if (prop == "Position") {
|
||||
onPositionChanged();
|
||||
} else if (prop == "DisplayMode") {
|
||||
onDisplayModeChanged();
|
||||
} else if (prop == "HideMode") {
|
||||
onHideModeChanged();
|
||||
} else if (prop == "HideState") {
|
||||
onHideStateChanged();
|
||||
}
|
||||
}
|
||||
} else if (interfaceName == "com.deepin.daemon.Display") {
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
QStringList keys = changedProps.keys();
|
||||
foreach (const QString &prop, keys) {
|
||||
if (prop == "ScreenHeight") {
|
||||
m_screenRawHeight = m_displayInter->screenHeight();
|
||||
} else if (prop == "ScreenWidth") {
|
||||
m_screenRawWidth = m_displayInter->screenWidth();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -741,6 +751,7 @@ void MultiScreenWorker::onRequestNotifyWindowManager()
|
||||
if (rect == lastRect)
|
||||
return;
|
||||
lastRect = rect;
|
||||
qDebug() << "dock geometry:" << rect;
|
||||
|
||||
// 先清除原先的窗管任务栏区域
|
||||
XcbMisc::instance()->clear_strut_partial(xcb_window_t(parent()->winId()));
|
||||
@ -754,12 +765,14 @@ void MultiScreenWorker::onRequestNotifyWindowManager()
|
||||
|
||||
// 除了"一直显示"模式,其他的都不要设置任务栏区域
|
||||
if (m_hideMode != Dock::KeepShowing) {
|
||||
lastRect = QRect();
|
||||
return;
|
||||
}
|
||||
|
||||
qInfo() <<"Update Window WorkArea:" << rect;
|
||||
|
||||
const QPoint &p = rawXPosition(rect.topLeft());
|
||||
qDebug() << "dock topLeft position:" << p;
|
||||
|
||||
QScreen const *currentScreen = Utils::screenAtByScaled(rect.topLeft());
|
||||
|
||||
XcbMisc::Orientation orientation = XcbMisc::OrientationTop;
|
||||
uint strut = 0;
|
||||
@ -775,11 +788,7 @@ void MultiScreenWorker::onRequestNotifyWindowManager()
|
||||
break;
|
||||
case Position::Bottom:
|
||||
orientation = XcbMisc::OrientationBottom;
|
||||
strut = m_screenRawHeight - p.y();
|
||||
//m_rotations 这里面是保存当前屏幕旋转那个方向正常情况分别依次向下,向右,向上,向左
|
||||
if(m_rotations.size() >= 4 && (m_monitorRotation == m_rotations[1] || m_monitorRotation == m_rotations[3])) {
|
||||
strut = m_screenRawWidth - p.y();
|
||||
}
|
||||
strut = currentScreen->geometry().height() * ratio - p.y();
|
||||
strutStart = p.x();
|
||||
strutEnd = qMin(qRound(p.x() + rect.width() * ratio), rect.right());
|
||||
break;
|
||||
@ -791,16 +800,12 @@ void MultiScreenWorker::onRequestNotifyWindowManager()
|
||||
break;
|
||||
case Position::Right:
|
||||
orientation = XcbMisc::OrientationRight;
|
||||
strut = m_screenRawWidth - p.x();
|
||||
//m_rotations 这里面是保存当前屏幕旋转那个方向正常情况分别依次向下,向右,向上,向左
|
||||
if(m_rotations.size() >= 4 && (m_monitorRotation == m_rotations[1] || m_monitorRotation == m_rotations[3])) {
|
||||
strut = m_screenRawHeight - p.x();
|
||||
}
|
||||
strut = currentScreen->geometry().width() * ratio - p.x();
|
||||
strutStart = p.y();
|
||||
strutEnd = qMin(qRound(p.y() + rect.height() * ratio), rect.bottom());
|
||||
break;
|
||||
}
|
||||
|
||||
qDebug() << "set dock geometry to xcb:" << strut << strutStart << strutEnd;
|
||||
XcbMisc::instance()->set_strut_partial(parent()->winId(), orientation, strut + WINDOWMARGIN * ratio, strutStart, strutEnd);
|
||||
}
|
||||
|
||||
@ -943,7 +948,7 @@ void MultiScreenWorker::onRequestDelayShowDock(const QString &screenName)
|
||||
|
||||
void MultiScreenWorker::initMembers()
|
||||
{
|
||||
m_monitorUpdateTimer->setInterval(10);
|
||||
m_monitorUpdateTimer->setInterval(100);
|
||||
m_monitorUpdateTimer->setSingleShot(true);
|
||||
|
||||
m_delayTimer->setInterval(2000);
|
||||
@ -977,7 +982,14 @@ void MultiScreenWorker::initGSettingConfig()
|
||||
|
||||
void MultiScreenWorker::initConnection()
|
||||
{
|
||||
//FIX: 这里关联信号有时候收不到,未查明原因,handleDbusSignal处理
|
||||
/** FIXME
|
||||
* 这里关联的信号有时候收不到是因为 qt-dbus-factory 中的 changed 的信号有时候会发不出来,
|
||||
* qt-dbus-factory 中的 DBusExtendedAbstractInterface::internalPropGet 在同步调用情况下,会将缓存中的数据写入属性中,
|
||||
* 导致后面 onPropertyChanged 中的判断认为属性值没变,就没有发出 changed 信号。
|
||||
* 建议:前端仅在初始化时主动获取一次 dbus 中的值存储在成员变量中,并建立 changed 信号连接,后面所有用到那个值的地方,均获取成员变量;
|
||||
* 或去修改 qt-dbus-factory,取消 DBusExtendedAbstractInterface::internalPropGet 中将数据写入属性值,
|
||||
* 但是 qt-dbus-factory 修改涉及面较广,需要大量测试确认没有问题,再合入。
|
||||
*/
|
||||
#if 0
|
||||
// connect(m_dockInter, &DBusDock::PositionChanged, this, &MultiScreenWorker::onPositionChanged);
|
||||
// connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &MultiScreenWorker::onDisplayModeChanged);
|
||||
@ -990,6 +1002,12 @@ void MultiScreenWorker::initConnection()
|
||||
"PropertiesChanged",
|
||||
"sa{sv}as",
|
||||
this, SLOT(handleDbusSignal(QDBusMessage)));
|
||||
QDBusConnection::sessionBus().connect("com.deepin.daemon.Display",
|
||||
"/com/deepin/daemon/Display",
|
||||
"org.freedesktop.DBus.Properties",
|
||||
"PropertiesChanged",
|
||||
"sa{sv}as",
|
||||
this, SLOT(handleDbusSignal(QDBusMessage)));
|
||||
#endif
|
||||
connect(&m_mtrInfo, &MonitorInfo::monitorChanged, this, &MultiScreenWorker::requestUpdateMonitorInfo);
|
||||
|
||||
@ -1451,9 +1469,7 @@ void MultiScreenWorker::checkDaemonDockService()
|
||||
|
||||
void MultiScreenWorker::checkDaemonDisplayService()
|
||||
{
|
||||
auto connectionInit = [ = ](DisplayInter * displayInter) {
|
||||
connect(displayInter, &DisplayInter::ScreenWidthChanged, this, [ = ](ushort value) {m_screenRawWidth = value;});
|
||||
connect(displayInter, &DisplayInter::ScreenHeightChanged, this, [ = ](ushort value) {m_screenRawHeight = value;});
|
||||
auto connectionInit = [ = ](DisplayInter *displayInter) {
|
||||
connect(displayInter, &DisplayInter::MonitorsChanged, this, &MultiScreenWorker::onMonitorListChanged);
|
||||
connect(displayInter, &DisplayInter::MonitorsChanged, this, &MultiScreenWorker::requestUpdateRegionMonitor);
|
||||
connect(displayInter, &DisplayInter::PrimaryRectChanged, this, &MultiScreenWorker::primaryScreenChanged, Qt::QueuedConnection);
|
||||
|
@ -38,7 +38,6 @@
|
||||
//#include "../plugins/sound/componments/horizontalseparator.h"
|
||||
|
||||
#include "../plugins/show-desktop/showdesktopwidget.h"
|
||||
#include "../plugins/bluetooth/componments/deviceitem.h"
|
||||
#include "../plugins/network/networkitem.h"
|
||||
#include "../plugins/network/item/applet/devicecontrolwidget.h"
|
||||
#include "../plugins/datetime/datetimewidget.h"
|
||||
@ -88,11 +87,6 @@ SET_FORM_ACCESSIBLE(AttentionContainer, "attentioncontainer")
|
||||
SET_FORM_ACCESSIBLE(HoldContainer, "holdcontainer")
|
||||
SET_FORM_ACCESSIBLE(NormalContainer, "normalcontainer")
|
||||
SET_FORM_ACCESSIBLE(SpliterAnimated, "spliteranimated")
|
||||
//SET_BUTTON_ACCESSIBLE(SoundItem, "plugin-sounditem")
|
||||
//SET_FORM_ACCESSIBLE(SoundApplet, "soundapplet")
|
||||
//SET_FORM_ACCESSIBLE(SinkInputWidget, "sinkinputwidget")
|
||||
//SET_SLIDER_ACCESSIBLE(VolumeSlider, QAccessible::Slider, "volumeslider")
|
||||
//SET_FORM_ACCESSIBLE(HorizontalSeparator, "horizontalseparator")
|
||||
SET_FORM_ACCESSIBLE(DatetimeWidget, "plugin-datetime")
|
||||
SET_FORM_ACCESSIBLE(OnboardItem, "plugin-onboard")
|
||||
SET_FORM_ACCESSIBLE(TrashWidget, "plugin-trash")
|
||||
@ -119,9 +113,7 @@ SET_FORM_ACCESSIBLE(QScrollArea, "QScrollArea")
|
||||
SET_FORM_ACCESSIBLE(QFrame, "QFrame")
|
||||
SET_FORM_ACCESSIBLE(QGraphicsView, "QGraphicsView")
|
||||
SET_FORM_ACCESSIBLE(DragWidget, "DragWidget")
|
||||
SET_FORM_ACCESSIBLE(MenueItem, "MenueItem")
|
||||
SET_FORM_ACCESSIBLE(NetworkItem, "NetworkItem")
|
||||
SET_FORM_ACCESSIBLE(DeviceItem, "DeviceItem")
|
||||
SET_FORM_ACCESSIBLE(StateButton, "StateButton")
|
||||
SET_FORM_ACCESSIBLE(DeviceControlWidget, "DeviceControlWidget")
|
||||
|
||||
@ -157,11 +149,6 @@ QAccessibleInterface *accessibleFactory(const QString &classname, QObject *objec
|
||||
USE_ACCESSIBLE(classname, SpliterAnimated);
|
||||
USE_ACCESSIBLE(classname, IndicatorTrayWidget);
|
||||
USE_ACCESSIBLE(classname, XEmbedTrayWidget);
|
||||
// USE_ACCESSIBLE(classname, SoundItem);
|
||||
// USE_ACCESSIBLE(classname, SoundApplet);
|
||||
// USE_ACCESSIBLE(classname, SinkInputWidget);
|
||||
// USE_ACCESSIBLE(classname, VolumeSlider);
|
||||
// USE_ACCESSIBLE(classname, HorizontalSeparator);
|
||||
USE_ACCESSIBLE(classname, DesktopWidget);
|
||||
USE_ACCESSIBLE(classname, DatetimeWidget);
|
||||
USE_ACCESSIBLE(classname, OnboardItem);
|
||||
@ -193,9 +180,7 @@ QAccessibleInterface *accessibleFactory(const QString &classname, QObject *objec
|
||||
USE_ACCESSIBLE(classname, QFrame);
|
||||
USE_ACCESSIBLE(classname, QGraphicsView);
|
||||
USE_ACCESSIBLE(classname, DragWidget);
|
||||
USE_ACCESSIBLE(classname, MenueItem);
|
||||
USE_ACCESSIBLE(classname, NetworkItem);
|
||||
USE_ACCESSIBLE(classname, DeviceItem);
|
||||
USE_ACCESSIBLE(classname, StateButton);
|
||||
USE_ACCESSIBLE(classname, DeviceControlWidget);
|
||||
|
||||
|
@ -254,6 +254,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
// 任务栏大小、位置、模式改变都会触发resize,发射大小改变信号,供依赖项目更新位置
|
||||
Q_EMIT panelGeometryChanged();
|
||||
|
||||
m_mainPanel->updatePluginsLayout();
|
||||
m_shadowMaskOptimizeTimer->start();
|
||||
|
||||
return DBlurEffectWidget::resizeEvent(event);
|
||||
@ -355,30 +356,21 @@ void MainWindow::getTrayVisableItemCount()
|
||||
|
||||
void MainWindow::adjustShadowMask()
|
||||
{
|
||||
if (!m_launched)
|
||||
if (!m_launched || m_shadowMaskOptimizeTimer->isActive())
|
||||
return;
|
||||
|
||||
if (m_shadowMaskOptimizeTimer->isActive())
|
||||
return;
|
||||
|
||||
const bool composite = m_wmHelper->hasComposite();
|
||||
const bool isFasion = m_multiScreenWorker->displayMode() == Fashion;
|
||||
|
||||
DStyleHelper dstyle(style());
|
||||
int radius = dstyle.pixelMetric(DStyle::PM_TopLevelWindowRadius);
|
||||
|
||||
if (Dtk::Core::DSysInfo::isCommunityEdition()) {
|
||||
auto theme = DGuiApplicationHelper::instance()->systemTheme();
|
||||
radius = theme->windowRadius(radius);
|
||||
int radius = 0;
|
||||
if (m_wmHelper->hasComposite() && m_multiScreenWorker->displayMode() == DisplayMode::Fashion) {
|
||||
if (Dtk::Core::DSysInfo::isCommunityEdition()) { // 社区版圆角与专业版不同
|
||||
DPlatformTheme *theme = DGuiApplicationHelper::instance()->systemTheme();
|
||||
radius = theme->windowRadius(radius);
|
||||
} else {
|
||||
radius = dstyle.pixelMetric(DStyle::PM_TopLevelWindowRadius);
|
||||
}
|
||||
}
|
||||
|
||||
int newRadius = composite && isFasion ? radius : 0;
|
||||
m_platformWindowHandle.setWindowRadius(newRadius);
|
||||
|
||||
QPainterPath clipPath;
|
||||
clipPath.addRect(QRect(QPoint(0, 0), this->geometry().size()));
|
||||
|
||||
m_platformWindowHandle.setClipPath(newRadius != 0 ? QPainterPath() : clipPath);
|
||||
m_platformWindowHandle.setWindowRadius(radius);
|
||||
}
|
||||
|
||||
void MainWindow::onDbusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
|
||||
|
@ -1,331 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "bluetoothapplet.h"
|
||||
#include "componments/switchitem.h"
|
||||
#include "componments/deviceitem.h"
|
||||
#include "componments/adapter.h"
|
||||
#include "componments/switchitem.h"
|
||||
#include "componments/adaptersmanager.h"
|
||||
#include "componments/adapteritem.h"
|
||||
#include "componments/bluetoothconstants.h"
|
||||
|
||||
#include <DApplicationHelper>
|
||||
#include <DDBusSender>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
extern void initFontColor(QWidget *widget)
|
||||
{
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
auto fontChange = [&](QWidget *widget){
|
||||
QPalette defaultPalette = widget->palette();
|
||||
defaultPalette.setBrush(QPalette::WindowText, defaultPalette.brightText());
|
||||
widget->setPalette(defaultPalette);
|
||||
};
|
||||
|
||||
fontChange(widget);
|
||||
|
||||
QObject::connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, widget, [=]{
|
||||
fontChange(widget);
|
||||
});
|
||||
}
|
||||
|
||||
BluetoothApplet::BluetoothApplet(QWidget *parent)
|
||||
: QScrollArea(parent)
|
||||
, m_line(new HorizontalSeparator(this))
|
||||
, m_appletName(new QLabel(this))
|
||||
, m_centralWidget(new QWidget)
|
||||
, m_centrealLayout(new QVBoxLayout)
|
||||
, m_adapterLayout(new QVBoxLayout)
|
||||
, m_menueLayout(new QHBoxLayout)
|
||||
, m_openControlCenter(new MenueItem(this))
|
||||
, m_textLayout(new QVBoxLayout)
|
||||
, m_adaptersManager(new AdaptersManager(this))
|
||||
{
|
||||
m_line->setVisible(false);
|
||||
m_adapterLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QFont defaultFont = font();
|
||||
auto titlefont = QFont(defaultFont.family(), defaultFont.pointSize() + 2);
|
||||
|
||||
m_appletName->setText(tr("Bluetooth"));
|
||||
m_appletName->setFont(titlefont);
|
||||
initFontColor(m_appletName);
|
||||
m_appletName->setVisible(false);
|
||||
|
||||
m_openControlCenter->setText(tr("Bluetooth settings"));
|
||||
m_textLayout->addWidget(m_openControlCenter);
|
||||
m_textLayout->setContentsMargins(10, 0, 0, 0);
|
||||
initFontColor(m_openControlCenter);
|
||||
m_openControlCenter->setFixedHeight(ITEMHEIGHT);
|
||||
m_openControlCenter->setVisible(false);
|
||||
|
||||
QHBoxLayout *appletNameLayout = new QHBoxLayout;
|
||||
appletNameLayout->setMargin(0);
|
||||
appletNameLayout->setSpacing(0);
|
||||
appletNameLayout->addSpacing(MARGIN);
|
||||
appletNameLayout->addWidget(m_appletName);
|
||||
appletNameLayout->addStretch();
|
||||
|
||||
m_menueLayout->setMargin(0);
|
||||
m_menueLayout->setSpacing(0);
|
||||
m_menueLayout->addSpacing(MARGIN);
|
||||
|
||||
m_centrealLayout->setMargin(0);
|
||||
m_centrealLayout->setSpacing(0);
|
||||
m_centrealLayout->addLayout(appletNameLayout);
|
||||
m_centrealLayout->addWidget(m_line);
|
||||
m_centrealLayout->addLayout(m_adapterLayout);
|
||||
m_centrealLayout->addLayout(m_textLayout);
|
||||
m_centralWidget->setLayout(m_centrealLayout);
|
||||
m_centralWidget->setFixedWidth(POPUPWIDTH);
|
||||
m_centralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
|
||||
setFixedWidth(POPUPWIDTH);
|
||||
setWidget(m_centralWidget);
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
setFrameShape(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_centralWidget->setAutoFillBackground(false);
|
||||
viewport()->setAutoFillBackground(false);
|
||||
|
||||
connect(m_adaptersManager, &AdaptersManager::adapterIncreased, this, &BluetoothApplet::addAdapter);
|
||||
connect(m_adaptersManager, &AdaptersManager::adapterDecreased, this, &BluetoothApplet::removeAdapter);
|
||||
connect(m_openControlCenter, &MenueItem::clicked, []{
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.method(QString("ShowModule"))
|
||||
.arg(QString("bluetooth"))
|
||||
.call();
|
||||
});
|
||||
}
|
||||
|
||||
void BluetoothApplet::setAdapterPowered(bool powered)
|
||||
{
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem)
|
||||
adapterItem->setPowered(powered);
|
||||
}
|
||||
}
|
||||
|
||||
bool BluetoothApplet::poweredInitState()
|
||||
{
|
||||
return m_adaptersManager->defaultAdapterInitPowerState();
|
||||
}
|
||||
|
||||
bool BluetoothApplet::hasAadapter()
|
||||
{
|
||||
return m_adaptersManager->adaptersCount();
|
||||
}
|
||||
|
||||
QStringList BluetoothApplet::connectedDevsName()
|
||||
{
|
||||
QStringList devicesName;
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem) {
|
||||
devicesName << adapterItem->connectedDevsName();
|
||||
}
|
||||
}
|
||||
return devicesName;
|
||||
}
|
||||
|
||||
void BluetoothApplet::onPowerChanged()
|
||||
{
|
||||
bool powerState = false;
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem->isPowered()) {
|
||||
powerState = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
emit powerChanged(powerState);
|
||||
|
||||
m_openControlCenter->setVisible(powerState);
|
||||
}
|
||||
|
||||
void BluetoothApplet::onDeviceStateChanged()
|
||||
{
|
||||
Device::State deviceState = Device::StateUnavailable;
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (Device::StateAvailable == adapterItem->currentDeviceState()) {
|
||||
deviceState = Device::StateAvailable;
|
||||
continue;
|
||||
}
|
||||
if (Device::StateConnected == adapterItem->currentDeviceState()) {
|
||||
deviceState = Device::StateConnected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
emit deviceStateChanged(deviceState);
|
||||
updateView();
|
||||
}
|
||||
|
||||
void BluetoothApplet::addAdapter(Adapter *adapter)
|
||||
{
|
||||
if (!adapter)
|
||||
return;
|
||||
|
||||
if (!m_adapterItems.size()) {
|
||||
emit justHasAdapter();
|
||||
}
|
||||
|
||||
QString adapterId = adapter->id();
|
||||
//dde-session-daemon重启的时候,同一个Id的蓝牙设备会再次添加一次,因此需要先移除以前的
|
||||
if (m_adapterItems.contains(adapterId)) {
|
||||
AdapterItem *adapterItem = m_adapterItems.value(adapterId);
|
||||
if (adapterItem) {
|
||||
m_adapterLayout->removeWidget(adapterItem);
|
||||
delete adapterItem;
|
||||
m_adapterItems.remove(adapterId);
|
||||
}
|
||||
}
|
||||
|
||||
auto adatpterItem = new AdapterItem(m_adaptersManager, adapter, this);
|
||||
m_adapterItems[adapterId] = adatpterItem;
|
||||
m_adapterLayout->addWidget(adatpterItem);
|
||||
getDevieInitStatus(adatpterItem);
|
||||
|
||||
connect(adatpterItem, &AdapterItem::deviceStateChanged, this, &BluetoothApplet::onDeviceStateChanged);
|
||||
connect(adatpterItem, &AdapterItem::powerChanged, this, &BluetoothApplet::onPowerChanged);
|
||||
connect(adatpterItem, &AdapterItem::sizeChange, this, &BluetoothApplet::updateView);
|
||||
|
||||
updateView();
|
||||
}
|
||||
|
||||
void BluetoothApplet::removeAdapter(Adapter *adapter)
|
||||
{
|
||||
if (adapter) {
|
||||
QString adapterId = adapter->id();
|
||||
AdapterItem *adapterItem = m_adapterItems.value(adapterId);
|
||||
if (adapterItem) {
|
||||
m_adapterLayout->removeWidget(adapterItem);
|
||||
delete adapterItem;
|
||||
m_adapterItems.remove(adapterId);
|
||||
updateView();
|
||||
if (!m_adapterItems.size())
|
||||
emit noAdapter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BluetoothApplet::updateView()
|
||||
{
|
||||
int contentHeight = 0;
|
||||
int itemCount = 0;
|
||||
bool isPowered = false;
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem) {
|
||||
contentHeight += CONTROLHEIGHT;
|
||||
if (adapterItem->isPowered()) {
|
||||
isPowered = true;
|
||||
itemCount += adapterItem->deviceCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
m_openControlCenter->setVisible(isPowered);
|
||||
if (isPowered) {
|
||||
contentHeight += ITEMHEIGHT;
|
||||
}
|
||||
|
||||
int adaptersCnt = m_adapterItems.size();
|
||||
if (adaptersCnt > 1) {
|
||||
m_line->setVisible(true);
|
||||
m_appletName->setVisible(true);
|
||||
} else {
|
||||
m_line->setVisible(false);
|
||||
m_appletName->setVisible(false);
|
||||
}
|
||||
|
||||
if (adaptersCnt > 1)
|
||||
contentHeight += m_appletName->height();
|
||||
|
||||
contentHeight += itemCount * ITEMHEIGHT;
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
setFixedHeight(itemCount <= 10 ? contentHeight : 10 * ITEMHEIGHT);
|
||||
setVerticalScrollBarPolicy(itemCount <= 10 ? Qt::ScrollBarAlwaysOff : Qt::ScrollBarAlwaysOn);
|
||||
}
|
||||
|
||||
void BluetoothApplet::getDevieInitStatus(AdapterItem *item)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
bool powered = item->isPowered();
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem != item) {
|
||||
if (adapterItem->isPowered()) {
|
||||
powered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
emit powerChanged(powered);
|
||||
|
||||
Device::State deviceState = item->initDeviceState();
|
||||
Device::State otherDeviceState = Device::StateUnavailable;
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem != item) {
|
||||
if (Device::StateAvailable == adapterItem->currentDeviceState()) {
|
||||
otherDeviceState = Device::StateAvailable;
|
||||
continue;
|
||||
}
|
||||
if (Device::StateConnected == adapterItem->currentDeviceState()) {
|
||||
otherDeviceState = Device::StateConnected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (deviceState) {
|
||||
case Device::StateConnected:
|
||||
emit deviceStateChanged(deviceState);
|
||||
break;
|
||||
case Device::StateUnavailable:
|
||||
emit deviceStateChanged(otherDeviceState);
|
||||
break;
|
||||
case Device::StateAvailable: {
|
||||
if (otherDeviceState != Device::StateConnected)
|
||||
emit deviceStateChanged(deviceState);
|
||||
else
|
||||
emit deviceStateChanged(otherDeviceState);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void BluetoothApplet::setAdapterRefresh()
|
||||
{
|
||||
for (AdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem)
|
||||
adapterItem->refresh();
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLUETOOTHAPPLET_H
|
||||
#define BLUETOOTHAPPLET_H
|
||||
|
||||
#include "componments/device.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
|
||||
class QLabel;
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class Adapter;
|
||||
class AdapterItem;
|
||||
class HorizontalSeparator;
|
||||
class MenueItem;
|
||||
class AdaptersManager;
|
||||
class BluetoothApplet : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothApplet(QWidget *parent = nullptr);
|
||||
void setAdapterPowered(bool powered);
|
||||
void setAdapterRefresh();
|
||||
bool poweredInitState();
|
||||
bool hasAadapter();
|
||||
QStringList connectedDevsName();
|
||||
|
||||
public slots :
|
||||
void addAdapter(Adapter *adapter);
|
||||
void removeAdapter(Adapter *adapter);
|
||||
|
||||
signals:
|
||||
void powerChanged(bool powered);
|
||||
void deviceStateChanged(const Device::State state);
|
||||
void noAdapter();
|
||||
void justHasAdapter();
|
||||
|
||||
private slots:
|
||||
void onPowerChanged();
|
||||
void onDeviceStateChanged();
|
||||
|
||||
private:
|
||||
void updateView();
|
||||
void getDevieInitStatus(AdapterItem *item);
|
||||
|
||||
private:
|
||||
HorizontalSeparator *m_line;
|
||||
QLabel *m_appletName;
|
||||
QWidget *m_centralWidget;
|
||||
QVBoxLayout *m_centrealLayout;
|
||||
QVBoxLayout *m_adapterLayout;
|
||||
QHBoxLayout *m_menueLayout;
|
||||
MenueItem *m_openControlCenter;
|
||||
QVBoxLayout *m_textLayout;
|
||||
|
||||
AdaptersManager *m_adaptersManager;
|
||||
|
||||
QMap<QString, AdapterItem *> m_adapterItems;
|
||||
Device::State m_initDeviceState;
|
||||
};
|
||||
|
||||
#endif // BLUETOOTHAPPLET_H
|
@ -24,7 +24,7 @@
|
||||
#include "constants.h"
|
||||
#include "../widgets/tipswidget.h"
|
||||
#include "../frame/util/imageutil.h"
|
||||
#include "bluetoothapplet.h"
|
||||
#include "componments/bluetoothapplet.h"
|
||||
|
||||
#include <DApplication>
|
||||
#include <DDBusSender>
|
||||
@ -45,21 +45,26 @@ BluetoothItem::BluetoothItem(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_tipsLabel(new TipsWidget(this))
|
||||
, m_applet(new BluetoothApplet(this))
|
||||
, m_devState(Device::State::StateUnavailable)
|
||||
, m_adapterPowered(m_applet->poweredInitState())
|
||||
{
|
||||
setAccessibleName("BluetoothPluginItem");
|
||||
m_applet->setVisible(false);
|
||||
m_adapterPowered = m_applet->poweredInitState();
|
||||
m_tipsLabel->setVisible(false);
|
||||
refreshIcon();
|
||||
|
||||
connect(m_applet, &BluetoothApplet::powerChanged, [&](bool powered) {
|
||||
connect(m_applet, &BluetoothApplet::powerChanged, [ & ] (bool powered) {
|
||||
m_adapterPowered = powered;
|
||||
refreshIcon();
|
||||
});
|
||||
connect(m_applet, &BluetoothApplet::deviceStateChanged, [&](const Device::State state) {
|
||||
m_devState = state;
|
||||
connect(m_applet, &BluetoothApplet::deviceStateChanged, [ & ] (const Device* device) {
|
||||
m_devState = device->state();
|
||||
refreshIcon();
|
||||
refreshTips();
|
||||
});
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &BluetoothItem::refreshIcon);
|
||||
connect(m_applet,&BluetoothApplet::noAdapter,this,&BluetoothItem::noAdapter);
|
||||
connect(m_applet,&BluetoothApplet::justHasAdapter,this,&BluetoothItem::justHasAdapter);
|
||||
connect(m_applet, &BluetoothApplet::noAdapter, this, &BluetoothItem::noAdapter);
|
||||
connect(m_applet, &BluetoothApplet::justHasAdapter, this, &BluetoothItem::justHasAdapter);
|
||||
}
|
||||
|
||||
QWidget *BluetoothItem::tipsWidget()
|
||||
@ -124,9 +129,6 @@ void BluetoothItem::invokeMenuItem(const QString menuId, const bool checked)
|
||||
|
||||
void BluetoothItem::refreshIcon()
|
||||
{
|
||||
if (!m_applet)
|
||||
return;
|
||||
|
||||
QString stateString;
|
||||
QString iconString;
|
||||
|
||||
@ -160,16 +162,13 @@ void BluetoothItem::refreshIcon()
|
||||
|
||||
void BluetoothItem::refreshTips()
|
||||
{
|
||||
if (!m_applet)
|
||||
return;
|
||||
|
||||
QString tipsText;
|
||||
|
||||
if (m_adapterPowered) {
|
||||
switch (m_devState) {
|
||||
case Device::StateConnected: {
|
||||
QStringList textList;
|
||||
for (QString devName : m_applet->connectedDevsName()) {
|
||||
for (QString devName : m_applet->connectedDevicesName()) {
|
||||
textList << tr("%1 connected").arg(devName);
|
||||
}
|
||||
m_tipsLabel->setTextList(textList);
|
||||
@ -223,4 +222,3 @@ void BluetoothItem::paintEvent(QPaintEvent *event)
|
||||
const QRectF &rfp = QRectF(m_iconPixmap.rect());
|
||||
painter.drawPixmap(rf.center() - rfp.center() / m_iconPixmap.devicePixelRatioF(), m_iconPixmap);
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#define BLUETOOTH_KEY "bluetooth-item-key"
|
||||
|
||||
class BluetoothApplet;
|
||||
|
||||
namespace Dock {
|
||||
class TipsWidget;
|
||||
}
|
||||
@ -63,8 +64,8 @@ signals:
|
||||
private:
|
||||
Dock::TipsWidget *m_tipsLabel;
|
||||
BluetoothApplet *m_applet;
|
||||
QPixmap m_iconPixmap;
|
||||
|
||||
QPixmap m_iconPixmap;
|
||||
Device::State m_devState;
|
||||
bool m_adapterPowered;
|
||||
};
|
||||
|
@ -1,362 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "adapteritem.h"
|
||||
#include "switchitem.h"
|
||||
#include "deviceitem.h"
|
||||
#include "adapter.h"
|
||||
#include "adaptersmanager.h"
|
||||
#include "bluetoothconstants.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
extern void initFontColor(QWidget *widget);
|
||||
|
||||
AdapterItem::AdapterItem(AdaptersManager *adapterManager, Adapter *adapter, QWidget *parent)
|
||||
: QScrollArea(parent)
|
||||
, m_centralWidget(new QWidget(this))
|
||||
, m_line(new HorizontalSeparator(this))
|
||||
, m_deviceLayout(new QVBoxLayout)
|
||||
, m_adaptersManager(adapterManager)
|
||||
, m_adapter(adapter)
|
||||
, m_switchItem(new SwitchItem(this))
|
||||
{
|
||||
m_centralWidget->setFixedWidth(POPUPWIDTH);
|
||||
m_line->setVisible(true);
|
||||
m_deviceLayout->setMargin(0);
|
||||
m_deviceLayout->setSpacing(0);
|
||||
|
||||
m_switchItem->setTitle(adapter->name());
|
||||
m_switchItem->setChecked(adapter->powered(),false);
|
||||
m_switchItem->setLoading(adapter->discover());
|
||||
|
||||
m_deviceLayout->addWidget(m_switchItem, Qt::AlignCenter);
|
||||
m_deviceLayout->addWidget(m_line);
|
||||
m_centralWidget->setFixedWidth(POPUPWIDTH);
|
||||
m_centralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
m_centralWidget->setLayout(m_deviceLayout);
|
||||
|
||||
setFixedWidth(POPUPWIDTH);
|
||||
setWidget(m_centralWidget);
|
||||
setFrameShape(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_centralWidget->setAutoFillBackground(false);
|
||||
viewport()->setAutoFillBackground(false);
|
||||
|
||||
QMap<QString, const Device *> myDevices = adapter->devices();
|
||||
for (const Device *constDevice : myDevices) {
|
||||
auto device = const_cast<Device *>(constDevice);
|
||||
if (device)
|
||||
createDeviceItem(device);
|
||||
}
|
||||
|
||||
m_initDeviceState = Device::StateUnavailable;
|
||||
for (const Device *constDevice : myDevices) {
|
||||
auto device = const_cast<Device *>(constDevice);
|
||||
if (device) {
|
||||
if (device->state() == Device::StateAvailable) {
|
||||
m_initDeviceState = Device::StateAvailable;
|
||||
continue;
|
||||
}
|
||||
if (device->state() == Device::StateConnected && device->connectState()) {
|
||||
m_initDeviceState = Device::StateConnected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
connect(m_switchItem, &SwitchItem::checkedChanged, this, &AdapterItem::showAndConnect);
|
||||
connect(m_switchItem, &SwitchItem::refresh, this, &AdapterItem::refresh);
|
||||
connect(m_switchItem, &SwitchItem::justUpdateView, [&](bool checked){
|
||||
showDevices(checked);
|
||||
emit powerChanged(checked);
|
||||
});
|
||||
connect(adapter, &Adapter::nameChanged, m_switchItem, &SwitchItem::setTitle);
|
||||
connect(adapter, &Adapter::deviceAdded, this, &AdapterItem::addDeviceItem);
|
||||
connect(adapter, &Adapter::deviceRemoved, this, &AdapterItem::removeDeviceItem);
|
||||
connect(adapter, &Adapter::poweredChanged, m_switchItem, [=](const bool powered){
|
||||
m_switchItem->setChecked(powered, false);
|
||||
});
|
||||
|
||||
connect(adapter, &Adapter::discoveringChanged, m_switchItem, [=](const bool discovering){
|
||||
m_switchItem->setLoading(discovering);
|
||||
});
|
||||
|
||||
showDevices(adapter->powered());
|
||||
}
|
||||
|
||||
int AdapterItem::deviceCount()
|
||||
{
|
||||
return m_deviceItems.size();
|
||||
}
|
||||
|
||||
void AdapterItem::setPowered(bool powered)
|
||||
{
|
||||
m_switchItem->setChecked(powered,true);
|
||||
}
|
||||
|
||||
bool AdapterItem::isPowered()
|
||||
{
|
||||
return m_switchItem->checkState();
|
||||
}
|
||||
|
||||
QStringList AdapterItem::connectedDevsName()
|
||||
{
|
||||
QStringList devsName;
|
||||
for (DeviceItem *devItem : m_sortConnected) {
|
||||
if (devItem) {
|
||||
devsName << devItem->title();
|
||||
}
|
||||
}
|
||||
|
||||
return devsName;
|
||||
}
|
||||
|
||||
void AdapterItem::deviceItemPaired(const bool paired)
|
||||
{
|
||||
auto device = qobject_cast<Device *>(sender());
|
||||
if (device) {
|
||||
DeviceItem *deviceItem = m_deviceItems.value(device->id());
|
||||
if (paired) {
|
||||
int index = m_sortConnected.indexOf(deviceItem);
|
||||
|
||||
if (index < 0) {
|
||||
m_sortUnConnect.removeOne(deviceItem);
|
||||
m_sortConnected << deviceItem;
|
||||
}
|
||||
} else {
|
||||
int index = m_sortUnConnect.indexOf(deviceItem);
|
||||
|
||||
if(index < 0){
|
||||
m_sortConnected.removeOne(deviceItem);
|
||||
m_sortUnConnect << deviceItem;
|
||||
}
|
||||
}
|
||||
showDevices(m_adapter->powered());
|
||||
}
|
||||
}
|
||||
|
||||
void AdapterItem::deviceRssiChanged()
|
||||
{
|
||||
auto device = qobject_cast<Device *>(sender());
|
||||
if (device) {
|
||||
DeviceItem *deviceItem = m_deviceItems.value(device->id());
|
||||
Device::State state = device->state();
|
||||
if (deviceItem && Device::StateConnected == state)
|
||||
qSort(m_sortConnected);
|
||||
else
|
||||
qSort(m_sortUnConnect);
|
||||
moveDeviceItem(state, deviceItem);
|
||||
}
|
||||
}
|
||||
|
||||
void AdapterItem::removeDeviceItem(const Device *device)
|
||||
{
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
DeviceItem *deviceItem = m_deviceItems.value(device->id());
|
||||
if (deviceItem) {
|
||||
m_deviceItems.remove(device->id());
|
||||
m_sortConnected.removeOne(deviceItem);
|
||||
m_sortUnConnect.removeOne(deviceItem);
|
||||
m_deviceLayout->removeWidget(deviceItem);
|
||||
delete deviceItem;
|
||||
}
|
||||
showDevices(m_adapter->powered());
|
||||
}
|
||||
|
||||
void AdapterItem::showAndConnect(bool change)
|
||||
{
|
||||
m_adaptersManager->setAdapterPowered(m_adapter, change);
|
||||
showDevices(change);
|
||||
emit powerChanged(change);
|
||||
}
|
||||
|
||||
void AdapterItem::addDeviceItem(const Device *constDevice)
|
||||
{
|
||||
auto device = const_cast<Device *>(constDevice);
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
createDeviceItem(device);
|
||||
showDevices(m_adapter->powered());
|
||||
}
|
||||
|
||||
void AdapterItem::deviceChangeState(const Device::State state)
|
||||
{
|
||||
auto device = qobject_cast<Device *>(sender());
|
||||
|
||||
auto setUnavailableItem = [this](const Device::State state, DeviceItem *deviceItem){
|
||||
int index = m_sortUnConnect.indexOf(deviceItem);
|
||||
if (index < 0) {
|
||||
m_sortConnected.removeOne(deviceItem);
|
||||
m_sortUnConnect << deviceItem;
|
||||
qSort(m_sortUnConnect);
|
||||
moveDeviceItem(state, deviceItem);
|
||||
}
|
||||
};
|
||||
|
||||
if (device) {
|
||||
DeviceItem *deviceItem = m_deviceItems.value(device->id());
|
||||
if (deviceItem) {
|
||||
switch (state) {
|
||||
case Device::StateUnavailable: {
|
||||
setUnavailableItem(state, deviceItem);
|
||||
}
|
||||
break;
|
||||
case Device::StateAvailable: {
|
||||
int index = m_sortUnConnect.indexOf(deviceItem);
|
||||
if (index < 0)
|
||||
m_sortConnected.removeOne(deviceItem);
|
||||
}
|
||||
break;
|
||||
case Device::StateConnected: {
|
||||
if (!device->connectState()) {
|
||||
setUnavailableItem(state, deviceItem);
|
||||
break;
|
||||
}
|
||||
int index = m_sortConnected.indexOf(deviceItem);
|
||||
if (index < 0) {
|
||||
m_sortUnConnect.removeOne(deviceItem);
|
||||
m_sortConnected << deviceItem;
|
||||
qSort(m_sortConnected);
|
||||
moveDeviceItem(state, deviceItem);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_sortConnected.size() > 0)
|
||||
m_currentDeviceState = Device::StateConnected;
|
||||
else if (state == Device::StateAvailable)
|
||||
m_currentDeviceState = Device::StateAvailable;
|
||||
else
|
||||
m_currentDeviceState = Device::StateUnavailable;
|
||||
|
||||
emit deviceStateChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void AdapterItem::moveDeviceItem(Device::State state, DeviceItem *item)
|
||||
{
|
||||
int size = m_sortConnected.size();
|
||||
int index = 0;
|
||||
switch (state) {
|
||||
case Device::StateUnavailable:
|
||||
case Device::StateAvailable: {
|
||||
index = m_sortUnConnect.indexOf(item);
|
||||
index += size;
|
||||
}
|
||||
break;
|
||||
case Device::StateConnected: {
|
||||
index = m_sortUnConnect.indexOf(item);
|
||||
}
|
||||
break;
|
||||
}
|
||||
index += 2;
|
||||
m_deviceLayout->removeWidget(item);
|
||||
m_deviceLayout->insertWidget(index, item);
|
||||
}
|
||||
|
||||
void AdapterItem::createDeviceItem(Device *device)
|
||||
{
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
QString deviceId = device->id();
|
||||
auto deviceItem = new DeviceItem(device, this);
|
||||
m_deviceItems[deviceId] = deviceItem;
|
||||
if (device->state() == Device::StateConnected)
|
||||
m_sortConnected << deviceItem;
|
||||
else
|
||||
m_sortUnConnect << deviceItem;
|
||||
|
||||
connect(device, &Device::pairedChanged, this, &AdapterItem::deviceItemPaired);
|
||||
connect(device, &Device::nameChanged, deviceItem, &DeviceItem::setTitle);
|
||||
connect(device, &Device::stateChanged, deviceItem, &DeviceItem::changeState);
|
||||
connect(device, &Device::stateChanged, this, &AdapterItem::deviceChangeState);
|
||||
connect(device, &Device::rssiChanged, this, &AdapterItem::deviceRssiChanged);
|
||||
connect(deviceItem, &DeviceItem::clicked, m_adaptersManager, [this, deviceItem](Device *device) {
|
||||
m_adaptersManager->connectDevice(device, m_adapter);
|
||||
m_deviceLayout->removeWidget(deviceItem);
|
||||
m_deviceLayout->insertWidget(1, deviceItem);
|
||||
});
|
||||
}
|
||||
|
||||
void AdapterItem::updateView()
|
||||
{
|
||||
int contentHeight = m_switchItem->height();
|
||||
contentHeight += (m_deviceLayout->count() - 2) * ITEMHEIGHT;
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
setFixedHeight(contentHeight);
|
||||
emit sizeChange();
|
||||
}
|
||||
|
||||
void AdapterItem::showDevices(bool powered)
|
||||
{
|
||||
if (m_sortConnected.size())
|
||||
qSort(m_sortConnected);
|
||||
if (m_sortUnConnect.size())
|
||||
qSort(m_sortUnConnect);
|
||||
|
||||
QList<DeviceItem *> deviceItems;
|
||||
deviceItems << m_sortConnected << m_sortUnConnect;
|
||||
|
||||
// 在蓝牙关闭的时候,会出现不在connected和Unconnect列表中的设备(连接/关闭中的状态),关闭的时候使用总表参数
|
||||
qDebug() << m_sortConnected.size() << m_sortUnConnect.size() << m_deviceItems.size();
|
||||
if (powered) {
|
||||
for (DeviceItem *deviceItem : deviceItems) {
|
||||
if (deviceItem) {
|
||||
m_deviceLayout->addWidget(deviceItem);
|
||||
deviceItem->setVisible(powered);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (DeviceItem *deviceItem : m_deviceItems) {
|
||||
if (deviceItem) {
|
||||
m_deviceLayout->removeWidget(deviceItem);
|
||||
deviceItem->setVisible(powered);
|
||||
}
|
||||
}
|
||||
|
||||
for (DeviceItem *deviceItem : m_sortConnected) {
|
||||
if (deviceItem) {
|
||||
m_adaptersManager->disconnectDevice(deviceItem->device());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_line->setVisible(powered);
|
||||
updateView();
|
||||
}
|
||||
|
||||
void AdapterItem::refresh()
|
||||
{
|
||||
if (m_adapter->discover())
|
||||
return;
|
||||
m_adaptersManager->adapterRefresh(m_adapter);
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ADAPTERITEM_H
|
||||
#define ADAPTERITEM_H
|
||||
|
||||
#include "device.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
|
||||
class QLabel;
|
||||
class QVBoxLayout;
|
||||
class HorizontalSeparator;
|
||||
class Adapter;
|
||||
class SwitchItem;
|
||||
class DeviceItem;
|
||||
class AdaptersManager;
|
||||
class MenueItem;
|
||||
class AdapterItem : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AdapterItem(AdaptersManager *a, Adapter *adapter, QWidget *parent = nullptr);
|
||||
int deviceCount();
|
||||
void setPowered(bool powered);
|
||||
bool isPowered();
|
||||
inline Device::State initDeviceState() { return m_initDeviceState; }
|
||||
inline Device::State currentDeviceState() { return m_currentDeviceState; }
|
||||
QStringList connectedDevsName();
|
||||
|
||||
signals:
|
||||
void deviceStateChanged();
|
||||
void powerChanged(bool powered);
|
||||
void sizeChange();
|
||||
|
||||
private slots:
|
||||
void deviceItemPaired(const bool paired);
|
||||
void deviceRssiChanged();
|
||||
void removeDeviceItem(const Device *device);
|
||||
void showAndConnect(bool change);
|
||||
void addDeviceItem(const Device *constDevice);
|
||||
void deviceChangeState(const Device::State state);
|
||||
void moveDeviceItem(Device::State state, DeviceItem *item);
|
||||
|
||||
public slots:
|
||||
void refresh();
|
||||
|
||||
private:
|
||||
void createDeviceItem(Device *device);
|
||||
void updateView();
|
||||
void showDevices(bool powered);
|
||||
|
||||
private:
|
||||
QWidget *m_centralWidget;
|
||||
HorizontalSeparator *m_line;
|
||||
QVBoxLayout *m_deviceLayout;
|
||||
|
||||
AdaptersManager *m_adaptersManager;
|
||||
|
||||
Adapter *m_adapter;
|
||||
SwitchItem *m_switchItem;
|
||||
QMap<QString, DeviceItem *> m_deviceItems;
|
||||
Device::State m_initDeviceState;
|
||||
Device::State m_currentDeviceState;
|
||||
QList<DeviceItem *> m_sortConnected;
|
||||
QList<DeviceItem *> m_sortUnConnect;
|
||||
QMap<DeviceItem *, Device::State> m_devicesState;
|
||||
};
|
||||
|
||||
#endif // ADAPTERITEM_H
|
@ -37,11 +37,11 @@ AdaptersManager::AdaptersManager(QObject *parent)
|
||||
this))
|
||||
, m_defaultAdapterState(false)
|
||||
{
|
||||
connect(m_bluetoothInter, &DBusBluetooth::AdapterAdded, this, &AdaptersManager::addAdapter);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::AdapterRemoved, this, &AdaptersManager::removeAdapter);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::AdapterAdded, this, &AdaptersManager::onAddAdapter);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::AdapterRemoved, this, &AdaptersManager::onRemoveAdapter);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::AdapterPropertiesChanged, this, &AdaptersManager::onAdapterPropertiesChanged);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::DeviceAdded, this, &AdaptersManager::addDevice);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::DeviceRemoved, this, &AdaptersManager::removeDevice);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::DeviceAdded, this, &AdaptersManager::onAddDevice);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::DeviceRemoved, this, &AdaptersManager::onRemoveDevice);
|
||||
connect(m_bluetoothInter, &DBusBluetooth::DevicePropertiesChanged, this, &AdaptersManager::onDevicePropertiesChanged);
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
@ -112,7 +112,7 @@ void AdaptersManager::setAdapterPowered(const Adapter *adapter, const bool &powe
|
||||
}
|
||||
}
|
||||
|
||||
void AdaptersManager::connectDevice(Device *device, Adapter *adapter)
|
||||
void AdaptersManager::connectDevice(const Device *device, Adapter *adapter)
|
||||
{
|
||||
if (device) {
|
||||
QDBusObjectPath path(device->id());
|
||||
@ -150,6 +150,10 @@ void AdaptersManager::onAdapterPropertiesChanged(const QString &json)
|
||||
const QString id = obj["Path"].toString();
|
||||
QDBusObjectPath dPath(id);
|
||||
|
||||
if (!m_adapters.contains(id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Adapter *adapter = const_cast<Adapter *>(m_adapters[id]);
|
||||
if (adapter) {
|
||||
inflateAdapter(adapter, obj);
|
||||
@ -167,19 +171,23 @@ void AdaptersManager::onDevicePropertiesChanged(const QString &json)
|
||||
}
|
||||
}
|
||||
|
||||
void AdaptersManager::addAdapter(const QString &json)
|
||||
void AdaptersManager::onAddAdapter(const QString &json)
|
||||
{
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||
auto adapter = new Adapter(this);
|
||||
adapterAdd(adapter, doc.object());
|
||||
}
|
||||
|
||||
void AdaptersManager::removeAdapter(const QString &json)
|
||||
void AdaptersManager::onRemoveAdapter(const QString &json)
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||
QJsonObject obj = doc.object();
|
||||
const QString id = obj["Path"].toString();
|
||||
|
||||
if (!m_adapters.contains(id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Adapter *result = m_adapters[id];
|
||||
Adapter *adapter = const_cast<Adapter *>(result);
|
||||
if (adapter) {
|
||||
@ -189,13 +197,17 @@ void AdaptersManager::removeAdapter(const QString &json)
|
||||
}
|
||||
}
|
||||
|
||||
void AdaptersManager::addDevice(const QString &json)
|
||||
void AdaptersManager::onAddDevice(const QString &json)
|
||||
{
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||
const QJsonObject obj = doc.object();
|
||||
const QString adapterId = obj["AdapterPath"].toString();
|
||||
const QString deviceId = obj["Path"].toString();
|
||||
|
||||
if (!m_adapters.contains(adapterId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Adapter *result = m_adapters[adapterId];
|
||||
Adapter *adapter = const_cast<Adapter *>(result);
|
||||
if (adapter) {
|
||||
@ -207,13 +219,17 @@ void AdaptersManager::addDevice(const QString &json)
|
||||
}
|
||||
}
|
||||
|
||||
void AdaptersManager::removeDevice(const QString &json)
|
||||
void AdaptersManager::onRemoveDevice(const QString &json)
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||
QJsonObject obj = doc.object();
|
||||
const QString adapterId = obj["AdapterPath"].toString();
|
||||
const QString deviceId = obj["Path"].toString();
|
||||
|
||||
if (!m_adapters.contains(adapterId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Adapter *result = m_adapters[adapterId];
|
||||
Adapter *adapter = const_cast<Adapter *>(result);
|
||||
if (adapter) {
|
||||
@ -247,11 +263,11 @@ void AdaptersManager::adapterAdd(Adapter *adapter, const QJsonObject &adpterObj)
|
||||
|
||||
QString id = adapter->id();
|
||||
if (!id.isEmpty()) {
|
||||
// in case memory leaks
|
||||
if (m_adapters.contains(id)) {
|
||||
return;
|
||||
if (!m_adapters.contains(id)) {
|
||||
m_adapters[id] = adapter;
|
||||
} else if (m_adapters[id] == nullptr) {
|
||||
m_adapters[id] = adapter;
|
||||
}
|
||||
m_adapters[id] = adapter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
explicit AdaptersManager(QObject *parent = nullptr);
|
||||
|
||||
void setAdapterPowered(const Adapter *adapter, const bool &powered);
|
||||
void connectDevice(Device *device, Adapter *adapter);
|
||||
void connectDevice(const Device *device, Adapter *adapter);
|
||||
bool defaultAdapterInitPowerState();
|
||||
int adaptersCount();
|
||||
void adapterRefresh(const Adapter *adapter);
|
||||
@ -49,11 +49,11 @@ private slots:
|
||||
void onAdapterPropertiesChanged(const QString &json);
|
||||
void onDevicePropertiesChanged(const QString &json);
|
||||
|
||||
void addAdapter(const QString &json);
|
||||
void removeAdapter(const QString &json);
|
||||
void onAddAdapter(const QString &json);
|
||||
void onRemoveAdapter(const QString &json);
|
||||
|
||||
void addDevice(const QString &json);
|
||||
void removeDevice(const QString &json);
|
||||
void onAddDevice(const QString &json);
|
||||
void onRemoveDevice(const QString &json);
|
||||
|
||||
private:
|
||||
void adapterAdd(Adapter *adapter, const QJsonObject &adpterObj);
|
||||
@ -62,7 +62,6 @@ private:
|
||||
private:
|
||||
DBusBluetooth *m_bluetoothInter;
|
||||
QMap<QString, const Adapter *> m_adapters;
|
||||
|
||||
bool m_defaultAdapterState;
|
||||
};
|
||||
|
||||
|
276
plugins/bluetooth/componments/bluetoothadapteritem.cpp
Normal file
276
plugins/bluetooth/componments/bluetoothadapteritem.cpp
Normal file
@ -0,0 +1,276 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
* Maintainer: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "bluetoothadapteritem.h"
|
||||
#include "componments/adapter.h"
|
||||
#include "bluetoothapplet.h"
|
||||
#include "bluetoothconstants.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include <DFontSizeManager>
|
||||
#include <DLabel>
|
||||
#include <DSwitchButton>
|
||||
#include <DListView>
|
||||
#include <DSpinner>
|
||||
#include <DApplicationHelper>
|
||||
|
||||
BluetoothDeviceItem::BluetoothDeviceItem(QStyle *style, const Device *device, DListView *parent)
|
||||
: m_style(style)
|
||||
, m_device(device)
|
||||
, m_standarditem(new DStandardItem())
|
||||
, m_loading(new DSpinner(parent))
|
||||
{
|
||||
initActionList();
|
||||
initConnect();
|
||||
}
|
||||
|
||||
BluetoothDeviceItem::~BluetoothDeviceItem()
|
||||
{
|
||||
if (m_loading != nullptr) {
|
||||
delete m_loading;
|
||||
m_loading = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void BluetoothDeviceItem::initActionList()
|
||||
{
|
||||
m_labelAction = new DViewItemAction(Qt::AlignLeft | Qt::AlignVCenter, QSize(), QSize(), false);
|
||||
m_stateAction = new DViewItemAction(Qt::AlignLeft | Qt::AlignVCenter, QSize(), QSize(), true);
|
||||
|
||||
m_loading->setFixedSize(QSize(24, 24));
|
||||
m_stateAction->setWidget(m_loading);
|
||||
|
||||
m_standarditem->setAccessibleText(m_device->name());
|
||||
m_standarditem->setActionList(Qt::RightEdge, {m_stateAction});
|
||||
m_standarditem->setActionList(Qt::LeftEdge, {m_labelAction});
|
||||
|
||||
m_labelAction->setText(m_device->name());
|
||||
updateDeviceState(m_device->state());
|
||||
updateIconTheme(DGuiApplicationHelper::instance()->themeType());
|
||||
}
|
||||
|
||||
void BluetoothDeviceItem::initConnect()
|
||||
{
|
||||
connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, this, &BluetoothDeviceItem::updateIconTheme);
|
||||
connect(m_device, &Device::stateChanged, this, &BluetoothDeviceItem::updateDeviceState);
|
||||
}
|
||||
|
||||
void BluetoothDeviceItem::updateIconTheme(DGuiApplicationHelper::ColorType type)
|
||||
{
|
||||
if (type == DGuiApplicationHelper::LightType) {
|
||||
if (!m_device->deviceType().isEmpty()) {
|
||||
m_deviceIcon = LightString.arg(m_device->deviceType());
|
||||
} else {
|
||||
m_deviceIcon = LightString.arg("other");
|
||||
}
|
||||
} else {
|
||||
if (!m_device->deviceType().isEmpty()) {
|
||||
m_deviceIcon = DarkString.arg(m_device->deviceType());
|
||||
} else {
|
||||
m_deviceIcon = DarkString.arg("other");
|
||||
}
|
||||
}
|
||||
m_labelAction->setIcon(QIcon(m_deviceIcon));
|
||||
}
|
||||
|
||||
void BluetoothDeviceItem::updateDeviceState(Device::State state)
|
||||
{
|
||||
m_labelAction->setText(m_device->name());
|
||||
if (state == Device::StateAvailable) {
|
||||
m_loading->start();
|
||||
m_stateAction->setVisible(true);
|
||||
m_standarditem->setCheckState(Qt::Unchecked);
|
||||
} else if (state == Device::StateConnected){
|
||||
m_loading->stop();
|
||||
m_stateAction->setVisible(false);
|
||||
m_standarditem->setCheckState(Qt::Checked);
|
||||
emit requestTopDeviceItem(m_standarditem);
|
||||
} else {
|
||||
m_loading->stop();
|
||||
m_stateAction->setVisible(false);
|
||||
m_standarditem->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
emit deviceStateChanged(m_device);
|
||||
}
|
||||
|
||||
BluetoothAdapterItem::BluetoothAdapterItem(Adapter *adapter, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_adapter(adapter)
|
||||
, m_adapterLabel(new SettingLabel(adapter->name(), this))
|
||||
, m_adapterStateBtn(new DSwitchButton(this))
|
||||
, m_deviceListview(new DListView(this))
|
||||
, m_deviceModel(new QStandardItemModel(m_deviceListview))
|
||||
{
|
||||
initData();
|
||||
initUi();
|
||||
initConnect();
|
||||
}
|
||||
|
||||
BluetoothAdapterItem::~BluetoothAdapterItem()
|
||||
{
|
||||
qDeleteAll(m_deviceItems);
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::onConnectDevice(const QModelIndex &index)
|
||||
{
|
||||
const QStandardItemModel *deviceModel = dynamic_cast<const QStandardItemModel *>(index.model());
|
||||
if (!deviceModel)
|
||||
return;
|
||||
DStandardItem *deviceitem = dynamic_cast<DStandardItem *>(deviceModel->item(index.row()));
|
||||
|
||||
foreach(const auto item, m_deviceItems) {
|
||||
if (item->standardItem() == deviceitem) {
|
||||
emit connectDevice(item->device(), m_adapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::onTopDeviceItem(DStandardItem *item)
|
||||
{
|
||||
if (!item || item->row() == -1 || item->row() == 0)
|
||||
return;
|
||||
|
||||
int index1 = item->row();
|
||||
QStandardItem *index = m_deviceModel->takeItem(index1, 0);
|
||||
m_deviceModel->removeRow(index1);
|
||||
m_deviceModel->insertRow(0, index);
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::onAdapterNameChanged(const QString name)
|
||||
{
|
||||
m_adapterLabel->label()->setText(name);
|
||||
}
|
||||
|
||||
int BluetoothAdapterItem::currentDeviceCount()
|
||||
{
|
||||
return m_deviceItems.size();
|
||||
}
|
||||
|
||||
QStringList BluetoothAdapterItem::connectedDevicesName()
|
||||
{
|
||||
QStringList devsName;
|
||||
for (BluetoothDeviceItem *devItem : m_deviceItems) {
|
||||
if (devItem && devItem->device()->state() == Device::StateConnected) {
|
||||
devsName << devItem->device()->name();
|
||||
}
|
||||
}
|
||||
|
||||
return devsName;
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::initData()
|
||||
{
|
||||
if (!m_adapter->powered())
|
||||
return;
|
||||
|
||||
foreach(const auto device, m_adapter->devices()) {
|
||||
if (!m_deviceItems.contains(device->id()))
|
||||
onDeviceAdded(device);
|
||||
}
|
||||
emit deviceCountChanged();
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::onDeviceAdded(const Device *device)
|
||||
{
|
||||
int insertRow = 0;
|
||||
foreach(const auto item, m_deviceItems) {
|
||||
if (item->device()->connectState()) {
|
||||
insertRow++;
|
||||
}
|
||||
}
|
||||
|
||||
BluetoothDeviceItem *item = new BluetoothDeviceItem(style(), device, m_deviceListview);
|
||||
connect(item, &BluetoothDeviceItem::requestTopDeviceItem, this, &BluetoothAdapterItem::onTopDeviceItem);
|
||||
connect(item, &BluetoothDeviceItem::deviceStateChanged, this, &BluetoothAdapterItem::deviceStateChanged);
|
||||
|
||||
m_deviceItems.insert(device->id(), item);
|
||||
m_deviceModel->insertRow(insertRow, item->standardItem());
|
||||
emit deviceCountChanged();
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::onDeviceRemoved(const Device *device)
|
||||
{
|
||||
if(m_deviceItems.isEmpty())
|
||||
return;
|
||||
|
||||
m_deviceModel->removeRow(m_deviceItems.value(device->id())->standardItem()->row());
|
||||
m_deviceItems.value(device->id())->deleteLater();
|
||||
m_deviceItems.remove(device->id());
|
||||
emit deviceCountChanged();
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::initUi()
|
||||
{
|
||||
setAccessibleName(m_adapter->name());
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
m_adapterLabel->setFixedSize(ItemWidth, TitleHeight);
|
||||
m_adapterLabel->addSwichButton(m_adapterStateBtn);
|
||||
DFontSizeManager::instance()->bind(m_adapterLabel->label(), DFontSizeManager::T4);
|
||||
|
||||
m_adapterStateBtn->setChecked(m_adapter->powered());
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
m_deviceListview->setAccessibleName("DeviceItemList");
|
||||
m_deviceListview->setModel(m_deviceModel);
|
||||
m_deviceListview->setItemSpacing(1);
|
||||
m_deviceListview->setItemSize(QSize(ItemWidth, DeviceItemHeight));
|
||||
m_deviceListview->setBackgroundType(DStyledItemDelegate::ClipCornerBackground);
|
||||
m_deviceListview->setItemRadius(0);
|
||||
m_deviceListview->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
m_deviceListview->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
m_deviceListview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_deviceListview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_deviceListview->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
||||
m_deviceListview->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
|
||||
mainLayout->addWidget(m_adapterLabel);
|
||||
mainLayout->addSpacing(2);
|
||||
mainLayout->addWidget(m_deviceListview);
|
||||
}
|
||||
|
||||
void BluetoothAdapterItem::initConnect()
|
||||
{
|
||||
connect(m_adapter, &Adapter::deviceAdded, this, &BluetoothAdapterItem::onDeviceAdded);
|
||||
connect(m_adapter, &Adapter::deviceRemoved, this, &BluetoothAdapterItem::onDeviceRemoved);
|
||||
connect(m_adapter, &Adapter::nameChanged, this, &BluetoothAdapterItem::onAdapterNameChanged);
|
||||
connect(m_deviceListview, &DListView::clicked, this, &BluetoothAdapterItem::onConnectDevice);
|
||||
connect(m_adapter, &Adapter::poweredChanged, this, [ = ] (bool state) {
|
||||
initData();
|
||||
m_deviceListview->setVisible(state);
|
||||
m_adapterStateBtn->setChecked(state);
|
||||
m_adapterStateBtn->setEnabled(true);
|
||||
emit adapterPowerChanged();
|
||||
});
|
||||
connect(m_adapterStateBtn, &DSwitchButton::clicked, this, [ = ] (bool state){
|
||||
qDeleteAll(m_deviceItems);
|
||||
m_deviceItems.clear();
|
||||
m_deviceModel->clear();
|
||||
m_deviceListview->setVisible(false);
|
||||
m_adapterStateBtn->setEnabled(false);
|
||||
emit requestSetAdapterPower(m_adapter, state);
|
||||
});
|
||||
}
|
126
plugins/bluetooth/componments/bluetoothadapteritem.h
Normal file
126
plugins/bluetooth/componments/bluetoothadapteritem.h
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
* Maintainer: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLUETOOTHADAPTERITEM_H
|
||||
#define BLUETOOTHADAPTERITEM_H
|
||||
|
||||
#include "componments/device.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <DStyleHelper>
|
||||
#include <DApplicationHelper>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
DWIDGET_BEGIN_NAMESPACE
|
||||
class DSwitchButton;
|
||||
class DStandardItem;
|
||||
class DListView;
|
||||
class DSpinner;
|
||||
DWIDGET_END_NAMESPACE
|
||||
|
||||
class Adapter;
|
||||
class SettingLabel;
|
||||
class QStandardItemModel;
|
||||
|
||||
const QString LightString = QString(":/light/buletooth_%1_light.svg");
|
||||
const QString DarkString = QString(":/dark/buletooth_%1_dark.svg");
|
||||
|
||||
class BluetoothDeviceItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothDeviceItem(QStyle *style = nullptr, const Device *device = nullptr, DListView *parent = nullptr);
|
||||
virtual ~BluetoothDeviceItem();
|
||||
|
||||
DStandardItem *standardItem() { return m_standarditem; }
|
||||
const Device *device() { return m_device; }
|
||||
|
||||
public slots:
|
||||
// 系统主题发生改变时更新蓝牙图标
|
||||
void updateIconTheme(DGuiApplicationHelper::ColorType type);
|
||||
// 更新蓝牙设备的连接状态
|
||||
void updateDeviceState(Device::State state);
|
||||
|
||||
signals:
|
||||
void requestTopDeviceItem(DStandardItem *item);
|
||||
void deviceStateChanged(const Device* device);
|
||||
|
||||
private:
|
||||
void initActionList();
|
||||
void initConnect();
|
||||
|
||||
DStyleHelper m_style;
|
||||
QString m_deviceIcon;
|
||||
|
||||
const Device *m_device = nullptr;
|
||||
DStandardItem *m_standarditem = nullptr;
|
||||
DViewItemAction *m_labelAction = nullptr;
|
||||
DViewItemAction *m_stateAction = nullptr;
|
||||
DSpinner *m_loading = nullptr;
|
||||
};
|
||||
|
||||
class BluetoothAdapterItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothAdapterItem(Adapter *adapter, QWidget *parent = nullptr);
|
||||
~BluetoothAdapterItem();
|
||||
Adapter *adapter() { return m_adapter; }
|
||||
int currentDeviceCount();
|
||||
QStringList connectedDevicesName();
|
||||
|
||||
public slots:
|
||||
// 添加蓝牙设备
|
||||
void onDeviceAdded(const Device *device);
|
||||
// 移除蓝牙设备
|
||||
void onDeviceRemoved(const Device *device);
|
||||
// 连接蓝牙设备
|
||||
void onConnectDevice(const QModelIndex &index);
|
||||
// 将已连接的蓝牙设备放到列表第一个
|
||||
void onTopDeviceItem(DStandardItem* item);
|
||||
// 设置蓝牙适配器名称
|
||||
void onAdapterNameChanged(const QString name);
|
||||
|
||||
signals:
|
||||
void adapterPowerChanged();
|
||||
void requestSetAdapterPower(Adapter *adapter, bool state);
|
||||
void connectDevice(const Device *device, Adapter *adapter);
|
||||
void deviceCountChanged();
|
||||
void deviceStateChanged(const Device* device);
|
||||
|
||||
private:
|
||||
void initData();
|
||||
void initUi();
|
||||
void initConnect();
|
||||
|
||||
Adapter *m_adapter = nullptr;
|
||||
SettingLabel *m_adapterLabel = nullptr;
|
||||
DSwitchButton *m_adapterStateBtn = nullptr;
|
||||
DListView *m_deviceListview = nullptr;
|
||||
QStandardItemModel *m_deviceModel = nullptr;
|
||||
|
||||
QMap<QString, BluetoothDeviceItem *> m_deviceItems;
|
||||
};
|
||||
|
||||
#endif // BLUETOOTHADAPTERITEM_H
|
257
plugins/bluetooth/componments/bluetoothapplet.cpp
Normal file
257
plugins/bluetooth/componments/bluetoothapplet.cpp
Normal file
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
* Maintainer: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "bluetoothapplet.h"
|
||||
#include "device.h"
|
||||
#include "bluetoothconstants.h"
|
||||
#include "adaptersmanager.h"
|
||||
#include "adapter.h"
|
||||
#include "bluetoothadapteritem.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QBoxLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QDebug>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <DApplicationHelper>
|
||||
#include <DDBusSender>
|
||||
#include <DLabel>
|
||||
#include <DSwitchButton>
|
||||
#include <DScrollArea>
|
||||
#include <DListView>
|
||||
|
||||
SettingLabel::SettingLabel(QString text, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_label(new DLabel(text, this))
|
||||
, m_layout(new QHBoxLayout(this))
|
||||
{
|
||||
setAccessibleName("BluetoothSettingLabel");
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
m_layout->setMargin(0);
|
||||
m_layout->addSpacing(20);
|
||||
m_layout->addWidget(m_label, 0, Qt::AlignLeft | Qt::AlignHCenter);
|
||||
}
|
||||
|
||||
void SettingLabel::addSwichButton(DSwitchButton *button)
|
||||
{
|
||||
m_layout->addWidget(button, 0, Qt::AlignRight | Qt::AlignHCenter);
|
||||
m_layout->addSpacing(10);
|
||||
}
|
||||
|
||||
void SettingLabel::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton) {
|
||||
Q_EMIT clicked();
|
||||
return;
|
||||
}
|
||||
|
||||
return QWidget::mousePressEvent(ev);
|
||||
}
|
||||
|
||||
void SettingLabel::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.setPen(Qt::NoPen);
|
||||
if (DApplicationHelper::instance()->themeType() == DApplicationHelper::LightType) {
|
||||
painter.setBrush(QColor(0, 0, 0, 0.03 * 255));
|
||||
} else {
|
||||
painter.setBrush(QColor(255, 255, 255, 0.03 * 255));
|
||||
}
|
||||
painter.drawRoundedRect(rect(), 0, 0);
|
||||
|
||||
return QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
BluetoothApplet::BluetoothApplet(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_contentWidget(new QWidget(this))
|
||||
, m_adaptersManager(new AdaptersManager(this))
|
||||
, m_settingLabel(new SettingLabel(tr("Bluetooth settings"), this))
|
||||
, m_mainLayout(new QVBoxLayout(this))
|
||||
, m_contentLayout(new QVBoxLayout(m_contentWidget))
|
||||
{
|
||||
initUi();
|
||||
initConnect();
|
||||
}
|
||||
|
||||
bool BluetoothApplet::poweredInitState()
|
||||
{
|
||||
foreach(const auto adapter, m_adapterItems) {
|
||||
if (adapter->adapter()->powered()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BluetoothApplet::hasAadapter()
|
||||
{
|
||||
return m_adaptersManager->adaptersCount();
|
||||
}
|
||||
|
||||
void BluetoothApplet::setAdapterRefresh()
|
||||
{
|
||||
for (BluetoothAdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem->adapter()->discover())
|
||||
m_adaptersManager->adapterRefresh(adapterItem->adapter());
|
||||
}
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::setAdapterPowered(bool state)
|
||||
{
|
||||
for (BluetoothAdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem)
|
||||
m_adaptersManager->setAdapterPowered(adapterItem->adapter(), state);
|
||||
}
|
||||
}
|
||||
|
||||
QStringList BluetoothApplet::connectedDevicesName()
|
||||
{
|
||||
QStringList deviceList;
|
||||
for (BluetoothAdapterItem *adapterItem : m_adapterItems) {
|
||||
if (adapterItem)
|
||||
deviceList << adapterItem->connectedDevicesName();
|
||||
}
|
||||
|
||||
return deviceList;
|
||||
}
|
||||
|
||||
void BluetoothApplet::onAdapterAdded(Adapter *adapter)
|
||||
{
|
||||
if (!m_adapterItems.size()) {
|
||||
emit justHasAdapter();
|
||||
}
|
||||
if (m_adapterItems.contains(adapter->id())) {
|
||||
onAdapterRemoved(m_adapterItems.value(adapter->id())->adapter());
|
||||
}
|
||||
|
||||
BluetoothAdapterItem *adapterItem = new BluetoothAdapterItem(adapter, this);
|
||||
connect(adapterItem, &BluetoothAdapterItem::requestSetAdapterPower, this, &BluetoothApplet::onSetAdapterPower);
|
||||
connect(adapterItem, &BluetoothAdapterItem::connectDevice, m_adaptersManager, &AdaptersManager::connectDevice);
|
||||
connect(adapterItem, &BluetoothAdapterItem::deviceCountChanged, this, &BluetoothApplet::updateSize);
|
||||
connect(adapterItem, &BluetoothAdapterItem::adapterPowerChanged, this, &BluetoothApplet::updateBluetoothPowerState);
|
||||
connect(adapterItem, &BluetoothAdapterItem::deviceStateChanged, this, &BluetoothApplet::deviceStateChanged);
|
||||
|
||||
m_adapterItems.insert(adapter->id(), adapterItem);
|
||||
m_contentLayout->insertWidget(0, adapterItem, Qt::AlignTop | Qt::AlignVCenter);
|
||||
updateBluetoothPowerState();
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::onAdapterRemoved(Adapter *adapter)
|
||||
{
|
||||
m_contentLayout->removeWidget(m_adapterItems.value(adapter->id()));
|
||||
m_adapterItems.value(adapter->id())->deleteLater();
|
||||
m_adapterItems.remove(adapter->id());
|
||||
if (m_adapterItems.isEmpty()) {
|
||||
emit noAdapter();
|
||||
}
|
||||
updateBluetoothPowerState();
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::onSetAdapterPower(Adapter *adapter, bool state)
|
||||
{
|
||||
m_adaptersManager->setAdapterPowered(adapter, state);
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::updateBluetoothPowerState()
|
||||
{
|
||||
foreach(const auto item, m_adapterItems) {
|
||||
if (item->adapter()->powered()) {
|
||||
emit powerChanged(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
emit powerChanged(false);
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::initUi()
|
||||
{
|
||||
setFixedWidth(ItemWidth);
|
||||
setAccessibleName("BluetoothApplet");
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_settingLabel->setFixedHeight(DeviceItemHeight);
|
||||
DFontSizeManager::instance()->bind(m_settingLabel->label(), DFontSizeManager::T7);
|
||||
|
||||
m_contentWidget->setContentsMargins(0, 0, 0, 0);
|
||||
m_contentLayout->setMargin(0);
|
||||
m_contentLayout->setSpacing(0);
|
||||
m_contentLayout->addWidget(m_settingLabel, 0, Qt::AlignBottom | Qt::AlignVCenter);
|
||||
|
||||
QScrollArea *scroarea = new QScrollArea(this);
|
||||
m_contentWidget->setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
scroarea->setWidgetResizable(true);
|
||||
scroarea->setFrameStyle(QFrame::NoFrame);
|
||||
scroarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
scroarea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
scroarea->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
|
||||
scroarea->setContentsMargins(0, 0, 0, 0);
|
||||
scroarea->setWidget(m_contentWidget);
|
||||
|
||||
m_mainLayout->setMargin(0);
|
||||
m_mainLayout->setSpacing(0);
|
||||
m_mainLayout->addWidget(scroarea);
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void BluetoothApplet::initConnect()
|
||||
{
|
||||
connect(m_adaptersManager, &AdaptersManager::adapterIncreased, this, &BluetoothApplet::onAdapterAdded);
|
||||
connect(m_adaptersManager, &AdaptersManager::adapterDecreased, this, &BluetoothApplet::onAdapterRemoved);
|
||||
|
||||
connect(m_settingLabel, &SettingLabel::clicked, this, [ = ] {
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.method(QString("ShowModule"))
|
||||
.arg(QString("bluetooth"))
|
||||
.call();
|
||||
});
|
||||
}
|
||||
|
||||
void BluetoothApplet::updateSize()
|
||||
{
|
||||
int hetght = 0;
|
||||
int count = 0;
|
||||
foreach(const auto item, m_adapterItems) {
|
||||
hetght += TitleHeight + TitleSpace;
|
||||
if (item->adapter()->powered()) {
|
||||
count += item->currentDeviceCount();
|
||||
hetght += count * DeviceItemHeight;
|
||||
}
|
||||
}
|
||||
|
||||
hetght += DeviceItemHeight;
|
||||
int maxHeight = (TitleHeight + TitleSpace) + MaxDeviceCount * DeviceItemHeight;
|
||||
hetght = hetght > maxHeight ? maxHeight : hetght;
|
||||
setFixedSize(ItemWidth, hetght);
|
||||
}
|
||||
|
112
plugins/bluetooth/componments/bluetoothapplet.h
Normal file
112
plugins/bluetooth/componments/bluetoothapplet.h
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
* Maintainer: chenwei <chenwei@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLUETOOTHAPPLET_H
|
||||
#define BLUETOOTHAPPLET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include <dtkwidget_global.h>
|
||||
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
|
||||
class Device;
|
||||
class Adapter;
|
||||
class BluetoothAdapterItem;
|
||||
class AdaptersManager;
|
||||
|
||||
DWIDGET_BEGIN_NAMESPACE
|
||||
class DLabel;
|
||||
class DSwitchButton;
|
||||
class DListView;
|
||||
DWIDGET_END_NAMESPACE
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class SettingLabel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingLabel(QString text, QWidget *parent = nullptr);
|
||||
void addSwichButton(DSwitchButton *button);
|
||||
DLabel *label() { return m_label; }
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *ev) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
DLabel *m_label = nullptr;
|
||||
QHBoxLayout *m_layout = nullptr;
|
||||
};
|
||||
|
||||
class BluetoothApplet : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothApplet(QWidget *parent = nullptr);
|
||||
bool poweredInitState();
|
||||
// 当前是否有蓝牙适配器
|
||||
bool hasAadapter();
|
||||
// 刷新蓝牙适配器搜索到的设备列表
|
||||
void setAdapterRefresh();
|
||||
// 设置当前所有蓝牙适配器的电源状态
|
||||
void setAdapterPowered(bool state);
|
||||
// 已连接蓝牙设备名称列表,用于获取鼠标悬浮在蓝牙插件上时tips显示内容
|
||||
QStringList connectedDevicesName();
|
||||
|
||||
signals:
|
||||
void noAdapter();
|
||||
void justHasAdapter();
|
||||
void powerChanged(bool state);
|
||||
void deviceStateChanged(const Device* device);
|
||||
|
||||
public slots:
|
||||
// 蓝牙适配器增加
|
||||
void onAdapterAdded(Adapter *adapter);
|
||||
// 蓝牙适配器移除
|
||||
void onAdapterRemoved(Adapter *adapter);
|
||||
// 设置蓝牙适配器电源是否开启
|
||||
void onSetAdapterPower(Adapter *adapter, bool state);
|
||||
// 更新蓝牙适配器电源状态,用于更新任务栏蓝牙插件图标的显示状态
|
||||
void updateBluetoothPowerState();
|
||||
|
||||
private:
|
||||
void initUi();
|
||||
void initConnect();
|
||||
// 更新蓝牙插件主界面大小
|
||||
void updateSize();
|
||||
QWidget *m_contentWidget = nullptr;
|
||||
AdaptersManager *m_adaptersManager = nullptr;
|
||||
SettingLabel *m_settingLabel = nullptr;
|
||||
QVBoxLayout *m_mainLayout = nullptr;
|
||||
QVBoxLayout *m_contentLayout = nullptr;
|
||||
|
||||
QStringList m_connectDeviceName;
|
||||
QMap<QString, BluetoothAdapterItem *> m_adapterItems;
|
||||
};
|
||||
|
||||
#endif // BLUETOOTHAPPLET_H
|
@ -1,18 +1,10 @@
|
||||
#ifndef BLUETOOTHCONSTANTS_H
|
||||
#define BLUETOOTHCONSTANTS_H
|
||||
|
||||
#define POPUPWIDTH (200)
|
||||
#define ITEMHEIGHT (30)
|
||||
#define CONTROLHEIGHT (35)
|
||||
#define CONTROLTITLEHEIGHT (45)
|
||||
#define LIGHTSUFFIX ("_dark.svg")
|
||||
#define DARKSUFFIX (".svg")
|
||||
#define MARGIN (12)
|
||||
#define SWITCHBUTTONWIDTH (50)
|
||||
|
||||
#define LIGHTICON "light/buletooth_"
|
||||
#define DARKICON "dark/buletooth_"
|
||||
#define LIGHTICONSUFFIX "_light.svg"
|
||||
#define DARKICONSUFFIX "_dark.svg"
|
||||
const int DeviceItemHeight = 36;
|
||||
const int ItemWidth = 300;
|
||||
const int TitleHeight = 46;
|
||||
const int TitleSpace = 2;
|
||||
const int MaxDeviceCount = 8;
|
||||
|
||||
#endif // BLUETOOTHCONSTANTS_H
|
||||
|
@ -57,7 +57,6 @@ Device::Device(QObject *parent)
|
||||
|
||||
Device::~Device()
|
||||
{
|
||||
emit stateChanged(StateUnavailable);
|
||||
}
|
||||
|
||||
void Device::updateDeviceTime()
|
||||
|
@ -1,194 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "deviceitem.h"
|
||||
#include "constants.h"
|
||||
#include "bluetoothconstants.h"
|
||||
#include "util/imageutil.h"
|
||||
#include "util/statebutton.h"
|
||||
|
||||
#include <DApplicationHelper>
|
||||
#include <DStyle>
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QPainter>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
extern void initFontColor(QWidget *widget);
|
||||
|
||||
DeviceItem::DeviceItem(Device *d, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_title(new QLabel(this))
|
||||
, m_state(new StateButton(this))
|
||||
, m_loadingStat(new DSpinner)
|
||||
, m_line(new HorizontalSeparator(this))
|
||||
, m_typeIcon(new QLabel(this))
|
||||
{
|
||||
m_device = d;
|
||||
|
||||
setFixedHeight(ITEMHEIGHT);
|
||||
auto themeChanged = [&](DApplicationHelper::ColorType themeType){
|
||||
QString iconPrefix;
|
||||
QString iconSuffix;
|
||||
switch (themeType) {
|
||||
case DApplicationHelper::UnknownType:
|
||||
case DApplicationHelper::LightType: {
|
||||
iconPrefix = LIGHTICON;
|
||||
iconSuffix = LIGHTICONSUFFIX;
|
||||
}
|
||||
break;
|
||||
case DApplicationHelper::DarkType: {
|
||||
iconPrefix = DARKICON;
|
||||
iconSuffix = DARKICONSUFFIX;
|
||||
}
|
||||
}
|
||||
|
||||
QString iconString;
|
||||
if (!m_device->deviceType().isEmpty())
|
||||
iconString = iconPrefix + m_device->deviceType() + iconSuffix;
|
||||
else
|
||||
iconString = iconPrefix + QString("other") + iconSuffix;
|
||||
m_typeIcon->setPixmap(ImageUtil::loadSvg(iconString, ":/", PLUGIN_ICON_MIN_SIZE, devicePixelRatioF()));
|
||||
};
|
||||
|
||||
themeChanged(DApplicationHelper::instance()->themeType());
|
||||
|
||||
m_state->setType(StateButton::Check);
|
||||
m_state->setFixedSize(PLUGIN_ICON_MAX_SIZE, PLUGIN_ICON_MAX_SIZE);
|
||||
m_state->setVisible(false);
|
||||
|
||||
m_title->setText(nameDecorated(m_device->name()));
|
||||
initFontColor(m_title);
|
||||
|
||||
m_line->setVisible(false);
|
||||
m_loadingStat->setFixedSize(20, 20);
|
||||
m_loadingStat->setVisible(false);
|
||||
|
||||
auto itemLayout = new QHBoxLayout;
|
||||
itemLayout->setMargin(0);
|
||||
itemLayout->setSpacing(0);
|
||||
itemLayout->addSpacing(MARGIN);
|
||||
itemLayout->addWidget(m_typeIcon);
|
||||
itemLayout->addSpacing(5);
|
||||
itemLayout->addWidget(m_title);
|
||||
itemLayout->addStretch();
|
||||
itemLayout->addWidget(m_state);
|
||||
itemLayout->addWidget(m_loadingStat);
|
||||
itemLayout->addSpacing(MARGIN);
|
||||
setLayout(itemLayout);
|
||||
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, themeChanged);
|
||||
|
||||
changeState(m_device->state());
|
||||
}
|
||||
|
||||
bool DeviceItem::operator <(const DeviceItem &item)
|
||||
{
|
||||
return this->device()->deviceTime() < item.device()->deviceTime();
|
||||
}
|
||||
|
||||
void DeviceItem::setTitle(const QString &name)
|
||||
{
|
||||
m_title->setText(nameDecorated(name));
|
||||
}
|
||||
|
||||
void DeviceItem::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
m_device->updateDeviceTime();
|
||||
emit clicked(m_device);
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void DeviceItem::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
if (LightType == DApplicationHelper::instance()->themeType()) {
|
||||
QPainter painter(this);
|
||||
QRect rc = rect();
|
||||
rc.moveTop(1);
|
||||
painter.fillRect(rc, QColor(255, 255, 255, 51));
|
||||
|
||||
QWidget::paintEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceItem::changeState(const Device::State state)
|
||||
{
|
||||
switch (state) {
|
||||
case Device::StateUnavailable: {
|
||||
m_state->setVisible(false);
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->hide();
|
||||
m_loadingStat->setVisible(false);
|
||||
}
|
||||
break;
|
||||
case Device::StateAvailable: {
|
||||
m_state->setVisible(false);
|
||||
m_loadingStat->start();
|
||||
m_loadingStat->show();
|
||||
m_loadingStat->setVisible(true);
|
||||
}
|
||||
break;
|
||||
case Device::StateConnected: {
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->hide();
|
||||
m_loadingStat->setVisible(false);
|
||||
m_state->setVisible(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString DeviceItem::nameDecorated(const QString &name)
|
||||
{
|
||||
return QFontMetrics(m_title->font()).elidedText(name, Qt::ElideRight, POPUPWIDTH - MARGIN * 2 - PLUGIN_ICON_MIN_SIZE - 30);
|
||||
}
|
||||
|
||||
HorizontalSeparator::HorizontalSeparator(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setFixedHeight(2);
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
}
|
||||
|
||||
void HorizontalSeparator::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
|
||||
QPainter painter(this);
|
||||
if (LightType == DApplicationHelper::instance()->themeType()) {
|
||||
painter.fillRect(rect(), QColor(0, 0, 0, 10));
|
||||
} else if (DarkType == DApplicationHelper::instance()->themeType()) {
|
||||
painter.fillRect(rect(), QColor(255, 255, 255, 13));
|
||||
}
|
||||
}
|
||||
|
||||
MenueItem::MenueItem(QWidget *parent)
|
||||
: QLabel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void MenueItem::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QLabel::mousePressEvent(event);
|
||||
emit clicked();
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DEVICEITEM_H
|
||||
#define DEVICEITEM_H
|
||||
|
||||
#include "device.h"
|
||||
|
||||
#include <DSpinner>
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
enum ColorType {
|
||||
UnknownType,
|
||||
LightType,
|
||||
DarkType
|
||||
};
|
||||
|
||||
class StateButton;
|
||||
class HorizontalSeparator;
|
||||
class DeviceItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceItem(Device *d, QWidget *parent = nullptr);
|
||||
bool operator <(const DeviceItem &item);
|
||||
|
||||
void setTitle(const QString &name);
|
||||
inline QString title() { return m_title->text(); }
|
||||
|
||||
inline Device *device() { return m_device; }
|
||||
inline const Device *device() const { return m_device; }
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
signals:
|
||||
void clicked(Device *);
|
||||
|
||||
public slots:
|
||||
void changeState(const Device::State state);
|
||||
|
||||
private:
|
||||
QString nameDecorated(const QString &name);
|
||||
|
||||
private:
|
||||
QLabel *m_title;
|
||||
StateButton *m_state;
|
||||
DSpinner *m_loadingStat;
|
||||
Device *m_device;
|
||||
HorizontalSeparator *m_line;
|
||||
QLabel *m_typeIcon;
|
||||
};
|
||||
|
||||
class HorizontalSeparator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HorizontalSeparator(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
};
|
||||
|
||||
class MenueItem : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MenueItem(QWidget *parent = nullptr);
|
||||
signals:
|
||||
void clicked();
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
};
|
||||
|
||||
#endif // DEVICEITEM_H
|
@ -1,137 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "switchitem.h"
|
||||
#include "bluetoothconstants.h"
|
||||
|
||||
#include <DHiDPIHelper>
|
||||
#include <DApplicationHelper>
|
||||
#include <DFontSizeManager>
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QFontMetrics>
|
||||
#include <QLabel>
|
||||
#include <QEvent>
|
||||
|
||||
extern void initFontColor(QWidget *widget);
|
||||
|
||||
SwitchItem::SwitchItem(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_title(new QLabel(this))
|
||||
, m_switchBtn(new DSwitchButton(this))
|
||||
, m_default(false)
|
||||
{
|
||||
initFontColor(m_title);
|
||||
|
||||
DFontSizeManager::instance()->bind(m_title, DFontSizeManager::T4, QFont::Medium);
|
||||
m_switchBtn->setFixedWidth(SWITCHBUTTONWIDTH);
|
||||
|
||||
const QPixmap pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh_dark.svg");
|
||||
|
||||
m_loadingIndicator = new DLoadingIndicator;
|
||||
m_loadingIndicator->setSmooth(true);
|
||||
m_loadingIndicator->setAniDuration(500);
|
||||
m_loadingIndicator->setAniEasingCurve(QEasingCurve::InOutCirc);
|
||||
m_loadingIndicator->installEventFilter(this);
|
||||
m_loadingIndicator->setFixedSize(pixmap.size() / devicePixelRatioF());
|
||||
m_loadingIndicator->viewport()->setAutoFillBackground(false);
|
||||
m_loadingIndicator->setFrameShape(QFrame::NoFrame);
|
||||
m_loadingIndicator->installEventFilter(this);
|
||||
|
||||
auto themeChanged = [&](DApplicationHelper::ColorType themeType){
|
||||
Q_UNUSED(themeType)
|
||||
setLoadIndicatorIcon();
|
||||
};
|
||||
themeChanged(DApplicationHelper::instance()->themeType());
|
||||
|
||||
setFixedHeight(CONTROLTITLEHEIGHT);
|
||||
auto switchLayout = new QHBoxLayout;
|
||||
switchLayout->setSpacing(0);
|
||||
switchLayout->setMargin(0);
|
||||
switchLayout->addSpacing(MARGIN);
|
||||
switchLayout->addWidget(m_title);
|
||||
switchLayout->addStretch();
|
||||
switchLayout->addWidget(m_loadingIndicator);
|
||||
switchLayout->addSpacing(MARGIN);
|
||||
switchLayout->addWidget(m_switchBtn);
|
||||
switchLayout->addSpacing(5);
|
||||
setLayout(switchLayout);
|
||||
|
||||
connect(m_switchBtn, &DSwitchButton::toggled, [&](bool change) {
|
||||
m_checkState = change;
|
||||
m_loadingIndicator->setVisible(change);
|
||||
emit checkedChanged(change);
|
||||
});
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, themeChanged);
|
||||
}
|
||||
|
||||
void SwitchItem::setChecked(const bool checked,bool notify)
|
||||
{
|
||||
m_checkState = checked;
|
||||
if(!notify) { // 防止收到蓝牙开启或关闭信号后再触发一次打开或关闭
|
||||
m_switchBtn->blockSignals(true);
|
||||
m_switchBtn->setChecked(checked);
|
||||
m_switchBtn->blockSignals(false);
|
||||
emit justUpdateView(checked);
|
||||
}
|
||||
else {
|
||||
m_switchBtn->setChecked(checked);
|
||||
}
|
||||
}
|
||||
|
||||
void SwitchItem::setTitle(const QString &title)
|
||||
{
|
||||
int width = POPUPWIDTH - MARGIN * 2 - m_switchBtn->width() - 3;
|
||||
QString strTitle = QFontMetrics(m_title->font()).elidedText(title, Qt::ElideRight, width);
|
||||
m_title->setText(strTitle);
|
||||
}
|
||||
|
||||
bool SwitchItem::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == m_loadingIndicator) {
|
||||
if (event->type() == QEvent::MouseButtonPress) {
|
||||
if(!m_loadingIndicator->loading())
|
||||
Q_EMIT refresh();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SwitchItem::setLoading(const bool bloading)
|
||||
{
|
||||
m_loadingIndicator->setLoading(bloading);
|
||||
}
|
||||
|
||||
void SwitchItem::setLoadIndicatorIcon()
|
||||
{
|
||||
QString filePath = ":/wireless/resources/wireless/refresh.svg";
|
||||
if(DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
filePath = ":/wireless/resources/wireless/refresh_dark.svg";
|
||||
const QPixmap pixmap = DHiDPIHelper::loadNxPixmap(filePath);
|
||||
m_loadingIndicator->setImageSource(pixmap);
|
||||
}
|
||||
|
||||
//void SwitchItem::mousePressEvent(QMouseEvent *event)
|
||||
//{
|
||||
// emit clicked(m_adapterId);
|
||||
// QWidget::mousePressEvent(event);
|
||||
//}
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
* Maintainer: zhaolong <zhaolong@uniontech.com>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SWITCHITEM_H
|
||||
#define SWITCHITEM_H
|
||||
|
||||
#include <DSwitchButton>
|
||||
#include <dloadingindicator.h>
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class QLabel;
|
||||
class SwitchItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SwitchItem(QWidget *parent = nullptr);
|
||||
void setChecked(const bool checked = true,bool notify = false);
|
||||
void setTitle(const QString &title);
|
||||
void setLoading(const bool bloading);
|
||||
void setLoadIndicatorIcon();
|
||||
inline bool checkState() { return m_checkState; }
|
||||
|
||||
inline bool isdefault() { return m_default; }
|
||||
inline void setDefault(bool def) { m_default = def; }
|
||||
|
||||
signals:
|
||||
void checkedChanged(bool checked);
|
||||
void justUpdateView(bool checked);
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj,QEvent *event) override;
|
||||
|
||||
private:
|
||||
QLabel *m_title;
|
||||
DSwitchButton *m_switchBtn;
|
||||
bool m_default;
|
||||
bool m_checkState;
|
||||
DLoadingIndicator *m_loadingIndicator;
|
||||
};
|
||||
|
||||
#endif // SWITCHITEM_H
|
@ -1,3 +1,4 @@
|
||||
{
|
||||
"api": "1.2.3"
|
||||
"api": "1.2.3",
|
||||
"depends-daemon-dbus-service": "com.deepin.daemon.Timedate"
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ void DatetimeWidget::set24HourFormat(const bool value)
|
||||
m_24HourFormat = value;
|
||||
update();
|
||||
|
||||
adjustSize();
|
||||
if (isVisible()) {
|
||||
emit requestUpdateGeometry();
|
||||
}
|
||||
@ -86,6 +85,10 @@ void DatetimeWidget::setShortDateFormat(int type)
|
||||
default: m_shortDateFormat = "yyyy-MM-dd"; break;
|
||||
}
|
||||
update();
|
||||
|
||||
if (isVisible()) {
|
||||
emit requestUpdateGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,6 +103,10 @@ void DatetimeWidget::setShortTimeFormat(int type)
|
||||
default: m_shortTimeFormat = "hh:mm"; break;
|
||||
}
|
||||
update();
|
||||
|
||||
if (isVisible()) {
|
||||
emit requestUpdateGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
QSize DatetimeWidget::curTimeSize() const
|
||||
@ -135,7 +142,7 @@ QSize DatetimeWidget::curTimeSize() const
|
||||
dateSize.setWidth(QFontMetrics(m_dateFont).boundingRect("0000/00/00").size().width());
|
||||
}
|
||||
}
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()) + 2, height());
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()), timeSize.height() + dateSize.height());
|
||||
} else {
|
||||
while (std::max(QFontMetrics(m_timeFont).boundingRect(timeString).size().width(), QFontMetrics(m_dateFont).boundingRect("0000/00/00").size().width()) > (width() - 4)) {
|
||||
m_timeFont.setPixelSize(m_timeFont.pixelSize() - 1);
|
||||
@ -150,7 +157,7 @@ QSize DatetimeWidget::curTimeSize() const
|
||||
}
|
||||
}
|
||||
m_timeOffset = (timeSize.height() - dateSize.height()) / 2 ;
|
||||
return QSize(width(), timeSize.height() + dateSize.height());
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()), timeSize.height() + dateSize.height());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,8 @@ void SoundApplet::updateListHeight()
|
||||
//显示声音设备列表高度 = 设备的高度 + 间隔 + 边距
|
||||
int viewHeight = visualHeight + m_listView->spacing() * count * 2 + listMargin;
|
||||
// 设备信息高度 = 设备标签 + 分隔线 + 滚动条 + 间隔
|
||||
int infoHeight = m_soundShow->height() + m_separator->height() + m_volumeSlider->height() + m_centralLayout->spacing() * 3 + DEVICE_SPACING;
|
||||
int labelHeight = m_deviceLabel->height() > m_soundShow->height() ? m_deviceLabel->height() : m_soundShow->height();
|
||||
int infoHeight = labelHeight + m_separator->height() + m_volumeSlider->height() + m_centralLayout->spacing() * 3 + DEVICE_SPACING;
|
||||
int margain = m_centralLayout->contentsMargins().top() + m_centralLayout->contentsMargins().bottom();
|
||||
//整个界面高度 = 显示声音设备列表高度 + 设备信息高度 + 边距
|
||||
int totalHeight = viewHeight + infoHeight + margain;
|
||||
|
@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en">
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="en" version="2.1">
|
||||
<context>
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
@ -17,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth settings</translation>
|
||||
@ -291,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Connection failed</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -423,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Device</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Application</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -498,4 +488,4 @@
|
||||
<translation>Wireless Network %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
</TS>
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>البلوتوث</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>إعدادات البلوتوث</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>الجهاز</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>تطبيق</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
491
translations/dde-dock_bo.ts
Normal file
491
translations/dde-dock_bo.ts
Normal file
@ -0,0 +1,491 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="bo" version="2.1">
|
||||
<context>
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>འཇུག་ཆས་%1དང་རྒྱུད་ཁོངས་ཀྱི་པར་གཞི་ཕན་ཚུན་མི་མཐུན་པ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AppDragWidget</name>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation>སྤོ་འབུད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>སོ་སྔོན་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>སོ་སྔོན་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>སོ་སྔོན་ཁ་ཕྱེ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>སོ་སྔོན་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation>%1མཐུད་ཟིན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation>སྦྲེལ་བཞིན་པ། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>སོ་སྔོན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation>སོ་སྔོན་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothPlugin</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>སོ་སྔོན།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DBusAdaptors</name>
|
||||
<message>
|
||||
<source>Add keyboard layout</source>
|
||||
<translation>མཐེབ་གཞོང་བཀོད་པ་སྣོན་པ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatetimePlugin</name>
|
||||
<message>
|
||||
<source>Datetime</source>
|
||||
<translation>དུས་ཚོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>12-hour time</source>
|
||||
<translation>ཆུ་ཚོད་12ཀྱི་ལུགས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24-hour time</source>
|
||||
<translation>ཆུ་ཚོད་24ཡི་ལུགས། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time settings</source>
|
||||
<translation>དུས་ཚོད་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DeviceItem</name>
|
||||
<message>
|
||||
<source>Enable network</source>
|
||||
<translation>དྲ་རྒྱ་སྤྱོད་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
<translation>དྲ་རྒྱ་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network settings</source>
|
||||
<translation>དྲ་རྒྱ་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogManager</name>
|
||||
<message>
|
||||
<source>Are you sure you want to empty %1 items?</source>
|
||||
<translation>ཁྱོད་ཀྱིས་སྙིགས་སྣོད་ནང་གི་ནང་དོན་%1དག་གཙང་སེལ་བྱེད་རྒྱུ་ཡིན་པ་གཏན་ཁེལ་ལམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
<translation>འདོར་བ། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>སུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This action cannot be restored</source>
|
||||
<translation>བཀོལ་སྤྱོད་འདི་བྱས་ཚེ་སོར་ཆུད་ཐབས་བྲལ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DiskControlItem</name>
|
||||
<message>
|
||||
<source>Unknown device</source>
|
||||
<translation>མ་ཤེས་པའི་སྒྲིག་ཆས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unknown volume</source>
|
||||
<translation>ཤོང་ཚད་མ་ཤེས་པ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DiskMountPlugin</name>
|
||||
<message>
|
||||
<source>Disk</source>
|
||||
<translation>སྡུད་སྡེར།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open</source>
|
||||
<translation>ཁ་ཕྱེ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmount all</source>
|
||||
<translation>ཚང་མ་བཤིག་འདོན་བྱེད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>འགོ་སློང་ཆས།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MenuWorker</name>
|
||||
<message>
|
||||
<source>Fashion Mode</source>
|
||||
<translation>དར་སྲོལ་དཔེ་རྣམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Efficient Mode</source>
|
||||
<translation>ལས་ཆོད་ཆེ་བའི་དཔེ་རྣམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Top</source>
|
||||
<translation>གོང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bottom</source>
|
||||
<translation>འོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left</source>
|
||||
<translation>གཡོན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right</source>
|
||||
<translation>གཡས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Keep Shown</source>
|
||||
<translation>རྟག་ཏུ་མངོན་སྟོན་བྱེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Keep Hidden</source>
|
||||
<translation>རྟག་ཏུ་ཡིབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smart Hide</source>
|
||||
<translation>རིག་ནུས་གབ་ཡིབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mode</source>
|
||||
<translation>དཔེ་རྣམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation>གནས་ས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status</source>
|
||||
<translation>རྣམ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Plugins</source>
|
||||
<translation>འཇུག་ཆས།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
<source>Multitasking View</source>
|
||||
<translation>འགན་མང་མཐོང་རིས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>བསྡད་པ་གཙང་སེལ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ་སྤྱོད་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ་སྤྱོད་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
<translation>དྲ་རྒྱ་ཁ་རྒྱོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable network</source>
|
||||
<translation>དྲ་རྒྱ་སྤྱོད་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network settings</source>
|
||||
<translation>དྲ་རྒྱ་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Device disabled</source>
|
||||
<translation>སྒྲིག་ཆས་སྤྱོད་མི་ཆོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ། %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ། %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not connected</source>
|
||||
<translation>སྦྲེལ་མེད་པ། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting</source>
|
||||
<translation>སྦྲེལ་བཞིན་པ། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>དྲ་རྒྱ་དང་འབྲེལ་ཟིན་ཡང་མཉམ་སྦྲེལ་དྲ་རྒྱར་འཛུལ་མི་ཐུབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
<translation>དྲ་སྐུད་མཐུད་མི་འདུག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkPlugin</name>
|
||||
<message>
|
||||
<source>Network</source>
|
||||
<translation>དྲ་རྒྱ། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network %1</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་རྒྱ་%1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OnboardPlugin</name>
|
||||
<message>
|
||||
<source>Onboard</source>
|
||||
<translation>བརྙན་ཡོལ་མཐེབ་གཞོང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PowerPlugin</name>
|
||||
<message>
|
||||
<source>Power</source>
|
||||
<translation>གློག་ཁུངས་དོ་དམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Power settings</source>
|
||||
<translation>གློག་ཁུངས་སྒིག་འགོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation>གློག་ཚད་%1 སྐར་མ་%2ལྷག་འདུག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation>གློག་ཚད་%1 ཆུ་ཚོད་%2དང་སྐར་མ་%3ལྷག་འདུག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
<translation>གློག་གསོག་བཞིན་ཡོད་%1 ད་དུང་སྐར་མ་%2དགོས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 hr %3 min until full</source>
|
||||
<translation>གློག་གསོག་བཞིན་ཡོད་%1 ད་དུང་ཆུ་ཚོད་%2དང་སྐར་མ་%3དགོས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged</source>
|
||||
<translation>ཁེངས་ཟིན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation>གློག་ཚད་%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
<translation>གློག་གསོག་བཞིན་ཡོད་%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation>གློག་ཚད་%1 ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation>གློག་ཚད་%1 ཁེངས་ཟིན།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ShowDesktopPlugin</name>
|
||||
<message>
|
||||
<source>Show Desktop</source>
|
||||
<translation>མངོན་སྟོན་ཅོག་ངོས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>བསྡད་པ་གཙང་སེལ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ShutdownPlugin</name>
|
||||
<message>
|
||||
<source>Power</source>
|
||||
<translation>གློག་ཁུངས་དོ་དམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Shut down</source>
|
||||
<translation>ཁ་བརྒྱབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Suspend</source>
|
||||
<translation>སྒུག་སྡོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hibernate</source>
|
||||
<translation>མལ་གསོ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock</source>
|
||||
<translation>ཟྭ་རྒྱག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log out</source>
|
||||
<translation>ཐོ་སུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Switch account</source>
|
||||
<translation>རྩིས་ཁྲ་བརྗེ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Power settings</source>
|
||||
<translation>གློག་ཁུངས་སྒིག་འགོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Reboot</source>
|
||||
<translation>བསྐྱར་སློང་།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundApplet</name>
|
||||
<message>
|
||||
<source>Device</source>
|
||||
<translation>སྒྲིག་ཆས།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
<message>
|
||||
<source>Unmute</source>
|
||||
<translation>སྒྲ་ལྡན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mute</source>
|
||||
<translation>སྒྲ་མེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sound settings</source>
|
||||
<translation>སྐད་གདངས་སྒྲིག་འགོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
<translation>མིག་སྔའི་སྐད་གདངས་%1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundPlugin</name>
|
||||
<message>
|
||||
<source>Sound</source>
|
||||
<translation>སྒྲ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TrashPlugin</name>
|
||||
<message>
|
||||
<source>Trash</source>
|
||||
<translation>སྙིགས་སྣོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Trash - %1 file</source>
|
||||
<translation>སྙིགས་སྣོད་ཀྱི་ཡིག་ཆ་%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Trash - %1 files</source>
|
||||
<translation>སྙིགས་སྣོད་ཀྱི་ཡིག་ཆ་%1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TrashWidget</name>
|
||||
<message>
|
||||
<source>Open</source>
|
||||
<translation>ཁ་ཕྱེ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty</source>
|
||||
<translation>གསལ་ཐོ་གཙང་སེལ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TrayPlugin</name>
|
||||
<message>
|
||||
<source>System Tray</source>
|
||||
<translation>རྒྱུད་ཁོངས་སྡེར་མ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessList</name>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network %1</source>
|
||||
<translation>སྐུད་མེད་དྲ་རྒྱ་%1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Configuració del Bluetooth</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Ha fallat la connexió.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositiu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicació</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>Zásuvný modul %1 není kompatibilní se systémem.</translation>
|
||||
<translation>Přídavný modul %1 není slučitelný se systémem.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Nastavení Bluetooth</translation>
|
||||
@ -44,7 +40,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation>Připojování…</translation>
|
||||
<translation>Připojuje se...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
@ -111,7 +107,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
<translation>Storno</translation>
|
||||
<translation>Zrušit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Připojení se nezdařilo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -311,7 +307,7 @@
|
||||
<name>OnboardPlugin</name>
|
||||
<message>
|
||||
<source>Onboard</source>
|
||||
<translation>Onboard</translation>
|
||||
<translation>Na základní desce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Zařízení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplikace</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth-indstillinger</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Enhed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Program</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth-Einstellungen</translation>
|
||||
@ -52,7 +48,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Ausgeschaltet</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Verbindung fehlgeschlagen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -362,7 +358,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Kapazität %1, voll aufgeladen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Gerät</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Anwendung</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -442,7 +434,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
<translation>Lautstärke: %1</translation>
|
||||
<translation>Lautstärke %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth settings</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Device</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Application</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Ajustes de Bluetooth</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicación</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -6,6 +6,58 @@
|
||||
<translation>افزونه %1 با سیستم سازگار نیست.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AppDragWidget</name>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>تنظیمات بلوتوث</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>خاموش کردن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>روشن کردن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>تنظیمات بلوتوث</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>بلوتوث</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothPlugin</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>بلوتوث</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DBusAdaptors</name>
|
||||
<message>
|
||||
@ -21,15 +73,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>12-hour time</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>زمان 12-ساعته</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24-hour time</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>زمان 24-ساعته</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>تنظیمات زمان</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -93,7 +145,14 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DockSettings</name>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>لانچر</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MenuWorker</name>
|
||||
<message>
|
||||
<source>Fashion Mode</source>
|
||||
<translation>حالت فشن</translation>
|
||||
@ -147,13 +206,6 @@
|
||||
<translation>پلاگین ها</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>لانچر</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
@ -165,12 +217,91 @@
|
||||
<translation>باز کردن از داک</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
<translation>غیر فعال کردن شبکه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable network</source>
|
||||
<translation>فعال کردن شبکه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network settings</source>
|
||||
<translation>تنظیمات شبکه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Device disabled</source>
|
||||
<translation>دستگاه غیرفعال است</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>اتصال سیمی %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not connected</source>
|
||||
<translation>متصل نیست</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting</source>
|
||||
<translation>در حال اتصال</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>متصل است اما دسترسی به اینترنت ندارد</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
<translation>کابل شبکه وصل نشده است</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
<translation>شبکه بیسیم</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>شبکه کابلی</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkPlugin</name>
|
||||
<message>
|
||||
<source>Network</source>
|
||||
<translation>شبکه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>شبکه کابلی</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network %1</source>
|
||||
<translation>شبکه سیمی %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OnboardPlugin</name>
|
||||
@ -286,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>دستگاه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>برنامه</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -303,7 +430,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Sound settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>تنظیمات صدا</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
@ -350,32 +477,6 @@
|
||||
<translation>سینی سیستم</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiredItem</name>
|
||||
<message>
|
||||
<source>Unknown</source>
|
||||
<translation>ناشناخته</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>اتصال سیمی %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessItem</name>
|
||||
<message>
|
||||
<source>No Network</source>
|
||||
<translation>بدون شبکه</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>متصل است اما دسترسی به اینترنت ندارد</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessList</name>
|
||||
<message>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth asetukset</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Yhteys epäonnistui</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Laite</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Sovellus</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>L'extension %1 n'est pas compatible avec le système</translation>
|
||||
<translation>Le plugin %1 n'est pas compatible avec le système.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Paramètres Bluetooth</translation>
|
||||
@ -107,7 +103,7 @@
|
||||
<name>DialogManager</name>
|
||||
<message>
|
||||
<source>Are you sure you want to empty %1 items?</source>
|
||||
<translation>Êtes-vous sûr de vouloir vider %1 éléments ?</translation>
|
||||
<translation>Êtes-vous sûr de vouloir supprimer %1 éléments ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>La connexion a échoué</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -330,11 +326,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation>Capacité: %1, %2 minutes restantes</translation>
|
||||
<translation>Capacité %1, %2 minutes restantes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation>Capacité: %1, %2 heures et %3 minutes restantes</translation>
|
||||
<translation>Capacité %1, %2 heures et %3 minutes restantes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Périphérique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Applications</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>O complemento% 1 non é compatible co sistema.</translation>
|
||||
<translation>O complemento %1 non é compatible co sistema.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -15,13 +15,9 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Configuración de Bluetooth</translation>
|
||||
<translation>Axustes do Bluetooth</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -36,7 +32,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Configuración de Bluetooth</translation>
|
||||
<translation>Axustes do Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
@ -52,7 +48,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation>Apagado</translation>
|
||||
<translation>Desactivado</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -77,15 +73,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>12-hour time</source>
|
||||
<translation>12 horas de tempo</translation>
|
||||
<translation>formato 12 horas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24-hour time</source>
|
||||
<translation>24 horas de tempo</translation>
|
||||
<translation>formato 24 horas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time settings</source>
|
||||
<translation>Configuración do tempo</translation>
|
||||
<translation>Axustes da hora</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -107,7 +103,7 @@
|
||||
<name>DialogManager</name>
|
||||
<message>
|
||||
<source>Are you sure you want to empty %1 items?</source>
|
||||
<translation>Está seguro que que quere vaciar %1 elementos?</translation>
|
||||
<translation>Está certo/a de querer baleirar %1 elementos?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
@ -225,11 +221,11 @@
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation>Desactivar a conexión por cable</translation>
|
||||
<translation>Desactivar a conexión con fíos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation>Activa a conexión por fíos</translation>
|
||||
<translation>Activa a conexión con fíos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
@ -253,7 +249,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Device disabled</source>
|
||||
<translation>Despositivo desactivado</translation>
|
||||
<translation>Dispositivo desactivado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
@ -277,7 +273,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
<translation>Cable de rede desconectado</translation>
|
||||
<translation>Cabo de rede desconectado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
@ -330,19 +326,19 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation>Capacidade% 1,% 2 minutos restantes</translation>
|
||||
<translation>Capacidade %1, %2 minutos restantes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation>Capacidade% 1,% 2 h% 3 minutos restantes</translation>
|
||||
<translation>Capacidade %1,%2h %3m restantes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
<translation>Cargando% 1,% 2 min ata o completo</translation>
|
||||
<translation>Cargando %1, %2m até completar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 hr %3 min until full</source>
|
||||
<translation>Cargando% 1,% 2 h% 3 min ata completar</translation>
|
||||
<translation>Cargando %1, %2h %3m até completar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged</source>
|
||||
@ -362,7 +358,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation>Capacidade% 1, totalmente cargada</translation>
|
||||
<translation>Capacidade %1, totalmente cargada</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -400,7 +396,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Log out</source>
|
||||
<translation>Pechar a sesión</translation>
|
||||
<translation>Pechar sesión</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Switch account</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicación</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>ब्लूटूथ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>ब्लूएटूथ सेवाएं</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>डिवाइस</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>अनुप्रयोग</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth postavke</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Uređaj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Računalni program</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>%1 bővítmény nem kompatibilis a rendszerrel.</translation>
|
||||
<translation>A %1 bővítmény nem kompatibilis a rendszerrel.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth beállítások</translation>
|
||||
@ -66,7 +62,7 @@
|
||||
<name>DBusAdaptors</name>
|
||||
<message>
|
||||
<source>Add keyboard layout</source>
|
||||
<translation>Billentyűzet kiosztás megadása</translation>
|
||||
<translation>Billentyűzetkiosztás megadása</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -77,15 +73,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>12-hour time</source>
|
||||
<translation>12 órás formátum</translation>
|
||||
<translation>12 órás időformátum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24-hour time</source>
|
||||
<translation>24 órás formátum</translation>
|
||||
<translation>24 órás időformátum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time settings</source>
|
||||
<translation>Idő beállítások</translation>
|
||||
<translation>Idő beállításai</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -107,7 +103,7 @@
|
||||
<name>DialogManager</name>
|
||||
<message>
|
||||
<source>Are you sure you want to empty %1 items?</source>
|
||||
<translation>Biztosan törölni akarsz %1 elemet?</translation>
|
||||
<translation>Biztosan törölni akarja a %1 elemet?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
@ -145,7 +141,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmount all</source>
|
||||
<translation>Minden külső partíció leválasztása</translation>
|
||||
<translation>Összes lecsatolása</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -159,7 +155,7 @@
|
||||
<name>MenuWorker</name>
|
||||
<message>
|
||||
<source>Fashion Mode</source>
|
||||
<translation>Stílus mód</translation>
|
||||
<translation>Stílusos mód</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Efficient Mode</source>
|
||||
@ -214,7 +210,7 @@
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
<source>Multitasking View</source>
|
||||
<translation>Multitasking nézet</translation>
|
||||
<translation>Többfeladatos nézet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
@ -233,11 +229,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation>Vezeték-nélküli kapcsolat megszüntetése</translation>
|
||||
<translation>Vezeték nélküli kapcsolat megszüntetése</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation>Vezeték-nélküli kapcsolat engedélyezése</translation>
|
||||
<translation>Vezeték nélküli kapcsolat engedélyezése</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
@ -257,7 +253,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation>Vezeték-nélküli kapcsolat: %1</translation>
|
||||
<translation>Vezeték nélküli kapcsolat: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
@ -273,7 +269,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>Csatlakozva helyi hálózathoz</translation>
|
||||
<translation>Csatlakoztatva, de nincs internet hozzáférés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>A kapcsolódás sikertelen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -322,7 +318,7 @@
|
||||
<name>PowerPlugin</name>
|
||||
<message>
|
||||
<source>Power</source>
|
||||
<translation>Kikapcsolás</translation>
|
||||
<translation>Energiaellátás</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Power settings</source>
|
||||
@ -330,11 +326,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation>Akkukapacitás %1, %2 perc van még hátra</translation>
|
||||
<translation>Akkumulátor töltöttsége %1, %2 perc van még hátra a feltöltésig</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation>Akkukapacitás %1, %2 óra %3 perc van még hátra</translation>
|
||||
<translation>Akkumulátor töltöttsége %1, %2 óra %3 perc van még hátra a feltöltésig</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
@ -350,7 +346,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation>Kapacitás %1</translation>
|
||||
<translation>Akkumulátor töltöttsége %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
@ -358,11 +354,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation>Kapacitás %1...</translation>
|
||||
<translation>Akkumulátor töltöttsége %1 ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation>Kapacitás %1, teljesen feltöltve</translation>
|
||||
<translation>Akkumulátor töltöttsége %1, teljesen feltöltve</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -380,7 +376,7 @@
|
||||
<name>ShutdownPlugin</name>
|
||||
<message>
|
||||
<source>Power</source>
|
||||
<translation>Kikapcsolás</translation>
|
||||
<translation>Energiaellátás</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Shut down</source>
|
||||
@ -388,7 +384,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Suspend</source>
|
||||
<translation>Felfüggesztés</translation>
|
||||
<translation>Alvó állapot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hibernate</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Eszköz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Alkalmazás</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -442,7 +434,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
<translation>Hangerő: %1%</translation>
|
||||
<translation>Hangerő: %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -475,7 +467,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty</source>
|
||||
<translation>Üres</translation>
|
||||
<translation>Ürítés</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -493,7 +485,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network %1</source>
|
||||
<translation>Vezeték nélküli Hálózat %1 </translation>
|
||||
<translation>Vezeték nélküli hálózat %1 </translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Impostazioni Bluetooth</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Connessione fallita</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Applicazioni</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -6,6 +6,58 @@
|
||||
<translation>プラグイン %1 はこのシステムと互換性がありません。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AppDragWidget</name>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth設定</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>オフにする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>オンにする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth設定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation>%1が接続されました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation>接続試行中...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation>オフにしました</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothPlugin</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DBusAdaptors</name>
|
||||
<message>
|
||||
@ -21,15 +73,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>12-hour time</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>12時間表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24-hour time</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>24時間表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>時間設定</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -89,11 +141,18 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmount all</source>
|
||||
<translation>すべてアンマウント</translation>
|
||||
<translation>すべてマウント解除</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DockSettings</name>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>ランチャー</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MenuWorker</name>
|
||||
<message>
|
||||
<source>Fashion Mode</source>
|
||||
<translation>ファッションモード</translation>
|
||||
@ -147,13 +206,6 @@
|
||||
<translation>プラグイン</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>ランチャー</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
@ -162,7 +214,78 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>ドックから削除</translation>
|
||||
<translation>ドックから外す</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation>有線接続を無効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation>有線接続を有効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation>無線接続を無効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation>無線接続を有効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
<translation>ネットワークを無効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable network</source>
|
||||
<translation>ネットワークを有効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network settings</source>
|
||||
<translation>ネットワーク設定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Device disabled</source>
|
||||
<translation>デバイスが無効</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation>無線接続: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>有線接続: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not connected</source>
|
||||
<translation>未接続</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting</source>
|
||||
<translation>接続試行中</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>接続済み、インターネットアクセスなし</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
<translation>ネットワークケーブル未接続</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
<translation>無線ネットワーク</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>有線ネットワーク</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -171,6 +294,14 @@
|
||||
<source>Network</source>
|
||||
<translation>ネットワーク</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>有線ネットワーク</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network %1</source>
|
||||
<translation>有線ネットワーク %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OnboardPlugin</name>
|
||||
@ -195,11 +326,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation>残量 %1、残り %2 分</translation>
|
||||
<translation>バッテリー残量 %1、残り %2 分</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation>残量 %1、残り %2 時間 %3 分</translation>
|
||||
<translation>バッテリー残量 %1、残り %2 時間 %3 分</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
@ -211,11 +342,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>充電完了</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>バッテリー残量 %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
@ -223,11 +354,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>バッテリー残量 %1...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>バッテリー残量 %1、フル充電済み</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -238,7 +369,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>ドックから削除</translation>
|
||||
<translation>ドックから外す</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -286,16 +417,12 @@
|
||||
<source>Device</source>
|
||||
<translation>デバイス</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>アプリケーション</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
<message>
|
||||
<source>Unmute</source>
|
||||
<translation>消音解除</translation>
|
||||
<translation>消音を解除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mute</source>
|
||||
@ -303,11 +430,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Sound settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>サウンドの設定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>音量 %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -350,32 +477,6 @@
|
||||
<translation>システムトレイ</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiredItem</name>
|
||||
<message>
|
||||
<source>Unknown</source>
|
||||
<translation>不明</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>有線接続: %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessItem</name>
|
||||
<message>
|
||||
<source>No Network</source>
|
||||
<translation>ネットワークなし</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>接続済み、インターネットアクセスなし</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessList</name>
|
||||
<message>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>블루투스</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>블루투스 설정</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>장치</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>응용프로그램</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth nustatymai</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Įrenginys</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Programa</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Tetapan Bluetooth</translation>
|
||||
@ -40,11 +36,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>%1 bersambung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Menyambung...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
@ -52,7 +48,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Dimatikan</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -218,26 +214,26 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>Nyahlabuh</translation>
|
||||
<translation>Tanggal</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Lumpuhkan sambungan berwayar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Benarkan sambungan berwayar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Lumpuhkan sambungan tanpa wayar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Benarkan sambungan tanpa wayar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
@ -350,7 +346,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Kapasiti %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
@ -358,22 +354,22 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Kapasiti %1 ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Kapasiti %1, sepenuhnya dicas</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ShowDesktopPlugin</name>
|
||||
<message>
|
||||
<source>Show Desktop</source>
|
||||
<translation>Tunjuk Desktop</translation>
|
||||
<translation>Tunjuk Atas Meja</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>Nyahlabuh</translation>
|
||||
<translation>Tanggal</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Peranti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplikasi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth-instellingen</translation>
|
||||
@ -214,7 +210,7 @@
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
<source>Multitasking View</source>
|
||||
<translation>Multitaskingoverzicht</translation>
|
||||
<translation>Venster- en werkbladoverzicht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Verbinding mislukt</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Apparaat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Programma</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Ustawienia Bluetooth</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Połączenie nieudane</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Urządzenie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Program</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Definições bluetooth</translation>
|
||||
@ -36,7 +32,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Definições bluetooth</translation>
|
||||
<translation>Definições Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
@ -214,7 +210,7 @@
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
<source>Multitasking View</source>
|
||||
<translation>Vista de tarefas</translation>
|
||||
<translation>Vista de Tarefas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Falha na ligação</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicação</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,13 +15,9 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Configurações de Bluetooth</translation>
|
||||
<translation>Configurações do Bluetooth</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>A conexão falhou</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispositivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicativo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,36 +15,32 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Setări Bluetooth</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Oprește</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Pornește</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Setări Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>%1 conectat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Conectare...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
@ -52,7 +48,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Oprit</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -346,11 +342,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Încărcat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Capactitate %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
@ -358,11 +354,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Capactitate %1 ....</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Capacitate %1, complet încărcat</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Dispozitiv</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplicație</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Настройки Bluetooth</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Устройство</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Приложение</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -442,7 +434,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Volume %1</source>
|
||||
<translation>Том %1</translation>
|
||||
<translation>Громкость %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>බ්ලූටූත්</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>බ්ලූටූත් සැකසුම්</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>උපාංගය</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>යෙදවුම</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation type="unfinished"/>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Zariadenie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplikácia</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -3,33 +3,85 @@
|
||||
<name>AbstractPluginsController</name>
|
||||
<message>
|
||||
<source>The plugin %1 is not compatible with the system.</source>
|
||||
<translation>Vtičnik %1 ni združljiv s sistemom.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AppDragWidget</name>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth nastavitve</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>Izklopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>Vklopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth nastavitve</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 connected</source>
|
||||
<translation>%1 je povezan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting...</source>
|
||||
<translation>Povezovanje...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turned off</source>
|
||||
<translation>Izklopljen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothPlugin</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DBusAdaptors</name>
|
||||
<message>
|
||||
<source>Add keyboard layout</source>
|
||||
<translation>Dodaj razpored</translation>
|
||||
<translation>Dodaj razpored tipk</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatetimePlugin</name>
|
||||
<message>
|
||||
<source>Datetime</source>
|
||||
<translation>Datumčas</translation>
|
||||
<translation>Datum in čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>12 Hour Time</source>
|
||||
<translation>12-urni čas</translation>
|
||||
<source>12-hour time</source>
|
||||
<translation>12 urni čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>24 Hour Time</source>
|
||||
<translation>24-urni čas</translation>
|
||||
<source>24-hour time</source>
|
||||
<translation>24 urni čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time Settings</source>
|
||||
<translation>Nastavitev časa</translation>
|
||||
<source>Time settings</source>
|
||||
<translation>Nastavitve časa</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -51,7 +103,7 @@
|
||||
<name>DialogManager</name>
|
||||
<message>
|
||||
<source>Are you sure you want to empty %1 items?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Želite počisiti %1 predmetov?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
@ -89,11 +141,18 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmount all</source>
|
||||
<translation>Izvrzi vse</translation>
|
||||
<translation>Odklopi vse</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DockSettings</name>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>Zaganjalnik</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MenuWorker</name>
|
||||
<message>
|
||||
<source>Fashion Mode</source>
|
||||
<translation>Modni način</translation>
|
||||
@ -147,21 +206,85 @@
|
||||
<translation>Vtičniki</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LauncherItem</name>
|
||||
<message>
|
||||
<source>Launcher</source>
|
||||
<translation>Zaganjalnik</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultitaskingPlugin</name>
|
||||
<message>
|
||||
<source>Multitasking View</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Prikaz večopravilnosti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation>Odveži</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NetworkItem</name>
|
||||
<message>
|
||||
<source>Disable wired connection</source>
|
||||
<translation>Onemogoči žično povezavo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wired connection</source>
|
||||
<translation>Omogoči žično povezavo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable wireless connection</source>
|
||||
<translation>Onemogoči brezžično povezavo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable wireless connection</source>
|
||||
<translation>Omogoči brezžično povezavo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable network</source>
|
||||
<translation>Onemogoči omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable network</source>
|
||||
<translation>Omogoči omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network settings</source>
|
||||
<translation>Nastavitve omrežja</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Device disabled</source>
|
||||
<translation>Naprava onemogočena</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless connection: %1</source>
|
||||
<translation>Brezžična povezava: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>Žična povezava: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not connected</source>
|
||||
<translation>Brez povezave</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connecting</source>
|
||||
<translation>Povezovanje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>Povezano, brez dostopa do spleta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Network cable unplugged</source>
|
||||
<translation>Omrežni kabel je izklopljen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Network</source>
|
||||
<translation>Brezžično omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>Žično omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
@ -171,12 +294,20 @@
|
||||
<source>Network</source>
|
||||
<translation>Omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network</source>
|
||||
<translation>Žično omrežje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired Network %1</source>
|
||||
<translation>Žično omrežje %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OnboardPlugin</name>
|
||||
<message>
|
||||
<source>Onboard</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Na plošči</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
@ -195,32 +326,40 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 min remaining</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Zmogljivost %1 za %2 min</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, %2 hr %3 min remaining</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged %1</source>
|
||||
<translation type="vanished">Napolnjeno %1</translation>
|
||||
<translation>Zmogljivost %1 za %2 ur in %3 min</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 min until full</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Polnjenje %1 bo končano čez %2 min</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1, %2 hr %3 min until full</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1 ....</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Polnjenje %1 bo končano čez %2 ur in %3 min</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charged</source>
|
||||
<translation>Napolnjen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1</source>
|
||||
<translation>Zmogljivost %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Charging %1</source>
|
||||
<translation>Polnim %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1 ...</source>
|
||||
<translation>Zmogljvost %1 ..</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Capacity %1, fully charged</source>
|
||||
<translation>Zmogljivost %1 - polno</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ShowDesktopPlugin</name>
|
||||
@ -230,7 +369,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Undock</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Odveži</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -243,17 +382,13 @@
|
||||
<source>Shut down</source>
|
||||
<translation>Zaustavitev sistema</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Restart</source>
|
||||
<translation>Vnovični zagon</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Suspend</source>
|
||||
<translation>V način mirovanja</translation>
|
||||
<translation>Mirovanje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hibernate</source>
|
||||
<translation>Mirovanje</translation>
|
||||
<translation>Spanje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock</source>
|
||||
@ -271,6 +406,10 @@
|
||||
<source>Power settings</source>
|
||||
<translation>Nastavitve energijske porabe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Reboot</source>
|
||||
<translation>Ponovni zagon</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundApplet</name>
|
||||
@ -278,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Naprava</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Program</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -294,12 +429,12 @@
|
||||
<translation>Utišaj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Settings</source>
|
||||
<translation>Zvočne nastavitve</translation>
|
||||
<source>Sound settings</source>
|
||||
<translation>Nastavitve zvoka</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Current Volume %1</source>
|
||||
<translation>Trenutna glasnost %1</translation>
|
||||
<source>Volume %1</source>
|
||||
<translation>Glasnost %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -342,32 +477,6 @@
|
||||
<translation>Sistemski pladenj</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiredItem</name>
|
||||
<message>
|
||||
<source>Unknown</source>
|
||||
<translation>Neznano</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wired connection: %1</source>
|
||||
<translation>Žična povezava: %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessItem</name>
|
||||
<message>
|
||||
<source>No Network</source>
|
||||
<translation>Ni omrežij</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wireless Connection: %1</source>
|
||||
<translation>Brezžična povezava: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Connected but no Internet access</source>
|
||||
<translation>Povezano brez dostopa do interneta</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WirelessList</name>
|
||||
<message>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Rregullime Bluetooth-i</translation>
|
||||
@ -163,11 +159,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Efficient Mode</source>
|
||||
<translation>Mënyrë Efikase</translation>
|
||||
<translation>Mënyra Efikase</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Top</source>
|
||||
<translation>Sipër</translation>
|
||||
<translation>Në Krye</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bottom</source>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Lidhja dështoi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Pajisje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Aplikacion</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Блутут</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Блутут подешавања</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Неуспешно повезивање</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Уређај</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Програм</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Bluetooth ayarları</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Bağlantı başarısız</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Aygıt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Uygulama</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>كۆكچىش</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>كۆكچىش تەڭشىكى</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ئۇلىنىش مەغلۇپ بولدى</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>ئۈسكۈنە</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>ئەپلەر </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Параметри Bluetooth</translation>
|
||||
@ -289,7 +285,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Connection failed</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Не вдалося встановити з'єднання</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Пристрій</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Програма</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>Bluetooth</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>Cài đặt Blurtooth</translation>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>Thiết bị</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>Ứng dụng</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>蓝牙设置</translation>
|
||||
@ -28,11 +24,11 @@
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>关闭蓝牙</translation>
|
||||
<translation>关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>开启蓝牙</translation>
|
||||
<translation>开启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>应用</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>藍牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>藍牙設置</translation>
|
||||
@ -28,11 +24,11 @@
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>關閉藍牙</translation>
|
||||
<translation>關閉</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>開啟藍牙</translation>
|
||||
<translation>開啟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
@ -141,7 +137,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Open</source>
|
||||
<translation>開啟</translation>
|
||||
<translation>打開</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmount all</source>
|
||||
@ -400,7 +396,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Log out</source>
|
||||
<translation>登出</translation>
|
||||
<translation>註銷</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Switch account</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>裝置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>應用</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
@ -471,7 +463,7 @@
|
||||
<name>TrashWidget</name>
|
||||
<message>
|
||||
<source>Open</source>
|
||||
<translation>開啟</translation>
|
||||
<translation>打開</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty</source>
|
||||
|
@ -15,10 +15,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>BluetoothApplet</name>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation>藍牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>藍牙設定</translation>
|
||||
@ -28,11 +24,11 @@
|
||||
<name>BluetoothItem</name>
|
||||
<message>
|
||||
<source>Turn off</source>
|
||||
<translation>關閉藍牙</translation>
|
||||
<translation>關閉</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Turn on</source>
|
||||
<translation>開啟藍牙</translation>
|
||||
<translation>開啟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth settings</source>
|
||||
@ -421,10 +417,6 @@
|
||||
<source>Device</source>
|
||||
<translation>裝置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application</source>
|
||||
<translation>應用程式</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SoundItem</name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user