void MySQLStore::report(int priority, const char* format, ...) { if (onReport != NULL) { va_list arguments; va_start(arguments, format); onReport(priority, format, arguments); va_end(arguments); } }
//事件过滤器(服务开关按钮) bool RegistWindow::eventFilter(QObject *obj, QEvent *event) { if(obj==_control && event->type()==QEvent::MouseButtonPress) { _isRunning = !_isRunning; if(_isRunning){ _server->start(); _control->setText("stop"); _statelabel->setText("regist server is running"); onReport("regist server start success~~"); }else{ _server->stop(); _control->setText("start"); _statelabel->setText("regist server is closed"); onReport("regist server close success"); } return true; } return QWidget::eventFilter(obj,event); }
void WP34sFlashDialog::report(const QString& aMessage) { if(QThread::currentThread() == qApp->thread()) { onReport(aMessage); } else { emit reportInEventLoop(aMessage); } }
Statistic::Statistic(QWidget *parent, Qt::WFlags flags) : QWidget(parent, flags) { Engine::removeOldDirs(); ui.setupUi(this); QString title = trUtf8("Статистика v") + VERSION; title += trUtf8(", сборка от "); title += __DATE__; this->setWindowTitle(title); mSettingsDialog = new CXSettingsDialog(this); mFtp = new QFtp(this); mLoadFile = NULL; waitTimer = -1; mIsArchiveAccept = false; start_arch = false; CXSettings* settings = CXSettings::inst(); if (settings->value(E_StartDate).toDateTime().isValid()) { ui.mStartDateEdit->setDateTime(settings->value(E_StartDate).toDateTime()); ui.mStartTimeEdit->setTime(settings->value(E_StartDate).toDateTime().time()); } if (settings->value(E_EndDate).toDateTime().isValid()) { ui.mEndDateEdit->setDateTime(settings->value(E_EndDate).toDateTime()); ui.mEndTimeEdit->setTime(settings->value(E_EndDate).toDateTime().time()); } connect(ui.mArchiveButton, SIGNAL(clicked()), this, SLOT(onArchiveLoad())); connect(ui.mFTPButton, SIGNAL(clicked()), this, SLOT(onFTPLoad())); connect(ui.mReportButton, SIGNAL(clicked()), this, SLOT(onReport())); connect(ui.mSaveReportButton, SIGNAL(clicked()), this, SLOT(onSaveReport())); connect(ui.mSettingsButton, SIGNAL(clicked()), mSettingsDialog, SLOT(exec())); connect(mFtp, SIGNAL(commandStarted(int)), this, SLOT(onCommandStarted(int))); connect(mFtp, SIGNAL(commandFinished(int,bool)), this, SLOT(onFtpCommandFinish(int,bool))); connect(mFtp, SIGNAL(listInfo(const QUrlInfo&)), this, SLOT(onListInfo(const QUrlInfo&))); // connect(mFtp, SIGNAL(readyRead()), this, SLOT(onReadyRead())); tlClient = new QtTelnet(this); connect(tlClient, SIGNAL(loginRequired()), this, SLOT(telnetLoginRequired())); connect(tlClient, SIGNAL(loginFailed()), this, SLOT(telnetLoginFailed())); connect(tlClient, SIGNAL(connectionError(QAbstractSocket::SocketError)), this, SLOT(telnetConnectionError(QAbstractSocket::SocketError))); connect(tlClient, SIGNAL(message(const QString &)),this, SLOT(telnetMessage(const QString &))); //#ifdef QT_NO_DEBUG // ui.mErrorGroupBox->hide(); //#endif }
void ReportBox::prepare() { setTitle(lang(_peer->isUser() ? lng_report_bot_title : (_peer->isMegagroup() ? lng_report_group_title : lng_report_title))); addButton(lang(lng_report_button), [this] { onReport(); }); addButton(lang(lng_cancel), [this] { closeBox(); }); connect(_reasonSpam, SIGNAL(changed()), this, SLOT(onChange())); connect(_reasonViolence, SIGNAL(changed()), this, SLOT(onChange())); connect(_reasonPornography, SIGNAL(changed()), this, SLOT(onChange())); connect(_reasonOther, SIGNAL(changed()), this, SLOT(onChange())); updateMaxHeight(); }
void ActionsWidget::refreshButtons() { auto buttons = base::take(_buttons); for_const (auto &button, buttons) { delete button; } _blockUser = _leaveChannel = nullptr; if (auto user = peer()->asUser()) { if ((_hasBotHelp = hasBotCommand(qsl("help")))) { addButton(lang(lng_profile_bot_help), SLOT(onBotHelp())); } if ((_hasBotSettings = hasBotCommand(qsl("settings")))) { addButton(lang(lng_profile_bot_settings), SLOT(onBotSettings())); } addButton(lang(lng_profile_clear_history), SLOT(onClearHistory())); addButton(lang(lng_profile_delete_conversation), SLOT(onDeleteConversation())); if (user->botInfo) { addButton(lang(lng_profile_report), SLOT(onReport()), st::defaultLeftOutlineButton, st::profileBlockOneLineSkip); } refreshBlockUser(); } else if (auto chat = peer()->asChat()) { if (chat->amCreator()) { addButton(lang(lng_profile_migrate_button), SLOT(onUpgradeToSupergroup())); } addButton(lang(lng_profile_clear_history), SLOT(onClearHistory())); addButton(lang(lng_profile_clear_and_exit), SLOT(onDeleteConversation())); } else if (auto channel = peer()->asChannel()) { if (!channel->amCreator() && (!channel->isMegagroup() || channel->isPublic())) { addButton(lang(lng_profile_report), SLOT(onReport())); } refreshDeleteChannel(); refreshLeaveChannel(); } refreshVisibility(); }
//配置注册服务业务 void RegistWindow::originServer() { _server = new RegistServer(this); connect(_server,SIGNAL(report(QString)),this,SLOT(onReport(QString))); }