#error You seem to have updated QtSingleApplication without porting our custom QtSingleApplication::getRunningPid() function. Please see previous version to understate how it works.
#endif
classUsageDisplay:publicQObject{
Q_OBJECT
public:
staticvoiddisplayUsage(char*prg_name){
std::cout<<qPrintable(tr("Usage:"))<<std::endl;
std::cout<<'\t'<<prg_name<<" --version: "<<qPrintable(tr("displays program version"))<<std::endl;
std::cout<<'\t'<<prg_name<<" -d | --daemon: "<<qPrintable(tr("run in daemon-mode (background)"))<<std::endl;
std::cout<<'\t'<<prg_name<<" -d | --daemon: "<<qPrintable(QObject::tr("run in daemon-mode (background)"))<<std::endl;
#endif
std::cout<<'\t'<<prg_name<<" --help: "<<qPrintable(tr("displays this help message"))<<std::endl;
std::cout<<'\t'<<prg_name<<" --webui-port=x: "<<qPrintable(tr("changes the webui port (current: %1)").arg(QString::number(Preferences::instance()->getWebUiPort())))<<std::endl;
std::cout<<'\t'<<prg_name<<""<<qPrintable(tr("[files or urls]: downloads the torrents passed by the user (optional)"))<<std::endl;
}
};
classLegalNotice:publicQObject{
Q_OBJECT
std::cout<<'\t'<<prg_name<<" --help: "<<qPrintable(QObject::tr("displays this help message"))<<std::endl;
std::cout<<'\t'<<prg_name<<" --webui-port=x: "<<qPrintable(QObject::tr("changes the webui port (current: %1)").arg(QString::number(Preferences::instance()->getWebUiPort())))<<std::endl;
std::cout<<'\t'<<prg_name<<""<<qPrintable(QObject::tr("[files or urls]: downloads the torrents passed by the user (optional)"))<<std::endl;
}
public:
staticbooluserAgreesWithNotice(){
booluserAgreesWithLegalNotice()
{
Preferences*constpref=Preferences::instance();
if(pref->getAcceptedLegal())// Already accepted once
std::cout<<qPrintable(tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."))<<std::endl<<std::endl;
std::cout<<qPrintable(tr("Press %1 key to accept and continue...").arg("'y'"))<<std::endl;
std::cout<<qPrintable(QObject::tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."))<<std::endl<<std::endl;
std::cout<<qPrintable(QObject::tr("Press %1 key to accept and continue...").arg("'y'"))<<std::endl;
charret=getchar();// Read pressed key
if(ret=='y'||ret=='Y'){
// Save the answer
pref->setAcceptedLegal(true);
returntrue;
// Save the answer
pref->setAcceptedLegal(true);
returntrue;
}
returnfalse;
#else
QMessageBoxmsgBox;
msgBox.setText(tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."));
msgBox.setText(QObject::tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."));