1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-17 19:37:09 +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() XmppConfigWidget::launchExternalConfigDialog()
{ {
ConfigStorage* cs = AccountManager::instance()->configStorageForAccount( m_account->accountId() ); ConfigStorage* cs = AccountManager::instance()->configStorageForAccount( m_account->accountId() );
cs->execConfigDialog(); cs->execConfigDialog( this );
} }

View File

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

View File

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

View File

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

View File

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