Ejemplo n.º 1
0
void ITunesMediaPlayer::pause()
{
	kdebugf();
	executeCommand("tell application \"iTunes\" to pause");
}
Ejemplo n.º 2
0
void ITunesMediaPlayer::prevTrack()
{
	kdebugf();
	executeCommand("tell application \"iTunes\" to previous track");
}
Ejemplo n.º 3
0
void ITunesMediaPlayer::stop()
{
	kdebugf();
	executeCommand("tell application \"iTunes\" to stop");
}
Ejemplo n.º 4
0
QString ITunesMediaPlayer::getPlayerVersion()
{
	kdebugf();
	return executeCommand("tell application \"iTunes\" to version");
}
Ejemplo n.º 5
0
PowerStatusChanger::~PowerStatusChanger()
{
    kdebugf();
    StatusChangerManager::instance()->unregisterStatusChanger(this);
    kdebugf2();
}
Ejemplo n.º 6
0
bool ITunesMediaPlayer::isPlaying()
{
	kdebugf();
	Tune t = controller->currentTune();
	return (t.state() == Tune::playing);
}
Ejemplo n.º 7
0
ITunesMediaPlayer::ITunesMediaPlayer()
{
	controller = new ITunesController();
	kdebugf();
}
Ejemplo n.º 8
0
QString ITunesMediaPlayer::getTitle(int position)
{
	kdebugf();
	Tune t = controller->currentTune();
	return t.name();
}
Ejemplo n.º 9
0
QString ITunesMediaPlayer::getArtist(int position)
{
	kdebugf();
	Tune t = controller->currentTune();
	return t.artist();
}
Ejemplo n.º 10
0
void KaduExtInfo::knowBirthday()
{
    kdebugf();
    extlist[currentUser].setKnowBirthday();
    kdebugf2();
}
Ejemplo n.º 11
0
/**
	Formatowanie wyjsciowej prognozy pogody
**/
bool WeatherParser::getData(const QString &page, const PlainConfigFile *wConfig, Forecast &forecast) const
{
	kdebugf();

	bool cs = wConfig->readBoolEntry("Default","CaseSensitive");

	int num_layouts = wConfig->readNumEntry("Default","Layouts");
	WDataValue dValue;

	QString actualName;
	QVector<WDataValue> valsList;
	QStringList nextDaysNamesList;
	QVector<WDataValue> nextDaysValsList;

	bool result;
	int cursor = 0;
	for (int i = 0; i < num_layouts; i++)
	{
		QString layoutSection = QString("Layout%1").arg(i + 1);
		QString layoutName = wConfig->readEntry(layoutSection,"Name");
		int num_repeats = wConfig->readNumEntry(layoutSection,"Repeats");
		int num_values = wConfig->readNumEntry(layoutSection,"Values");

		for (int j = 0; j < num_repeats; j++)
		{
			for (int k = 0; k<num_values; k++)
			{
				QString valSection = QString("Layout%1Value%2").arg(i + 1).arg(k + 1);

				dValue.Name = wConfig->readEntry(valSection,"Name");
				dValue.Start = wConfig->readEntry(valSection,"Start");
				dValue.End = wConfig->readEntry(valSection,"End");
				dValue.Content = "";

				result = getDataValue(page, dValue,cursor, wConfig, cs);

				if (dValue.Content.isEmpty())
					continue;
				else if (dValue.Name == "Phantom")
					continue;

				if (layoutName == "Name")
					forecast.LocationName = dValue.Content;
				else if (layoutName == "Actual")
				{
					if (dValue.Name == "Name")
						actualName = dValue.Content;
					else
						valsList.push_back(dValue);
				}
				else if (layoutName == "DaysNames")
				{
					if (dValue.Name == "Actual")
						actualName = dValue.Content;
					else if (dValue.Name == "NextDays")
						nextDaysNamesList.push_back(dValue.Content);
				}
				else if (layoutName == "NextDays" && dValue.Name == "Name")
					nextDaysNamesList.push_back(dValue.Content);
				else
					nextDaysValsList.push_back(dValue);
			}
		}
	}

	QString Data("");

	ForecastDay fDay;

	fDay["Name"] = actualName;
	for (QVector<WDataValue>::iterator it = valsList.begin(); it != valsList.end(); it++)
	{
		if ((*it).Name == "Icon")
			fDay["Icon"] = WeatherGlobal::getIconPath(wConfig->readEntry("Icons", (*it).Content));
		else
			fDay[(*it).Name] = (*it).Content;
	}

	forecast.Days.push_back(fDay);
	fDay.clear();

	int num_vals = nextDaysValsList.count();
	int num_names = nextDaysNamesList.count();

	if (!num_names)
		return false;

	int T = num_vals / num_names;

	if (!T)
		return false;

	Data = "";
	num_vals = T * num_names; /* Dorr: fix for index out of bounds when parsing data from
					Onet (num vals 31, num names 5, crash at i = 30 ->
					nextDaysNamesList[5] which is having 5 elements) */
	for (int i = 0; i < num_vals; i++)
	{
		WDataValue& val = nextDaysValsList[i];

		if (i % T == 0)
			fDay["Name"] = nextDaysNamesList[i / T];

		if (val.Name == "Icon")
			fDay["Icon"] = WeatherGlobal::getIconPath(wConfig->readEntry("Icons",val.Content));
		else
			fDay[val.Name] = val.Content;

		if (i % T == T - 1)
		{
			forecast.Days.push_back(fDay);
			fDay.clear();

			Data = "";
		}
	}

	kdebugf2();
	return true;
}
Ejemplo n.º 12
0
void PowerStatusChanger::setOffline(QString desc)
{
    kdebugf();
    setStatus(STATUS_OFFLINE, desc);
    kdebugf2();
}
Ejemplo n.º 13
0
void PowerStatusChanger::setInvisible(QString desc)
{
    kdebugf();
    setStatus(STATUS_INVISIBLE, desc);
    kdebugf2();
}
Ejemplo n.º 14
0
void PowerStatusChanger::setBusy(QString desc)
{
    kdebugf();
    setStatus(STATUS_BUSY, desc);
    kdebugf2();
}
Ejemplo n.º 15
0
void ITunesMediaPlayer::setVolume(int vol)
{
	kdebugf();
	executeCommand(QString("tell application \"iTunes\" to set sound volume to %1").arg(vol));
}
Ejemplo n.º 16
0
QString ITunesMediaPlayer::getFile(int position)
{
	kdebugf();
	Tune t = controller->currentTune();
	return t.location();
}
Ejemplo n.º 17
0
int ITunesMediaPlayer::getVolume()
{
	kdebugf();
	QByteArray reply = executeCommand("tell application \"iTunes\" to get sound volume");
	return reply.toInt();
}
Ejemplo n.º 18
0
int ITunesMediaPlayer::getLength(int position)
{
	kdebugf();
	Tune t = controller->currentTune();
	return t.time();
}
Ejemplo n.º 19
0
bool ITunesMediaPlayer::isActive()
{
	kdebugf();
	Tune t = controller->currentTune();
	return (t.state() != Tune::unknown);
}
Ejemplo n.º 20
0
int ITunesMediaPlayer::getCurrentPos()
{
	kdebugf();
	Tune t = controller->currentTune();
	return (QDateTime::currentDateTime().toTime_t() -  t.started()) * 1000;
}
Ejemplo n.º 21
0
ITunesMediaPlayer::~ITunesMediaPlayer()
{
	delete controller;
	controller = NULL;
	kdebugf();
}
Ejemplo n.º 22
0
void ITunesMediaPlayer::nextTrack()
{
	kdebugf();
	executeCommand("tell application \"iTunes\" to next track");
}
Ejemplo n.º 23
0
uint ITunesMediaPlayer::getPlayListLength()
{
	kdebugf();
	QByteArray reply = executeCommand("tell application \"iTunes\" to get duration of current playlist");
	return reply.toInt();
}
Ejemplo n.º 24
0
ModulesDialog::ModulesDialog(QWidget *parent)
	: QWidget(parent, Qt::Window),
	lv_modules(0), l_moduleinfo(0)
{
	kdebugf();
	setWindowTitle(tr("Manage Modules"));
	setAttribute(Qt::WA_DeleteOnClose);

	// create main QLabel widgets (icon and app info)
	QWidget *left = new QWidget(this);
	QVBoxLayout *leftLayout = new QVBoxLayout(left);
	leftLayout->setMargin(10);
	leftLayout->setSpacing(10);

	QLabel *l_icon = new QLabel(left);

	leftLayout->addWidget(l_icon);
	leftLayout->addStretch();

	QWidget *center = new QWidget(this);
	QVBoxLayout *centerLayout = new QVBoxLayout(center);
	centerLayout->setMargin(10);
	centerLayout->setSpacing(10);

	QLabel *l_info = new QLabel(center);
	l_icon->setPixmap(IconsManager::instance()->loadPixmap("ManageModulesWindowIcon"));
	l_info->setText(tr("This dialog box allows you to manage installed modules. Modules are responsible "
			"for numerous vital features like playing sounds or message encryption.\n"
			"You can load (or unload) them by double-clicking on their names."));
	l_info->setWordWrap(true);
#ifndef	Q_OS_MAC
	l_info->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
#endif
	// end create main QLabel widgets (icon and app info)

	// our QListView
	lv_modules = new QTreeWidget(center);
	QStringList headers;
	headers << tr("Module name") << tr("Version") << tr("Module type") << tr("State");
	lv_modules->setHeaderLabels(headers);
	lv_modules->setSortingEnabled(true);
	lv_modules->setAllColumnsShowFocus(true);
	lv_modules->setIndentation(false);
	lv_modules->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));

	
	// end our QListView

	//our QVGroupBox
	QGroupBox *vgb_info = new QGroupBox(center);
	QVBoxLayout *infoLayout = new QVBoxLayout(vgb_info);
	vgb_info->setTitle(tr("Info"));
	//end our QGroupBox

	l_moduleinfo = new QLabel(vgb_info);
	l_moduleinfo->setText(tr("<b>Module:</b><br/><b>Depends on:</b><br/><b>Conflicts with:</b><br/><b>Provides:</b><br/><b>Author:</b><br/><b>Version:</b><br/><b>Description:</b>"));
