"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/context/applets/wikipedia/WikipediaApplet.cpp" between
amarok-2.8.90.tar.gz and amarok-2.9.0.tar.xz

About: Amarok is a powerful music player for Linux and Unix, MacOS X and Windows with an intuitive interface.

WikipediaApplet.cpp  (amarok-2.8.90):WikipediaApplet.cpp  (amarok-2.9.0.tar.xz)
skipping to change at line 253 skipping to change at line 253
for( int i = 0, count = listWidget->count(); i < count; ++i ) for( int i = 0, count = listWidget->count(); i < count; ++i )
{ {
QListWidgetItem *item = listWidget->item( i ); QListWidgetItem *item = listWidget->item( i );
const QString &prefix = item->data( PrefixRole ).toString(); const QString &prefix = item->data( PrefixRole ).toString();
const QString &urlPrefix = item->data( UrlPrefixRole ).toString(); const QString &urlPrefix = item->data( UrlPrefixRole ).toString();
QString concat = QString("%1:%2").arg( prefix, urlPrefix ); QString concat = QString("%1:%2").arg( prefix, urlPrefix );
list << (prefix == urlPrefix ? prefix : concat); list << (prefix == urlPrefix ? prefix : concat);
} }
langList = list; langList = list;
useMobileWikipedia = (generalSettingsUi.mobileCheckBox->checkState() == Qt:: Checked); useMobileWikipedia = (generalSettingsUi.mobileCheckBox->checkState() == Qt:: Checked);
useSSL = (generalSettingsUi.sslCheckBox->checkState() == Qt::Checked);
Amarok::config("Wikipedia Applet").writeEntry( "PreferredLang", list ); Amarok::config("Wikipedia Applet").writeEntry( "PreferredLang", list );
Amarok::config("Wikipedia Applet").writeEntry( "UseMobile", useMobileWikiped ia ); Amarok::config("Wikipedia Applet").writeEntry( "UseMobile", useMobileWikiped ia );
Amarok::config( "Wikipedia Applet" ).writeEntry( "UseSSL", useSSL );
_paletteChanged( App::instance()->palette() ); _paletteChanged( App::instance()->palette() );
dataContainer->setData( "lang", langList ); dataContainer->setData( "lang", langList );
dataContainer->setData( "mobile", useMobileWikipedia ); dataContainer->setData( "mobile", useMobileWikipedia );
dataContainer->setData( "ssl", useSSL );
scheduleEngineUpdate(); scheduleEngineUpdate();
} }
void void
WikipediaAppletPrivate::_paletteChanged( const QPalette &palette ) WikipediaAppletPrivate::_paletteChanged( const QPalette &palette )
{ {
if( useMobileWikipedia ) if( useMobileWikipedia )
{ {
webView->settings()->setUserStyleSheetUrl( QUrl() ); webView->settings()->setUserStyleSheetUrl( QUrl() );
return; return;
skipping to change at line 417 skipping to change at line 414
void void
WikipediaAppletPrivate::_getLangMap() WikipediaAppletPrivate::_getLangMap()
{ {
Q_Q( WikipediaApplet ); Q_Q( WikipediaApplet );
languageSettingsUi.downloadButton->setEnabled( false ); languageSettingsUi.downloadButton->setEnabled( false );
languageSettingsUi.progressBar->setEnabled( true ); languageSettingsUi.progressBar->setEnabled( true );
languageSettingsUi.progressBar->setMaximum( 100 ); languageSettingsUi.progressBar->setMaximum( 100 );
languageSettingsUi.progressBar->setValue( 0 ); languageSettingsUi.progressBar->setValue( 0 );
KUrl url; KUrl url;
url.setScheme( "http" ); url.setScheme( "https" );
url.setHost( "en.wikipedia.org" ); url.setHost( "en.wikipedia.org" );
url.setPath( "/w/api.php" ); url.setPath( "/w/api.php" );
url.addQueryItem( "action", "query" ); url.addQueryItem( "action", "query" );
url.addQueryItem( "meta", "siteinfo" ); url.addQueryItem( "meta", "siteinfo" );
url.addQueryItem( "siprop", "interwikimap" ); url.addQueryItem( "siprop", "interwikimap" );
url.addQueryItem( "sifilteriw", "local" ); url.addQueryItem( "sifilteriw", "local" );
url.addQueryItem( "format", "xml" ); url.addQueryItem( "format", "xml" );
QNetworkReply *reply = The::networkAccessManager()->getData( url, q, QNetworkReply *reply = The::networkAccessManager()->getData( url, q,
SLOT(_getLangMapFinished(KUrl,QByteArray,NetworkAcces sManagerProxy::Error)) ); SLOT(_getLangMapFinished(KUrl,QByteArray,NetworkAcces sManagerProxy::Error)) );
q->connect( reply, SIGNAL(downloadProgress(qint64,qint64)), q, SLOT(_getLang MapProgress(qint64,qint64)) ); q->connect( reply, SIGNAL(downloadProgress(qint64,qint64)), q, SLOT(_getLang MapProgress(qint64,qint64)) );
skipping to change at line 662 skipping to change at line 659
layout->addItem( m_header ); layout->addItem( m_header );
layout->addItem( d->webView ); layout->addItem( d->webView );
setLayout( layout ); setLayout( layout );
dataEngine( "amarok-wikipedia" )->connectSource( "wikipedia", this ); dataEngine( "amarok-wikipedia" )->connectSource( "wikipedia", this );
d->dataContainer = dataEngine( "amarok-wikipedia" )->containerForSource( "wi kipedia" ); d->dataContainer = dataEngine( "amarok-wikipedia" )->containerForSource( "wi kipedia" );
// Read config and inform the engine. // Read config and inform the engine.
d->langList = Amarok::config("Wikipedia Applet").readEntry( "PreferredLang", QStringList() << "en" ); d->langList = Amarok::config("Wikipedia Applet").readEntry( "PreferredLang", QStringList() << "en" );
d->useMobileWikipedia = Amarok::config("Wikipedia Applet").readEntry( "UseMo bile", false ); d->useMobileWikipedia = Amarok::config("Wikipedia Applet").readEntry( "UseMo bile", false );
d->useSSL = Amarok::config( "Wikipedia Applet" ).readEntry( "UseSSL", true ) ;
d->_paletteChanged( App::instance()->palette() ); d->_paletteChanged( App::instance()->palette() );
d->dataContainer->setData( "lang", d->langList ); d->dataContainer->setData( "lang", d->langList );
d->dataContainer->setData( "mobile", d->useMobileWikipedia ); d->dataContainer->setData( "mobile", d->useMobileWikipedia );
d->dataContainer->setData( "ssl", d->useSSL );
d->scheduleEngineUpdate(); d->scheduleEngineUpdate();
updateConstraints(); updateConstraints();
} }
void void
WikipediaApplet::constraintsEvent( Plasma::Constraints constraints ) WikipediaApplet::constraintsEvent( Plasma::Constraints constraints )
{ {
Context::Applet::constraintsEvent( constraints ); Context::Applet::constraintsEvent( constraints );
update(); update();
skipping to change at line 795 skipping to change at line 790
d->languageSettingsUi.downloadButton->setGuiItem( KStandardGuiItem::find() ) ; d->languageSettingsUi.downloadButton->setGuiItem( KStandardGuiItem::find() ) ;
d->languageSettingsUi.langSelector->availableListWidget()->setAlternatingRow Colors( true ); d->languageSettingsUi.langSelector->availableListWidget()->setAlternatingRow Colors( true );
d->languageSettingsUi.langSelector->selectedListWidget()->setAlternatingRowC olors( true ); d->languageSettingsUi.langSelector->selectedListWidget()->setAlternatingRowC olors( true );
d->languageSettingsUi.langSelector->availableListWidget()->setUniformItemSiz es( true ); d->languageSettingsUi.langSelector->availableListWidget()->setUniformItemSiz es( true );
d->languageSettingsUi.langSelector->selectedListWidget()->setUniformItemSize s( true ); d->languageSettingsUi.langSelector->selectedListWidget()->setUniformItemSize s( true );
d->languageSettingsUi.progressBar->setEnabled( false ); d->languageSettingsUi.progressBar->setEnabled( false );
QWidget *genSettings = new QWidget; QWidget *genSettings = new QWidget;
d->generalSettingsUi.setupUi( genSettings ); d->generalSettingsUi.setupUi( genSettings );
d->generalSettingsUi.mobileCheckBox->setCheckState( d->useMobileWikipedia ? Qt::Checked : Qt::Unchecked ); d->generalSettingsUi.mobileCheckBox->setCheckState( d->useMobileWikipedia ? Qt::Checked : Qt::Unchecked );
d->generalSettingsUi.sslCheckBox->setCheckState( d->useSSL ? Qt::Checked : Q t::Unchecked );
connect( d->languageSettingsUi.downloadButton, SIGNAL(clicked()), this, SLOT (_getLangMap()) ); connect( d->languageSettingsUi.downloadButton, SIGNAL(clicked()), this, SLOT (_getLangMap()) );
connect( parent, SIGNAL(okClicked()), this, SLOT(_loadSettings()) ); connect( parent, SIGNAL(okClicked()), this, SLOT(_loadSettings()) );
parent->addPage( genSettings, i18n( "Wikipedia General Settings" ), "configu re" ); parent->addPage( genSettings, i18n( "Wikipedia General Settings" ), "configu re" );
parent->addPage( langSettings, i18n( "Wikipedia Language Settings" ), "appli cations-education-language" ); parent->addPage( langSettings, i18n( "Wikipedia Language Settings" ), "appli cations-education-language" );
QTimer::singleShot( 0, this, SLOT(_configureLangSelector()) ); QTimer::singleShot( 0, this, SLOT(_configureLangSelector()) );
} }
#include "WikipediaApplet.moc" #include "WikipediaApplet.moc"
 End of changes. 7 change blocks. 
7 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)