diff --git a/eink.qrc b/eink.qrc index b1d55db..739e06a 100644 --- a/eink.qrc +++ b/eink.qrc @@ -74,5 +74,6 @@ resources/clock-inverted.png resources/clock.png resources/eink-square-encfs.qss + resources/tzlist diff --git a/resources/tzlist b/resources/tzlist new file mode 100644 index 0000000..af83384 --- /dev/null +++ b/resources/tzlist @@ -0,0 +1,595 @@ +Pacific/Palau +Pacific/Nauru +Pacific/Auckland +Pacific/Port_Moresby +Pacific/Gambier +Pacific/Saipan +Pacific/Fakaofo +Pacific/Guadalcanal +Pacific/Truk +Pacific/Pago_Pago +Pacific/Bougainville +Pacific/Samoa +Pacific/Easter +Pacific/Tarawa +Pacific/Kosrae +Pacific/Apia +Pacific/Efate +Pacific/Fiji +Pacific/Wake +Pacific/Wallis +Pacific/Tahiti +Pacific/Chatham +Pacific/Guam +Pacific/Funafuti +Pacific/Kwajalein +Pacific/Rarotonga +Pacific/Galapagos +Pacific/Kiritimati +Pacific/Tongatapu +Pacific/Majuro +Pacific/Yap +Pacific/Niue +Pacific/Honolulu +Pacific/Pitcairn +Pacific/Ponape +Pacific/Marquesas +Pacific/Chuuk +Pacific/Enderbury +Pacific/Noumea +Pacific/Johnston +Pacific/Midway +Pacific/Norfolk +Pacific/Pohnpei +Arctic/Longyearbyen +PRC +Singapore +Australia/Yancowinna +Australia/LHI +Australia/Melbourne +Australia/Tasmania +Australia/Broken_Hill +Australia/Adelaide +Australia/Currie +Australia/North +Australia/Hobart +Australia/Eucla +Australia/ACT +Australia/Lord_Howe +Australia/Queensland +Australia/Brisbane +Australia/Canberra +Australia/Sydney +Australia/Perth +Australia/South +Australia/Lindeman +Australia/West +Australia/NSW +Australia/Darwin +Australia/Victoria +Greenwich +Atlantic/South_Georgia +Atlantic/Stanley +Atlantic/Cape_Verde +Atlantic/Madeira +Atlantic/Faeroe +Atlantic/Bermuda +Atlantic/St_Helena +Atlantic/Faroe +Atlantic/Jan_Mayen +Atlantic/Azores +Atlantic/Canary +Atlantic/Reykjavik +GMT-0 +GB +UTC +Africa/El_Aaiun +Africa/Nairobi +Africa/Maputo +Africa/Algiers +Africa/Bangui +Africa/Niamey +Africa/Juba +Africa/Ceuta +Africa/Maseru +Africa/Asmara +Africa/Kinshasa +Africa/Windhoek +Africa/Bamako +Africa/Mbabane +Africa/Asmera +Africa/Freetown +Africa/Conakry +Africa/Gaborone +Africa/Ndjamena +Africa/Khartoum +Africa/Ouagadougou +Africa/Luanda +Africa/Libreville +Africa/Tripoli +Africa/Timbuktu +Africa/Bujumbura +Africa/Porto-Novo +Africa/Monrovia +Africa/Abidjan +Africa/Casablanca +Africa/Lusaka +Africa/Nouakchott +Africa/Dakar +Africa/Lome +Africa/Addis_Ababa +Africa/Cairo +Africa/Blantyre +Africa/Johannesburg +Africa/Banjul +Africa/Sao_Tome +Africa/Tunis +Africa/Mogadishu +Africa/Malabo +Africa/Douala +Africa/Bissau +Africa/Lubumbashi +Africa/Harare +Africa/Accra +Africa/Brazzaville +Africa/Lagos +Africa/Dar_es_Salaam +Africa/Kigali +Africa/Djibouti +Africa/Kampala +CET +EST +EST5EDT +US/Alaska +US/Pacific +US/Indiana-Starke +US/Eastern +US/Central +US/Arizona +US/Samoa +US/Michigan +US/Mountain +US/East-Indiana +US/Hawaii +US/Aleutian +Israel +EET +Etc/GMT+10 +Etc/GMT+11 +Etc/GMT+12 +Etc/Greenwich +Etc/GMT-0 +Etc/GMT-10 +Etc/GMT-1 +Etc/GMT-11 +Etc/GMT-12 +Etc/GMT-2 +Etc/GMT-13 +Etc/GMT-3 +Etc/GMT-14 +Etc/GMT-4 +Etc/GMT-5 +Etc/GMT-6 +Etc/GMT-7 +Etc/GMT-8 +Etc/UTC +Etc/GMT-9 +Etc/Universal +Etc/GMT0 +Etc/Zulu +Etc/GMT+0 +Etc/GMT+1 +Etc/GMT +Etc/GMT+2 +Etc/GMT+3 +Etc/GMT+4 +Etc/GMT+5 +Etc/GMT+6 +Etc/GMT+7 +Etc/GMT+8 +Etc/GMT+9 +Etc/UCT +Universal +Brazil/DeNoronha +Brazil/East +Brazil/Acre +Brazil/West +posixrules +Poland +Jamaica +GMT0 +Mexico/BajaSur +Mexico/General +Mexico/BajaNorte +MST +Cuba +MET +NZ-CHAT +America/Atka +America/Mexico_City +America/Juneau +America/St_Barthelemy +America/St_Thomas +America/Montserrat +America/Cordoba +America/Dominica +America/Montreal +America/North_Dakota/Center +America/North_Dakota/New_Salem +America/North_Dakota/Beulah +America/Boa_Vista +America/Nassau +America/Scoresbysund +America/Thule +America/St_Johns +America/Kralendijk +America/Punta_Arenas +America/Tortola +America/Cancun +America/Shiprock +America/Menominee +America/Rainy_River +America/Blanc-Sablon +America/Toronto +America/Porto_Velho +America/Argentina/Cordoba +America/Argentina/Tucuman +America/Argentina/La_Rioja +America/Argentina/ComodRivadavia +America/Argentina/Catamarca +America/Argentina/Buenos_Aires +America/Argentina/Rio_Gallegos +America/Argentina/Salta +America/Argentina/Mendoza +America/Argentina/Ushuaia +America/Argentina/San_Juan +America/Argentina/Jujuy +America/Argentina/San_Luis +America/Rio_Branco +America/Grenada +America/Louisville +America/Cayman +America/Halifax +America/Santo_Domingo +America/Martinique +America/Campo_Grande +America/Marigot +America/Phoenix +America/Moncton +America/Port_of_Spain +America/Porto_Acre +America/Port-au-Prince +America/Nipigon +America/Inuvik +America/Paramaribo +America/Knox_IN +America/Araguaina +America/Rankin_Inlet +America/Cayenne +America/Belize +America/Indiana/Winamac +America/Indiana/Petersburg +America/Indiana/Vincennes +America/Indiana/Marengo +America/Indiana/Tell_City +America/Indiana/Vevay +America/Indiana/Knox +America/Indiana/Indianapolis +America/Merida +America/Jamaica +America/Santarem +America/Guayaquil +America/Cambridge_Bay +America/Catamarca +America/Creston +America/Mazatlan +America/Guatemala +America/New_York +America/Panama +America/Dawson +America/Swift_Current +America/Los_Angeles +America/Fort_Nelson +America/Sitka +America/Matamoros +America/Tijuana +America/St_Vincent +America/Yakutat +America/Anchorage +America/Cuiaba +America/Guyana +America/Havana +America/Glace_Bay +America/Metlakatla +America/St_Kitts +America/Lima +America/Pangnirtung +America/Buenos_Aires +America/Barbados +America/Detroit +America/Belem +America/Bahia_Banderas +America/Managua +America/Ojinaga +America/Nome +America/Asuncion +America/Yellowknife +America/Chicago +America/Boise +America/Curacao +America/Thunder_Bay +America/Danmarkshavn +America/Winnipeg +America/Denver +America/Goose_Bay +America/Resolute +America/Costa_Rica +America/Caracas +America/Antigua +America/Manaus +America/Maceio +America/Fortaleza +America/Bahia +America/Mendoza +America/Recife +America/Ensenada +America/Sao_Paulo +America/Bogota +America/La_Paz +America/Chihuahua +America/Vancouver +America/Fort_Wayne +America/Eirunepe +America/Anguilla +America/Santa_Isabel +America/Monterrey +America/Puerto_Rico +America/Godthab +America/Kentucky/Louisville +America/Kentucky/Monticello +America/Tegucigalpa +America/Regina +America/Lower_Princes +America/Rosario +America/Guadeloupe +America/St_Lucia +America/Dawson_Creek +America/Santiago +America/Coral_Harbour +America/Whitehorse +America/Jujuy +America/Hermosillo +America/Virgin +America/Indianapolis +America/Montevideo +America/Miquelon +America/El_Salvador +America/Grand_Turk +America/Noronha +America/Iqaluit +America/Nuuk +America/Aruba +America/Adak +America/Edmonton +America/Atikokan +Europe/Dublin +Europe/Amsterdam +Europe/Helsinki +Europe/Astrakhan +Europe/Tallinn +Europe/Bucharest +Europe/Tiraspol +Europe/Zurich +Europe/Gibraltar +Europe/Vatican +Europe/Simferopol +Europe/Jersey +Europe/Madrid +Europe/Brussels +Europe/Ulyanovsk +Europe/Budapest +Europe/Nicosia +Europe/Berlin +Europe/Volgograd +Europe/Belfast +Europe/Luxembourg +Europe/Chisinau +Europe/Podgorica +Europe/Vaduz +Europe/Isle_of_Man +Europe/Paris +Europe/Kiev +Europe/Rome +Europe/Ljubljana +Europe/Busingen +Europe/London +Europe/Istanbul +Europe/Sofia +Europe/Stockholm +Europe/Mariehamn +Europe/Uzhgorod +Europe/Lisbon +Europe/Samara +Europe/Monaco +Europe/Kaliningrad +Europe/Malta +Europe/Tirane +Europe/Prague +Europe/Minsk +Europe/Vilnius +Europe/Warsaw +Europe/Riga +Europe/Guernsey +Europe/Bratislava +Europe/Zagreb +Europe/Athens +Europe/Copenhagen +Europe/Andorra +Europe/San_Marino +Europe/Skopje +Europe/Vienna +Europe/Moscow +Europe/Oslo +Europe/Zaporozhye +Europe/Belgrade +Europe/Saratov +Europe/Kirov +Europe/Sarajevo +Zulu +WET +Portugal +GMT+0 +MST7MDT +GMT +Chile/Continental +Chile/EasterIsland +Turkey +Factory +CST6CDT +Kwajalein +Canada/Pacific +Canada/Newfoundland +Canada/Eastern +Canada/Atlantic +Canada/Central +Canada/Yukon +Canada/Saskatchewan +Canada/Mountain +W-SU +Egypt +ROC +Eire +Navajo +Libya +GB-Eire +ROK +Antarctica/McMurdo +Antarctica/Rothera +Antarctica/Macquarie +Antarctica/Palmer +Antarctica/South_Pole +Antarctica/Davis +Antarctica/DumontDUrville +Antarctica/Casey +Antarctica/Troll +Antarctica/Syowa +Antarctica/Mawson +Antarctica/Vostok +HST +NZ +Hongkong +Japan +Iran +PST8PDT +Asia/Jayapura +Asia/Srednekolymsk +Asia/Aqtobe +Asia/Qyzylorda +Asia/Urumqi +Asia/Dushanbe +Asia/Dili +Asia/Tel_Aviv +Asia/Macao +Asia/Singapore +Asia/Kuching +Asia/Macau +Asia/Aden +Asia/Qostanay +Asia/Beirut +Asia/Dubai +Asia/Brunei +Asia/Kathmandu +Asia/Omsk +Asia/Rangoon +Asia/Tbilisi +Asia/Tomsk +Asia/Taipei +Asia/Harbin +Asia/Nicosia +Asia/Baku +Asia/Ulaanbaatar +Asia/Makassar +Asia/Karachi +Asia/Amman +Asia/Vladivostok +Asia/Magadan +Asia/Riyadh +Asia/Sakhalin +Asia/Tehran +Asia/Pontianak +Asia/Qatar +Asia/Ashgabat +Asia/Katmandu +Asia/Istanbul +Asia/Ulan_Bator +Asia/Thimbu +Asia/Saigon +Asia/Ujung_Pandang +Asia/Barnaul +Asia/Jerusalem +Asia/Almaty +Asia/Famagusta +Asia/Yakutsk +Asia/Thimphu +Asia/Khandyga +Asia/Yangon +Asia/Atyrau +Asia/Manila +Asia/Colombo +Asia/Novosibirsk +Asia/Kamchatka +Asia/Krasnoyarsk +Asia/Pyongyang +Asia/Ashkhabad +Asia/Yerevan +Asia/Ust-Nera +Asia/Bangkok +Asia/Samarkand +Asia/Bahrain +Asia/Kuala_Lumpur +Asia/Phnom_Penh +Asia/Kabul +Asia/Oral +Asia/Chungking +Asia/Ho_Chi_Minh +Asia/Hong_Kong +Asia/Jakarta +Asia/Damascus +Asia/Chongqing +Asia/Gaza +Asia/Vientiane +Asia/Choibalsan +Asia/Aqtau +Asia/Hovd +Asia/Irkutsk +Asia/Kolkata +Asia/Chita +Asia/Yekaterinburg +Asia/Tashkent +Asia/Seoul +Asia/Baghdad +Asia/Muscat +Asia/Kuwait +Asia/Tokyo +Asia/Anadyr +Asia/Calcutta +Asia/Kashgar +Asia/Dhaka +Asia/Dacca +Asia/Bishkek +Asia/Novokuznetsk +Asia/Shanghai +Asia/Hebron +Indian/Chagos +Indian/Christmas +Indian/Comoro +Indian/Maldives +Indian/Mahe +Indian/Reunion +Indian/Mayotte +Indian/Antananarivo +Indian/Cocos +Indian/Mauritius +Indian/Kerguelen +UCT +Iceland diff --git a/settings.cpp b/settings.cpp index 8c0f34a..da03c0a 100644 --- a/settings.cpp +++ b/settings.cpp @@ -25,6 +25,7 @@ settings::settings(QWidget *parent) : ui->setupUi(this); settings::setFont(QFont("u001")); ui->comboBox->setFont(QFont("u001")); + ui->tzComboBox->setFont(QFont("u001")); ui->sleepTimeoutComboBox->setFont(QFont("u001")); ui->aboutBtn->setFont(QFont("u001")); ui->okBtn->setFont(QFont("Inter")); @@ -53,6 +54,7 @@ settings::settings(QWidget *parent) : ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt"); ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt"); ui->comboBox->setStyleSheet("font-size: 9pt"); + ui->tzComboBox->setStyleSheet("font-size: 9pt"); ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt"); ui->setPasscodeBtn->setStyleSheet("font-size: 9pt"); ui->repackBtn->setStyleSheet("font-size: 9pt"); @@ -334,6 +336,16 @@ settings::settings(QWidget *parent) : ui->enableUiScalingCheckBox->click(); } + timezone_not_user_change = true; + ui->tzComboBox->addItems(QStringList(readFile(":/resources/tzlist").split("\n", Qt::SkipEmptyParts))); + // Timezone + if(readFile(".config/19-timezone/config-name").isEmpty()) { + ui->tzComboBox->setCurrentText("UTC"); + } + else { + ui->tzComboBox->setCurrentText(readFile(".config/19-timezone/config-name")); + } + if(checkconfig("/opt/inkbox_genuine") == true) { // Enforcing security policy if the user has not rooted the device if(checkconfig("/external_root/opt/root/rooted") == true) { @@ -999,3 +1011,18 @@ void settings::on_generateSystemReportBtn_clicked() } } } + +void settings::on_tzComboBox_currentTextChanged(const QString &arg1) +{ + if(timezone_not_user_change == true) { + timezone_not_user_change = false; + } + else { + setDefaultWorkDir(); + // Preventing unnecessary (e)MMC writes + if(readFile(".config/19-timezone/config-name") != arg1) { + QProcess::execute("ln", QStringList() << "-sf" << "/usr/share/zoneinfo/" + arg1 << ".config/19-timezone/config"); + string_writeconfig(".config/19-timezone/config-name", arg1.toStdString()); + } + } +} diff --git a/settings.h b/settings.h index 9acc77c..16fa198 100644 --- a/settings.h +++ b/settings.h @@ -24,6 +24,7 @@ public: bool ui_enable_changed = false; bool ui_not_user_change = false; bool not_user_change = true; + bool timezone_not_user_change = true; bool enableEncryptedStorageUserChange = false; explicit settings(QWidget *parent = nullptr); @@ -68,8 +69,8 @@ private slots: void disableStorageEncryption(); void cancelDisableStorageEncryption(); void on_repackBtn_clicked(); - void on_generateSystemReportBtn_clicked(); + void on_tzComboBox_currentTextChanged(const QString &arg1); signals: void showToast(QString messageToDisplay); diff --git a/settings.ui b/settings.ui index b6884cf..4c0f435 100644 --- a/settings.ui +++ b/settings.ui @@ -529,10 +529,176 @@ 0 - - + + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + 0 + + + + + Reset this device + + + + + + + + 75 + true + + + + Reset + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + - Enable night mode + Enable lock screen and passcode + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + + + + Set + + + + + + + Set a passcode + + + + + + + + + 0 + + + + + Check for updates + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + + + + Check + + + + + + + + + + Chivo + true + + + + System + + + + + + + + Chivo + true + + + + Storage encryption + + + + + + + QFrame::Plain + + + Qt::Horizontal @@ -588,25 +754,131 @@ - - - - Enable + + + + 0 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Update InkBox + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 75 + true + + + + Update + + + + - - - - - Chivo - true - + + + + 0 - - Storage encryption + + 0 - + + + + System info + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + + + + Show + + + + + + + + + 0 + + + + + + 75 + true + + + + Generate + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Generate system report + + + + @@ -677,315 +949,6 @@ - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - - Chivo - true - - - - System - - - - - - - Enable lock screen and passcode - - - - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - 0 - - - 0 - - - - - System info - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - Show - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - Set - - - - - - - Set a passcode - - - - - - - - - 0 - - - - - Check for updates - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - Check - - - - - - - - - - Chivo - true - - - - Security - - - - - - - 0 - - - - - Reset this device - - - - - - - - 75 - true - - - - Reset - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - - - - 75 - true - - - - Generate - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Generate system report - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Update InkBox - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 75 - true - - - - Update - - - - - - - - - QFrame::Plain - - - Qt::Horizontal - - - @@ -993,7 +956,27 @@ - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Enable night mode + + + + 0 @@ -1033,18 +1016,65 @@ - - + + + + + Chivo + true + + + + Security + + + + + + + QFrame::Plain + - Qt::Vertical + Qt::Horizontal - - - 20 - 40 - + + + + + + Enable - + + + + + + 0 + + + + + Timezone + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + +