mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 11:04:01 +02:00
Show KTp KCM for KTp akkounts.
This commit is contained in:
@@ -84,7 +84,7 @@ void
|
||||
XmppConfigWidget::launchExternalConfigDialog()
|
||||
{
|
||||
ConfigStorage* cs = AccountManager::instance()->configStorageForAccount( m_account->accountId() );
|
||||
cs->execConfigDialog();
|
||||
cs->execConfigDialog( this );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -52,7 +52,7 @@ ConfigStorage::icon() const
|
||||
|
||||
|
||||
bool
|
||||
ConfigStorage::execConfigDialog()
|
||||
ConfigStorage::execConfigDialog( QWidget* parent )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
virtual QPixmap icon() const;
|
||||
|
||||
virtual bool execConfigDialog();
|
||||
virtual bool execConfigDialog( QWidget* parent );
|
||||
|
||||
virtual QStringList accountIds() const = 0;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
QString prettyName() const;
|
||||
QPixmap icon() const;
|
||||
|
||||
bool execConfigDialog();
|
||||
bool execConfigDialog( QWidget* parent );
|
||||
|
||||
QStringList accountIds() const;
|
||||
|
||||
|
Reference in New Issue
Block a user