mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
Merge branch 'release/2014.2.2' into develop
Change-Id: I4af79d46ea1663fa7ab7ab0288e0af031b0b145e
This commit is contained in:
commit
5f168b8279
3
debian/control
vendored
3
debian/control
vendored
@ -22,7 +22,6 @@ Build-Depends: debhelper (>= 9),
|
||||
libxtst-dev,
|
||||
libxfixes-dev,
|
||||
libxcursor-dev,
|
||||
upower,
|
||||
libfontconfig1-dev,
|
||||
Standards-Version: 3.9.5
|
||||
Homepage: http://www.linuxdeepin.com
|
||||
@ -32,6 +31,7 @@ Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
acpid,
|
||||
upower,
|
||||
bluez5 | bluez (>=5.4),
|
||||
grub-themes-deepin,
|
||||
network-manager,
|
||||
@ -44,6 +44,7 @@ Depends: ${shlibs:Depends},
|
||||
xserver-xorg-input-wacom,
|
||||
iso-codes,
|
||||
mobile-broadband-provider-info,
|
||||
policykit-1-gnome,
|
||||
Conflicts: dde-workspace ( < 2.1+20141028122406 )
|
||||
Description: daemon handling the DDE session settings
|
||||
This package contains the daemon which is responsible for setting the
|
||||
|
@ -262,6 +262,7 @@ func (m *ClientManager) listenRootWindow() {
|
||||
logger.Debug(err)
|
||||
} else {
|
||||
LAUNCHER.Hide()
|
||||
launcher.DestroyLauncher(LAUNCHER)
|
||||
}
|
||||
} else {
|
||||
isLauncherShown = true
|
||||
|
@ -78,6 +78,10 @@ func (dai *DesktopAppInfo) ListActions() []string {
|
||||
return actions
|
||||
}
|
||||
|
||||
func getGroupName(actionGropuName string) string {
|
||||
return actionGropuName + " Shortcut Group"
|
||||
}
|
||||
|
||||
func (dai *DesktopAppInfo) GetActionName(actionGroup string) string {
|
||||
if dai.gioSupported {
|
||||
logger.Debug("[GetActionName]", dai.GetFilename(), "gio support")
|
||||
@ -88,16 +92,14 @@ func (dai *DesktopAppInfo) GetActionName(actionGroup string) string {
|
||||
langs := GetLanguageNames()
|
||||
str := ""
|
||||
for _, lang := range langs {
|
||||
str, _ = dai.KeyFile.GetLocaleString(actionGroup+" Shortcut Group",
|
||||
"Name", lang)
|
||||
str, _ = dai.KeyFile.GetLocaleString(getGroupName(actionGroup), "Name", lang)
|
||||
if str != "" {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
if str == "" {
|
||||
str, _ = dai.KeyFile.GetString(actionGroup+" Shortcut Group",
|
||||
"Name")
|
||||
str, _ = dai.KeyFile.GetString(getGroupName(actionGroup), "Name")
|
||||
}
|
||||
|
||||
return str
|
||||
@ -112,7 +114,7 @@ func (dai *DesktopAppInfo) LaunchAction(actionGroup string, ctx gio.AppLaunchCon
|
||||
}
|
||||
|
||||
logger.Debug("LaunchAction")
|
||||
exec, _ := dai.KeyFile.GetString(actionGroup+" Shortcut Group", glib.KeyFileDesktopKeyExec)
|
||||
exec, _ := dai.KeyFile.GetString(getGroupName(actionGroup), glib.KeyFileDesktopKeyExec)
|
||||
logger.Debug("exec:", exec)
|
||||
a, err := gio.AppInfoCreateFromCommandline(
|
||||
exec,
|
||||
|
@ -8,7 +8,8 @@ import (
|
||||
var displayRect xproto.Rectangle
|
||||
|
||||
func initDisplay() bool {
|
||||
dpy, err := display.NewDisplay(
|
||||
var err error
|
||||
dpy, err = display.NewDisplay(
|
||||
"com.deepin.daemon.Display",
|
||||
"/com/deepin/daemon/Display",
|
||||
)
|
||||
|
@ -253,6 +253,7 @@ func createScratchFile(id, title, icon, cmd string) error {
|
||||
logger.Warning(err)
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
temp := template.Must(template.New("docked_item_temp").Parse(DockedItemTemp))
|
||||
logger.Debug(title, ",", icon, ",", cmd)
|
||||
e := temp.Execute(f, dockedItemInfo{title, icon, cmd})
|
||||
|
@ -13,5 +13,8 @@ func (m *DockedAppManager) GetDBusInfo() dbus.DBusInfo {
|
||||
}
|
||||
|
||||
func (m *DockedAppManager) destroy() {
|
||||
if m.core != nil {
|
||||
m.core.Unref()
|
||||
}
|
||||
dbus.UnInstallObject(m)
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ func NewHideStateManager(mode HideModeType) *HideStateManager {
|
||||
}
|
||||
|
||||
func (e *HideStateManager) destroy() {
|
||||
close(e.cleanToggleShowChan)
|
||||
dbus.UnInstallObject(e)
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ func Stop() {
|
||||
|
||||
if dpy != nil {
|
||||
display.DestroyDisplay(dpy)
|
||||
dpy = nil
|
||||
}
|
||||
|
||||
if XU != nil {
|
||||
|
@ -46,6 +46,10 @@ func (m *EntryProxyerManager) destroy() {
|
||||
dbus.UnInstallObject(entry)
|
||||
}
|
||||
dbus.UnInstallObject(m)
|
||||
if busdaemon != nil {
|
||||
pkgbus.DestroyDBusDaemon(busdaemon)
|
||||
busdaemon = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *EntryProxyerManager) watchEntries() {
|
||||
|
@ -640,7 +640,8 @@ char* icon_name_to_path(const char* name, int size)
|
||||
char* pic_name = g_strndup(name, pic_name_len);
|
||||
GtkIconTheme* them = gtk_icon_theme_get_default(); //do not ref or unref it
|
||||
if (them == NULL) {
|
||||
g_debug("get theme failed");
|
||||
// NOTE: the g_message won't be recorded on log,
|
||||
g_message("error get default icon theme failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -31,11 +31,15 @@ func find_app_id(pid uint, instanceName, wmName, wmClass, iconName string) strin
|
||||
}
|
||||
|
||||
func find_exec_by_pid(pid uint) string {
|
||||
e := C.GoString(C.get_exec(C.int(pid)))
|
||||
cExec := C.get_exec(C.int(pid))
|
||||
defer C.free(unsafe.Pointer(cExec))
|
||||
e := C.GoString(cExec)
|
||||
if e != "" {
|
||||
return e
|
||||
}
|
||||
return C.GoString(C.get_exe(C.int(pid)))
|
||||
cExe := C.get_exe(C.int(pid))
|
||||
defer C.free(unsafe.Pointer(cExe))
|
||||
return C.GoString(cExe)
|
||||
}
|
||||
|
||||
func get_theme_icon(name string, size int) string {
|
||||
@ -43,7 +47,10 @@ func get_theme_icon(name string, size int) string {
|
||||
defer func() {
|
||||
C.free(unsafe.Pointer(iconName))
|
||||
}()
|
||||
return C.GoString(C.icon_name_to_path(iconName, C.int(size)))
|
||||
cPath := C.icon_name_to_path(iconName, C.int(size))
|
||||
defer C.free(unsafe.Pointer(cPath))
|
||||
path := C.GoString(cPath)
|
||||
return path
|
||||
}
|
||||
|
||||
func initDeepin() {
|
||||
@ -55,6 +62,8 @@ func xpm_to_dataurl(icon string) string {
|
||||
defer func() {
|
||||
C.free(unsafe.Pointer(iconName))
|
||||
}()
|
||||
return C.GoString(C.get_data_uri_by_path(iconName))
|
||||
cDataUri := C.get_data_uri_by_path(iconName)
|
||||
defer C.free(unsafe.Pointer(cDataUri))
|
||||
return C.GoString(cDataUri)
|
||||
|
||||
}
|
||||
|
18
dock/util.go
18
dock/util.go
@ -45,32 +45,38 @@ func getAppIcon(core *gio.DesktopAppInfo) string {
|
||||
}
|
||||
|
||||
icon := gioIcon.ToString()
|
||||
logger.Debug("GetIcon:", gioIcon.ToString())
|
||||
logger.Debug("GetIcon:", icon)
|
||||
if icon == "" {
|
||||
logger.Warning("get icon from theme failed")
|
||||
logger.Warning("gioIcon to string failed")
|
||||
return ""
|
||||
}
|
||||
|
||||
iconPath := get_theme_icon(icon, 48)
|
||||
if iconPath == "" {
|
||||
logger.Warning("get icon from theme failed")
|
||||
return ""
|
||||
// return a empty string might be a better idea here.
|
||||
// However, gtk will get theme icon failed sometimes for unknown reason.
|
||||
// frontend must make a validity check for icon.
|
||||
iconPath = icon
|
||||
}
|
||||
|
||||
logger.Debug("get_theme_icon:", icon)
|
||||
ext := filepath.Ext(iconPath)
|
||||
if ext == "" {
|
||||
logger.Info("get app icon:", icon)
|
||||
return icon
|
||||
}
|
||||
// the filepath.Ext return ".xxx"
|
||||
|
||||
// strip the '.' before extension name,
|
||||
// filepath.Ext function will return ".xxx"
|
||||
ext = ext[1:]
|
||||
logger.Debug("ext:", ext)
|
||||
if strings.EqualFold(ext, "xpm") {
|
||||
logger.Debug("change xpm to data uri")
|
||||
logger.Info("change xpm to data uri")
|
||||
return xpm_to_dataurl(iconPath)
|
||||
}
|
||||
|
||||
logger.Debug("get_theme_icon:", icon)
|
||||
logger.Info("get app icon:", icon)
|
||||
return icon
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@ -29,7 +29,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
@ -227,7 +227,7 @@ func (kbd *Keyboard) init() {
|
||||
}
|
||||
|
||||
func setKbdRepeat(enable bool, delay, interval uint32) {
|
||||
libwrapper.SetKeyboardRepeat(enable, delay, interval)
|
||||
wrapper.SetKeyboardRepeat(enable, delay, interval)
|
||||
}
|
||||
|
||||
func getLayoutFromFile(config string) string {
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
"strings"
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
import (
|
||||
C "launchpad.net/gocheck"
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libkeyboard
|
||||
package keyboard
|
||||
|
||||
func (kbd *Keyboard) printInfo(format string, v ...interface{}) {
|
||||
if kbd.logger == nil {
|
@ -1,223 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2011 ~ 2014 Deepin, Inc.
|
||||
* 2013 ~ 2014 jouyouyun
|
||||
*
|
||||
* Author: jouyouyun <jouyouwen717@gmail.com>
|
||||
* Maintainer: jouyouyun <jouyouwen717@gmail.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
|
||||
* (at your option) 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/>.
|
||||
**/
|
||||
|
||||
package libmouse
|
||||
|
||||
import (
|
||||
"dbus/com/deepin/sessionmanager"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libtouchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
)
|
||||
|
||||
const (
|
||||
mouseKeyLeftHanded = "left-handed"
|
||||
mouseKeyDisableTouchpad = "disable-touchpad"
|
||||
mouseKeyMiddleButton = "middle-button-enabled"
|
||||
mouseKeyNaturalScroll = "natural-scroll"
|
||||
mouseKeyAcceleration = "motion-acceleration"
|
||||
mouseKeyThreshold = "motion-threshold"
|
||||
mouseKeyDoubleClick = "double-click"
|
||||
mouseKeyDragThreshold = "drag-threshold"
|
||||
)
|
||||
|
||||
type Mouse struct {
|
||||
LeftHanded *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
DisableTpad *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
NaturalScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
MiddleButtonEmulation *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
|
||||
MotionAcceleration *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
MotionThreshold *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
|
||||
DoubleClick *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DragThreshold *property.GSettingsIntProperty `access:"readwrite"`
|
||||
|
||||
DeviceList []libwrapper.XIDeviceInfo
|
||||
Exist bool
|
||||
|
||||
logger *log.Logger
|
||||
settings *gio.Settings
|
||||
xsettings *sessionmanager.XSettings
|
||||
}
|
||||
|
||||
var _mouse *Mouse
|
||||
|
||||
func NewMouse(l *log.Logger) *Mouse {
|
||||
mouse := &Mouse{}
|
||||
|
||||
mouse.settings = gio.NewSettings("com.deepin.dde.mouse")
|
||||
mouse.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
mouse, "LeftHanded",
|
||||
mouse.settings, mouseKeyLeftHanded)
|
||||
mouse.DisableTpad = property.NewGSettingsBoolProperty(
|
||||
mouse, "DisableTpad",
|
||||
mouse.settings, mouseKeyDisableTouchpad)
|
||||
mouse.NaturalScroll = property.NewGSettingsBoolProperty(
|
||||
mouse, "NaturalScroll",
|
||||
mouse.settings, mouseKeyNaturalScroll)
|
||||
mouse.MiddleButtonEmulation = property.NewGSettingsBoolProperty(
|
||||
mouse, "MiddleButtonEmulation",
|
||||
mouse.settings, mouseKeyMiddleButton)
|
||||
|
||||
mouse.MotionAcceleration = property.NewGSettingsFloatProperty(
|
||||
mouse, "MotionAcceleration",
|
||||
mouse.settings, mouseKeyAcceleration)
|
||||
mouse.MotionThreshold = property.NewGSettingsFloatProperty(
|
||||
mouse, "MotionThreshold",
|
||||
mouse.settings, mouseKeyThreshold)
|
||||
|
||||
mouse.DoubleClick = property.NewGSettingsIntProperty(
|
||||
mouse, "DoubleClick",
|
||||
mouse.settings, mouseKeyDoubleClick)
|
||||
mouse.DragThreshold = property.NewGSettingsIntProperty(
|
||||
mouse, "DragThreshold",
|
||||
mouse.settings, mouseKeyDragThreshold)
|
||||
|
||||
mouseList, _, _ := libwrapper.GetDevicesList()
|
||||
mouse.setPropDeviceList(mouseList)
|
||||
if len(mouseList) > 0 {
|
||||
mouse.setPropExist(true)
|
||||
} else {
|
||||
mouse.setPropExist(false)
|
||||
}
|
||||
|
||||
mouse.logger = l
|
||||
var err error
|
||||
mouse.xsettings, err = sessionmanager.NewXSettings(
|
||||
"com.deepin.SessionManager",
|
||||
"/com/deepin/XSettings",
|
||||
)
|
||||
if err != nil {
|
||||
mouse.warningInfo("Create XSettings Failed: %v", err)
|
||||
mouse.xsettings = nil
|
||||
}
|
||||
|
||||
_mouse = mouse
|
||||
mouse.init()
|
||||
mouse.handleGSettings()
|
||||
|
||||
return mouse
|
||||
}
|
||||
|
||||
func HandleDeviceChanged(devList []libwrapper.XIDeviceInfo) {
|
||||
if _mouse == nil {
|
||||
return
|
||||
}
|
||||
|
||||
_mouse.setPropDeviceList(devList)
|
||||
if len(devList) == 0 {
|
||||
_mouse.setPropExist(false)
|
||||
if _mouse.DisableTpad.Get() == true {
|
||||
libtouchpad.DeviceEnabled(true)
|
||||
}
|
||||
} else {
|
||||
_mouse.setPropExist(true)
|
||||
_mouse.init()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
* HandleDeviceAdded
|
||||
* HandleDeviceRemoved
|
||||
**/
|
||||
|
||||
func (mouse *Mouse) Reset() {
|
||||
for _, key := range mouse.settings.ListKeys() {
|
||||
mouse.settings.Reset(key)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) motionAcceleration(accel float64) {
|
||||
for _, info := range mouse.DeviceList {
|
||||
libwrapper.SetMotionAcceleration(info.Deviceid, accel)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) motionThreshold(thres float64) {
|
||||
for _, info := range mouse.DeviceList {
|
||||
libwrapper.SetMotionThreshold(info.Deviceid, thres)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) leftHanded(enabled bool) {
|
||||
for _, info := range mouse.DeviceList {
|
||||
libwrapper.SetLeftHanded(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) naturalScroll(enabled bool) {
|
||||
for _, info := range mouse.DeviceList {
|
||||
libwrapper.SetMouseNaturalScroll(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) middleButtonEmulation(enabled bool) {
|
||||
for _, info := range mouse.DeviceList {
|
||||
libwrapper.SetMiddleButtonEmulation(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) doubleClick(value uint32) {
|
||||
if mouse.settings != nil {
|
||||
mouse.xsettings.SetInteger("Net/DoubleClickTime", value)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) dragThreshold(value uint32) {
|
||||
if mouse.settings != nil {
|
||||
mouse.xsettings.SetInteger("Net/DndDragThreshold", value)
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) disableTouchpad(enabled bool) {
|
||||
if !enabled {
|
||||
libtouchpad.DeviceEnabled(true)
|
||||
return
|
||||
}
|
||||
|
||||
if mouse.Exist {
|
||||
libtouchpad.DeviceEnabled(false)
|
||||
} else {
|
||||
libtouchpad.DeviceEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by device info
|
||||
func (mouse *Mouse) init() {
|
||||
mouse.disableTouchpad(mouse.DisableTpad.Get())
|
||||
|
||||
if !mouse.Exist {
|
||||
return
|
||||
}
|
||||
|
||||
mouse.leftHanded(mouse.LeftHanded.Get())
|
||||
mouse.middleButtonEmulation(mouse.MiddleButtonEmulation.Get())
|
||||
|
||||
mouse.motionAcceleration(mouse.MotionAcceleration.Get())
|
||||
mouse.motionThreshold(mouse.MotionThreshold.Get())
|
||||
|
||||
mouse.doubleClick(uint32(mouse.DoubleClick.Get()))
|
||||
mouse.dragThreshold(uint32(mouse.DragThreshold.Get()))
|
||||
}
|
@ -1,327 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2011 ~ 2014 Deepin, Inc.
|
||||
* 2013 ~ 2014 jouyouyun
|
||||
*
|
||||
* Author: jouyouyun <jouyouwen717@gmail.com>
|
||||
* Maintainer: jouyouyun <jouyouwen717@gmail.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
|
||||
* (at your option) 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/>.
|
||||
**/
|
||||
|
||||
package libtouchpad
|
||||
|
||||
import (
|
||||
"dbus/com/deepin/sessionmanager"
|
||||
"os"
|
||||
"os/exec"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
)
|
||||
|
||||
const (
|
||||
tpadKeyEnabled = "touchpad-enabled"
|
||||
tpadKeyLeftHanded = "left-handed"
|
||||
tpadKeyWhileTyping = "disable-while-typing"
|
||||
tpadKeyNaturalScroll = "natural-scroll"
|
||||
tpadKeyEdgeScroll = "edge-scroll-enabled"
|
||||
tpadKeyHorizScroll = "horiz-scroll-enabled"
|
||||
tpadKeyVertScroll = "vert-scroll-enabled"
|
||||
tpadKeyAcceleration = "motion-acceleration"
|
||||
tpadKeyThreshold = "motion-threshold"
|
||||
tpadKeyTapClick = "tap-to-click"
|
||||
tpadKeyScrollDelta = "delta-scroll"
|
||||
tpadKeyDoubleClick = "double-click"
|
||||
tpadKeyDragThreshold = "drag-threshold"
|
||||
)
|
||||
|
||||
type Touchpad struct {
|
||||
TPadEnable *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
LeftHanded *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
DisableIfTyping *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
NaturalScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
EdgeScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
HorizScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
VertScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
TapClick *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
|
||||
MotionAcceleration *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
MotionThreshold *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
|
||||
DoubleClick *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DragThreshold *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DeltaScroll *property.GSettingsIntProperty `access:"readwrite"`
|
||||
|
||||
Exist bool
|
||||
DeviceList []libwrapper.XIDeviceInfo
|
||||
|
||||
logger *log.Logger
|
||||
process *os.Process
|
||||
settings *gio.Settings
|
||||
xsettings *sessionmanager.XSettings
|
||||
}
|
||||
|
||||
var _tpad *Touchpad
|
||||
|
||||
func NewTouchpad(l *log.Logger) *Touchpad {
|
||||
touchpad := &Touchpad{}
|
||||
|
||||
touchpad.settings = gio.NewSettings("com.deepin.dde.touchpad")
|
||||
touchpad.TPadEnable = property.NewGSettingsBoolProperty(
|
||||
touchpad, "TPadEnable",
|
||||
touchpad.settings, tpadKeyEnabled)
|
||||
touchpad.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
touchpad, "LeftHanded",
|
||||
touchpad.settings, tpadKeyLeftHanded)
|
||||
touchpad.DisableIfTyping = property.NewGSettingsBoolProperty(
|
||||
touchpad, "DisableIfTyping",
|
||||
touchpad.settings, tpadKeyWhileTyping)
|
||||
touchpad.NaturalScroll = property.NewGSettingsBoolProperty(
|
||||
touchpad, "NaturalScroll",
|
||||
touchpad.settings, tpadKeyNaturalScroll)
|
||||
touchpad.EdgeScroll = property.NewGSettingsBoolProperty(
|
||||
touchpad, "EdgeScroll",
|
||||
touchpad.settings, tpadKeyEdgeScroll)
|
||||
touchpad.VertScroll = property.NewGSettingsBoolProperty(
|
||||
touchpad, "VertScroll",
|
||||
touchpad.settings, tpadKeyVertScroll)
|
||||
touchpad.HorizScroll = property.NewGSettingsBoolProperty(
|
||||
touchpad, "HorizScroll",
|
||||
touchpad.settings, tpadKeyHorizScroll)
|
||||
touchpad.TapClick = property.NewGSettingsBoolProperty(
|
||||
touchpad, "TapClick",
|
||||
touchpad.settings, tpadKeyTapClick)
|
||||
|
||||
touchpad.MotionAcceleration = property.NewGSettingsFloatProperty(
|
||||
touchpad, "MotionAcceleration",
|
||||
touchpad.settings, tpadKeyAcceleration)
|
||||
touchpad.MotionThreshold = property.NewGSettingsFloatProperty(
|
||||
touchpad, "MotionThreshold",
|
||||
touchpad.settings, tpadKeyThreshold)
|
||||
|
||||
touchpad.DeltaScroll = property.NewGSettingsIntProperty(
|
||||
touchpad, "DeltaScroll",
|
||||
touchpad.settings, tpadKeyScrollDelta)
|
||||
touchpad.DoubleClick = property.NewGSettingsIntProperty(
|
||||
touchpad, "DoubleClick",
|
||||
touchpad.settings, tpadKeyDoubleClick)
|
||||
touchpad.DragThreshold = property.NewGSettingsIntProperty(
|
||||
touchpad, "DragThreshold",
|
||||
touchpad.settings, tpadKeyDragThreshold)
|
||||
|
||||
_, tpadList, _ := libwrapper.GetDevicesList()
|
||||
touchpad.setPropDeviceList(tpadList)
|
||||
|
||||
if len(touchpad.DeviceList) > 0 {
|
||||
touchpad.setPropExist(true)
|
||||
} else {
|
||||
touchpad.setPropExist(false)
|
||||
}
|
||||
|
||||
touchpad.logger = l
|
||||
var err error
|
||||
touchpad.xsettings, err = sessionmanager.NewXSettings(
|
||||
"com.deepin.SessionManager",
|
||||
"/com/deepin/XSettings",
|
||||
)
|
||||
if err != nil {
|
||||
touchpad.warningInfo("Create XSettings Failed: %v", err)
|
||||
touchpad.xsettings = nil
|
||||
}
|
||||
|
||||
_tpad = touchpad
|
||||
touchpad.init()
|
||||
touchpad.handleGSettings()
|
||||
|
||||
return touchpad
|
||||
}
|
||||
|
||||
func DeviceEnabled(enable bool) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !enable {
|
||||
_tpad.enable(false)
|
||||
return
|
||||
}
|
||||
|
||||
// enable == true
|
||||
if !_tpad.TPadEnable.Get() {
|
||||
return
|
||||
}
|
||||
_tpad.enable(true)
|
||||
}
|
||||
|
||||
func HandleDeviceChanged(devList []libwrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
|
||||
_tpad.setPropDeviceList(devList)
|
||||
if len(devList) == 0 {
|
||||
_tpad.setPropExist(false)
|
||||
} else {
|
||||
_tpad.setPropExist(true)
|
||||
_tpad.init()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func HandleDeviceAdded(devInfo libwrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func HandleDeviceRemoved(devInfo libwrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) Reset() {
|
||||
for _, key := range touchpad.settings.ListKeys() {
|
||||
touchpad.settings.Reset(key)
|
||||
}
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) disableTpadWhileTyping(enable bool) {
|
||||
if !enable {
|
||||
if touchpad.process != nil {
|
||||
touchpad.process.Kill()
|
||||
touchpad.process = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Has a syndaemon running...
|
||||
if touchpad.process != nil {
|
||||
return
|
||||
}
|
||||
cmd := exec.Command("/bin/sh", "-c",
|
||||
"syndaemon -i 1 -K -t")
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
touchpad.warningInfo("Exec syndaemon failed: %v", err)
|
||||
return
|
||||
}
|
||||
touchpad.process = cmd.Process
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) enable(enabled bool) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetTouchpadEnabled(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) leftHanded(enabled bool) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetLeftHanded(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) motionAcceleration(accel float64) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetMotionAcceleration(info.Deviceid, accel)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) motionThreshold(thres float64) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetMotionThreshold(info.Deviceid, thres)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) naturalScroll(enabled bool, delta int32) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetTouchpadNaturalScroll(info.Deviceid, enabled, delta)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) edgeScroll(enabled bool) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetTouchpadEdgeScroll(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) twoFingerScroll(vertEnabled,
|
||||
horizEnabled bool) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetTouchpadTwoFingerScroll(info.Deviceid,
|
||||
vertEnabled, horizEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) tapToClick(enabled, leftHanded bool) {
|
||||
for _, info := range touchpad.DeviceList {
|
||||
libwrapper.SetTouchpadTapToClick(info.Deviceid,
|
||||
enabled, leftHanded)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) doubleClick(value int32) {
|
||||
if touchpad.xsettings != nil {
|
||||
touchpad.xsettings.SetInteger("Net/DoubleClickTime",
|
||||
uint32(value))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) dragThreshold(value int32) {
|
||||
if touchpad.xsettings != nil {
|
||||
touchpad.xsettings.SetInteger("Net/DndDragThreshold",
|
||||
uint32(value))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (touchpad *Touchpad) init() {
|
||||
if !touchpad.Exist {
|
||||
return
|
||||
}
|
||||
|
||||
enabled := touchpad.TPadEnable.Get()
|
||||
touchpad.enable(enabled)
|
||||
if !enabled {
|
||||
return
|
||||
}
|
||||
|
||||
touchpad.leftHanded(touchpad.LeftHanded.Get())
|
||||
touchpad.tapToClick(touchpad.TapClick.Get(),
|
||||
touchpad.LeftHanded.Get())
|
||||
if touchpad.DisableIfTyping.Get() {
|
||||
exec.Command("/bin/sh", "-c", "killall syndaemon").Run()
|
||||
}
|
||||
touchpad.disableTpadWhileTyping(touchpad.DisableIfTyping.Get())
|
||||
touchpad.naturalScroll(touchpad.NaturalScroll.Get(),
|
||||
touchpad.DeltaScroll.Get())
|
||||
touchpad.edgeScroll(touchpad.EdgeScroll.Get())
|
||||
touchpad.twoFingerScroll(touchpad.VertScroll.Get(),
|
||||
touchpad.HorizScroll.Get())
|
||||
|
||||
touchpad.motionAcceleration(touchpad.MotionAcceleration.Get())
|
||||
touchpad.motionThreshold(touchpad.MotionThreshold.Get())
|
||||
}
|
@ -22,10 +22,10 @@
|
||||
package inputdevices
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libkeyboard"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libmouse"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libtouchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwacom"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/keyboard"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/mouse"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/touchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wacom"
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
)
|
||||
@ -34,10 +34,10 @@ import (
|
||||
type Manager struct {
|
||||
Infos []devicePathInfo
|
||||
|
||||
mouse *libmouse.Mouse
|
||||
touchpad *libtouchpad.Touchpad
|
||||
kbd *libkeyboard.Keyboard
|
||||
wacom *libwacom.Wacom
|
||||
mouse *mouse.Mouse
|
||||
touchpad *touchpad.Touchpad
|
||||
kbd *keyboard.Keyboard
|
||||
wacom *wacom.Wacom
|
||||
logger *log.Logger
|
||||
versionRight bool
|
||||
}
|
||||
@ -61,10 +61,10 @@ func NewManager(l *log.Logger) *Manager {
|
||||
|
||||
m.logger = l
|
||||
// Touchpad must be created Before Mouse
|
||||
m.touchpad = libtouchpad.NewTouchpad(l)
|
||||
m.mouse = libmouse.NewMouse(l)
|
||||
m.kbd = libkeyboard.NewKeyboard(l)
|
||||
m.wacom = libwacom.NewWacom(l)
|
||||
m.touchpad = touchpad.NewTouchpad(l)
|
||||
m.mouse = mouse.NewMouse(l)
|
||||
m.kbd = keyboard.NewKeyboard(l)
|
||||
m.wacom = wacom.NewWacom(l)
|
||||
m.versionRight = m.isVersionRight()
|
||||
|
||||
return m
|
||||
|
@ -19,31 +19,31 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libmouse
|
||||
package mouse
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
)
|
||||
|
||||
func (mouse *Mouse) handleGSettings() {
|
||||
mouse.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
func (m *Mouse) handleGSettings() {
|
||||
m.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
switch key {
|
||||
case mouseKeyLeftHanded:
|
||||
mouse.leftHanded(mouse.LeftHanded.Get())
|
||||
m.leftHanded(m.LeftHanded.Get())
|
||||
case mouseKeyDisableTouchpad:
|
||||
mouse.disableTouchpad(mouse.DisableTpad.Get())
|
||||
m.disableTouchpad(m.DisableTpad.Get())
|
||||
case mouseKeyNaturalScroll:
|
||||
mouse.naturalScroll(mouse.NaturalScroll.Get())
|
||||
m.naturalScroll(m.NaturalScroll.Get())
|
||||
case mouseKeyMiddleButton:
|
||||
mouse.middleButtonEmulation(mouse.MiddleButtonEmulation.Get())
|
||||
m.middleButtonEmulation(m.MiddleButtonEmulation.Get())
|
||||
case mouseKeyAcceleration:
|
||||
mouse.motionAcceleration(mouse.MotionAcceleration.Get())
|
||||
m.motionAcceleration(m.MotionAcceleration.Get())
|
||||
case mouseKeyThreshold:
|
||||
mouse.motionThreshold(mouse.MotionThreshold.Get())
|
||||
m.motionThreshold(m.MotionThreshold.Get())
|
||||
case mouseKeyDoubleClick:
|
||||
mouse.doubleClick(uint32(mouse.DoubleClick.Get()))
|
||||
m.doubleClick(uint32(m.DoubleClick.Get()))
|
||||
case mouseKeyDragThreshold:
|
||||
mouse.dragThreshold(uint32(mouse.DragThreshold.Get()))
|
||||
m.dragThreshold(uint32(m.DragThreshold.Get()))
|
||||
}
|
||||
})
|
||||
}
|
223
inputdevices/mouse/mouse.go
Normal file
223
inputdevices/mouse/mouse.go
Normal file
@ -0,0 +1,223 @@
|
||||
/**
|
||||
* Copyright (c) 2011 ~ 2014 Deepin, Inc.
|
||||
* 2013 ~ 2014 jouyouyun
|
||||
*
|
||||
* Author: jouyouyun <jouyouwen717@gmail.com>
|
||||
* Maintainer: jouyouyun <jouyouwen717@gmail.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
|
||||
* (at your option) 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/>.
|
||||
**/
|
||||
|
||||
package mouse
|
||||
|
||||
import (
|
||||
"dbus/com/deepin/sessionmanager"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/touchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
)
|
||||
|
||||
const (
|
||||
mouseKeyLeftHanded = "left-handed"
|
||||
mouseKeyDisableTouchpad = "disable-touchpad"
|
||||
mouseKeyMiddleButton = "middle-button-enabled"
|
||||
mouseKeyNaturalScroll = "natural-scroll"
|
||||
mouseKeyAcceleration = "motion-acceleration"
|
||||
mouseKeyThreshold = "motion-threshold"
|
||||
mouseKeyDoubleClick = "double-click"
|
||||
mouseKeyDragThreshold = "drag-threshold"
|
||||
)
|
||||
|
||||
type Mouse struct {
|
||||
LeftHanded *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
DisableTpad *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
NaturalScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
MiddleButtonEmulation *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
|
||||
MotionAcceleration *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
MotionThreshold *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
|
||||
DoubleClick *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DragThreshold *property.GSettingsIntProperty `access:"readwrite"`
|
||||
|
||||
DeviceList []wrapper.XIDeviceInfo
|
||||
Exist bool
|
||||
|
||||
logger *log.Logger
|
||||
settings *gio.Settings
|
||||
xsettings *sessionmanager.XSettings
|
||||
}
|
||||
|
||||
var _mouse *Mouse
|
||||
|
||||
func NewMouse(l *log.Logger) *Mouse {
|
||||
m := &Mouse{}
|
||||
|
||||
m.settings = gio.NewSettings("com.deepin.dde.mouse")
|
||||
m.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
m, "LeftHanded",
|
||||
m.settings, mouseKeyLeftHanded)
|
||||
m.DisableTpad = property.NewGSettingsBoolProperty(
|
||||
m, "DisableTpad",
|
||||
m.settings, mouseKeyDisableTouchpad)
|
||||
m.NaturalScroll = property.NewGSettingsBoolProperty(
|
||||
m, "NaturalScroll",
|
||||
m.settings, mouseKeyNaturalScroll)
|
||||
m.MiddleButtonEmulation = property.NewGSettingsBoolProperty(
|
||||
m, "MiddleButtonEmulation",
|
||||
m.settings, mouseKeyMiddleButton)
|
||||
|
||||
m.MotionAcceleration = property.NewGSettingsFloatProperty(
|
||||
m, "MotionAcceleration",
|
||||
m.settings, mouseKeyAcceleration)
|
||||
m.MotionThreshold = property.NewGSettingsFloatProperty(
|
||||
m, "MotionThreshold",
|
||||
m.settings, mouseKeyThreshold)
|
||||
|
||||
m.DoubleClick = property.NewGSettingsIntProperty(
|
||||
m, "DoubleClick",
|
||||
m.settings, mouseKeyDoubleClick)
|
||||
m.DragThreshold = property.NewGSettingsIntProperty(
|
||||
m, "DragThreshold",
|
||||
m.settings, mouseKeyDragThreshold)
|
||||
|
||||
mouseList, _, _ := wrapper.GetDevicesList()
|
||||
m.setPropDeviceList(mouseList)
|
||||
if len(mouseList) > 0 {
|
||||
m.setPropExist(true)
|
||||
} else {
|
||||
m.setPropExist(false)
|
||||
}
|
||||
|
||||
m.logger = l
|
||||
var err error
|
||||
m.xsettings, err = sessionmanager.NewXSettings(
|
||||
"com.deepin.SessionManager",
|
||||
"/com/deepin/XSettings",
|
||||
)
|
||||
if err != nil {
|
||||
m.warningInfo("Create XSettings Failed: %v", err)
|
||||
m.xsettings = nil
|
||||
}
|
||||
|
||||
_mouse = m
|
||||
m.init()
|
||||
m.handleGSettings()
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func HandleDeviceChanged(devList []wrapper.XIDeviceInfo) {
|
||||
if _mouse == nil {
|
||||
return
|
||||
}
|
||||
|
||||
_mouse.setPropDeviceList(devList)
|
||||
if len(devList) == 0 {
|
||||
_mouse.setPropExist(false)
|
||||
if _mouse.DisableTpad.Get() == true {
|
||||
touchpad.DeviceEnabled(true)
|
||||
}
|
||||
} else {
|
||||
_mouse.setPropExist(true)
|
||||
_mouse.init()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
* HandleDeviceAdded
|
||||
* HandleDeviceRemoved
|
||||
**/
|
||||
|
||||
func (m *Mouse) Reset() {
|
||||
for _, key := range m.settings.ListKeys() {
|
||||
m.settings.Reset(key)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) motionAcceleration(accel float64) {
|
||||
for _, info := range m.DeviceList {
|
||||
wrapper.SetMotionAcceleration(info.Deviceid, accel)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) motionThreshold(thres float64) {
|
||||
for _, info := range m.DeviceList {
|
||||
wrapper.SetMotionThreshold(info.Deviceid, thres)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) leftHanded(enabled bool) {
|
||||
for _, info := range m.DeviceList {
|
||||
wrapper.SetLeftHanded(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) naturalScroll(enabled bool) {
|
||||
for _, info := range m.DeviceList {
|
||||
wrapper.SetMouseNaturalScroll(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) middleButtonEmulation(enabled bool) {
|
||||
for _, info := range m.DeviceList {
|
||||
wrapper.SetMiddleButtonEmulation(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) doubleClick(value uint32) {
|
||||
if m.settings != nil {
|
||||
m.xsettings.SetInteger("Net/DoubleClickTime", value)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) dragThreshold(value uint32) {
|
||||
if m.settings != nil {
|
||||
m.xsettings.SetInteger("Net/DndDragThreshold", value)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mouse) disableTouchpad(enabled bool) {
|
||||
if !enabled {
|
||||
touchpad.DeviceEnabled(true)
|
||||
return
|
||||
}
|
||||
|
||||
if m.Exist {
|
||||
touchpad.DeviceEnabled(false)
|
||||
} else {
|
||||
touchpad.DeviceEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by device info
|
||||
func (m *Mouse) init() {
|
||||
m.disableTouchpad(m.DisableTpad.Get())
|
||||
|
||||
if !m.Exist {
|
||||
return
|
||||
}
|
||||
|
||||
m.leftHanded(m.LeftHanded.Get())
|
||||
m.middleButtonEmulation(m.MiddleButtonEmulation.Get())
|
||||
|
||||
m.motionAcceleration(m.MotionAcceleration.Get())
|
||||
m.motionThreshold(m.MotionThreshold.Get())
|
||||
|
||||
m.doubleClick(uint32(m.DoubleClick.Get()))
|
||||
m.dragThreshold(uint32(m.DragThreshold.Get()))
|
||||
}
|
@ -19,10 +19,10 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libmouse
|
||||
package mouse
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
)
|
||||
|
||||
@ -32,7 +32,7 @@ const (
|
||||
DBUS_IFC_MOUSE = "com.deepin.daemon.InputDevice.Mouse"
|
||||
)
|
||||
|
||||
func (mouse *Mouse) GetDBusInfo() dbus.DBusInfo {
|
||||
func (m *Mouse) GetDBusInfo() dbus.DBusInfo {
|
||||
return dbus.DBusInfo{
|
||||
Dest: DBUS_SENDER,
|
||||
ObjectPath: DBUS_PATH_MOUSE,
|
||||
@ -40,14 +40,14 @@ func (mouse *Mouse) GetDBusInfo() dbus.DBusInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (mouse *Mouse) setPropDeviceList(devList []libwrapper.XIDeviceInfo) {
|
||||
mouse.DeviceList = devList
|
||||
dbus.NotifyChange(mouse, "DeviceList")
|
||||
func (m *Mouse) setPropDeviceList(devList []wrapper.XIDeviceInfo) {
|
||||
m.DeviceList = devList
|
||||
dbus.NotifyChange(m, "DeviceList")
|
||||
}
|
||||
|
||||
func (mouse *Mouse) setPropExist(exist bool) {
|
||||
if mouse.Exist != exist {
|
||||
mouse.Exist = exist
|
||||
dbus.NotifyChange(mouse, "Exist")
|
||||
func (m *Mouse) setPropExist(exist bool) {
|
||||
if m.Exist != exist {
|
||||
m.Exist = exist
|
||||
dbus.NotifyChange(m, "Exist")
|
||||
}
|
||||
}
|
@ -19,36 +19,36 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libmouse
|
||||
package mouse
|
||||
|
||||
func (mouse *Mouse) printInfo(format string, v ...interface{}) {
|
||||
if mouse.logger == nil {
|
||||
func (m *Mouse) printInfo(format string, v ...interface{}) {
|
||||
if m.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
mouse.logger.Infof(format, v...)
|
||||
m.logger.Infof(format, v...)
|
||||
}
|
||||
|
||||
func (mouse *Mouse) debugInfo(format string, v ...interface{}) {
|
||||
if mouse.logger == nil {
|
||||
func (m *Mouse) debugInfo(format string, v ...interface{}) {
|
||||
if m.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
mouse.logger.Debugf(format, v...)
|
||||
m.logger.Debugf(format, v...)
|
||||
}
|
||||
|
||||
func (mouse *Mouse) warningInfo(format string, v ...interface{}) {
|
||||
if mouse.logger == nil {
|
||||
func (m *Mouse) warningInfo(format string, v ...interface{}) {
|
||||
if m.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
mouse.logger.Warningf(format, v...)
|
||||
m.logger.Warningf(format, v...)
|
||||
}
|
||||
|
||||
func (mouse *Mouse) errorInfo(format string, v ...interface{}) {
|
||||
if mouse.logger == nil {
|
||||
func (m *Mouse) errorInfo(format string, v ...interface{}) {
|
||||
if m.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
mouse.logger.Errorf(format, v...)
|
||||
m.logger.Errorf(format, v...)
|
||||
}
|
@ -19,42 +19,42 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libtouchpad
|
||||
package touchpad
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
)
|
||||
|
||||
func (touchpad *Touchpad) handleGSettings() {
|
||||
touchpad.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
func (tpad *Touchpad) handleGSettings() {
|
||||
tpad.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
switch key {
|
||||
case tpadKeyEnabled:
|
||||
touchpad.enable(touchpad.TPadEnable.Get())
|
||||
tpad.enable(tpad.TPadEnable.Get())
|
||||
case tpadKeyLeftHanded:
|
||||
touchpad.leftHanded(touchpad.LeftHanded.Get())
|
||||
touchpad.tapToClick(touchpad.TapClick.Get(),
|
||||
touchpad.LeftHanded.Get())
|
||||
tpad.leftHanded(tpad.LeftHanded.Get())
|
||||
tpad.tapToClick(tpad.TapClick.Get(),
|
||||
tpad.LeftHanded.Get())
|
||||
case tpadKeyTapClick:
|
||||
touchpad.tapToClick(touchpad.TapClick.Get(),
|
||||
touchpad.LeftHanded.Get())
|
||||
tpad.tapToClick(tpad.TapClick.Get(),
|
||||
tpad.LeftHanded.Get())
|
||||
case tpadKeyNaturalScroll, tpadKeyScrollDelta:
|
||||
touchpad.naturalScroll(touchpad.NaturalScroll.Get(),
|
||||
touchpad.DeltaScroll.Get())
|
||||
tpad.naturalScroll(tpad.NaturalScroll.Get(),
|
||||
tpad.DeltaScroll.Get())
|
||||
case tpadKeyEdgeScroll:
|
||||
touchpad.edgeScroll(touchpad.EdgeScroll.Get())
|
||||
tpad.edgeScroll(tpad.EdgeScroll.Get())
|
||||
case tpadKeyVertScroll, tpadKeyHorizScroll:
|
||||
touchpad.twoFingerScroll(touchpad.VertScroll.Get(),
|
||||
touchpad.HorizScroll.Get())
|
||||
tpad.twoFingerScroll(tpad.VertScroll.Get(),
|
||||
tpad.HorizScroll.Get())
|
||||
case tpadKeyWhileTyping:
|
||||
touchpad.disableTpadWhileTyping(touchpad.DisableIfTyping.Get())
|
||||
tpad.disableTpadWhileTyping(tpad.DisableIfTyping.Get())
|
||||
case tpadKeyDoubleClick:
|
||||
touchpad.doubleClick(touchpad.DoubleClick.Get())
|
||||
tpad.doubleClick(tpad.DoubleClick.Get())
|
||||
case tpadKeyDragThreshold:
|
||||
touchpad.dragThreshold(touchpad.DragThreshold.Get())
|
||||
tpad.dragThreshold(tpad.DragThreshold.Get())
|
||||
case tpadKeyAcceleration:
|
||||
touchpad.motionAcceleration(touchpad.MotionAcceleration.Get())
|
||||
tpad.motionAcceleration(tpad.MotionAcceleration.Get())
|
||||
case tpadKeyThreshold:
|
||||
touchpad.motionThreshold(touchpad.MotionThreshold.Get())
|
||||
tpad.motionThreshold(tpad.MotionThreshold.Get())
|
||||
}
|
||||
})
|
||||
}
|
@ -19,36 +19,36 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwacom
|
||||
package touchpad
|
||||
|
||||
func (wacom *Wacom) printInfo(format string, v ...interface{}) {
|
||||
if wacom.logger == nil {
|
||||
func (tpad *Touchpad) printInfo(format string, v ...interface{}) {
|
||||
if tpad.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
wacom.logger.Infof(format, v...)
|
||||
tpad.logger.Infof(format, v...)
|
||||
}
|
||||
|
||||
func (wacom *Wacom) debugInfo(format string, v ...interface{}) {
|
||||
if wacom.logger == nil {
|
||||
func (tpad *Touchpad) debugInfo(format string, v ...interface{}) {
|
||||
if tpad.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
wacom.logger.Debugf(format, v...)
|
||||
tpad.logger.Debugf(format, v...)
|
||||
}
|
||||
|
||||
func (wacom *Wacom) warningInfo(format string, v ...interface{}) {
|
||||
if wacom.logger == nil {
|
||||
func (tpad *Touchpad) warningInfo(format string, v ...interface{}) {
|
||||
if tpad.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
wacom.logger.Warningf(format, v...)
|
||||
tpad.logger.Warningf(format, v...)
|
||||
}
|
||||
|
||||
func (wacom *Wacom) errorInfo(format string, v ...interface{}) {
|
||||
if wacom.logger == nil {
|
||||
func (tpad *Touchpad) errorInfo(format string, v ...interface{}) {
|
||||
if tpad.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
wacom.logger.Errorf(format, v...)
|
||||
tpad.logger.Errorf(format, v...)
|
||||
}
|
327
inputdevices/touchpad/touchpad.go
Normal file
327
inputdevices/touchpad/touchpad.go
Normal file
@ -0,0 +1,327 @@
|
||||
/**
|
||||
* Copyright (c) 2011 ~ 2014 Deepin, Inc.
|
||||
* 2013 ~ 2014 jouyouyun
|
||||
*
|
||||
* Author: jouyouyun <jouyouwen717@gmail.com>
|
||||
* Maintainer: jouyouyun <jouyouwen717@gmail.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
|
||||
* (at your option) 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/>.
|
||||
**/
|
||||
|
||||
package touchpad
|
||||
|
||||
import (
|
||||
"dbus/com/deepin/sessionmanager"
|
||||
"os"
|
||||
"os/exec"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
"pkg.linuxdeepin.com/lib/log"
|
||||
)
|
||||
|
||||
const (
|
||||
tpadKeyEnabled = "touchpad-enabled"
|
||||
tpadKeyLeftHanded = "left-handed"
|
||||
tpadKeyWhileTyping = "disable-while-typing"
|
||||
tpadKeyNaturalScroll = "natural-scroll"
|
||||
tpadKeyEdgeScroll = "edge-scroll-enabled"
|
||||
tpadKeyHorizScroll = "horiz-scroll-enabled"
|
||||
tpadKeyVertScroll = "vert-scroll-enabled"
|
||||
tpadKeyAcceleration = "motion-acceleration"
|
||||
tpadKeyThreshold = "motion-threshold"
|
||||
tpadKeyTapClick = "tap-to-click"
|
||||
tpadKeyScrollDelta = "delta-scroll"
|
||||
tpadKeyDoubleClick = "double-click"
|
||||
tpadKeyDragThreshold = "drag-threshold"
|
||||
)
|
||||
|
||||
type Touchpad struct {
|
||||
TPadEnable *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
LeftHanded *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
DisableIfTyping *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
NaturalScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
EdgeScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
HorizScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
VertScroll *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
TapClick *property.GSettingsBoolProperty `access:"readwrite"`
|
||||
|
||||
MotionAcceleration *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
MotionThreshold *property.GSettingsFloatProperty `access:"readwrite"`
|
||||
|
||||
DoubleClick *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DragThreshold *property.GSettingsIntProperty `access:"readwrite"`
|
||||
DeltaScroll *property.GSettingsIntProperty `access:"readwrite"`
|
||||
|
||||
Exist bool
|
||||
DeviceList []wrapper.XIDeviceInfo
|
||||
|
||||
logger *log.Logger
|
||||
process *os.Process
|
||||
settings *gio.Settings
|
||||
xsettings *sessionmanager.XSettings
|
||||
}
|
||||
|
||||
var _tpad *Touchpad
|
||||
|
||||
func NewTouchpad(l *log.Logger) *Touchpad {
|
||||
tpad := &Touchpad{}
|
||||
|
||||
tpad.settings = gio.NewSettings("com.deepin.dde.touchpad")
|
||||
tpad.TPadEnable = property.NewGSettingsBoolProperty(
|
||||
tpad, "TPadEnable",
|
||||
tpad.settings, tpadKeyEnabled)
|
||||
tpad.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
tpad, "LeftHanded",
|
||||
tpad.settings, tpadKeyLeftHanded)
|
||||
tpad.DisableIfTyping = property.NewGSettingsBoolProperty(
|
||||
tpad, "DisableIfTyping",
|
||||
tpad.settings, tpadKeyWhileTyping)
|
||||
tpad.NaturalScroll = property.NewGSettingsBoolProperty(
|
||||
tpad, "NaturalScroll",
|
||||
tpad.settings, tpadKeyNaturalScroll)
|
||||
tpad.EdgeScroll = property.NewGSettingsBoolProperty(
|
||||
tpad, "EdgeScroll",
|
||||
tpad.settings, tpadKeyEdgeScroll)
|
||||
tpad.VertScroll = property.NewGSettingsBoolProperty(
|
||||
tpad, "VertScroll",
|
||||
tpad.settings, tpadKeyVertScroll)
|
||||
tpad.HorizScroll = property.NewGSettingsBoolProperty(
|
||||
tpad, "HorizScroll",
|
||||
tpad.settings, tpadKeyHorizScroll)
|
||||
tpad.TapClick = property.NewGSettingsBoolProperty(
|
||||
tpad, "TapClick",
|
||||
tpad.settings, tpadKeyTapClick)
|
||||
|
||||
tpad.MotionAcceleration = property.NewGSettingsFloatProperty(
|
||||
tpad, "MotionAcceleration",
|
||||
tpad.settings, tpadKeyAcceleration)
|
||||
tpad.MotionThreshold = property.NewGSettingsFloatProperty(
|
||||
tpad, "MotionThreshold",
|
||||
tpad.settings, tpadKeyThreshold)
|
||||
|
||||
tpad.DeltaScroll = property.NewGSettingsIntProperty(
|
||||
tpad, "DeltaScroll",
|
||||
tpad.settings, tpadKeyScrollDelta)
|
||||
tpad.DoubleClick = property.NewGSettingsIntProperty(
|
||||
tpad, "DoubleClick",
|
||||
tpad.settings, tpadKeyDoubleClick)
|
||||
tpad.DragThreshold = property.NewGSettingsIntProperty(
|
||||
tpad, "DragThreshold",
|
||||
tpad.settings, tpadKeyDragThreshold)
|
||||
|
||||
_, tpadList, _ := wrapper.GetDevicesList()
|
||||
tpad.setPropDeviceList(tpadList)
|
||||
|
||||
if len(tpad.DeviceList) > 0 {
|
||||
tpad.setPropExist(true)
|
||||
} else {
|
||||
tpad.setPropExist(false)
|
||||
}
|
||||
|
||||
tpad.logger = l
|
||||
var err error
|
||||
tpad.xsettings, err = sessionmanager.NewXSettings(
|
||||
"com.deepin.SessionManager",
|
||||
"/com/deepin/XSettings",
|
||||
)
|
||||
if err != nil {
|
||||
tpad.warningInfo("Create XSettings Failed: %v", err)
|
||||
tpad.xsettings = nil
|
||||
}
|
||||
|
||||
_tpad = tpad
|
||||
tpad.init()
|
||||
tpad.handleGSettings()
|
||||
|
||||
return tpad
|
||||
}
|
||||
|
||||
func DeviceEnabled(enable bool) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !enable {
|
||||
_tpad.enable(false)
|
||||
return
|
||||
}
|
||||
|
||||
// enable == true
|
||||
if !_tpad.TPadEnable.Get() {
|
||||
return
|
||||
}
|
||||
_tpad.enable(true)
|
||||
}
|
||||
|
||||
func HandleDeviceChanged(devList []wrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
|
||||
_tpad.setPropDeviceList(devList)
|
||||
if len(devList) == 0 {
|
||||
_tpad.setPropExist(false)
|
||||
} else {
|
||||
_tpad.setPropExist(true)
|
||||
_tpad.init()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func HandleDeviceAdded(devInfo wrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func HandleDeviceRemoved(devInfo wrapper.XIDeviceInfo) {
|
||||
if _tpad == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (tpad *Touchpad) Reset() {
|
||||
for _, key := range tpad.settings.ListKeys() {
|
||||
tpad.settings.Reset(key)
|
||||
}
|
||||
}
|
||||
|
||||
func (tpad *Touchpad) disableTpadWhileTyping(enable bool) {
|
||||
if !enable {
|
||||
if tpad.process != nil {
|
||||
tpad.process.Kill()
|
||||
tpad.process = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Has a syndaemon running...
|
||||
if tpad.process != nil {
|
||||
return
|
||||
}
|
||||
cmd := exec.Command("/bin/sh", "-c",
|
||||
"syndaemon -i 1 -K -t")
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
tpad.warningInfo("Exec syndaemon failed: %v", err)
|
||||
return
|
||||
}
|
||||
tpad.process = cmd.Process
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) enable(enabled bool) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetTouchpadEnabled(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) leftHanded(enabled bool) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetLeftHanded(info.Deviceid, info.Name, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) motionAcceleration(accel float64) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetMotionAcceleration(info.Deviceid, accel)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) motionThreshold(thres float64) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetMotionThreshold(info.Deviceid, thres)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) naturalScroll(enabled bool, delta int32) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetTouchpadNaturalScroll(info.Deviceid, enabled, delta)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) edgeScroll(enabled bool) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetTouchpadEdgeScroll(info.Deviceid, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) twoFingerScroll(vertEnabled,
|
||||
horizEnabled bool) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetTouchpadTwoFingerScroll(info.Deviceid,
|
||||
vertEnabled, horizEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) tapToClick(enabled, leftHanded bool) {
|
||||
for _, info := range tpad.DeviceList {
|
||||
wrapper.SetTouchpadTapToClick(info.Deviceid,
|
||||
enabled, leftHanded)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) doubleClick(value int32) {
|
||||
if tpad.xsettings != nil {
|
||||
tpad.xsettings.SetInteger("Net/DoubleClickTime",
|
||||
uint32(value))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) dragThreshold(value int32) {
|
||||
if tpad.xsettings != nil {
|
||||
tpad.xsettings.SetInteger("Net/DndDragThreshold",
|
||||
uint32(value))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: set by deviceid
|
||||
func (tpad *Touchpad) init() {
|
||||
if !tpad.Exist {
|
||||
return
|
||||
}
|
||||
|
||||
enabled := tpad.TPadEnable.Get()
|
||||
tpad.enable(enabled)
|
||||
if !enabled {
|
||||
return
|
||||
}
|
||||
|
||||
tpad.leftHanded(tpad.LeftHanded.Get())
|
||||
tpad.tapToClick(tpad.TapClick.Get(),
|
||||
tpad.LeftHanded.Get())
|
||||
if tpad.DisableIfTyping.Get() {
|
||||
exec.Command("/bin/sh", "-c", "killall syndaemon").Run()
|
||||
}
|
||||
tpad.disableTpadWhileTyping(tpad.DisableIfTyping.Get())
|
||||
tpad.naturalScroll(tpad.NaturalScroll.Get(),
|
||||
tpad.DeltaScroll.Get())
|
||||
tpad.edgeScroll(tpad.EdgeScroll.Get())
|
||||
tpad.twoFingerScroll(tpad.VertScroll.Get(),
|
||||
tpad.HorizScroll.Get())
|
||||
|
||||
tpad.motionAcceleration(tpad.MotionAcceleration.Get())
|
||||
tpad.motionThreshold(tpad.MotionThreshold.Get())
|
||||
}
|
@ -19,10 +19,10 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libtouchpad
|
||||
package touchpad
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
)
|
||||
|
||||
@ -32,7 +32,7 @@ const (
|
||||
DBUS_IFC_TPAD = "com.deepin.daemon.InputDevice.TouchPad"
|
||||
)
|
||||
|
||||
func (touchpad *Touchpad) GetDBusInfo() dbus.DBusInfo {
|
||||
func (tpad *Touchpad) GetDBusInfo() dbus.DBusInfo {
|
||||
return dbus.DBusInfo{
|
||||
Dest: DBUS_SENDER,
|
||||
ObjectPath: DBUS_PATH_TPAD,
|
||||
@ -40,14 +40,14 @@ func (touchpad *Touchpad) GetDBusInfo() dbus.DBusInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) setPropDeviceList(devList []libwrapper.XIDeviceInfo) {
|
||||
touchpad.DeviceList = devList
|
||||
dbus.NotifyChange(touchpad, "DeviceList")
|
||||
func (tpad *Touchpad) setPropDeviceList(devList []wrapper.XIDeviceInfo) {
|
||||
tpad.DeviceList = devList
|
||||
dbus.NotifyChange(tpad, "DeviceList")
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) setPropExist(exist bool) {
|
||||
if touchpad.Exist != exist {
|
||||
touchpad.Exist = exist
|
||||
dbus.NotifyChange(touchpad, "Exist")
|
||||
func (tpad *Touchpad) setPropExist(exist bool) {
|
||||
if tpad.Exist != exist {
|
||||
tpad.Exist = exist
|
||||
dbus.NotifyChange(tpad, "Exist")
|
||||
}
|
||||
}
|
@ -19,27 +19,27 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwacom
|
||||
package wacom
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
)
|
||||
|
||||
func (wacom *Wacom) handleGSettings() {
|
||||
wacom.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
func (w *Wacom) handleGSettings() {
|
||||
w.settings.Connect("changed", func(s *gio.Settings, key string) {
|
||||
switch key {
|
||||
case wacomKeyLeftHanded:
|
||||
wacom.rotationAngle(wacom.LeftHanded.Get())
|
||||
w.rotationAngle(w.LeftHanded.Get())
|
||||
case wacomKeyCursorMode:
|
||||
wacom.cursorMode(wacom.CursorMode.Get())
|
||||
w.cursorMode(w.CursorMode.Get())
|
||||
case wacomKeyUpAction:
|
||||
wacom.keyUpAction(wacom.KeyUpAction.Get())
|
||||
w.keyUpAction(w.KeyUpAction.Get())
|
||||
case wacomKeyDownAction:
|
||||
wacom.keyDownAction(wacom.KeyDownAction.Get())
|
||||
w.keyDownAction(w.KeyDownAction.Get())
|
||||
case wacomKeyDoubleDelta:
|
||||
wacom.doubleDelta(wacom.DoubleDelta.Get())
|
||||
w.doubleDelta(w.DoubleDelta.Get())
|
||||
case wacomKeyPressureSensitive:
|
||||
wacom.pressureSensitive(wacom.PressureSensitive.Get())
|
||||
w.pressureSensitive(w.PressureSensitive.Get())
|
||||
}
|
||||
})
|
||||
}
|
@ -19,36 +19,36 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libtouchpad
|
||||
package wacom
|
||||
|
||||
func (touchpad *Touchpad) printInfo(format string, v ...interface{}) {
|
||||
if touchpad.logger == nil {
|
||||
func (w *Wacom) printInfo(format string, v ...interface{}) {
|
||||
if w.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
touchpad.logger.Infof(format, v...)
|
||||
w.logger.Infof(format, v...)
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) debugInfo(format string, v ...interface{}) {
|
||||
if touchpad.logger == nil {
|
||||
func (w *Wacom) debugInfo(format string, v ...interface{}) {
|
||||
if w.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
touchpad.logger.Debugf(format, v...)
|
||||
w.logger.Debugf(format, v...)
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) warningInfo(format string, v ...interface{}) {
|
||||
if touchpad.logger == nil {
|
||||
func (w *Wacom) warningInfo(format string, v ...interface{}) {
|
||||
if w.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
touchpad.logger.Warningf(format, v...)
|
||||
w.logger.Warningf(format, v...)
|
||||
}
|
||||
|
||||
func (touchpad *Touchpad) errorInfo(format string, v ...interface{}) {
|
||||
if touchpad.logger == nil {
|
||||
func (w *Wacom) errorInfo(format string, v ...interface{}) {
|
||||
if w.logger == nil {
|
||||
return
|
||||
}
|
||||
|
||||
touchpad.logger.Errorf(format, v...)
|
||||
w.logger.Errorf(format, v...)
|
||||
}
|
@ -19,10 +19,10 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwacom
|
||||
package wacom
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus/property"
|
||||
. "pkg.linuxdeepin.com/lib/gettext"
|
||||
"pkg.linuxdeepin.com/lib/gio-2.0"
|
||||
@ -61,7 +61,7 @@ type Wacom struct {
|
||||
DoubleDelta *property.GSettingsUintProperty `access:"readwrite"`
|
||||
PressureSensitive *property.GSettingsUintProperty `access:"readwrite"`
|
||||
|
||||
DeviceList []libwrapper.XIDeviceInfo
|
||||
DeviceList []wrapper.XIDeviceInfo
|
||||
ActionInfos []KeyActionInfo
|
||||
Exist bool
|
||||
|
||||
@ -69,60 +69,60 @@ type Wacom struct {
|
||||
settings *gio.Settings
|
||||
}
|
||||
|
||||
func (wacom *Wacom) Reset() {
|
||||
keys := wacom.settings.ListKeys()
|
||||
func (w *Wacom) Reset() {
|
||||
keys := w.settings.ListKeys()
|
||||
for _, key := range keys {
|
||||
wacom.settings.Reset(key)
|
||||
w.settings.Reset(key)
|
||||
}
|
||||
}
|
||||
|
||||
var _wacom *Wacom
|
||||
|
||||
func NewWacom(l *log.Logger) *Wacom {
|
||||
wacom := &Wacom{}
|
||||
w := &Wacom{}
|
||||
|
||||
wacom.settings = gio.NewSettings("com.deepin.dde.wacom")
|
||||
w.settings = gio.NewSettings("com.deepin.dde.wacom")
|
||||
|
||||
wacom.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
wacom, "LeftHanded",
|
||||
wacom.settings, wacomKeyLeftHanded)
|
||||
wacom.CursorMode = property.NewGSettingsBoolProperty(
|
||||
wacom, "CursorMode",
|
||||
wacom.settings, wacomKeyCursorMode)
|
||||
w.LeftHanded = property.NewGSettingsBoolProperty(
|
||||
w, "LeftHanded",
|
||||
w.settings, wacomKeyLeftHanded)
|
||||
w.CursorMode = property.NewGSettingsBoolProperty(
|
||||
w, "CursorMode",
|
||||
w.settings, wacomKeyCursorMode)
|
||||
|
||||
wacom.KeyUpAction = property.NewGSettingsStringProperty(
|
||||
wacom, "KeyUpAction",
|
||||
wacom.settings, wacomKeyUpAction)
|
||||
wacom.KeyDownAction = property.NewGSettingsStringProperty(
|
||||
wacom, "KeyDownAction",
|
||||
wacom.settings, wacomKeyDownAction)
|
||||
w.KeyUpAction = property.NewGSettingsStringProperty(
|
||||
w, "KeyUpAction",
|
||||
w.settings, wacomKeyUpAction)
|
||||
w.KeyDownAction = property.NewGSettingsStringProperty(
|
||||
w, "KeyDownAction",
|
||||
w.settings, wacomKeyDownAction)
|
||||
|
||||
wacom.DoubleDelta = property.NewGSettingsUintProperty(
|
||||
wacom, "DoubleDelta",
|
||||
wacom.settings, wacomKeyDoubleDelta)
|
||||
wacom.PressureSensitive = property.NewGSettingsUintProperty(
|
||||
wacom, "PressureSensitive",
|
||||
wacom.settings, wacomKeyPressureSensitive)
|
||||
w.DoubleDelta = property.NewGSettingsUintProperty(
|
||||
w, "DoubleDelta",
|
||||
w.settings, wacomKeyDoubleDelta)
|
||||
w.PressureSensitive = property.NewGSettingsUintProperty(
|
||||
w, "PressureSensitive",
|
||||
w.settings, wacomKeyPressureSensitive)
|
||||
|
||||
_, _, wacomList := libwrapper.GetDevicesList()
|
||||
wacom.setPropDeviceList(wacomList)
|
||||
if len(wacom.DeviceList) > 0 {
|
||||
wacom.setPropExist(true)
|
||||
_, _, wacomList := wrapper.GetDevicesList()
|
||||
w.setPropDeviceList(wacomList)
|
||||
if len(w.DeviceList) > 0 {
|
||||
w.setPropExist(true)
|
||||
} else {
|
||||
wacom.setPropExist(false)
|
||||
w.setPropExist(false)
|
||||
}
|
||||
|
||||
wacom.logger = l
|
||||
wacom.ActionInfos = generateActionInfos()
|
||||
w.logger = l
|
||||
w.ActionInfos = generateActionInfos()
|
||||
|
||||
_wacom = wacom
|
||||
wacom.init()
|
||||
wacom.handleGSettings()
|
||||
_wacom = w
|
||||
w.init()
|
||||
w.handleGSettings()
|
||||
|
||||
return wacom
|
||||
return w
|
||||
}
|
||||
|
||||
func HandleDeviceChanged(devList []libwrapper.XIDeviceInfo) {
|
||||
func HandleDeviceChanged(devList []wrapper.XIDeviceInfo) {
|
||||
if _wacom == nil {
|
||||
return
|
||||
}
|
||||
@ -170,17 +170,17 @@ func generateActionInfos() []KeyActionInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (wacom *Wacom) init() {
|
||||
if !wacom.Exist {
|
||||
func (w *Wacom) init() {
|
||||
if !w.Exist {
|
||||
return
|
||||
}
|
||||
|
||||
wacom.rotationAngle(wacom.LeftHanded.Get())
|
||||
wacom.cursorMode(wacom.CursorMode.Get())
|
||||
w.rotationAngle(w.LeftHanded.Get())
|
||||
w.cursorMode(w.CursorMode.Get())
|
||||
|
||||
wacom.keyUpAction(wacom.KeyUpAction.Get())
|
||||
wacom.keyDownAction(wacom.KeyDownAction.Get())
|
||||
w.keyUpAction(w.KeyUpAction.Get())
|
||||
w.keyDownAction(w.KeyDownAction.Get())
|
||||
|
||||
wacom.pressureSensitive(wacom.PressureSensitive.Get())
|
||||
wacom.doubleDelta(wacom.DoubleDelta.Get())
|
||||
w.pressureSensitive(w.PressureSensitive.Get())
|
||||
w.doubleDelta(w.DoubleDelta.Get())
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwacom
|
||||
package wacom
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -30,8 +30,8 @@ import (
|
||||
* xsetwacom set deviceName Rotate half/none
|
||||
* default: none
|
||||
*/
|
||||
func (wacom *Wacom) rotationAngle(leftHanded bool) {
|
||||
for _, info := range wacom.DeviceList {
|
||||
func (w *Wacom) rotationAngle(leftHanded bool) {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := "xsetwacom set \"" + info.Name + "\" Rotate "
|
||||
if leftHanded {
|
||||
cmdline += "half"
|
||||
@ -41,7 +41,7 @@ func (wacom *Wacom) rotationAngle(leftHanded bool) {
|
||||
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -51,8 +51,8 @@ func (wacom *Wacom) rotationAngle(leftHanded bool) {
|
||||
* default: Absolute for stylus, eraser and tablet PC touch;
|
||||
* Relative for cursor and tablet touch.
|
||||
*/
|
||||
func (wacom *Wacom) cursorMode(cursorMode bool) {
|
||||
for _, info := range wacom.DeviceList {
|
||||
func (w *Wacom) cursorMode(cursorMode bool) {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := "xsetwacom set \"" + info.Name + "\" mode "
|
||||
if cursorMode {
|
||||
cmdline += "Relative"
|
||||
@ -62,7 +62,7 @@ func (wacom *Wacom) cursorMode(cursorMode bool) {
|
||||
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,17 +71,17 @@ func (wacom *Wacom) cursorMode(cursorMode bool) {
|
||||
* xsetwacom set deviceName Button 3 3/"KP_Page_Up"
|
||||
* default: 3
|
||||
*/
|
||||
func (wacom *Wacom) keyUpAction(action string) {
|
||||
func (w *Wacom) keyUpAction(action string) {
|
||||
value, ok := descActionMap[action]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
for _, info := range wacom.DeviceList {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := "xsetwacom set \"" + info.Name + "\" Button 3 " + value
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,17 +90,17 @@ func (wacom *Wacom) keyUpAction(action string) {
|
||||
* xsetwacom set deviceName Button 2 2/"KP_Page_Down"
|
||||
* default: 2
|
||||
*/
|
||||
func (wacom *Wacom) keyDownAction(action string) {
|
||||
func (w *Wacom) keyDownAction(action string) {
|
||||
value, ok := descActionMap[action]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
for _, info := range wacom.DeviceList {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := "xsetwacom set \"" + info.Name + "\" Button 2 " + value
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -109,12 +109,12 @@ func (wacom *Wacom) keyDownAction(action string) {
|
||||
* xsetwacom set deviceName Suppress 0-100
|
||||
* default: 2
|
||||
*/
|
||||
func (wacom *Wacom) doubleDelta(delta uint32) {
|
||||
for _, info := range wacom.DeviceList {
|
||||
func (w *Wacom) doubleDelta(delta uint32) {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := fmt.Sprintf("xsetwacom set \"%s\" Suppress %v", info.Name, delta)
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -123,16 +123,16 @@ func (wacom *Wacom) doubleDelta(delta uint32) {
|
||||
* xsetwacom set deviceName Threshold 0-2047
|
||||
* default: 27
|
||||
*/
|
||||
func (wacom *Wacom) pressureSensitive(pressure uint32) {
|
||||
func (w *Wacom) pressureSensitive(pressure uint32) {
|
||||
if pressure > 2047 {
|
||||
return
|
||||
}
|
||||
|
||||
for _, info := range wacom.DeviceList {
|
||||
for _, info := range w.DeviceList {
|
||||
cmdline := fmt.Sprintf("xsetwacom set \"%s\" Threshold %v", info.Name, pressure)
|
||||
err := doCommand(cmdline)
|
||||
if err != nil {
|
||||
wacom.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
w.debugInfo("Exec '%s' failed: %v", cmdline, err)
|
||||
}
|
||||
}
|
||||
}
|
@ -19,10 +19,10 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwacom
|
||||
package wacom
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
)
|
||||
|
||||
@ -32,7 +32,7 @@ const (
|
||||
DBUS_IFC_WACOM = "com.deepin.daemon.InputDevice.Wacom"
|
||||
)
|
||||
|
||||
func (wacom *Wacom) GetDBusInfo() dbus.DBusInfo {
|
||||
func (w *Wacom) GetDBusInfo() dbus.DBusInfo {
|
||||
return dbus.DBusInfo{
|
||||
Dest: DBUS_SENDER,
|
||||
ObjectPath: DBUS_PATH_WACOM,
|
||||
@ -40,16 +40,16 @@ func (wacom *Wacom) GetDBusInfo() dbus.DBusInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (wacom *Wacom) setPropDeviceList(list []libwrapper.XIDeviceInfo) {
|
||||
if len(wacom.DeviceList) != len(list) {
|
||||
wacom.DeviceList = list
|
||||
dbus.NotifyChange(wacom, "DeviceList")
|
||||
func (w *Wacom) setPropDeviceList(list []wrapper.XIDeviceInfo) {
|
||||
if len(w.DeviceList) != len(list) {
|
||||
w.DeviceList = list
|
||||
dbus.NotifyChange(w, "DeviceList")
|
||||
}
|
||||
}
|
||||
|
||||
func (wacom *Wacom) setPropExist(exist bool) {
|
||||
if wacom.Exist != exist {
|
||||
wacom.Exist = exist
|
||||
dbus.NotifyChange(wacom, "Exist")
|
||||
func (w *Wacom) setPropExist(exist bool) {
|
||||
if w.Exist != exist {
|
||||
w.Exist = exist
|
||||
dbus.NotifyChange(w, "Exist")
|
||||
}
|
||||
}
|
@ -28,10 +28,10 @@ package inputdevices
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libmouse"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libtouchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwacom"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/libwrapper"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/mouse"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/touchpad"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wacom"
|
||||
"pkg.linuxdeepin.com/dde-daemon/inputdevices/wrapper"
|
||||
)
|
||||
|
||||
func initDeviceChangedWatcher() bool {
|
||||
@ -49,18 +49,18 @@ func endDeviceListenThread() {
|
||||
|
||||
//export handleDeviceAdded
|
||||
func handleDeviceAdded(deviceid C.int) {
|
||||
mouseList, tpadList, wacomList := libwrapper.GetDevicesList()
|
||||
mouseList, tpadList, wacomList := wrapper.GetDevicesList()
|
||||
|
||||
libtouchpad.HandleDeviceChanged(tpadList)
|
||||
libmouse.HandleDeviceChanged(mouseList)
|
||||
libwacom.HandleDeviceChanged(wacomList)
|
||||
touchpad.HandleDeviceChanged(tpadList)
|
||||
mouse.HandleDeviceChanged(mouseList)
|
||||
wacom.HandleDeviceChanged(wacomList)
|
||||
}
|
||||
|
||||
//export handleDeviceRemoved
|
||||
func handleDeviceRemoved(deviceid C.int) {
|
||||
mouseList, tpadList, wacomList := libwrapper.GetDevicesList()
|
||||
mouseList, tpadList, wacomList := wrapper.GetDevicesList()
|
||||
|
||||
libtouchpad.HandleDeviceChanged(tpadList)
|
||||
libmouse.HandleDeviceChanged(mouseList)
|
||||
libwacom.HandleDeviceChanged(wacomList)
|
||||
touchpad.HandleDeviceChanged(tpadList)
|
||||
mouse.HandleDeviceChanged(mouseList)
|
||||
wacom.HandleDeviceChanged(wacomList)
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ typedef struct _DeviceInfo {
|
||||
char *name;
|
||||
int deviceid;
|
||||
int enabled;
|
||||
int is_touchscreen;
|
||||
} DeviceInfo;
|
||||
|
||||
DeviceInfo *get_device_info_list(int *n_devices);
|
@ -29,6 +29,49 @@
|
||||
#include "utils.h"
|
||||
#include "devices.h"
|
||||
|
||||
#define AXIS_MODE_REL 1 //relative
|
||||
#define AXIS_MODE_ABS 2 //absolte --> touchscreen
|
||||
|
||||
#define TOUCH_MODE_DEPENDENT 1 //touchpad
|
||||
#define TOUCH_MODE_DIRECT 2 // touchscreen
|
||||
|
||||
static int is_touchscreen_device(const XIDeviceInfo* info);
|
||||
|
||||
static int
|
||||
is_touchscreen_device(const XIDeviceInfo* info)
|
||||
{
|
||||
if (info->num_classes <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (; i < info->num_classes; i++) {
|
||||
XIAnyClassInfo* any = info->classes[i];
|
||||
switch (any->type) {
|
||||
case XIValuatorClass: {
|
||||
XIValuatorClassInfo *v = (XIValuatorClassInfo*)any;
|
||||
if (v->mode == XIModeAbsolute) {
|
||||
//dev is touchscreen
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
case XITouchClass: {
|
||||
XITouchClassInfo* t = (XITouchClassInfo*)any;
|
||||
if (t->mode == XIDirectTouch) {
|
||||
//dev is touchscreen
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
DeviceInfo*
|
||||
get_device_info_list(int *n_devices)
|
||||
{
|
||||
@ -79,6 +122,7 @@ get_device_info_list(int *n_devices)
|
||||
/*tmp[j].name = infos[i].name;*/
|
||||
tmp[j].deviceid = infos[i].deviceid;
|
||||
tmp[j].enabled = (int)infos[i].enabled;
|
||||
tmp[j].is_touchscreen = is_touchscreen_device(&infos[i]);
|
||||
|
||||
if (j != 0) {
|
||||
free(list);
|
@ -19,7 +19,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
package libwrapper
|
||||
package wrapper
|
||||
|
||||
// #cgo pkg-config: x11 xi
|
||||
// #cgo CFLAGS: -Wall -g
|
||||
@ -55,7 +55,11 @@ func GetDevicesList() ([]XIDeviceInfo, []XIDeviceInfo, []XIDeviceInfo) {
|
||||
length := unsafe.Sizeof(*devices)
|
||||
for i := C.int(0); i < n_devices; i++ {
|
||||
devInfo := (*C.DeviceInfo)(unsafe.Pointer(tmpList + uintptr(i)*length))
|
||||
if C.is_mouse_device(devInfo.deviceid) == 1 {
|
||||
switch {
|
||||
// Touch screen
|
||||
case (devInfo.is_touchscreen == 1):
|
||||
continue
|
||||
case (C.is_mouse_device(devInfo.deviceid) == 1):
|
||||
info := XIDeviceInfo{
|
||||
C.GoString(devInfo.name),
|
||||
int32(devInfo.deviceid),
|
||||
@ -67,7 +71,7 @@ func GetDevicesList() ([]XIDeviceInfo, []XIDeviceInfo, []XIDeviceInfo) {
|
||||
}
|
||||
|
||||
mouseList = append(mouseList, info)
|
||||
} else if C.is_tpad_device(devInfo.deviceid) == 1 {
|
||||
case (C.is_tpad_device(devInfo.deviceid) == 1):
|
||||
info := XIDeviceInfo{
|
||||
C.GoString(devInfo.name),
|
||||
int32(devInfo.deviceid),
|
||||
@ -79,7 +83,7 @@ func GetDevicesList() ([]XIDeviceInfo, []XIDeviceInfo, []XIDeviceInfo) {
|
||||
}
|
||||
|
||||
tpadList = append(tpadList, info)
|
||||
} else if C.is_wacom_device(devInfo.deviceid) == 1 {
|
||||
case (C.is_wacom_device(devInfo.deviceid) == 1):
|
||||
info := XIDeviceInfo{
|
||||
C.GoString(devInfo.name),
|
||||
int32(devInfo.deviceid),
|
@ -187,15 +187,9 @@ func doAction(action string) {
|
||||
return
|
||||
}
|
||||
|
||||
strs := strings.Split(action, " ")
|
||||
cmd := strs[0]
|
||||
args := []string{}
|
||||
|
||||
if len(strs) > 1 {
|
||||
args = append(args, strs[1:]...)
|
||||
}
|
||||
if err := exec.Command(cmd, args...).Run(); err != nil {
|
||||
logger.Errorf("Exec '%s' failed: %v", action, err)
|
||||
err := exec.Command("/bin/sh", "-c", action).Run()
|
||||
if err != nil {
|
||||
logger.Debugf("Exec '%s' failed: %v", action, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ package keybinding
|
||||
import (
|
||||
"dbus/com/deepin/daemon/inputdevices"
|
||||
"github.com/BurntSushi/xgbutil/keybind"
|
||||
dutils "pkg.linuxdeepin.com/lib/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@ -566,6 +567,8 @@ func isKeySupported(key string) bool {
|
||||
switch key {
|
||||
case "disable-touchpad":
|
||||
return isTouchpadExist()
|
||||
case "deepin-translator":
|
||||
return dutils.IsFileExist("/usr/bin/deepin-translator")
|
||||
}
|
||||
|
||||
return true
|
||||
|
@ -45,6 +45,7 @@ type Launcher struct {
|
||||
cancelSearchingChan chan struct{}
|
||||
pinyinObj PinYinInterface
|
||||
store *storeApi.DStoreDesktop
|
||||
appMonitor *fsnotify.Watcher
|
||||
|
||||
ItemChanged func(
|
||||
status string,
|
||||
@ -285,6 +286,7 @@ func (self *Launcher) itemChangedHandler(ev *fsnotify.FileEvent, name string, in
|
||||
}()
|
||||
info[name].renamed <- true
|
||||
} else if ev.IsCreate() {
|
||||
self.emitItemChanged(name, SoftwareStatusCreated, info)
|
||||
go func() {
|
||||
select {
|
||||
case <-info[name].renamed:
|
||||
@ -385,7 +387,8 @@ func (self *Launcher) listenItemChanged() {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// FIXME: close watcher.
|
||||
|
||||
self.appMonitor = watcher
|
||||
for _, dir := range dirs {
|
||||
logger.Info("monitor:", dir)
|
||||
watcher.Watch(dir)
|
||||
@ -513,5 +516,9 @@ func (self *Launcher) destroy() {
|
||||
storeApi.DestroyDStoreDesktop(self.store)
|
||||
self.store = nil
|
||||
}
|
||||
if self.appMonitor != nil {
|
||||
self.appMonitor.Close()
|
||||
self.appMonitor = nil
|
||||
}
|
||||
dbus.UnInstallObject(self)
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 04:47+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Afrikaans (South Africa) (http://www.transifex.com/projects/p/dde-daemon/language/af_ZA/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
1626
misc/po/ar.po
Normal file
1626
misc/po/ar.po
Normal file
File diff suppressed because it is too large
Load Diff
1624
misc/po/bg.po
Normal file
1624
misc/po/bg.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: fri\n"
|
||||
"Language-Team: Czech (http://www.transifex.com/projects/p/dde-daemon/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 18:34+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Danish (http://www.transifex.com/projects/p/dde-daemon/language/da/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -13,7 +13,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-28 11:02+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: German (http://www.transifex.com/projects/p/dde-daemon/language/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-04-05 14:34+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Greek (http://www.transifex.com/projects/p/dde-daemon/language/el/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 04:47+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: English (Australia) (http://www.transifex.com/projects/p/dde-daemon/language/en_AU/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -12,7 +12,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/projects/p/dde-daemon/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 04:47+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Spanish (Latin America) (http://www.transifex.com/projects/p/dde-daemon/language/es_419/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -11,7 +11,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Mariano Agüero <nero1000000@gmail.com>\n"
|
||||
"Language-Team: Spanish (Argentina) (http://www.transifex.com/projects/p/dde-daemon/language/es_AR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -11,7 +11,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-27 10:52+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: French (http://www.transifex.com/projects/p/dde-daemon/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -3,14 +3,14 @@
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Translators:
|
||||
# Yuval Bar-On <hyuvii@gmail.com>, 2014
|
||||
# Yuval Bar-On <hyuvii@gmail.com>, 2014-2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2015-01-07 15:31+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Yuval Bar-On <hyuvii@gmail.com>\n"
|
||||
"Language-Team: Hebrew (http://www.transifex.com/projects/p/dde-daemon/language/he/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -20,11 +20,11 @@ msgstr ""
|
||||
|
||||
#: ../../accounts/username_checker/username.go:65
|
||||
msgid "Username can not be empty."
|
||||
msgstr ""
|
||||
msgstr "שם משתמש לא יכול להיות ריק"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:66
|
||||
msgid "Username must comprise a~z, 0~9, - or _."
|
||||
msgstr ""
|
||||
msgstr "שם המשתמש חייב להיות מורכב מאותיות לטיניות a~z, מספרים 0~9, מקף - או קו תחתון _"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:67
|
||||
msgid "The first character must be in lower case."
|
||||
@ -220,7 +220,7 @@ msgstr "Cape Verde"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:148
|
||||
msgid "London"
|
||||
msgstr ""
|
||||
msgstr "London"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:152
|
||||
msgid "Dublin"
|
||||
@ -433,23 +433,23 @@ msgstr "אוטומטי"
|
||||
|
||||
#: ../../inputdevices/libwacom/wacom.go:152
|
||||
msgid "Left Click"
|
||||
msgstr ""
|
||||
msgstr "לחצן שמאלי"
|
||||
|
||||
#: ../../inputdevices/libwacom/wacom.go:156
|
||||
msgid "Middle Click"
|
||||
msgstr ""
|
||||
msgstr "לחצן אמצעי"
|
||||
|
||||
#: ../../inputdevices/libwacom/wacom.go:160
|
||||
msgid "Right Click"
|
||||
msgstr ""
|
||||
msgstr "לחצן ימני"
|
||||
|
||||
#: ../../inputdevices/libwacom/wacom.go:164
|
||||
msgid "Page Up"
|
||||
msgstr ""
|
||||
msgstr "עמוד למעלה"
|
||||
|
||||
#: ../../inputdevices/libwacom/wacom.go:168
|
||||
msgid "Page Down"
|
||||
msgstr ""
|
||||
msgstr "עמוד למטה"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:47
|
||||
msgid "Launcher"
|
||||
@ -677,22 +677,22 @@ msgstr "עבור לסביבת עבודה אשר למטה"
|
||||
|
||||
#: ../../langselector/handle_event.go:36
|
||||
msgid "System language failed to change, please try later."
|
||||
msgstr ""
|
||||
msgstr "שינוי שפת המערכת נכשל, אנא נסה שנית מאוחר יותר"
|
||||
|
||||
#: ../../langselector/handle_event.go:42
|
||||
msgid ""
|
||||
"System language has been changed, please log in again after logged out."
|
||||
msgstr ""
|
||||
msgstr "שפת המערכת שונתה בהצלחה, אנא התנתק והתחבר שוב על מנת להחיל שינויים"
|
||||
|
||||
#: ../../langselector/locale_ifc.go:55
|
||||
msgid "System language is being changed, please wait..."
|
||||
msgstr ""
|
||||
msgstr "משנה את שפת המערכת, אנא המתן..."
|
||||
|
||||
#: ../../langselector/locale_ifc.go:60
|
||||
msgid ""
|
||||
"System language is being changed with an installation of lacked language "
|
||||
"packages, please wait..."
|
||||
msgstr ""
|
||||
msgstr "משנה את שפת המערכת ומתקין חבילות שפה משלימות, אנא המתן..."
|
||||
|
||||
#: ../../mime/default_media.go:73 ../../mime/default_media.go:90
|
||||
msgid "Nothing"
|
||||
|
@ -3,6 +3,7 @@
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Translators:
|
||||
# Adam Klarić <dabomedasamja@gmail.com>, 2015
|
||||
# Ivica Kolić <ikoli@yahoo.com>, 2014
|
||||
# gogo <trebelnik2@gmail.com>, 2014
|
||||
msgid ""
|
||||
@ -10,8 +11,8 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Adam Klarić <dabomedasamja@gmail.com>\n"
|
||||
"Language-Team: Croatian (http://www.transifex.com/projects/p/dde-daemon/language/hr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -25,7 +26,7 @@ msgstr "Korisničko ime ne može biti prazno."
|
||||
|
||||
#: ../../accounts/username_checker/username.go:66
|
||||
msgid "Username must comprise a~z, 0~9, - or _."
|
||||
msgstr ""
|
||||
msgstr "Korisničko ime mora sadržavati a~z, 0~9, - ili _."
|
||||
|
||||
#: ../../accounts/username_checker/username.go:67
|
||||
msgid "The first character must be in lower case."
|
||||
@ -693,7 +694,7 @@ msgstr "Jezik sustava se promjenio, molim pričekajte..."
|
||||
msgid ""
|
||||
"System language is being changed with an installation of lacked language "
|
||||
"packages, please wait..."
|
||||
msgstr ""
|
||||
msgstr "Jezik sustava se mijenja instalacijom nedostajućih jezičnih paketa, molim pričekajte..."
|
||||
|
||||
#: ../../mime/default_media.go:73 ../../mime/default_media.go:90
|
||||
msgid "Nothing"
|
||||
@ -812,7 +813,7 @@ msgstr "Bežično ad-hoc"
|
||||
|
||||
#: ../../network/nm_custom_type.go:184
|
||||
msgid "Wireless Ap-Hotspot"
|
||||
msgstr ""
|
||||
msgstr "Bežični Ap-Hotspot"
|
||||
|
||||
#: ../../network/nm_custom_type.go:186
|
||||
msgid "PPPoE Connection"
|
||||
@ -1565,7 +1566,7 @@ msgstr "Nepoznato"
|
||||
|
||||
#: ../../network/utils_notify.go:78
|
||||
msgid "Airplan mode enabled."
|
||||
msgstr ""
|
||||
msgstr "Zrakoplovni način rada uključen."
|
||||
|
||||
#: ../../network/utils_notify.go:82
|
||||
msgid "You are now offline."
|
||||
|
@ -11,7 +11,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Hungarian (http://www.transifex.com/projects/p/dde-daemon/language/hu/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -13,7 +13,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Indonesian (http://www.transifex.com/projects/p/dde-daemon/language/id/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Massimo Antonio Carofano <real.massimo@hotmail.it>\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/projects/p/dde-daemon/language/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -3,8 +3,8 @@
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Translators:
|
||||
# Alain Baudrez <a.baudrez@gmail.com>, 2014
|
||||
# Heimen Stoffels <motionshot@vivaldi.net>, 2014
|
||||
# Alain Baudrez <inactive+Wamukota@transifex.com>, 2014
|
||||
# Heimen Stoffels <vistausss@outlook.com>, 2014
|
||||
# closeddoors1559 <mrvnp@msn.com>, 2014
|
||||
# Stefan van den Brink <stefan.vandenbrink@gmail.com>, 2014
|
||||
msgid ""
|
||||
@ -12,7 +12,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Stefan van den Brink <stefan.vandenbrink@gmail.com>\n"
|
||||
"Language-Team: Dutch (http://www.transifex.com/projects/p/dde-daemon/language/nl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2015-01-05 15:11+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Piotr Strębski <strebski@o2.pl>\n"
|
||||
"Language-Team: Polish (http://www.transifex.com/projects/p/dde-daemon/language/pl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Ricardo Simões <xmcorporation@gmail.com>\n"
|
||||
"Language-Team: Portuguese (http://www.transifex.com/projects/p/dde-daemon/language/pt/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -6,7 +6,7 @@
|
||||
# JeffWagen <jeff.wagen@yahoo.com>, 2014
|
||||
# Kayo Martins <kayomfreire@gmail.com>, 2014
|
||||
# Marlon Janke <marlonjke@gmail.com>, 2014
|
||||
# RAFAEL GAUNA <rafaelgt.mbin@gmail.com>, 2014
|
||||
# RAFAEL GAUNA <rafaelgt.mbin@gmail.com>, 2014-2015
|
||||
# Rubens de Almeida Medeiros <rubens.cejovem@gmail.com>, 2014
|
||||
# viniciusarl <vinniciusal@outlook.com>, 2014
|
||||
msgid ""
|
||||
@ -14,8 +14,8 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: RAFAEL GAUNA <rafaelgt.mbin@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/dde-daemon/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -610,7 +610,7 @@ msgstr "Redimensionar janela"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:99
|
||||
msgid "Switch furl state"
|
||||
msgstr "Alternar estado de furl"
|
||||
msgstr "Alternar estado completo"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:100
|
||||
msgid "Activate window menu"
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Romanian (http://www.transifex.com/projects/p/dde-daemon/language/ro/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
298
misc/po/ru.po
298
misc/po/ru.po
@ -5,15 +5,15 @@
|
||||
# Translators:
|
||||
# Анатолий Валерианович <ffox909@mail.ru>, 2014
|
||||
# jvjey <justVolodya@gmail.com>, 2014
|
||||
# Serge Kukharski, 2014
|
||||
# Serge Kukharski, 2014-2015
|
||||
# Анатолий Валерианович <ffox909@mail.ru>, 2014
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"Last-Translator: Анатолий Валерианович <ffox909@mail.ru>\n"
|
||||
"PO-Revision-Date: 2015-03-26 07:40+0000\n"
|
||||
"Last-Translator: Serge Kukharski\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/projects/p/dde-daemon/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -23,23 +23,23 @@ msgstr ""
|
||||
|
||||
#: ../../accounts/username_checker/username.go:65
|
||||
msgid "Username can not be empty."
|
||||
msgstr "Имя пользователя не может быть пустым."
|
||||
msgstr "Имя пользователя не может быть пустым!"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:66
|
||||
msgid "Username must comprise a~z, 0~9, - or _."
|
||||
msgstr "Имя пользователя должно содержать a~z, 0~9, - или _."
|
||||
msgstr "Имя пользователя должно содержать только буквы латиницы в нижнем регистре, цифры, дефис или нижнее подчеркивание!"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:67
|
||||
msgid "The first character must be in lower case."
|
||||
msgstr "Первый символ должен быть в нижнем регистре."
|
||||
msgstr "Первый символ должен быть в нижнем регистре!"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:68
|
||||
msgid "The username exists."
|
||||
msgstr "Имя пользователя существует."
|
||||
msgstr "Имя пользователя уже существует!"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:69
|
||||
msgid "The username has been used by system."
|
||||
msgstr "Это имя пользователя используется системой."
|
||||
msgstr "Это имя пользователя используется системой!"
|
||||
|
||||
#: ../../bluetooth/bluez_profile.go:31
|
||||
msgid "Serial port"
|
||||
@ -51,7 +51,7 @@ msgstr "Коммутируемые сети"
|
||||
|
||||
#: ../../bluetooth/bluez_profile.go:33
|
||||
msgid "Hands-Free device"
|
||||
msgstr "Hands-Free устройство"
|
||||
msgstr "Устройство громкой связи"
|
||||
|
||||
#: ../../bluetooth/bluez_profile.go:34
|
||||
msgid "Hands-Free voice gateway"
|
||||
@ -59,7 +59,7 @@ msgstr "Hands-Free голосовой шлюз"
|
||||
|
||||
#: ../../bluetooth/bluez_profile.go:35
|
||||
msgid "Headset voice gateway"
|
||||
msgstr "Headset голосовой шлюз"
|
||||
msgstr "Голосовой шлюз наушников"
|
||||
|
||||
#: ../../bluetooth/bluez_profile.go:36
|
||||
msgid "Object push"
|
||||
@ -91,147 +91,147 @@ msgstr "Уведомления о сообщении"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:16
|
||||
msgid "Niue"
|
||||
msgstr "Niue"
|
||||
msgstr "Ниуэ"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:20
|
||||
msgid "Hawaii"
|
||||
msgstr "Hawaii"
|
||||
msgstr "Гавайи"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:24
|
||||
msgid "Tahiti"
|
||||
msgstr "Tahiti"
|
||||
msgstr "Таити"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:28
|
||||
msgid "Honolulu"
|
||||
msgstr "Honolulu"
|
||||
msgstr "Гонолулу"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:32
|
||||
msgid "Marquesas"
|
||||
msgstr "Marquesas"
|
||||
msgstr "Маркизские острова"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:36
|
||||
msgid "Alaska"
|
||||
msgstr "Alaska"
|
||||
msgstr "Аляска"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:40
|
||||
msgid "Juneau"
|
||||
msgstr "Juneau"
|
||||
msgstr "Джуно"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:44
|
||||
msgid "Gambier"
|
||||
msgstr "Gambier"
|
||||
msgstr "Острова Гамбье"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:48
|
||||
msgid "BajaNorte"
|
||||
msgstr "BajaNorte"
|
||||
msgstr "Нижняя Калифорния"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:52
|
||||
msgid "Vancouver"
|
||||
msgstr "Vancouver"
|
||||
msgstr "Ванкувер"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:56
|
||||
msgid "Metlakatla"
|
||||
msgstr "Metlakatla"
|
||||
msgstr "Метлакатла"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:60
|
||||
msgid "Chihuahua"
|
||||
msgstr "Chihuahua"
|
||||
msgstr "Чиуауа"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:64
|
||||
msgid "Arizona"
|
||||
msgstr "Arizona"
|
||||
msgstr "Аризона"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:68
|
||||
msgid "BajaSur"
|
||||
msgstr "BajaSur"
|
||||
msgstr "Южная Баха"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:72
|
||||
msgid "Mexico City"
|
||||
msgstr "Mexico City"
|
||||
msgstr "Мехико"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:76
|
||||
msgid "Chicago"
|
||||
msgstr "Chicago"
|
||||
msgstr "Чикаго"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:80
|
||||
msgid "Managua"
|
||||
msgstr "Managua"
|
||||
msgstr "Манагуа"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:84
|
||||
msgid "Monterrey"
|
||||
msgstr "Monterrey"
|
||||
msgstr "Монтеррей"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:88
|
||||
msgid "New York"
|
||||
msgstr "New York"
|
||||
msgstr "Нью Йорк"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:92
|
||||
msgid "Lima"
|
||||
msgstr "Lima"
|
||||
msgstr "Лима"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:96
|
||||
msgid "Bogota"
|
||||
msgstr "Bogota"
|
||||
msgstr "Богота"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:100
|
||||
msgid "Caracas"
|
||||
msgstr "Caracas"
|
||||
msgstr "Каракас"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:104
|
||||
msgid "Cuiaba"
|
||||
msgstr "Cuiaba"
|
||||
msgstr "Куяба"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:108
|
||||
msgid "Santiago"
|
||||
msgstr "Santiago"
|
||||
msgstr "Сантьяго"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:112
|
||||
msgid "La Paz"
|
||||
msgstr "La Paz"
|
||||
msgstr "Ла-Пас"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:116
|
||||
msgid "Asuncion"
|
||||
msgstr "Asuncion"
|
||||
msgstr "Асунсьон"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:120
|
||||
msgid "Newfoundland"
|
||||
msgstr "Newfoundland"
|
||||
msgstr "Ньюфаундленд"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:124
|
||||
msgid "St Johns"
|
||||
msgstr "St Johns"
|
||||
msgstr "Сент-Джонс"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:128
|
||||
msgid "Buenos Aires"
|
||||
msgstr "Buenos Aires"
|
||||
msgstr "Буэнос-Айрес"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:132
|
||||
msgid "Cayenne"
|
||||
msgstr "Cayenne"
|
||||
msgstr "Кайенна"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:136
|
||||
msgid "DeNoronha"
|
||||
msgstr "DeNoronha"
|
||||
msgstr "Фернанду-ди-Норонья"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:140
|
||||
msgid "Azores"
|
||||
msgstr "Azores"
|
||||
msgstr "Азорские острова"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:144
|
||||
msgid "Cape Verde"
|
||||
msgstr "Cape Verde"
|
||||
msgstr "Капе Верде"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:148
|
||||
msgid "London"
|
||||
msgstr "London"
|
||||
msgstr "Лондон"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:152
|
||||
msgid "Dublin"
|
||||
msgstr "Dublin"
|
||||
msgstr "Дублин"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:156
|
||||
msgid "Casablanca"
|
||||
msgstr "Casablanca"
|
||||
msgstr "Касабланка"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:160
|
||||
msgid "Monrovia"
|
||||
@ -239,51 +239,51 @@ msgstr "Monrovia"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:164
|
||||
msgid "Madrid"
|
||||
msgstr "Madrid"
|
||||
msgstr "Мадрид"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:168
|
||||
msgid "Paris"
|
||||
msgstr "Paris"
|
||||
msgstr "Париж"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:172
|
||||
msgid "Rome"
|
||||
msgstr "Rome"
|
||||
msgstr "Рим"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:176
|
||||
msgid "Vienna"
|
||||
msgstr "Vienna"
|
||||
msgstr "Вена"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:180
|
||||
msgid "Algiers"
|
||||
msgstr "Algiers"
|
||||
msgstr "Алжир"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:184
|
||||
msgid "Cairo"
|
||||
msgstr "Cairo"
|
||||
msgstr "Каир"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:188
|
||||
msgid "Athens"
|
||||
msgstr "Athens"
|
||||
msgstr "Афины"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:192
|
||||
msgid "Istanbul"
|
||||
msgstr "Istanbul"
|
||||
msgstr "Стамбул"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:196
|
||||
msgid "Blantyre"
|
||||
msgstr "Blantyre"
|
||||
msgstr "Блантайр"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:200
|
||||
msgid "Nairobi"
|
||||
msgstr "Nairobi"
|
||||
msgstr "Найроби"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:204
|
||||
msgid "Tehran"
|
||||
msgstr "Tehran"
|
||||
msgstr "Тегеран"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:208
|
||||
msgid "Muscat"
|
||||
msgstr "Muscat"
|
||||
msgstr "Маскат"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:212
|
||||
msgid "Baku"
|
||||
@ -295,7 +295,7 @@ msgstr "Москва"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:220
|
||||
msgid "Kabul"
|
||||
msgstr "Kabul"
|
||||
msgstr "Кабул"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:224
|
||||
msgid "Karachi"
|
||||
@ -303,15 +303,15 @@ msgstr "Карачи"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:228
|
||||
msgid "Calcutta"
|
||||
msgstr "Calcutta"
|
||||
msgstr "Калькутта"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:232
|
||||
msgid "Kathmandu"
|
||||
msgstr "Kathmandu"
|
||||
msgstr "Катманду"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:236
|
||||
msgid "Dhaka"
|
||||
msgstr "Dhaka"
|
||||
msgstr "Дакка"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:240
|
||||
msgid "Yekaterinburg"
|
||||
@ -319,83 +319,83 @@ msgstr "Екатеринбург"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:244
|
||||
msgid "Rangoon"
|
||||
msgstr "Rangoon"
|
||||
msgstr "Янгон"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:248
|
||||
msgid "Bangkok"
|
||||
msgstr "Bangkok"
|
||||
msgstr "Бангкок"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:252
|
||||
msgid "Jakarta"
|
||||
msgstr "Jakarta"
|
||||
msgstr "Джакарта"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:256
|
||||
msgid "Beijing"
|
||||
msgstr "Beijing"
|
||||
msgstr "Пекин"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:260
|
||||
msgid "Hong Kong"
|
||||
msgstr "Hong Kong"
|
||||
msgstr "Гонконг"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:264
|
||||
msgid "Taipei"
|
||||
msgstr "Taipei"
|
||||
msgstr "Тайпей"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:268
|
||||
msgid "Kuala Lumpur"
|
||||
msgstr "Kuala Lumpur"
|
||||
msgstr "Куала-Лумпур"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:272
|
||||
msgid "Perth"
|
||||
msgstr "Perth"
|
||||
msgstr "Перт"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:276
|
||||
msgid "Eucla"
|
||||
msgstr "Eucla"
|
||||
msgstr "Евкла"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:280
|
||||
msgid "Tokyo"
|
||||
msgstr "Tokyo"
|
||||
msgstr "Токио"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:284
|
||||
msgid "Seoul"
|
||||
msgstr "Seoul"
|
||||
msgstr "Сеул"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:288
|
||||
msgid "Darwin"
|
||||
msgstr "Darwin"
|
||||
msgstr "Дарвин"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:292
|
||||
msgid "Sydney"
|
||||
msgstr "Sydney"
|
||||
msgstr "Сидней"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:296
|
||||
msgid "Guam"
|
||||
msgstr "Guam"
|
||||
msgstr "Гуам"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:300
|
||||
msgid "Melbourne"
|
||||
msgstr "Melbourne"
|
||||
msgstr "Мельбурн"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:304
|
||||
msgid "Hobart"
|
||||
msgstr "Hobart"
|
||||
msgstr "Хобарт"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:308
|
||||
msgid "Lord Howe"
|
||||
msgstr "Lord Howe"
|
||||
msgstr "Лорд-Хау"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:312
|
||||
msgid "Pohnpei"
|
||||
msgstr "Pohnpei"
|
||||
msgstr "Понпеи"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:316
|
||||
msgid "Norfolk"
|
||||
msgstr "Norfolk"
|
||||
msgstr "Норфолк"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:320
|
||||
msgid "Auckland"
|
||||
msgstr "Auckland"
|
||||
msgstr "Окленд"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:324
|
||||
msgid "Anadyr"
|
||||
@ -403,31 +403,31 @@ msgstr "Анадырь"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:328
|
||||
msgid "Chatham"
|
||||
msgstr "Chatham"
|
||||
msgstr "Чатэм"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:332
|
||||
msgid "Apia"
|
||||
msgstr "Apia"
|
||||
msgstr "Апиа"
|
||||
|
||||
#: ../../datetime/timezone/deepin_list.go:336
|
||||
msgid "Fakaofo"
|
||||
msgstr "Fakaofo"
|
||||
msgstr "Факаофо"
|
||||
|
||||
#: ../../dock/normal_apps.go:73
|
||||
msgid "_Run"
|
||||
msgstr "_Запуск"
|
||||
msgstr "Запуск"
|
||||
|
||||
#: ../../dock/normal_apps.go:105 ../../dock/runtime_apps.go:291
|
||||
msgid "_Undock"
|
||||
msgstr "_Разблокировать"
|
||||
msgstr "Убрать из дока"
|
||||
|
||||
#: ../../dock/runtime_apps.go:260
|
||||
msgid "_Close All"
|
||||
msgstr "_Закрыть всё"
|
||||
msgstr "Закрыть все"
|
||||
|
||||
#: ../../dock/runtime_apps.go:303
|
||||
msgid "_Dock"
|
||||
msgstr "_Док"
|
||||
msgstr "Закрепить в доке"
|
||||
|
||||
#: ../../grub2/grub2_ifc.go:75 ../../network/nm_setting_ip4_config.go:174
|
||||
#: ../../network/nm_setting_ip6_config.go:64
|
||||
@ -456,67 +456,67 @@ msgstr "Страницу вниз"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:47
|
||||
msgid "Launcher"
|
||||
msgstr "Лаунчер"
|
||||
msgstr "Показать лаунчер"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:48
|
||||
msgid "Show desktop"
|
||||
msgstr "Показать на рабочем столе"
|
||||
msgstr "Показать рабочий стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:49
|
||||
msgid "Lock screen"
|
||||
msgstr "Экран блокировки"
|
||||
msgstr "Заблокировать сеанс"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:50
|
||||
msgid "File manager"
|
||||
msgstr "Файловый менеджер"
|
||||
msgstr "Запустить менеджер файлов"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:51
|
||||
msgid "Switch applications"
|
||||
msgstr "Переключить приложения"
|
||||
msgstr "Перекл. между приложениями"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:52
|
||||
msgid "Reverse switch applications"
|
||||
msgstr "Реверс переключения приложений"
|
||||
msgstr "Обратное перекл. между приложениями"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:53
|
||||
msgid "3D switch applications"
|
||||
msgstr "3D переключение приложений"
|
||||
msgstr "3D перекл. между приложениями"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:54
|
||||
msgid "3D reverse switch applications"
|
||||
msgstr "Реверс 3D переключения приложений"
|
||||
msgstr "Обратное 3D перекл. между приложениями"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:55
|
||||
msgid "Show/Hide the dock"
|
||||
msgstr "Показать/Скрыть док"
|
||||
msgstr "Показать/скрыть док"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:56
|
||||
msgid "Screenshot"
|
||||
msgstr "Снимок экрана"
|
||||
msgstr "Сделать скриншот"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:57
|
||||
msgid "Full screenshot"
|
||||
msgstr "Полный скриншот"
|
||||
msgstr "Сделать полный скриншот"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:58
|
||||
msgid "Window screenshot"
|
||||
msgstr "Скриншот окна"
|
||||
msgstr "Сделать скриншот окна"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:59
|
||||
msgid "Delay screenshot"
|
||||
msgstr "Задержка скриншота"
|
||||
msgstr "Сделать скриншот с задержкой"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:60
|
||||
msgid "Terminal"
|
||||
msgstr "Терминал"
|
||||
msgstr "Запустить терминал"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:61
|
||||
msgid "Terminal Quake Window"
|
||||
msgstr "Окно Quake терминала"
|
||||
msgstr "Запустить полноэкранный терминал"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:62
|
||||
msgid "Logout"
|
||||
msgstr "Выход"
|
||||
msgstr "Выйти из системы"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:63
|
||||
msgid "Disable Touchpad"
|
||||
@ -524,7 +524,7 @@ msgstr "Отключить тачпад"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:64
|
||||
msgid "Deepin Translator"
|
||||
msgstr "Переводчик Deepin"
|
||||
msgstr "Запустить переводчик"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:65
|
||||
msgid "Switch Layout"
|
||||
@ -584,7 +584,7 @@ msgstr "Извлечь"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:93
|
||||
msgid "Close window"
|
||||
msgstr "Закрыть окна"
|
||||
msgstr "Закрыть окно"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:94
|
||||
msgid "Maximize window"
|
||||
@ -616,86 +616,86 @@ msgstr "Активировать меню окна"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:108
|
||||
msgid "Switch to workspace 1"
|
||||
msgstr "Переключится на рабочий стол 1 "
|
||||
msgstr "Переключится на раб. стол 1 "
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:109
|
||||
msgid "Switch to workspace 2"
|
||||
msgstr "Переключится на рабочий стол 2"
|
||||
msgstr "Переключится на раб. стол 2"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:110
|
||||
msgid "Switch to workspace 3"
|
||||
msgstr "Переключится на рабочий стол 3"
|
||||
msgstr "Переключится на раб. стол 3"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:111
|
||||
msgid "Switch to workspace 4"
|
||||
msgstr "Переключится на рабочий стол 4"
|
||||
msgstr "Переключится на раб. стол 4"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:112
|
||||
msgid "Switch to left workspace"
|
||||
msgstr "На левый рабочий стол"
|
||||
msgstr "На левый раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:113
|
||||
msgid "Switch to right workspace"
|
||||
msgstr "На правый рабочий стол"
|
||||
msgstr "На правый раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:114
|
||||
msgid "Switch to upper workspace"
|
||||
msgstr "На верхний рабочий стол"
|
||||
msgstr "На верхний раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:115
|
||||
msgid "Switch to lower workspace"
|
||||
msgstr "На нижний рабочий стол"
|
||||
msgstr "На нижний раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:116
|
||||
msgid "Move to workspace 1"
|
||||
msgstr "Переместить на рабочий стол 1"
|
||||
msgstr "Переместить на раб. стол 1"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:117
|
||||
msgid "Move to workspace 2"
|
||||
msgstr "Переместить на рабочий стол 2"
|
||||
msgstr "Переместить на раб. стол 2"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:118
|
||||
msgid "Move to workspace 3"
|
||||
msgstr "Переместить на рабочий стол 3"
|
||||
msgstr "Переместить на раб. стол 3"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:119
|
||||
msgid "Move to workspace 4"
|
||||
msgstr "Переместить на рабочий стол 4"
|
||||
msgstr "Переместить на раб. стол 4"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:120
|
||||
msgid "Move to left workspace"
|
||||
msgstr "Переместит на левый рабочий стол"
|
||||
msgstr "Переместить на левый раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:121
|
||||
msgid "Move to right workspace"
|
||||
msgstr "Переместить на правый рабочий стол"
|
||||
msgstr "Переместить на правый раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:122
|
||||
msgid "Move to upper workspace"
|
||||
msgstr "Переместить на верхний рабочий стол"
|
||||
msgstr "Переместить на верхний раб. стол"
|
||||
|
||||
#: ../../keybinding/id_desc_list.go:123
|
||||
msgid "Move to lower workspace"
|
||||
msgstr "Переместить на нижний рабочий стол"
|
||||
msgstr "Переместить на нижний раб. стол"
|
||||
|
||||
#: ../../langselector/handle_event.go:36
|
||||
msgid "System language failed to change, please try later."
|
||||
msgstr "Неудача смены языка системы, попробуйте позже."
|
||||
msgstr "Не удалось сменить язык системы, попробуйте позже!"
|
||||
|
||||
#: ../../langselector/handle_event.go:42
|
||||
msgid ""
|
||||
"System language has been changed, please log in again after logged out."
|
||||
msgstr "Был изменён язык системы, перезайдите."
|
||||
msgstr "Был изменен язык системы, выйдите из системы и войдите вновь…"
|
||||
|
||||
#: ../../langselector/locale_ifc.go:55
|
||||
msgid "System language is being changed, please wait..."
|
||||
msgstr "Меняется язык системы, подождите..."
|
||||
msgstr "Меняется язык системы, подождите…"
|
||||
|
||||
#: ../../langselector/locale_ifc.go:60
|
||||
msgid ""
|
||||
"System language is being changed with an installation of lacked language "
|
||||
"packages, please wait..."
|
||||
msgstr "Язык системы меняется с установкой недостающих языковых пакетов, подождите..."
|
||||
msgstr "Меняется язык системы с установкой недостающих языковых пакетов, подождите…"
|
||||
|
||||
#: ../../mime/default_media.go:73 ../../mime/default_media.go:90
|
||||
msgid "Nothing"
|
||||
@ -707,12 +707,12 @@ msgstr "Открыть папку"
|
||||
|
||||
#: ../../mime/default_media.go:80
|
||||
msgid "Run Software"
|
||||
msgstr "Пуск программы"
|
||||
msgstr "Запуск программы"
|
||||
|
||||
#: ../../network/_dev_test.go:42 ../../network/_dev_test.go:49
|
||||
#: ../../network/state_handler.go:188 ../../network/utils_notify.go:103
|
||||
msgid "Connected"
|
||||
msgstr "Подключён"
|
||||
msgstr "Подключен"
|
||||
|
||||
#: ../../network/_dev_test.go:45 ../../network/_dev_test.go:47
|
||||
#: ../../network/_dev_test.go:51 ../../network/_dev_test.go:53
|
||||
@ -735,7 +735,7 @@ msgstr "Ничего"
|
||||
#: ../../network/nm_setting_virtual_key.go:142
|
||||
#: ../../network/nm_setting_virtual_key.go:149
|
||||
msgid "WEP 40/128-bit Key"
|
||||
msgstr "WEP 40/128-bit Key"
|
||||
msgstr "WEP 40/128-бит. ключ"
|
||||
|
||||
#: ../../network/manager_active.go:292
|
||||
#: ../../network/nm_setting_virtual_key.go:143
|
||||
@ -772,7 +772,7 @@ msgstr "Туннельный LTS "
|
||||
#: ../../network/manager_active.go:310 ../../network/nm_setting_802_1x.go:171
|
||||
#: ../../network/nm_setting_802_1x.go:179
|
||||
msgid "Protected EAP"
|
||||
msgstr "Защищённый EAP"
|
||||
msgstr "Защищенный EAP"
|
||||
|
||||
#: ../../network/manager_connection.go:211 ../../network/nm_custom_type.go:178
|
||||
msgid "Wired Connection"
|
||||
@ -818,7 +818,7 @@ msgstr "Беспроводный Ap-Hotspot"
|
||||
|
||||
#: ../../network/nm_custom_type.go:186
|
||||
msgid "PPPoE Connection"
|
||||
msgstr "PPPoE подключение"
|
||||
msgstr "PPPoE-подключение"
|
||||
|
||||
#: ../../network/nm_custom_type.go:188
|
||||
msgid "Mobile Connection"
|
||||
@ -826,15 +826,15 @@ msgstr "Мобильное подключение"
|
||||
|
||||
#: ../../network/nm_custom_type.go:190
|
||||
msgid "Mobile GSM Connection"
|
||||
msgstr "Мобильное GSM подключение"
|
||||
msgstr "Мобильное GSM-подключение"
|
||||
|
||||
#: ../../network/nm_custom_type.go:192
|
||||
msgid "Mobile CDMA Connection"
|
||||
msgstr "Мобильное CDMA подключение"
|
||||
msgstr "Мобильное CDMA-подключение"
|
||||
|
||||
#: ../../network/nm_custom_type.go:194
|
||||
msgid "VPN Connection"
|
||||
msgstr "VPN подключение"
|
||||
msgstr "VPN-подключение"
|
||||
|
||||
#: ../../network/nm_custom_type.go:196
|
||||
msgid "VPN L2TP"
|
||||
@ -1288,11 +1288,11 @@ msgstr "Открыть"
|
||||
|
||||
#: ../../network/state_handler.go:34
|
||||
msgid "Device state changed, unknown reason."
|
||||
msgstr "Статус устройства изменён по неизвестной причине."
|
||||
msgstr "Состояние устройства изменено по неизвестной причине."
|
||||
|
||||
#: ../../network/state_handler.go:35
|
||||
msgid "Device state changed."
|
||||
msgstr "Статус устройства изменён."
|
||||
msgstr "Состояние устройства изменено."
|
||||
|
||||
#: ../../network/state_handler.go:36
|
||||
msgid "The device is now managed."
|
||||
@ -1427,7 +1427,7 @@ msgstr "Регистрация для запрашиваемой GSM сети н
|
||||
|
||||
#: ../../network/state_handler.go:68
|
||||
msgid "PIN check failed."
|
||||
msgstr "Проверка PIN неудачна."
|
||||
msgstr "Проверка PIN не удалась!"
|
||||
|
||||
#: ../../network/state_handler.go:69
|
||||
msgid "Necessary firmware for the device may be missed."
|
||||
@ -1435,7 +1435,7 @@ msgstr "Необходимая микропрограмма для устрой
|
||||
|
||||
#: ../../network/state_handler.go:70
|
||||
msgid "The device was removed."
|
||||
msgstr "Устройство было удалено."
|
||||
msgstr "Устройство было удалено!"
|
||||
|
||||
#: ../../network/state_handler.go:71
|
||||
msgid "NetworkManager went to sleep."
|
||||
@ -1499,11 +1499,11 @@ msgstr "Проблема с RFC 2684 Ethernet по ADSL мосту."
|
||||
|
||||
#: ../../network/state_handler.go:86
|
||||
msgid "ModemManager did not run or quitted unexpectedly."
|
||||
msgstr "ModemManager не запущен или неожиданно отключён."
|
||||
msgstr "ModemManager не запущен или неожиданно отключен!"
|
||||
|
||||
#: ../../network/state_handler.go:87
|
||||
msgid "The 802.11 Wi-Fi network could not be found."
|
||||
msgstr "802.11 Wi-Fi сеть не может быть найдена."
|
||||
msgstr "Wi-Fi-сеть не может быть найдена!"
|
||||
|
||||
#: ../../network/state_handler.go:88
|
||||
msgid "A secondary connection of the base connection failed."
|
||||
@ -1511,27 +1511,27 @@ msgstr "Вторичное подключение базового соедин
|
||||
|
||||
#: ../../network/state_handler.go:91
|
||||
msgid "Network cable is unplugged."
|
||||
msgstr "Сетевой кабель отключён."
|
||||
msgstr "Сетевой кабель отключен!"
|
||||
|
||||
#: ../../network/state_handler.go:94
|
||||
msgid "Activate VPN connection failed, unknown reason."
|
||||
msgstr "Активация VPN-соединения неудачна, причина неизвестна."
|
||||
msgstr "Активация VPN-соединения не удалась по неизвестной причине…"
|
||||
|
||||
#: ../../network/state_handler.go:95
|
||||
msgid "Activate VPN connection failed."
|
||||
msgstr "Активация VPN-соединения неудачна."
|
||||
msgstr "Активация VPN-соединения не удалась!"
|
||||
|
||||
#: ../../network/state_handler.go:96
|
||||
msgid "The VPN connection changed state due to disconnection from users."
|
||||
msgstr "VPN соединение изменено состояние из-за отключения пользователей."
|
||||
msgstr "Изменено состояние VPN-соединения из-за отключения пользователей!"
|
||||
|
||||
#: ../../network/state_handler.go:97
|
||||
msgid "The VPN connection changed state due to disconnection from devices."
|
||||
msgstr "VPN соединение изменило состояние из-за отключения устройств."
|
||||
msgstr "Изменено состояние VPN-соединения из-за отключения устройств!"
|
||||
|
||||
#: ../../network/state_handler.go:98
|
||||
msgid "VPN service stopped."
|
||||
msgstr "VPN-сервис остановлен."
|
||||
msgstr "VPN-сервис остановлен!"
|
||||
|
||||
#: ../../network/state_handler.go:99
|
||||
msgid "The IP config of VPN connection was invalid."
|
||||
@ -1555,7 +1555,7 @@ msgstr "Необходимый пароль для подключения VPN н
|
||||
|
||||
#: ../../network/state_handler.go:104
|
||||
msgid "Authentication to VPN server failed."
|
||||
msgstr "Аутентификация на сервере VPN не удалась."
|
||||
msgstr "Аутентификация на VPN-сервере не удалась!"
|
||||
|
||||
#: ../../network/state_handler.go:105
|
||||
msgid "The connection was deleted from settings."
|
||||
@ -1607,7 +1607,7 @@ msgstr "Заряд батареи не предсказуем, правильн
|
||||
|
||||
#: ../../power/upower.go:86 ../../power/upower.go:101
|
||||
msgid "Battery Critical Low"
|
||||
msgstr "Батарей полностью разряжена"
|
||||
msgstr "Слишком слабый заряд батареи"
|
||||
|
||||
#: ../../power/upower.go:86
|
||||
msgid "Computer has been in suspend mode, please plug in."
|
||||
|
@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: Microtus <hrabosmartin@gmail.com>\n"
|
||||
"Language-Team: Slovak (http://www.transifex.com/projects/p/dde-daemon/language/sk/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
4659
misc/po/sl.po
4659
misc/po/sl.po
File diff suppressed because it is too large
Load Diff
1623
misc/po/sv_SE.po
Normal file
1623
misc/po/sv_SE.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-04-06 13:52+0000\n"
|
||||
"Last-Translator: deepin_transifex <xiabin@linuxdeepin.com>\n"
|
||||
"Language-Team: Turkish (http://www.transifex.com/projects/p/dde-daemon/language/tr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -3,13 +3,13 @@
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Translators:
|
||||
# szd_liufei <liufei@linuxdeepin.com>, 2014
|
||||
# szd_liufei <liufei@linuxdeepin.com>, 2014-2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-26 08:41+0000\n"
|
||||
"PO-Revision-Date: 2015-03-25 06:11+0000\n"
|
||||
"Last-Translator: szd_liufei <liufei@linuxdeepin.com>\n"
|
||||
"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/dde-daemon/language/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -32,7 +32,7 @@ msgstr "首字符必须为小写字母"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:68
|
||||
msgid "The username exists."
|
||||
msgstr "此用户名已存在。"
|
||||
msgstr "此用户名已存在"
|
||||
|
||||
#: ../../accounts/username_checker/username.go:69
|
||||
msgid "The username has been used by system."
|
||||
|
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: dde-daemon\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-08 14:49+0800\n"
|
||||
"PO-Revision-Date: 2014-12-30 07:28+0000\n"
|
||||
"PO-Revision-Date: 2015-04-05 17:21+0000\n"
|
||||
"Last-Translator: szd_liufei <liufei@linuxdeepin.com>\n"
|
||||
"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/dde-daemon/language/zh_TW/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -54,7 +54,7 @@ func (op *Manager) EnableZoneDetected(enable bool) {
|
||||
func (op *Manager) SetTopLeft(value string) {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
edgeActionMap[EDGE_TOPLEFT] = value
|
||||
edgeActionMap[leftTopEdge] = value
|
||||
}
|
||||
|
||||
func (op *Manager) TopLeftAction() string {
|
||||
@ -64,7 +64,7 @@ func (op *Manager) TopLeftAction() string {
|
||||
func (op *Manager) SetBottomLeft(value string) {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
edgeActionMap[EDGE_BOTTOMLEFT] = value
|
||||
edgeActionMap[leftBottomEdge] = value
|
||||
}
|
||||
|
||||
func (op *Manager) BottomLeftAction() string {
|
||||
@ -74,7 +74,7 @@ func (op *Manager) BottomLeftAction() string {
|
||||
func (op *Manager) SetTopRight(value string) {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
edgeActionMap[EDGE_TOPRIGHT] = value
|
||||
edgeActionMap[rightTopEdge] = value
|
||||
}
|
||||
|
||||
func (op *Manager) TopRightAction() string {
|
||||
@ -84,7 +84,7 @@ func (op *Manager) TopRightAction() string {
|
||||
func (op *Manager) SetBottomRight(value string) {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
edgeActionMap[EDGE_BOTTOMRIGHT] = value
|
||||
edgeActionMap[rightBottomEdge] = value
|
||||
}
|
||||
|
||||
func (op *Manager) BottomRightAction() string {
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"os/exec"
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type areaRange struct {
|
||||
@ -35,12 +36,21 @@ type areaRange struct {
|
||||
}
|
||||
|
||||
const (
|
||||
DISTANCE = int32(10)
|
||||
EDGE_TOPLEFT = "TopLeft"
|
||||
EDGE_BOTTOMLEFT = "BottomLeft"
|
||||
EDGE_TOPRIGHT = "TopRight"
|
||||
EDGE_BOTTOMRIGHT = "BottomRight"
|
||||
ACTION_WORKSPACE = "workspace"
|
||||
edgeDistance int32 = 5
|
||||
|
||||
leftTopEdge = "TopLeft"
|
||||
leftBottomEdge = "BottomLeft"
|
||||
rightTopEdge = "TopRight"
|
||||
rightBottomEdge = "BottomRight"
|
||||
|
||||
edgeActionWorkspace = "workspace"
|
||||
)
|
||||
|
||||
const (
|
||||
leftTopDelay int32 = 0
|
||||
leftBottomDelay = 0
|
||||
rightTopDelay = 0
|
||||
rightBottomDelay = 500
|
||||
)
|
||||
|
||||
var (
|
||||
@ -79,13 +89,13 @@ func registerZoneArea() {
|
||||
return
|
||||
}
|
||||
|
||||
topLeftArea = areaRange{startX, startY, startX + DISTANCE, startY + DISTANCE}
|
||||
topLeftArea = areaRange{startX, startY, startX + edgeDistance, startY + edgeDistance}
|
||||
logger.Debug("TopLeft: ", topLeftArea)
|
||||
bottomLeftArea = areaRange{startX, endY - DISTANCE, startX + DISTANCE, endY}
|
||||
bottomLeftArea = areaRange{startX, endY - edgeDistance, startX + edgeDistance, endY}
|
||||
logger.Debug("BottomLeft: ", bottomLeftArea)
|
||||
topRightArea = areaRange{endX - DISTANCE, startY, endX, startY + DISTANCE}
|
||||
topRightArea = areaRange{endX - edgeDistance, startY, endX, startY + edgeDistance}
|
||||
logger.Debug("TopRight: ", topRightArea)
|
||||
bottomRightArea = areaRange{endX - DISTANCE, endY - DISTANCE, endX, endY}
|
||||
bottomRightArea = areaRange{endX - edgeDistance, endY - edgeDistance, endX, endY}
|
||||
logger.Debug("BottomRight: ", bottomRightArea)
|
||||
|
||||
logger.Debug("topLeft: ", topLeftArea)
|
||||
@ -183,8 +193,41 @@ func (m *Manager) destroy() {
|
||||
func newManager() *Manager {
|
||||
m := &Manager{}
|
||||
|
||||
m.lTopTimer = &edgeTimer{}
|
||||
m.lBottomTimer = &edgeTimer{}
|
||||
m.rTopTimer = &edgeTimer{}
|
||||
m.rBottomTimer = &edgeTimer{}
|
||||
|
||||
registerZoneArea()
|
||||
m.listenSignal()
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
type edgeTimer struct {
|
||||
timer *time.Timer
|
||||
}
|
||||
|
||||
func (eTimer *edgeTimer) DoAction(edge string, timeout int32) {
|
||||
if timeout == 0 {
|
||||
execEdgeAction(edge)
|
||||
return
|
||||
}
|
||||
|
||||
eTimer.timer = time.NewTimer(time.Millisecond *
|
||||
time.Duration(timeout))
|
||||
go func() {
|
||||
<-eTimer.timer.C
|
||||
execEdgeAction(edge)
|
||||
eTimer.timer = nil
|
||||
}()
|
||||
}
|
||||
|
||||
func (eTimer *edgeTimer) StopTimer() {
|
||||
if eTimer.timer == nil {
|
||||
return
|
||||
}
|
||||
|
||||
eTimer.timer.Stop()
|
||||
eTimer.timer = nil
|
||||
}
|
||||
|
@ -25,7 +25,12 @@ import (
|
||||
"pkg.linuxdeepin.com/lib/dbus"
|
||||
)
|
||||
|
||||
type Manager struct{}
|
||||
type Manager struct {
|
||||
lTopTimer *edgeTimer
|
||||
lBottomTimer *edgeTimer
|
||||
rTopTimer *edgeTimer
|
||||
rBottomTimer *edgeTimer
|
||||
}
|
||||
|
||||
const (
|
||||
ZONE_DEST = "com.deepin.daemon.Zone"
|
||||
@ -33,7 +38,7 @@ const (
|
||||
ZONE_IFC = "com.deepin.daemon.Zone"
|
||||
)
|
||||
|
||||
func (op *Manager) GetDBusInfo() dbus.DBusInfo {
|
||||
func (m *Manager) GetDBusInfo() dbus.DBusInfo {
|
||||
return dbus.DBusInfo{
|
||||
Dest: ZONE_DEST,
|
||||
ObjectPath: ZONE_PATH,
|
||||
@ -41,36 +46,18 @@ func (op *Manager) GetDBusInfo() dbus.DBusInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (op *Manager) listenSignal() {
|
||||
func (m *Manager) listenSignal() {
|
||||
dspObj.ConnectPrimaryChanged(func(argv []interface{}) {
|
||||
unregisterZoneArea()
|
||||
registerZoneArea()
|
||||
})
|
||||
|
||||
areaObj.ConnectCursorInto(func(x, y int32, id string) {
|
||||
if id != areaId {
|
||||
return
|
||||
}
|
||||
m.handleCursorSignal(x, y, id, true)
|
||||
})
|
||||
|
||||
if isAppInBlackList() {
|
||||
return
|
||||
}
|
||||
|
||||
if pid, ok := isActiveWindowFullscreen(); ok {
|
||||
if !isAppInWhiteList(pid) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if isInArea(x, y, topLeftArea) {
|
||||
execEdgeAction(EDGE_TOPLEFT)
|
||||
} else if isInArea(x, y, bottomLeftArea) {
|
||||
execEdgeAction(EDGE_BOTTOMLEFT)
|
||||
} else if isInArea(x, y, topRightArea) {
|
||||
execEdgeAction(EDGE_TOPRIGHT)
|
||||
} else if isInArea(x, y, bottomRightArea) {
|
||||
execEdgeAction(EDGE_BOTTOMRIGHT)
|
||||
}
|
||||
areaObj.ConnectCursorOut(func(x, y int32, id string) {
|
||||
m.handleCursorSignal(x, y, id, false)
|
||||
})
|
||||
|
||||
areaObj.ConnectCancelAllArea(func() {
|
||||
@ -83,13 +70,55 @@ func (op *Manager) listenSignal() {
|
||||
})
|
||||
|
||||
launchObj.ConnectClosed(func() {
|
||||
op.enableAllEdge()
|
||||
m.enableAllEdge()
|
||||
})
|
||||
}
|
||||
|
||||
func (op *Manager) enableAllEdge() {
|
||||
op.SetTopLeft(op.TopLeftAction())
|
||||
op.SetBottomLeft(op.BottomLeftAction())
|
||||
op.SetTopRight(op.TopRightAction())
|
||||
op.SetBottomRight(op.BottomRightAction())
|
||||
func (m *Manager) enableAllEdge() {
|
||||
m.SetTopLeft(m.TopLeftAction())
|
||||
m.SetBottomLeft(m.BottomLeftAction())
|
||||
m.SetTopRight(m.TopRightAction())
|
||||
m.SetBottomRight(m.BottomRightAction())
|
||||
}
|
||||
|
||||
func (m *Manager) filterCursorSignal(id string) bool {
|
||||
if id != areaId {
|
||||
return true
|
||||
}
|
||||
|
||||
if isAppInBlackList() {
|
||||
return true
|
||||
}
|
||||
|
||||
if pid, ok := isActiveWindowFullscreen(); ok {
|
||||
if !isAppInWhiteList(pid) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Manager) handleCursorSignal(x, y int32, id string, into bool) {
|
||||
if m.filterCursorSignal(id) {
|
||||
return
|
||||
}
|
||||
|
||||
if !into {
|
||||
m.lTopTimer.StopTimer()
|
||||
m.lBottomTimer.StopTimer()
|
||||
m.rTopTimer.StopTimer()
|
||||
m.rBottomTimer.StopTimer()
|
||||
return
|
||||
}
|
||||
|
||||
if isInArea(x, y, topLeftArea) {
|
||||
m.lTopTimer.DoAction(leftTopEdge, leftTopDelay)
|
||||
} else if isInArea(x, y, bottomLeftArea) {
|
||||
m.lBottomTimer.DoAction(leftBottomEdge, leftBottomDelay)
|
||||
} else if isInArea(x, y, topRightArea) {
|
||||
m.rTopTimer.DoAction(rightTopEdge, rightTopDelay)
|
||||
} else if isInArea(x, y, bottomRightArea) {
|
||||
m.rBottomTimer.DoAction(rightBottomEdge, rightBottomDelay)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user