Browse Source

Shortcuts for Dont Disturb and Lock

F1 and F2
pull/223/head
Ramiro Saenz 9 years ago
parent
commit
73e4309c1f
  1. 21
      app/Application.js
  2. 6
      app/view/main/Main.js
  3. 8
      app/view/main/MainController.js

21
app/Application.js

@ -100,6 +100,27 @@ Ext.define('Rambox.Application', {
Ext.cq1('app-main').setActiveTab(key - 48);
}
}
,{
key: Ext.event.Event.F1
,ctrl: false
,alt: false
,shift: false
,handler: function(key) {
var btn = Ext.getCmp('disturbBtn');
btn.toggle();
Ext.cq1('app-main').getController().dontDisturb(btn);
}
}
,{
key: Ext.event.Event.F2
,ctrl: false
,alt: false
,shift: false
,handler: function(key) {
var btn = Ext.getCmp('lockRamboxBtn');
Ext.cq1('app-main').getController().lockRambox(btn);
}
}
]
});

6
app/view/main/Main.js

@ -215,16 +215,18 @@ Ext.define('Rambox.view.main.Main', {
{
glyph: 'xf1f7@FontAwesome'
,text: 'Don\'t Disturb: OFF'
,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.'
,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.<br/><b>Shortcut key: F1</b>'
,enableToggle: true
,handler: 'dontDisturb'
,reference: 'disturbBtn'
,id: 'disturbBtn'
}
,{
glyph: 'xf023@FontAwesome'
,text: 'Lock Rambox'
,tooltip: 'Lock this app if you will be away for a period of time.'
,tooltip: 'Lock this app if you will be away for a period of time.<br/><b>Shortcut key: F2</b>'
,handler: 'lockRambox'
,id: 'lockRamboxBtn'
}
,'->'
,{

8
app/view/main/MainController.js

@ -749,6 +749,14 @@ Ext.define('Rambox.view.main.MainController', {
});
btn.setText('Don\'t Disturb: ' + ( btn.pressed ? 'ON' : 'OFF' ));
Ext.toast({
html: btn.pressed ? 'ENABLED' : 'DISABLED'
,title: 'Don\'t Disturb'
,width: 200
,align: 't'
,closable: false
});
}
,lockRambox: function(btn) {

Loading…
Cancel
Save