Populate the test of locale bindings

This commit is contained in:
Giorgos Tsiapaliwkas 2012-02-21 20:23:04 +02:00
parent a820916926
commit 37dd4360d2

View File

@ -23,43 +23,120 @@ import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.core 0.1 as PlasmaCore import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.locale 0.1 import org.kde.plasma.locale 0.1
Item { Item {
id: root id: root
property int minimumHeight:200 property int minimumHeight:200
property int minimumWidth:500 property int minimumWidth:500
Column { Column {
id: column id: column
anchors.horizontalCenter: root.horizontalCenter anchors.horizontalCenter: root.horizontalCenter
spacing: 20 spacing: 20
Text { Text {
id: text id: text1
anchors.horizontalCenter: column.horizontalCenter anchors.horizontalCenter: column.horizontalCenter
text: "<B>This is a test plasmoid for the locale bindings</B>" text: "<B>This is a test plasmoid for the locale bindings</B>"
color: "red" color: "black"
}
PlasmaComponents.Button {
id: bt1
anchors.horizontalCenter: column.horizontalCenter
text: "click in order to test the Locale component"
onClicked:{
print("hello");
} }
}
PlasmaComponents.Button { Text {
id: bt2 id: text2
anchors.horizontalCenter: column.horizontalCenter anchors.horizontalCenter: column.horizontalCenter
text: "click in order to test the CalendarSystem component" text: "<B>If you see this text,that means that every" +
onClicked:{ "non printable property/method has been already set. And it works!!</B>"
print("hello again"); color: "black"
} }
}
Locale { PlasmaComponents.Button {
id: locale id: bt1
anchors.horizontalCenter: column.horizontalCenter
text: "click in order to test the Locale component"
onClicked:{
console.log("=====Locale Component====")
console.log("country:" + locale.country)
// locale.binaryUnitDialect = Locale.BinaryUnitDialect.IECBinaryDialect
// locale.calendarSystem = CalendarSystem.CopticCalendar
locale.countryDivisionCode = "AL"
console.log("countryDivisionCode:" + locale.countryDivisionCode)
//locale.currencyCode = "AFN" //TODO add the right value
//console.log("currencyCode:" + locale.currencyCode)
//locale.currencySymbol = TODO
//console.log("currencySymbol" + locale.currencySymbol)
locale.dateFormat = "Y"
console.log("dateFormat:" + locale.dateFormat)
locale.dateFormatShort = "Y"
console.log("dateFormatShort:" + locale.dateFormatShort)
locale.dateMonthNamePossessive = false
console.log("dateMonthNamePossessive:" + locale.dateMonthNamePossessive)
console.log("===========end===========")
}
}
PlasmaComponents.Button {
id: bt2
anchors.horizontalCenter: column.horizontalCenter
text: "click in order to test the CalendarSystem component"
onClicked:{
console.log("=====CalendarSystem Component====")
console.log("===============end===============")
}
}
Locale {
id: locale
binaryUnitDialect: BinaryUnitDialect.DefaultBinaryDialect
onBinaryUnitDialectChanged: {
console.log("the binaryUnitDialect property has been changed")
}
calendarSystem: Locale.QDateCalendar
onCalendarSystemChanged: {
console.log("the calendarSystem property has been changed")
}
//TODO:Add the proper value
/*currencyCode: "AED"
onCurrencyCodeChanged: {
console.log("the currencyCode property has been changed")
}*/
/*TODO
currencySymbol: ""
onCurrencySymbolChanged: {
console.log("the currencySymbol property has been changed")
}*/
countryDivisionCode: "AD"
onCountryDivisionCodeChanged: {
console.log("the countryDivisionCode property has been changed")
}
dateFormat: "y"
onDateFormatChanged: {
console.log("the dateFormat property has been changed")
}
dateFormatShort: "y"
onDateFormatShortChanged: {
console.log("the dateFormatShort property has been changed")
}
dateMonthNamePossessive: true
onDateMonthNamePossessiveChanged: {
console.log("the dateMonthNamePossessive property has been changed")
}
} }
CalendarSystem { CalendarSystem {
id: calendar id: calendar
}
} }
} }
}