#ifndef	Q_OS_MAC
	l_moduleinfo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
#endif
	l_moduleinfo->setWordWrap(true);

	infoLayout->addWidget(l_moduleinfo);

	// buttons
	QWidget *bottom = new QWidget(center);
	QHBoxLayout *bottomLayout = new QHBoxLayout(bottom);
	bottomLayout->setSpacing(5);

	hideBaseModules = new QCheckBox(tr("Hide base modules"), bottom);
	hideBaseModules->setChecked(config_file.readBoolEntry("General", "HideBaseModules"));
	connect(hideBaseModules, SIGNAL(clicked()), this, SLOT(refreshList()));
	QPushButton *pb_close = new QPushButton(IconsManager::instance()->loadIcon("CloseWindow"), tr("&Close"), bottom);

	bottomLayout->addWidget(hideBaseModules);
	bottomLayout->addStretch();
	bottomLayout->addWidget(pb_close);
#ifdef Q_OS_MAC
	bottom->setMaximumHeight(pb_close->height() + 5);
#endif
	// end buttons

	centerLayout->addWidget(l_info);
	centerLayout->addWidget(lv_modules);
	centerLayout->addWidget(vgb_info);
	centerLayout->addWidget(bottom);

	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->addWidget(left);
	layout->addWidget(center);

	connect(pb_close, SIGNAL(clicked()), this, SLOT(close()));
	connect(lv_modules, SIGNAL(itemSelectionChanged()), this, SLOT(itemsChanging()));
	connect(lv_modules, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(moduleAction(QTreeWidgetItem *)));

	loadWindowGeometry(this, "General", "ModulesDialogGeometry", 0, 50, 600, 620);
	refreshList();
	lv_modules->sortByColumn(0, Qt::AscendingOrder);
	kdebugf2();
}