Commit 246c5d94 authored by Volker Krause's avatar Volker Krause

Port away from KButtonGroup

parent 278db47a
......@@ -33,6 +33,7 @@
UrlConfigurationDialog::UrlConfigurationDialog(QWidget *parent)
: QDialog(parent)
, mRemoteProtocolGroup(new QButtonGroup(this))
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......@@ -55,7 +56,11 @@ UrlConfigurationDialog::UrlConfigurationDialog(QWidget *parent)
mUi.discoveredUrls->setRootIsDecorated(false);
connect(mModel, &QStandardItemModel::dataChanged, this, &UrlConfigurationDialog::onModelDataChanged);
connect(mUi.remoteProtocol, &KButtonGroup::changed, this, &UrlConfigurationDialog::onConfigChanged);
mRemoteProtocolGroup->setExclusive(true);
mRemoteProtocolGroup->addButton(mUi.caldav, KDAV::CalDav);
mRemoteProtocolGroup->addButton(mUi.carddav, KDAV::CardDav);
mRemoteProtocolGroup->addButton(mUi.groupdav, KDAV::GroupDav);
connect(mRemoteProtocolGroup, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), this, &UrlConfigurationDialog::onConfigChanged);
connect(mUi.remoteUrl, &KLineEdit::textChanged, this, &UrlConfigurationDialog::onConfigChanged);
connect(mUi.useDefaultCreds, &QRadioButton::toggled, this, &UrlConfigurationDialog::onConfigChanged);
connect(mUi.username, &KLineEdit::textChanged, this, &UrlConfigurationDialog::onConfigChanged);
......@@ -91,12 +96,12 @@ void UrlConfigurationDialog::writeConfig()
KDAV::Protocol UrlConfigurationDialog::protocol() const
{
return KDAV::Protocol(mUi.remoteProtocol->selected());
return KDAV::Protocol(mRemoteProtocolGroup->id(mRemoteProtocolGroup->checkedButton()));
}
void UrlConfigurationDialog::setProtocol(KDAV::Protocol protocol)
{
mUi.remoteProtocol->setSelected(protocol);
mRemoteProtocolGroup->button(protocol)->setChecked(true);
}
QString UrlConfigurationDialog::remoteUrl() const
......
......@@ -27,6 +27,7 @@
#include <QDialog>
class KJob;
class QButtonGroup;
class QModelIndex;
class QStandardItemModel;
class QPushButton;
......@@ -74,6 +75,7 @@ private:
QString mDefaultUsername;
QString mDefaultPassword;
QPushButton *mOkButton;
QButtonGroup *mRemoteProtocolGroup;
};
#endif
......@@ -33,7 +33,7 @@
<number>0</number>
</property>
<item>
<widget class="KButtonGroup" name="remoteProtocol">
<widget class="QGroupBox" name="remoteProtocol">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
......@@ -210,12 +210,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
......
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