Example #1
0
void LoginWidget::on_toolButtonServersManager_clicked(){
    
    
    QDialog dlg(this);
    QVBoxLayout vbl(&dlg);

    ServerManagerWindow smw(&dlg);
    connect(this, SIGNAL(signalServerFound(const QString&, quint16, const QString&, const QString&)), &smw, SLOT(serverFound(const QString& ,quint16, const QString&, const QString&))/*, Qt::QueuedConnection*/);
    connect(&smw, SIGNAL(signalLookForServer(const QHostAddress &, quint16 )), this, SIGNAL(signalLookForServer(const QHostAddress &, quint16)));
    //        connect(&smw, SIGNAL(signalServersUpdated()), this, SLOT(slotServersUpdated()));
    connect(&smw, SIGNAL(signalServerSelected(const QString &)), this, SLOT(slotServerSelected(const QString &)));


    vbl.addWidget(&smw);
    dlg.setLayout(&vbl);
    dlg.updateGeometry();
    dlg.setWindowTitle(tr("Servers Manager"));
    dlg.exec();

    //        disconnect(this, SIGNAL(signalServerFound(const QString&, quint16, quint16, const QString&, const QString&)), &smw, SLOT(serverFound(const QString& ,quint16, quint16, const QString&, const QString&)));
    //        disconnect(&smw, SIGNAL(signalLookForServer(const QHostAddress &, quint16 )), this, SIGNAL(signalLookForServer(const QHostAddress &, quint16)));
    //        disconnect(&smw, SIGNAL(signalServerSelected(const QString &)), this,SLOT(slotServerSelected(const QString &)));


    loadServers();

}
Example #2
0
void LoginWidget::setupNetworkConfig(){
    qDebug()<<"LoginWidget::setupNetworkConfig()";

    ui.groupBoxConfiguration->hide();

    ui.comboBoxNetworkType->addItem(tr("LAN"), ResourcesManager::LAN);
    ui.comboBoxNetworkType->addItem(tr("Internet"), ResourcesManager::INTERNET);
    ui.comboBoxNetworkType->setCurrentIndex(Settings::instance()->getNetworkType());

    ui.comboBoxProtocol->addItem(tr("P2P"), ResourcesManager::P2P);
    ui.comboBoxProtocol->addItem(tr("C/S"), ResourcesManager::CS);
    ui.comboBoxProtocol->setCurrentIndex(Settings::instance()->getProtocol());


    //	QStringList servers = Settings::instance()->getServers();
    //	if(!servers.isEmpty()){
    //		for(int i = 0; i< servers.size(); i++){
    //                        //QStringList values = servers.at(i).split(":");
    //                        //ui.comboBoxServerIP->addItem(values.at(0), values.at(1));
    //                    ui.comboBoxServerIP->addItem(servers.at(i));
    //		}
    //	}

    //	QString lastServer = Settings::instance()->getLastServer();
    //	if(!lastServer.isEmpty()){
    //                //ui.comboBoxServerIP->setCurrentIndex(ui.comboBoxServerIP->findText(lastServer.split(":").at(0)));
    //                ui.comboBoxServerIP->setCurrentIndex(ui.comboBoxServerIP->findText(lastServer));
    //	}

    loadServers();



}
Example #3
0
BluecherryApp::BluecherryApp()
    : nam(new QNetworkAccessManager(this)), liveView(new LiveViewManager(this)),
      globalRate(new TransferRateCalculator(this)), m_updateChecker(0),
      m_livePaused(false), m_inPauseQuery(false),
      m_screensaverInhibited(false), m_screensaveValue(0)
{
    Q_ASSERT(!bcApp);
    bcApp = this;

    m_serverRepository = new DVRServerRepository(this);

    connect(qApp, SIGNAL(aboutToQuit()), SLOT(aboutToQuit()));

    appIcon.addFile(QLatin1String(":/icons/icon16.png"));
    appIcon.addFile(QLatin1String(":/icons/icon32.png"));
    appIcon.addFile(QLatin1String(":/icons/icon64.png"));
    appIcon.addFile(QLatin1String(":/icons/bluecherry-client.png"));
    qApp->setWindowIcon(appIcon);

    connect(nam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));

    /* Don't use the system CAs to verify certificates */
    QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration();
    sslConfig.setCaCertificates(QList<QSslCertificate>());
#if QT_VERSION >= 0x040800
    /* SNI breaks connections (before sslError, even) when the hostname does
     * not match the server. */
    sslConfig.setSslOption(QSsl::SslOptionDisableServerNameIndication, true);
