diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb757d1cd..bbfd83c02 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -496,6 +496,7 @@ set(APP_TRANSLATIONS
localization/rssguard-cs_CZ.ts
localization/rssguard-de_DE.ts
localization/rssguard-en_GB.ts
+ localization/rssguard-en_US.ts
localization/rssguard-fr_FR.ts
localization/rssguard-it_IT.ts
localization/rssguard-nl_NL.ts
@@ -510,6 +511,7 @@ set(APP_TRANSLATIONS_WO_QT
localization/rssguard-cs_CZ.ts
localization/rssguard-de_DE.ts
localization/rssguard-en_GB.ts
+ localization/rssguard-en_US.ts
localization/rssguard-fr_FR.ts
localization/rssguard-it_IT.ts
localization/rssguard-nl_NL.ts
diff --git a/localization/rssguard-cs_CZ.ts b/localization/rssguard-cs_CZ.ts
index d6d52dd6f..3e4b945ba 100644
--- a/localization/rssguard-cs_CZ.ts
+++ b/localization/rssguard-cs_CZ.ts
@@ -394,6 +394,82 @@ Automatický update: %5
ČÁSTEČNĚ portable
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nastavení
+
+
+
+
+
+
+
+ Výsledky operací
+
+
+
+
+
+
+
+ Doposud neprovedena žádná operace.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1251,6 +1327,69 @@ Automatický update: %5
&Restartovat
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+ Výsledky operací
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Doposud neprovedena žádná operace.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1812,6 +1951,18 @@ Musíte restartovat manuálně.
Chcete restartovat nyní?
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -2231,6 +2382,17 @@ Přejít na web aplikace a stáhnout jej ručně.
Přepnout režim okna aplikace rovnou z ikonky ve stavovém pruhu.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/localization/rssguard-de_DE.ts b/localization/rssguard-de_DE.ts
index e1d7f4f73..4b4b2d0c4 100644
--- a/localization/rssguard-de_DE.ts
+++ b/localization/rssguard-de_DE.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
Titel der Feeds/Kategorien.
+ Feed list header "counts" column tooltip.
Anzahl ungelesener/aller Nachrichten.
@@ -382,6 +384,82 @@ Auto-update status: %5
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Einstellungen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1239,6 +1317,69 @@ Auto-update status: %5
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1265,7 +1406,9 @@ Auto-update status: %5
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
Sprache
@@ -1323,10 +1466,12 @@ Auto-update status: %5
+ Lang. code column of language list.
Code
+ Version column of skin list.
Version
@@ -1404,6 +1549,7 @@ Auto-update status: %5
+ Skin list name column.
Name
@@ -1777,6 +1923,18 @@ You have to restart manually.
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -1920,42 +2078,52 @@ Go to application website to obtain it manually.
MessagesModel
+ Tooltip for ID of message.
ID
+ Tooltip for "read" column in msg list.
Lesen
+ Tooltip for "deleted" column in msg list.
Gelöscht
+ Tooltip for "important" column in msg list.
Wichtig
+ Tooltip for name of feed for message.
Feed
+ Tooltip for title of message.
Titel
+ Tooltip for url of message.
Url
+ Tooltip for author of message.
Author
+ Tooltip for creation date of message.
Erstellt am
+ Tooltip for contents of message.
Inhalt
@@ -2188,6 +2356,17 @@ Go to application website to obtain it manually.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/localization/rssguard-en_GB.ts b/localization/rssguard-en_GB.ts
index 991b0db86..ab49081cf 100644
--- a/localization/rssguard-en_GB.ts
+++ b/localization/rssguard-en_GB.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
+ Feed list header "counts" column tooltip.
@@ -382,6 +384,82 @@ Auto-update status: %5
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1239,6 +1317,69 @@ Auto-update status: %5
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1265,7 +1406,9 @@ Auto-update status: %5
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
@@ -1323,10 +1466,12 @@ Auto-update status: %5
+ Lang. code column of language list.
+ Version column of skin list.
@@ -1404,6 +1549,7 @@ Auto-update status: %5
+ Skin list name column.
@@ -1775,6 +1921,18 @@ You have to restart manually.
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -1915,42 +2073,52 @@ Go to application website to obtain it manually.
MessagesModel
+ Tooltip for ID of message.
+ Tooltip for "read" column in msg list.
+ Tooltip for "deleted" column in msg list.
+ Tooltip for "important" column in msg list.
+ Tooltip for name of feed for message.
+ Tooltip for title of message.
+ Tooltip for url of message.
+ Tooltip for author of message.
+ Tooltip for creation date of message.
+ Tooltip for contents of message.
@@ -2183,6 +2351,17 @@ Go to application website to obtain it manually.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/localization/rssguard-en_US.ts b/localization/rssguard-en_US.ts
index a62731bc8..ae15c92fc 100644
--- a/localization/rssguard-en_US.ts
+++ b/localization/rssguard-en_US.ts
@@ -1,6 +1,6 @@
-
+
Application
diff --git a/localization/rssguard-fr_FR.ts b/localization/rssguard-fr_FR.ts
index 49ab9c959..31239a82b 100644
--- a/localization/rssguard-fr_FR.ts
+++ b/localization/rssguard-fr_FR.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -78,11 +78,11 @@
FeedsImportExportModel
-
+ (catégorie)
-
+ (flux)
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
Titres des flux/catégories.
+ Feed list header "counts" column tooltip.
Nombre des messages lus/non-lus.
@@ -123,15 +125,15 @@
Tooltip for "unread" column of feed list.
-
-
-
+
+ %n message(s) non lu(s).
+ %n message(s) non lu(s).
Tooltip for standard feed.
-
+ %1 (catégorie)%2%3
Tooltip for "unread" column of feed list.
-
+ %n message(s) non lu(s).
@@ -181,7 +183,7 @@ Auto-update status: %5
FeedsModelRecycleBin
-
+ Poubelle
@@ -190,7 +192,8 @@ Auto-update status: %5
-
+ Corbeille
+%1
@@ -359,7 +362,7 @@ Auto-update status: %5
-
+ Chemins
@@ -382,6 +385,82 @@ Auto-update status: %5
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Paramètres
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -410,7 +489,7 @@ Auto-update status: %5
-
+ Ajouter une nouvelle catégorie
@@ -594,7 +673,7 @@ Auto-update status: %5
-
+ Ajouter un nouveau flux
@@ -810,7 +889,7 @@ Auto-update status: %5
-
+ Fichier source
@@ -818,11 +897,11 @@ Auto-update status: %5
-
+ Importer des flux
-
+ Fichier OPML 2.0 (*.opml)
@@ -830,7 +909,7 @@ Auto-update status: %5
-
+ Le fichier est sélectionné
@@ -862,7 +941,7 @@ Auto-update status: %5
-
+ Erreur critique rencontrée
@@ -1157,19 +1236,19 @@ Auto-update status: %5
-
+ Nouveau &flux
-
+ Ajouter un nouveau flux
-
+ Nouvelle &catégorie
-
+ Ajouter une nouvelle catégorie
@@ -1205,7 +1284,7 @@ Auto-update status: %5
-
+ &Corbeille
@@ -1217,7 +1296,7 @@ Auto-update status: %5
-
+ &Donner via PayPal
@@ -1237,6 +1316,69 @@ Auto-update status: %5
+ &Redémarrer
+
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1265,7 +1407,9 @@ Auto-update status: %5
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
Langage
@@ -1323,10 +1467,12 @@ Auto-update status: %5
+ Lang. code column of language list.
Code
+ Version column of skin list.
Version
@@ -1404,6 +1550,7 @@ Auto-update status: %5
+ Skin list name column.
Nom
@@ -1791,6 +1938,18 @@ You have to restart manually.
+ Voulez vous redémarrer maintenant ?
+
+
+
+
+
+
+
+
+
+
+
@@ -1907,11 +2066,11 @@ Aller sur le site de l'application pour les obtenir manuellement.
-
+ Installer la mise à jour
-
+ Erreur rencontrée
@@ -1923,7 +2082,7 @@ Aller sur le site de l'application pour les obtenir manuellement.
-
+ Aller sur le site web de l'application
@@ -1937,42 +2096,52 @@ Aller sur le site de l'application pour les obtenir manuellement.MessagesModel
+ Tooltip for ID of message.
Id
+ Tooltip for "read" column in msg list.
Lire
+ Tooltip for "deleted" column in msg list.
Supprimé
+ Tooltip for "important" column in msg list.
Important
+ Tooltip for name of feed for message.
Flux
+ Tooltip for title of message.
Titre
+ Tooltip for url of message.
Url
+ Tooltip for author of message.
Auteur
+ Tooltip for creation date of message.
Crée sur
+ Tooltip for contents of message.
Contenus
@@ -2044,7 +2213,7 @@ Aller sur le site de l'application pour les obtenir manuellement.
-
+ Afficher tout les messages
@@ -2148,7 +2317,7 @@ Aller sur le site de l'application pour les obtenir manuellement.
Network status.
-
+ Pas d'erreurs
@@ -2205,6 +2374,17 @@ Aller sur le site de l'application pour les obtenir manuellement.Changer l'état de l'application entre plein écran/normal depuis l'icône de la barre des status.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
@@ -2245,7 +2425,7 @@ Unread news: %2
-
+ Menu principal
@@ -2260,7 +2440,7 @@ Unread news: %2
-
+ Actions possibles
diff --git a/localization/rssguard-it_IT.ts b/localization/rssguard-it_IT.ts
index 852331a5b..c6c1a86bb 100644
--- a/localization/rssguard-it_IT.ts
+++ b/localization/rssguard-it_IT.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
Titoli dei feed/categorie.
+ Feed list header "counts" column tooltip.
Conteggio dei messaggi non letti/tutti.
@@ -382,6 +384,82 @@ Auto-update status: %5
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Impostazioni
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1239,6 +1317,69 @@ Auto-update status: %5
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1265,7 +1406,9 @@ Auto-update status: %5
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
Lingua
@@ -1323,10 +1466,12 @@ Auto-update status: %5
+ Lang. code column of language list.
Codice
+ Version column of skin list.
Versione
@@ -1404,6 +1549,7 @@ Auto-update status: %5
+ Skin list name column.
Nome
@@ -1777,6 +1923,18 @@ You have to restart manually.
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -1920,42 +2078,52 @@ Go to application website to obtain it manually.
MessagesModel
+ Tooltip for ID of message.
Id
+ Tooltip for "read" column in msg list.
Leggi
+ Tooltip for "deleted" column in msg list.
Eliminato
+ Tooltip for "important" column in msg list.
Importante
+ Tooltip for name of feed for message.
Feed
+ Tooltip for title of message.
Titolo
+ Tooltip for url of message.
Url
+ Tooltip for author of message.
Autore
+ Tooltip for creation date of message.
Creato il
+ Tooltip for contents of message.
Contenuti
@@ -2188,6 +2356,17 @@ Go to application website to obtain it manually.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/localization/rssguard-nl_NL.ts b/localization/rssguard-nl_NL.ts
index be9fd9ef8..f85076cea 100644
--- a/localization/rssguard-nl_NL.ts
+++ b/localization/rssguard-nl_NL.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
Naam van feeds/categorieën.
+ Feed list header "counts" column tooltip.
Aantal van alle ongelezen berichten.
@@ -382,6 +384,82 @@ Auto-update status: %5
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instellingen
+
+
+
+
+
+
+
+ Resultaten
+
+
+
+
+
+
+
+ Nog geen handeling uitgevoerd.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1240,6 +1318,69 @@ Exporteer feeds die je wilt van het geselecteerde bestand.
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+ Resultaten
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nog geen handeling uitgevoerd.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1266,7 +1407,9 @@ Exporteer feeds die je wilt van het geselecteerde bestand.
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
Taal
@@ -1324,10 +1467,12 @@ Exporteer feeds die je wilt van het geselecteerde bestand.
+ Lang. code column of language list.
Code
+ Version column of skin list.
Versie
@@ -1405,6 +1550,7 @@ Exporteer feeds die je wilt van het geselecteerde bestand.
+ Skin list name column.
Naam
@@ -1797,6 +1943,18 @@ Je moet handmatig herstarten.
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -1941,42 +2099,52 @@ Ga naar RRSguard website en download het handmatig.
MessagesModel
+ Tooltip for ID of message.
ld
+ Tooltip for "read" column in msg list.
Lees
+ Tooltip for "deleted" column in msg list.
verwijder
+ Tooltip for "important" column in msg list.
Belangrijk
+ Tooltip for name of feed for message.
Feed
+ Tooltip for title of message.
Titel
+ Tooltip for url of message.
Url
+ Tooltip for author of message.
Auteur
+ Tooltip for creation date of message.
Gemaakt op
+ Tooltip for contents of message.
Inhoud
@@ -2209,6 +2377,17 @@ Ga naar RRSguard website en download het handmatig.
Wissel Rssguard tussen volledige scherm/normale staat vanaf deze statusbar pictogram.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/localization/rssguard-sv_SE.ts b/localization/rssguard-sv_SE.ts
index 8a6925ee9..66c59b447 100644
--- a/localization/rssguard-sv_SE.ts
+++ b/localization/rssguard-sv_SE.ts
@@ -1,6 +1,6 @@
-
+
Application
@@ -94,10 +94,12 @@
+ Feed list header "titles" column tooltip.
Namn på kategorier/flöden.
+ Feed list header "counts" column tooltip.
Antal meddelanden.
@@ -388,6 +390,82 @@ Uppdateringsstatus: %5
PARTIELLT portabel
+
+ FormBackupDatabaseSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Inställningar
+
+
+
+
+
+
+
+ Åtgärdsresultat
+
+
+
+
+
+
+
+ Ingen åtgärd slutförd än.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormCategoryDetails
@@ -1245,6 +1323,69 @@ Uppdateringsstatus: %5
&Starta om
+
+
+
+
+
+
+
+
+
+
+ FormRestoreDatabaseSettings
+
+
+
+
+
+
+ Åtgärdsresultat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ingen åtgärd slutförd än.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
FormSettings
@@ -1271,7 +1412,9 @@ Uppdateringsstatus: %5
- Language settings section.
+ Language settings section.
+----------
+Language column of language list.
Språk
@@ -1329,10 +1472,12 @@ Uppdateringsstatus: %5
+ Lang. code column of language list.
Språkkod
+ Version column of skin list.
Version
@@ -1410,6 +1555,7 @@ Uppdateringsstatus: %5
+ Skin list name column.
Namn
@@ -1802,6 +1948,18 @@ Du måste starta om manuellt.
+
+
+
+
+
+
+
+
+
+
+
+
FormUpdate
@@ -1945,42 +2103,52 @@ Gå till programmets hemsida för att hämta den manuellt.
MessagesModel
+ Tooltip for ID of message.
ID
+ Tooltip for "read" column in msg list.
Läst
+ Tooltip for "deleted" column in msg list.
Borttaget
+ Tooltip for "important" column in msg list.
Viktigt
+ Tooltip for name of feed for message.
Flöde
+ Tooltip for title of message.
Titel
+ Tooltip for url of message.
URL
+ Tooltip for author of message.
Författare
+ Tooltip for creation date of message.
Skapad
+ Tooltip for contents of message.
Innehåll
@@ -2213,6 +2381,17 @@ Gå till programmets hemsida för att hämta den manuellt.
Växla mellan fullskärmsläge och fönsterläge.
+
+ SystemFactory
+
+
+
+
+
+
+
+
+
SystemTrayIcon
diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index 27992ced5..5fdd3baae 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -3,7 +3,7 @@
Fixed:
-- Fixed #76, #75, #82, #79, #85 #78, #92.
+- Fixed #76, #75, #82, #79, #85 #78, #92, #93.
Added:
@@ -11,6 +11,7 @@ Added:
Settings/database can now experimentally be exported/imported.
Added Swedish localization (thanks to Åke Engelbrektson).
Parent item is now selected when adding new category/feed with that parent pre-selected in feed view.
+Message date/time format is now changeable.
Changed:
diff --git a/src/core/messagesmodel.cpp b/src/core/messagesmodel.cpp
index 20f69bb92..37faddd28 100755
--- a/src/core/messagesmodel.cpp
+++ b/src/core/messagesmodel.cpp
@@ -30,11 +30,12 @@
MessagesModel::MessagesModel(QObject *parent)
: QSqlTableModel(parent, qApp->database()->connection("MessagesModel", DatabaseFactory::FromSettings)),
- m_messageMode(MessagesFromFeeds), m_messageFilter(NoHighlighting) {
+ m_messageMode(MessagesFromFeeds), m_messageFilter(NoHighlighting), m_customDateFormat(QString()) {
setObjectName("MessagesModel");
setupFonts();
setupIcons();
setupHeaderData();
+ updateDateFormat();
// Set desired table and edit strategy.
// NOTE: Changes to the database are actually NOT submitted
@@ -106,6 +107,20 @@ int MessagesModel::messageId(int row_index) const {
return data(row_index, MSG_DB_ID_INDEX, Qt::EditRole).toInt();
}
+void MessagesModel::updateDateFormat() {
+ if (qApp->settings()->value(APP_CFG_MESSAGES, "use_custom_date").toBool()) {
+ m_customDateFormat = qApp->settings()->value(APP_CFG_MESSAGES, "custom_date_format").toString();
+ }
+ else {
+ m_customDateFormat = QString();
+ }
+}
+
+void MessagesModel::reloadWholeLayout() {
+ emit layoutAboutToBeChanged();
+ emit layoutChanged();
+}
+
Message MessagesModel::messageAt(int row_index) const {
QSqlRecord rec = record(row_index);
Message message;
@@ -157,8 +172,14 @@ QVariant MessagesModel::data(const QModelIndex &idx, int role) const {
int index_column = idx.column();
if (index_column == MSG_DB_DCREATED_INDEX) {
- return TextFactory::parseDateTime(QSqlTableModel::data(idx,
- role).value()).toLocalTime().toString(Qt::DefaultLocaleShortDate);
+ if (m_customDateFormat.isEmpty()) {
+ return TextFactory::parseDateTime(QSqlTableModel::data(idx,
+ role).value()).toLocalTime().toString(Qt::DefaultLocaleShortDate);
+
+ }
+ else {
+ return TextFactory::parseDateTime(QSqlTableModel::data(idx, role).value()).toLocalTime().toString(m_customDateFormat);
+ }
}
else if (index_column == MSG_DB_AUTHOR_INDEX) {
QString author_name = QSqlTableModel::data(idx, role).toString();
diff --git a/src/core/messagesmodel.h b/src/core/messagesmodel.h
index 1ab5b3578..882e5271a 100644
--- a/src/core/messagesmodel.h
+++ b/src/core/messagesmodel.h
@@ -80,6 +80,8 @@ class MessagesModel : public QSqlTableModel {
return m_currentFeeds;
}
+ void updateDateFormat();
+
public slots:
// To disable persistent changes submissions.
inline bool submitAll() {
@@ -87,6 +89,8 @@ class MessagesModel : public QSqlTableModel {
return false;
}
+ void reloadWholeLayout();
+
// CORE messages manipulators.
// NOTE: These are used to change properties of one message.
// NOTE: Model is NOT reset after one of these methods are applied
@@ -136,6 +140,7 @@ class MessagesModel : public QSqlTableModel {
MessageMode m_messageMode;
MessageFilter m_messageFilter;
+ QString m_customDateFormat;
QList m_currentFeeds;
QList m_headerData;
QList m_tooltipData;
diff --git a/src/gui/feedmessageviewer.h b/src/gui/feedmessageviewer.h
index 7f7371f07..2d7bb66f0 100644
--- a/src/gui/feedmessageviewer.h
+++ b/src/gui/feedmessageviewer.h
@@ -52,6 +52,10 @@ class FeedMessageViewer : public TabContent {
return m_feedsView;
}
+ inline MessagesView *messagesView() {
+ return m_messagesView;
+ }
+
inline MessagesToolBar *messagesToolBar() {
return m_toolBarMessages;
}
diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp
index 767e2a21f..a59bf11f4 100755
--- a/src/gui/formsettings.cpp
+++ b/src/gui/formsettings.cpp
@@ -20,6 +20,7 @@
#include "definitions/definitions.h"
#include "core/feeddownloader.h"
#include "core/feedsmodel.h"
+#include "core/messagesmodel.h"
#include "miscellaneous/application.h"
#include "miscellaneous/settings.h"
#include "miscellaneous/databasefactory.h"
@@ -39,6 +40,7 @@
#include "gui/messagebox.h"
#include "gui/basetoolbar.h"
#include "gui/messagestoolbar.h"
+#include "gui/messagesview.h"
#include "dynamic-shortcuts/dynamicshortcuts.h"
#include
@@ -184,6 +186,27 @@ void FormSettings::loadFeedsMessages() {
m_ui->m_checkUpdateAllFeedsOnStartup->setChecked(settings->value(APP_CFG_FEEDS, "feeds_update_on_startup", false).toBool());
m_ui->m_cmbCountsFeedList->addItems(QStringList() << "(%unread)" << "[%unread]" << "%unread/%all" << "%unread-%all" << "[%unread|%all]");
m_ui->m_cmbCountsFeedList->setEditText(settings->value(APP_CFG_FEEDS, "count_format", "(%unread)").toString());
+
+ initializeMessageDateFormats();
+
+ m_ui->m_checkMessagesDateTimeFormat->setChecked(settings->value(APP_CFG_MESSAGES, "use_custom_date").toBool());
+ int index_format = m_ui->m_cmbMessagesDateTimeFormat->findData(settings->value(APP_CFG_MESSAGES, "custom_date_format").toString());
+
+ if (index_format >= 0) {
+ m_ui->m_cmbMessagesDateTimeFormat->setCurrentIndex(index_format);
+ }
+}
+
+void FormSettings::initializeMessageDateFormats() {
+ QStringList best_formats; best_formats << "d/M/yyyy hh:mm:ss" << "ddd, d. M. yy hh:mm:ss" <<
+ "yyyy-MM-dd HH:mm:ss.z" << "yyyy-MM-ddThh:mm:ss" <<
+ "MMM d yyyy hh:mm:ss";;
+ QLocale current_locale = qApp->localization()->loadedLocale();
+ QDateTime current_dt = QDateTime::currentDateTime();
+
+ foreach (const QString &format, best_formats) {
+ m_ui->m_cmbMessagesDateTimeFormat->addItem(current_locale.toString(current_dt, format), format);
+ }
}
void FormSettings::saveFeedsMessages() {
@@ -196,9 +219,15 @@ void FormSettings::saveFeedsMessages() {
settings->setValue(APP_CFG_FEEDS, "feed_update_timeout", m_ui->m_spinFeedUpdateTimeout->value());
settings->setValue(APP_CFG_FEEDS, "feeds_update_on_startup", m_ui->m_checkUpdateAllFeedsOnStartup->isChecked());
settings->setValue(APP_CFG_FEEDS, "count_format", m_ui->m_cmbCountsFeedList->currentText());
+ settings->setValue(APP_CFG_MESSAGES, "use_custom_date", m_ui->m_checkMessagesDateTimeFormat->isChecked());
+ settings->setValue(APP_CFG_MESSAGES, "custom_date_format",
+ m_ui->m_cmbMessagesDateTimeFormat->itemData(m_ui->m_cmbMessagesDateTimeFormat->currentIndex()).toString());
+ // TODO: aktualizovat messageview s novym formatem
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->updateAutoUpdateStatus();
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->reloadWholeLayout();
+ qApp->mainForm()->tabWidget()->feedMessageViewer()->messagesView()->sourceModel()->updateDateFormat();
+ qApp->mainForm()->tabWidget()->feedMessageViewer()->messagesView()->sourceModel()->reloadWholeLayout();
}
void FormSettings::displayProxyPassword(int state) {
diff --git a/src/gui/formsettings.h b/src/gui/formsettings.h
index c64eb2d3d..b061d74ad 100644
--- a/src/gui/formsettings.h
+++ b/src/gui/formsettings.h
@@ -91,6 +91,7 @@ class FormSettings : public QDialog {
void onProxyTypeChanged(int index);
void loadFeedsMessages();
+ void initializeMessageDateFormats();
void saveFeedsMessages();
private:
diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui
index 2d6528cf1..af2337390 100644
--- a/src/gui/formsettings.ui
+++ b/src/gui/formsettings.ui
@@ -400,8 +400,8 @@ Authors of this application are NOT responsible for lost data.
0
0
- 684
- 451
+ 100
+ 30
@@ -478,8 +478,8 @@ Authors of this application are NOT responsible for lost data.
0
0
- 678
- 425
+ 167
+ 219
@@ -1163,7 +1163,7 @@ Authors of this application are NOT responsible for lost data.
-
- 1
+ 0
@@ -1287,48 +1287,21 @@ Authors of this application are NOT responsible for lost data.
-
-
-
+
+
Use custom date/time format (overrides format loaded from active localization)
true
- false
+ true
-
-
-
-
-
- Format code
-
-
-
- -
-
-
- true
-
-
-
- -
-
-
- Example
-
-
-
- -
-
-
-
-
-
-
-
+ -
+
+
@@ -1447,5 +1420,21 @@ Authors of this application are NOT responsible for lost data.
+
+ m_checkMessagesDateTimeFormat
+ toggled(bool)
+ m_cmbMessagesDateTimeFormat
+ setEnabled(bool)
+
+
+ 445
+ 94
+
+
+ 778
+ 95
+
+
+