mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-13 04:21:51 +02:00
pass parent to messageboxes
This commit is contained in:
parent
492c2acf18
commit
b6d6969281
@ -182,9 +182,9 @@ SipHandler::connectPlugins( bool startup, const QString &pluginName )
|
||||
if ( !TomahawkSettings::instance()->acceptedLegalWarning() )
|
||||
{
|
||||
int result = QMessageBox::question(
|
||||
TomahawkApp::instance()->mainWindow(), "Legal Warning",
|
||||
"By pressing OK below, you agree that your use of Tomahawk will be in accordance with any applicable laws, including copyright and intellectual property laws, in effect in your country of residence, and indemnify the Tomahawk developers and project from liability should you choose to break those laws.\n\nFor more information, please see http://gettomahawk.com/legal",
|
||||
"I Do Not Agree", "I Agree"
|
||||
TomahawkApp::instance()->mainWindow(), tr( "Legal Warning" ),
|
||||
tr( "By pressing OK below, you agree that your use of Tomahawk will be in accordance with any applicable laws, including copyright and intellectual property laws, in effect in your country of residence, and indemnify the Tomahawk developers and project from liability should you choose to break those laws.\n\nFor more information, please see http://gettomahawk.com/legal" ),
|
||||
tr( "I Do Not Agree" ), tr( "I Agree" )
|
||||
);
|
||||
if ( result != 1 )
|
||||
return;
|
||||
|
@ -114,7 +114,7 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user )
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( user.id() == 0 )
|
||||
{
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("The credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("The credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
@ -194,7 +194,7 @@ TwitterConfigWidget::startPostGotTomahawkStatus()
|
||||
|
||||
if ( m_postGTtype != "Global Tweet" && ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" ) )
|
||||
{
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("You must enter a user name for this type of tweet.") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("You must enter a user name for this type of tweet.") );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ TwitterConfigWidget::postGotTomahawkStatusAuthVerifyReply( const QTweetUser &use
|
||||
{
|
||||
if ( user.id() == 0 )
|
||||
{
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("Your saved credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("Your saved credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
@ -264,18 +264,18 @@ void
|
||||
TwitterConfigWidget::postGotTomahawkStatusUpdateReply( const QTweetStatus& status )
|
||||
{
|
||||
if ( status.id() == 0 )
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
else
|
||||
QMessageBox::information( 0, tr("Tweeted!"), tr("Your tweet has been posted!") );
|
||||
QMessageBox::information( this, tr("Tweeted!"), tr("Your tweet has been posted!") );
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::postGotTomahawkDirectMessageReply( const QTweetDMStatus& status )
|
||||
{
|
||||
if ( status.id() == 0 )
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your direct message -- sorry!") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your direct message -- sorry!") );
|
||||
else
|
||||
QMessageBox::information( 0, tr("Tweeted!"), tr("Your message has been posted!") );
|
||||
QMessageBox::information( this, tr("Tweeted!"), tr("Your message has been posted!") );
|
||||
}
|
||||
|
||||
void
|
||||
@ -283,5 +283,5 @@ TwitterConfigWidget::postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "Error posting Got Tomahawk message, error code is " << code << ", error message is " << errorMsg;
|
||||
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ void
|
||||
TomahawkWindow::loadSpiff()
|
||||
{
|
||||
bool ok;
|
||||
QString urlstr = QInputDialog::getText( this, "Load XSPF", "Path:", QLineEdit::Normal, "http://ws.audioscrobbler.com/1.0/tag/metal/toptracks.xspf", &ok );
|
||||
QString urlstr = QInputDialog::getText( this, tr( "Load XSPF" ), tr( "Path:" ), QLineEdit::Normal, "http://ws.audioscrobbler.com/1.0/tag/metal/toptracks.xspf", &ok );
|
||||
if ( !ok || urlstr.isEmpty() )
|
||||
return;
|
||||
|
||||
@ -395,7 +395,7 @@ void
|
||||
TomahawkWindow::createAutomaticPlaylist()
|
||||
{
|
||||
bool ok;
|
||||
QString name = QInputDialog::getText( this, "Create New Automatic Playlist", "Name:", QLineEdit::Normal, "New Automatic Playlist", &ok );
|
||||
QString name = QInputDialog::getText( this, tr( "Create New Automatic Playlist" ), tr( "Name:" ), QLineEdit::Normal, tr( "New Automatic Playlist" ), &ok );
|
||||
if ( !ok || name.isEmpty() )
|
||||
return;
|
||||
|
||||
@ -414,7 +414,7 @@ void
|
||||
TomahawkWindow::createStation()
|
||||
{
|
||||
bool ok;
|
||||
QString name = QInputDialog::getText( this, "Create New Station", "Name:", QLineEdit::Normal, "New Station", &ok );
|
||||
QString name = QInputDialog::getText( this, tr( "Create New Station" ), tr( "Name:" ), QLineEdit::Normal, tr( "New Station" ), &ok );
|
||||
if ( !ok || name.isEmpty() )
|
||||
return;
|
||||
|
||||
@ -493,8 +493,8 @@ TomahawkWindow::setWindowTitle( const QString& title )
|
||||
QMainWindow::setWindowTitle( title );
|
||||
else
|
||||
{
|
||||
QString s = m_currentTrack->track() + " " + tr( "by" ) + " " + m_currentTrack->artist()->name();
|
||||
QMainWindow::setWindowTitle( s + " - " + title );
|
||||
QString s = tr( "%1 by %2", "track, artist name" ).arg( m_currentTrack->track(), m_currentTrack->artist()->name() );
|
||||
QMainWindow::setWindowTitle( tr( "%1 - %2", "current track, some window title" ).arg( s, title ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -502,7 +502,7 @@ TomahawkWindow::setWindowTitle( const QString& title )
|
||||
void
|
||||
TomahawkWindow::showAboutTomahawk()
|
||||
{
|
||||
QMessageBox::about( this, "About Tomahawk",
|
||||
QMessageBox::about( this, tr( "About Tomahawk" ),
|
||||
tr( "<h2><b>Tomahawk %1</h2>Copyright 2010, 2011<br/>Christian Muehlhaeuser <muesli@tomahawk-player.org><br/><br/>"
|
||||
"Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Harald Sitter and Steve Robertson" )
|
||||
.arg( qApp->applicationVersion() ) );
|
||||
|
@ -12,7 +12,7 @@ int
|
||||
TomahawkOAuthTwitter::authorizationWidget()
|
||||
{
|
||||
bool ok;
|
||||
int i = QInputDialog::getInt(0, QString( "Twitter PIN" ), QString( "After authenticating on Twitter's web site,\nenter the displayed PIN number here:" ), 0, 0, 2147483647, 1, &ok);
|
||||
int i = QInputDialog::getInt(0, tr( "Twitter PIN" ), tr( "After authenticating on Twitter's web site,\nenter the displayed PIN number here:" ), 0, 0, 2147483647, 1, &ok);
|
||||
if (ok)
|
||||
return i;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user