void toResultLong::query(const QString &sql, const toQueryParams ¶m) { setSqlAndParams(sql, param); slotStop(); Query = NULL; LastItem = NULL; RowNumber = 0; First = true; clear(); setSorting( -1); if (NumberColumn) { addColumn(QString::fromLatin1("#")); setColumnAlignment(0, Qt::AlignRight); } if (Filter) Filter->startingQuery(); try { Query = new toEventQuery(this , connection() , sql , param //, Statistics , toEventQuery::READ_ALL ); connect(Query, SIGNAL(dataAvailable(toEventQuery*)), this, SLOT(slotAddItem())); connect(Query, SIGNAL(done(toEventQuery*)), this, SLOT(slotQueryDone())); if (ReadAll) { MaxNumber = -1; //// Query->slotReadAll(); // indicate that all records should be fetched } else MaxNumber = toConfigurationNewSingle::Instance().option(ToConfiguration::Database::InitialFetchInt).toInt(); Query->start(); } catch (const toConnection::exception &str) { First = false; emit firstResult(toResult::sql(), str, true); emit done(); //// if (Mode != toQuery::Long) Utils::toStatusMessage(str); } catch (const QString &str) { First = false; emit firstResult(toResult::sql(), str, true); emit done(); //// if (Mode != toQuery::Long) Utils::toStatusMessage(str); } updateContents(); }
Receiver::Receiver() { QVBoxLayout *lay = new QVBoxLayout(this); QPushButton *h = new QPushButton(QStringLiteral("Press here to terminate"), this); lay->addWidget(h); connect(h, SIGNAL(clicked()), qApp, SLOT(quit())); start = new QPushButton(QStringLiteral("Launch KRuns"), this); lay->addWidget(start); connect(start, SIGNAL(clicked()), this, SLOT(slotStart())); stop = new QPushButton(QStringLiteral("Stop those KRuns"), this); stop->setEnabled(false); lay->addWidget(stop); connect(stop, SIGNAL(clicked()), this, SLOT(slotStop())); QPushButton *launchOne = new QPushButton(QStringLiteral("Launch one http KRun"), this); lay->addWidget(launchOne); connect(launchOne, SIGNAL(clicked()), this, SLOT(slotLaunchOne())); for (uint i = 0; i < sizeof(s_tests) / sizeof(*s_tests); ++i) { QHBoxLayout *hbox = new QHBoxLayout; lay->addLayout(hbox); QPushButton *button = new QPushButton(s_tests[i].text, this); button->setProperty("testNumber", i); hbox->addWidget(button); QLabel *label = new QLabel(s_tests[i].expectedResult, this); hbox->addWidget(label); connect(button, SIGNAL(clicked()), this, SLOT(slotLaunchTest())); hbox->addStretch(); } adjustSize(); show(); }
GuiCoordinator::GuiCoordinator(void){ qDebug() << "GuiCoordinator constructor"; _mainWindow=new MainWindow(); // MainWindow -> GuiCoordinator : load the Table /*connect( _mainWindow, SIGNAL(robotFileXml(const QString&,const QString&)), this, SLOT(forwardRobotNameXml(const QString&,const QString&)) ); */ connect(_mainWindow, SIGNAL(uiPlay()), this, SLOT(slotPlay())); connect(_mainWindow, SIGNAL(uiPause()), this, SLOT(slotPause())); connect(_mainWindow, SIGNAL(uiStop()), this, SLOT(slotStop())); connect(_mainWindow, SIGNAL(close()), this, SLOT(slotClose())); }
MpdWidget::MpdWidget(QWidget *parent) : QWidget(parent) , aktPlay(false), aktStop(false) { timerMpd = new QTimer(); timerMpd->setInterval(100); connect(timerMpd, SIGNAL(timeout()), this, SLOT(psMpdHB())); timerMpd->start(); labelSender = new ScrollText(); labelVol = new ScrollText(); labelTitle = new ScrollText(); buttonPlay = new QPushButton("Play"); connect(buttonPlay, SIGNAL(clicked()), this, SLOT(slotPlay())); buttonStop = new QPushButton("Stop"); connect(buttonStop, SIGNAL(clicked()), this, SLOT(slotStop())); QBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addWidget(buttonPlay); buttonLayout->addWidget(buttonStop); QBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addWidget(labelTitle); mainLayout->addWidget(labelSender); mainLayout->addWidget(labelVol); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); }
KfmView::~KfmView() { // debugT("Deleting KfmView\n"); if ( dropZone != 0L ) delete dropZone; dropZone = 0L; // MRJ: make sure all requests are cancelled before the cache is deleted slotStop(); delete manager; delete htmlCache; if(getParentView() == 0) { delete backStack; delete forwardStack; } // debugT("Deleted\n"); // Save HTTP Cookies if (cookiejar) { QString cookieFile = kapp->localkdedir().copy(); cookieFile += "/share/apps/kfm/cookies"; cookiejar->saveCookies( cookieFile.data() ); } }
//--------------------------------------------------------------------------- // //! \brief release connection to buttons and remove stored button pointer // //! \author Jo2003 //! \date 26.11.2012 // //! \param -- // //! \return -- //--------------------------------------------------------------------------- void QFusionControl::disconnectBtn() { disconnect(this, SLOT(slotPlay())); _playBtnVector.clear(); disconnect(this, SLOT(slotRec())); _recBtnVector.clear(); disconnect(this, SLOT(slotStop())); _stopBtnVector.clear(); disconnect(this, SLOT(slotFwd())); _fwdBtnVector.clear(); disconnect(this, SLOT(slotBwd())); _bwdBtnVector.clear(); disconnect(this, SLOT(slotFs())); _fsBtnVector.clear(); disconnect(this, SLOT(slotScrShot())); _scrShtBtnVector.clear(); disconnect(this, SLOT(slotEnterWndwd())); _wndModBtnVector.clear(); disconnect(this, SLOT(slotSaveVideoFormat())); _frmtBtnVector.clear(); }
FMMatchRaster::FMMatchRaster ( QWidget * parent ) :QDialog ( parent ) { setupUi ( this ); QSettings settings; m_compsize = settings.value ( "MatchRaster/CompareSize", 120 ).toInt(); m_matchLimit = settings.value ( "MatchRaster/Limit", 800.0 ).toDouble(); m_minRefSize = settings.value ( "MatchRaster/ReferenceSize", 160 ).toInt(); m_progressValue = 0; m_waitingForButton = false; waitingFont = 0; refCodepoint = 0; connect ( browseButton,SIGNAL ( clicked() ),this, SLOT ( browseImage() ) ); connect ( grabZoom , SIGNAL ( valueChanged(int) ) ,this, SLOT ( zoomChanged(int)) ); connect ( grabModeBox , SIGNAL ( toggled(bool) ) ,this, SLOT ( enterGrabMode(bool) ) ); connect ( tweakRectBox, SIGNAL(toggled(bool)),this,SLOT(switchControlRect(bool))); connect ( letter,SIGNAL ( textChanged ( const QString & ) ),this,SLOT ( addImage ( const QString & ) ) ); connect ( searchButton,SIGNAL ( clicked() ),this,SLOT ( search() ) ); connect ( iView,SIGNAL ( rectChange ( QRect ) ),this,SLOT ( recordCurrentRect ( QRect ) ) ); connect ( iView,SIGNAL ( selColorChanged ( QRgb ) ),this,SLOT ( recordCurrentColor ( QRgb ) ) ); connect ( buttonBox,SIGNAL ( rejected() ),this,SLOT ( slotRefuseFont() ) ); connect ( buttonBox,SIGNAL ( accepted() ),this,SLOT ( slotAcceptFont() ) ); connect ( stopButton,SIGNAL ( clicked() ), this, SLOT ( slotStop() ) ); }
LircCommander::LircCommander(LircClient *lirc, RosegardenMainWindow *rgGUIApp) : QObject() { m_lirc = lirc; m_rgGUIApp = rgGUIApp; connect(m_lirc, SIGNAL(buttonPressed(const char *)), this, SLOT(slotExecute(const char *)) ); connect(this, SIGNAL(play()), m_rgGUIApp, SLOT(slotPlay()) ); connect(this, SIGNAL(stop()), m_rgGUIApp, SLOT(slotStop()) ); connect(this, SIGNAL(record()), m_rgGUIApp, SLOT(slotRecord()) ); connect(this, SIGNAL(rewind()), m_rgGUIApp, SLOT(slotRewind()) ); connect(this, SIGNAL(rewindToBeginning()), m_rgGUIApp, SLOT(slotRewindToBeginning()) ); connect(this, SIGNAL(fastForward()), m_rgGUIApp, SLOT(slotFastforward()) ); connect(this, SIGNAL(fastForwardToEnd()), m_rgGUIApp, SLOT(slotFastForwardToEnd()) ); connect(this, SIGNAL(toggleRecord()), m_rgGUIApp, SLOT(slotToggleRecord()) ); connect(this, SIGNAL(trackDown()), m_rgGUIApp, SLOT(slotTrackDown()) ); connect(this, SIGNAL(trackUp()), m_rgGUIApp, SLOT(slotTrackUp()) ); connect(this, SIGNAL(trackMute()), m_rgGUIApp, SLOT(slotToggleMute()) ); connect(this, SIGNAL(trackRecord()), m_rgGUIApp, SLOT(slotToggleRecordCurrentTrack()) ); connect(this, SIGNAL(undo()), CommandHistory::getInstance(), SLOT(undo()) ); connect(this, SIGNAL(redo()), CommandHistory::getInstance(), SLOT(redo()) ); connect(this, SIGNAL(aboutrg()), m_rgGUIApp, SLOT(slotHelpAbout()) ); connect(this, SIGNAL(editInMatrix()), m_rgGUIApp, SLOT(slotEditInMatrix()) ); connect(this, SIGNAL(editInPercussionMatrix()), m_rgGUIApp, SLOT(slotEditInPercussionMatrix()) ); connect(this, SIGNAL(editInEventList()), m_rgGUIApp, SLOT(slotEditInEventList()) ); connect(this, SIGNAL(editAsNotation()), m_rgGUIApp, SLOT(slotEditAsNotation()) ); connect(this, SIGNAL(quit()), m_rgGUIApp, SLOT(slotQuit()) ); connect(this, SIGNAL(closeTransport()), m_rgGUIApp, SLOT(slotCloseTransport()) ); connect(this, SIGNAL(toggleTransportVisibility()), m_rgGUIApp, SLOT(slotToggleTransportVisibility()) ); }
void MainWnd::keyReleaseEvent( QKeyEvent * event ) { switch( event->key() ) { case Qt::Key_W: case Qt::Key_S: case Qt::Key_A: case Qt::Key_D: slotStop(); break; } }
void toResultTableView::setup(bool readable, bool numberColumn, bool editable) { Statistics = NULL; Menu = NULL; ReadAll = false; Filter = NULL; VisibleColumns = 0; ReadableColumns = readable; NumberColumn = numberColumn; ColumnsResized = false; Ready = false; Finished = false; Working = new toWorkingWidget(this); connect(Working, SIGNAL(stop()), this, SLOT(slotStop())); Working->hide(); // hide by default createActions(); setSelectionBehavior(QAbstractItemView::SelectItems); setSelectionMode(QAbstractItemView::ContiguousSelection); setAlternatingRowColors(true); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotDisplayMenu(const QPoint &))); connect(horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(slotColumnWasResized(int, int, int))); connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotHandleDoubleClick(const QModelIndex &))); setDragEnabled(true); setDropIndicatorShown(true); // this is my dirty hack to prevent fetchMore being called on the // model during a horizontal scroll. // this would be one great way to fix it, but as of this time it's // prioritized low and not scheduled for a fix: // https://bugreports.qt-project.org/browse/QTBUG-9988 disconnect(QTableView::horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollbarValueChanged(int))); }
Receiver::Receiver() { QVBoxLayout *lay = new QVBoxLayout(this); lay->setAutoAdd(true); QPushButton *h = new QPushButton("Press here to terminate", this); start = new QPushButton("Launch KRuns", this); stop = new QPushButton("Stop those KRuns", this); stop->setEnabled(false); QObject::connect(h, SIGNAL(clicked()), kapp, SLOT(quit())); QObject::connect(start, SIGNAL(clicked()), this, SLOT(slotStart())); QObject::connect(stop, SIGNAL(clicked()), this, SLOT(slotStop())); adjustSize(); show(); }
void toEventQuery::start() { if ( Worker || Started || WorkDone ) throw tr("toEventQuery::start - can not restart already stared query"); Worker = new toEventQueryWorker(this, Connection, CancelCondition, SQL, Param); Worker->moveToThread(Thread); Thread->Slave = Worker; // Connect to Worker's API connect(Worker, SIGNAL(headers(toQColumnDescriptionList &, int)), // BG -> main this, SLOT(slotDesc(toQColumnDescriptionList &, int))); connect(Worker, SIGNAL(data(const ValuesList &)), // BG -> main this, SLOT(slotData(const ValuesList &))); connect(Worker, SIGNAL(error(const toConnection::exception &)), // BG -> main this, SLOT(slotError(const toConnection::exception &))); connect(Worker, SIGNAL(workDone()), // BG -> main this, SLOT(slotFinished())); connect(Worker, SIGNAL(rowsProcessed(unsigned long)), // BG -> main this, SLOT(slotRowsProcessed(unsigned long))); connect(this, SIGNAL(dataRequested()), Worker, SLOT(slotRead())); // main -> BG connect(this, SIGNAL(consumed()), Worker, SLOT(slotRead())); // main -> BG // Connect to QThread's API // error handling connect(Worker, SIGNAL(error(toConnection::exception const &)) // BG -> main , this, SLOT(slotError(toConnection::exception const &))); // initization connect(Thread, SIGNAL(started()), Worker, SLOT(init())); // main -> BG connect(Worker, SIGNAL(started()), this, SLOT(slotStarted()));// BG -> main // finish connect(Worker, SIGNAL(finished()), Thread, SLOT(quit())); // BG -> BG?? (quit event loop) connect(Worker, SIGNAL(finished()), Worker, SLOT(deleteLater())); // BG -> BG connect(Thread, SIGNAL(finished()), Thread, SLOT(deleteLater())); // BG -> main connect(Thread, SIGNAL(destroyed()), this, SLOT(slotThreadEnd())); // main -> main connect(this, SIGNAL(stopRequested()), Worker, SLOT(slotStop())); // main -> BG TLOG(7, toDecorator, __HERE__) << "toEventQuery start" << std::endl; // finally start the thread Thread->start(); }
void FVAnimation::setupMenu( ) { contextMenuObj->clear(); acPlay = contextMenuObj->addAction(tr("&Play"), this, SLOT( slotPlay() ) ); acPause = contextMenuObj->addAction(tr("&Pause"), this, SLOT( slotPause() ) ); acStop = contextMenuObj->addAction(tr("&Stop"), this, SLOT( slotStop() ) ); acPause->setEnabled( false ); acStop->setEnabled( false ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Update"), this, SLOT( slotUpdate() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) ); }
ThreadDlg::ThreadDlg(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("线程")); startBtn = new QPushButton(tr("开始")); stopBtn = new QPushButton(tr("停止")); quitBtn = new QPushButton(tr("退出")); QHBoxLayout *mainLayout = new QHBoxLayout(this); mainLayout->addWidget(startBtn); mainLayout->addWidget(stopBtn); mainLayout->addWidget(quitBtn); connect(startBtn,SIGNAL(clicked()),this,SLOT(slotStart())); connect(stopBtn,SIGNAL(clicked()),this,SLOT(slotStop())); connect(quitBtn,SIGNAL(clicked()),this,SLOT(close())); }
bool QueueMgrWindow::queryClose() { if (isBusy()) { int result = QMessageBox::warning(this, i18n("Processing under progress"), i18n("Batch Queue Manager is running. Do you want to cancel current job?"), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { slotStop(); } else if (result == QMessageBox::No) { return false; } } return true; }
void k2send::setupActions() { KAction *action; KShortcut cut; setXMLFile( "k2sendui.rc" ); KStdAction::openNew(this, SLOT(fileNew()), actionCollection(),"file_new"); KStdAction::open(this, SLOT(fileOpen()), actionCollection(),"file_open"); action = new KAction(i18n("Import Playlist"), cut, this, SLOT(importPlaylist()), actionCollection(), "file_import"); KStdAction::print(this, SLOT(filePrint()), actionCollection(),"file_print"); KStdAction::quit(kapp, SLOT(quit()), actionCollection(),"file_quit"); m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection(),"preferences"); action = new KAction(i18n("Remove"), "editdelete", cut, m_view, SLOT(slotRemoveBranch()), actionCollection(), "file_remove"); action = new KAction(i18n("Play"), "player_play", cut, m_view, SLOT(slotPlay()), actionCollection(), "player_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotStop()), actionCollection(), "player_stop"); action = new KAction(i18n("Next"), "player_fwd", cut,m_view, SLOT(slotSkip()), actionCollection(), "player_next"); action = new KAction(i18n("Loudness"), 0, cut,m_view, SLOT(slotLoudness()), actionCollection(), "player_loudness"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotPlaylistClear()), actionCollection(), "playlist_clear"); action = new KAction(i18n("Play"), "player_play", cut,m_view, SLOT(slotConsolePlay()), actionCollection(), "console_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotConsoleStop()), actionCollection(), "console_stop"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotConsoleClear()), actionCollection(), "console_clear"); createGUI(); }
k2send::k2send() : KMainWindow( 0, "k2send" ), m_printer(0) { m_config = new KConfig("k2send"); m_view = new k2sendWidget(this,"k2sendwidget",0,m_config); setAcceptDrops(FALSE); setCentralWidget(m_view); setupActions(); statusBar()->show(); setAutoSaveSettings(); statusBar()->insertFixedItem("9999 Files", 0, true); statusBar()->insertFixedItem("00:00:00", 1, true); statusBar()->insertFixedItem("000 kbit/s", 2, true); statusBar()->insertFixedItem("Loud: 0", 3, true); statusBar()->insertFixedItem("00:00:00:00:00:00 ", 4, true); statusBar()->changeItem ("0 Files", 0); statusBar()->changeItem ("0 kbit/s", 2); trayicon = new KSystemTray(this, "k2sendtray"); trayicon->show(); trayicon->setPixmap (DesktopIcon( "k2send", 24)); KPopupMenu * pop = trayicon->contextMenu() ; pop->insertItem(DesktopIcon( "player_play", 16 ), "Play", m_view, SLOT(slotPlay()), CTRL+Key_P ,1,1); pop->insertItem(DesktopIcon( "player_stop", 16 ), "Stop", m_view, SLOT(slotStop()), CTRL+Key_S ,2,2); pop->insertItem(DesktopIcon( "player_fwd", 16 ), "Next", m_view, SLOT(slotSkip()), CTRL+Key_N ,3,3); pop->insertItem( "Loundess", m_view, SLOT(slotLoudness()), CTRL+Key_L ,4,4); connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), this, SLOT(changeStatusbar(const QString&))); connect(m_view, SIGNAL(signalChangeCaption(const QString&)), this, SLOT(changeCaption(const QString&))); }
//--------------------------------------------------------------------------- // //! \brief add button to control // //! \author Jo2003 //! \date 26.11.2012 // //! \param pBtn pointer to pushbutton //! \param role role for button (start, stop, rec, ...) // //! \return -- //--------------------------------------------------------------------------- void QFusionControl::addButton (QPushButton *pBtn, eBtnRole role) { switch (role) { case BTN_PLAY: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotPlay())); // add to vector ... _playBtnVector.append(pBtn); break; case BTN_REC: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotRec())); // add to vector ... _recBtnVector.append(pBtn); break; case BTN_STOP: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotStop())); // add to vector ... _stopBtnVector.append(pBtn); break; case BTN_FWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotFwd())); // add to vector ... _fwdBtnVector.append(pBtn); break; case BTN_BWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotBwd())); // add to vector ... _bwdBtnVector.append(pBtn); break; case BTN_FS: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotFs())); // add to vector ... _fsBtnVector.append(pBtn); break; case BTN_FRMT: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotSaveVideoFormat())); // add to vector ... _frmtBtnVector.append(pBtn); break; case BTN_SCRSHOT: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotScrShot())); // add to vector ... _scrShtBtnVector.append(pBtn); break; case BTN_WNDWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotEnterWndwd())); // add to vector ... _wndModBtnVector.append(pBtn); break; default: break; } }
PlaybackWidget::PlaybackWidget(QWidget* parent, KUrl::List &urls, SharedContainer* sharedData) : QWidget(parent) { setupUi(this); m_sharedData = sharedData; m_currIndex = 0; m_urlList = urls; m_stopCalled = false; m_canHide = true; m_soundLabel->setPixmap(KIcon("speaker").pixmap(64, 64)); m_prevButton->setText(""); m_nextButton->setText(""); m_playButton->setText(""); m_stopButton->setText(""); m_prevButton->setIcon(KIcon("media-skip-backward")); m_nextButton->setIcon(KIcon("media-skip-forward")); m_playButton->setIcon(KIcon("media-playback-start")); m_stopButton->setIcon(KIcon("media-playback-stop")); connect(m_prevButton, SIGNAL(clicked()), this, SLOT(slotPrev())); connect(m_nextButton, SIGNAL(clicked()), this, SLOT(slotNext())); connect(m_playButton, SIGNAL(clicked()), this, SLOT(slotPlay())); connect(m_stopButton, SIGNAL(clicked()), this, SLOT(slotStop())); if (m_urlList.empty()) { setEnabled(false); return; } // Waiting for files to be enqueued. m_playButton->setEnabled(false); m_prevButton->setEnabled(false); // Phonon m_mediaObject = new Phonon::MediaObject(this); m_mediaObject->setTransitionTime(1000); m_mediaObject->setTickInterval(500); connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(slotMediaStateChanged(Phonon::State,Phonon::State))); connect(m_mediaObject, SIGNAL(finished()), this, SLOT(slotSongFinished())); connect(m_mediaObject, SIGNAL(tick(qint64)), this, SLOT(slotTimeUpdaterTimeout())); m_audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(m_mediaObject, m_audioOutput); m_volumeSlider->setAudioOutput(m_audioOutput); m_volumeSlider->setOrientation(Qt::Horizontal); setZeroTime(); // Loading first song m_mediaObject->setCurrentSource(static_cast<QUrl>(m_urlList[m_currIndex])); }
/* * Constructs a MakeLayout as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ MakeLayout::MakeLayout( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { if ( !name ) setName( "MakeLayout" ); MakeLayoutLayout = new QVBoxLayout( this, 11, 6, "MakeLayoutLayout"); layout10 = new QGridLayout( 0, 1, 1, 0, 6, "layout10"); textLabel1 = new QLabel( this, "textLabel1" ); layout10->addWidget( textLabel1, 0, 0 ); m_pCommandHistory = new KHistoryCombo( this, "m_pCommandHistory" ); m_pCommandHistory->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, m_pCommandHistory->sizePolicy().hasHeightForWidth() ) ); layout10->addWidget( m_pCommandHistory, 1, 1 ); m_pRootURL = new KURLRequester( this, "m_pRootURL" ); layout10->addWidget( m_pRootURL, 0, 1 ); textLabel2 = new QLabel( this, "textLabel2" ); layout10->addWidget( textLabel2, 1, 0 ); MakeLayoutLayout->addLayout( layout10 ); tabWidget2 = new QTabWidget( this, "tabWidget2" ); tab = new QWidget( tabWidget2, "tab" ); tabLayout = new QVBoxLayout( tab, 11, 6, "tabLayout"); m_pOutputBrowser = new KTextBrowser( tab, "m_pOutputBrowser" ); tabLayout->addWidget( m_pOutputBrowser ); tabWidget2->insertTab( tab, QString::fromLatin1("") ); tab_2 = new QWidget( tabWidget2, "tab_2" ); tabLayout_2 = new QVBoxLayout( tab_2, 11, 6, "tabLayout_2"); m_pErrorView = new QueryView( tab_2, "m_pErrorView" ); tabLayout_2->addWidget( m_pErrorView ); tabWidget2->insertTab( tab_2, QString::fromLatin1("") ); MakeLayoutLayout->addWidget( tabWidget2 ); layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); spacer1 = new QSpacerItem( 520, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout7->addItem( spacer1 ); m_pMakeButton = new QPushButton( this, "m_pMakeButton" ); m_pMakeButton->setDefault( TRUE ); layout7->addWidget( m_pMakeButton ); m_pStopButton = new QPushButton( this, "m_pStopButton" ); m_pStopButton->setEnabled( FALSE ); layout7->addWidget( m_pStopButton ); m_pCloseButton = new QPushButton( this, "m_pCloseButton" ); layout7->addWidget( m_pCloseButton ); MakeLayoutLayout->addLayout( layout7 ); languageChange(); resize( QSize(768, 642).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( m_pCloseButton, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( m_pMakeButton, SIGNAL( clicked() ), this, SLOT( slotMake() ) ); connect( m_pStopButton, SIGNAL( clicked() ), this, SLOT( slotStop() ) ); connect( m_pCommandHistory, SIGNAL( returnPressed() ), this, SLOT( slotMake() ) ); // tab order setTabOrder( m_pRootURL, m_pCommandHistory ); setTabOrder( m_pCommandHistory, m_pMakeButton ); setTabOrder( m_pMakeButton, m_pStopButton ); setTabOrder( m_pStopButton, m_pCloseButton ); }
KateBuildView::KateBuildView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw) : QObject (mw) , m_buildWidget(0) , m_outputWidgetWidth(0) , m_proc(0) , m_buildCancelled(false) , m_displayModeBeforeBuild(1) // NOTE this will not allow spaces in file names. // e.g. from gcc: "main.cpp:14: error: cannot convert ‘std::string’ to ‘int’ in return" , m_filenameDetector(QStringLiteral("(([a-np-zA-Z]:[\\\\/])?[a-zA-Z0-9_\\.\\-/\\\\]+\\.[a-zA-Z0-9]+):([0-9]+)(.*)")) // e.g. from icpc: "main.cpp(14): error: no suitable conversion function from "std::string" to "int" exists" , m_filenameDetectorIcpc(QStringLiteral("(([a-np-zA-Z]:[\\\\/])?[a-zA-Z0-9_\\.\\-/\\\\]+\\.[a-zA-Z0-9]+)\\(([0-9]+)\\)(:.*)")) , m_filenameDetectorGccWorked(false) , m_newDirDetector(QStringLiteral("make\\[.+\\]: .+ `.*'")) { m_win=mw; KXMLGUIClient::setComponentName (QLatin1String("katebuild"), i18n ("Kate Build Plugin")); setXMLFile(QLatin1String("ui.rc")); m_toolView = mw->createToolView(plugin, QStringLiteral("kate_plugin_katebuildplugin"), KTextEditor::MainWindow::Bottom, QIcon::fromTheme(QStringLiteral("application-x-ms-dos-executable")), i18n("Build Output")); QAction *a = actionCollection()->addAction(QStringLiteral("select_target")); a->setText(i18n("Select Target...")); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotSelectTarget())); a = actionCollection()->addAction(QStringLiteral("build_default_target")); a->setText(i18n("Build Default Target")); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotBuildDefaultTarget())); a = actionCollection()->addAction(QStringLiteral("build_previous_target")); a->setText(i18n("Build Previous Target")); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotBuildPreviousTarget())); a = actionCollection()->addAction(QStringLiteral("stop")); a->setText(i18n("Stop")); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotStop())); a = actionCollection()->addAction(QStringLiteral("goto_next")); a->setText(i18n("Next Error")); actionCollection()->setDefaultShortcut(a, Qt::CTRL+Qt::ALT+Qt::Key_Right); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotNext())); a = actionCollection()->addAction(QStringLiteral("goto_prev")); a->setText(i18n("Previous Error")); actionCollection()->setDefaultShortcut(a, Qt::CTRL+Qt::ALT+Qt::Key_Left); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrev())); m_buildWidget = new QWidget(m_toolView); m_buildUi.setupUi(m_buildWidget); m_targetsUi = new TargetsUi(this, m_buildUi.u_tabWidget); m_buildUi.u_tabWidget->insertTab(0, m_targetsUi, i18nc("Tab label", "Target Settings")); m_buildUi.u_tabWidget->setCurrentWidget(m_targetsUi); m_buildWidget->installEventFilter(this); m_buildUi.buildAgainButton->setVisible(true); m_buildUi.cancelBuildButton->setVisible(true); m_buildUi.buildStatusLabel->setVisible(true); m_buildUi.buildAgainButton2->setVisible(false); m_buildUi.cancelBuildButton2->setVisible(false); m_buildUi.buildStatusLabel2->setVisible(false); m_buildUi.extraLineLayout->setAlignment(Qt::AlignRight); m_buildUi.cancelBuildButton->setEnabled(false); m_buildUi.cancelBuildButton2->setEnabled(false); connect(m_buildUi.errTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(slotErrorSelected(QTreeWidgetItem*))); m_buildUi.plainTextEdit->setReadOnly(true); slotDisplayMode(FullOutput); connect(m_buildUi.displayModeSlider, SIGNAL(valueChanged(int)), this, SLOT(slotDisplayMode(int))); connect(m_buildUi.buildAgainButton, SIGNAL(clicked()), this, SLOT(slotBuildPreviousTarget())); connect(m_buildUi.cancelBuildButton, SIGNAL(clicked()), this, SLOT(slotStop())); connect(m_buildUi.buildAgainButton2, SIGNAL(clicked()), this, SLOT(slotBuildPreviousTarget())); connect(m_buildUi.cancelBuildButton2, SIGNAL(clicked()), this, SLOT(slotStop())); connect(m_targetsUi->newTarget, SIGNAL(clicked()), this, SLOT(targetSetNew())); connect(m_targetsUi->copyTarget, SIGNAL(clicked()), this, SLOT(targetOrSetCopy())); connect(m_targetsUi->deleteTarget, SIGNAL(clicked()), this, SLOT(targetDelete())); connect(m_targetsUi->addButton, SIGNAL(clicked()), this, SLOT(slotAddTargetClicked())); connect(m_targetsUi->buildButton, SIGNAL(clicked()), this, SLOT(slotBuildActiveTarget())); connect(m_targetsUi, SIGNAL(enterPressed()), this, SLOT(slotBuildActiveTarget())); m_proc = new KProcess(); m_proc->setOutputChannelMode(KProcess::SeparateChannels); connect(m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotProcExited(int,QProcess::ExitStatus))); connect(m_proc, SIGNAL(readyReadStandardError()),this, SLOT(slotReadReadyStdErr())); connect(m_proc, SIGNAL(readyReadStandardOutput()),this, SLOT(slotReadReadyStdOut())); connect(m_win, SIGNAL(unhandledShortcutOverride(QEvent*)), this, SLOT(handleEsc(QEvent*))); m_toolView->installEventFilter(this); m_win->guiFactory()->addClient(this); // watch for project plugin view creation/deletion connect(m_win, SIGNAL(pluginViewCreated (const QString &, QObject *)) , this, SLOT(slotPluginViewCreated (const QString &, QObject *))); connect(m_win, SIGNAL(pluginViewDeleted (const QString &, QObject *)) , this, SLOT(slotPluginViewDeleted (const QString &, QObject *))); // update once project plugin state manually m_projectPluginView = m_win->pluginView (QStringLiteral("kateprojectplugin")); slotProjectMapChanged (); }
void CDeviceDetailView::constructLayout() { // Create the buttons // ... edit pqPushButtonEdit = new QPushButton( QIcon( ":icons/32x32/edit.png" ), "" ); pqPushButtonEdit->setMaximumSize( 36, 34 ); pqPushButtonEdit->setToolTip( tr("Edit this device's configuration") ); pqPushButtonEdit->setEnabled( false ); QWidget::connect( pqPushButtonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); // ... delete pqPushButtonDelete = new QPushButton( QIcon( ":icons/32x32/delete.png" ), "" ); pqPushButtonDelete->setMaximumSize( 36, 34 ); pqPushButtonDelete->setToolTip( tr("Delete this device") ); pqPushButtonDelete->setEnabled( false ); QWidget::connect( pqPushButtonDelete, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); // ... stop pqPushButtonStop = new QPushButton( QIcon( ":icons/32x32/stop.png" ), "" ); pqPushButtonStop->setMaximumSize( 36, 34 ); pqPushButtonStop->setToolTip( tr("Stop this device") ); pqPushButtonStop->setCheckable( true ); pqPushButtonStop->setEnabled( false ); QWidget::connect( pqPushButtonStop, SIGNAL( clicked() ), this, SLOT( slotStop() ) ); // ... pause pqPushButtonPause = new QPushButton( QIcon( ":icons/32x32/pause.png" ), "" ); pqPushButtonPause->setMaximumSize( 36, 34 ); pqPushButtonPause->setToolTip( tr("Pause this device") ); pqPushButtonPause->setCheckable( true ); pqPushButtonPause->setEnabled( false ); QWidget::connect( pqPushButtonPause, SIGNAL( clicked() ), this, SLOT( slotPause() ) ); // ... start pqPushButtonStart = new QPushButton( QIcon( ":icons/32x32/start.png" ), "" ); pqPushButtonStart->setMaximumSize( 36, 34 ); pqPushButtonStart->setToolTip( tr("Start this device") ); pqPushButtonStart->setCheckable( true ); pqPushButtonStart->setEnabled( false ); QWidget::connect( pqPushButtonStart, SIGNAL( clicked() ), this, SLOT( slotStart() ) ); // Create layout QVBoxLayout* __pqVBoxLayout = new QVBoxLayout(); // Add header QFont __qFontHeader; __qFontHeader.setPixelSize( 16 ); __qFontHeader.setBold( true ); QHBoxLayout* __pqHBoxLayoutHeader = new QHBoxLayout(); QLabel* __pqLabelIcon = new QLabel(); __pqLabelIcon->setPixmap( QPixmap( ":icons/32x32/device.png" ) ); __pqLabelIcon->setToolTip( tr("Device") ); __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop ); poTextName = new COverlayText(); poTextName->setToolTip( tr("Name") ); poTextName->setFont( __qFontHeader ); poTextName->setWordWrap( true ); __pqHBoxLayoutHeader->addWidget( poTextName, 1 ); __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader ); // Add data QFont __qFontData; QTabWidget* __poTabWidget = new QTabWidget(); __poTabWidget->setTabPosition( QTabWidget::South ); __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); // ... summary QWidget* __poWidgetSummary = new QWidget(); QVBoxLayout* __pqVBoxLayoutSummary = new QVBoxLayout(); __qFontData.setPixelSize( 20 ); poTextDriver = new COverlayText(); poTextDriver->setToolTip( tr("Driver") ); poTextDriver->setFont( __qFontData ); poTextDriver->setIndent( 10 ); poTextDriver->setAlignment( Qt::AlignHCenter ); poTextDriver->resetText(); __pqVBoxLayoutSummary->addWidget( poTextDriver, 0 ); pqLabelActivity = new COverlayText(); pqLabelActivity->setToolTip( tr("Activity") ); pqLabelActivity->setFont( __qFontData ); pqLabelActivity->setIndent( 10 ); pqLabelActivity->setAlignment( Qt::AlignHCenter ); __pqVBoxLayoutSummary->addWidget( pqLabelActivity, 1 ); __poWidgetSummary->setLayout( __pqVBoxLayoutSummary ); __poTabWidget->addTab( __poWidgetSummary, tr("Summary") ); // ... [end] __pqVBoxLayout->addWidget( __poTabWidget, 1 ); // Add separator QFrame* __pqFrameSeparator = new QFrame(); __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken ); __pqVBoxLayout->addWidget( __pqFrameSeparator ); // Add buttons QHBoxLayout* __pqHBoxLayoutButtons = new QHBoxLayout(); __pqHBoxLayoutButtons->addWidget( pqPushButtonEdit, 0, Qt::AlignLeft ); __pqHBoxLayoutButtons->addWidget( pqPushButtonDelete, 1, Qt::AlignLeft ); __pqHBoxLayoutButtons->addWidget( pqPushButtonStop, 1, Qt::AlignRight ); __pqHBoxLayoutButtons->addWidget( pqPushButtonPause, 0, Qt::AlignRight ); __pqHBoxLayoutButtons->addWidget( pqPushButtonStart, 0, Qt::AlignRight ); __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons ); // Set the layout COverlayObjectDetailView::setLayout( __pqVBoxLayout ); }
ProcessorDlg::ProcessorDlg(const QList<QUrl>& list) : QDialog(0), d(new Private) { setModal(false); setWindowTitle(QString::fromUtf8("Convert RAW files To PNG")); d->buttons = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Close, this); d->thread = new MyActionThread(this); d->list = list; d->count = d->list.count(); qDebug() << d->list; d->page = new QWidget(this); QVBoxLayout* const vbx = new QVBoxLayout(this); vbx->addWidget(d->page); vbx->addWidget(d->buttons); setLayout(vbx); int cpu = d->thread->maximumNumberOfThreads(); QGridLayout* const grid = new QGridLayout(d->page); QLabel* const pid = new QLabel(QString::fromUtf8("Main PID: %1").arg(QCoreApplication::applicationPid()), this); QLabel* const core = new QLabel(QString::fromUtf8("CPU cores available: %1").arg(cpu), this); QWidget* const hbox = new QWidget(this); d->items = new QLabel(this); QHBoxLayout* const hlay = new QHBoxLayout(hbox); QLabel* const coresLabel = new QLabel(QString::fromUtf8("Cores to use: "), this); d->usedCore = new QSpinBox(this); d->usedCore->setRange(1, cpu); d->usedCore->setSingleStep(1); d->usedCore->setValue(cpu); hlay->addWidget(coresLabel); hlay->addWidget(d->usedCore); hlay->setContentsMargins(QMargins()); d->progressView = new QScrollArea(this); QWidget* const progressbox = new QWidget(d->progressView->viewport()); QVBoxLayout* const progressLay = new QVBoxLayout(progressbox); d->progressView->setWidget(progressbox); d->progressView->setWidgetResizable(true); grid->addWidget(pid, 0, 0, 1, 1); grid->addWidget(core, 1, 0, 1, 1); grid->addWidget(hbox, 2, 0, 1, 1); grid->addWidget(d->items, 3, 0, 1, 1); grid->addWidget(d->progressView, 4, 0, 1, 1); foreach (const QUrl& url, d->list) { QProgressBar* const bar = new QProgressBar(progressbox); QString file = url.toLocalFile(); QFileInfo fi(file); bar->setMaximum(100); bar->setMinimum(0); bar->setValue(100); bar->setObjectName(file); bar->setFormat(fi.fileName()); progressLay->addWidget(bar); } progressLay->addStretch(); QPushButton* const applyBtn = d->buttons->button(QDialogButtonBox::Apply); QPushButton* const cancelBtn = d->buttons->button(QDialogButtonBox::Close); connect(applyBtn, SIGNAL(clicked()), this, SLOT(slotStart())); connect(cancelBtn, SIGNAL(clicked()), this, SLOT(slotStop())); connect(d->thread, SIGNAL(starting(QUrl)), this, SLOT(slotStarting(QUrl))); connect(d->thread, SIGNAL(finished(QUrl)), this, SLOT(slotFinished(QUrl))); connect(d->thread, SIGNAL(failed(QUrl,QString)), this, SLOT(slotFailed(QUrl,QString))); connect(d->thread, SIGNAL(progress(QUrl,int)), this, SLOT(slotProgress(QUrl,int))); updateCount(); resize(500, 400); }
TranzportClient::TranzportClient(RosegardenMainWindow* rgGUIApp) : QObject(), device_online(true), previous_buttons(*reinterpret_cast<uint32_t*>(previousbuf+2)), current_buttons(*reinterpret_cast<uint32_t*>(currentbuf+2)), datawheel(currentbuf[6]), status(currentbuf[1]), m_rgGUIApp(rgGUIApp), m_rgDocument(rgGUIApp->getDocument()), m_composition(&m_rgDocument->getComposition()) { m_descriptor = open("/dev/tranzport0",O_RDWR); if (m_descriptor < 0) { throw Exception(qstrtostr(QObject::tr("Failed to open tranzport device /dev/tranzport0"))); } bzero(currentbuf,8); bzero(previousbuf,8); fcntl(m_descriptor,F_SETOWN, getpid()); int socketFlags = fcntl(m_descriptor, F_GETFL, 0); if (socketFlags != -1) { fcntl(m_descriptor, F_SETFL, socketFlags | O_NONBLOCK); } m_socketReadNotifier = new QSocketNotifier(m_descriptor, QSocketNotifier::Read, 0); m_socketWriteNotifier = new QSocketNotifier(m_descriptor, QSocketNotifier::Write,0); connect(m_socketReadNotifier, SIGNAL(activated(int)), this, SLOT(readData())); connect(m_socketWriteNotifier, SIGNAL(activated(int)), this, SLOT(writeCommandQueue())); connect(this, SIGNAL(play()), m_rgGUIApp, SLOT(slotPlay()) ); connect(this, SIGNAL(stop()), m_rgGUIApp, SLOT(slotStop()) ); connect(this, SIGNAL(record()), m_rgGUIApp, SLOT(slotRecord()) ); connect(this, SIGNAL(rewind()), m_rgGUIApp, SLOT(slotRewind()) ); connect(this, SIGNAL(rewindToBeginning()), m_rgGUIApp, SLOT(slotRewindToBeginning()) ); connect(this, SIGNAL(fastForward()), m_rgGUIApp, SLOT(slotFastforward()) ); connect(this, SIGNAL(fastForwardToEnd()), m_rgGUIApp, SLOT(slotFastForwardToEnd()) ); connect(this, SIGNAL(toggleRecord()), m_rgGUIApp, SLOT(slotToggleRecord()) ); connect(this, SIGNAL(trackDown()), m_rgGUIApp, SLOT(slotTrackDown()) ); connect(this, SIGNAL(trackUp()), m_rgGUIApp, SLOT(slotTrackUp()) ); connect(this, SIGNAL(trackMute()), m_rgGUIApp, SLOT(slotToggleMute()) ); connect(this, SIGNAL(trackRecord()), m_rgGUIApp, SLOT(slotToggleRecordCurrentTrack()) ); connect(this, SIGNAL(solo(bool)), m_rgGUIApp, SLOT(slotToggleSolo(bool))); connect(m_rgGUIApp, SIGNAL(documentChanged(RosegardenDocument*)), this, SLOT(documentChanged(RosegardenDocument*))); connect(m_rgDocument, SIGNAL(pointerPositionChanged(timeT)), this, SLOT(pointerPositionChanged(timeT))); connect(m_rgDocument, SIGNAL(loopChanged(timeT,timeT)), this, SLOT(loopChanged(timeT,timeT))); connect(this, SIGNAL(undo()), CommandHistory::getInstance(),SLOT(undo())); connect(this, SIGNAL(redo()), CommandHistory::getInstance(), SLOT(redo())); connect(this, SIGNAL(setPosition(timeT)), m_rgDocument, SLOT(slotSetPointerPosition(timeT))); m_composition->addObserver(this); m_socketWriteNotifier->setEnabled(false); stateUpdate(); RG_DEBUG << "TranzportClient::TranzportClient: connected to tranzport device: " << m_descriptor << endl; }
VCCueList::VCCueList(QWidget* parent, Doc* doc) : VCWidget(parent, doc) , m_chaserID(Function::invalidId()) , m_nextPrevBehavior(DefaultRunFirst) , m_playbackLayout(PlayPauseStop) , m_timer(NULL) , m_primaryIndex(0) , m_secondaryIndex(0) , m_primaryLeft(true) , m_slidersMode(Crossfade) { /* Set the class name "VCCueList" as the object name as well */ setObjectName(VCCueList::staticMetaObject.className()); /* Create a layout for this widget */ QGridLayout* grid = new QGridLayout(this); grid->setSpacing(2); m_linkCheck = new QCheckBox(tr("Link")); grid->addWidget(m_linkCheck, 0, 0, 1, 2, Qt::AlignVCenter | Qt::AlignCenter); m_sl1TopLabel = new QLabel("100%"); m_sl1TopLabel->setAlignment(Qt::AlignHCenter); grid->addWidget(m_sl1TopLabel, 1, 0, 1, 1); m_slider1 = new ClickAndGoSlider(); m_slider1->setSliderStyleSheet(CNG_DEFAULT_STYLE); m_slider1->setFixedWidth(32); m_slider1->setRange(0, 100); m_slider1->setValue(100); grid->addWidget(m_slider1, 2, 0, 1, 1); m_sl1BottomLabel = new QLabel(""); m_sl1BottomLabel->setStyleSheet(cfLabelNoStyle); m_sl1BottomLabel->setAlignment(Qt::AlignCenter); grid->addWidget(m_sl1BottomLabel, 3, 0, 1, 1); connect(m_slider1, SIGNAL(valueChanged(int)), this, SLOT(slotSlider1ValueChanged(int))); m_sl2TopLabel = new QLabel("0%"); m_sl2TopLabel->setAlignment(Qt::AlignHCenter); grid->addWidget(m_sl2TopLabel, 1, 1, 1, 1); m_slider2 = new ClickAndGoSlider(); m_slider2->setSliderStyleSheet(CNG_DEFAULT_STYLE); m_slider2->setFixedWidth(32); m_slider2->setRange(0, 100); m_slider2->setValue(0); m_slider2->setInvertedAppearance(true); grid->addWidget(m_slider2, 2, 1, 1, 1); m_sl2BottomLabel = new QLabel(""); m_sl2BottomLabel->setStyleSheet(cfLabelNoStyle); m_sl2BottomLabel->setAlignment(Qt::AlignCenter); grid->addWidget(m_sl2BottomLabel, 3, 1, 1, 1); connect(m_slider2, SIGNAL(valueChanged(int)), this, SLOT(slotSlider2ValueChanged(int))); slotShowCrossfadePanel(false); /* Create a list for scenes (cues) */ m_tree = new QTreeWidget(this); grid->addWidget(m_tree, 0, 2, 3, 1); m_tree->setSelectionMode(QAbstractItemView::SingleSelection); //m_tree->setAlternatingRowColors(true); m_tree->setAllColumnsShowFocus(true); m_tree->setRootIsDecorated(false); m_tree->setItemsExpandable(false); m_tree->header()->setSortIndicatorShown(false); m_tree->header()->setMinimumSectionSize(0); // allow columns to be hidden #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) m_tree->header()->setClickable(false); m_tree->header()->setMovable(false); #else m_tree->header()->setSectionsClickable(false); m_tree->header()->setSectionsMovable(false); #endif // Make only the notes column editable m_tree->setItemDelegateForColumn(COL_NUM, new NoEditDelegate(this)); m_tree->setItemDelegateForColumn(COL_NAME, new NoEditDelegate(this)); m_tree->setItemDelegateForColumn(COL_FADEIN, new NoEditDelegate(this)); m_tree->setItemDelegateForColumn(COL_FADEOUT, new NoEditDelegate(this)); m_tree->setItemDelegateForColumn(COL_DURATION, new NoEditDelegate(this)); connect(m_tree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(slotItemActivated(QTreeWidgetItem*))); connect(m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotItemChanged(QTreeWidgetItem*,int))); m_progress = new QProgressBar(this); m_progress->setOrientation(Qt::Horizontal); m_progress->setStyleSheet(progressDisabledStyle); m_progress->setProperty("status", 0); m_progress->setFixedHeight(20); grid->addWidget(m_progress, 3, 2); m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(slotProgressTimeout())); m_updateTimer = new QTimer(this); connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(slotUpdateStepList())); m_updateTimer->setSingleShot(true); /* Create control buttons */ QHBoxLayout *hbox = new QHBoxLayout(); hbox->setSpacing(2); m_crossfadeButton = new QToolButton(this); m_crossfadeButton->setIcon(QIcon(":/slider.png")); m_crossfadeButton->setIconSize(QSize(24, 24)); m_crossfadeButton->setCheckable(true); m_crossfadeButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); m_crossfadeButton->setFixedHeight(32); m_crossfadeButton->setToolTip(tr("Show/Hide crossfade sliders")); connect(m_crossfadeButton, SIGNAL(toggled(bool)), this, SLOT(slotShowCrossfadePanel(bool))); hbox->addWidget(m_crossfadeButton); m_playbackButton = new QToolButton(this); m_playbackButton->setIcon(QIcon(":/player_play.png")); m_playbackButton->setIconSize(QSize(24, 24)); m_playbackButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_playbackButton->setFixedHeight(32); m_playbackButton->setToolTip(tr("Play/Pause Cue list")); connect(m_playbackButton, SIGNAL(clicked()), this, SLOT(slotPlayback())); hbox->addWidget(m_playbackButton); m_stopButton = new QToolButton(this); m_stopButton->setIcon(QIcon(":/player_stop.png")); m_stopButton->setIconSize(QSize(24, 24)); m_stopButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_stopButton->setFixedHeight(32); m_stopButton->setToolTip(tr("Stop Cue list")); connect(m_stopButton, SIGNAL(clicked()), this, SLOT(slotStop())); hbox->addWidget(m_stopButton); m_previousButton = new QToolButton(this); m_previousButton->setIcon(QIcon(":/back.png")); m_previousButton->setIconSize(QSize(24, 24)); m_previousButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_previousButton->setFixedHeight(32); m_previousButton->setToolTip(tr("Go to previous step in the list")); connect(m_previousButton, SIGNAL(clicked()), this, SLOT(slotPreviousCue())); hbox->addWidget(m_previousButton); m_nextButton = new QToolButton(this); m_nextButton->setIcon(QIcon(":/forward.png")); m_nextButton->setIconSize(QSize(24, 24)); m_nextButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_nextButton->setFixedHeight(32); m_nextButton->setToolTip(tr("Go to next step in the list")); connect(m_nextButton, SIGNAL(clicked()), this, SLOT(slotNextCue())); hbox->addWidget(m_nextButton); grid->addItem(hbox, 4, 2); setFrameStyle(KVCFrameStyleSunken); setType(VCWidget::CueListWidget); setCaption(tr("Cue list")); QSettings settings; QVariant var = settings.value(SETTINGS_CUELIST_SIZE); if (var.isValid() == true) resize(var.toSize()); else resize(QSize(300, 220)); slotModeChanged(m_doc->mode()); setLiveEdit(m_liveEdit); connect(m_doc, SIGNAL(functionRemoved(quint32)), this, SLOT(slotFunctionRemoved(quint32))); connect(m_doc, SIGNAL(functionChanged(quint32)), this, SLOT(slotFunctionChanged(quint32))); connect(m_doc, SIGNAL(functionNameChanged(quint32)), this, SLOT(slotFunctionNameChanged(quint32))); m_nextLatestValue = 0; m_previousLatestValue = 0; m_playbackLatestValue = 0; m_stopLatestValue = 0; }
MainWnd::MainWnd( QWidget * parent ) : QMainWindow( parent ) { ui.setupUi( this ); connect( this, SIGNAL(sigLog(const QString &)), this, SLOT(slotLog(const QString &)), Qt::QueuedConnection ); connect( ui.console, SIGNAL(line_validate(const QString &)), this, SLOT(slotSend(const QString &)), Qt::QueuedConnection ); QObject::connect( ui.clearLog, SIGNAL(triggered()), this, SLOT(slotClearLog()) ); QObject::connect( ui.dontSleep, SIGNAL(triggered()), this, SLOT(slotDontSleep()) ); QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) ); QObject::connect( ui.queryStatus, SIGNAL(triggered()), this, SLOT(slotStatus()) ); QObject::connect( ui.queryOsc, SIGNAL(triggered()), this, SLOT(slotOsc()) ); QObject::connect( ui.shutdown, SIGNAL(triggered()), this, SLOT(slotShutdown()) ); QObject::connect( ui.setupPipe, SIGNAL(triggered()), this, SLOT(slotSetupPipe()) ); QObject::connect( ui.lightBtn, SIGNAL(clicked()), this, SLOT(slotLight()) ); QObject::connect( ui.motoEnBtn, SIGNAL(clicked()), this, SLOT(slotMotoEn()) ); QObject::connect( ui.fwdBtn, SIGNAL(pressed()), this, SLOT(slotForward()) ); QObject::connect( ui.bwdBtn, SIGNAL(pressed()), this, SLOT(slotBackward()) ); QObject::connect( ui.leftBtn, SIGNAL(pressed()), this, SLOT(slotLeft()) ); QObject::connect( ui.rightBtn, SIGNAL(pressed()), this, SLOT(slotRight()) ); QObject::connect( ui.fwdBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.bwdBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.leftBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.rightBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) ); m_peer = new QXmppPeer( this ); QObject::connect( m_peer, SIGNAL(connected()), this, SLOT(slotConnected()) ); QObject::connect( m_peer, SIGNAL(disconnected()), this, SLOT(slotDisconnected()) ); QObject::connect( m_peer, SIGNAL(textmsg(QString)), this, SLOT(qxmppMessageReceived(QString)) ); m_video = new QXmppVideo( m_peer ); // It also connects frameReady() signal to an appropriate slot. ui.view->setVideo( m_video ); this->setCentralWidget( ui.view ); QSettings ini( CONFIG_FILE, QSettings::IniFormat ); ini.beginGroup( "main" ); QString selfJid = ini.value( "selfJid", "client@xmpp" ).toString(); QString destJid = ini.value( "destJid", "host@xmpp" ).toString(); QString password = ini.value( "password", "12345" ).toString(); QString host = ini.value( "host", QString() ).toString(); int port = ini.value( "port", -1 ).toInt(); bool tls = ini.value( "tls", true ).toBool(); bool updateDest = ini.value( "updateDest", true ).toBool(); m_peer->setTarget( destJid, updateDest ); m_video->setTarget( destJid ); m_peer->connect( selfJid, password, host, port, tls ); m_jidDest = destJid; m_pipe = new QXmppMsgPipe( m_peer, 1 ); m_pipe->setOutPipe( m_jidDest, 1234, 22, "localhost" ); m_dontSleepTimer = new QTimer( this ); m_dontSleepTimer->setInterval( 15000 ); QObject::connect( m_dontSleepTimer, SIGNAL(timeout()), this, SLOT(slotDontSleepTimeout()) ); }
void QueueMgrWindow::setupActions() { // -- Standard 'File' menu actions --------------------------------------------- KActionCollection* const ac = actionCollection(); d->runAction = new QAction(QIcon::fromTheme(QLatin1String("media-playback-start")), i18n("Run"), this); d->runAction->setEnabled(false); connect(d->runAction, SIGNAL(triggered()), this, SLOT(slotRun())); ac->addAction(QLatin1String("queuemgr_run"), d->runAction); ac->setDefaultShortcut(d->runAction, Qt::CTRL + Qt::Key_P); d->stopAction = new QAction(QIcon::fromTheme(QLatin1String("media-playback-stop")), i18n("Stop"), this); d->stopAction->setEnabled(false); connect(d->stopAction, SIGNAL(triggered()), this, SLOT(slotStop())); ac->addAction(QLatin1String("queuemgr_stop"), d->stopAction); ac->setDefaultShortcut(d->stopAction, Qt::CTRL + Qt::Key_S); d->newQueueAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-addqueue")), i18n("New Queue"), this); connect(d->newQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotAddQueue())); ac->addAction(QLatin1String("queuemgr_newqueue"), d->newQueueAction); d->removeQueueAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-rmqueue")), i18n("Remove Queue"), this); connect(d->removeQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveCurrentQueue())); ac->addAction(QLatin1String("queuemgr_removequeue"), d->removeQueueAction); // TODO rename action to saveWorkflowAction to avoid confusion? d->saveQueueAction = new QAction(QIcon::fromTheme(QLatin1String("document-save")), i18n("Save Workflow"), this); connect(d->saveQueueAction, SIGNAL(triggered()), this, SLOT(slotSaveWorkflow())); ac->addAction(QLatin1String("queuemgr_savequeue"), d->saveQueueAction); d->removeItemsSelAction = new QAction(QIcon::fromTheme(QLatin1String("list-remove")), i18n("Remove items"), this); d->removeItemsSelAction->setEnabled(false); connect(d->removeItemsSelAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveSelectedItems())); ac->addAction(QLatin1String("queuemgr_removeitemssel"), d->removeItemsSelAction); ac->setDefaultShortcut(d->removeItemsSelAction, Qt::CTRL + Qt::Key_K); d->removeItemsDoneAction = new QAction(i18n("Remove processed items"), this); d->removeItemsDoneAction->setEnabled(false); connect(d->removeItemsDoneAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveItemsDone())); ac->addAction(QLatin1String("queuemgr_removeitemsdone"), d->removeItemsDoneAction); d->clearQueueAction = new QAction(QIcon::fromTheme(QLatin1String("edit-clear")), i18n("Clear Queue"), this); d->clearQueueAction->setEnabled(false); connect(d->clearQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotClearList())); ac->addAction(QLatin1String("queuemgr_clearlist"), d->clearQueueAction); ac->setDefaultShortcut(d->clearQueueAction, Qt::CTRL + Qt::SHIFT + Qt::Key_K); QAction* const close = buildStdAction(StdCloseAction, this, SLOT(close()), this); ac->addAction(QLatin1String("queuemgr_close"), close); // -- 'Tools' menu actions ----------------------------------------------------- d->moveUpToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-commit")), i18n("Move up"), this); connect(d->moveUpToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotMoveCurrentToolUp())); ac->addAction(QLatin1String("queuemgr_toolup"), d->moveUpToolAction); d->moveDownToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-update")), i18n("Move down"), this); connect(d->moveDownToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotMoveCurrentToolDown())); ac->addAction(QLatin1String("queuemgr_tooldown"), d->moveDownToolAction); d->removeToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-remove")), i18n("Remove tool"), this); connect(d->removeToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotRemoveCurrentTool())); ac->addAction(QLatin1String("queuemgr_toolremove"), d->removeToolAction); d->clearToolsAction = new QAction(QIcon::fromTheme(QLatin1String("edit-clear-list")), i18n("Clear List"), this); connect(d->clearToolsAction, SIGNAL(triggered()), d->assignedList, SLOT(slotClearToolsList())); ac->addAction(QLatin1String("queuemgr_toolsclear"), d->clearToolsAction); // -- Standard 'View' menu actions --------------------------------------------- createFullScreenAction(QLatin1String("queuemgr_fullscreen")); // -- Standard 'Configure' menu actions ---------------------------------------- createSettingsActions(); // --------------------------------------------------------------------------------- ThemeManager::instance()->registerThemeActions(this); // -- Standard 'Help' menu actions --------------------------------------------- createHelpActions(); // Provides a menu entry that allows showing/hiding the toolbar(s) setStandardToolBarMenuEnabled(true); // Provides a menu entry that allows showing/hiding the statusbar createStandardStatusBarAction(); // --------------------------------------------------------------------------------- createGUI(xmlFile()); showMenuBarAction()->setChecked(!menuBar()->isHidden()); // NOTE: workaround for bug #171080 }