Changeset View
Changeset View
Standalone View
Standalone View
src/applet/package/contents/ui/DeviceItem.qml
Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Line(s) | 30 | PlasmaComponents.ListItem { | |||
---|---|---|---|---|---|
399 | } | 399 | } | ||
400 | 400 | | |||
401 | function infoText() | 401 | function infoText() | ||
402 | { | 402 | { | ||
403 | if (connecting) { | 403 | if (connecting) { | ||
404 | return Connected ? i18n("Disconnecting") : i18n("Connecting"); | 404 | return Connected ? i18n("Disconnecting") : i18n("Connecting"); | ||
405 | } | 405 | } | ||
406 | 406 | | |||
407 | var labels = []; | ||||
408 | | ||||
407 | switch (Type) { | 409 | switch (Type) { | ||
408 | case BluezQt.Device.Headset: | 410 | case BluezQt.Device.Headset: | ||
409 | case BluezQt.Device.Headphones: | 411 | case BluezQt.Device.Headphones: | ||
410 | case BluezQt.Device.OtherAudio: | 412 | case BluezQt.Device.OtherAudio: | ||
411 | return i18n("Audio device"); | 413 | labels.push(i18n("Audio device")); | ||
414 | break; | ||||
412 | 415 | | |||
413 | case BluezQt.Device.Keyboard: | 416 | case BluezQt.Device.Keyboard: | ||
414 | case BluezQt.Device.Mouse: | 417 | case BluezQt.Device.Mouse: | ||
415 | case BluezQt.Device.Joypad: | 418 | case BluezQt.Device.Joypad: | ||
416 | case BluezQt.Device.Tablet: | 419 | case BluezQt.Device.Tablet: | ||
417 | return i18n("Input device"); | 420 | labels.push(i18n("Input device")); | ||
418 | | ||||
419 | default: | | |||
420 | break; | 421 | break; | ||
421 | } | | |||
422 | 422 | | |||
423 | default: | ||||
423 | var profiles = []; | 424 | var profiles = []; | ||
424 | 425 | | |||
425 | if (Uuids.indexOf(BluezQt.Services.ObexFileTransfer) != -1) { | 426 | if (Uuids.indexOf(BluezQt.Services.ObexFileTransfer) != -1) { | ||
426 | profiles.push(i18n("File transfer")); | 427 | profiles.push(i18n("File transfer")); | ||
427 | } | 428 | } | ||
428 | if (Uuids.indexOf(BluezQt.Services.ObexObjectPush) != -1) { | 429 | if (Uuids.indexOf(BluezQt.Services.ObexObjectPush) != -1) { | ||
429 | profiles.push(i18n("Send file")); | 430 | profiles.push(i18n("Send file")); | ||
430 | } | 431 | } | ||
431 | if (Uuids.indexOf(BluezQt.Services.HumanInterfaceDevice) != -1) { | 432 | if (Uuids.indexOf(BluezQt.Services.HumanInterfaceDevice) != -1) { | ||
432 | profiles.push(i18n("Input")); | 433 | profiles.push(i18n("Input")); | ||
433 | } | 434 | } | ||
434 | if (Uuids.indexOf(BluezQt.Services.AdvancedAudioDistribution) != -1) { | 435 | if (Uuids.indexOf(BluezQt.Services.AdvancedAudioDistribution) != -1) { | ||
435 | profiles.push(i18n("Audio")); | 436 | profiles.push(i18n("Audio")); | ||
436 | } | 437 | } | ||
437 | if (Uuids.indexOf(BluezQt.Services.Nap) != -1) { | 438 | if (Uuids.indexOf(BluezQt.Services.Nap) != -1) { | ||
438 | profiles.push(i18n("Network")); | 439 | profiles.push(i18n("Network")); | ||
439 | } | 440 | } | ||
440 | 441 | | |||
441 | if (!profiles.length) { | 442 | if (!profiles.length) { | ||
442 | return i18n("Other device"); | 443 | profiles.push(i18n("Other device")); | ||
444 | } | ||||
445 | | ||||
446 | labels.push(profiles.join(", ")); | ||||
447 | } | ||||
448 | | ||||
449 | if (Battery) { | ||||
450 | labels.push(i18n("%1% Battery", Battery.percentage)); | ||||
443 | } | 451 | } | ||
444 | 452 | | |||
445 | return profiles.join(", "); | 453 | return labels.join(" · "); | ||
446 | } | 454 | } | ||
447 | 455 | | |||
448 | function connectToDevice() | 456 | function connectToDevice() | ||
449 | { | 457 | { | ||
450 | if (connecting) { | 458 | if (connecting) { | ||
451 | return; | 459 | return; | ||
452 | } | 460 | } | ||
453 | 461 | | |||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |