Skip to content
Permalink
Browse files

Update settings dialog to allow events or todos.

  • Loading branch information...
moldybeats committed Apr 3, 2013
1 parent 390468c commit 9e7f04e79475e3d2cf45daaed981cc200a24e892
Showing with 16 additions and 8 deletions.
  1. +10 −5 chrome/content/settingsDialog.js
  2. +6 −3 chrome/content/settingsDialog.xul
@@ -15,7 +15,8 @@ StormCowsConfig.prototype = {
mBtnStartAuth: null,
mBtnFinishAuth: null,
mMenulistCalendars: null,
mBtnAddCalendar: null,
mBtnAddCalendarEvents: null,
mBtnAddCalendarTodos: null,

setAuthenticated: function() {
stormcowsLogger.debug('settingsDialog.js:setAuthenticated()');
@@ -25,7 +26,8 @@ StormCowsConfig.prototype = {
this.mBtnStartAuth.disabled = true;
this.mBtnFinishAuth.disabled = true;
this.mMenulistCalendars.disabled = false;
this.mBtnAddCalendar.disabled = false;
this.mBtnAddCalendarEvents.disabled = false;
this.mBtnAddCalendarTodos.disabled = false;

let data = {
callback: this.populateCalendarList.bind(this)
@@ -41,7 +43,8 @@ StormCowsConfig.prototype = {
this.mBtnStartAuth.disabled = false;
this.mBtnFinishAuth.disabled = true;
this.mMenulistCalendars.disabled = true;
this.mBtnAddCalendar.disabled = true;
this.mBtnAddCalendarEvents.disabled = true;
this.mBtnAddCalendarTodos.disabled = true;
},

populateCalendarList: function(aLists) {
@@ -70,7 +73,8 @@ StormCowsConfig.prototype = {
this.mBtnStartAuth = document.getElementById('stormcows-config-startauth-btn');
this.mBtnFinishAuth = document.getElementById('stormcows-config-finishauth-btn');
this.mMenulistCalendars = document.getElementById('stormcows-config-calendar-menulist');
this.mBtnAddCalendar = document.getElementById('stormcows-config-addcalendar-btn');
this.mBtnAddCalendarEvents = document.getElementById('stormcows-config-addcalendar-events-btn');
this.mBtnAddCalendarTodos = document.getElementById('stormcows-config-addcalendar-todos-btn');

if (rtmClient.authToken) {
this.setAuthenticated();
@@ -160,7 +164,7 @@ StormCowsConfig.prototype = {
this.setAuthenticated();
},

doAddCalendar: function() {
doAddCalendar: function(aItemType) {
stormcowsLogger.debug('settingsDialog.js:doAddCalendar()');

let menuItem = this.mMenulistCalendars.selectedItem;
@@ -172,6 +176,7 @@ StormCowsConfig.prototype = {
let newCal = calManager.createCalendar('stormcows', url);
newCal.name = listName;
newCal.setProperty('listId', listId);
newCal.setProperty('itemType', aItemType);

calManager.registerCalendar(newCal);
},
@@ -49,9 +49,12 @@
<menupopup>
</menupopup>
</menulist>
<button id="stormcows-config-addcalendar-btn"
label="Add"
oncommand="scConfig.doAddCalendar()" />
<button id="stormcows-config-addcalendar-events-btn"
label="Add Events"
oncommand="scConfig.doAddCalendar('events')" />
<button id="stormcows-config-addcalendar-todos-btn"
label="Add Todos"
oncommand="scConfig.doAddCalendar('todos')" />
</hbox>
</groupbox>

0 comments on commit 9e7f04e

Please sign in to comment.
You can’t perform that action at this time.