frmProgress::frmProgress(QWidget * parent, Qt::WFlags f) : QWidget(parent, f) { qRegisterMetaType<QNapiSubtitleInfoList>("QNapiSubtitleInfoList"); ui.setupUi(this); #ifdef Q_WS_MAC setAttribute(Qt::WA_MacBrushedMetal, GlobalConfig().useBrushedMetal()); #endif setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_QuitOnClose, false); setBatchMode(false); connect(&getThread, SIGNAL(fileNameChange(const QString &)), ui.lbFileName, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(actionChange(const QString &)), ui.lbAction, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(progressChange(int, int, float)), this, SLOT(updateProgress(int, int, float))); connect(&getThread, SIGNAL(selectSubtitles(QString, QNapiSubtitleInfoList)), this, SLOT(selectSubtitles(QString, QNapiSubtitleInfoList))); connect(this, SIGNAL(subtitlesSelected(int)), &getThread, SLOT(subtitlesSelected(int))); connect(&getThread, SIGNAL(finished()), this, SLOT(downloadFinished())); }
frmProgress::frmProgress(QWidget * parent, Qt::WindowFlags f) : QWidget(parent, f) { qRegisterMetaType<QNapiSubtitleInfoList>("QNapiSubtitleInfoList"); ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_QuitOnClose, false); setBatchMode(false); connect(&getThread, SIGNAL(fileNameChange(const QString &)), ui.lbFileName, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(actionChange(const QString &)), ui.lbAction, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(progressChange(int, int, float)), this, SLOT(updateProgress(int, int, float))); connect(&getThread, SIGNAL(selectSubtitles(QString, QNapiSubtitleInfoList)), this, SLOT(selectSubtitles(QString, QNapiSubtitleInfoList))); connect(this, SIGNAL(subtitlesSelected(int)), &getThread, SLOT(subtitlesSelected(int))); connect(&getThread, SIGNAL(finished()), this, SLOT(downloadFinished())); QRect position = frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); }
frmCorrect::frmCorrect(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { ui.setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); connect(ui.pbMovieSelect, SIGNAL(clicked()), this, SLOT(selectMovie())); connect(ui.pbSubtitlesSelect, SIGNAL(clicked()), this, SLOT(selectSubtitles())); connect(ui.leMovieSelect, SIGNAL(textChanged(QString)), this, SLOT(checkPostEnable())); connect(ui.leSubtitlesSelect, SIGNAL(textChanged(QString)), this, SLOT(checkPostEnable())); connect(ui.teComment, SIGNAL(textChanged()), this, SLOT(checkPostEnable())); connect(ui.pbPost, SIGNAL(clicked()), this, SLOT(pbPostClicked())); connect(&postThread, SIGNAL(postFinished(bool)), this, SLOT(postFinished(bool))); connect(&postThread, SIGNAL(invalidUserPass()), this, SLOT(invalidUserPass())); // workaround dla compiza? move((QApplication::desktop()->width() - width()) / 2, (QApplication::desktop()->height() - height()) / 2); }