443
443
id: profileSelector
445
title: i18n.tr("Select profile")
446
contentsHeight: mainView.height
455
height: mainColumnSettings.height
459
text: i18n.tr("Select profile")
466
height: mainColumnSettings.height
470
// height: parent.height - header.height
476
text: firstname + " " + lastname
479
console.log("clicked "+index)
480
currentUserId = profileId;
491
id: manageProfileSelector
493
title: i18n.tr("Select profile")
494
contentsHeight: mainView.height
499
id: manageProfileListView
502
height: mainColumnSettings.height
509
text: firstname + " " + lastname
514
editUserId = profileId
515
PopupUtils.open(manageProfileDialog, selectorProfile)
529
id: mainColumnSettings;
530
//width: settingsTab.width;
531
//height: settingsTab.height;
533
//anchors.horizontalCenter: parent.horizontalCenter;
537
text: i18n.tr("<b>Sudoku settings</b>")
540
ListItem.ValueSelector {
541
objectName: "difficultySelector"
542
id: difficultySelector
543
text: i18n.tr("Difficulty")
544
values: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard")]
545
onSelectedIndexChanged: {
546
//print(difficultySelector.selectedIndex)
547
switch(difficultySelector.selectedIndex) {
549
var randomnumber = Math.floor(Math.random()*9);
551
sudokuBlocksGrid.createNewGame(81 - randomnumber);
552
Settings.setSetting("Difficulty", selectedIndex)
555
var randomnumber = Math.floor(Math.random()*4);
557
sudokuBlocksGrid.createNewGame(81 - randomnumber);
558
Settings.setSetting("Difficulty", selectedIndex)
561
var randomnumber = Math.floor(Math.random()*4);
563
sudokuBlocksGrid.createNewGame(81 - randomnumber);
564
Settings.setSetting("Difficulty", selectedIndex)
567
var randomnumber = Math.floor(Math.random()*3);
569
sudokuBlocksGrid.createNewGame(81 - randomnumber);
570
Settings.setSetting("Difficulty", selectedIndex)
576
ListItem.ValueSelector {
578
text: i18n.tr("Theme")
579
values: ["UbuntuColours", "Simple"]
580
onSelectedIndexChanged: {
581
var newColorScheme = null;
582
if (selectedIndex == 0)
585
var result = Settings.setSetting("ColorTheme", selectedIndex);
587
sudokuBlocksGrid.changeColorScheme("ColorSchemeUbuntu.qml");
589
if (selectedIndex == 1)
592
var result = Settings.setSetting("ColorTheme", selectedIndex);
594
sudokuBlocksGrid.changeColorScheme("ColorSchemeSimple.qml");
600
objectName: "hintsSwitchClickable"
601
text: i18n.tr("Hints")
604
objectName: "hintsSwitch"
445
title: i18n.tr("Select profile")
450
height: mainColumnSettings.height
456
height: parent.height - units.gu(12)
462
text: firstname + " " + lastname
465
console.log("clicked "+index)
466
currentUserId = profileId;
475
anchors.horizontalCenter: parent.horizontalCenter
477
buttonText: i18n.tr("Cancel")
478
width: parent.width/2;
480
buttonColor: sudokuBlocksGrid.dialogButtonColor1
481
textColor: sudokuBlocksGrid.dialogButtonTextColor
482
//border.color: "transparent"
493
id: manageProfileSelector
495
title: i18n.tr("Select profile")
498
height: mainColumnSettings.height
500
id: manageProfileListView
503
height: parent.height - units.gu(12)
510
text: firstname + " " + lastname
515
editUserId = profileId
516
PopupUtils.open(manageProfileDialog, selectorProfile)
525
anchors.horizontalCenter: parent.horizontalCenter
527
buttonText: i18n.tr("Cancel")
528
width: parent.width/2;
530
buttonColor: sudokuBlocksGrid.dialogButtonColor1
531
textColor: sudokuBlocksGrid.dialogButtonTextColor
532
//border.color: "transparent"
545
id: mainColumnSettings;
546
//width: settingsTab.width;
547
//height: settingsTab.height;
549
//anchors.horizontalCenter: parent.horizontalCenter;
553
text: i18n.tr("<b>Sudoku settings</b>")
556
ListItem.ValueSelector {
557
objectName: "difficultySelector"
558
id: difficultySelector
559
text: i18n.tr("Difficulty")
560
values: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard")]
561
onSelectedIndexChanged: {
562
//print(difficultySelector.selectedIndex)
563
switch(difficultySelector.selectedIndex) {
565
var randomnumber = Math.floor(Math.random()*9);
567
sudokuBlocksGrid.createNewGame(81 - randomnumber);
568
Settings.setSetting("Difficulty", selectedIndex)
571
var randomnumber = Math.floor(Math.random()*4);
573
sudokuBlocksGrid.createNewGame(81 - randomnumber);
574
Settings.setSetting("Difficulty", selectedIndex)
577
var randomnumber = Math.floor(Math.random()*4);
579
sudokuBlocksGrid.createNewGame(81 - randomnumber);
580
Settings.setSetting("Difficulty", selectedIndex)
583
var randomnumber = Math.floor(Math.random()*3);
585
sudokuBlocksGrid.createNewGame(81 - randomnumber);
586
Settings.setSetting("Difficulty", selectedIndex)
592
ListItem.ValueSelector {
594
text: i18n.tr("Theme")
595
values: ["UbuntuColours", "Simple"]
596
onSelectedIndexChanged: {
597
var newColorScheme = null;
598
if (selectedIndex == 0)
601
var result = Settings.setSetting("ColorTheme", selectedIndex);
603
sudokuBlocksGrid.changeColorScheme("ColorSchemeUbuntu.qml");
605
if (selectedIndex == 1)
608
var result = Settings.setSetting("ColorTheme", selectedIndex);
610
sudokuBlocksGrid.changeColorScheme("ColorSchemeSimple.qml");
616
objectName: "hintsSwitchClickable"
617
text: i18n.tr("Hints")
620
objectName: "hintsSwitch"
622
anchors.horizontalCenter: parent.horizontalCenter
623
anchors.verticalCenter: parent.verticalCenter
624
checked: disableHintsChecked
626
var result = Settings.setSetting("DisableHints", checked ? "true":"false");
632
text: i18n.tr("<b>Profiles settings</b>")
634
ListItem.SingleValue {
635
text: "Current profile"
638
if(currentUserId==-1)
639
return i18n.tr("None")
641
return Settings.getUserFirstName(currentUserId)+" "+Settings.getUserLastName(currentUserId);
647
var allProfiles = new Array();
648
allProfiles = Settings.getAllProfiles()
650
profilesModel.clear()
652
for(var i = 0; i < allProfiles.length; i++)
654
profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname})
656
PopupUtils.open(profileSelector, selectorProfile)
665
id:manageProfileDialog
669
ListItem.SingleValue {
671
text: i18n.tr("Add profile")
673
PopupUtils.open(addProfileDialog, addSingleValue);
677
ListItem.SingleValue {
678
id:manageProfileSingleValue
679
text: i18n.tr("Manage profiles")
682
var allProfiles = new Array();
683
allProfiles = Settings.getAllProfiles()
685
profilesModel.clear()
687
for(var i = 0; i < allProfiles.length; i++)
689
profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname})
692
PopupUtils.open(manageProfileSelector, manageProfileSingleValue)
705
objectName: "aboutTab"
706
title: i18n.tr("About")
712
//anchors.fill: parent
713
anchors.horizontalCenter: parent.horizontalCenter;
716
objectName: "aboutImage"
717
property real maxWidth: units.gu(100)
606
718
anchors.horizontalCenter: parent.horizontalCenter
607
anchors.verticalCenter: parent.verticalCenter
608
checked: disableHintsChecked
610
var result = Settings.setSetting("DisableHints", checked ? "true":"false");
616
text: i18n.tr("<b>Profiles settings</b>")
618
ListItem.SingleValue {
619
text: "Current profile"
622
if(currentUserId==-1)
623
return i18n.tr("None")
625
return Settings.getUserFirstName(currentUserId)+" "+Settings.getUserLastName(currentUserId);
631
var allProfiles = new Array();
632
allProfiles = Settings.getAllProfiles()
634
profilesModel.clear()
636
for(var i = 0; i < allProfiles.length; i++)
638
profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname})
640
PopupUtils.open(profileSelector, selectorProfile)
649
id:manageProfileDialog
653
ListItem.SingleValue {
655
text: i18n.tr("Add profile")
657
PopupUtils.open(addProfileDialog, addSingleValue);
661
ListItem.SingleValue {
662
id:manageProfileSingleValue
663
text: i18n.tr("Manage profiles")
666
var allProfiles = new Array();
667
allProfiles = Settings.getAllProfiles()
669
profilesModel.clear()
671
for(var i = 0; i < allProfiles.length; i++)
673
profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname})
676
PopupUtils.open(manageProfileSelector, manageProfileSingleValue)
689
objectName: "aboutTab"
690
title: i18n.tr("About")
696
//anchors.fill: parent
697
anchors.horizontalCenter: parent.horizontalCenter;
700
objectName: "aboutImage"
701
property real maxWidth: units.gu(100)
702
anchors.horizontalCenter: parent.horizontalCenter
703
width: Math.min(mainView.width, maxWidth)/1.75
705
source: "icons/sudoko-vector-about.svg"
707
fillMode: Image.PreserveAspectFit
711
//anchors.horizontalCenter: parent.horizontalCenter;
712
anchors.left: aboutColumn.left
714
objectName: "authorLabel"
715
text: i18n.tr("Author(s): ")
719
objectName: "authors"
721
text: "Dinko Osmankovic\nFr\u00e9d\u00e9ric Delgado\nGeorgi Karavasilev"
725
anchors.horizontalCenter: parent.horizontalCenter;
727
objectName: "contactLabel"
728
text: i18n.tr("Contact: ")
731
objectName: "contacts"
733
text: "Dinko Osmankovic\nFrédéric Delgado\nGeorgi Karavasilev"
738
anchors.horizontalCenter: parent.horizontalCenter;
740
objectName: "urlLabel"
742
text: "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>"
743
onLinkActivated: Qt.openUrlExternally(link)
748
anchors.horizontalCenter: parent.horizontalCenter;
749
anchors.top: aboutColumn.bottom;
750
anchors.topMargin: units.gu(5);
752
objectName: "versionLabel"
753
text: i18n.tr("Version: ")
756
objectName: "version"
762
anchors.horizontalCenter: parent.horizontalCenter;
763
anchors.top: aboutColumn.bottom;
764
anchors.topMargin: units.gu(8);
766
objectName: "yearLabel"
719
width: Math.min(mainView.width, maxWidth)/1.75
721
source: "icons/sudoko-vector-about.svg"
723
fillMode: Image.PreserveAspectFit
727
//anchors.horizontalCenter: parent.horizontalCenter;
728
anchors.left: aboutColumn.left
730
objectName: "authorLabel"
731
text: i18n.tr("Author(s): ")
735
objectName: "authors"
737
text: "Dinko Osmankovic\nFr\u00e9d\u00e9ric Delgado\nGeorgi Karavasilev"
741
anchors.horizontalCenter: parent.horizontalCenter;
743
objectName: "contactLabel"
744
text: i18n.tr("Contact: ")
747
objectName: "contacts"
749
text: "Dinko Osmankovic\nFrédéric Delgado\nGeorgi Karavasilev"
754
anchors.horizontalCenter: parent.horizontalCenter;
756
objectName: "urlLabel"
758
text: "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>"
759
onLinkActivated: Qt.openUrlExternally(link)
764
anchors.horizontalCenter: parent.horizontalCenter;
765
anchors.top: aboutColumn.bottom;
766
anchors.topMargin: units.gu(5);
768
objectName: "versionLabel"
769
text: i18n.tr("Version: ")
772
objectName: "version"
778
anchors.horizontalCenter: parent.horizontalCenter;
779
anchors.top: aboutColumn.bottom;
780
anchors.topMargin: units.gu(8);
782
objectName: "yearLabel"