Commit a91f4d3af590f896112da23484db4f2058169dda

  • avatar
  • nobody <nobody @loca…ost.>
  • Sat May 08 09:44:07 CEST 2004
This commit was manufactured by cvs2svn to create tag
'amarok_1_0_beta3'.

svn path=/tags/amarok_1_0_beta3/kdeextragear-1/amarok/; revision=309520
  
1616GenericName[pt]=Leitor de Áudio
1717GenericName[pt_BR]=Tocador de Mídia
1818GenericName[sv]=Ljudspelare
19GenericName[ta]=கேட்பொலி இயக்கி
2019GenericName[xx]=xxAudio Playerxx
2120Exec=amarok -caption "%c" %U
2221Comment=Uncle Rodney says, "10/10, amaroK is seriously super!"
2828Comment[pt]=O Tio Rodney diz, "10/10, amaroK é excelente!"
2929Comment[pt_BR]=O Tio Rodney disse: "10/10, amaroK é muito bom!"
3030Comment[sv]=Farbror Rodney säger, "10/10, amaroK är verkligen fantastiskt!"
31Comment[ta]=Uncle Rodney கூறுவதாவது, "10/10, amaroK நிஜமாக அற்புதமானது!"
3231Comment[xx]=xxUncle Rodney says, "10/10, amaroK is seriously super!"xx
3332Icon=amarok
3433MimeType=application/x-ogg;audio/x-vorbis;audio/basic;audio/x-mod;audio/x-mp3;audio/x-scpls;audio/x-mpegurl;audio/x-sid;audio/x-wav
5050Name[pt]=Colacar em fila no amaroK
5151Name[pt_BR]=Enfileirar no amaroK
5252Name[sv]=Köa i amaroK
53Name[ta]=amaroKகிலுள்ள Enqueue
5453Name[xx]=xxEnqueue in amaroKxx
  
