Exemplo n.º 1
0
KviQueryWindow::KviQueryWindow(KviConsoleWindow * lpConsole, const QString & szNick)
    : KviWindow(KviWindow::Query, szNick, lpConsole)
{
	m_iFlags = 0;
	connection()->registerQuery(this);

	//m_pTopSplitter = new KviTalSplitter(QSplitter::Horizontal,this,"top_splitter");
	m_pButtonBox = new KviTalHBox(this);
	m_pButtonBox->setSpacing(0);
	m_pButtonBox->setMargin(0);
	m_pLabel = new KviThemedLabel(m_pButtonBox, this, "query_label");
	updateLabelText();
	m_pButtonBox->setStretchFactor(m_pLabel, 1);

	// The button box on the right
	//KviTalHBox * box = new KviTalHBox(m_pTopSplitter,"button_box");
	m_pButtonGrid = (QFrame *)new KviTalHBox(m_pButtonBox);

	createTextEncodingButton(m_pButtonGrid);

	m_pSplitter = new KviTalSplitter(Qt::Horizontal, this);
	m_pSplitter->setObjectName("query_splitter");
	m_pSplitter->setChildrenCollapsible(false);

	m_pIrcView = new KviIrcView(m_pSplitter, this);
	connect(m_pIrcView, SIGNAL(rightClicked()), this, SLOT(textViewRightClicked()));
	//m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter);

	m_pListViewButton = new KviWindowToolPageButton(KviIconManager::HideListView, KviIconManager::ShowListView, __tr2qs("Show user list"), buttonContainer(), true);
	m_pListViewButton->setObjectName("list_view_button");
	connect(m_pListViewButton, SIGNAL(clicked()), this, SLOT(toggleListView()));

#ifdef COMPILE_CRYPT_SUPPORT
	createCryptControllerButton(m_pButtonGrid);
#endif

	m_pUserListView = new KviUserListView(m_pSplitter, m_pListViewButton, connection()->userDataBase(), this, 7, __tr2qs("Query targets"), "user_list_view");

	m_pInput = new KviInput(this, m_pUserListView);

	if(KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin))
		pasteLastLog();

	if(KVI_OPTION_BOOL(KviOption_boolAutoLogQueries))
		m_pIrcView->startLogging();
	// FIXME: #warning "Maybe tell the user all that we know about the remote szEnd(s)....channels..."

	m_pIrcView->enableDnd(true);
	connect(m_pIrcView, SIGNAL(fileDropped(const QString &)), this, SLOT(slotDndEvents(const QString &)));

	updateCaption();
}
Exemplo n.º 2
0
void SimpleUI::setupCentralWidget()
{
    QVBox *npWidget = new QVBox( this );
    npWidget->setMargin( 0 );
    npWidget->setSpacing( 0 );

    positionLabel = new QLabel( statusBar() );
    positionLabel->setAlignment( AlignVCenter | AlignCenter );
    positionLabel->setFixedSize( fontMetrics().size( 0, " 00:00/00:00 " ) );
    statusBar()->addWidget( positionLabel, 0, true );

    video = new VideoFrame( npWidget );
    connect( video, SIGNAL(adaptSize(int,int)),
         SLOT(slotAdaptSize(int,int)) );
    connect( video, SIGNAL(rightButtonPressed(const QPoint &)),
         SLOT(slotContextMenu(const QPoint &)) );

    QHBox *ctlFrame = new QHBox( npWidget );
    ctlFrame->setFixedHeight( 38 );
    ctlFrame->setFrameShape( QFrame::StyledPanel );
    ctlFrame->setFrameShadow( QFrame::Raised );
    ctlFrame->setMargin( 6 );
    ctlFrame->setSpacing( 6 );

    QPushButton *backButton = new QPushButton( ctlFrame );
    backButton->setFixedSize( 24, 24 );
    backButton->setPixmap( QPixmap( back_xpm ) );
    QToolTip::add( backButton, i18n("Back") );
    connect( backButton, SIGNAL(clicked()), napp->player(), SLOT(back()) );

    stopButton = new QPushButton( ctlFrame );
    stopButton->setFixedSize( 24, 24 );
    stopButton->setPixmap( QPixmap( stop_xpm ) );
    QToolTip::add( stopButton, i18n("Stop") );
    connect( stopButton, SIGNAL(clicked()), napp->player(), SLOT(stop()) );

    playButton = new QPushButton( ctlFrame );
    playButton->setFixedSize( 24, 24 );
    playButton->setPixmap( QPixmap( play_xpm ) );
    QToolTip::add( playButton, i18n("Play / Pause") );
    connect( playButton, SIGNAL(clicked()), napp->player(), SLOT(playpause()) );

    QPushButton *forwButton = new QPushButton( ctlFrame );
    forwButton->setFixedSize( 24, 24 );
    forwButton->setPixmap( QPixmap( forward_xpm ) );
    QToolTip::add( forwButton, i18n("Forward") );
    connect( forwButton, SIGNAL(clicked()), napp->player(), SLOT(forward()) );

    slider = new L33tSlider( 0, 1000, 10, 0, L33tSlider::Horizontal, ctlFrame );
    slider->setFixedHeight( 24 );
    slider->setMinimumWidth( 100 );
    slider->setTickmarks( QSlider::NoMarks );
    connect( slider, SIGNAL(userChanged(int)), SLOT(slotSkipTo(int)) );
    connect( slider, SIGNAL(sliderMoved(int)), SLOT(slotSliderMoved(int)) );

    QPushButton *playlistButton = new QPushButton( ctlFrame );
    playlistButton->setFixedSize( 24, 24 );
    playlistButton->setPixmap( QPixmap( playlist_xpm ) );
    QToolTip::add( playlistButton, i18n("Playlist") );
    connect( playlistButton, SIGNAL(clicked()), napp->player(), SLOT(toggleListView()) );

    volumeButton = new QPushButton( ctlFrame );
    volumeButton->setFixedSize( 24, 24 );
    volumeButton->setPixmap( QPixmap( volume_xpm ) );
    QToolTip::add( volumeButton, i18n("Volume") );

    volumeFrame = new QVBox( this, "Volume", WStyle_Customize | WType_Popup );
    volumeFrame->setFrameStyle( QFrame::PopupPanel );
    volumeFrame->setMargin( 4 );

    volumeLabel = new QLabel( volumeFrame );
    volumeLabel->setText( "100%" );
    volumeLabel->setAlignment( AlignCenter );
    volumeLabel->setFixedSize( volumeLabel->sizeHint() );

    QHBox *volumeSubFrame = new QHBox( volumeFrame );
    volumeSlider = new L33tSlider( 0, 100, 10, 0, Vertical, volumeSubFrame );
    volumeSlider->setValue( 100 - napp->player()->volume() );
    volumeSlider->setFixedSize( volumeSlider->sizeHint() );

    volumeFrame->resize( volumeFrame->sizeHint() );

    connect( volumeSlider, SIGNAL(sliderMoved(int)), SLOT(slotVolumeSliderMoved(int)) );
    connect( volumeSlider, SIGNAL(userChanged(int)), SLOT(slotVolumeSliderMoved(int)) );
    connect( volumeButton, SIGNAL(clicked()), SLOT(slotVolumeFrame()) );

    setCentralWidget( npWidget );

    video->setMinimumSize( minimumSizeHint().width(), 1 );

    // Create properties dialog
    propertiesDialog = new PropertiesDialog( this );
    propertiesDialog->resize( 375, 285 );
}