Beispiel #1
0
void TinyMainWindow::on_action_network_reconnect_triggered()
{
	connectToMPD(pv->host);
	update(false);

	showNotify(tr("Reconnected"));
}
Beispiel #2
0
int main(int argc, char **argv) {
	unsigned timeout = 1, connected = 0;

	parseArguments(argc, argv);
	daemonize();
	registerSignalHandlers();
	termInit();
	atexit(disconnectFromMPD);
	initCodesets();

	do {
		if (!connected) {
			timeout = timeout <= 30 ? timeout * 2 : 60;
			connected = connectToMPD(timeout > 10 ? 10 : timeout);
		}

		if (connected) {
			timeout = 1;
			connected = getSong();
		}

		display(timeout);
	} while (!done());

	return 0;
}
Beispiel #3
0
void TinyMainWindow::execConnectionDialog()
{
	TinyConnectionDialog dlg(this, pv->host);
	if (dlg.exec() == QDialog::Accepted) {
		Host host = dlg.host();
		connectToMPD(host);
	}
	updateServersComboBox();
}