mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 11:51:44 +02:00
Show KTp KCM for KTp akkounts.
This commit is contained in:
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ ConfigStorage::icon() const
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ConfigStorage::execConfigDialog()
|
ConfigStorage::execConfigDialog( QWidget* parent )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
|
@@ -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 );
|
||||||
|
dialog.resize( parent->logicalDpiX() * 3.0, parent->logicalDpiY() * 2.2 );
|
||||||
|
dialog.setLayout( new QVBoxLayout );
|
||||||
|
dialog.layout()->addWidget( m_configWidgetPlugins.first()->configWidget() );
|
||||||
|
|
||||||
|
QDialogButtonBox* box = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal );
|
||||||
|
dialog.layout()->addWidget( box );
|
||||||
|
connect( box, SIGNAL( clicked( QAbstractButton* ) ), &dialog, SLOT( accept() ) );
|
||||||
|
return dialog.exec();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( !kcm.waitForFinished( 600000 ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
//TODO: this should probably be async
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user