コード例 #1
0
ファイル: screenprovider.cpp プロジェクト: kimmoli/SailCast
void ScreenProvider::start()
{

    if (!this->listen()) {
        return;
    }

    QString ipAddress;
    QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();

    for (int i = 0; i < ipAddressesList.size(); ++i) {
        if (ipAddressesList.at(i) != QHostAddress::LocalHost &&
            ipAddressesList.at(i).toIPv4Address()) {
            ipAddress = ipAddressesList.at(i).toString();
            break;
        }
    }

    if (ipAddress.isEmpty()) {
        ipAddress = QHostAddress(QHostAddress::LocalHost).toString();
    }

    ipAddress_ = ipAddress;
    port_ = this->serverPort();
    this->setMaxPendingConnections(1);
    emit serverChanged(port_, ipAddress_.toString());
}
コード例 #2
0
void KNMusicOnlineLyricsDownloader::onActionDownloadFinished(
        uint identifier,
        const KNMusicDetailInfo &detailInfo,
        QList<KNMusicLyricsDownloader::KNMusicLyricsDetails> lyricsList)
{
    //Check the identifier first.
    if(identifier!=m_identifier ||
            detailInfo.textLists[Name]!=m_workingDetailInfo.textLists[Name] ||
            detailInfo.textLists[Artist]!=m_workingDetailInfo.textLists[Artist])
    {
        //This signal is not for me.
        return;
    }
    //Increase the counter of the completed downloader.
    ++m_completeDownloader;
    //Emit the server changed signal.
    emit serverChanged(m_completeDownloader, m_downloaders.size());
    //Check out the cancel flag.
    if(m_cancelFlag)
    {
        //Reset the running flag.
        m_running=false;
        //Emit signal.
        emit downloadCancel();
        //Won't download more.
        return;
    }
    //Check the lyrics list size and emit signal.
    if(!lyricsList.isEmpty())
    {
        //Increase the new lyrics list to the cached list.
        m_lyricsList.append(lyricsList);
        //Sort the lyrics list right now.
        std::sort(m_lyricsList.begin(),
                  m_lyricsList.end(),
                  KNMusicLyricsDownloader::lyricsDetailLessThan);
        //Emit the have content signal.
        emit listContentChanged(m_lyricsList);
    }
    //Check out the cancel flag.
    if(m_cancelFlag)
    {
        //Reset the running flag.
        m_running=false;
        //Emit signal.
        emit downloadCancel();
        //Won't download more.
        return;
    }
    //Check whether the completed downloader count is the same as the size of
    //the downloaders.
    if(m_completeDownloader==m_downloaders.size())
    {
        //After download all the data, emit the signal.
        emit downloadComplete();
        //Reset the running flag.
        m_running=false;
    }
}
コード例 #3
0
ファイル: seafilemodel.cpp プロジェクト: unsanded/cargodock
void SeafileModel::setServer(SeafileServer *server)
{
    if (m_server == server)
        return;

    m_server = server;
    emit serverChanged(server);
}
コード例 #4
0
ファイル: cdoodgroupitem.cpp プロジェクト: MakoVsp/Linkdood
QString CDoodGroupItem::setServer(const QString &data)
{
    if(mServer == data) {
        return data;
    }
    mServer = data;
    emit serverChanged();
    return mServer;
}
コード例 #5
0
QWidget *PasteBinDotComSettings::createPage(QWidget *parent)
{
    Ui_PasteBinComSettingsWidget ui;
    QWidget *w = new QWidget(parent);
    ui.setupUi(w);
    ui.lineEdit->setText(hostPrefix());
    connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
    return w;
}
コード例 #6
0
void ServerConfigWindow::setServer(DVRServer *server)
{
    if (m_server == server)
        return;

    m_server = server;

    if (server)
    {
        m_webView->load(server->url());
        setWindowTitle(tr("Bluecherry - %1").arg(server->configuration().displayName()));
    }

    emit serverChanged(m_server);
}
コード例 #7
0
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
{
    QWidget *outerWidget = new QWidget(parent);
    QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);

    QFormLayout *formLayout = new QFormLayout;
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    QLineEdit *lineEdit = new QLineEdit(m_host);
    connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
    formLayout->addRow(tr("Server:"), lineEdit);
    outerLayout->addLayout(formLayout);
    outerLayout->addSpacerItem(new QSpacerItem(0, 30, QSizePolicy::Ignored, QSizePolicy::Fixed));

    QLabel *noteLabel = new QLabel(tr("Note: Specify the host name for the CodePaster service "
                                      "without any protocol prepended (e.g. codepaster.mycompany.com)."));
    noteLabel->setWordWrap(true);
    outerLayout->addWidget(noteLabel);

    outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
    return outerWidget;
}
コード例 #8
0
void KNMusicOnlineLyricsDownloader::downloadLyrics(
        const KNMusicDetailInfo &detailInfo)
{
    //Check the running flag.
    if(m_running)
    {
        //Cancel the current running mission first.
        cancelDownload();
    }
    //Reset the cancel flag.
    m_cancelFlag=false;
    //Set up the running flag.
    m_running=true;
    //Save the new detail info.
    m_workingDetailInfo=detailInfo;
    //Clear the lyrics list.
    m_lyricsList=QList<KNMusicLyricsDownloader::KNMusicLyricsDetails>();
    m_completeDownloader=0;
    //Emit the empty list data right now.
    emit listContentChanged(m_lyricsList);
    //Emit the server changed signal.
    emit serverChanged(0, m_downloaders.size());
    //Download the lyrics data via all the plugins.
    for(auto i : m_downloaders)
    {
        //Before doing downloading, checking the cancel flag first.
        if(m_cancelFlag)
        {
            //Reset the running flag.
            m_running=false;
            //Emit signal.
            emit downloadCancel();
            //Won't download before calling the download.
            return;
        }
        //Try to download the lyrics from all the remote server.
        i->downloadLyrics(m_identifier, detailInfo);
    }
}
コード例 #9
0
ファイル: mainwindow.cpp プロジェクト: pnezis/cresemo
void MainWindow::applyChanges()
{
    // Get new Entry
    QApplication::setOverrideCursor(Qt::WaitCursor);
    QString newRootEntry = getNewRootEntry();

    QString cvsPath = ui->currentFolder->text();

    ui->infoWindow->appendPlainText("======== START UPDATING CVS ENTRIES ======");
    if (replaceRootEntries(cvsPath, newRootEntry))
    {
	// Update the rootEntry
	rootEntry = newRootEntry;
	updateDefaultParameters();
	usernameChanged(ui->usernameLE->text());
	serverChanged(ui->serverLE->text());

	ui->infoWindow->appendPlainText("======== FINISHED UPDATING CVS ENTRIES ======\n\n");
    }
    else
	ui->infoWindow->appendPlainText("======== SOME ERROR OCCURRED !!! ======\n\n");

    QApplication::restoreOverrideCursor();
}
コード例 #10
0
ファイル: ImapAccess.cpp プロジェクト: KDE/trojita
void ImapAccess::setServer(const QString &server)
{
    m_server = server;
    m_settings->setValue(Common::SettingsNames::imapHostKey, m_server);
    emit serverChanged();
}
コード例 #11
0
ConnectionDialog::ConnectionDialog (QWidget *parent)
	: QDialog (parent)
{
	fSettings settings;

	uriLabel = new QLabel (tr ("IRC URI"), this);
	uriLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

	uriEdit = new QLineEdit (this);
	connect (uriEdit, SIGNAL (textChanged (QString)), this, SLOT (uriChanged (QString)));

	serverLabel = new QLabel (tr ("IRC server"), this);
	serverLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

	serverEdit = new QComboBox (this);
	serverEdit->setEditable (true);
	serverEdit->addItems(settings.value("Connection/Servers", QStringList()).toStringList());
	serverEdit->setCurrentIndex (-1);
	connect (serverEdit, SIGNAL (editTextChanged (QString)), this, SLOT (serverChanged ()));
	connect (serverEdit, SIGNAL (editTextChanged (QString)), this, SLOT (updateUri ()));

	roomLabel = new QLabel (tr ("Room"), this);
	roomLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

	roomEdit = new QComboBox (this);
	roomEdit->setEditable (true);
	roomEdit->setEnabled (false);
	connect (roomEdit, SIGNAL (editTextChanged (QString)), this, SLOT (updateUri ()));

	nickLabel = new QLabel (tr ("Nick"), this);
	nickLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

	nickEdit = new QComboBox (this);
	nickEdit->setEditable (true);
	nickEdit->setEnabled (false);

	encodingLabel = new QLabel (tr ("Encoding"), this);
	encodingLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

	encodingEdit = new QComboBox (this);
	encodingEdit->setEditable (false);

	{
		QList<int> textCodecs = QTextCodec::availableMibs();

		for (QList<int>::iterator it = textCodecs.begin (), end = textCodecs.end (); it != end; it++) {
			encodingEdit->addItem (QTextCodec::codecForMib(*it)->name());
		}
		encodingEdit->setCurrentIndex (encodingEdit->findText ("UTF-8"));
	}

	QGridLayout *layout = new QGridLayout ();
	layout->addWidget (uriLabel, 0, 0);
	layout->addWidget (uriEdit, 0, 1);
	layout->addWidget (serverLabel, 1, 0);
	layout->addWidget (serverEdit, 1, 1);
	layout->addWidget (roomLabel, 2, 0);
	layout->addWidget (roomEdit, 2, 1);
	layout->addWidget (nickLabel, 3, 0);
	layout->addWidget (nickEdit, 3, 1);
	layout->addWidget (encodingLabel, 4, 0);
	layout->addWidget (encodingEdit, 4, 1);

	QDialogButtonBox *buttonBox = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
				Qt::Horizontal,
				this);
	connect (buttonBox, SIGNAL (accepted ()), this, SLOT (saveAndAccept ()));
	connect (buttonBox, SIGNAL (rejected ()), this, SLOT (reject ()));

	QVBoxLayout *mainLayout = new QVBoxLayout ();
	mainLayout->addLayout (layout);
	mainLayout->addWidget (buttonBox);

	setLayout (mainLayout);

	serverEdit->setCurrentIndex(settings.value("Connection/LastServer", -1).toInt ());
}
コード例 #12
0
LRESULT CQuickSetupDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){
	TRC(IDC_FTPSETTINGSBUTTON, "Настройки FTP");
	TRC(IDOK, "Продолжить");
	TRC(IDCANCEL, "Отмена");
	TRC(IDC_LOGINLABEL, "Логин:");
	TRC(IDC_PASSWORDLABEL, "Пароль:");
	TRC(IDC_SERVERLABEL, "На какой сервер будем загружать картинки?");
	TRC(IDC_AUTOSTARTUPCHECKBOX, "Запуск программы при старте Windows");
	TRC(IDC_CAPTUREPRINTSCREENCHECKBOX, "Перехватывать нажатия PrintScreen и Alt+PrintScreen");
	TRC(IDC_EXPLORERINTEGRATION, "Добавить пункт в контекстное меню проводника Windows");
	SetWindowText( APPNAME );
	CString titleText;
	titleText.Format(TR("%s - быстрая настройка"), APPNAME );
	SetDlgItemText(IDC_TITLE, titleText );

	CenterWindow();
	hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	hIconSmall = GuiTools::LoadSmallIcon(IDR_MAINFRAME);
	SetIcon(hIconSmall, FALSE);
	serverComboBox_.Attach( GetDlgItem( IDC_SERVERCOMBOBOX ) );

	if ( !Settings.IsPortable ) {
		SendDlgItemMessage( IDC_AUTOSTARTUPCHECKBOX, BM_SETCHECK, BST_CHECKED, 0);
		SendDlgItemMessage( IDC_CAPTUREPRINTSCREENCHECKBOX, BM_SETCHECK, BST_CHECKED, 0);
		SendDlgItemMessage( IDC_EXPLORERINTEGRATION, BM_SETCHECK, BST_CHECKED, 0);
	}
	LogoImage.SubclassWindow(GetDlgItem( IDC_STATICLOGO ) );
	LogoImage.SetWindowPos(0, 0,0, 48, 48, SWP_NOMOVE );
	LogoImage.LoadImage(0, 0, Settings.UseNewIcon ? IDR_ICONMAINNEW : IDR_PNG1, false, GetSysColor(COLOR_BTNFACE));

	HFONT font = GetFont();
	LOGFONT alf;

	bool ok = ::GetObject(font, sizeof(LOGFONT), &alf) == sizeof(LOGFONT);

	if(ok)
	{
		alf.lfWeight = FW_BOLD;

		NewFont=CreateFontIndirect(&alf);

		HDC dc = ::GetDC(0);
		alf.lfHeight  =  - MulDiv(11, GetDeviceCaps(dc, LOGPIXELSY), 72);
		ReleaseDC(dc);
		NewFont = CreateFontIndirect(&alf);
		SendDlgItemMessage(IDC_TITLE,WM_SETFONT,(WPARAM)(HFONT)NewFont,MAKELPARAM(false, 0));
	}
	
	comboBoxImageList_.Create(16,16,ILC_COLOR32 | ILC_MASK,0,6);

	//serverComboBox_.AddItem( _T("<") + CString(TR("Случайный сервер")) + _T(">"), -1, -1, 0, static_cast<LPARAM>( -1 ) );

	HICON hImageIcon = NULL, hFileIcon = NULL;
	int selectedIndex = 0;

	//CUploadEngineData *uploadEngine = _EngineList->byIndex( Settings.getServerID() );
	std::string selectedServerName = "directupload.net" ;
	for( int i = 0; i < _EngineList->count(); i++) {	
		CUploadEngineData * ue = _EngineList->byIndex( i ); 
		if ( ue->Type !=  CUploadEngineData::TypeImageServer && ue->Type !=  CUploadEngineData::TypeFileServer ) {
			continue;
		}
		HICON hImageIcon = _EngineList->getIconForServer(ue->Name);
		int nImageIndex = -1;
		if ( hImageIcon) {
			nImageIndex = comboBoxImageList_.AddIcon( hImageIcon);
		}
		char *serverName = new char[ue->Name.length() + 1];
		lstrcpyA( serverName, ue->Name.c_str() );
		int itemIndex = serverComboBox_.AddItem( Utf8ToWCstring( ue->Name ), nImageIndex, nImageIndex, 1, reinterpret_cast<LPARAM>( serverName ) );
		if ( ue->Name == selectedServerName ){
			selectedIndex = itemIndex;
		}
	}
	serverComboBox_.SetImageList( comboBoxImageList_ );
	serverComboBox_.SetCurSel( selectedIndex );

	doAuthCheckboxChanged();
	
	serverChanged();

	return 1;  
}
コード例 #13
0
LRESULT CQuickSetupDlg::OnServerComboSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {
	serverChanged();
	return 0;
}