aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-06-18 08:47:06 +0000
committerSaturneric <[email protected]>2021-06-18 08:47:06 +0000
commit4bd6e0a8f18603e1ea0600fd6df97d2bafef627f (patch)
tree98c72ecde2eb7605f4371fbe4ffecc5468688a71 /src/main.cpp
parentFixed. (diff)
downloadGpgFrontend-4bd6e0a8f18603e1ea0600fd6df97d2bafef627f.tar.gz
GpgFrontend-4bd6e0a8f18603e1ea0600fd6df97d2bafef627f.zip
Improve project configuration files.
Set the TS file to update automatically. Set to automatically generate QM files. Adjust the configuration file reading path. Fix the refresh logic of the configuration file. Set icon for executable file Improve the about page. Adjust the configuration file reading and setting related to Key Server.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7ce4a946..b2aca517 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
// css
- QFile file(qApp->applicationDirPath() + "/css/default.css");
+ QFile file(qApp->applicationDirPath() + "/css/default.qss");
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
qApp->setStyleSheet(styleSheet);
@@ -53,11 +53,16 @@ int main(int argc, char *argv[]) {
* internationalisation. loop to restart mainwindow
* with changed translation when settings change.
*/
+ if(!QDir(appPath + "/conf").exists()) {
+ QDir().mkdir(appPath + "/conf");
+ }
QSettings::setDefaultFormat(QSettings::IniFormat);
- QSettings settings;
+ QSettings settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat);
QTranslator translator, translator2;
int return_from_event_loop_code;
+ qDebug() << settings.fileName();
+
do {
QApplication::removeTranslator(&translator);
QApplication::removeTranslator(&translator2);
@@ -66,12 +71,14 @@ int main(int argc, char *argv[]) {
if (lang.isEmpty()) {
lang = QLocale::system().name();
}
-
- translator.load("./ts/gpg4usb_" + lang, appPath);
+ qDebug() << "Language set" << lang;
+ translator.load( appPath + "/ts/" + "gpg4usb_" + lang);
+ qDebug() << "Translator" << translator.filePath();
QApplication::installTranslator(&translator);
// set qt translations
translator2.load("./ts/qt_" + lang, appPath);
+ qDebug() << "Translator2" << translator2.filePath();
QApplication::installTranslator(&translator2);
MainWindow window;