1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-15 18:44:30 +02:00

Show KTp KCM for KTp akkounts.

This commit is contained in:
Teo Mrnjavac
2013-06-28 21:40:13 +02:00
parent 1c61c5ae25
commit e2f31fdd68
5 changed files with 21 additions and 14 deletions

View File

@@ -84,7 +84,7 @@ void
XmppConfigWidget::launchExternalConfigDialog()
{
ConfigStorage* cs = AccountManager::instance()->configStorageForAccount( m_account->accountId() );
cs->execConfigDialog();
cs->execConfigDialog( this );
}

View File

@@ -52,7 +52,7 @@ ConfigStorage::icon() const
bool
ConfigStorage::execConfigDialog()
ConfigStorage::execConfigDialog( QWidget* parent )
{
return false;
}

View File

@@ -45,7 +45,7 @@ public:
virtual QPixmap icon() const;
virtual bool execConfigDialog();
virtual bool execConfigDialog( QWidget* parent );
virtual QStringList accountIds() const = 0;

View File

@@ -27,14 +27,18 @@
#include "accounts/CredentialsManager.h"
#include "utils/Logger.h"
#include "utils/PluginLoader.h"
#include "utils/TomahawkUtilsGui.h"
#include <TelepathyQt/Account>
#include <TelepathyQt/PendingReady>
#include <TelepathyQt/PendingOperation>
#include <TelepathyQt/AccountSet>
#include <QDialog>
#include <QDialogButtonBox>
#include <QProcess>
#include <QTimer>
#include <QBoxLayout>
@@ -82,19 +86,22 @@ Tomahawk::Accounts::TelepathyConfigStorage::icon() const
bool
Tomahawk::Accounts::TelepathyConfigStorage::execConfigDialog()
Tomahawk::Accounts::TelepathyConfigStorage::execConfigDialog( QWidget* parent )
{
QProcess kcm;
kcm.start( "kcmshell4 kcm_ktp_accounts" );
if ( !kcm.waitForStarted() )
return false;
if ( !m_configWidgetPlugins.isEmpty() )
{
QDialog dialog( parent );
dialog.resize( parent->logicalDpiX() * 3.0, parent->logicalDpiY() * 2.2 );
dialog.setLayout( new QVBoxLayout );
dialog.layout()->addWidget( m_configWidgetPlugins.first()->configWidget() );
if ( !kcm.waitForFinished( 600000 ) )
return false;
QDialogButtonBox* box = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal );
dialog.layout()->addWidget( box );
connect( box, SIGNAL( clicked( QAbstractButton* ) ), &dialog, SLOT( accept() ) );
return dialog.exec();
}
//TODO: this should probably be async
return true;
return false;
}

View File

@@ -51,7 +51,7 @@ public:
QString prettyName() const;
QPixmap icon() const;
bool execConfigDialog();
bool execConfigDialog( QWidget* parent );
QStringList accountIds() const;