diff --git a/src/conf/accountdlg.ui b/src/conf/accountdlg.ui deleted file mode 100644 index bfbcc4bc..00000000 --- a/src/conf/accountdlg.ui +++ /dev/null @@ -1,297 +0,0 @@ - - - AccountDlg - - - - 0 - 0 - 788 - 552 - - - - - - - Qt::Horizontal - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Qt::Horizontal - - - - 41 - 21 - - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - - 16777215 - 16777215 - - - - true - - - By default, when you place a call, Ring will use the first account in this list which is "registered". Change the order of the accounts using the "Up" and "Down" arrows. Enable/disable them by checking/unchecking them on the left of the item. Add or remove some with "Plus" and "Sub" buttons. Edit the selected account with the form on the right. - - - true - - - QAbstractItemView::DragDrop - - - Qt::MoveAction - - - 5 - - - true - - - - - - - 0 - - - - - Get this account up - - - By default, when you place a call, Ring will use the first account in this list which is "registered". Change the order of the accounts using the "Up" and "Down" arrows. - - - Up - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - Up, PgUp - - - - - - - Get this account down - - - By default, when you place a call, Ring will use the first account in this list which is "registered". Change the order of the accounts using the "Up" and "Down" arrows. - - - Down - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - Down, PgDown - - - - - - - - 0 - 0 - - - - Remove the selected account - - - This button will remove the selected account in the list below. Be sure you really don't need it anymore. If you think you might use it again later, just uncheck it. - - - - - - Remove - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - -, Del, Backspace - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Add a new account - - - This button enables you to initialize a new account. You will then be able to edit it using the form on the right. - - - Add - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - + - - - - - - - - - 6 - 0 - - - - - 0 - 0 - - - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
- - LeftToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
- - CategorizedTree - QTreeView -
widgets/categorizedtree.h
-
- - RightToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
- - CenterToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
- - Pages::Account - QWidget -
conf/accountpages/account.h
- 1 - - setAccount(QModelIndex) - -
-
- - - - button_accountAdd - clicked() - AccountDlg - slotNewAddAccount() - - - 266 - 530 - - - 361 - 550 - - - - - - slotNewAddAccount() - setCurrentAccount(QModelIndex) - -
diff --git a/src/conf/accountpages/account.cpp b/src/conf/accountpages/account.cpp deleted file mode 100644 index aeb725f7..00000000 --- a/src/conf/accountpages/account.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "account.h" - -//Qt -#include - -//KDE -#include - -//Ring -#include -#include -#include -#include - -//Binder -#include "conf/accountserializationadapter.h" - -#include "basic.h" - -#include "dlgprofiles.h" - -Pages::Account::Account(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - - //Remove profile - m_pPages->removeTab(m_pPages->count()-1); - - //Remove Wizard - m_pPages->removeTab(m_pPages->count()-1); - - // Don't ask - QTimer::singleShot(0, [this]() { - m_pPages->setCurrentIndex(0); - }); -} - -void Pages::Account::setEngine(QQmlEngine* e) -{ - m_pEngine = e; - auto l = new QHBoxLayout(dlgProfileHolder); - m_pProfile = new DlgProfiles(dlgProfileHolder, e); - l->addWidget(m_pProfile); - connect(m_pProfile, &DlgProfiles::changed, this, [this]() { - emit changed(); - }); -} - -void Pages::Account::setAccount(::Account* a) -{ - PageBase::setAccount(a); - - dlgBasic -> setAccount(a); - dlgAdvanced -> setAccount(a); - dlgNetwork -> setAccount(a); - dlgCodec -> setAccount(a); - dlgDevices -> setAccount(a); - dlgCredentials -> setAccount(a); - dlgRingtone -> setAccount(a); - dlgSecurity -> setAccount(a); - - if (m_pAdapter) - delete m_pAdapter; - - m_pAdapter = new AccountSerializationAdapter(a, this); - - switch (a->protocol()) { - case ::Account::Protocol::RING: - case ::Account::Protocol::SIP: - m_pPages->setTabEnabled(4, a->isNew() || a->id() != "IP2IP"); - break; - case ::Account::Protocol::COUNT__: - break; - } -} - -void Pages::Account::displayProfile(bool display) -{ - if (display) { - while (m_pPages->count()) - m_pPages->removeTab(0); - - m_pPages->insertTab(0, m_pProfile,i18n("Profile")); - } - else if (m_pPages->count() == 1) { - m_pPages->removeTab(0); - m_pPages->insertTab(0, dlgRingtone ,i18n("Ringtone" )); - m_pPages->insertTab(0, dlgSecurity ,i18n("Security" )); - m_pPages->insertTab(0, dlgCredentials,i18n("Credentials")); - m_pPages->insertTab(0, dlgCodec ,i18n("Codecs" )); - m_pPages->insertTab(0, dlgDevices ,i18n("Devices" )); - m_pPages->insertTab(0, dlgNetwork ,i18n("Network" )); - m_pPages->insertTab(0, dlgAdvanced ,i18n("Advanced" )); - m_pPages->insertTab(0, dlgBasic ,i18n("Basic" )); - m_pPages->setCurrentIndex(0); - } -} - -void Pages::Account::setProfile(Person* p) -{ - m_pProfile->loadPerson(p); - m_lToSave << p; -} - -void Pages::Account::setAccount(const QModelIndex& idx) -{ - auto prof = idx; - - while (qobject_cast(prof.model())) - prof = static_cast(prof.model())->mapToSource(prof); - - if (auto a = ProfileModel::instance().getAccount(prof)) { - displayProfile(false); - setAccount(a); - } - else if (auto pr = ProfileModel::instance().getProfile(prof)) { - setProfile(pr); - displayProfile(true); - } -} - -void Pages::Account::updateWidgets() -{ - qDebug() << "Update widgets"; - account() << ::Account::EditAction::CANCEL; -} - -void Pages::Account::updateSettings() -{ - qDebug() << "Update settings"; - m_pProfile->saveToPerson(); - - foreach(Person* p, m_lToSave) { - if (p->isActive()) - p->save(); - } -} - -void Pages::Account::slotUpdateButtons() -{ - qDebug() << "Update buttons"; - emit updateButtons(); -} - -void Pages::Account::selectAlias() -{ - QLineEdit* le = dlgBasic->lrcfg_alias; - - le->setSelection(0,le->text().size()); - le->setFocus(Qt::OtherFocusReason); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/account.h b/src/conf/accountpages/account.h deleted file mode 100644 index 5d4d8c27..00000000 --- a/src/conf/accountpages/account.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef ACCOUNT_PAGE_H -#define ACCOUNT_PAGE_H - -#include -#include "pagebase.h" -#include "ui_tabs.h" - -class Account; -class Person; -class AccountSerializationAdapter; -class DlgProfiles; -class QQmlEngine; - -namespace Pages { - -class Account final : public PageBase, public Ui::Tabs -{ -Q_OBJECT -public: - //Constructor - explicit Account(QWidget *parent = nullptr); - - void setEngine(QQmlEngine* e); - -public Q_SLOTS: - virtual void updateWidgets() override; - virtual void updateSettings() override; - - void selectAlias(); - -public Q_SLOTS: - virtual void setAccount(::Account* a) override; - void setProfile(Person* p); - void setAccount(const QModelIndex& idx); - -private Q_SLOTS: - void slotUpdateButtons(); - void displayProfile(bool display); - -Q_SIGNALS: - void changed(); - -private: - //Attributes - Account* m_pAccount {nullptr}; - QList m_lToSave; - AccountSerializationAdapter* m_pAdapter = nullptr; - DlgProfiles* m_pProfile {nullptr}; - QQmlEngine* m_pEngine{nullptr}; -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/advanced.cpp b/src/conf/accountpages/advanced.cpp deleted file mode 100644 index d264e57a..00000000 --- a/src/conf/accountpages/advanced.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "advanced.h" - -#include - -Pages::Advanced::Advanced(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - - connect(this,&PageBase::accountSet,[this]() { - m_pDTMF_GB->setVisible(account()->protocol() == Account::Protocol::SIP); - }); - - connect(lrcfg_hasActiveCallLimit, &QCheckBox::toggled, this, [this](bool v) { - if (!v) - lrcfg_activeCallLimit->setValue(-1); - else if (lrcfg_activeCallLimit->value() == -1) - lrcfg_activeCallLimit->setValue(1); - }); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; - diff --git a/src/conf/accountpages/advanced.h b/src/conf/accountpages/advanced.h deleted file mode 100644 index 4be5b741..00000000 --- a/src/conf/accountpages/advanced.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef ADVANCED_PAGE_H -#define ADVANCED_PAGE_H - -#include -#include "pagebase.h" -#include "ui_advanced.h" - -namespace Pages { - -class Advanced final : public PageBase, public Ui_AdvancedPage -{ -Q_OBJECT -public: - //Constructor - explicit Advanced(QWidget *parent = nullptr); - -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/advanced.ui b/src/conf/accountpages/advanced.ui deleted file mode 100644 index 834ba4a7..00000000 --- a/src/conf/accountpages/advanced.ui +++ /dev/null @@ -1,373 +0,0 @@ - - - AdvancedPage - - - - 0 - 0 - 678 - 555 - - - - - - - Registration - - - - - - - - Re&gistration expire - - - lrcfg_registrationExpire - - - - - - - seconds - - - 16777215 - - - - - - - Use custom user agent - - - - - - - false - - - - - - - - - Allow calls from unknown peers - - - - - - - false - - - Allow calls if that person has been contacted in the past - - - - - - - false - - - Allow calls from your contacts - - - - - - - - - - Negotiation - - - - QFormLayout::ExpandingFieldsGrow - - - - - Use a proxy - - - - - - - false - - - SIP proxy server (if none, leave blank) - - - - - - - Enable STUN - - - - - - - false - - - Choose STUN server (example: stunserver.org) - - - - - - - TURN server - - - - - - - false - - - Choose TURN server (example: turnserver.org) - - - - - - - Enable UPnP - - - true - - - - - - - - - - Feature - - - - - - true - - - Enable presence support - - - - - - - Enable video when supported - - - - - - - Limit the number of concurrent incoming calls - - - - - - - false - - - -1 - - - - - - - Qt::Horizontal - - - - 278 - 20 - - - - - - - - - - - DTMF - - - - - - Over R&TP - - - - - - - Over SIP - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 53 - - - - - - - - - - lrcfg_hasCustomUserAgent - toggled(bool) - lrcfg_userAgent - setEnabled(bool) - - - 94 - 72 - - - 256 - 72 - - - - - lrcfg_sipStunEnabled - toggled(bool) - lrcfg_sipStunServer - setEnabled(bool) - - - 112 - 243 - - - 432 - 244 - - - - - lrcfg_hasProxy - toggled(bool) - lrcfg_proxy - setEnabled(bool) - - - 78 - 205 - - - 194 - 215 - - - - - lrcfg_turnEnabled - toggled(bool) - lrcfg_turnServer - setEnabled(bool) - - - 65 - 267 - - - 219 - 264 - - - - - lrcfg_hasActiveCallLimit - toggled(bool) - lrcfg_activeCallLimit - setEnabled(bool) - - - 187 - 398 - - - 389 - 407 - - - - - lrcfg_allowIncomingFromUnknown - toggled(bool) - lrcfg_allowIncomingFromContact - setDisabled(bool) - - - 125 - 106 - - - 143 - 156 - - - - - lrcfg_allowIncomingFromUnknown - toggled(bool) - lrcfg_allowIncomingFromHistory - setDisabled(bool) - - - 184 - 106 - - - 198 - 131 - - - - - diff --git a/src/conf/accountpages/basic.cpp b/src/conf/accountpages/basic.cpp deleted file mode 100644 index b2e315ad..00000000 --- a/src/conf/accountpages/basic.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "basic.h" - -#include - -#include -#include -#include -#include -#include - -#include - -Pages::Basic::Basic(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - connect(this,&PageBase::accountSet,[this]() { - disconnect(m_CredConn ); - - auto a = account(); - Q_ASSERT(a); - - m_pProtocol->bindToModel(a->protocolModel(),a->protocolModel()->selectionModel()); - - m_pProfile->bindToModel( - &ProfileModel::instance(), - ProfileModel::instance().getAccountSelectionModel(a) - ); - - m_pBootstrapModel->setModel((a->protocol() == Account::Protocol::RING)? - a->bootstrapModel() : nullptr - ); - - if (m_pBootstrapModel->horizontalHeader() && m_pBootstrapModel->model()) - m_pBootstrapModel->horizontalHeader()->setSectionResizeMode (0,QHeaderView::Stretch); - - m_pBootstrapModel->setVisible(a->roleData((int)Account::Role::HasCustomBootstrap).toBool()); - -// disconnect(this, &Pages::Basic::updateStatus); //TODO track previous account - connect(a, &Account::stateChanged, this, &Pages::Basic::updateStatus); - -/* m_CredConn = connect(account()->credentialModel(), &CredentialModel::primaryCredentialChanged,[this](Credential::Type t, Credential* c) { - if (t == Credential::Type::SIP) { - lrcfg_password->setText(c->password()); - } - });*/ - - updateStatus(); - }); - - connect(m_pDisplayLog, &QToolButton::clicked, this, [this]() { - if (account()) { - QPointer d = new AccountStatusViewer(account(),this); - d->show(); - } - }); -} - -void Pages::Basic::updateStatus() -{ - const int errorCode = account()->lastErrorCode(); - QString message = account()->toHumanStateName(); - - if (account()->registrationState() == Account::RegistrationState::ERROR && !account()->lastErrorMessage().isEmpty()) - message = account()->lastErrorMessage(); - - edit7_state->setText(QStringLiteral(" %1 (%2)") - .arg(message ) - .arg( errorCode==-1 ? 200 : errorCode ) - .arg(account()->stateColorName() ) - ); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/basic.h b/src/conf/accountpages/basic.h deleted file mode 100644 index 5ae42f49..00000000 --- a/src/conf/accountpages/basic.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef BASIC_PAGE_H -#define BASIC_PAGE_H - -#include -#include "pagebase.h" -#include "ui_basic.h" - -namespace Pages { - -class Basic final : public PageBase, public Ui_BasicPage -{ -Q_OBJECT -public: - //Constructor - explicit Basic(QWidget *parent = nullptr); - -private: - QMetaObject::Connection m_CredConn; - -private Q_SLOTS: - void updateStatus(); -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/basic.ui b/src/conf/accountpages/basic.ui deleted file mode 100644 index 10616e54..00000000 --- a/src/conf/accountpages/basic.ui +++ /dev/null @@ -1,328 +0,0 @@ - - - BasicPage - - - - 0 - 0 - 402 - 494 - - - - - - - - - Alias* - - - lrcfg_alias - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Anything, used only to select the account - - - - - - - Protocol - - - m_pProtocol - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - &Display Name* - - - lrcfg_displayName - - - - - - - The name as seen by the peer - - - - - - - Re&gistered Name* - - - lrcfg_registeredName - - - - - - - - - The name seen by your peers - - - - - - - A - - - - - - - - - Server* - - - lrcfg_hostname - - - - - - - - 0 - 0 - - - - Example: sip.sring.cx or 192.168.0.2 - - - - - - - - - - &Username* - - - lrcfg_username - - - - - - - Usually your extension number - - - - - - - Password* - - - lrcfg_password - - - - - - - QLineEdit::Password - - - SIP password, ask your network administrator - - - - - - - Profile - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - 0 - 0 - - - - - 10 - 0 - - - - - - - - - - - Availability log - - - - .. - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - - - - - Use custom bootstrap nodes - - - - - - - Auto answer - - - - - - - Qt::Vertical - - - - 20 - 30 - - - - - - - - Status - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
-
- - - - lrcfg_hasCustomBootstrap - toggled(bool) - m_pBootstrapModel - setVisible(bool) - - - 81 - 276 - - - 88 - 356 - - - - -
diff --git a/src/conf/accountpages/codecs.cpp b/src/conf/accountpages/codecs.cpp deleted file mode 100644 index 7d983959..00000000 --- a/src/conf/accountpages/codecs.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "codecs.h" - -// #include -// #include -// -// -// Pages::Codecs::Codecs(QWidget *parent) : PageBase(parent) -// { -// setupUi(this); -// connect(this,&PageBase::accountSet,[this]() { -// disconnect(button_audiocodecUp ); -// disconnect(button_audiocodecDown); -// m_pCodecs->setModel(account()->codecModel()); -// m_pCodecs->setSelectionModel(account()->codecModel()->selectionModel()); -// connect(button_audiocodecUp , &QToolButton::clicked,account()->codecModel(), &CodecModel::moveUp ); -// connect(button_audiocodecDown, &QToolButton::clicked,account()->codecModel(), &CodecModel::moveDown); -// }); -// -// connect(m_pCodecs, &QListView::clicked, this, [this](const QModelIndex& idx) { -// m_pSampleRate->setText(idx.data(CodecModel::Role::SAMPLERATE).toString()); -// }); -// -// connect(m_pCodecs, &QListView::clicked, this, [this](const QModelIndex& idx) { -// m_pBitrate->setText(idx.data(CodecModel::Role::BITRATE).toString()); -// }); -// } - - -// Qt -#include -#include -#include -#include -#include -#include -#include - -// Ring -#include -#include -#include - -Pages::Codecs::Codecs(QWidget* parent) : PageBase(parent),m_pAccount(nullptr) -{ - setupUi(this); - - connect(this,&PageBase::accountSet,[this]() { -// disconnect(button_audiocodecUp ); -// disconnect(button_audiocodecDown); -// m_pCodecs->setModel(account()->codecModel()); -// m_pCodecs->setSelectionModel(account()->codecModel()->selectionModel()); -// connect(button_audiocodecUp , &QToolButton::clicked,account()->codecModel(), &CodecModel::moveUp ); -// connect(button_audiocodecDown, &QToolButton::clicked,account()->codecModel(), &CodecModel::moveDown); - }); - -// connect(m_pCodecs, &QListView::clicked, this, [this](const QModelIndex& idx) { -// m_pSampleRate->setText(idx.data(CodecModel::Role::SAMPLERATE).toString()); -// }); -// -// connect(m_pCodecs, &QListView::clicked, this, [this](const QModelIndex& idx) { -// m_pBitrate->setText(idx.data(CodecModel::Role::BITRATE).toString()); -// }); -} - -void Pages::Codecs::setAccount(Account* a) -{ - m_pAccount = a; -} - -// kate: space-indent on; indent-width 4; replace-tabs on; diff --git a/src/conf/accountpages/codecs.h b/src/conf/accountpages/codecs.h deleted file mode 100644 index 9967579a..00000000 --- a/src/conf/accountpages/codecs.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef CODECS_PAGE_H -#define CODECS_PAGE_H - -#include -class QQuickWidget; - -#include "pagebase.h" -#include "ui_codecs.h" - -namespace Pages { - -class Codecs final : public PageBase, public Ui_CodecPage -{ - Q_OBJECT -public: - //Constructor - explicit Codecs(QWidget *parent = nullptr); - void setAccount(Account* a); - -private: - Account* m_pAccount; -}; - -} - -#endif - -// kate: space-indent on; indent-width 4; replace-tabs on; diff --git a/src/conf/accountpages/codecs.ui b/src/conf/accountpages/codecs.ui deleted file mode 100644 index 29ab8017..00000000 --- a/src/conf/accountpages/codecs.ui +++ /dev/null @@ -1,38 +0,0 @@ - - - CodecPage - - - - 0 - 0 - 400 - 346 - - - - - - - Move the codecs up and down to alter the priority. Ring recommend Opus for audio and H264 for video. In case of problems, PCMA is the most widely supported audio codec and H263 the most supported video codec. - - - true - - - - - - - - 0 - 0 - - - - - - - - - diff --git a/src/conf/accountpages/credentials.cpp b/src/conf/accountpages/credentials.cpp deleted file mode 100644 index ce8ef7cc..00000000 --- a/src/conf/accountpages/credentials.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "credentials.h" - -// Qt -#include -#include -#include -#include -#include -#include - -// LibRingQt -#include -#include - -#include -#include - -Pages::Credentials::Credentials(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - m_pDelegate = new CategorizedDelegate(m_pCredentials); - m_pChildDelegate = new QStyledItemDelegate(); - m_pDelegate->setChildDelegate(m_pChildDelegate); - m_pCredentials->setItemDelegate(m_pDelegate); - - connect(this,&PageBase::accountSet, this, &Pages::Credentials::slotSetAccount); - - connect(m_pCredentials , &QTreeView::clicked , this, &Pages::Credentials::loadInfo ); - connect(button_add_credential , &QToolButton::clicked , this, &Pages::Credentials::slotAddCredential ); - connect(button_remove_credential , &QToolButton::clicked , this, &Pages::Credentials::slotRemoveCredential ); - connect(edit_credential_realm_2 , &QLineEdit::textChanged, this, &Pages::Credentials::slotRealmChanged ); - connect(edit_credential_auth_2 , &QLineEdit::textChanged, this, &Pages::Credentials::slotUserChanged ); - connect(edit_credential_password_2 , &QLineEdit::textChanged, this, &Pages::Credentials::slotPasswdChanged ); -} - -Pages::Credentials::~Credentials() -{ - m_pDelegate->setChildDelegate(nullptr); - delete m_pChildDelegate; - delete m_pDelegate; -} - -void Pages::Credentials::slotSetAccount() -{ - m_pCredentials->setModel(account()->credentialModel()); - loadInfo(); - m_pType->bindToModel(account()->credentialModel()->availableTypeModel(),account()->credentialModel()->availableTypeSelectionModel()); - - connect(account()->credentialModel(), &QAbstractItemModel::rowsInserted, m_pCredentials, &QTreeView::expandAll); - - m_pCredentials->expandAll(); -} - -void Pages::Credentials::slotAddCredential() -{ - m_pCredentials->setCurrentIndex(account()->credentialModel()->addCredentials()); - loadInfo(); -} - -void Pages::Credentials::slotRemoveCredential() -{ - account()->credentialModel()->removeCredentials(m_pCredentials->currentIndex()); - m_pCredentials->setCurrentIndex(account()->credentialModel()->index(0,0)); - loadInfo(); -} - -void Pages::Credentials::slotRealmChanged(const QString& text) -{ - const QModelIndex current = m_pCredentials->selectionModel()->currentIndex(); - account()->credentialModel()->setData(current,text, CredentialModel::Role::REALM); -} - -void Pages::Credentials::slotUserChanged(const QString& text) -{ - const QModelIndex current = m_pCredentials->selectionModel()->currentIndex(); - account()->credentialModel()->setData(current,text, CredentialModel::Role::NAME); -} - -void Pages::Credentials::slotPasswdChanged(const QString& text) -{ - const QModelIndex current = m_pCredentials->selectionModel()->currentIndex(); - account()->credentialModel()->setData(current,text, CredentialModel::Role::PASSWORD); -} - -void Pages::Credentials::loadInfo() -{ - const QModelIndex idx = m_pCredentials->selectionModel()->currentIndex(); - if (idx.isValid()) { - edit_credential_password_2->blockSignals(true); - edit_credential_auth_2->blockSignals(true); - edit_credential_realm_2->blockSignals(true); - edit_credential_realm_2->setText ( m_pCredentials->model()->data(idx,CredentialModel::Role::REALM) .toString()); - edit_credential_auth_2->setText ( m_pCredentials->model()->data(idx,CredentialModel::Role::NAME) .toString()); - edit_credential_password_2->setText ( m_pCredentials->model()->data(idx,CredentialModel::Role::PASSWORD) .toString()); - edit_credential_realm_2->blockSignals(false); - edit_credential_auth_2->blockSignals(false); - edit_credential_password_2->blockSignals(false); - } - else if (account()->credentialModel()->rowCount()) { - m_pCredentials->setCurrentIndex(account()->credentialModel()->index(0,0)); - loadInfo(); - } -} - -void Pages::Credentials::setAccount(Account* a) -{ -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/credentials.h b/src/conf/accountpages/credentials.h deleted file mode 100644 index d5f4a650..00000000 --- a/src/conf/accountpages/credentials.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef CREDENTIALS_PAGE_H -#define CREDENTIALS_PAGE_H - -#include -#include "pagebase.h" -#include "ui_credentials.h" - -class CategorizedDelegate; -class QQuickWidget; -class QStyledItemDelegate; - -namespace Pages { - -class Credentials final : public PageBase, public Ui_CredentialsPage -{ -Q_OBJECT -public: - //Constructor - explicit Credentials(QWidget *parent = nullptr); - virtual ~Credentials(); - void setAccount(Account* a); - -private: - CategorizedDelegate* m_pDelegate; - QStyledItemDelegate* m_pChildDelegate; - -private Q_SLOTS: - void loadInfo(); - void slotSetAccount(); - void slotAddCredential(); - void slotRemoveCredential(); - void slotRealmChanged(const QString& text); - void slotUserChanged(const QString& text); - void slotPasswdChanged(const QString& text); -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/credentials.ui b/src/conf/accountpages/credentials.ui deleted file mode 100644 index 7ba951e7..00000000 --- a/src/conf/accountpages/credentials.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - CredentialsPage - - - - 0 - 0 - 659 - 530 - - - - - - - - 0 - 0 - - - - Details - - - - - - Realm - - - - - - - Auth. name - - - - - - - Password - - - - - - - true - - - Usually * - - - - - - - true - - - Usually your extension number - - - - - - - true - - - true - - - QLineEdit::Password - - - SIP password, ask your network administrator - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 40 - - - - - - - - - - - - 0 - 0 - - - - - 32 - 16777215 - - - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - - - - - Remove - - - - ../../../../../../.designer/backup../../../../../../.designer/backup - - - - - - - - - - 0 - 0 - - - - true - - - Qt::MoveAction - - - 5 - - - false - - - - - - - - 0 - 0 - - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
- - CategorizedTree - QTreeView -
widgets/categorizedtree.h
-
-
- - -
diff --git a/src/conf/accountpages/devices.cpp b/src/conf/accountpages/devices.cpp deleted file mode 100644 index 2bdaf1d5..00000000 --- a/src/conf/accountpages/devices.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "devices.h" - -// Qt -#include -#include -#include -#include -#include -#include - -// Ring -#include -#include - -Pages::Devices::Devices(QWidget* parent) : QWidget(parent),m_pAccount(nullptr) -{ - -} - -void Pages::Devices::setAccount(Account* a) -{ - m_pAccount = a; -} diff --git a/src/conf/accountpages/devices.h b/src/conf/accountpages/devices.h deleted file mode 100644 index 59bb0af2..00000000 --- a/src/conf/accountpages/devices.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLG_DHT_H -#define DLG_DHT_H - -#include - -class QQuickWidget; - -class Account; - -namespace Pages { - -class Devices : public QWidget -{ - Q_OBJECT -public: - explicit Devices(QWidget* parent = nullptr); - void setAccount(Account* a); - -private: - Account* m_pAccount; -}; - -} - -#endif diff --git a/src/conf/accountpages/dlgprofiles.cpp b/src/conf/accountpages/dlgprofiles.cpp deleted file mode 100644 index 162aa4a3..00000000 --- a/src/conf/accountpages/dlgprofiles.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Alexandre Lision * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "dlgprofiles.h" - -//KDE -#include -#include -#include -#include - -//Qt -#include - -//Ring -#include "profilemodel.h" -#include "personmodel.h" -#include "individual.h" - -DlgProfiles::DlgProfiles(QWidget *parent, QQmlEngine* e, const QString& name, const QString& uri) : - QQuickWidget(e, parent), m_pCurrentPerson(nullptr) -{ - Q_UNUSED(name) - Q_UNUSED(uri) - - setResizeMode(QQuickWidget::SizeRootObjectToView); - setSource(QUrl(QStringLiteral("qrc:/ContactDialog.qml"))); - auto item = rootObject(); - - if (!item) { - qDebug() << errors(); - Q_ASSERT(false); - } - - item->setProperty("showStat" , false ); - item->setProperty("showImage" , true ); - item->setProperty("forcedState" , "profile" ); - item->setProperty("showSave" , false ); - - connect(item, SIGNAL(changed(bool)), this, SLOT(slotChanged())); -} - -DlgProfiles::~DlgProfiles() -{ - -} - -bool DlgProfiles::checkValues() -{ - return true; //!edit_name->text().isEmpty(); -} - -void DlgProfiles::loadPerson(Person* profile) -{ - auto item = rootObject(); - m_Lock = true; - item->setProperty("individual", QVariant::fromValue(profile->individual())); - item->setProperty("showStat", false); - item->setProperty("showImage", true); - item->setProperty("showSave", false); - m_Lock = false; -} - -bool DlgProfiles::saveToPerson(Person* p) -{ - m_Lock = true; - auto item = rootObject(); - - if (p) - item->setProperty("individual", QVariant::fromValue(p->individual())); - - QMetaObject::invokeMethod(item, "save"); - m_Lock = false; - return true; -} - -Person* DlgProfiles::create(CollectionInterface* col) -{ - if(checkValues()) { - - Person* profile = new Person(col); - - saveToPerson(profile); - - return profile; - } - - return nullptr; -} - -void DlgProfiles::cancel() -{ - emit requestCancel(); -} - -void DlgProfiles::accept() -{ - emit requestSave(); -} - -//4.6 Image Restrictions -//The following rules apply to images: -//1. The image SHOULD use less than eight kilobytes (8k) of data; this restriction -// is to be enforced by the publishing client. -//2. The image height and width SHOULD be between thirty-two (32) and ninety-six (96) pixels; -// the recommended size is sixty-four (64) pixels high and sixty-four (64) pixels wide. -//3. The image SHOULD be square. -//4. The image content type SHOULD be image/gif, image/jpeg, or image/png; -// support for the "image/png" content type is REQUIRED, -// support for the "image/gif" and "image/jpeg" content types is RECOMMENDED, -// and support for any other content type is OPTIONAL. - -void DlgProfiles::slotChanged() -{ - if (m_Lock) - return; - - emit changed(); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/dlgprofiles.h b/src/conf/accountpages/dlgprofiles.h deleted file mode 100644 index 17d7cc0c..00000000 --- a/src/conf/accountpages/dlgprofiles.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Alexandre Lision * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLGPROFILES_H -#define DLGPROFILES_H - -#include - -#include -#include - -class CollectionInterface; -class Person; -class QQmlEngine; - -class DlgProfiles final : public QQuickWidget -{ -Q_OBJECT -public: - //Constructor - explicit DlgProfiles(QWidget *parent = nullptr, QQmlEngine* e = nullptr, const QString& name = QString(), const QString& uri = QString()); - - //Destructor - virtual ~DlgProfiles(); - - bool checkValues(); - -private: - Person* m_pCurrentPerson; - bool m_Lock {false}; - -public Q_SLOTS: - void loadPerson(Person* p); - bool saveToPerson(Person* p = nullptr); - Person* create(CollectionInterface* col); - void cancel(); - void accept(); - -private Q_SLOTS: - void slotChanged(); - -Q_SIGNALS: - void requestSave(); - void requestCancel(); - void changed(); -}; -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/network.cpp b/src/conf/accountpages/network.cpp deleted file mode 100644 index 5f339a66..00000000 --- a/src/conf/accountpages/network.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "network.h" - -#include -#include - -Pages::Network::Network(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - connect(this,&PageBase::accountSet,[this]() { - m_pPortGroup->setVisible(account()->protocol() == Account::Protocol::SIP); - m_pPublishedGB->setVisible(account()->protocol() == Account::Protocol::SIP); - m_pNetworkInterfaces->bindToModel(account()->networkInterfaceModel(),account()->networkInterfaceModel()->selectionModel()); - }); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; - diff --git a/src/conf/accountpages/network.h b/src/conf/accountpages/network.h deleted file mode 100644 index 834b11d7..00000000 --- a/src/conf/accountpages/network.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef NETWORK_PAGE_H -#define NETWORK_PAGE_H - -#include -#include "pagebase.h" -#include "ui_network.h" - -namespace Pages { - -class Network final : public PageBase, public Ui_NetworkPage -{ -Q_OBJECT -public: - //Constructor - explicit Network(QWidget *parent = nullptr); - -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/network.ui b/src/conf/accountpages/network.ui deleted file mode 100644 index 1e3f8108..00000000 --- a/src/conf/accountpages/network.ui +++ /dev/null @@ -1,272 +0,0 @@ - - - NetworkPage - - - - 0 - 0 - 445 - 398 - - - - - - - Network Interface - - - - - - Local address - - - - - - - - 0 - 0 - - - - - - - - Local port - - - - - - - 65535 - - - - - - - - - - Published address - - - - - - Same as &local parameters - - - true - - - - - - - Set p&ublished address and port - - - - - - - Published address - - - - - - - Published port - - - - - - - false - - - 65535 - - - - - - - false - - - IP address or hostname - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - RTP configuration - - - - - - 65535 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Minimum audio port - - - - - - - 65535 - - - - - - - 65535 - - - - - - - 65535 - - - - - - - Minimum video port - - - - - - - Maximum audio port - - - - - - - Maximum video port - - - - - - - Note that this is only used as a fallback when ICE negotiation failed (autodetected). - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 222 - - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
-
- - - - auto_2 - toggled(bool) - lrcfg_publishedAddress - setEnabled(bool) - - - 97 - 167 - - - 267 - 193 - - - - - auto_2 - toggled(bool) - lrcfg_publishedPort - setEnabled(bool) - - - 47 - 167 - - - 271 - 219 - - - - -
diff --git a/src/conf/accountpages/pagebase.cpp b/src/conf/accountpages/pagebase.cpp deleted file mode 100644 index f980d980..00000000 --- a/src/conf/accountpages/pagebase.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "pagebase.h" - -Pages::PageBase::PageBase(QWidget *parent) : QWidget(parent), m_pAccount(nullptr) -{ } - -Pages::PageBase::~PageBase() -{ } - -bool Pages::PageBase::hasChanged() -{ - return false; -} - -void Pages::PageBase::updateWidgets() -{ } - -void Pages::PageBase::updateSettings() -{ } - -void Pages::PageBase::setChanged() -{ } - -::Account* Pages::PageBase::account() const -{ - return m_pAccount; -} - -void Pages::PageBase::setAccount(::Account* a) -{ - m_pAccount = a; - emit accountSet(a); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/pagebase.h b/src/conf/accountpages/pagebase.h deleted file mode 100644 index 56ccb7e0..00000000 --- a/src/conf/accountpages/pagebase.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef BASE_PAGE_H -#define BASE_PAGE_H - -#include -#include "ui_basic.h" - -class Account; - -namespace Pages { - -class PageBase : public QWidget -{ -Q_OBJECT -public: - //Constructor - explicit PageBase(QWidget *parent = nullptr); - - //Destructor - virtual ~PageBase(); - - virtual bool hasChanged(); - - ::Account* account() const; - -protected: - bool m_Changed {false}; - -private: - ::Account* m_pAccount; - -public Q_SLOTS: - virtual void setAccount(::Account* a); - virtual void updateWidgets(); - virtual void updateSettings(); - -protected Q_SLOTS: - virtual void setChanged(); - -Q_SIGNALS: - void updateButtons(); - void accountSet(::Account* a); - -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/ringtone.cpp b/src/conf/accountpages/ringtone.cpp deleted file mode 100644 index f388f8ae..00000000 --- a/src/conf/accountpages/ringtone.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "ringtone.h" - -#include -#include - -// KDE -#include - -Pages::RingTone::RingTone(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - m_pAddFile->m_pFilePath->setPlaceholderText(i18n("Select a new ringtone")); - - connect(m_pAddFile, &FileSelector::urlSelected, this, &Pages::RingTone::urlSelected); - connect(this,&PageBase::accountSet,[this]() { - m_pRingtones->setModel(&RingtoneModel::instance()); - m_pRingtones->setSelectionModel(RingtoneModel::instance().selectionModel(account())); - - if (m_pRingtones->horizontalHeader()) { - m_pRingtones->horizontalHeader()->setSectionResizeMode(0,QHeaderView::Stretch); - for (int i =1;ihorizontalHeader()->setSectionResizeMode(i,QHeaderView::ResizeToContents); - } - }); -} - -void Pages::RingTone::urlSelected(const QUrl& url) -{ - RingtoneModel::instance().add(url, account()); - setChanged(); -} - -void Pages::RingTone::play() -{ - RingtoneModel::instance().play( - RingtoneModel::instance().selectionModel(account())->currentIndex() - ); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/ringtone.h b/src/conf/accountpages/ringtone.h deleted file mode 100644 index ec10fdb3..00000000 --- a/src/conf/accountpages/ringtone.h +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef RINGTONE_PAGE_H -#define RINGTONE_PAGE_H - -#include -#include "pagebase.h" -#include "ui_ringtone.h" - -namespace Pages { - -class RingTone final : public PageBase, public Ui_RingtonePage -{ -Q_OBJECT -public: - //Constructor - explicit RingTone(QWidget *parent = nullptr); - -private Q_SLOTS: - void urlSelected(const QUrl& url); - void play(); -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/ringtone.ui b/src/conf/accountpages/ringtone.ui deleted file mode 100644 index c3c99b45..00000000 --- a/src/conf/accountpages/ringtone.ui +++ /dev/null @@ -1,129 +0,0 @@ - - - RingtonePage - - - - 0 - 0 - 530 - 378 - - - - - - - Qt::Horizontal - - - - - 0 - 0 - - - - Ringtone - - - true - - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Play - - - - .. - - - - - - - - - - - - - - - FileSelector - QWidget -
widgets/fileselector.h
- 1 -
-
- - - - lrcfg_ringtoneEnabled - toggled(bool) - RingtonePage - setChanged() - - - 50 - 15 - - - 3 - 26 - - - - - m_pPlay - clicked() - RingtonePage - play() - - - 515 - 325 - - - 529 - 318 - - - - - - setChanged() - play() - -
diff --git a/src/conf/accountpages/security.cpp b/src/conf/accountpages/security.cpp deleted file mode 100644 index 121e4024..00000000 --- a/src/conf/accountpages/security.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "security.h" - -#include -#include - -#include - -#include - -#define FAILED == Certificate::CheckValues::FAILED -Pages::Security::Security(QWidget *parent) : PageBase(parent) -{ - setupUi(this); - frame->setVisible(false); - frame_2->setVisible(false); - - label_3->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(QSize(22,22))); - label_2->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(QSize(22,22))); - - connect(this,&PageBase::accountSet,[this]() { - combo_security_STRP->bindToModel(account()->keyExchangeModel(),account()->keyExchangeModel()->selectionModel()); - combo_tls_method->bindToModel(account()->tlsMethodModel(),account()->tlsMethodModel()->selectionModel()); - m_pSecurityIssues->setModel(account()->securityEvaluationModel()); - - //Display the permission fixer - frame_2->setVisible( - (account()->tlsCertificate() && ( - account()->tlsCertificate()->arePrivateKeyStoragePermissionOk () FAILED || - account()->tlsCertificate()->arePublicKeyStoragePermissionOk () FAILED || - account()->tlsCertificate()->arePrivateKeyDirectoryPermissionsOk () FAILED || - account()->tlsCertificate()->arePublicKeyDirectoryPermissionsOk () FAILED ) - ) || - (account()->tlsCaListCertificate() && ( - account()->tlsCaListCertificate()->arePrivateKeyStoragePermissionOk () FAILED || - account()->tlsCaListCertificate()->arePublicKeyStoragePermissionOk () FAILED || - account()->tlsCaListCertificate()->arePrivateKeyDirectoryPermissionsOk () FAILED || - account()->tlsCaListCertificate()->arePublicKeyDirectoryPermissionsOk () FAILED ) - ) - ); - - frame->setVisible( - (account()->tlsCertificate() && ( - account()->tlsCertificate()->arePrivateKeyStorageLocationOk () FAILED || - account()->tlsCertificate()->arePublicKeyStorageLocationOk () FAILED || - account()->tlsCertificate()->arePrivateKeySelinuxAttributesOk () FAILED || - account()->tlsCertificate()->arePublicKeySelinuxAttributesOk () FAILED ) - ) || - (account()->tlsCaListCertificate() && ( - account()->tlsCaListCertificate()->arePrivateKeyStorageLocationOk () FAILED || - account()->tlsCaListCertificate()->arePublicKeyStorageLocationOk () FAILED || - account()->tlsCaListCertificate()->arePrivateKeySelinuxAttributesOk () FAILED || - account()->tlsCaListCertificate()->arePublicKeySelinuxAttributesOk () FAILED ) - ) - ); - - tabWidget->setVisible(account()->protocol() == Account::Protocol::RING); - - const bool cipherVisible = account()->roleState(Account::Role::CipherModel) != Account::RoleState::UNAVAILABLE; - m_pDefaultCiphers->setChecked( account()->cipherModel()->useDefault()); - m_pCipherModel->setModel(account()->cipherModel()); - m_pCipherModel->setVisible(cipherVisible && !account()->cipherModel()->useDefault()); - m_pDefaultCiphers->setVisible(cipherVisible); - }); - - connect(m_pViewCa, &QToolButton::clicked, this, [this]() { - CertificateViewer* c = new CertificateViewer(account()->tlsCaListCertificate()); - c->show(); - }); - - connect(m_pViewCert, &QToolButton::clicked, this, [this]() { - CertificateViewer* c = new CertificateViewer(account()->tlsCertificate()); - c->show(); - }); - - connect(m_pFixCertPB , &QPushButton::clicked, this, [this]() { - if (account()->tlsCertificate()) { - if (!account()->tlsCertificate()->fixPermissions()) - qWarning() << "Changing" << account()->tlsCertificate()->path() << "permissions failed"; - frame_2->hide(); - } - }); - - connect(m_pMoveCertPB , &QPushButton::clicked, this, [this]() { - if (account()->tlsCertificate()) { - if (!account()->tlsCertificate()->moveToDotCert()) - qWarning() << "Moving" << account()->tlsCertificate()->path() << "failed"; - frame->hide(); - } - }); - - for (const QAbstractItemView* v : {lrcfg_knownCertificateModel, lrcfg_bannedCertificatesModel, lrcfg_allowedCertificatesModel}) { - connect(v, &QAbstractItemView::doubleClicked, this, [](const QModelIndex& idx) { - CertificateViewer* c = new CertificateViewer(idx); - c->show(); - }); - } -} -#undef FAILED - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/security.h b/src/conf/accountpages/security.h deleted file mode 100644 index 75cddf47..00000000 --- a/src/conf/accountpages/security.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef SECURITY_PAGE_H -#define SECURITY_PAGE_H - -#include -#include "pagebase.h" -#include "ui_security.h" - -namespace Pages { - -class Security final : public PageBase, public Ui_SecurityPage -{ -Q_OBJECT -public: - //Constructor - explicit Security(QWidget *parent = nullptr); - -}; - -} - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountpages/security.ui b/src/conf/accountpages/security.ui deleted file mode 100644 index 63b49f3b..00000000 --- a/src/conf/accountpages/security.ui +++ /dev/null @@ -1,643 +0,0 @@ - - - SecurityPage - - - - 0 - 0 - 657 - 587 - - - - - - - Qt::Vertical - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - 0 - 0 - - - - - 0 - 8 - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 625 - 1126 - - - - - - - Encr&ypt media streams (SRTP) - - - true - - - - - - - 0 - 0 - - - - - - - - Fallback on RTP on SDES failure - - - - - - - - - - - 0 - 0 - - - - Encrypt negotiation (&TLS) - - - true - - - false - - - - - - Authority certificate list - - - - - - - - 0 - 55 - - - - - 0 - 66 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Your certificates access are too permissive. Certificates should only be readable by the owner. - - - true - - - - - - - - - - - Fix the permissions - - - - .. - - - - - - - No thanks - - - - .. - - - - - - - - - - - - - 0 - 55 - - - - - 0 - 66 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - A good security practice is to move the certificates to a common directory. SELinux recommend ~/.cert for this. Do you wish to move the certificate there? - - - true - - - - - - - - - - - Move to ~/.cert - - - - .. - - - - - - - No thanks - - - - .. - - - - - - - - - - - - Negotiation timeout - - - - - - - Verify incoming certificates (server side) - - - - - - - Public endpoint certificate - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QLineEdit::Password - - - Only necessary if the key have a password - - - - - - - Private key - - - - - - - Usually the SIP server hostname - - - - - - - View the certificate authority - - - View - - - - ../../../../../../../../../../../../.designer/backup../../../../../../../../../../../../.designer/backup - - - - - - - View the certificate - - - View - - - - ../../../../../../../../../../../../.designer/backup../../../../../../../../../../../../.designer/backup - - - - - - - Private key password - - - - - - - - - - Require a certificate for incoming TLS connections - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - seconds - - - - - - - - - - - - - Outgoing TLS server name - - - - - - - Verify answer certificates (client side) - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - TLS protocol method - - - - - - - Use default ciphers - - - true - - - - - - - 0 - - - - Allowed certificates - - - - - - - - - - Banned certificates - - - - - - - - - - Known certificates - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
- - SecurityLevelWidget - QWidget -
widgets/securityprogress.h
- 1 -
- - IssuesIcon - QWidget -
widgets/securityprogress.h
- 1 -
- - ContextListView - QListView -
widgets/contextlistview.h
-
- - FileSelector - QWidget -
widgets/fileselector.h
- 1 -
-
- - - - m_pDefaultCiphers - toggled(bool) - m_pCipherModel - setHidden(bool) - - - 55 - 604 - - - 148 - 802 - - - - - m_pCancelMove - clicked() - frame - hide() - - - 613 - 367 - - - 616 - 370 - - - - - m_pCancelFix - clicked() - frame_2 - hide() - - - 613 - 439 - - - 616 - 442 - - - - -
diff --git a/src/conf/accountpages/tabs.ui b/src/conf/accountpages/tabs.ui deleted file mode 100644 index 24ac096a..00000000 --- a/src/conf/accountpages/tabs.ui +++ /dev/null @@ -1,170 +0,0 @@ - - - Tabs - - - - 0 - 0 - 723 - 487 - - - - - - - 1 - - - - Basic - - - - - - - - - - Advanced - - - - - - - - - - Network - - - - - - - - - - Devices - - - - - - - - - - Codecs - - - - - - - - - - Credentials - - - - - - - - - - Security - - - - - - - - - - Ringtones - - - - - - - - - - Profile - - - - - - - - - - Wizard - - - - - - - - - Pages::Basic - QWidget -
conf/accountpages/basic.h
- 1 -
- - Pages::Advanced - QWidget -
conf/accountpages/advanced.h
- 1 -
- - Pages::Network - QWidget -
conf/accountpages/network.h
- 1 -
- - Pages::Codecs - QWidget -
conf/accountpages/codecs.h
- 1 -
- - Pages::RingTone - QWidget -
conf/accountpages/ringtone.h
- 1 -
- - Pages::Credentials - QWidget -
conf/accountpages/credentials.h
- 1 -
- - Pages::Security - QWidget -
conf/accountpages/security.h
- 1 -
- - Pages::Devices - QWidget -
conf/accountpages/devices.h
- 1 -
-
- - -
diff --git a/src/conf/accountserializationadapter.cpp b/src/conf/accountserializationadapter.cpp deleted file mode 100644 index 7711fda5..00000000 --- a/src/conf/accountserializationadapter.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "accountserializationadapter.h" - -//Qt -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//KDE -// #include -#include - -#include -#include - -// Ring -#include "widgets/fileselector.h" - -QHash AccountSerializationAdapter::m_hProblems = {}; - -constexpr static const char LRC_CFG[] = "lrcfg_"; -constexpr static const int LRC_CFG_LEN = 6 ; - -struct ConnHolder final{ - ConnHolder(const QMetaObject::Connection& _c) : c(_c) {} - QMetaObject::Connection c; - ConnHolder(const ConnHolder&) = delete; - ~ConnHolder(); -}; -Q_DECLARE_METATYPE(ConnHolder*) - -ConnHolder::~ConnHolder() -{ - QObject::disconnect(c); -} - -static void avoidDuplicate(QWidget* w, QList& holders ) -{ - Q_UNUSED(w) - Q_UNUSED(holders) - //FIXME this will need a better design -// if (qvariant_cast(w->property("lrcfgConn"))) { -// auto c = qvariant_cast(w->property("lrcfgConn")); -// delete c; -// } -} - -static QWidget* buddyWidget(QWidget* w) -{ - if (w->property("lrcfgBuddy").canConvert()) - return qvariant_cast(w->property("lrcfgBuddy")); - - QFormLayout* fm = qobject_cast(w->parentWidget()->layout()); - - //There is many of corner case here, this only handle the one that's - //created by Qt Designer - if (!fm) { - QLayoutItem* il = w->parentWidget()->layout()->itemAt(0); - if (il && il->layout()) - fm = qobject_cast(il->layout()); - } - - if (fm) - return fm->labelForField(w); - - return nullptr; -} - -void AccountSerializationAdapter::updateProblemList(int role, Account::RoleStatus status, QWidget* buddy) -{ - Q_UNUSED(buddy) - switch(status) { - case Account::RoleStatus::OK : - if (m_hProblems.contains(role)) - m_hProblems.remove(role); - break; - case Account::RoleStatus::UNTESTED : - m_hProblems[role] = QStringLiteral("UNTESTED"); - break; - case Account::RoleStatus::INVALID : - m_hProblems[role] = QStringLiteral("INVALID"); - break; - case Account::RoleStatus::REQUIRED_EMPTY: - m_hProblems[role] = QStringLiteral("REQUIRED_EMPTY"); - break; - case Account::RoleStatus::OUT_OF_RANGE : - m_hProblems[role] = QStringLiteral("OUT_OF_RANGE"); - break; - } -} - -/** - * This check for some supported widgets and bind the widgets and property - */ -void AccountSerializationAdapter::setupWidget(QWidget* w, Account* a, const QHash& roles) -{ - if (w->objectName().left(LRC_CFG_LEN) == QLatin1String(LRC_CFG)) { - - static KStatefulBrush errorBrush( KColorScheme::View, KColorScheme::NegativeText ); - - QByteArray prop = w->objectName().mid(LRC_CFG_LEN, 999).toLatin1(); - - if (roles.contains(prop)) { - const int role = roles[prop]; - const Account::RoleState rs = a->roleState((Account::Role)role); - - if (auto le = qobject_cast(w)) { - avoidDuplicate(le, m_lConns); - le->setText(a->roleData(role).toString()); - le->setReadOnly(rs == Account::RoleState::READ_ONLY); - ConnHolder* c = new ConnHolder( - QObject::connect(le, &QLineEdit::textChanged, this, [a,role,le](const QString& text) { - if (a->roleData(role) != text) - a->setRoleData(role, text); - - const Account::RoleStatus rstatus = a->roleStatus((Account::Role)role); - QPalette pal = QApplication::palette(); - static QPalette palOrig = QApplication::palette(); - pal.setBrush(QPalette::Base,rstatus != Account::RoleStatus::OK ? - errorBrush.brush(QPalette::Normal) : palOrig.base() - ); - - le->setPalette(pal); - }) - ); - le->setProperty("lrcfgConn",QVariant::fromValue(c)); - m_lConns << c; - } - else if (auto sb = qobject_cast(w)) { - avoidDuplicate(sb, m_lConns); - sb->setValue(a->roleData(role).toInt()); - ConnHolder* c = new ConnHolder { - QObject::connect(sb, static_cast(&QSpinBox::valueChanged), this, [a,role](int value) { - if (a->roleData(role).toInt() != value) - a->setRoleData(role, value); - }) - }; - sb->setProperty("lrcfgConn",QVariant::fromValue(c)); - m_lConns << c; - } - else if (auto b = qobject_cast(w)) { - //QCheckBox, QRadioButton, QToolButton, QPushButton - avoidDuplicate(b, m_lConns); - b->setChecked(a->roleData(role).toBool()); - ConnHolder* c = new ConnHolder { - QObject::connect(b, &QAbstractButton::toggled, this, [a,role](bool ck) { - if (a->roleData(role).toBool() != ck) - a->setRoleData(role, ck); - }) - }; - b->setProperty("lrcfgConn",QVariant::fromValue(c)); - m_lConns << c; - } - else if (auto b = qobject_cast(w)) { - avoidDuplicate(b, m_lConns); - b->setCheckable(rs == Account::RoleState::READ_WRITE); - b->setChecked(a->roleData(role).toBool()); - ConnHolder* c = new ConnHolder { - QObject::connect(b, &QGroupBox::toggled, this, [a,role](bool ck) { - if (a->roleData(role).toBool() != ck) - a->setRoleData(role, ck); - }) - }; - b->setProperty("lrcfgConn",QVariant::fromValue(c)); - m_lConns << c; - } - else if (auto v = qobject_cast(w)) { - avoidDuplicate(v, m_lConns); - if (a->roleData(role).canConvert()) - v->setModel(qvariant_cast(a->roleData(role))); - } - else if (auto b = qobject_cast(w)) { - avoidDuplicate(b, m_lConns); - b->setText(a->roleData(role).toString()); - ConnHolder* c = new ConnHolder { - QObject::connect(b, &FileSelector::urlSelected, this, [a,role](const QUrl& s) { - if (a->roleData(role).toString() != s.path()) - a->setRoleData(role, s.path()); - }) - }; - b->setProperty("lrcfgConn",QVariant::fromValue(c)); - m_lConns << c; - } - else { - qDebug() << "Unsupported widget type" << w; - } - - //Check if the field is required for this account type - if (rs == Account::RoleState::UNAVAILABLE) { - - w->setVisible(false); - - QFormLayout* fm = qobject_cast(w->parentWidget()->layout()); - - //There is many of corner case here, this only handle the one that's - //created by Qt Designer - if (!fm) { - QLayoutItem* il = w->parentWidget()->layout()->itemAt(0); - if (il && il->layout()) - fm = qobject_cast(il->layout()); - } - - QWidget* buddy = buddyWidget(w); - - if (buddy) { - buddy->setVisible(false); - w->setProperty("buddy", QVariant::fromValue(buddy)); - } - - } - else { - w->setVisible(true); - if (w->property("buddy").canConvert()) - qvariant_cast(w->property("buddy"))->setVisible(true); - } - } - else if (prop.right(5) == "Buddy") { - prop = prop.left(prop.size()-5); - const int role = roles[prop]; - const Account::RoleState rs = a->roleState((Account::Role)role); - w->setVisible(rs != Account::RoleState::UNAVAILABLE); - } - else if (prop.right(6) == "Buddy2") { //HACK - prop = prop.left(prop.size()-6); - const int role = roles[prop]; - const Account::RoleState rs = a->roleState((Account::Role)role); - w->setVisible(rs != Account::RoleState::UNAVAILABLE); - } - else { - qWarning() << "Unknown config properties" << w->objectName(); - } - } -} - -static void clearConnections(QWidget* w, QList& m_lConns) -{ - if (w->objectName().left(LRC_CFG_LEN) == LRC_CFG) { - avoidDuplicate(w, m_lConns); - } -} - -void AccountSerializationAdapter::drill(QWidget* w, Account* a, const QHash& roles, bool clear) -{ - for (QObject *object : w->children()) { - if (!object->isWidgetType()) - continue; - - QWidget* w2 = static_cast(object); - if (clear) - clearConnections(w2, m_lConns); - else - setupWidget(w2, a, roles); - - drill(w2, a, roles); - } -} - -AccountSerializationAdapter::AccountSerializationAdapter(Account* a, QWidget* w) : QObject(w) -{ - static QHash reverse; - if (reverse.isEmpty()) { - const QHash roles = AccountModel::instance().roleNames(); - for (QHash::const_iterator i = roles.begin(); i != roles.end(); ++i) { - reverse[i.value()] = i.key(); - } - } - - drill(w, a, reverse); -} - -AccountSerializationAdapter::~AccountSerializationAdapter() -{ - foreach(ConnHolder* c, m_lConns) - delete c; -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/accountserializationadapter.h b/src/conf/accountserializationadapter.h deleted file mode 100644 index 50de8942..00000000 --- a/src/conf/accountserializationadapter.h +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef ACCOUNTSERIALIZATIONADAPTER_H -#define ACCOUNTSERIALIZATIONADAPTER_H - -#include "typedefs.h" -#include - -class QWidget; -struct ConnHolder; - -/** - * This class will automatically bridge QtDesigner .ui to the LRC Account:: - * class. To use it, all relevant .ui fields need to have in their name - * - * `lrcfg_propertyName` where `propertyName` is part of the Account object - * roleName hash. - * - * Supported widgets are currently: - * - * * QLineEdit - */ -class LIB_EXPORT AccountSerializationAdapter final : public QObject -{ - Q_OBJECT -public: - AccountSerializationAdapter(Account* a, QWidget* w); - virtual ~AccountSerializationAdapter(); -private: - void updateProblemList(int role, Account::RoleStatus status, QWidget* buddy); - void drill(QWidget* w, Account* a, const QHash& roles, bool clear = false); - void setupWidget(QWidget* w, Account* a, const QHash& roles); - - // Attributes - static QHash m_hProblems; - QList m_lConns; -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/configurationdialog.cpp b/src/conf/configurationdialog.cpp deleted file mode 100644 index 19f7d7e2..00000000 --- a/src/conf/configurationdialog.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "configurationdialog.h" - -//KDE -#include -#include -#include - -#include -#include - -#include "klib/kcfg_settings.h" - -#include "dlgdisplay.h" -#include "dlgaccount.h" -#include "dlgaudio.h" -#include "dlgaddressbook.h" -#include "dlgaccessibility.h" -#include "dlgvideo.h" -#include "dlgpresence.h" -#include "icons/icons.h" - -#include "accountmodel.h" -#include "ringapplication.h" - -typedef QWidget* QWidgetPtr; - -typedef QWidgetPtr(*PageConstructor)(ConfigurationDialog* dialog); -class PlaceHolderWidget : public QWidget -{ - Q_OBJECT -public: - PlaceHolderWidget(int id,ConfigurationDialog* parent, PageConstructor callback); -private: - PageConstructor m_fCallback; - ConfigurationDialog* m_pParent; - QWidget* m_pReal; - int m_Id; - -public Q_SLOTS: - void display(KPageWidgetItem *current); -}; - -PlaceHolderWidget::PlaceHolderWidget(int id,ConfigurationDialog* parent, PageConstructor callback) : -QWidget(parent),m_pParent(parent),m_fCallback(callback),m_pReal(nullptr),m_Id(id) -{} - -void PlaceHolderWidget::display(KPageWidgetItem *current) -{ - //Create the widget if it doesn't exist, then disconnect itself - if ((!m_pReal) && (current->property("id").toInt() == m_Id)) { - m_pReal = m_fCallback(m_pParent); - QHBoxLayout* l = new QHBoxLayout(this); - l->setContentsMargins(0,0,0,0); - l->addWidget(m_pReal); - disconnect(m_pParent,&KPageDialog::currentPageChanged,this,&PlaceHolderWidget::display); - } -} - -#define GUARD(a,b) if (a) {a->b;} -#define GUARD_FALSE(a,b) (a?(a->b):false) - -/* - * This file use macros because every pages can be null at all time, - * so in the end it make the code less dense. Loading all pages - * by default caused too many dbus call and was slow (> 1 second) - * so it is better to lazy load them. - */ - -///Constructor -ConfigurationDialog::ConfigurationDialog(QWidget *parent) - :KConfigDialog(parent, QStringLiteral("settings"), ConfigurationSkeleton::self()),dlgVideo(nullptr),dlgDisplay(nullptr) - ,dlgAudio(nullptr),dlgAddressBook(nullptr),dlgAccessibility(nullptr),dlgAccount(nullptr), - dlgPresence(nullptr) -{ - setWindowIcon( QIcon(":/appicon/icons/sc-apps-ring-kde.svgz") ); - - for(int i=0;i<=ConfigurationDialog::Page::Presence;i++) - dlgHolder[i] = nullptr; - - //Usually, this is done automatically by KConfig, but for performance - //there is too many widgets and too many dbus calls to do it all at once - m_pManager = new KConfigDialogManager(this, ConfigurationSkeleton::self()); - connect(buttonBox()->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, m_pManager, &KConfigDialogManager::updateSettings); - connect(buttonBox()->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, m_pManager, &KConfigDialogManager::updateSettings); - connect(buttonBox()->button(QDialogButtonBox::Cancel), &QAbstractButton::clicked, m_pManager, &KConfigDialogManager::updateWidgets); - connect(buttonBox()->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, m_pManager, &KConfigDialogManager::updateWidgetsDefault); - - connect(m_pManager, SIGNAL(settingsChanged()), this, SLOT(updateButtons())); - connect(m_pManager, SIGNAL(widgetModified()), this, SLOT(updateButtons())); - - - //Account - dlgHolder[ConfigurationDialog::Page::Accounts] = new PlaceHolderWidget(Page::Accounts,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgAccount = new DlgAccount(dialog, RingApplication::engine()); - dialog->m_pManager->addWidget(dialog->dlgAccount); - return dialog->dlgAccount; - }); - auto accDlg = addPage( dlgHolder[ConfigurationDialog::Page::Accounts] , i18n("Accounts") , QStringLiteral("user-identity") ); - accDlg->setProperty("id",ConfigurationDialog::Page::Accounts); - dlgHolder[ConfigurationDialog::Page::Accounts]->display(accDlg); - - //Display - dlgHolder[ConfigurationDialog::Page::Display] = new PlaceHolderWidget(Page::Display,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgDisplay = new DlgDisplay(dialog); - dialog->m_pManager->addWidget(dialog->dlgDisplay); - return dialog->dlgDisplay; - }); - addPage( dlgHolder[ConfigurationDialog::Page::Display] , i18nc("User interterface settings" ,"Display"), QStringLiteral("applications-graphics") ) - ->setProperty("id",ConfigurationDialog::Page::Display); - - //Audio - dlgHolder[ConfigurationDialog::Page::Audio] = new PlaceHolderWidget(Page::Audio,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgAudio = new DlgAudio(dialog); - dialog->m_pManager->addWidget(dialog->dlgAudio); - return dialog->dlgAudio; - }); - addPage( dlgHolder[ConfigurationDialog::Page::Audio] , i18n("Audio") , QStringLiteral("audio-volume-high") ) - ->setProperty("id",ConfigurationDialog::Page::Audio); - - //AddressBook - dlgHolder[ConfigurationDialog::Page::AddressBook]= new PlaceHolderWidget(Page::AddressBook,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgAddressBook = new DlgAddressBook(dialog); - dialog->m_pManager->addWidget(dialog->dlgAddressBook); - return dialog->dlgAddressBook; - }); - addPage( dlgHolder[ConfigurationDialog::Page::AddressBook] , i18n("Personal data") , QStringLiteral("x-office-address-book") ) - ->setProperty("id",ConfigurationDialog::Page::AddressBook); - - //Accessibility - dlgHolder[ConfigurationDialog::Page::Accessibility]= new PlaceHolderWidget(Page::Accessibility,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgAccessibility = new DlgAccessibility (dialog); - dialog->m_pManager->addWidget(dialog->dlgAccessibility); - return dialog->dlgAccessibility; - }); - addPage( dlgHolder[ConfigurationDialog::Page::Accessibility] , i18n("Accessibility") , QStringLiteral("preferences-desktop-accessibility") ) - ->setProperty("id",ConfigurationDialog::Page::Accessibility); - - //Video -#ifdef ENABLE_VIDEO - dlgHolder[ConfigurationDialog::Page::Video] = new PlaceHolderWidget(Page::Video,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgVideo = new DlgVideo(dialog); - dialog->m_pManager->addWidget(dialog->dlgVideo); - return dialog->dlgVideo; - }); - addPage( dlgHolder[ConfigurationDialog::Page::Video] , i18nc("Video conversation","Video") , QStringLiteral("camera-web") ) - ->setProperty("id",ConfigurationDialog::Page::Video); -#endif - - //Presence - /*dlgHolder[ConfigurationDialog::Page::Presence] = new PlaceHolderWidget(Page::Presence,this,[](ConfigurationDialog* dialog)->QWidget*{ - dialog->dlgPresence = new DlgPresence(dialog); - dialog->m_pManager->addWidget(dialog->dlgPresence); - return dialog->dlgPresence; - }); - m_pPresPage = addPage( dlgHolder[ConfigurationDialog::Page::Presence] , i18nc("SIP Presence","Presence") , QStandardPaths::locate(QStandardPaths::GenericDataLocation, "ring-kde/presence-icon.svg")); - m_pPresPage->setProperty("id",ConfigurationDialog::Page::Presence); - m_pPresPage->setEnabled(AccountModel::instance().isPresencePublishSupported() && AccountModel::instance().isPresenceEnabled()); - connect(AccountModel::instance(),SIGNAL(presenceEnabledChanged(bool)),this,SLOT(slotPresenceEnabled(bool)));*/ - - //Connect everything - for(int i=0;i<=ConfigurationDialog::Page::Presence;i++) - if (dlgHolder[i]) - connect(this,&KPageDialog::currentPageChanged,dlgHolder[i],&PlaceHolderWidget::display); - - connect(buttonBox()->button(QDialogButtonBox::Apply), &QAbstractButton::clicked , this, &ConfigurationDialog::applyCustomSettings); - connect(buttonBox()->button(QDialogButtonBox::Ok), &QAbstractButton::clicked , this, &ConfigurationDialog::applyCustomSettings); - connect(buttonBox()->button(QDialogButtonBox::Cancel), &QAbstractButton::clicked, this, &ConfigurationDialog::cancelSettings ); - - connect(dlgAccount, &DlgAccount::updateButtons,this,&ConfigurationDialog::updateButtons); - - if (dlgPresence) - connect(dlgPresence, &DlgPresence::updateButtons ,this,&ConfigurationDialog::updateButtons); - setMinimumSize(1024,700); - -} //ConfigurationDialog - -///Destructor -ConfigurationDialog::~ConfigurationDialog() -{ - if (dlgDisplay ) delete dlgDisplay ; - if (dlgAccount ) delete dlgAccount ; - if (dlgAudio ) delete dlgAudio ; - if (dlgAddressBook ) delete dlgAddressBook ; - if (dlgAccessibility) delete dlgAccessibility; - if (dlgPresence ) delete dlgPresence ; - #ifdef ENABLE_VIDEO - if (dlgVideo ) delete dlgVideo ; - #endif - delete m_pManager; -} - -///Update all widgets when something is reloaded -void ConfigurationDialog::updateWidgets() -{ - GUARD(dlgAudio,updateWidgets ()); - GUARD(dlgAccount,updateWidgets ()); - GUARD(dlgAddressBook,updateWidgets ()); - GUARD(dlgAccessibility,updateWidgets()); - GUARD(dlgPresence,updateWidgets ()); - #ifdef ENABLE_VIDEO - GUARD(dlgVideo,updateWidgets ()); - #endif -} - -///Save all settings when apply is clicked -void ConfigurationDialog::updateSettings() -{ - GUARD(dlgAudio,updateSettings ()); - GUARD(dlgAccount,updateSettings ()); - GUARD(dlgAddressBook,updateSettings ()); - GUARD(dlgAccessibility,updateSettings()); - GUARD(dlgDisplay,updateSettings ()); - GUARD(dlgPresence,updateSettings ()); - #ifdef ENABLE_VIDEO - GUARD(dlgVideo,updateSettings ()); - #endif -} - -///Cancel current modification -void ConfigurationDialog::cancelSettings() -{ - GUARD(dlgAccount,cancel()); -} - -///If the account changed -bool ConfigurationDialog::hasChanged() -{ - bool res = ((GUARD_FALSE(dlgAudio,hasChanged() )) - || (GUARD_FALSE(dlgAccount,hasChanged() )) - || (GUARD_FALSE(dlgDisplay,hasChanged() )) - || (GUARD_FALSE(dlgAddressBook,hasChanged() )) - || (GUARD_FALSE(dlgAccessibility,hasChanged() )) -#ifdef ENABLE_VIDEO - || (GUARD_FALSE(dlgVideo,hasChanged() )) -#endif - || (GUARD_FALSE(dlgPresence,hasChanged() ))); - - return res; -} - -bool ConfigurationDialog::hasIncompleteRequiredFields() -{ - return AccountModel::instance().editState() == AccountModel::EditState::INVALID; -} - -///Update the buttons -void ConfigurationDialog::updateButtons() -{ - bool changed = hasChanged() || m_pManager->hasChanged(); - bool preventApply = hasIncompleteRequiredFields(); - buttonBox()->button(QDialogButtonBox::Apply)->setEnabled( changed && (!preventApply) ); - buttonBox()->button(QDialogButtonBox::Ok)->setEnabled ( !preventApply ); -} - -///Apply settings -void ConfigurationDialog::applyCustomSettings() -{ - if(hasChanged()) { -// ConfigurationSkeleton::self()->writeConfig(); - } - updateSettings(); - updateWidgets (); - updateButtons (); - emit changesApplied(); -} - -///Reload the pages -void ConfigurationDialog::reload() -{ - qDebug() << "Reloading config"; -// ConfigurationSkeleton::self()->readConfig(); - updateWidgets(); - updateButtons(); -} - - -void ConfigurationDialog::slotPresenceEnabled(bool state) -{ - Q_UNUSED(state) -// m_pPresPage->setEnabled(state && AccountModel::instance().isPresencePublishSupported()); -} - -#undef GUARD -#undef GUARD_FALSE -#include "configurationdialog.moc" -#include "moc_configurationdialog.cpp" - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/configurationdialog.h b/src/conf/configurationdialog.h deleted file mode 100644 index f497fdde..00000000 --- a/src/conf/configurationdialog.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef CONFIGURATIONDIALOG_H -#define CONFIGURATIONDIALOG_H - -//Base -#include - -#include "klib/kcfg_settings.h" - -//KDE -class KConfigDialogManager; - -//Ring -class DlgDisplay; -class DlgAccount; -class DlgAudio; -class DlgAddressBook; -class DlgAccessibility; -class DlgVideo; -class View; -class DlgPresence; - -//Private -class PlaceHolderWidget; - -/** - @author Jérémy Quentin - This class represents the config dialog for Ring. - It uses the ConfigurationSkeleton class to handle most of the settings. - It inherits KConfigDialog with the pages defined in dlg... files. - A few complicated settings are handled directly by its pages. - Some custom behaviors have been added to handle specific cases, - as this config dialog is not the usual kind. - A few things might be done a cleaner way by passing the handling - to the skeleton like it has been done with codecs. -*/ -class ConfigurationDialog final : public KConfigDialog -{ -Q_OBJECT -friend class PlaceHolderWidget; -private: - enum Page { - Display, - Accounts, - Audio, - AddressBook, - Accessibility, - Video, - Presence, - }; - PlaceHolderWidget* dlgHolder[Page::Presence+1]; - - DlgDisplay* dlgDisplay ; - DlgAccount* dlgAccount ; - DlgAudio* dlgAudio ; - DlgAddressBook* dlgAddressBook ; - DlgAccessibility* dlgAccessibility; - DlgVideo* dlgVideo ; - DlgPresence* dlgPresence ; - - KConfigDialogManager* m_pManager; - -public: - explicit ConfigurationDialog(QWidget* parent = nullptr); - virtual ~ConfigurationDialog(); - - -public Q_SLOTS: - /** - * Reimplements KConfigDialog - */ - void updateWidgets() override; - /** - * Reimplements KConfigDialog - */ - void updateSettings() override; - /** - * @author Jérémy Quentin - * Is implemented in KConfigDialog only from KDE4.3 - * It it implemented here for KDE4.2 users. - * I didn't test with KDE4.3 so I leave it even for 4.3 users. - * Causes problems for a few cases (item managed by kconfig switched, item not managed - * switched and then switched back, apply becomes disabled). - * Can't be resolved without a method to know if items managed by kconfig have changed. - * Disable/Enable Apply Button according to hasChanged() result - */ - void updateButtons(); - - /** - * Cancel modifications (apply only to model changes) - */ - void cancelSettings(); - - /** - * @return whether any custom widget has changed in the dialog. - */ - bool hasChanged() override; - - ///Are there required fields left to complete - bool hasIncompleteRequiredFields(); - - /** - * reloads the information before showing it. - */ - void reload(); - -private Q_SLOTS: - /** - * Apply settings not managed by kconfig (accounts) - * Should be removed when accounts are managed by kconfig. - */ - void applyCustomSettings(); - - void slotPresenceEnabled(bool); - - -Q_SIGNALS: - ///Emitted when the history need to be cleaned - void clearCallHistoryAsked(); - ///Emitted when changes are applied - void changesApplied(); - -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/confresources.qrc b/src/conf/confresources.qrc deleted file mode 100644 index af8a564b..00000000 --- a/src/conf/confresources.qrc +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/conf/dlgaccessibility.cpp b/src/conf/dlgaccessibility.cpp deleted file mode 100644 index 7ed33caa..00000000 --- a/src/conf/dlgaccessibility.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2012-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "dlgaccessibility.h" -#include "klib/kcfg_settings.h" - -//Qt -#include -#include - -//KDE -#include -#include - -//Ring -#include "delegates/categorizeddelegate.h" - -///Constructor -DlgAccessibility::DlgAccessibility(KConfigDialog* parent) - : QWidget(parent),m_Changed(false) -{ - setupUi(this); - -#ifdef HAVE_SPEECH - m_pT2SBG->setEnabled(true); -#endif -} - -///Destructor -DlgAccessibility::~DlgAccessibility() -{ -} - -///Save -void DlgAccessibility::updateSettings() -{ - m_Changed = false; - emit updateButtons(); -} - -///Load -void DlgAccessibility::updateWidgets() -{ - -} - -void DlgAccessibility::changed() -{ - m_Changed = true; - emit updateButtons(); -} - -bool DlgAccessibility::hasChanged() -{ - return m_Changed; -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaccessibility.h b/src/conf/dlgaccessibility.h deleted file mode 100644 index 84fe953d..00000000 --- a/src/conf/dlgaccessibility.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2012-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLGACCESSIBILITY_H -#define DLGACCESSIBILITY_H - -#include - -#include "ui_dlgaccessibility.h" - -class KConfigDialog; - -///DlgAccessibility: Display option for the visually impaired -class DlgAccessibility final : public QWidget, public Ui_DlgAccessibility -{ -Q_OBJECT -public: - //Constructor - explicit DlgAccessibility(KConfigDialog *parent = nullptr); - - //Destructor - virtual ~DlgAccessibility(); - - //Getters - bool hasChanged(); - -private: - //Attributes - bool m_Changed; - -public Q_SLOTS: - void updateSettings(); - void updateWidgets(); - -private Q_SLOTS: - void changed(); - -Q_SIGNALS: - void updateButtons(); -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaccessibility.ui b/src/conf/dlgaccessibility.ui deleted file mode 100644 index ae6ccdf8..00000000 --- a/src/conf/dlgaccessibility.ui +++ /dev/null @@ -1,119 +0,0 @@ - - - DlgAccessibility - - - - 0 - 0 - 794 - 557 - - - - Accessibility settings - - - - - - false - - - Text to Speech - - - - - - Enable audio feedback from common actions - - - - - - - Automatically read label when an overlay is being displayed - - - - - - - Automatically read the call details when it is selected - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - kcfg_enableVoiceFeedback - toggled(bool) - DlgAccessibility - changed() - - - 265 - 139 - - - 798 - 116 - - - - - kcfg_enableReadLabel - toggled(bool) - DlgAccessibility - changed() - - - 348 - 157 - - - 798 - 148 - - - - - kcfg_enableReadDetails - toggled(bool) - DlgAccessibility - changed() - - - 321 - 190 - - - 797 - 179 - - - - - - changed() - - diff --git a/src/conf/dlgaccount.cpp b/src/conf/dlgaccount.cpp deleted file mode 100644 index 1a393746..00000000 --- a/src/conf/dlgaccount.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ - -#include "dlgaccount.h" - -// Qt -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// KDE -#include -#include - -//Ring -#include -#include -#include -#include -#include - -#include "accountpages/account.h" - -#include -#include - -#include - - - -DlgAccount::DlgAccount(QWidget* parent, QQmlEngine* engine) : - QWidget(parent),m_HasChanged(false), m_pEngine(engine) -{ - setupUi(this); - m_pPanel->setEngine(m_pEngine); - m_pAccountList->setModel ( ProfileModel::instance().sortedProxyModel () ); - m_pAccountList->setSelectionModel( ProfileModel::instance().sortedProxySelectionModel() ); - - m_pCategoryDelegate = new CategorizedDelegate(m_pAccountList); - m_pCategoryDelegate->setChildDelegate(new RightIconDelegate(this, (int)Account::Role::SecurityLevelIcon, 0.2f)); - - m_pAccountList->setItemDelegate(m_pCategoryDelegate); - - m_pProtocolModel = new ExtendedProtocolModel(this); - - m_pGlobalProto->bindToModel(m_pProtocolModel, m_pProtocolModel->selectionModel()); - -// setCurrentAccount(nullptr); - - connect(m_pMoveUp , &QToolButton::clicked,&AccountModel::instance(), &AccountModel::moveUp ); - connect(m_pMoveDown, &QToolButton::clicked,&AccountModel::instance(), &AccountModel::moveDown); - connect(m_pRemove , &QToolButton::clicked, this, &DlgAccount::slotRemoveAccount ); - - connect(&AccountModel::instance(), &AccountModel::editStateChanged, this, &DlgAccount::slotUpdateButtons); - - connect(&ProfileModel::instance(), &ProfileModel::rowsInserted, this, &DlgAccount::slotExpand); - - connect(m_pPanel, &Pages::Account::changed, this, [this]() { - m_HasChanged = true; - emit updateButtons(); - }); - - slotSetAccount(m_pAccountList->selectionModel()->currentIndex()); - - connect(m_pAccountList->selectionModel(), &QItemSelectionModel::currentChanged, this, &DlgAccount::slotSetAccount); - - slotExpand(); -} - -DlgAccount::~DlgAccount() -{ - delete m_pCategoryDelegate; -} - -void DlgAccount::slotSetAccount(const QModelIndex& idx) -{ - m_pPanel->setAccount(idx); -} - -void DlgAccount::slotExpand() -{ - m_pAccountList->expandAll(); - - if (!m_pAccountList->selectionModel()->currentIndex().isValid()) { - for (int i = 0; i < m_pAccountList->model()->rowCount(); i++) { - const QModelIndex idx = m_pAccountList->model()->index(i, 0); - if (m_pAccountList->model()->rowCount(idx)) { - const QModelIndex defaultAcc = m_pAccountList->model()->index(0, 0, idx); - m_pAccountList->selectionModel()->setCurrentIndex(defaultAcc, QItemSelectionModel::ClearAndSelect); - } - } - } -} - -void DlgAccount::slotRemoveAccount() -{ - QModelIndex idx = ProfileModel::instance().sortedProxySelectionModel()->currentIndex(); - - // Check if the selected element is a profile - if (idx.isValid() && !idx.parent().isValid()) { - const QString message = i18n("Are you sure you want to remove %1?", - idx.data(Qt::DisplayRole).toString()); - - if (QMessageBox::warning(this, i18n("Remove profile"), - message, - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes - ) - if (ProfileModel::instance().remove(idx)) { - m_pAccountList->selectionModel()->setCurrentIndex( - m_pAccountList->model()->index(0,0), QItemSelectionModel::ClearAndSelect - ); - } - } - else { - // Remove an account - idx = AccountModel::instance().selectionModel()->currentIndex(); - - if (!idx.isValid()) - return; - - const QString message = i18n("Are you sure you want to remove %1?", - idx.data(Qt::DisplayRole).toString()); - - if (QMessageBox::warning(this, i18n("Remove account"), - message, - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes - ) - AccountModel::instance().remove(idx); - } -} - -void DlgAccount::slotUpdateButtons() -{ - emit updateButtons(); -} - -void DlgAccount::slotNewAddAccount() -{ - const Account::Protocol proto = qvariant_cast( - m_pProtocolModel->data(m_pProtocolModel->selectionModel()->currentIndex(),Qt::UserRole) - ); - - // Add profile or import accounts - if ((int)proto == ((int)Account::Protocol::COUNT__) + (int)ExtendedProtocolModel::ExtendedRole::PROFILE) { - const bool ret = ProfileModel::instance().add(); - - if (!ret) - return; - - const QModelIndex idx = ProfileModel::instance().index(ProfileModel::instance().rowCount(),0); - - if (idx.isValid()) { - m_pAccountList->selectionModel()->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect); - } - - return; - } - else if ((int)proto == ((int)Account::Protocol::COUNT__) + (int)ExtendedProtocolModel::ExtendedRole::IMPORT) { - const QString path = QFileDialog::getOpenFileName(this, i18n("Import accounts"), QDir::currentPath()); - - if (!path.isEmpty()) { - QPointer dlg = new KPasswordDialog(this); - dlg->setPrompt(i18n("Enter the password")); - - if( !dlg->exec() ) - return; - - AccountModel::instance().importAccounts(path, dlg->password()); - - delete dlg; - } - - return; - } - - const QString newAlias - = i18n("New account%1", - AccountModel::getSimilarAliasIndex(i18n("New account"))); - Account* a = AccountModel::instance().add(newAlias, proto); - - QModelIndex accIdx = ProfileModel::instance().accountIndex(a); - accIdx = static_cast( - ProfileModel::instance().sortedProxyModel() - )->mapFromSource(accIdx); - - ProfileModel::instance().sortedProxySelectionModel()->setCurrentIndex( - accIdx, QItemSelectionModel::ClearAndSelect - ); - - m_pPanel->setAccount(a); - - m_pPanel->selectAlias(); - -} //on_button_accountAdd_clicked - -void DlgAccount::cancel() -{ - AccountModel::instance().cancel(); -} - -bool DlgAccount::hasChanged() -{ - return m_HasChanged || AccountModel::instance().editState() != AccountModel::EditState::SAVED; -} - -void DlgAccount::updateSettings() -{ - m_pPanel->updateSettings(); - AccountModel::instance().save(); - m_HasChanged = false; -} - -void DlgAccount::updateWidgets() -{ - m_HasChanged = false; -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaccount.h b/src/conf/dlgaccount.h deleted file mode 100644 index 3b06c441..00000000 --- a/src/conf/dlgaccount.h +++ /dev/null @@ -1,72 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#ifndef DLGACCOUNT_H -#define DLGACCOUNT_H - -#include "ui_accountdlg.h" -#include "typedefs.h" - -class QQmlEngine; -class Account; -class ExtendedProtocolModel; -class CategorizedDelegate; -class QQuickWidget; - -namespace Pages { - class Account; -} - -class LIB_EXPORT DlgAccount final : public QWidget, public Ui::AccountDlg -{ - Q_OBJECT -public: - explicit DlgAccount(QWidget* parent, QQmlEngine* engine); - virtual ~DlgAccount(); - - //Getters - bool hasChanged(); - -private: - Pages::Account* m_pCurrentAccount {nullptr}; - ExtendedProtocolModel* m_pProtocolModel {nullptr}; - bool m_HasChanged; - CategorizedDelegate* m_pCategoryDelegate; - QQmlEngine* m_pEngine {nullptr}; - -public Q_SLOTS: - //Housekeeping - void updateSettings(); - void updateWidgets(); - void cancel(); - - //Core logic - void slotNewAddAccount(); - -private Q_SLOTS: - void slotUpdateButtons(); - void slotRemoveAccount(); - void slotExpand(); - void slotSetAccount(const QModelIndex& idx); - -Q_SIGNALS: - void updateButtons(); -}; - -#endif // _DLGACCOUNT_H_ - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaddressbook.cpp b/src/conf/dlgaddressbook.cpp deleted file mode 100644 index f5a9dfea..00000000 --- a/src/conf/dlgaddressbook.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "dlgaddressbook.h" - -//Qt -#include -#include - -//KDE -#include -#include - -//Ring-KDE -#include "klib/kcfg_settings.h" - -//LibRingQt -#include "numbercategorymodel.h" -#include "delegates/autocompletiondelegate.h" -#include "delegates/categorizeddelegate.h" -#include "collectionextensionmodel.h" -#include -#include "personmodel.h" -#include "collectionmodel.h" - -///Constructor -DlgAddressBook::DlgAddressBook(KConfigDialog* parent) - : QWidget(parent),m_HasChanged(false),m_pCurrent(nullptr) -{ - setupUi(this); - - m_pDelegate = new AutoCompletionDelegate(); - - m_pCategoryDelegate = new CategorizedDelegate(m_pItemBackendW); - m_pCategoryDelegate->setChildDelegate(m_pDelegate); - m_pCategoryDelegate->setChildChildDelegate(m_pDelegate); - m_pItemBackendW->setItemDelegate(m_pCategoryDelegate); - - CollectionModel::instance().load(); - - m_pProxyModel = new QSortFilterProxyModel(this); - m_pProxyModel->setSortRole(Qt::DisplayRole); - m_pProxyModel->setSourceModel(ConfigurationSkeleton::displayAllCollections()? &CollectionModel::instance() : CollectionModel::instance().manageableCollections()); - m_pItemBackendW->sortByColumn(0,Qt::AscendingOrder); - - m_pItemBackendW->setModel(m_pProxyModel); - - m_pManager = new KConfigDialogManager(this, ConfigurationSkeleton::self()); - - connect(m_pManager, SIGNAL(settingsChanged()), this, SLOT(updateButtons())); - connect(m_pManager, &KConfigDialogManager::widgetModified, this, &DlgAddressBook::updateButtons); - - //Resize the columns - if (m_pItemBackendW->header()) { - m_pItemBackendW->header()->setSectionResizeMode(0,QHeaderView::Stretch); - for (int i =1;iheader()->setSectionResizeMode(i,QHeaderView::ResizeToContents); - } - - connect(this , SIGNAL(updateButtons()) , parent , SLOT(updateButtons())); - connect(&CollectionModel::instance(),&CollectionModel::checkStateChanged,this,&DlgAddressBook::changed); - - connect(&CollectionModel::instance(),&CollectionModel::rowsInserted, this, &DlgAddressBook::slotRowsInserted); - - connect(kcfg_displayAllCollections,&QCheckBox::toggled, this, &DlgAddressBook::slotDisplayAll); - - connect(m_pItemBackendW->selectionModel(), &QItemSelectionModel::currentChanged,this,&DlgAddressBook::slotEditCollection); - - m_pItemBackendW->expandAll(); - - //Select the first useful element - for (int i=0; iconfigurator(); - if (configurator) { - if (m_pProxyModel->sourceModel() == &CollectionModel::instance()) - m_pItemBackendW->selectionModel()->setCurrentIndex(m_pProxyModel->mapFromSource(orig), QItemSelectionModel::ClearAndSelect); - else - m_pItemBackendW->selectionModel()->setCurrentIndex(m_pProxyModel->mapFromSource(((QAbstractProxyModel*)CollectionModel::instance().manageableCollections())->mapFromSource(orig)), QItemSelectionModel::ClearAndSelect); - } - } - } - } - -} //DlgAddressBook - -///Destructor -DlgAddressBook::~DlgAddressBook() -{ - m_pCategoryDelegate->setChildDelegate(nullptr); - m_pCategoryDelegate->setChildChildDelegate(nullptr); - delete m_pDelegate; - delete m_pCategoryDelegate; - m_pItemBackendW->setItemDelegate(nullptr); - delete m_pManager; - m_hWidgets.clear(); -} - -void DlgAddressBook::slotRowsInserted(const QModelIndex&, int, int) -{ - m_pItemBackendW->expandAll(); -} - -void DlgAddressBook::slotDisplayAll(bool checked) -{ - m_pProxyModel->setSourceModel( checked ? &CollectionModel::instance() : CollectionModel::instance().manageableCollections()); - m_pItemBackendW->expandAll(); -} - -///Reload the widget -void DlgAddressBook::updateWidgets() -{ -// AkonadiPersonCollectionModel::instance().reload(); - m_pManager->updateWidgets(); - CollectionModel::instance().load(); -} - -///Save the settings -void DlgAddressBook::updateSettings() -{ -// AkonadiPersonCollectionModel::instance().save(); - CollectionModel::instance().save(); - m_pManager->updateSettings(); - - foreach (CollectionConfigurationInterface* c, m_lConfigurators) { - if (c->hasChanged()) - c->save(); - } - - m_HasChanged = false; -} - -///Tag this dialog as changed -void DlgAddressBook::changed() -{ - m_HasChanged = true; - emit updateButtons(); -} - -///If the "Apply" button need to be enabled -bool DlgAddressBook::hasChanged() -{ - bool configuratorChanged = false; - foreach (CollectionConfigurationInterface* c, m_lConfigurators) { - configuratorChanged |= c->hasChanged(); - } - - return m_HasChanged || m_pManager->hasChanged(); -} - -///Edit the selection collection -void DlgAddressBook::slotEditCollection() -{ - QModelIndex dest = m_pItemBackendW->selectionModel()->currentIndex(); - if (m_pProxyModel->sourceModel() != &CollectionModel::instance()) { - dest = m_pProxyModel->mapToSource(dest); - dest = ((QAbstractProxyModel*)CollectionModel::instance().manageableCollections())->mapToSource(dest); - } - else - dest = m_pProxyModel->mapToSource(dest); - - CollectionInterface* col = CollectionModel::instance().collectionAt(dest); - if (col) { - - if (m_hWidgets[col]) { - if (m_pCurrent) - m_pCurrent->setVisible(false); - m_pCurrent = m_hWidgets[col]; - m_pCurrent->setVisible(true); - return; - } - - CollectionConfigurationInterface* configurator = col->configurator(); - - if (m_pCurrent) { - m_pCurrent->setVisible(false); - m_pCurrent = nullptr; - } - - if (configurator) { - QWidget* w = new QWidget(frame_2); - m_hWidgets[col] = w; - configurator->loadCollection(col,w); - verticalLayout->addWidget(w); - m_pManager->addWidget(w); - m_pCurrent = w; - connect(configurator,&CollectionConfigurationInterface::changed,this,&DlgAddressBook::changed); - m_lConfigurators << configurator; - } - } -} - -///Add a new Akonadi collection -void DlgAddressBook::slotAddCollection() -{ - /*QPointer dlg = new Akonadi::AgentTypeDialog( this ); - dlg->agentFilterProxyModel()->addMimeTypeFilter( "text/x-vcard" ); - dlg->agentFilterProxyModel()->addMimeTypeFilter( "X-IMAddress" ); - if ( dlg->exec() ) { - const Akonadi::AgentType agentType = dlg->agentType(); - - if ( agentType.isValid() ) { - Akonadi::AgentInstanceCreateJob *job = new Akonadi::AgentInstanceCreateJob( agentType, this ); - connect( job, SIGNAL(result(KJob*)), SLOT(slotResourceCreationResult(KJob*)) ); - job->configure( this ); - job->start(); - } - - } - delete dlg;*/ -} - -void DlgAddressBook::slotResourceCreationResult(KJob* job) -{ - Q_UNUSED(job) -// if ( job->error() ) { -// KMessageBox::error( parentWidget, -// contextText( Akonadi::StandardActionManager::CreateResource, Akonadi::StandardActionManager::ErrorMessageText, job->errorString() ), -// contextText( Akonadi::StandardActionManager::CreateResource, Akonadi::StandardActionManager::ErrorMessageTitle ) ); -// } -} - -// kate: space-indent on; indent-width 3; replace-tabs on; - diff --git a/src/conf/dlgaddressbook.h b/src/conf/dlgaddressbook.h deleted file mode 100644 index ee848824..00000000 --- a/src/conf/dlgaddressbook.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLGADDRESSBOOK_H -#define DLGADDRESSBOOK_H - -//Qt -#include -#include -#include -#include -class QSortFilterProxyModel; - -#include "ui_dlgaddressbookbase.h" -#include - - -//KDE -class KJob; -class KConfigDialogManager; - -//Ring -class AutoCompletionDelegate; -class CategorizedDelegate; -class CollectionInterface; - -class DlgAddressBook final : public QWidget, public Ui_DlgAddressBookBase -{ -Q_OBJECT -public: - explicit DlgAddressBook(KConfigDialog* parent = nullptr); - - virtual ~DlgAddressBook(); - - bool hasChanged(); - -private: - //Attributes - QHash m_mNumbertype; - bool m_HasChanged; - AutoCompletionDelegate* m_pDelegate; - CategorizedDelegate* m_pCategoryDelegate; - QSortFilterProxyModel* m_pProxyModel; - QHash m_hWidgets; - QWidget* m_pCurrent; - KConfigDialogManager* m_pManager; - QList m_lConfigurators; - -public Q_SLOTS: - void updateWidgets (); - void updateSettings(); - -private Q_SLOTS: - void changed(); - void slotEditCollection(); - void slotAddCollection(); - void slotResourceCreationResult(KJob*); - void slotRowsInserted(const QModelIndex&, int, int); - void slotDisplayAll(bool); - -Q_SIGNALS: - ///Emitted when the buttons need to be updated - void updateButtons(); -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaddressbookbase.ui b/src/conf/dlgaddressbookbase.ui deleted file mode 100644 index d7e6c1cd..00000000 --- a/src/conf/dlgaddressbookbase.ui +++ /dev/null @@ -1,150 +0,0 @@ - - - DlgAddressBookBase - - - - 0 - 0 - 846 - 590 - - - - Addressbook settings - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 150 - 0 - - - - 5 - - - true - - - - - - - - - Display all - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - - - - - - - - - - 3 - 0 - - - - - 550 - 0 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - CategorizedTreeView - QTreeView -
widgets/categorizedtreeview.h
-
-
- - - - slotEditCollection() - slotAddCollection() - -
diff --git a/src/conf/dlgaudio.cpp b/src/conf/dlgaudio.cpp deleted file mode 100644 index 40953f92..00000000 --- a/src/conf/dlgaudio.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "dlgaudio.h" - -//Qt -#include - -//Ring -#include "klib/kcfg_settings.h" -#include "conf/configurationdialog.h" -#include "audio/settings.h" -#include "audio/inputdevicemodel.h" -#include "audio/outputdevicemodel.h" -#include "audio/ringtonedevicemodel.h" -#include "audio/managermodel.h" -#include "audio/alsapluginmodel.h" - -///Constructor -DlgAudio::DlgAudio(KConfigDialog *parent) - : QWidget(parent),m_Changed(false),m_IsLoading(false) -{ - setupUi(this); - - m_pSuppressNoise->setChecked(Audio::Settings::instance().isNoiseSuppressEnabled()); - m_pCPlayDTMFCk->setChecked(Audio::Settings::instance().areDTMFMuted()); - - loadAlsaSettings(); - - m_pManager ->bindToModel(Audio::Settings::instance().managerModel (), Audio::Settings::instance().managerModel ()->selectionModel()); - alsaOutputDevice ->bindToModel(Audio::Settings::instance().outputDeviceModel (), Audio::Settings::instance().outputDeviceModel ()->selectionModel()); - alsaRingtoneDevice ->bindToModel(Audio::Settings::instance().ringtoneDeviceModel(), Audio::Settings::instance().ringtoneDeviceModel()->selectionModel()); - alsaInputDevice ->bindToModel(Audio::Settings::instance().inputDeviceModel (), Audio::Settings::instance().inputDeviceModel ()->selectionModel()); - box_alsaPlugin ->bindToModel(Audio::Settings::instance().alsaPluginModel (), Audio::Settings::instance().alsaPluginModel ()->selectionModel()); - - connect( this , SIGNAL(updateButtons()), parent, SLOT(updateButtons())); - -} - -///Destructor -DlgAudio::~DlgAudio() -{ -} - -///Update the widgets -void DlgAudio::updateWidgets() -{ - loadAlsaSettings(); -} - -///Save the settings -void DlgAudio::updateSettings() -{ - if (m_Changed) { - m_IsLoading = true; - - Audio::Settings::instance().setNoiseSuppressState(m_pSuppressNoise->isChecked()); - Audio::Settings::instance().setDTMFMuted (m_pCPlayDTMFCk ->isChecked()); - - m_Changed = false; - m_IsLoading = false; - } -} - -///Have this dialog changed -bool DlgAudio::hasChanged() -{ - return m_Changed; -} - -///Tag the dialog as needing saving -void DlgAudio::changed() -{ - switch (Audio::Settings::instance().managerModel()->currentManager()) { - case Audio::ManagerModel::Manager::PULSE: - box_alsaPlugin->setDisabled(true); - stackedWidget_interfaceSpecificSettings->setVisible(true); - break; - case Audio::ManagerModel::Manager::ALSA: - box_alsaPlugin->setDisabled(false); - stackedWidget_interfaceSpecificSettings->setVisible(true); - break; - case Audio::ManagerModel::Manager::JACK: - box_alsaPlugin->setDisabled(true); - stackedWidget_interfaceSpecificSettings->setVisible(false); - break; - case Audio::ManagerModel::Manager::ERROR: - break; - }; - if (!m_IsLoading) { - m_Changed = true; - emit updateButtons(); - } -} - -///Load alsa settings -void DlgAudio::loadAlsaSettings() -{ - m_IsLoading = true; - Audio::Settings::instance().reload(); - - m_IsLoading = false; -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaudio.h b/src/conf/dlgaudio.h deleted file mode 100644 index 98c666fd..00000000 --- a/src/conf/dlgaudio.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLGAUDIO_H -#define DLGAUDIO_H - -#include -#include - -#include "ui_dlgaudiobase.h" -#include "klib/kcfg_settings.h" - -/** - @author Jérémy Quentin -*/ -class DlgAudio final : public QWidget, public Ui_DlgAudioBase -{ -Q_OBJECT -public: - //Constructor - explicit DlgAudio(KConfigDialog* parent = nullptr); - - //Destructor - virtual ~DlgAudio(); - -private: - bool m_Changed; - bool m_IsLoading; - -public Q_SLOTS: - void updateWidgets (); - void updateSettings(); - bool hasChanged (); - /** - * Loads the ALSA settings to fill the combo boxes - * of the ALSA settings. - * ALSA choices for input, output... can be load only - * when the daemon has set ALSA as sound manager. - * So we have to load these settings once the user choses - * ALSA. - */ - void loadAlsaSettings(); - -private Q_SLOTS: - //void codecTableChanged(); - void changed(); - -Q_SIGNALS: - ///Emitted when the buttons need to be updated in the parent dialog - void updateButtons(); -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgaudiobase.ui b/src/conf/dlgaudiobase.ui deleted file mode 100644 index 727b2952..00000000 --- a/src/conf/dlgaudiobase.ui +++ /dev/null @@ -1,359 +0,0 @@ - - - DlgAudioBase - - - - 0 - 0 - 467 - 437 - - - - Audio settings - - - - - - false - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Sound manager - - - m_pManager - - - - - - - - - - - - - - 0 - 0 - - - - 0 - - - - - 0 - - - - - ALSA Settings - - - - QFormLayout::ExpandingFieldsGrow - - - 5 - - - 9 - - - - - ALSA plugin - - - box_alsaPlugin - - - - - - - QComboBox::AdjustToContents - - - - - - - Input - - - alsaInputDevice - - - - - - - QComboBox::AdjustToContents - - - - - - - Output - - - alsaOutputDevice - - - - - - - QComboBox::AdjustToContents - - - - - - - Ringtone - - - - - - - - - - - - - - - - - - 0 - 0 - - - - PulseAudio Settings - - - - QFormLayout::ExpandingFieldsGrow - - - - - Mute other applications during a call - - - - - - - - - - - - - - Audio settings - - - - - - Enable noise reduction - - - - - - - Enable dial tone - - - - - - - Mute DTMF - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - AutoComboBox - QComboBox -
widgets/autocombobox.h
-
-
- - - - box_alsaPlugin - currentIndexChanged(int) - DlgAudioBase - changed() - - - 119 - 91 - - - 463 - 75 - - - - - alsaInputDevice - currentIndexChanged(QString) - DlgAudioBase - changed() - - - 147 - 126 - - - 465 - 105 - - - - - alsaOutputDevice - currentIndexChanged(int) - DlgAudioBase - changed() - - - 170 - 147 - - - 465 - 137 - - - - - alsaRingtoneDevice - currentIndexChanged(int) - DlgAudioBase - changed() - - - 141 - 170 - - - 466 - 173 - - - - - m_pSuppressNoise - toggled(bool) - DlgAudioBase - changed() - - - 109 - 244 - - - 469 - 229 - - - - - kcfg_enableRoomTone - toggled(bool) - DlgAudioBase - changed() - - - 120 - 268 - - - 468 - 264 - - - - - m_pCPlayDTMFCk - toggled(bool) - DlgAudioBase - changed() - - - 89 - 290 - - - 467 - 300 - - - - - m_pManager - currentIndexChanged(int) - DlgAudioBase - changed() - - - 424 - 29 - - - 465 - 32 - - - - - - changed() - -
diff --git a/src/conf/dlgaudiorecording.ui b/src/conf/dlgaudiorecording.ui deleted file mode 100644 index b5aa9499..00000000 --- a/src/conf/dlgaudiorecording.ui +++ /dev/null @@ -1,73 +0,0 @@ - - - DlgAudioRecording - - - - 0 - 0 - 400 - 300 - - - - - - - - 0 - 0 - - - - Recording - - - - - - - 0 - 0 - - - - Destination folder - - - - - - - Always record calls - - - - - - - - - - Qt::Vertical - - - - 20 - 199 - - - - - - - - - KUrlRequester - QFrame -
kurlrequester.h
-
-
- - -
diff --git a/src/conf/dlgdisplay.cpp b/src/conf/dlgdisplay.cpp deleted file mode 100644 index d899b18b..00000000 --- a/src/conf/dlgdisplay.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "dlgdisplay.h" -#include "klib/kcfg_settings.h" - -//KDE -#include -#include - -//LRC -#include - -///Constructor -DlgDisplay::DlgDisplay(KConfigDialog *parent) - : QWidget(parent),m_HasChanged(false) -{ - setupUi(this); - - connect(this,SIGNAL(updateButtons()), parent , SLOT(updateButtons())); - -//FIXME DROP QTWIDGET -// PhoneWindow::app()->isAutoStart(); -} - -///Destructor -DlgDisplay::~DlgDisplay() -{ -} - -///Have this dialog changed -bool DlgDisplay::hasChanged() -{ - return m_HasChanged; -} - -///Tag this dialog as changed -void DlgDisplay::changed() -{ - m_HasChanged = true; - emit updateButtons(); -} - -///Update all widgets -void DlgDisplay::updateWidgets() -{ -//FIXME DROP QTWIDGET -// kcfg_autoStart->setChecked(PhoneWindow::app()->isAutoStart()); -} - -///Save current settings -void DlgDisplay::updateSettings() -{ - if (ConfigurationSkeleton::autoStart() != kcfg_autoStart->isChecked()) { - ConfigurationSkeleton::setAutoStartOverride(true); - } - - if (ConfigurationSkeleton::hideUnreachable() != kcfg_hideUnreachable->isChecked()) - CategorizedContactModel::instance().setUnreachableHidden(kcfg_hideUnreachable->isChecked()); - -//FIXME DROP QTWIDGET -// PhoneWindow::app()->setAutoStart(kcfg_autoStart->isChecked()); - - m_HasChanged = false; -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgdisplay.h b/src/conf/dlgdisplay.h deleted file mode 100644 index 22a4daa6..00000000 --- a/src/conf/dlgdisplay.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2015 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#ifndef DLGDISPLAY_H -#define DLGDISPLAY_H - -#include - -#include "ui_dlgdisplaybase.h" - -class KConfigDialog; - -/** - @author Jérémy Quentin -*/ -class DlgDisplay final : public QWidget, public Ui_DlgDisplayBase -{ -Q_OBJECT -public: - //Constructor - explicit DlgDisplay(KConfigDialog *parent = nullptr); - - //Destructor - virtual ~DlgDisplay(); - - bool hasChanged(); - -private: - bool m_HasChanged; - -public Q_SLOTS: - //Mutator - void updateWidgets(); - void updateSettings(); - -private Q_SLOTS: - void changed(); - -Q_SIGNALS: - ///Emitted when the history need to be cleared - void clearCallHistoryAsked(); - ///Emitted when the buttons need to be updated - void updateButtons(); - -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgdisplaybase.ui b/src/conf/dlgdisplaybase.ui deleted file mode 100644 index a76226e8..00000000 --- a/src/conf/dlgdisplaybase.ui +++ /dev/null @@ -1,109 +0,0 @@ - - - DlgDisplayBase - - - - 0 - 0 - 573 - 550 - - - - - 0 - 0 - - - - Display settings - - - - - - Display Main Window - - - - - - - - - On start - - - - - - - - - - On incoming calls - - - - - - - On boot (auto start) - - - - - - - - - - - 0 - 0 - - - - - - - - Visible contacts Details - - - - - - Hide unreachable contacts - - - - - - - Hide contacts without phone numbers - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - diff --git a/src/conf/dlgfallbackperson.ui b/src/conf/dlgfallbackperson.ui deleted file mode 100644 index dfb644b8..00000000 --- a/src/conf/dlgfallbackperson.ui +++ /dev/null @@ -1,47 +0,0 @@ - - - DlgFallbackPerson - - - - 0 - 0 - 400 - 300 - - - - - - - <html><head/><body><p>Akonadi 2, the version compatible with the KDE frameworks 5 is not released yet. Therefore, at this point, Ring-KDE cannot be integrated with KAddressBook.</p><p>However, it is possible to integrate the <span style=" font-weight:600;">KDE4</span> version KAddressbook with Ring-KDE. To do this:</p><p>(1) Open <span style=" font-weight:600;">KAddressBook </span>and File-&gt;New-&gt;Add Address Book</p><p>(2) Select &quot;vCard directory&quot;</p><p>(3) Select the &quot;/home/<span style=" font-style:italic;">your_user_name</span>/.local/share/ring-kde/vCard&quot; folder</p><p>(4) Press OK</p><p>It will now be possible to access and edit your contacts from KAddressBook</p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - diff --git a/src/conf/dlggeneral.cpp b/src/conf/dlggeneral.cpp index 772698f3..16d21b65 100644 --- a/src/conf/dlggeneral.cpp +++ b/src/conf/dlggeneral.cpp @@ -1,88 +1,87 @@ /**************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Jérémy Quentin * * Emmanuel Lepage Vallee * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include "dlggeneral.h" //Qt #include #include #include //KDE #include #include //Ring #include "klib/kcfg_settings.h" -#include "conf/configurationdialog.h" #include "categorizedhistorymodel.h" ///Constructor DlgGeneral::DlgGeneral(KConfigDialog *parent) : QWidget(parent),m_HasChanged(false) { setupUi(this); connect(toolButton_historyClear, &QAbstractButton::clicked, this, &DlgGeneral::slotClearCallHistoryAsked); const bool isLimited = CategorizedHistoryModel::instance().isHistoryLimited(); m_pKeepHistory->setChecked(!isLimited); m_pHistoryMax ->setEnabled(isLimited ); m_pHistoryMax->setValue(CategorizedHistoryModel::instance().historyLimit()); m_HasChanged = false; } ///Destructor DlgGeneral::~DlgGeneral() { } ///Have this dialog changed bool DlgGeneral::hasChanged() { return m_HasChanged; } ///Tag this dialog as changed void DlgGeneral::slotChanged() { m_HasChanged = true; emit updateButtons(); } ///Update all widgets void DlgGeneral::updateWidgets() { } ///Save current settings void DlgGeneral::updateSettings() { CategorizedHistoryModel::instance().setHistoryLimited(!m_pKeepHistory->isChecked()); if (!m_pKeepHistory->isChecked()) CategorizedHistoryModel::instance().setHistoryLimit(m_pHistoryMax->value()); m_HasChanged = false; } void DlgGeneral::slotClearCallHistoryAsked() { CategorizedHistoryModel::instance().clearAllCollections(); } // kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgpresence.cpp b/src/conf/dlgpresence.cpp deleted file mode 100644 index 299bd7ae..00000000 --- a/src/conf/dlgpresence.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2013-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "dlgpresence.h" - -// Qt -#include - -//KDE -#include - -//Ring -#include - -DlgPresence::DlgPresence(QWidget *parent) : QWidget(parent),m_Changed(false) -{ - setupUi(this); - m_pView->setModel(&PresenceStatusModel::instance()); - connect(m_pAdd , &QAbstractButton::clicked,&PresenceStatusModel::instance() ,&PresenceStatusModel::addRow ); - connect(m_pUp , &QAbstractButton::clicked,this ,&DlgPresence::slotMoveUp ); - connect(m_pDown , &QAbstractButton::clicked,this ,&DlgPresence::slotMoveDown ); - connect(m_pRemove, &QAbstractButton::clicked,this ,&DlgPresence::slotRemoveRow); - connect(&PresenceStatusModel::instance(),&QAbstractItemModel::dataChanged,this,&DlgPresence::slotChanged); - - if (m_pView->horizontalHeader()) { - /*m_pView->horizontalHeader()->setSectionResizeMode(0,QHeaderView::ResizeToContents); - m_pView->horizontalHeader()->setSectionResizeMode(1,QHeaderView::Stretch); - for (int i=2;ihorizontalHeader()->setSectionResizeMode(i,QHeaderView::ResizeToContents); - }*/ - } - -} - -DlgPresence::~DlgPresence() -{ -} - -void DlgPresence::updateWidgets() -{ - -} - -void DlgPresence::updateSettings() -{ - PresenceStatusModel::instance().save(); - m_Changed = false; - emit updateButtons(); -} - -bool DlgPresence::hasChanged() -{ - return m_Changed; -} - -void DlgPresence::slotChanged() -{ - m_Changed = true; - emit updateButtons(); -} - -void DlgPresence::slotRemoveRow() -{ - PresenceStatusModel::instance().removeRow(m_pView->currentIndex()); -} - - -void DlgPresence::slotMoveUp() -{ - PresenceStatusModel::instance().moveUp(m_pView->currentIndex()); -} - -void DlgPresence::slotMoveDown() -{ - PresenceStatusModel::instance().moveDown(m_pView->currentIndex()); -} - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgpresence.h b/src/conf/dlgpresence.h deleted file mode 100644 index 005f8b80..00000000 --- a/src/conf/dlgpresence.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2013-2015 by Savoir-Faire Linux *** - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef DLGPRESENCE_H -#define DLGPRESENCE_H - -#include - -#include "ui_dlgpresence.h" - -class DlgPresence final : public QWidget, public Ui_DlgPresence -{ -Q_OBJECT -public: - //Constructor - explicit DlgPresence(QWidget *parent = nullptr); - - //Destructor - virtual ~DlgPresence(); - - //Getter - bool hasChanged(); - -private: - // Attributes - bool m_Changed ; - -public Q_SLOTS: - //Mutator - void updateWidgets(); - void updateSettings(); - -private Q_SLOTS: - void slotChanged(); - -private Q_SLOTS: - void slotRemoveRow(); - void slotMoveUp (); - void slotMoveDown (); - -Q_SIGNALS: - ///Emitted when the buttons need to be updated - void updateButtons(); -}; - -#endif - -// kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/conf/dlgpresence.ui b/src/conf/dlgpresence.ui deleted file mode 100644 index 53c7e3e4..00000000 --- a/src/conf/dlgpresence.ui +++ /dev/null @@ -1,127 +0,0 @@ - - - DlgPresence - - - - 0 - 0 - 400 - 300 - - - - - - - true - - - QAbstractItemView::SelectRows - - - false - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - true - - - Move Down - - - - - - - - - - true - - - Move Up - - - - - - - - - - true - - - Add - - - - - - - - - - true - - - Remove - - - - - - - - - - - - Track bookmarked number presence - - - - - - - - LeftToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
- - RightToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
- - CenterToolButton - QToolButton -
widgets/groupedtoolbutton.h
-
-
- - -
diff --git a/src/conf/dlgvideo.cpp b/src/conf/dlgvideo.cpp deleted file mode 100644 index 092cc616..00000000 --- a/src/conf/dlgvideo.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2012-2015 by Savoir-Faire Linux * - * Author : Emmanuel Lepage Vallee * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ -#include "dlgvideo.h" - -//KDE -#include -#include - -//Ring -#include "video/device.h" -#include "video/previewmanager.h" -#include "video/resolution.h" -#include "video/channel.h" -#include "video/rate.h" -#include