~timo-jyrinki/ubuntu-calendar-app/use_pickerpanelworkaround_lp1351024

« back to all changes in this revision

Viewing changes to EventDetails.qml

  • Committer: Jason
  • Date: 2014-07-29 21:18:36 UTC
  • mfrom: (370 ubuntu-calendar-app)
  • mto: This revision was merged to the branch mainline in revision 373.
  • Revision ID: gerlowskija@gmail.com-20140729211836-3a0np2sfnk1q3jr8
Merge trunk branch back into this bug-fix branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    title: "Event Details"
28
28
 
29
29
    Component.onCompleted: {
 
30
 
30
31
        showEvent(event);
31
32
    }
32
33
 
56
57
                    // TRANSLATORS: this is a time & Date formatting string,
57
58
                    //see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details
58
59
                    var dateFormat = i18n.tr("dd-MMM-yyyy")
 
60
                    // TRANSLATORS: This refers to no of occurences of an event.
59
61
                    limitHeader.value = parseInt(recurrenceRule[0].limit) ?
60
 
                                i18n.tr("After %1 Occurrences").arg(recurrenceRule[0].limit):
61
 
                                i18n.tr("After Date %1").arg(recurrenceRule[0].limit.toLocaleString(Qt.locale(),dateFormat));
 
62
                                i18n.tr("After %1 Occurrences", recurrenceRule[0].limit).arg(recurrenceRule[0].limit):
 
63
                                i18n.tr("After Date %1", recurrenceRule[0].limit.toLocaleString(Qt.locale(),dateFormat)).arg(recurrenceRule[0].limit.toLocaleString(Qt.locale(),dateFormat));
62
64
                }
63
65
 
64
66
                index =  recurrenceRule[0].frequency ;
 
67
                if(index === RecurrenceRule.Weekly ){
 
68
                    var sorted = recurrenceRule[0].daysOfWeek.sort();
 
69
                    var val = i18n.tr("Every ")
 
70
                    for(var j=0;j<sorted.length;++j){
 
71
                        val += Qt.locale().dayName(sorted[j],Locale.LongFormat) + " ,"
 
72
                    }
 
73
                    weekDaysHeader.value = val.slice(0,-1) // Trim last comma from the string
 
74
                    weekDaysHeader.visible = true;
 
75
                }
65
76
            }
66
77
            else{
67
78
                limitHeader.visible = false
68
79
                index = 0
69
80
            }
70
81
        }
71
 
        recurrentHeader.value = Defines.recurrenceLabel[index];
 
82
        // This happens will be weekly in following cases:
 
83
        // 1. Weekdays Monday to Friday
 
84
        // 2. Monday,Wednesday,Friday
 
85
        // 3. Tuesday & Thursday
 
86
        // 4. Manual weekdays
 
87
        recurrentHeader.value = Defines.recurrenceLabel[index === RecurrenceRule.Weekly ? 5 : index];
72
88
    }
73
89
 
74
90
    function updateContacts(event) {
292
308
                }
293
309
                Label{
294
310
                    id:calendarName
 
311
                    objectName: "calendarName"
295
312
                    anchors.verticalCenter: parent.verticalCenter
296
313
                    color: headerColor
297
314
                }
377
394
 
378
395
            //Guest Entries ends
379
396
            ThinDivider{}
380
 
            property int recurranceAreaMaxWidth: Math.max( recurrentHeader.headerWidth, reminderHeader.headerWidth,limitHeader.headerWidth) //Dynamic Height
 
397
            property int recurranceAreaMaxWidth: Math.max( recurrentHeader.headerWidth, reminderHeader.headerWidth,weekDaysHeader.headerWidth,limitHeader.headerWidth) //Dynamic Height
381
398
            EventDetailsInfo{
382
399
                id: recurrentHeader
383
400
                xMargin: column.recurranceAreaMaxWidth
389
406
                header: i18n.tr("Remind me")
390
407
            }
391
408
            EventDetailsInfo{
 
409
                id: weekDaysHeader
 
410
                xMargin: column.recurranceAreaMaxWidth
 
411
                header: i18n.tr("Repeats On");
 
412
                visible: false
 
413
            }
 
414
            EventDetailsInfo{
392
415
                id: limitHeader
393
416
                xMargin: column.recurranceAreaMaxWidth
394
417
                header: i18n.tr("Repetition Ends")
395
418
            }
 
419
 
396
420
        }
397
421
    }
398
422
}