#endif
    QSslConfiguration::setDefaultConfiguration(sslConfig);

    loadServers();
    if (shouldAddLocalServer())
        addLocalServer();
    autoConnectServers();

    sendSettingsChanged();

    m_updateChecker = new UpdateChecker(nam, this);
    connect(m_updateChecker, SIGNAL(newVersionAvailable(Version)), this, SLOT(newVersionAvailable(Version)));
    QSettings settings;

    if (!settings.value(QLatin1String("ui/disableUpdateNotifications"), false).toBool())
    {
        startUpdateChecker();
    }

    m_mediaDownloadManager = new MediaDownloadManager(this);
    m_mediaDownloadManager->setCookieJar(nam->cookieJar());

    m_eventDownloadManager = new EventDownloadManager(this);
    connect(m_serverRepository, SIGNAL(serverRemoved(DVRServer*)), m_eventDownloadManager, SLOT(serverRemoved(DVRServer*)));

    registerVideoPlayerFactory();

    connect(qApp, SIGNAL(commitDataRequest(QSessionManager&)), this, SLOT(commitDataRequest(QSessionManager&)));
    connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
}
Example #4
0
void LoginWidget::slotServerSelected(const QString &serverInfoString){
    
    loadServers();
    
    ui.comboBoxServerIP->setCurrentIndex(ui.comboBoxServerIP->findText(serverInfoString));
    
    updateUserLoginServerInfo();
        
}
Example #5
0
void ServerDialog::postInit()
{
    setVisible(true);

    mConnectButton->requestFocus();

    loadServers(true);

    mServersList->setSelected(0);  // Do this after for the Delete button

    if (needUpdateServers())
        downloadServerList();
}
bool GUIMultiplayerMenu::fetchServers()
{
	char* u = const_cast<char*>("/list");
	std::string data = http_request(NULL,u);
	std::string path = getPath("","servers.txt",false);

	std::ofstream f;
	f.open(path.c_str());
	if (!f.is_open())
		return false;

	f << data;
	f.close();

	return loadServers();
}
GUIMultiplayerMenu::GUIMultiplayerMenu(
	gui::IGUIEnvironment* env,
	gui::IGUIElement*
	parent,
	s32 id,
	MainMenuData *data,
	IMenuManager *menumgr,
	IGameCallback *gamecallback
):
	GUIModalMenu(env, parent, id, menumgr),
	m_accepted(false),
	m_gamecallback(gamecallback)
{
	m_data.mmdata = data;

	loadServers();
}
Example #8
0
ListServerModel::ListServerModel(bool showlocal, QObject *parent)
	: QAbstractListModel(parent), _showlocal(showlocal)
{
	loadServers();
}
Example #9
0
void LoginWidget::slotServersUpdated(){

    loadServers();
}
Example #10
0
DcmtkServerDialog::DcmtkServerDialog() {
    setWindowTitle("Dicom Downloader");


    listWidget_ = new DcmtkSeriesListWidget();
    configDialog_ = new DcmtkServerConfigDialog();

    serverCombo_ = new QComboBox();
    serverCombo_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    newServerButton_ = new QPushButton("New");
    newServerButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    deleteServerButton_ = new QPushButton("Delete");
    deleteServerButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    editServerButton_ = new QPushButton("Edit");
    editServerButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    updateListButton_ = new QPushButton("Update");
    updateListButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    openButton_ = new QPushButton("Open");
    openButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    openButton_->setDisabled(true);
    outputDirectory_ = new QLineEdit("");
    outputDirectory_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    changeDirectoryButton_ = new QPushButton("...");
    changeDirectoryButton_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    loadServers();

    connect(newServerButton_, SIGNAL(clicked()), this, SLOT(addServer()));
    connect(deleteServerButton_, SIGNAL(clicked()), this, SLOT(deleteServer()));
    connect(serverCombo_, SIGNAL(currentIndexChanged(int)), this, SLOT(displayConfig(int)));
    connect(editServerButton_, SIGNAL(clicked()), this, SLOT(editConfig()));
    connect(updateListButton_, SIGNAL(clicked()), this, SLOT(updateList()));
    connect(openButton_, SIGNAL(clicked()), this, SLOT(open()));
    connect(listWidget_, SIGNAL(seriesSelected()), this, SLOT(enableOpenButton()));
#ifdef VRN_DICOMLOADER
    connect(changeDirectoryButton_, SIGNAL(clicked()), this, SLOT(selectOutputDir()));
#endif
    QGridLayout *layout = new QGridLayout;

    layout->addWidget(new QLabel("Server:"),0,0,(Qt::Alignment)0);
    layout->addWidget(serverCombo_,0,1,(Qt::Alignment)0);
    fillCombo();
    layout->addWidget(editServerButton_,0,2,(Qt::Alignment)0);
    layout->addWidget(newServerButton_,0,3,(Qt::Alignment)0);
    layout->addWidget(deleteServerButton_,0,4,(Qt::Alignment)0);
    layout->addWidget(listWidget_,1,0,1,5,(Qt::Alignment)0);
    layout->addWidget(updateListButton_,2,3,1,1,(Qt::Alignment)0);
    layout->addWidget(openButton_,2,4,1,1,(Qt::Alignment)0);
#ifdef VRN_DICOMLOADER
    layout->addWidget(new QLabel("Output Directory:"),4,0,(Qt::Alignment)0);
    layout->addWidget(outputDirectory_,4,1,1,3,(Qt::Alignment)0);
    layout->addWidget(changeDirectoryButton_,4,4,1,1,(Qt::Alignment)0);
#endif

    listWidget_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    setLayout(layout);
//     if (servers_.size() > 0)
//         displayConfig(servers_[0]);

    dt_ = 0;
}