diff --git a/YACReader.svg b/YACReader.svg new file mode 100644 index 00000000..bc7cc2f7 --- /dev/null +++ b/YACReader.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro index 6935b593..8e2b9b66 100644 --- a/YACReader/YACReader.pro +++ b/YACReader/YACReader.pro @@ -242,8 +242,8 @@ docs.path = $$DATADIR/doc/yacreader docs.extra = cp ../README.txt ../README docs.files = ../README ../CHANGELOG.md -icon.path = $$DATADIR/icons/hicolor/48x48/apps -icon.files = ../YACReader.png +icon.path = $$DATADIR/icons/hicolor/scalable/apps +icon.files = ../YACReader.svg desktop.path = $$DATADIR/applications desktop.files = ../YACReader.desktop diff --git a/YACReader/main.cpp b/YACReader/main.cpp index 3d9a0ec0..ebe4312f 100644 --- a/YACReader/main.cpp +++ b/YACReader/main.cpp @@ -85,12 +85,15 @@ int main(int argc, char * argv[]) app.setApplicationName("YACReader"); app.setOrganizationName("YACReader"); - app.setAttribute(Qt::AA_UseHighDpiPixmaps); - //simple command line parser + app.setAttribute(Qt::AA_UseHighDpiPixmaps); + if (QIcon::hasThemeIcon("YACReader")) { + app.setWindowIcon(QIcon::fromTheme("YACReader")); + } + //simple command line parser //will be replaced by QCommandLineParser in the future QStringList optlist; QStringList arglist; - + if (argc > 1) { //extract options and arguments @@ -118,7 +121,7 @@ int main(int argc, char * argv[]) } } } - + QString destLog = YACReader::getSettingsPath()+"/yacreader.log"; QDir().mkpath(YACReader::getSettingsPath()); @@ -133,11 +136,11 @@ int main(int argc, char * argv[]) QTranslator translator; QString sufix = QLocale::system().name(); -#if defined Q_OS_UNIX && !defined Q_OS_MAC +#if defined Q_OS_UNIX && !defined Q_OS_MAC translator.load(QString(DATADIR)+"/yacreader/languages/yacreader_"+sufix); #else translator.load(QCoreApplication::applicationDirPath()+"/languages/yacreader_"+sufix); -#endif +#endif app.installTranslator(&translator); MainWindowViewer * mwv = new MainWindowViewer(); @@ -145,7 +148,7 @@ int main(int argc, char * argv[]) //if we have a valid request, open it - if not, load normally if (argc > 1) { - if (!optlist.filter("--comicId=").isEmpty() && !optlist.filter("--libraryId=").isEmpty()) + if (!optlist.filter("--comicId=").isEmpty() && !optlist.filter("--libraryId=").isEmpty()) { if (arglist.count()>1) { @@ -168,7 +171,7 @@ int main(int argc, char * argv[]) delete mwv; //Configuration::getConfiguration().save(); - + YACReader::exitCheck(ret); #ifdef Q_OS_MAC diff --git a/YACReaderLibrary.svg b/YACReaderLibrary.svg new file mode 100644 index 00000000..dbbea025 --- /dev/null +++ b/YACReaderLibrary.svg @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index da72a7a7..88a2c851 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -311,8 +311,8 @@ isEmpty(DESTDIR) { server.path = $$DATADIR/yacreader server.files = ../release/server -icon.path = $$DATADIR/icons/hicolor/48x48/apps -icon.files = ../YACReaderLibrary.png +icon.path = $$DATADIR/icons/hicolor/scalable/apps +icon.files = ../YACReaderLibrary.svg desktop.path = $$DATADIR/applications desktop.files = ../YACReaderLibrary.desktop diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 92226127..9e78a797 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -158,6 +158,9 @@ int main( int argc, char ** argv ) app.setApplicationVersion(VERSION); app.setAttribute(Qt::AA_UseHighDpiPixmaps); + if (QIcon::hasThemeIcon("YACReaderLibrary")) { + app.setWindowIcon(QIcon::fromTheme("YACReaderLibrary")); + } QString destLog = YACReader::getSettingsPath()+"/yacreaderlibrary.log"; QDir().mkpath(YACReader::getSettingsPath()); @@ -179,11 +182,11 @@ int main( int argc, char ** argv ) translator.load(QCoreApplication::applicationDirPath()+"/languages/yacreaderlibrary_"+sufix); #endif app.installTranslator(&translator); - + QTranslator viewerTranslator; #if defined Q_OS_UNIX && !defined Q_OS_MAC viewerTranslator.load(QString(DATADIR)+"/yacreader/languages/yacreader_"+sufix); -#else +#else viewerTranslator.load(QCoreApplication::applicationDirPath()+"/languages/yacreader_"+sufix); #endif app.installTranslator(&viewerTranslator); @@ -193,7 +196,7 @@ int main( int argc, char ** argv ) #ifdef SERVER_RELEASE QSettings * settings = new QSettings(YACReader::getSettingsPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creaci�n del fichero de config con el servidor settings->beginGroup("libraryConfig"); - + s = new Startup(); if(settings->value(SERVER_ON,true).toBool()) diff --git a/YACReaderLibraryServer/systemctl_service_instructions.txt b/YACReaderLibraryServer/systemctl_service_instructions.txt deleted file mode 100644 index 01b32792..00000000 --- a/YACReaderLibraryServer/systemctl_service_instructions.txt +++ /dev/null @@ -1,13 +0,0 @@ -1. change the path used in ExecStart so it points to the location your headless server binary resides, skip this step if yacreaderlibraryserver is in your path. - -2. copy the service file to ~/.local/share/systemd/user - -3. enable the service file by running: -"systemclt --user enable yacreaderlibraryserver" - - -4. start the server by running: -"systemctl --user start yacreaderlibraryserver" - -5. check the server status by running: -systemctl --user status yacreaderlibraryserver diff --git a/YACReaderLibraryServer/systemd_instructions.txt b/YACReaderLibraryServer/systemd_instructions.txt new file mode 100644 index 00000000..b62e118c --- /dev/null +++ b/YACReaderLibraryServer/systemd_instructions.txt @@ -0,0 +1,32 @@ +Starting with YACReader 9.0.0 we supply a systemd service file for use with +YACReaderLibraryServer. To make use of it, follow these instructions: + +1. Open yacreaderlibraryserver.service in a text editor of your choice. + Change the path used in the ExecStart variable to the location where your headless + server binary resides. If yacreaderlibraryserver was installed as part of a + package you can probably skip this step. + +2. Copy the service file into ~/.local/share/systemd/user + +3. Enable the service file by running: + "systemctl --user enable yacreaderlibraryserver" + +4. Start the server by running: + "systemctl --user start yacreaderlibraryserver" + +5. Check the server status by running: + "systemctl --user status yacreaderlibraryserver" + +Important: Don't run this as root. None of these steps require root privileges. + +By the default, the service is configured to restart yacreaderlibraryserver in +case of a crash and will automatically restart even after a kill or reboot. +This might give you some trouble when running YACReaderLibrary on the same machine. + +To temporarily disable the server, run systemctl with the stop command: + +"systemctl --user stop yacreaderlibraryserver" + +To permanently disable it, use the "disable" command: + +"systemctl --user disable yacreaderlibraryserver"