Permalink
Browse files

Apparently, sheets should be modal, if it's not a sheet, don't be modal.

git-svn-id: svn+ssh://svn.last.fm/svn/clientside/trunk/desktop@123311 ab8f4a45-97f9-0310-bbd1-854ce3dcee89
  • Loading branch information...
1 parent 0c61627 commit 53c1a7fd0d39dc0223efa691bf6ec0c037d6d837 @mxcl mxcl committed Mar 6, 2009
Showing with 15 additions and 14 deletions.
  1. +15 −13 app/boffin/App.cpp
  2. +0 −1 app/boffin/WordleDialog.h
View
@@ -378,19 +378,21 @@ App::onPlaybackError( const QString& msg )
#include "WordleDialog.h"
-void
+void
App::onWordle()
{
- WordleDialog* w = new WordleDialog( m_mainwindow );
- QString output;
- TagCloudModel m( this, 0 );
- TagCloudModel::CustomRoles role = TagCloudModel::WeightRole;
- w->show();
-
- for( int i = 0; i < m.rowCount(); ++i )
- {
- float weight = m.index( i, 0 ).data( role ).value<float>();
- output += m.index( i, 0 ).data().toString().simplified().replace(' ', '~' ) + ":" + QString::number(weight) + "\n";
+ static OneDialogPointer<WordleDialog> d;
+ if(!d) {
+ d = new WordleDialog( m_mainwindow );
+ QString output;
+ TagCloudModel model( this, 0 );
+ for(int i = 0; i < model.rowCount(); ++i) {
+ QModelIndex index = model.index( i, 0 );
+ QString weight = index.data( TagCloudModel::WeightRole ).toString();
+ QString tag = index.data().toString().trimmed().simplified().replace( ' ', '~' );
+ output += tag + ':' + weight + '\n';
+ }
+ d->setText( output );
}
- w->setText( output );
- }
+ d.show();
+}
@@ -55,7 +55,6 @@ class WordleDialog : public QDialog
connect( buttons, SIGNAL(accepted()), SLOT( accept()));
buttons->button( QDialogButtonBox::Ok )->setText( tr("Close") );
- setModal( true );
setWindowTitle( tr("Your Wordlized Tags") );
}

0 comments on commit 53c1a7f

Please sign in to comment.