void CNetwork::acquireLocalAddress(QString& sHeader)
{
	CEndPoint hostAddr(sHeader, m_oAddress.port());

	if(hostAddr.isValid())
	{
		if( hostAddr != m_oAddress )
		{
			m_oAddress = hostAddr;
			emit localAddressChanged();
		}
	}
}
Beispiel #2
0
void SettingsWidget::slotLocalAddressSizeChanged()
{
    adjustAddressSizeSpinBox( ui->local_size->value(), ui->local );
    emit localAddressChanged( ui->local->value() );
}
Beispiel #3
0
CWinMain::CWinMain( QWidget* parent ) :
	QMainWindow( parent ),
	ui( new Ui::CWinMain )
{
	ui->setupUi( this );

	//Initialize vaiables
	bypassCloseEvent = false;
	interfaceLoaded = false;

	ui->actionAres->setChecked( quazaaSettings.Ares.Enable );
	ui->actionEDonkey->setChecked( quazaaSettings.EDonkey.Enable );
	ui->actionGnutella2->setChecked( quazaaSettings.Gnutella2.Enable );

	//Load And Set Up User Interface
	quazaaSettings.loadWindowSettings( this );
	restoreState( quazaaSettings.WinMain.MainToolbar );

	//Set up the status bar
	labelIPAddress = new QLabel( tr( "Current IP:" ) );
	ui->statusbar->addWidget( labelIPAddress );
	labelCurrentIPAddress = new QLabel( tr( "Unknown" ) );
	ui->statusbar->addWidget( labelCurrentIPAddress );
	toolButtonAddressToClipboard = new QToolButton( this );
	toolButtonAddressToClipboard->setText( tr( "Copy Address" ) );
	toolButtonAddressToClipboard->setAutoRaise( true );
	connect( toolButtonAddressToClipboard, SIGNAL( clicked() ), this, SLOT( onCopyIP() ) );
	ui->statusbar->addWidget( toolButtonAddressToClipboard );

	tcpFirewalled = ":/Resource/Network/ShieldRed.png";
	udpFirewalled = ":/Resource/Network/ShieldRed.png";
	labelFirewallStatus = new QLabel(
		tr( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\"> <html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head><body style=\" font-family:'Segoe UI'; font-size:10pt; font-weight:400; font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">TCP: <img src=\":/Resource/Network/ShieldRed.png\" /> UDP: <img src=\":/Resource/Network/ShieldRed.png\" /></p></body></html>" ) );
	ui->statusbar->addPermanentWidget( labelFirewallStatus );
	labelBandwidthTotals = new QLabel();
	ui->statusbar->addPermanentWidget( labelBandwidthTotals );

	//Add the tabs
	pageHome = new CWidgetHome();
	ui->stackedWidgetMain->addWidget( pageHome );
	pageLibrary = new CWidgetLibrary();
	ui->stackedWidgetMain->addWidget( pageLibrary );
	pageMedia = new CWidgetMedia();
	ui->stackedWidgetMain->addWidget( pageMedia );
	pageSearch = new WidgetSearch();
	ui->stackedWidgetMain->addWidget( pageSearch );
	pageTransfers = new CWidgetTransfers();
	ui->stackedWidgetMain->addWidget( pageTransfers );
	pageSecurity = new CWidgetSecurity();
	ui->stackedWidgetMain->addWidget( pageSecurity );
	pageActivity = new WidgetActivity();
	ui->stackedWidgetMain->addWidget( pageActivity );
	pageIrcMain = new CWidgetIrcMain();
	ui->stackedWidgetMain->addWidget( pageIrcMain );
	pageHostCache = new WidgetHostCache;
	ui->stackedWidgetMain->addWidget( pageHostCache );
	pageDiscovery = new CWidgetDiscovery;
	ui->stackedWidgetMain->addWidget( pageDiscovery );
	pageScheduler = new CWidgetScheduler;
	ui->stackedWidgetMain->addWidget( pageScheduler );
	pageGraph = new CWidgetGraph;
	ui->stackedWidgetMain->addWidget( pageGraph );
	pagePacketDump = new CWidgetPacketDump;
	ui->stackedWidgetMain->addWidget( pagePacketDump );
	pageSearchMonitor = new CWidgetSearchMonitor;
	ui->stackedWidgetMain->addWidget( pageSearchMonitor );
	pageHitMonitor = new CWidgetHitMonitor;
	ui->stackedWidgetMain->addWidget( pageHitMonitor );

	dlgPrivateMessages = 0;

	// Set up the navigation toolbar
	actionGroupMainNavigation = new QActionGroup( this );
	actionGroupMainNavigation->addAction( ui->actionHome );
	actionGroupMainNavigation->addAction( ui->actionLibrary );
	actionGroupMainNavigation->addAction( ui->actionMedia );
	actionGroupMainNavigation->addAction( ui->actionSearch );
	actionGroupMainNavigation->addAction( ui->actionTransfers );
	actionGroupMainNavigation->addAction( ui->actionSecurity );
	actionGroupMainNavigation->addAction( ui->actionActivity );
	actionGroupMainNavigation->addAction( ui->actionChat );
	actionGroupMainNavigation->addAction( ui->actionHostCache );
	actionGroupMainNavigation->addAction( ui->actionDiscovery );
	actionGroupMainNavigation->addAction( ui->actionScheduler );
	actionGroupMainNavigation->addAction( ui->actionGraph );
	actionGroupMainNavigation->addAction( ui->actionPacketDump );
	actionGroupMainNavigation->addAction( ui->actionSearchMonitor );
	actionGroupMainNavigation->addAction( ui->actionHitMonitor );
	ui->stackedWidgetMain->setCurrentIndex( quazaaSettings.WinMain.ActiveTab );
	switch ( quazaaSettings.WinMain.ActiveTab )
	{
	case 0:
		ui->actionHome->setChecked( true );
		break;
	case 1:
		ui->actionLibrary->setChecked( true );
		break;
	case 2:
		ui->actionMedia->setChecked( true );
		break;
	case 3:
		ui->actionSearch->setChecked( true );
		pageSearch->focusSearchInput();
		break;
	case 4:
		ui->actionTransfers->setChecked( true );
		break;
	case 5:
		ui->actionSecurity->setChecked( true );
		break;
	case 6:
		ui->actionActivity->setChecked( true );
		break;
	case 7:
		ui->actionChat->setChecked( true );
		break;
	case 8:
		ui->actionHostCache->setChecked( true );
		break;
	case 9:
		ui->actionDiscovery->setChecked( true );
		break;
	case 10:
		ui->actionScheduler->setChecked( true );
		break;
	case 11:
		ui->actionGraph->setChecked( true );
		break;
	case 12:
		ui->actionPacketDump->setChecked( true );
		break;
	case 13:
		ui->actionSearchMonitor->setChecked( true );
		break;
	case 14:
		ui->actionHitMonitor->setChecked( true );
		break;
	default:
		ui->actionHome->setChecked( true );
		break;
	}

	connect( ui->actionNewSearch, SIGNAL( triggered() ), pageSearch, SLOT( on_toolButtonNewSearch_clicked() ) );
	connect( pageHome, SIGNAL( requestSearch( QString* ) ), this, SLOT( startNewSearch( QString* ) ) );
	connect( pageHome, SIGNAL( triggerLibrary() ), this, SLOT( on_actionLibrary_triggered() ) );
	connect( pageHome, SIGNAL( triggerSecurity() ), this, SLOT( on_actionSecurity_triggered() ) );
	connect( pageHome, SIGNAL( triggerTransfers() ), this, SLOT( on_actionTransfers_triggered() ) );

	neighboursRefresher = new QTimer( this );
	connect( neighboursRefresher, SIGNAL( timeout() ), this, SLOT( updateStatusBar() ) );
	connect( neighboursRefresher, SIGNAL( timeout() ), pageActivity->panelNeighbours, SLOT( onTimer() ) );

	update();
	qApp->processEvents();

	interfaceLoaded = true;

	connect( &chatCore, SIGNAL( openChatWindow( ChatSession* ) ), this, SLOT( OpenChat( ChatSession* ) ) );
	connect( &networkG2, SIGNAL( localAddressChanged() ), this, SLOT( localAddressChanged() ) );
	connect( &shareManager, SIGNAL( hasherStarted( int ) ), this, SLOT( onHasherStarted( int ) ) );
	setSkin();
}