Example #1
0
MainWindow::MainWindow(QWidget *widget, Qt::WFlags fl)
  : QMainWindow(widget, fl)
  , Ui::MainWindow()
{
    setupUi(this);

    Ui_MainWindow::mainToolBar->setIconSize(QSize(35, 35));

    connect(actionVolumeUp, SIGNAL(triggered()), this, SLOT(onVolumeUp()));
    connect(actionVolumeDown, SIGNAL(triggered()), this, SLOT(onVolumeDown()));
    connect(actionMute, SIGNAL(triggered()), this, SLOT(onMute()));
    connect(actionSkip, SIGNAL(triggered()), this, SLOT(onSkip()));
    connect(actionStop, SIGNAL(triggered()), this, SLOT(onStop()));
    connect(actionPlay, SIGNAL(triggered()), this, SLOT(onUnpause()));
    connect(actionPause, SIGNAL(triggered()), this, SLOT(onPause()));

    actionPlay->setVisible(false);

    connect(actionLogoutAndQuit, SIGNAL(triggered()), qApp, SLOT(logoutAndQuit()));
    connect(actionQuit, SIGNAL(triggered()), qApp, SLOT(logout()));
    connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAboutSpotfm()));

    m_settingsDlg = new SettingsDialog(this);
    connect(actionSettings, SIGNAL(triggered()), m_settingsDlg, SLOT(show()));

    Radio *radio = SpotFm::app()->radio();
    connect(radio, SIGNAL(trackStarted(Track)), this, SLOT(onTrackStarted(Track)));
    connect(radio, SIGNAL(skipsLeft(int)), this, SLOT(enableSkipButton(int)));
    connect(radio, SIGNAL(trackProgress(int)), this, SLOT(onTrackProgress(int)));
    connect(radio, SIGNAL(error(int, QString)), this, SLOT(onRadioError(int, QString)));

    connect(volumeSlider, SIGNAL(valueChanged(int)), radio, SLOT(setVolume(int)));

    connect(stationWidget, SIGNAL(clicked()), this, SLOT(onNewStation()));
    stationWidget->setFocus();

    QSettings *s = SpotFm::app()->settings();
    volumeSlider->setValue(s->value("volume", 80).toInt());
    radio->setVolume(volumeSlider->value());
    m_lastVolume = volumeSlider->value();

    defaultWindow();
    setupTrayIcon();
    loadExtensions();
}
Example #2
0
void TimerThread::onNotify() {
	onUnpause();
}
Example #3
0
void BaseThread::unpause()
{
	m_pPrivates->m_bPause = false;
	onUnpause();
	m_pPrivates->m_PauseCond.notify_all();
}