3232ContextBrowser::ContextBrowser( const char *name )
3333 : QVBox( 0, name )
3434{
35 sqlInit();
36
3735 setSpacing( 4 );
3836 setMargin( 5 );
3937
4038 QHBox *hb1 = new QHBox( this );
4139 hb1->setSpacing( 4 );
4240
41 sqlInit();
42
4343 browser = new KHTMLPart( hb1 );
4444 browser->begin();
4545 browser->write( "<html></html>" );
5959
6060void ContextBrowser::openURLRequest(const KURL &url, const KParts::URLArgs & )
6161{
62 kdDebug() << url.path().latin1() << endl;
6362 if ( url.protocol() == "album" )
6463 {
6564 QStringList info = QStringList::split( "/", url.path() );
8686
8787void ContextBrowser::showContextForItem( const MetaBundle &bundle )
8888{
89 // take care of sql updates (schema changed errors)
90 delete m_db;
91 sqlInit();
92
9389 browser->begin();
9490
9591 QString styleSheet( "a { color:black; font-size:8px; text-decoration:none; }"
9393 "td { color:black; font-size:8px; text-decoration:none; }"
9494
9595 ".song { color:black; font-size:8px; text-decoration:none; }"
96 ".song:hover { cursor: default; color:black; font-weight: bold; text-decoration:underline; background-color:#cccccc; }"
96 ".song:hover { color:black; text-decoration:underline; background-color:#cccccc; }"
9797 ".album { color:black; font-weight: bold; font-size:8px; text-decoration:none; }"
9898 ".title { font-size: 11px; font-weight: bold; }"
9999 ".head { font-size: 10px; font-weight: bold; }"
100100
101101 ".rbalbum { border: solid #ffffff 1px; }"
102 ".rbalbum:hover { cursor: default; background-color: #cccccc; border: solid #000000 1px; }"
102 ".rbalbum:hover { cursor: default; border: solid #000000 1px; }"
103103
104104 ".rbcontent { border: solid #cccccc 1px; }"
105105 ".rbcontent:hover { border: solid #000000 1px; }" );
112112 QStringList values;
113113 QStringList names;
114114
115 browser->write( "<div class='head'><br>Other titles on this album:</div>" );
115 browser->write( "<div class='head'><br>Other titles:</div>" );
116116 browser->write( "<div class='rbcontent'>" );
117 browser->write( "<table width='100%' border='0' cellspacing='1' cellpadding='1'>" );
117 browser->write( "<table width='100%' border='0' cellspacing='1' cellpadding='1'><tr><td></td><td width='%100'>" );
118118
119 m_db->execSql( QString( "SELECT tags.title, tags.url, tags.track "
119 m_db->execSql( QString( "SELECT tags.title, tags.url "
120120 "FROM tags, artist, album "
121121 "WHERE tags.album = album.id AND album.name LIKE '%1' AND "
122122 "tags.artist = artist.id AND artist.name LIKE '%2' "
123 "ORDER BY tags.track;" )
123 "ORDER BY random();" )
124124 .arg( m_db->escapeString( bundle.album() ) )
125125 .arg( m_db->escapeString( bundle.artist() ) ), &values, &names );
126126
127 for ( uint i = 0; i < ( values.count() / 3 ) && i < 10; i++ )
127 for ( uint i = 0; i < ( values.count() / 2 ) && i < 10; i++ )
128128 {
129129 if ( values[i].isEmpty() ) continue;
130130
131 browser->write( QString ( "<tr><td class='song' onClick='window.location.href=\"file:%1\"'>%2%3</a></td></tr>" )
132 .arg( values[i*3 + 1] )
133 .arg( ( values[i*3 + 2] == "" ) ? "" : values[i*3 + 2] + ". " )
134 .arg( values[i*3] ) );
131 browser->write( QString ( "<a class='song' href=\"file:%1\">%2</a><br>" )
132 .arg( values[i*2 + 1] )
133 .arg( values[i*2] ) );
135134 }
136135
137136 values.clear();
138137 names.clear();
139138
140 browser->write( "</table>" );
139 browser->write( "</td><td></td></tr></table>" );
141140 browser->write( "</div>" );
142141 browser->write( "<div class='head'><br>Other albums:</div>" );
143142 browser->write( "<table width='100%' border='0' cellspacing='2' cellpadding='1'>" );
161161 .arg( m_db->albumSongCount( values[i*3 + 2], values[i*3 + 1] ) ) );
162162 }
163163
164 browser->write( "</table><br></html>" );
164 browser->write( "</table><br>" );
165
166/* const KURL &url = bundle.url();
167 QString tipBuf;
168 QStringList validExtensions;
169 validExtensions << "jpg" << "png" << "gif" << "jpeg";
170
171 tipBuf = "<table width=108 align=center>";
172
173 DIR *d = opendir( url.directory( FALSE, FALSE ).local8Bit() );
174 if ( d )
175 {
176 const QString td = "<td width=108><img width=100 src='%1%2'></td>";
177 dirent *ent;
178
179 while ( ( ent = readdir( d ) ) )
180 {
181 QString file( ent->d_name );
182
183 if ( validExtensions.contains( file.mid( file.findRev('.')+1 ) ) )
184 {
185 // we found an image, let's add it to the tooltip
186 tipBuf += "<tr>"; //extra row for spacing
187 tipBuf += td.arg( url.directory( FALSE, TRUE ), file );
188 tipBuf += "</tr>";
189 }
190 }
191
192 closedir( d );
193 }
194
195 tipBuf += "</table>";*/
196
197 QString tipBuf;
198 browser->write( QString( "%1</html>" ).arg( tipBuf ) );
165199 browser->end();
166200}
167201
  
340340
341341 if ( validExtensions.contains( url.filename().mid( url.filename().findRev('.')+1 ) ) )
342342 {
343 kdDebug() << url.directory() << " - " << url.filename() << endl;
343344 insertdb->addImageToPath( url.directory(), url.filename(), true );
344345 }
345346 }