Commit 818c969c authored by Alexander Potashev's avatar Alexander Potashev
Browse files

vkontakte: Add function initAccountBox()

parent c336feee
...@@ -139,29 +139,7 @@ VkontakteWindow::VkontakteWindow(bool import, QWidget* const parent) ...@@ -139,29 +139,7 @@ VkontakteWindow::VkontakteWindow(bool import, QWidget* const parent)
/* /*
* Account box * Account box
*/ */
m_accountBox = new QGroupBox(i18n("Account"), m_settingsBox); initAccountBox();
m_accountBox->setWhatsThis(i18n("This account is used for authentication."));
QGridLayout* accountBoxLayout = new QGridLayout(m_accountBox);
QLabel* loginDescLabel = new QLabel(m_accountBox);
loginDescLabel->setText(i18n("Name:"));
loginDescLabel->setWhatsThis(i18n("Your VKontakte login"));
m_loginLabel = new QLabel(m_accountBox);
m_changeUserButton = new KPushButton(
KGuiItem(i18n("Change Account"), "system-switch-user",
i18n("Change VKontakte account used to authenticate")), m_accountBox);
m_changeUserButton->hide(); // changing account does not work anyway
accountBoxLayout->addWidget(loginDescLabel, 0, 0);
accountBoxLayout->addWidget(m_loginLabel, 0, 1);
accountBoxLayout->addWidget(m_changeUserButton, 1, 1);
accountBoxLayout->setSpacing(KDialog::spacingHint());
accountBoxLayout->setMargin(KDialog::spacingHint());
connect(m_changeUserButton, SIGNAL(clicked()),
this, SLOT(slotChangeUserClicked()));
/* /*
* Album box * Album box
...@@ -284,11 +262,40 @@ VkontakteWindow::VkontakteWindow(bool import, QWidget* const parent) ...@@ -284,11 +262,40 @@ VkontakteWindow::VkontakteWindow(bool import, QWidget* const parent)
updateBusyStatus(true); updateBusyStatus(true);
} }
void VkontakteWindow::initAccountBox()
{
m_accountBox = new QGroupBox(i18n("Account"), m_settingsBox);
m_accountBox->setWhatsThis(i18n("This account is used for authentication."));
QGridLayout* accountBoxLayout = new QGridLayout(m_accountBox);
QLabel* loginDescLabel = new QLabel(m_accountBox);
loginDescLabel->setText(i18n("Name:"));
loginDescLabel->setWhatsThis(i18n("Your VKontakte login"));
m_loginLabel = new QLabel(m_accountBox);
m_changeUserButton = new KPushButton(
KGuiItem(i18n("Change Account"), "system-switch-user",
i18n("Change VKontakte account used to authenticate")), m_accountBox);
m_changeUserButton->hide(); // changing account does not work anyway
accountBoxLayout->addWidget(loginDescLabel, 0, 0);
accountBoxLayout->addWidget(m_loginLabel, 0, 1);
accountBoxLayout->addWidget(m_changeUserButton, 1, 1);
accountBoxLayout->setSpacing(KDialog::spacingHint());
accountBoxLayout->setMargin(KDialog::spacingHint());
connect(m_changeUserButton, SIGNAL(clicked()),
this, SLOT(slotChangeUserClicked()));
}
VkontakteWindow::~VkontakteWindow() VkontakteWindow::~VkontakteWindow()
{ {
reset(); reset();
} }
//---------------------------------------------------------------------------
void VkontakteWindow::startReactivation() void VkontakteWindow::startReactivation()
{ {
m_imgList->loadImagesFromCurrentSelection(); m_imgList->loadImagesFromCurrentSelection();
......
...@@ -120,6 +120,8 @@ protected Q_SLOTS: ...@@ -120,6 +120,8 @@ protected Q_SLOTS:
protected: protected:
void initAccountBox();
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment