void MainWindow::execCommand(const int cmd, const QString &arg) { if (cmd == Dial) { QString d; if (arg == "*") d = "Star"; else if (arg == "#") d = "Number"; QPushButton *dButton = findChild<QPushButton *>(QString::fromUtf8("d%1Button").arg(d)); if (dButton) dButton->clicked(); } else if (cmd == Call) { ui->uriComboBox->setCurrentText(arg); callClicked(); } else if (cmd == Hangup) { hangupClicked(); } else if (cmd == Pickup) { if (voipc.state() == "INCOMING") { callClicked(); } } else if (cmd == Mute) { ui->muteButton->setChecked(true); muteClicked(); } else if (cmd == Unmute) { ui->muteButton->setChecked(false); muteClicked(); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , toneSound(0) , ringSound(0) { ui->setupUi(this); setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint); const QString qdircp = QDir::currentPath() + QDir::separator(); toneSound = new QSound(qdircp + "tone.wav"); ringSound = new QSound(qdircp + "ring.wav"); toneSound->setLoops(-1); ringSound->setLoops(-1); QShortcut *callShortcut = new QShortcut(QKeySequence("Ctrl+L"), this); QShortcut *hangupShortcut = new QShortcut(QKeySequence("Ctrl+H"), this); connect(ui->d1Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d2Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d3Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d4Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d5Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d6Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d7Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d8Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d9Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->d0Button, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->dStarButton, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->dNumeralButton, SIGNAL(clicked()), SLOT(dialButtonClicked())); connect(ui->muteButton, SIGNAL(clicked()), SLOT(muteClicked())); connect(ui->holdButton, SIGNAL(clicked()), SLOT(holdClicked())); connect(ui->uriComboBox->lineEdit(), SIGNAL(returnPressed()), SLOT(callClicked())); connect(ui->callButton, SIGNAL(clicked()), SLOT(callClicked())); connect(callShortcut, SIGNAL(activated()), SLOT(callClicked())); connect(ui->hangupButton, SIGNAL(clicked()), SLOT(hangupClicked())); connect(hangupShortcut, SIGNAL(activated()), SLOT(hangupClicked())); connect(&voipc, SIGNAL(stateChanged()), SLOT(voipCStateChanged())); initialize(); muteClicked(); }
void PlayerController::setView(AbstractPlayerView *view) { if (m_view == view) return; if (m_view) { m_view->disconnect(this); } m_view = view; if (m_view) { connect(m_view, SIGNAL(playClicked()), SLOT(play())); connect(m_view, SIGNAL(pauseClicked()), SLOT(pause())); connect(m_view, SIGNAL(stopClicked()), SLOT(stop())); connect(m_view, SIGNAL(nextClicked()), SLOT(next())); connect(m_view, SIGNAL(previousClicked()), SLOT(previous())); connect(m_view, SIGNAL(shuffleClicked()), SLOT(toggleShuffle())); connect(m_view, SIGNAL(muteClicked()), SLOT(toggleMute())); connect(m_view, SIGNAL(repeatClicked()), SLOT(toggleRepeat())); connect(m_view, SIGNAL(volumeChanged(qreal)), SLOT(setVolume(qreal))); connect(m_view, SIGNAL(songSelected(int)), SLOT(play(int))); } initializeView(); }
MixerTray::MixerTray() : QSystemTrayIcon(){ starting = true; //Initialize the settings backend settings = new QSettings("TrueOS", "pc-mixer"); //Initialize all the widgets isMuted = false; slider = new QSlider(Qt::Vertical, 0); slider->setRange(0,100); slider->setTickPosition(QSlider::NoTicks); slideA = new QWidgetAction(0); slideA->setDefaultWidget(slider); mute = new QToolButton(0); muteA = new QWidgetAction(0); muteA->setDefaultWidget(mute); mixer = new QToolButton(0); mixer->setText(tr("Mixer")); mixer->setIcon(QIcon(":icons/configure.png")); mixer->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mixerA = new QWidgetAction(0); mixerA->setDefaultWidget(mixer); //Get output devices actionMenu = new QMenu(0); actionMenu->addAction(slideA); actionMenu->addAction(muteA); actionMenu->addSeparator(); soundOutput = new QMenu(tr("Output")); slotFillOutputDevices(); if (soundOutput->actions().size()>1) actionMenu->addMenu(soundOutput); actionMenu->addAction(mixerA); //Now initialize the GUI GUI = new MixerGUI(settings); //Connect the signals/slots connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayActivated()) ); connect(mixer, SIGNAL(clicked()), this, SLOT(openMixerGUI()) ); connect(mute, SIGNAL(clicked()), this, SLOT(muteClicked()) ); connect(slider, SIGNAL(valueChanged(int)), this, SLOT(sliderChanged(int)) ); connect(GUI, SIGNAL(updateTray()), this, SLOT(loadVol()) ); connect(GUI, SIGNAL(outChanged()), this, SLOT(slotFillOutputDevices()) ); connect(actionMenu, SIGNAL(hovered(QAction*)), this, SLOT(hoverDisable(QAction*)) ); //Show a quick icon to prevent a warning message this->setIcon(QIcon(":icons/audio-volume-high.png")); CVOL = 101; //quick default to maximize it CDIFF = 0; //Make sure no single-instance events for 30 seconds QTimer::singleShot(30000, this, SLOT(doneStarting()) ); QTimer::singleShot(10, this, SLOT(loadVol()) ); //Update the UI //This timer will be fired in doneStarting() timer = new QTimer(); timer->setInterval(500); connect(timer, SIGNAL(timeout()), this, SLOT(loadVol()) ); }
OsdWidget::OsdWidget(QWidget *parent) : StyledBar(parent), ui(new Ui::OsdWidget), _current(""), _file(new NetworkDownload()) { ui->setupUi(this); setLightColored(true); setSingleRow(false); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); _info = new InfoBarWidget(this); ui->controls->addWidget(_info); ui->logo->hide(); ui->teletext->hide(); ui->buttonBack->setProperty("extraframe", true); ui->buttonMute->setProperty("extraframe", true); ui->buttonNext->setProperty("extraframe", true); ui->buttonPlay->setProperty("extraframe", true); ui->buttonRecordNow->setProperty("extraframe", true); ui->buttonSnapshot->setProperty("extraframe", true); ui->buttonStop->setProperty("extraframe", true); ui->buttonTeletext->setProperty("extraframe", true); connect(_info, SIGNAL(open(QString)), this, SIGNAL(openLink(QString))); connect(ui->teletext, SIGNAL(valueChanged(int)), this, SIGNAL(teletextPage(int))); connect(ui->buttonBack, SIGNAL(clicked()), this, SIGNAL(backClicked())); connect(ui->buttonMute, SIGNAL(clicked()), this, SIGNAL(muteClicked())); connect(ui->buttonNext, SIGNAL(clicked()), this, SIGNAL(nextClicked())); connect(ui->buttonPlay, SIGNAL(clicked()), this, SIGNAL(playClicked())); connect(ui->buttonRecordNow, SIGNAL(clicked()), this, SIGNAL(recordNowClicked())); connect(ui->buttonSnapshot, SIGNAL(clicked()), this, SIGNAL(snapshotClicked())); connect(ui->buttonStop, SIGNAL(clicked()), this, SIGNAL(stopClicked())); connect(ui->buttonTeletext, SIGNAL(clicked()), this, SIGNAL(teletextClicked())); connect(_file, SIGNAL(file(QFile *)), this, SLOT(setLogo(QFile *))); }
PlayerControls::PlayerControls(QWidget *parent, QMediaPlayer *player) : QWidget(parent) , playerState(QMediaPlayer::StoppedState) , playerMuted(false) , playButton(0) , stopButton(0) , nextButton(0) , previousButton(0) , muteButton(0) , volumeSlider(0) , rateBox(0) { #ifdef Q_OS_SYMBIAN initRemCon(); #endif // Q_OS_SYMBIAN iplayer = player; playButton = new QToolButton(this); playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); connect(playButton, SIGNAL(clicked()), this, SLOT(playClicked())); stopButton = new QToolButton(this); stopButton->setIcon(style()->standardIcon(QStyle::SP_MediaStop)); stopButton->setEnabled(false); connect(stopButton, SIGNAL(clicked()), this, SIGNAL(stop())); nextButton = new QToolButton(this); nextButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipForward)); connect(nextButton, SIGNAL(clicked()), this, SIGNAL(next())); previousButton = new QToolButton(this); previousButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipBackward)); connect(previousButton, SIGNAL(clicked()), this, SIGNAL(previous())); muteButton = new QToolButton(this); muteButton->setIcon(style()->standardIcon(QStyle::SP_MediaVolume)); connect(muteButton, SIGNAL(clicked()), this, SLOT(muteClicked())); #ifndef Q_WS_MAEMO_5 volumeSlider = new QSlider(Qt::Horizontal, this); volumeSlider->setRange(0, 100); connect(volumeSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(changeVolume(int))); rateBox = new QComboBox(this); rateBox->addItem("0.5x", QVariant(0.5)); rateBox->addItem("1.0x", QVariant(1.0)); rateBox->addItem("2.0x", QVariant(2.0)); rateBox->setCurrentIndex(1); connect(rateBox, SIGNAL(activated(int)), SLOT(updateRate())); #endif QBoxLayout *layout = new QHBoxLayout; layout->setMargin(0); layout->addWidget(stopButton); layout->addWidget(previousButton); layout->addWidget(playButton); layout->addWidget(nextButton); layout->addWidget(muteButton); if (volumeSlider) layout->addWidget(volumeSlider); if (rateBox) layout->addWidget(rateBox); setLayout(layout); }
connect(ui->actionFullscreen, SIGNAL(triggered(bool)), this, SLOT(toggleFullscreen(bool))); connect(ui->actionMute, SIGNAL(toggled(bool)), _mediaPlayer->osd(), SLOT(mute(bool))); connect(ui->actionVolumeDown, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeDown())); connect(ui->actionVolumeUp, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeUp())); #if defined(Q_OS_LINUX) if (_mediaPlayer->teletextEnabled()) { connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer->osd(), SLOT(teletext(bool))); connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer, SLOT(teletext(bool))); connect(_mediaPlayer->osd(), SIGNAL(teletextClicked()), ui->actionTeletext, SLOT(trigger())); } #endif connect(_mediaPlayer->osd(), SIGNAL(backClicked()), ui->actionBack, SLOT(trigger())); connect(_mediaPlayer->osd(), SIGNAL(muteClicked()), ui->actionMute, SLOT(toggle())); connect(_mediaPlayer->osd(), SIGNAL(nextClicked()), ui->actionNext, SLOT(trigger())); connect(_mediaPlayer->osd(), SIGNAL(playClicked()), ui->actionPlay, SLOT(trigger())); connect(_mediaPlayer->osd(), SIGNAL(recordNowClicked()), ui->actionRecordNow, SLOT(trigger())); connect(_mediaPlayer->osd(), SIGNAL(snapshotClicked()), ui->actionSnapshot, SLOT(trigger())); connect(_mediaPlayer->osd(), SIGNAL(stopClicked()), ui->actionStop, SLOT(trigger())); connect(_xmltv, SIGNAL(current(QStringList)), _mediaPlayer->osd(), SLOT(setEpg(QStringList))); connect(_xmltv, SIGNAL(schedule(QString, XmltvProgrammeModel *)), _scheduleTab, SLOT(setEpg(QString, XmltvProgrammeModel *))); connect(_scheduleTab, SIGNAL(requestEpg(QString)), _xmltv, SLOT(request(QString))); connect(_scheduleTab, SIGNAL(itemSelected(QString)), _xmltv, SLOT(requestProgramme(QString))); connect(_xmltv, SIGNAL(programme(XmltvProgramme *)), _showInfoTab, SLOT(display(XmltvProgramme *))); connect(_mediaPlayer->osd(), SIGNAL(openLink(QString)), _xmltv, SLOT(requestProgramme(QString))); connect(_showInfoTab, SIGNAL(requestNext(QString, QString)), _xmltv, SLOT(requestProgrammeNext(QString, QString))); connect(_showInfoTab, SIGNAL(requestPrevious(QString, QString)), _xmltv, SLOT(requestProgrammePrevious(QString, QString))); connect(_playlistTab->playlist(), SIGNAL(scheduleRequested(Channel *)), _scheduleTab, SLOT(channel(Channel *)));