diff --git a/sflphone_kde/Account.cpp b/sflphone_kde/Account.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ed4e9de074ee2be42a02c0bbfed51c7f18ef13f7 --- /dev/null +++ b/sflphone_kde/Account.cpp @@ -0,0 +1,181 @@ +#include "Account.h" +#include "sflphone_const.h" +#include "configurationmanager_interface_singleton.h" + +#include <iostream> + +using namespace std; + +const QString account_state_name(QString & s) +{ + if(s == QString(ACCOUNT_STATE_REGISTERED)) + return QApplication::translate("ConfigurationDialog", "Registered", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_UNREGISTERED)) + return QApplication::translate("ConfigurationDialog", "Not Registered", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_TRYING)) + return QApplication::translate("ConfigurationDialog", "Trying...", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR)) + return QApplication::translate("ConfigurationDialog", "Error", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR_AUTH)) + return QApplication::translate("ConfigurationDialog", "Bad authentification", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR_NETWORK)) + return QApplication::translate("ConfigurationDialog", "Network unreachable", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR_HOST)) + return QApplication::translate("ConfigurationDialog", "Host unreachable", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR_CONF_STUN)) + return QApplication::translate("ConfigurationDialog", "Stun configuration error", 0, QApplication::UnicodeUTF8); + if(s == QString(ACCOUNT_STATE_ERROR_EXIST_STUN)) + return QApplication::translate("ConfigurationDialog", "Stun server invalid", 0, QApplication::UnicodeUTF8); + return QApplication::translate("ConfigurationDialog", "Invalid", 0, QApplication::UnicodeUTF8); +} + +//Constructors + + Account::Account():accountId(NULL){} + +/* +Account::Account(QListWidgetItem & _item, QString & alias) +{ + accountDetails = new MapStringString(); + (*accountDetails)[ACCOUNT_ALIAS] = alias; + item = & _item; +} + +Account::Account(QString & _accountId, MapStringString & _accountDetails, account_state_t & _state) +{ + *accountDetails = _accountDetails; + *accountId = _accountId; + *state = _state; +} +*/ + +void Account::initAccountItem() +{ + item = new QListWidgetItem(); + item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + cout << getAccountDetail(*(new QString(ACCOUNT_ENABLED))).toStdString() << endl; + item->setCheckState((getAccountDetail(*(new QString(ACCOUNT_ENABLED))) == ACCOUNT_ENABLED_TRUE) ? Qt::Checked : Qt::Unchecked); + item->setText(getAccountDetail(*(new QString(ACCOUNT_ALIAS)))); +} + +Account * Account::buildExistingAccountFromId(QString _accountId) +{ + Account * a = new Account(); + a->accountId = new QString(_accountId); + a->accountDetails = new MapStringString( ConfigurationManagerInterfaceSingleton::getInstance().getAccountDetails(_accountId).value() ); + a->initAccountItem(); + if(a->item->checkState() == Qt::Checked) + if(a->getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) + a->item->setTextColor(Qt::darkGreen); + else + a->item->setTextColor(Qt::red); + return a; +} + +Account * Account::buildNewAccountFromAlias(QString alias) +{ + Account * a = new Account(); + a->accountDetails = new MapStringString(); + a->setAccountDetail(QString(ACCOUNT_ALIAS),alias); + a->initAccountItem(); + return a; +} + +Account::~Account() +{ + delete accountId; + delete accountDetails; + delete item; +} + +//Getters + +bool Account::isNew() +{ + qDebug() << accountId; + return(!accountId); +} + +QString & Account::getAccountId() +{ + return *accountId; +} + +MapStringString & Account::getAccountDetails() +{ + return *accountDetails; +} + +QListWidgetItem * Account::getItem() +{ + if(!item) + cout<<"null"<<endl; + return item; + +} + +QString Account::getStateName(QString & state) +{ + return account_state_name(state); +} + +QColor Account::getStateColor() +{ + if(item->checkState() == Qt::Checked) + { + if(getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) + return Qt::darkGreen; + return Qt::red; + } + return Qt::black; +} + + +QString Account::getStateColorName() +{ + if(item->checkState() == Qt::Checked) + { + if(getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) + return "darkGreen"; + return "red"; + } + return "black"; +} + +QString Account::getAccountDetail(QString & param) +{ + return (*accountDetails)[param]; +} +/* +QString Account::getAccountDetail(std::string param) +{ + return (*accountDetails)[QString(param)]; +} +*/ +//Setters +/* +void Account::setAccountId(QString id) +{ + accountId = id; +} +*/ +void Account::setAccountDetails(MapStringString m) +{ + *accountDetails = m; +} +/* +void Account::setState(account_state_t s) +{ + +} +*/ +void Account::setAccountDetail(QString param, QString val) +{ + (*accountDetails)[param] = val; +} + +//Operators +bool Account::operator==(const Account& a)const +{ + return *accountId == *a.accountId; +} diff --git a/sflphone_kde/Account.h b/sflphone_kde/Account.h new file mode 100644 index 0000000000000000000000000000000000000000..133cff985ad361474d1b69c78e4ce1fd6aeb4666 --- /dev/null +++ b/sflphone_kde/Account.h @@ -0,0 +1,52 @@ +#ifndef HEADER_ACCOUNT +#define HEADER_ACCOUNT + +#include <QtGui> +#include "metatypes.h" + +const QString account_state_name(QString & s); + +class Account{ + +private: + + QString * accountId; + MapStringString * accountDetails; + QListWidgetItem * item; + + Account(); + +public: + + //Constructors + static Account * buildExistingAccountFromId(QString _accountId); + static Account * buildNewAccountFromAlias(QString alias); + + ~Account(); + + //Getters + bool isNew(); + QString & getAccountId(); + MapStringString & getAccountDetails(); + QListWidgetItem * getItem(); + QString getStateName(QString & state); + QColor getStateColor(); + QString getStateColorName(); + QString getAccountDetail(QString & param); + //QString getAccountDetail(std::string param); + + //Setters + void initAccountItem(); + void setAccountId(QString id); + void setAccountDetails(MapStringString m); + //void setState(account_state_t s); + void setAccountDetail(QString param, QString val); + + //Operators + bool operator==(const Account&)const; + +}; + + + +#endif \ No newline at end of file diff --git a/sflphone_kde/AccountList.cpp b/sflphone_kde/AccountList.cpp new file mode 100644 index 0000000000000000000000000000000000000000..38d6ec2f34e9e3a95f66905b3acf62e6aa55802b --- /dev/null +++ b/sflphone_kde/AccountList.cpp @@ -0,0 +1,106 @@ +#include "AccountList.h" +#include "sflphone_const.h" + + +//Constructors +/* +AccountList::AccountList(VectorString & _accountIds) +{ + accounts = new QVector<Account *>(1); + (*accounts) += new Account(*(new QListWidgetItem()), "alias"); + for (int i = 0; i < _accountIds.size(); ++i){ + (*accounts) += new Account(_accountIds[i]); + } +} +*/ +AccountList::AccountList(QStringList & _accountIds) +{ + accounts = new QVector<Account *>(); + for (int i = 0; i < _accountIds.size(); ++i){ + (*accounts) += Account::buildExistingAccountFromId(_accountIds[i]); + } +} + +AccountList::~AccountList() +{ + delete accounts; +} + +//Getters +QVector<Account *> & AccountList::getAccounts() +{ + return *accounts; +} + +Account * AccountList::getAccountById(QString & id) +{ + for (int i = 0; i < accounts->size(); ++i){ + if ((*accounts)[i]->getAccountId() == id) + return (*accounts)[i]; + } + return NULL; +} + +QVector<Account *> AccountList::getAccountByState(QString & state) +{ + QVector<Account *> v; + for (int i = 0; i < accounts->size(); ++i){ + if ((*accounts)[i]->getAccountDetail(*(new QString(ACCOUNT_STATUS))) == state) + v += (*accounts)[i]; + } + return v; + +} +/* +Account AccountList::getAccountByRow(int row) +{ + +} +*/ +Account * AccountList::getAccountByItem(QListWidgetItem * item) +{ + for (int i = 0; i < accounts->size(); ++i){ + if ( (*accounts)[i]->getItem() == item) + return (*accounts)[i]; + } + return NULL; +} + +int AccountList::size() +{ + return accounts->size(); +} + +//Setters +/* +void AccountList::addAccount(Account & account) +{ + accounts->add(account); +} +*/ +QListWidgetItem * AccountList::addAccount(QString & alias) +{ + Account * a = Account::buildNewAccountFromAlias(alias); + (*accounts) += a; + return a->getItem(); +} + +void AccountList::removeAccount(QListWidgetItem * item) +{ + if(!item) {qDebug() << "Attempting to remove an account from a NULL item."; return; } + + Account * a = getAccountByItem(item); + if(!a) {qDebug() << "Attempting to remove an unexisting account."; return; } + + accounts->remove(accounts->indexOf(a)); +} + +const Account & AccountList::operator[] (int i) const +{ + return *((*accounts)[i]); +} + +Account & AccountList::operator[] (int i) +{ + return *((*accounts)[i]); +} diff --git a/sflphone_kde/AccountList.h b/sflphone_kde/AccountList.h new file mode 100644 index 0000000000000000000000000000000000000000..6420c7373241729f63557b1c3b36221ff7ee7ab6 --- /dev/null +++ b/sflphone_kde/AccountList.h @@ -0,0 +1,41 @@ +#ifndef HEADER_ACCOUNTLIST +#define HEADER_ACCOUNTLIST + +#include <QtGui> +#include "Account.h" + +class AccountList{ + +private: + + QVector<Account *> * accounts; + +public: + + //Constructors + //AccountList(VectorString & _accountIds); + AccountList(QStringList & _accountIds); + ~AccountList(); + + //Getters + QVector<Account *> & getAccounts(); + Account * getAccountById(QString & id); + QVector<Account *> getAccountByState(QString & state); + //Account * getAccountByRow(int row); + Account * getAccountByItem(QListWidgetItem * item); + int size(); + + //Setters + //void addAccount(Account & account); + QListWidgetItem * addAccount(QString & alias); + void removeAccount(QListWidgetItem * item); + + //Operators + Account & operator[] (int i); + const Account & operator[] (int i) const; +}; + + + + +#endif \ No newline at end of file diff --git a/sflphone_kde/CMakeLists.txt b/sflphone_kde/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b558c608ee8ff71294c8cae46400398bce812a90 --- /dev/null +++ b/sflphone_kde/CMakeLists.txt @@ -0,0 +1,38 @@ +project(sflphone_kde) +find_package(KDE4 REQUIRED) +include (KDE4Defaults) +include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) + +set(sflphone_kde_SRCS + SFLPhone.cpp + ConfigDialog.cpp + main.cpp + sflphone_const.cpp + Account.cpp + AccountList.cpp + configurationmanager_interface.cpp + configurationmanager_interface_singleton.cpp + callmanager_interface.cpp + callmanager_interface_singleton.cpp + ) + +#kde4_automoc(${sflphone_kde_SRCS}) + +kde4_add_ui_files(sflphone_kde_SRCS sflphone-qt.ui ConfigDialog.ui) + +kde4_add_kcfg_files(sflphone_kde_SRCS settings.kcfgc ) + +kde4_add_executable(sflphone_kde ${sflphone_kde_SRCS}) + +target_link_libraries(sflphone_kde ${KDE4_KDEUI_LIBS} ) + +install(TARGETS sflphone_kde DESTINATION ${BIN_INSTALL_DIR} ) + + +########### install files ############### + +install( FILES sflphone_kde.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( FILES sflphone_kde.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +install( FILES sflphone_kdeui.rc DESTINATION ${DATA_INSTALL_DIR}/sflphone_kde ) + + diff --git a/sflphone_kde/COPYING b/sflphone_kde/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..5b6e7c66c276e7610d4a73c70ec1a1f7c1003259 --- /dev/null +++ b/sflphone_kde/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/sflphone_kde/Call.cpp b/sflphone_kde/Call.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c3f895393c845895ba12da784d3ae0efbd900c80 --- /dev/null +++ b/sflphone_kde/Call.cpp @@ -0,0 +1,3 @@ +#include "Call.h" + + diff --git a/sflphone_kde/Call.h b/sflphone_kde/Call.h new file mode 100644 index 0000000000000000000000000000000000000000..f08b690a9f10788d4c5448dfcd0847515857afcb --- /dev/null +++ b/sflphone_kde/Call.h @@ -0,0 +1,33 @@ +#ifndef CALL_H +#define CALL_H + + +class Call +{ +private: + Account * account; + QString id; + CallStatus * status; + QString from; + QString to; + HistoryState * historyState; + QTime start; + QTime stop; + QListWidgetItem * item; + + +public: + + ~Call(); + + + + + + + + +}; + + +#endif \ No newline at end of file diff --git a/sflphone_kde/CallList.cpp b/sflphone_kde/CallList.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sflphone_kde/CallList.h b/sflphone_kde/CallList.h new file mode 100644 index 0000000000000000000000000000000000000000..3122e23ce2e7b4691c01d027a9f8d69cafd59abf --- /dev/null +++ b/sflphone_kde/CallList.h @@ -0,0 +1,24 @@ +#ifndef CALL_LIST_H +#define CALL_LIST_H + + +class CallList +{ +private: + QVector<Call *> * calls + +public: + + ~CallList(); + + Call * operator[](QListWidgetItem * item); + + + + + + +}; + + +#endif \ No newline at end of file diff --git a/sflphone_kde/ConfigDialog.cpp b/sflphone_kde/ConfigDialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bcbaff712acf5f39fec9fdd929757b7c7e1d93a6 --- /dev/null +++ b/sflphone_kde/ConfigDialog.cpp @@ -0,0 +1,478 @@ +#include <QtGui> +#include <QtCore> +#include <iostream> +#include <stdarg.h> +#include "sflphone_const.h" +#include "metatypes.h" +#include "ConfigDialog.h" +#include "configurationmanager_interface_singleton.h" + +using namespace std; + +ConfigurationDialog::ConfigurationDialog(SFLPhone *parent) : QDialog(parent) +{ + //configuration qt designer + setupUi(this); + + //configuration complémentaire + errorWindow = new QErrorMessage(this); + codecPayloads = new MapStringString(); + horizontalSlider_Capacity->setMaximum(MAX_HISTORY_CAPACITY); + label_WarningSIP->setVisible(false); + + //TODO ajouter les items de l'interface audio ici avec les constantes + + //configuration dbus + registerCommTypes(); + + + + + + loadOptions(); +} + +ConfigurationDialog::~ConfigurationDialog() +{ + delete accountList; + delete errorWindow; + delete codecPayloads; +} + +void ConfigurationDialog::loadOptions() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + spinBox_CapaciteHist->setValue(daemon.getMaxCalls()); + + //SIP port settings + int sipPort = daemon.getSipPort(); + if(sipPort<1025){ + spinBox_PortSIP->setMinimum(sipPort); + label_WarningSIP->setText("Attention : le port SIP doit être supérieur à 1024 !"); + label_WarningSIP->setVisible(true); + } + if(sipPort>65535){ + spinBox_PortSIP->setMaximum(sipPort); + label_WarningSIP->setText("Attention : le port SIP doit être inférieur à 65536 !"); + label_WarningSIP->setVisible(true); + } + spinBox_PortSIP->setValue(daemon.getSipPort()); + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + checkBox1_NotifAppels->setCheckState(daemon.getNotify() ? Qt::Checked : Qt::Unchecked); + checkBox2_NotifMessages->setCheckState(daemon.getMailNotify() ? Qt::Checked : Qt::Unchecked); + + //Window display settings + checkBox1_FenDemarrage->setCheckState(daemon.isStartHidden() ? Qt::Unchecked : Qt::Checked); + checkBox2_FenAppel->setCheckState(daemon.popupMode() ? Qt::Checked : Qt::Unchecked); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + + loadAccountList(); + + //Stun settings + checkBoxStun->setCheckState(daemon.isStunEnabled() ? Qt::Checked : Qt::Unchecked); + lineEdit_Stun->setText(QString(daemon.getStunServer())); + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + comboBox_Interface->setCurrentIndex(daemon.getAudioManager()); + stackedWidget_ParametresSpecif->setCurrentIndex(daemon.getAudioManager()); + + //ringtones settings + checkBox_Sonneries->setCheckState(daemon.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked); + //TODO widget choix de sonnerie + //widget_nomSonnerie->setText(daemon.getRingtoneChoice()); + + //codecs settings + loadCodecs(); + + // + //alsa settings + comboBox1_GreffonAlsa->clear(); + QStringList pluginList = daemon.getOutputAudioPluginList(); + comboBox1_GreffonAlsa->addItems(pluginList); + comboBox1_GreffonAlsa->setCurrentIndex(comboBox1_GreffonAlsa->findText(daemon.getCurrentAudioOutputPlugin())); + + qDebug() << "avant daemon.getCurrentAudioDevicesIndex();"; + QStringList devices = daemon.getCurrentAudioDevicesIndex(); + qDebug() << "apres daemon.getCurrentAudioDevicesIndex();"; + + int inputDevice = devices[1].toInt(); + comboBox2_Entree->clear(); + QStringList inputDeviceList = daemon.getAudioInputDeviceList(); + comboBox2_Entree->addItems(inputDeviceList); + comboBox2_Entree->setCurrentIndex(inputDevice); + + int outputDevice = devices[0].toInt(); + comboBox3_Sortie->clear(); + QStringList outputDeviceList = daemon.getAudioOutputDeviceList(); + comboBox3_Sortie->addItems(inputDeviceList); + comboBox3_Sortie->setCurrentIndex(outputDevice); + + //pulseaudio settings + checkBox_ModifVolumeApps->setCheckState(daemon.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked); + + +} + + +void ConfigurationDialog::saveOptions() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + daemon.setMaxCalls(spinBox_CapaciteHist->value()); + + //SIP port settings + int sipPort = spinBox_PortSIP->value(); + + if(sipPort<1025){ + errorWindow->showMessage("Attention : le port SIP doit être supérieur à 1024 !"); + } + if(sipPort>65535){ + errorWindow->showMessage("Attention : le port SIP doit être inférieur à 65536 !"); + } + daemon.setSipPort(sipPort); + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + if(checkBox1_NotifAppels->checkState() != (daemon.getNotify() ? Qt::Checked : Qt::Unchecked)) daemon.setNotify(); + if(checkBox2_NotifMessages->checkState() != (daemon.getMailNotify() ? Qt::Checked : Qt::Unchecked)) daemon.setMailNotify(); + + //Window display settings + //WARNING états inversés + if(checkBox1_FenDemarrage->checkState() != (daemon.isStartHidden() ? Qt::Unchecked : Qt::Checked)) daemon.startHidden(); + if(checkBox2_FenAppel->checkState() != (daemon.popupMode() ? Qt::Checked : Qt::Unchecked)) daemon.switchPopupMode(); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + + saveAccountList(); + + //Stun settings + if(checkBoxStun->checkState() != (daemon.isStunEnabled() ? Qt::Checked : Qt::Unchecked)) daemon.enableStun(); + daemon.setStunServer(lineEdit_Stun->text()); + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + qDebug() << "setting audio manager"; + int manager = comboBox_Interface->currentIndex(); + daemon.setAudioManager(manager); + + //ringtones settings + qDebug() << "setting ringtone options"; + if(checkBox_Sonneries->checkState() != (daemon.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked)) daemon.ringtoneEnabled(); + //TODO widget choix de sonnerie + //daemon.getRingtoneChoice(widget_nomSonnerie->text()); + + //codecs settings + qDebug() << "saving codecs"; + saveCodecs(); + + //alsa settings + if(manager == ALSA) + { + qDebug() << "setting alsa settings"; + daemon.setOutputAudioPlugin(comboBox1_GreffonAlsa->currentText()); + daemon.setAudioInputDevice(comboBox2_Entree->currentIndex()); + daemon.setAudioOutputDevice(comboBox3_Sortie->currentIndex()); + } + //pulseaudio settings + if(manager == PULSEAUDIO) + { + qDebug() << "setting pulseaudio settings"; + if(checkBox_ModifVolumeApps->checkState() != (daemon.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked)) daemon.setPulseAppVolumeControl(); + } +} + + +void ConfigurationDialog::loadAccountList() +{ + //ask for the list of accounts ids to the daemon + QStringList accountIds = ConfigurationManagerInterfaceSingleton::getInstance().getAccountList().value(); + //create the AccountList object with the ids + accountList = new AccountList(accountIds); + //initialize the QListWidget object with the AccountList + listWidgetComptes->clear(); + for (int i = 0; i < accountList->size(); ++i){ + listWidgetComptes->addItem((*accountList)[i].getItem()); + } + if (listWidgetComptes->count() > 0) + listWidgetComptes->setCurrentRow(0); + else + frame2_EditComptes->setEnabled(false); +} + +void ConfigurationDialog::saveAccountList() +{ + //save the account being edited + if(listWidgetComptes->currentItem()) + saveAccount(listWidgetComptes->currentItem()); + //get the daemon instance + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + //ask for the list of accounts ids to the daemon + QStringList accountIds= QStringList(daemon.getAccountList().value()); + //create or update each account from accountList + for (int i = 0; i < accountList->size(); i++){ + Account & current = (*accountList)[i]; + QString currentId; + //if the account has no instanciated id, it has just been created in the client + if(current.isNew()) + { + currentId = QString(daemon.addAccount(current.getAccountDetails())); + } + //if the account has an instanciated id but it's not in daemon + else{ + if(! accountIds.contains(current.getAccountId())) + { + qDebug() << "The account with id " << current.getAccountId() << " doesn't exist. It might have been removed by another SFLPhone client."; + currentId = QString(""); + } + else + { + daemon.setAccountDetails(current.getAccountId(), current.getAccountDetails()); + currentId = QString(current.getAccountId()); + } + } + daemon.sendRegister(currentId, (current.getItem()->checkState() == Qt::Checked) ? 1 : 0 ); + } + //remove accounts that are in the daemon but not in the client + for (int i = 0; i < accountIds.size(); i++) + if(! accountList->getAccountById(accountIds[i])){ + qDebug() << "remove account " << accountIds[i]; + daemon.removeAccount(accountIds[i]); + } +} + +void ConfigurationDialog::loadAccount(QListWidgetItem * item) +{ + if(! item ) { qDebug() << "Attempting to load details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account ) { qDebug() << "Attempting to load details of an unexisting account"; return; } + + edit1_Alias->setText( account->getAccountDetail(*(new QString(ACCOUNT_ALIAS)))); + int protocoleIndex = getProtocoleIndex(account->getAccountDetail(*(new QString(ACCOUNT_TYPE)))); + edit2_Protocole->setCurrentIndex( (protocoleIndex < 0) ? 0 : protocoleIndex ); + edit3_Serveur->setText( account->getAccountDetail(*(new QString(ACCOUNT_HOSTNAME)))); + edit4_Usager->setText( account->getAccountDetail(*(new QString(ACCOUNT_USERNAME)))); + edit5_Mdp->setText( account->getAccountDetail(*(new QString(ACCOUNT_PASSWORD)))); + edit6_BoiteVocale->setText( account->getAccountDetail(*(new QString(ACCOUNT_MAILBOX)))); + QString status = account->getAccountDetail(*(new QString(ACCOUNT_STATUS))); + edit7_Etat->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); + //edit7_Etat->setTextColor( account->getStateColor ); +} + + +void ConfigurationDialog::saveAccount(QListWidgetItem * item) +{ + if(! item) { qDebug() << "Attempting to save details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account) { qDebug() << "Attempting to save details of an unexisting account : " << item->text(); return; } + + account->setAccountDetail(ACCOUNT_ALIAS, edit1_Alias->text()); + account->setAccountDetail(ACCOUNT_TYPE, getIndexProtocole(edit2_Protocole->currentIndex())); + account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_Serveur->text()); + account->setAccountDetail(ACCOUNT_USERNAME, edit4_Usager->text()); + account->setAccountDetail(ACCOUNT_PASSWORD, edit5_Mdp->text()); + account->setAccountDetail(ACCOUNT_MAILBOX, edit6_BoiteVocale->text()); + +} + + +void ConfigurationDialog::loadCodecs() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList codecList = daemon.getCodecList(); + QStringList activeCodecList = daemon.getActiveCodecList(); + qDebug() << codecList; + qDebug() << activeCodecList; + tableWidget_Codecs->setRowCount(0); + codecPayloads->clear(); + for(int i=0 ; i<codecList.size() ; i++) + { + bool ok; + qDebug() << codecList[i]; + QString payloadStr = QString(codecList[i]); + int payload = payloadStr.toInt(&ok); + if(!ok) + qDebug() << "The codec's payload sent by the daemon is not a number : " << codecList[i]; + else + { + QStringList details = daemon.getCodecDetails(payload); + tableWidget_Codecs->insertRow(i); + QTableWidgetItem * headerItem = new QTableWidgetItem(""); + tableWidget_Codecs->setVerticalHeaderItem (i, headerItem); + //headerItem->setVisible(false); + tableWidget_Codecs->setItem(i,0,new QTableWidgetItem("")); + tableWidget_Codecs->setItem(i,1,new QTableWidgetItem(details[CODEC_NAME])); + //qDebug() << "tableWidget_Codecs->itemAt(" << i << "," << 2 << ")->setText(" << details[CODEC_NAME] << ");"; + //tableWidget_Codecs->item(i,2)->setText(details[CODEC_NAME]); + tableWidget_Codecs->setItem(i,2,new QTableWidgetItem(details[CODEC_SAMPLE_RATE])); + tableWidget_Codecs->setItem(i,3,new QTableWidgetItem(details[CODEC_BIT_RATE])); + tableWidget_Codecs->setItem(i,4,new QTableWidgetItem(details[CODEC_BANDWIDTH])); + tableWidget_Codecs->item(i,0)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + tableWidget_Codecs->item(i,0)->setCheckState(activeCodecList.contains(codecList[i]) ? Qt::Checked : Qt::Unchecked); + tableWidget_Codecs->item(i,1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_Codecs->item(i,2)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_Codecs->item(i,3)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_Codecs->item(i,4)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + (*codecPayloads)[details[CODEC_NAME]] = payloadStr; + qDebug() << "Added to codecs : " << payloadStr << " , " << details[CODEC_NAME]; + } + } + tableWidget_Codecs->resizeColumnsToContents(); + tableWidget_Codecs->resizeRowsToContents(); +} + + +void ConfigurationDialog::saveCodecs() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList activeCodecs; + for(int i = 0 ; i < tableWidget_Codecs->rowCount() ; i++) + { + //qDebug() << "Checked if active : " << tableWidget_Codecs->item(i,1)->text(); + if(tableWidget_Codecs->item(i,0)->checkState() == Qt::Checked) + { + //qDebug() << "Added to activeCodecs : " << tableWidget_Codecs->item(i,1)->text(); + activeCodecs << (*codecPayloads)[tableWidget_Codecs->item(i,1)->text()]; + } + } + qDebug() << "Calling setActiveCodecList with list : " << activeCodecs ; + daemon.setActiveCodecList(activeCodecs); +} + +void ConfigurationDialog::setPage(int page) +{ + stackedWidgetOptions->setCurrentIndex(page); + listOptions->setCurrentRow(page); +} + +void ConfigurationDialog::on_edit1_Alias_textChanged(const QString & text) +{ + listWidgetComptes->currentItem()->setText(text); +} + + +void ConfigurationDialog::on_listWidgetComptes_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) +{ + if(previous) + saveAccount(previous); + if(current) + loadAccount(current); +} + +void ConfigurationDialog::on_spinBox_PortSIP_valueChanged ( int value ) +{ + if(value>1024 && value<65536) + label_WarningSIP->setVisible(false); + else + label_WarningSIP->setVisible(true); +} + + + +void ConfigurationDialog::on_buttonNouveauCompte_clicked() +{ + QString itemName = QInputDialog::getText(this, "Item", "Enter new item"); + itemName = itemName.simplified(); + if (!itemName.isEmpty()) { + QListWidgetItem * item = accountList->addAccount(itemName); + //TODO verifier que addItem set bien le parent + listWidgetComptes->addItem(item); + int r = listWidgetComptes->count() - 1; + listWidgetComptes->setCurrentRow(r); + frame2_EditComptes->setEnabled(true); + } +} + +void ConfigurationDialog::on_buttonSupprimerCompte_clicked() +{ + int r = listWidgetComptes->currentRow(); + QListWidgetItem * item = listWidgetComptes->takeItem(r); + accountList->removeAccount(item); + listWidgetComptes->setCurrentRow( (r >= listWidgetComptes->count()) ? r-1 : r ); +} + + +void ConfigurationDialog::on_buttonBoxDialog_clicked(QAbstractButton * button) +{ + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Apply) + { + this->saveOptions(); + this->loadOptions(); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::RestoreDefaults) + { + this->loadOptions(); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Ok) + { + this->saveOptions(); + this->setVisible(false); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Cancel) + { + this->setVisible(false); + } +} + +/* +void ConfigurationDialog::on_listWidgetComptes_itemChanged(QListWidgetItem * item) +{ + if(! item) { qDebug() << "Attempting to save details of an account from a NULL item\n"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account) { qDebug() << "Attempting to save details of an unexisting account\n"; return; } + + if(item->checkState() != account->getAccountState) + + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Apply) + { + this->saveOptions(); + this->loadOptions(); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::RestoreDefaults) + { + this->loadOptions(); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Ok) + { + this->saveOptions(); + this->setVisible(false); + } + if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Cancel) + { + this->setVisible(false); + } +} +*/ \ No newline at end of file diff --git a/sflphone_kde/ConfigDialog.h b/sflphone_kde/ConfigDialog.h new file mode 100644 index 0000000000000000000000000000000000000000..014e47b7f490e8e88412bc094f4d7bc52ddaed8e --- /dev/null +++ b/sflphone_kde/ConfigDialog.h @@ -0,0 +1,53 @@ +#ifndef HEADER_CONFIGDIALOG +#define HEADER_CONFIGDIALOG + +#include <QtGui> +#include "ui_ConfigDialog.h" +#include "configurationmanager_interface_p.h" +#include "AccountList.h" +#include "SFLPhone.h" +#include <QErrorMessage> + + +class SFLPhone; + +class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog +{ + Q_OBJECT + + +private: + AccountList * accountList; + QErrorMessage * errorWindow; + MapStringString * codecPayloads; + +public: + ConfigurationDialog(SFLPhone *parent = 0); + ~ConfigurationDialog(); + + void loadAccount(QListWidgetItem * item); + void saveAccount(QListWidgetItem * item); + + void loadAccountList(); + void saveAccountList(); + + void loadCodecs(); + void saveCodecs(); + + void loadOptions(); + void saveOptions(); + + void setPage(int page); + +private slots: + void on_buttonSupprimerCompte_clicked(); + void on_buttonNouveauCompte_clicked(); + void on_edit1_Alias_textChanged(const QString & text); + void on_listWidgetComptes_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); + void on_spinBox_PortSIP_valueChanged ( int value ); + void on_buttonBoxDialog_clicked(QAbstractButton * button); +}; + + + +#endif diff --git a/sflphone_kde/ConfigDialog.ui b/sflphone_kde/ConfigDialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..da527cc5284387d7ec99b5ea4c2dfde53a1f7357 --- /dev/null +++ b/sflphone_kde/ConfigDialog.ui @@ -0,0 +1,1206 @@ +<ui version="4.0" > + <author>Jérémy Quentin</author> + <class>ConfigurationDialog</class> + <widget class="QDialog" name="ConfigurationDialog" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>504</width> + <height>432</height> + </rect> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <property name="margin" > + <number>1</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayoutDialog" > + <property name="sizeConstraint" > + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QListWidget" name="listOptions" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>300</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>100</width> + <height>16777215</height> + </size> + </property> + <property name="sizeIncrement" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="mouseTracking" > + <bool>false</bool> + </property> + <property name="contextMenuPolicy" > + <enum>Qt::DefaultContextMenu</enum> + </property> + <property name="acceptDrops" > + <bool>false</bool> + </property> + <property name="layoutDirection" > + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground" > + <bool>true</bool> + </property> + <property name="autoScrollMargin" > + <number>16</number> + </property> + <property name="editTriggers" > + <set>QAbstractItemView::AllEditTriggers</set> + </property> + <property name="dragEnabled" > + <bool>true</bool> + </property> + <property name="iconSize" > + <size> + <width>200</width> + <height>200</height> + </size> + </property> + <property name="textElideMode" > + <enum>Qt::ElideMiddle</enum> + </property> + <property name="verticalScrollMode" > + <enum>QAbstractItemView::ScrollPerItem</enum> + </property> + <property name="horizontalScrollMode" > + <enum>QAbstractItemView::ScrollPerItem</enum> + </property> + <property name="movement" > + <enum>QListView::Static</enum> + </property> + <property name="flow" > + <enum>QListView::TopToBottom</enum> + </property> + <property name="resizeMode" > + <enum>QListView::Adjust</enum> + </property> + <property name="layoutMode" > + <enum>QListView::SinglePass</enum> + </property> + <property name="viewMode" > + <enum>QListView::IconMode</enum> + </property> + <property name="modelColumn" > + <number>0</number> + </property> + <property name="uniformItemSizes" > + <bool>false</bool> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="sortingEnabled" > + <bool>false</bool> + </property> + <item> + <property name="text" > + <string>Général</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset> + </property> + </item> + <item> + <property name="text" > + <string>Affichage</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset> + </property> + </item> + <item> + <property name="text" > + <string>Comptes</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/stock_person.svg</normaloff>:/Images/stock_person.svg</iconset> + </property> + </item> + <item> + <property name="text" > + <string>Audio</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/icon_volume_off.svg</normaloff>:/Images/icon_volume_off.svg</iconset> + </property> + </item> + </widget> + </item> + <item> + <widget class="Line" name="lineOptions" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidgetOptions" > + <property name="currentIndex" > + <number>1</number> + </property> + <widget class="QWidget" name="page_General" > + <layout class="QVBoxLayout" name="verticalLayout_18" > + <property name="leftMargin" > + <number>4</number> + </property> + <item> + <widget class="QLabel" name="label_ConfGeneral" > + <property name="text" > + <string>Configuration des paramètres généraux</string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line_ConfGeneral" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox1_Historique" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Historique des appels</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_19" > + <item> + <widget class="QWidget" native="1" name="widget_CapaciteHist" > + <layout class="QHBoxLayout" name="horizontalLayout_10" > + <item> + <widget class="QLabel" name="label_Capacite" > + <property name="text" > + <string>&Capacité</string> + </property> + <property name="buddy" > + <cstring>horizontalSlider_Capacity</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="horizontalSlider_Capacity" > + <property name="maximum" > + <number>100</number> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_CapaciteHist" /> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButtonEffacerHist" > + <property name="text" > + <string>&Effacer l'Historique</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox2_Connexion" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Connexion</string> + </property> + <layout class="QFormLayout" name="formLayout_12" > + <property name="fieldGrowthPolicy" > + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0" > + <widget class="QLabel" name="label_PortSIP" > + <property name="text" > + <string>Port SIP</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QWidget" native="1" name="widget" > + <property name="minimumSize" > + <size> + <width>50</width> + <height>0</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QSpinBox" name="spinBox_PortSIP" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum" > + <number>1025</number> + </property> + <property name="maximum" > + <number>65536</number> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_WarningSIP" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>Attention </string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget_RemplissageConfGeneral" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_Affichage" > + <layout class="QVBoxLayout" name="verticalLayout_9" > + <item> + <widget class="QLabel" name="label_ConfAffichage" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Configuration de l'affichage</string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line_ConfAffichage" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QFrame" name="frameAffichage" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8" > + <item> + <widget class="QLabel" name="label1_Notifications" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Activer les notifications du bureau</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget1_Notifications" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5" > + <item> + <widget class="QCheckBox" name="checkBox1_NotifAppels" > + <property name="text" > + <string>&Appels entrants</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox2_NotifMessages" > + <property name="text" > + <string>&Messages vocaux</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QLabel" name="label2_FenetrePrincipale" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Faire apparaître la fenêtre principale</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget_FenetrePrincipale" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6" > + <item> + <widget class="QCheckBox" name="checkBox1_FenDemarrage" > + <property name="text" > + <string>Au &démarrage</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox2_FenAppel" > + <property name="text" > + <string>Lors d'un appel &entrant</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget_5" /> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_Comptes" > + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QLabel" name="label_ConfComptes" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Configuration des comptes utilisateur</string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line_ConfComptes" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget1_ConfComptes" > + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="QFrame" name="frame1_ListeComptes" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6" > + <item> + <widget class="QListWidget" name="listWidgetComptes" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBoxGestionComptes" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="layoutDirection" > + <enum>Qt::RightToLeft</enum> + </property> + <property name="title" > + <string/> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <property name="spacing" > + <number>0</number> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="buttonSupprimerCompte" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string/> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/hang_up.svg</normaloff>:/Images/hang_up.svg</iconset> + </property> + <property name="shortcut" > + <string>+</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonNouveauCompte" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="sizeIncrement" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/accept.svg</normaloff>:/Images/accept.svg</iconset> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame2_EditComptes" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Raised</enum> + </property> + <layout class="QFormLayout" name="formLayout_2" > + <property name="fieldGrowthPolicy" > + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0" > + <widget class="QLabel" name="label1_Alias" > + <property name="text" > + <string>&Alias</string> + </property> + <property name="buddy" > + <cstring>edit1_Alias</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="edit1_Alias" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label2_Protocole" > + <property name="text" > + <string>&Protocole</string> + </property> + <property name="buddy" > + <cstring>edit2_Protocole</cstring> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label3_Serveur" > + <property name="text" > + <string>&Serveur</string> + </property> + <property name="buddy" > + <cstring>edit3_Serveur</cstring> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label4_Usager" > + <property name="text" > + <string>&Usager</string> + </property> + <property name="buddy" > + <cstring>edit4_Usager</cstring> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label5_Mdp" > + <property name="text" > + <string>&Mot de Passe</string> + </property> + <property name="buddy" > + <cstring>edit5_Mdp</cstring> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label6_BoiteVocale" > + <property name="text" > + <string>&Boîte Vocale</string> + </property> + <property name="buddy" > + <cstring>edit6_BoiteVocale</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QLineEdit" name="edit3_Serveur" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QLineEdit" name="edit4_Usager" /> + </item> + <item row="4" column="1" > + <widget class="QLineEdit" name="edit5_Mdp" > + <property name="echoMode" > + <enum>QLineEdit::Password</enum> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QLineEdit" name="edit6_BoiteVocale" /> + </item> + <item row="1" column="1" > + <widget class="QComboBox" name="edit2_Protocole" > + <item> + <property name="text" > + <string>SIP</string> + </property> + </item> + <item> + <property name="text" > + <string>IAX</string> + </property> + </item> + </widget> + </item> + <item row="6" column="1" > + <widget class="QLabel" name="edit7_Etat" > + <property name="text" > + <string/> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="label7_Etat" > + <property name="text" > + <string>État </string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_ConfComptesCommuns" > + <property name="title" > + <string/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_10" > + <item> + <widget class="QLabel" name="label_ConfComptesCommus" > + <property name="text" > + <string>Les paramètres STUN seront appliqués à tous les comptes</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayoutConfComptesCommus" > + <property name="fieldGrowthPolicy" > + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0" > + <widget class="QCheckBox" name="checkBoxStun" > + <property name="text" > + <string>Activer Stun</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="lineEdit_Stun" > + <property name="enabled" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_Audio" > + <layout class="QVBoxLayout" name="verticalLayout_5" > + <item> + <widget class="QLabel" name="label_ConfAudio" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Configuration des paramètres audio</string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line_ConfAudio" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox1_Audio" > + <property name="title" > + <string/> + </property> + <layout class="QFormLayout" name="formLayout_3" > + <item row="0" column="0" > + <widget class="QLabel" name="label_Interface" > + <property name="text" > + <string>&Interface audio</string> + </property> + <property name="buddy" > + <cstring>comboBox_Interface</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QComboBox" name="comboBox_Interface" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <item> + <property name="text" > + <string>ALSA</string> + </property> + </item> + <item> + <property name="text" > + <string>PulseAudio</string> + </property> + </item> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="checkBox_Sonneries" > + <property name="text" > + <string>&Activer les sonneries</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox2_Codecs" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>&Codecs</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="2" > + <layout class="QVBoxLayout" name="verticalLayout_OrdreCodecs" > + <property name="leftMargin" > + <number>0</number> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="toolButton_MonterCodec" > + <property name="text" > + <string>...</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_DescendreCodec" > + <property name="text" > + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="0" column="0" > + <widget class="QTableWidget" name="tableWidget_Codecs" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Sunken</enum> + </property> + <property name="verticalScrollBarPolicy" > + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="textElideMode" > + <enum>Qt::ElideRight</enum> + </property> + <property name="verticalScrollMode" > + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="horizontalScrollMode" > + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <column> + <property name="text" > + <string>Actif</string> + </property> + </column> + <column> + <property name="text" > + <string>Nom</string> + </property> + </column> + <column> + <property name="text" > + <string>Fréquence</string> + </property> + </column> + <column> + <property name="text" > + <string>Bitrate</string> + </property> + </column> + <column> + <property name="text" > + <string>Bande Passante</string> + </property> + </column> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidget_ParametresSpecif" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex" > + <number>1</number> + </property> + <widget class="QWidget" name="page1_Alsa" > + <layout class="QVBoxLayout" name="verticalLayout_20" > + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox_Alsa" > + <property name="title" > + <string>Paramètres ALSA</string> + </property> + <layout class="QFormLayout" name="formLayout_4" > + <item row="2" column="1" > + <widget class="QComboBox" name="comboBox2_Entree" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label2_Entree" > + <property name="text" > + <string>&Entrée</string> + </property> + <property name="buddy" > + <cstring>comboBox2_Entree</cstring> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label3_Sortie" > + <property name="text" > + <string>&Sortie</string> + </property> + <property name="buddy" > + <cstring>comboBox3_Sortie</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QComboBox" name="comboBox3_Sortie" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="QLabel" name="label1_GreffonAlsa" > + <property name="text" > + <string>&Greffon ALSA</string> + </property> + <property name="buddy" > + <cstring>comboBox1_GreffonAlsa</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QComboBox" name="comboBox1_GreffonAlsa" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>0</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page2_PulseAudio" > + <layout class="QVBoxLayout" name="verticalLayout_7" > + <item> + <widget class="QGroupBox" name="groupBox_PulseAudio" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Paramètres PulseAudio</string> + </property> + <layout class="QFormLayout" name="formLayout_11" > + <property name="fieldGrowthPolicy" > + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0" > + <widget class="QCheckBox" name="checkBox_ModifVolumeApps" > + <property name="text" > + <string>Autoriser à &modifier le volume des autres applications</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="KButtonGroup" name="kbuttongroup" /> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </item> + <item> + <widget class="Line" name="lineDialog" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBoxDialog" > + <property name="layoutDirection" > + <enum>Qt::LeftToRight</enum> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set> + </property> + <property name="centerButtons" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + <layoutdefault spacing="4" margin="4" /> + <customwidgets> + <customwidget> + <class>KButtonGroup</class> + <extends>QGroupBox</extends> + <header>kbuttongroup.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources> + <include location="../../sflphone-qt/resources.qrc" /> + </resources> + <connections> + <connection> + <sender>buttonBoxDialog</sender> + <signal>rejected()</signal> + <receiver>ConfigurationDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>300</x> + <y>430</y> + </hint> + <hint type="destinationlabel" > + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>listOptions</sender> + <signal>currentRowChanged(int)</signal> + <receiver>stackedWidgetOptions</receiver> + <slot>setCurrentIndex(int)</slot> + <hints> + <hint type="sourcelabel" > + <x>73</x> + <y>92</y> + </hint> + <hint type="destinationlabel" > + <x>191</x> + <y>82</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkBoxStun</sender> + <signal>toggled(bool)</signal> + <receiver>lineEdit_Stun</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>228</x> + <y>374</y> + </hint> + <hint type="destinationlabel" > + <x>431</x> + <y>378</y> + </hint> + </hints> + </connection> + <connection> + <sender>comboBox_Interface</sender> + <signal>currentIndexChanged(int)</signal> + <receiver>stackedWidget_ParametresSpecif</receiver> + <slot>setCurrentIndex(int)</slot> + <hints> + <hint type="sourcelabel" > + <x>488</x> + <y>64</y> + </hint> + <hint type="destinationlabel" > + <x>325</x> + <y>286</y> + </hint> + </hints> + </connection> + <connection> + <sender>horizontalSlider_Capacity</sender> + <signal>valueChanged(int)</signal> + <receiver>spinBox_CapaciteHist</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel" > + <x>352</x> + <y>89</y> + </hint> + <hint type="destinationlabel" > + <x>484</x> + <y>88</y> + </hint> + </hints> + </connection> + <connection> + <sender>spinBox_CapaciteHist</sender> + <signal>valueChanged(int)</signal> + <receiver>horizontalSlider_Capacity</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel" > + <x>484</x> + <y>88</y> + </hint> + <hint type="destinationlabel" > + <x>352</x> + <y>89</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone_kde/Doxyfile b/sflphone_kde/Doxyfile new file mode 100644 index 0000000000000000000000000000000000000000..63d681f6f7f03c3c96a6ec7437e1f5e0954a8f93 --- /dev/null +++ b/sflphone_kde/Doxyfile @@ -0,0 +1,316 @@ +# Doxyfile 1.5.6-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = sflphone_kde +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/jquentin/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/jquentin/sflphone_kde +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY \ + *.F90 \ + *.F \ + *.VHD \ + *.VHDL \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +HTML_DYNAMIC_SECTIONS = NO +CHM_FILE = +HHC_LOCATION = +QTHELP_FILE = +QTHELP_CONFIG = +DOXYGEN2QTHELP_LOC = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NONE +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = sflphone_kde.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_FONTNAME = FreeSans +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = YES +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/sflphone_kde/README b/sflphone_kde/README new file mode 100644 index 0000000000000000000000000000000000000000..a5f3a30788f36e571a14ffba50c84111984cb6e0 --- /dev/null +++ b/sflphone_kde/README @@ -0,0 +1,15 @@ +!!!!!ATTENTION!!!!! + +Before starting the build you may need to setup the KDE4 environment variables. +To do this open Project->Project Options and then look at the "Run" and the "Make" +pages. Each of these two has an environment variables widget in which you have +to fill in the right values for the variables already listed. + +After setting up the variables you'll also need to run cmake inside the build +directory. This can not be done by kdevelop as a KDE4 environment is needed +when running cmake to find KDE4. Open the integrated konsole and change to the build +subdirectory. Then setup a KDE4 environment and run "cmake ../". + +More information how to setup a KDE4 development environment can be found on +http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts + diff --git a/sflphone_kde/SFLPhone.cpp b/sflphone_kde/SFLPhone.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ada3a78cf35580ce2855ba50b19d2e9d1cdbbf2 --- /dev/null +++ b/sflphone_kde/SFLPhone.cpp @@ -0,0 +1,179 @@ +#include "SFLPhone.h" +#include "sflphone_const.h" +#include "configurationmanager_interface_singleton.h" +#include "callmanager_interface_singleton.h" +#include <stdlib.h> + +SFLPhone::SFLPhone(QMainWindow *parent) : QMainWindow(parent),callIdCpt(0) +{ + setupUi(this); + + configDialog = new ConfigurationDialog(this); + configDialog->setModal(true); + + loadWindow(); + +} + +SFLPhone::~SFLPhone() +{ + delete configDialog; +} + +void SFLPhone::loadWindow() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + actionAfficher_les_barres_de_volume->setChecked(daemon.getVolumeControls()); + actionAfficher_le_clavier->setChecked(daemon.getDialpad()); +} + +void SFLPhone::on_actionAfficher_les_barres_de_volume_toggled() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + daemon.setVolumeControls(); +} + +void SFLPhone::on_actionAfficher_le_clavier_toggled() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + daemon.setDialpad(); +} + + +void SFLPhone::typeChar(QChar c) +{ + QListWidgetItem * item = listWidget_callList->currentItem(); + if(!item) + { + listWidget_callList->addItem(QString(c)); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + } + else + { + listWidget_callList->currentItem()->setText(listWidget_callList->currentItem()->text() + c); + } +} + + + +void SFLPhone::on_pushButton_1_clicked(){ typeChar('1'); } +void SFLPhone::on_pushButton_2_clicked(){ typeChar('2'); } +void SFLPhone::on_pushButton_3_clicked(){ typeChar('3'); } +void SFLPhone::on_pushButton_4_clicked(){ typeChar('4'); } +void SFLPhone::on_pushButton_5_clicked(){ typeChar('5'); } +void SFLPhone::on_pushButton_6_clicked(){ typeChar('6'); } +void SFLPhone::on_pushButton_7_clicked(){ typeChar('7'); } +void SFLPhone::on_pushButton_8_clicked(){ typeChar('8'); } +void SFLPhone::on_pushButton_9_clicked(){ typeChar('9'); } +void SFLPhone::on_pushButton_0_clicked(){ typeChar('0'); } +void SFLPhone::on_pushButton_diese_clicked(){ typeChar('#'); } +void SFLPhone::on_pushButton_etoile_clicked(){ typeChar('*'); } + + +void SFLPhone::on_actionConfigurer_les_comptes_triggered() +{ + configDialog->loadOptions(); + configDialog->setPage(PAGE_ACCOUNTS); + configDialog->show(); +} + +void SFLPhone::on_actionConfigurer_le_son_triggered() +{ + configDialog->loadOptions(); + configDialog->setPage(PAGE_AUDIO); + configDialog->show(); +} + +void SFLPhone::on_actionConfigurer_SFLPhone_triggered() +{ + configDialog->loadOptions(); + configDialog->setPage(PAGE_GENERAL); + configDialog->show(); +} + +void SFLPhone::on_actionDecrocher_triggered() +{ + CallManagerInterface & daemon = CallManagerInterfaceSingleton::getInstance(); + QListWidgetItem * item = listWidget_callList->currentItem(); + if(!item) + { + qDebug() << "Calling when no item is selected. Opening an item."; + listWidget_callList->addItem(QString("")); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + } + else + { + qDebug() << "Calling " << item->text() << " with account " << firstAccount() << ". callId : " << QString::number(callIdCpt); + daemon.placeCall(firstAccount(), getCallId(), item->text()); + } +} + +void SFLPhone::on_actionRaccrocher_triggered() +{ + CallManagerInterface & daemon = CallManagerInterfaceSingleton::getInstance(); + QListWidgetItem * item = listWidget_callList->currentItem(); + if(!item) + { + qDebug() << "Hanging up when no item selected. Should not happen."; + } + else + { + Call * call = callList[item]; + if(!call) return; + if(call->getState() == INCOMING) + { + qDebug() << "Refusing call from " << item->text() << " with account " << firstAccount() << ". callId : " << QString::number(callIdCpt); + daemon.refuse(getCallId()); + } + else + { + qDebug() << "Hanging up with " << item->text() << " with account " << firstAccount() << ". callId : " << QString::number(callIdCpt); + daemon.hangUp(getCallId()); + } + } +} + +void SFLPhone::on_actionMettre_en_attente_triggered() +{ + +} + +void SFLPhone::on_actionTransferer_triggered() +{ + +} + +void SFLPhone::on_actionHistorique_triggered() +{ + +} + +void SFLPhone::on_actionBoite_vocale_triggered() +{ + +} + +void SFLPhone::on_actionAbout() +{ + +} + +QString SFLPhone::firstAccount() +{ + ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + //ask for the list of accounts ids to the daemon + QStringList accountIds = daemon.getAccountList().value(); + for (int i = 0; i < accountIds.size(); ++i){ + MapStringString accountDetails = daemon.getAccountDetails(accountIds[i]); + if(accountDetails[QString(ACCOUNT_STATUS)] == QString(ACCOUNT_STATE_REGISTERED)) + { + return accountIds[i]; + } + } + return ""; +} + +QString getCallId() +{ + return QString::number(callIdCpt++); +} diff --git a/sflphone_kde/SFLPhone.h b/sflphone_kde/SFLPhone.h new file mode 100644 index 0000000000000000000000000000000000000000..a1a3796774fc4afd24d71c6f4f80a79b29c72e03 --- /dev/null +++ b/sflphone_kde/SFLPhone.h @@ -0,0 +1,63 @@ +#ifndef HEADER_SFLPHONE +#define HEADER_SFLPHONE + +#include <QtGui> +#include "ui_sflphone-qt.h" +#include "ConfigDialog.h" + + +class ConfigurationDialog; + +class SFLPhone : public QMainWindow, private Ui::SFLPhone +{ + +Q_OBJECT + +private: + ConfigurationDialog * configDialog; + int callIdCpt; + bool receivingCall; + +public: + SFLPhone(QMainWindow *parent = 0); + ~SFLPhone(); + void loadWindow(); + QAbstractButton * getDialpadButton(int ind); + QString firstAccount(); + + +private slots: + void typeChar(QChar c); + + void on_actionAfficher_les_barres_de_volume_toggled(); + void on_actionAfficher_le_clavier_toggled(); + void on_actionConfigurer_les_comptes_triggered(); + void on_actionConfigurer_le_son_triggered(); + void on_actionConfigurer_SFLPhone_triggered(); + void on_actionDecrocher_triggered(); + void on_actionRaccrocher_triggered(); + void on_actionMettre_en_attente_triggered(); + void on_actionTransferer_triggered(); + void on_actionHistorique_triggered(); + void on_actionBoite_vocale_triggered(); + void on_actionAbout(); + + + void on_pushButton_1_clicked(); + void on_pushButton_2_clicked(); + void on_pushButton_3_clicked(); + void on_pushButton_4_clicked(); + void on_pushButton_5_clicked(); + void on_pushButton_6_clicked(); + void on_pushButton_7_clicked(); + void on_pushButton_8_clicked(); + void on_pushButton_9_clicked(); + void on_pushButton_0_clicked(); + void on_pushButton_diese_clicked(); + void on_pushButton_etoile_clicked(); + +}; + + +#endif + diff --git a/sflphone_kde/callmanager-introspec.xml b/sflphone_kde/callmanager-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..82e1a36b4e44888267096d1a97e2572bed734969 --- /dev/null +++ b/sflphone_kde/callmanager-introspec.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.CallManager"> + + <!-- ///////////////////////////// --> + <!-- Methods --> + <!-- ///////////////////////////// --> + + <method name="placeCall"> + <arg type="s" name="accountID" direction="in"/> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="to" direction="in"/> + </method> + + <method name="refuse"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="accept"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="hangUp"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="hold"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="unhold"> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="transfert"> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="to" direction="in"/> + </method> + + <method name="playDTMF"> + <arg type="s" name="key" direction="in"/> + </method> + + <method name="startTone"> + <arg type="i" name="start" direction="in"/> + <arg type="i" name="type" direction="in"/> + </method> + + <method name="setVolume"> + <arg type="s" name="device" direction="in"/> + <arg type="d" name="value" direction="in"/> + </method> + + <method name="getVolume"> + <arg type="s" name="device" direction="in"/> + <arg type="d" name="value" direction="out"/> + </method> + + <method name="getCallDetails"> + <arg type="s" name="callID" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="infos" direction="out"/> + </method> + + <method name="getCurrentCallID"> + <arg type="s" name="callID" direction="out"/> + </method> + + <!-- ///////////////////////////// --> + <!-- Signals --> + <!-- ///////////////////////////// --> + + <signal name="incomingCall"> + <arg type="s" name="accountID" /> + <arg type="s" name="callID" /> + <arg type="s" name="from" /> + </signal> + + <signal name="incomingMessage"> + <arg type="s" name="accountID" direction="out" /> + <arg type="s" name="message" direction="out"/> + </signal> + + <signal name="callStateChanged"> + <arg type="s" name="callID" direction="out"/> + <arg type="s" name="state" direction="out"/> + </signal> + + <signal name="voiceMailNotify"> + <arg type="s" name="accountID" direction="out"/> + <arg type="i" name="count" direction="out"/> + </signal> + + + <signal name="volumeChanged"> + <arg type="s" name="device" direction="out"/> + <arg type="d" name="value" direction="out"/> + </signal> + + <signal name="error"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </signal> + </interface> +</node> diff --git a/sflphone_kde/callmanager_interface.cpp b/sflphone_kde/callmanager_interface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22eb57bcbdeab4d6e7d17976acdba94188155332 --- /dev/null +++ b/sflphone_kde/callmanager_interface.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c CallManagerInterface -p call_manager_interface_p.h:call_manager_interface.cpp -i metatypes.h callmanager-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "callmanager_interface_p.h" + +/* + * Implementation of interface class CallManagerInterface + */ + +CallManagerInterface::CallManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +CallManagerInterface::~CallManagerInterface() +{ +} + diff --git a/sflphone_kde/callmanager_interface_p.h b/sflphone_kde/callmanager_interface_p.h new file mode 100644 index 0000000000000000000000000000000000000000..890b62968b9ac3da45a2e2f9be03b5d99e7d0561 --- /dev/null +++ b/sflphone_kde/callmanager_interface_p.h @@ -0,0 +1,146 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c CallManagerInterface -p call_manager_interface_p.h:call_manager_interface.cpp -i metatypes.h callmanager-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef CALL_MANAGER_INTERFACE_P_H_1236370787 +#define CALL_MANAGER_INTERFACE_P_H_1236370787 + +#include <QtCore/QObject> +#include <QtCore/QByteArray> +#include <QtCore/QList> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QVariant> +#include <QtDBus/QtDBus> +#include "metatypes.h" + +/* + * Proxy class for interface org.sflphone.SFLphone.CallManager + */ +class CallManagerInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.sflphone.SFLphone.CallManager"; } + +public: + CallManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~CallManagerInterface(); + +public Q_SLOTS: // METHODS + inline QDBusReply<void> accept(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("accept"), argumentList); + } + + inline QDBusReply<MapStringString> getCallDetails(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("getCallDetails"), argumentList); + } + + inline QDBusReply<QString> getCurrentCallID() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getCurrentCallID"), argumentList); + } + + inline QDBusReply<double> getVolume(const QString &device) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(device); + return callWithArgumentList(QDBus::Block, QLatin1String("getVolume"), argumentList); + } + + inline QDBusReply<void> hangUp(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("hangUp"), argumentList); + } + + inline QDBusReply<void> hold(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("hold"), argumentList); + } + + inline QDBusReply<void> placeCall(const QString &accountID, const QString &callID, const QString &to) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(accountID) << qVariantFromValue(callID) << qVariantFromValue(to); + return callWithArgumentList(QDBus::Block, QLatin1String("placeCall"), argumentList); + } + + inline QDBusReply<void> playDTMF(const QString &key) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(key); + return callWithArgumentList(QDBus::Block, QLatin1String("playDTMF"), argumentList); + } + + inline QDBusReply<void> refuse(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("refuse"), argumentList); + } + + inline QDBusReply<void> setVolume(const QString &device, double value) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(device) << qVariantFromValue(value); + return callWithArgumentList(QDBus::Block, QLatin1String("setVolume"), argumentList); + } + + inline QDBusReply<void> startTone(int start, int type) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(start) << qVariantFromValue(type); + return callWithArgumentList(QDBus::Block, QLatin1String("startTone"), argumentList); + } + + inline QDBusReply<void> transfert(const QString &callID, const QString &to) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID) << qVariantFromValue(to); + return callWithArgumentList(QDBus::Block, QLatin1String("transfert"), argumentList); + } + + inline QDBusReply<void> unhold(const QString &callID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(callID); + return callWithArgumentList(QDBus::Block, QLatin1String("unhold"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void callStateChanged(const QString &callID, const QString &state); + void error(MapStringString details); + void incomingCall(const QString &accountID, const QString &callID, const QString &from); + void incomingMessage(const QString &accountID, const QString &message); + void voiceMailNotify(const QString &accountID, int count); + void volumeChanged(const QString &device, double value); +}; + +namespace org { + namespace sflphone { + namespace SFLphone { + typedef ::CallManagerInterface CallManager; + } + } +} +#endif diff --git a/sflphone_kde/callmanager_interface_singleton.cpp b/sflphone_kde/callmanager_interface_singleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d204919f9d275f0582b980612fa30960d60b63a --- /dev/null +++ b/sflphone_kde/callmanager_interface_singleton.cpp @@ -0,0 +1,14 @@ +#include "callmanager_interface_singleton.h" + + +CallManagerInterface * CallManagerInterfaceSingleton::daemon = new CallManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", QDBusConnection::sessionBus()); + + +CallManagerInterface & CallManagerInterfaceSingleton::getInstance(){ + if(!daemon){ + daemon = new CallManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", QDBusConnection::sessionBus()); + } + if(!daemon->isValid()) + throw "Error : sflphoned not connected"; + return *daemon; +} diff --git a/sflphone_kde/callmanager_interface_singleton.h b/sflphone_kde/callmanager_interface_singleton.h new file mode 100644 index 0000000000000000000000000000000000000000..e4759b7e21b16127961506720dddf499b0efda72 --- /dev/null +++ b/sflphone_kde/callmanager_interface_singleton.h @@ -0,0 +1,20 @@ +#ifndef CALL_MANAGER_INTERFACE_SINGLETON_H +#define CALL_MANAGER_INTERFACE_SINGLETON_H + +#include "callmanager_interface_p.h" + +class CallManagerInterfaceSingleton +{ + +private: + + static CallManagerInterface * daemon; + +public: + + //TODO verifier pointeur ou pas pour singleton en c++ + static CallManagerInterface & getInstance(); + +}; + +#endif \ No newline at end of file diff --git a/sflphone_kde/config_en.ts b/sflphone_kde/config_en.ts new file mode 100644 index 0000000000000000000000000000000000000000..1819343595da581d5dc8ec7676a5c24e7422a7dd --- /dev/null +++ b/sflphone_kde/config_en.ts @@ -0,0 +1,181 @@ +<!DOCTYPE TS><TS> +<context> + <name>ConfigurationDialog</name> + <message> + <source>Dialog</source> + <translation>Dialog</translation> + </message> + <message encoding="UTF-8"> + <source>Général</source> + <translation>General</translation> + </message> + <message> + <source>Affichage</source> + <translation>Display</translation> + </message> + <message> + <source>Comptes</source> + <translation>Accounts</translation> + </message> + <message> + <source>Audio</source> + <translation>Audio</translation> + </message> + <message encoding="UTF-8"> + <source>Configuration des paramètres généraux</source> + <translation>General settings</translation> + </message> + <message> + <source>Historique des appels</source> + <translation>Call history</translation> + </message> + <message encoding="UTF-8"> + <source>&Capacité</source> + <translation>&Capacity</translation> + </message> + <message> + <source>&Effacer l'Historique</source> + <translation>&Clean history</translation> + </message> + <message> + <source>Connexion</source> + <translation>Connection</translation> + </message> + <message> + <source>Port SIP</source> + <translation>SIP port</translation> + </message> + <message> + <source>Configuration de l'affichage</source> + <translation>Display settings</translation> + </message> + <message> + <source>Activer les notifications du bureau</source> + <translation>Enable desktop notifications</translation> + </message> + <message> + <source>&Appels entrants</source> + <translation>Calls</translation> + </message> + <message> + <source>&Messages vocaux</source> + <translation>Vocal messages</translation> + </message> + <message encoding="UTF-8"> + <source>Faire apparaître la fenêtre principale</source> + <translation>Show the main window</translation> + </message> + <message encoding="UTF-8"> + <source>Au &démarrage</source> + <translation>At &start</translation> + </message> + <message> + <source>Lors d'un appel &entrant</source> + <translation>When &receiving a call</translation> + </message> + <message> + <source>Configuration des comptes utilisateur</source> + <translation>Acounts settings</translation> + </message> + <message> + <source>+</source> + <translation>+</translation> + </message> + <message> + <source>...</source> + <translation>...</translation> + </message> + <message> + <source>&Alias</source> + <translation>&Alias</translation> + </message> + <message> + <source>&Protocole</source> + <translation>&Protocole</translation> + </message> + <message> + <source>&Serveur</source> + <translation>&Server</translation> + </message> + <message> + <source>&Usager</source> + <translation>&User</translation> + </message> + <message> + <source>&Mot de Passe</source> + <translation>Pass&Word</translation> + </message> + <message encoding="UTF-8"> + <source>&Boîte Vocale</source> + <translation>&Voicemail</translation> + </message> + <message> + <source>SIP</source> + <translation>SIP</translation> + </message> + <message> + <source>IAX</source> + <translation>IAX</translation> + </message> + <message encoding="UTF-8"> + <source>Les paramètres STUN seront appliqués à tous les comptes</source> + <translation>STUN settings will be applied on all accounts</translation> + </message> + <message> + <source>Activer Stun</source> + <translation>Enable STUN</translation> + </message> + <message encoding="UTF-8"> + <source>Configuration des paramètres audio</source> + <translation>Audio settings</translation> + </message> + <message> + <source>&Interface audio</source> + <translation>Audio &interface</translation> + </message> + <message> + <source>ALSA</source> + <translation>ALSA</translation> + </message> + <message> + <source>PulseAudio</source> + <translation>PulseAudio</translation> + </message> + <message> + <source>&Activer les sonneries</source> + <translation>Enable &ringtones</translation> + </message> + <message> + <source>&Codecs</source> + <translation>&Codecs</translation> + </message> + <message encoding="UTF-8"> + <source>Paramètres ALSA</source> + <translation>ALSA settings</translation> + </message> + <message encoding="UTF-8"> + <source>&Entrée</source> + <translation>&Entry</translation> + </message> + <message> + <source>&Sortie</source> + <translation>&Out</translation> + </message> + <message> + <source>&Greffon ALSA</source> + <translation>ALSA &plugin</translation> + </message> + <message encoding="UTF-8"> + <source>Paramètres PulseAudio</source> + <translation>Pulseaudio settings</translation> + </message> + <message encoding="UTF-8"> + <source>Autoriser à &modifier le volume des autres applications</source> + <translation>Allow to &modify other applications' volume</translation> + </message> + <message> + <source>PushButton</source> + <translation>PushButton</translation> + </message> +</context> +</TS> diff --git a/sflphone_kde/configurationmanager-introspec.xml b/sflphone_kde/configurationmanager-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..ffb70e963f96a4e8a132c59bce089668ab79db8a --- /dev/null +++ b/sflphone_kde/configurationmanager-introspec.xml @@ -0,0 +1,275 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.ConfigurationManager"> + + <!-- Accounts-related methods --> + <method name="getAccountDetails"> + <arg type="s" name="accountID" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </method> + + <method name="setAccountDetails"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> + <arg type="s" name="accountID" direction="in"/> + <arg type="a{ss}" name="details" direction="in"/> + </method> + + <method name="addAccount"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="in"/> + <arg type="s" name="createdAccountId" direction="out"/> + </method> + + <method name="removeAccount"> + <arg type="s" name="accoundID" direction="in"/> + </method> + + <method name="getAccountList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="sendRegister"> + <arg type="s" name="accountID" direction="in"/> + <arg type="i" name="expire" direction="in"/> + </method> + + <!-- /////////////////////// --> + + <!-- Various audio-related methods --> + + <method name="getToneLocaleList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getVersion"> + <arg type="s" name="version" direction="out"/> + </method> + + <method name="getRingtoneList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getPlaybackDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getRecordDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="isRingtoneEnabled"> + <arg type="i" name="bool" direction="out"/> + </method> + + <method name="ringtoneEnabled"> + </method> + + <method name="getRingtoneChoice"> + <arg type="s" name="tone" direction="out"/> + </method> + + <method name="setRingtoneChoice"> + <arg type="s" name="tone" direction="in"/> + </method> + + <method name="getAudioManager"> + <arg type="i" name="api" direction="out"/> + </method> + + <method name="setAudioManager"> + <arg type="i" name="api" direction="in"/> + </method> + + <!-- /////////////////////// --> + + <!-- Codecs-related methods --> + + <method name="getCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getCodecDetails"> + <arg type="i" name="payload" direction="in"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="details" direction="out"/> + </method> + + <method name="getActiveCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setActiveCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="list" direction="in"/> + </method> + + + <!-- Audio devices methods --> + + <method name="getInputAudioPluginList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getOutputAudioPluginList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setInputAudioPlugin"> + <arg type="s" name="audioPlugin" direction="in"/> + </method> + + <method name="setOutputAudioPlugin"> + <arg type="s" name="audioPlugin" direction="in"/> + </method> + + <method name="getAudioOutputDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setAudioOutputDevice"> + <arg type="i" name="index" direction="in"/> + </method> + + <method name="getAudioInputDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="setAudioInputDevice"> + <arg type="i" name="index" direction="in"/> + </method> + + <method name="getCurrentAudioDevicesIndex"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"/> + </method> + + <method name="getAudioDeviceIndex"> + <arg type="s" name="name" direction="in"/> + <arg type="i" name="index" direction="out"/> + </method> + + <method name="getCurrentAudioOutputPlugin"> + <arg type="s" name="plugin" direction="out"/> + </method> + + <!-- General Settings Panel --> + + <method name="isIax2Enabled"> + <arg type="i" name="res" direction="out"/> + </method> + + <method name="setNotify"> + </method> + + <method name="getNotify"> + <arg type="i" name="level" direction="out"/> + </method> + + <method name="setMailNotify"> + </method> + + <method name="getMailNotify"> + <arg type="i" name="level" direction="out"/> + </method> + + <method name="getDialpad"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setDialpad"> + </method> + + <method name="getSearchbar"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setSearchbar"> + </method> + + <method name="getVolumeControls"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setVolumeControls"> + </method> + + <method name="getMaxCalls"> + <arg type="i" name="calls" direction="out"/> + </method> + + <method name="setMaxCalls"> + <arg type="i" name="calls" direction="in"/> + </method> + + <method name="startHidden"> + </method> + + <method name="isStartHidden"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="popupMode"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="switchPopupMode"> + </method> + + <method name="setPulseAppVolumeControl"> + </method> + + <method name="getPulseAppVolumeControl"> + <arg type="i" name="state" direction="out"/> + </method> + + <method name="setSipPort"> + <arg type="i" name="port" direction="in"/> + </method> + + <method name="getSipPort"> + <arg type="i" name="port" direction="out"/> + </method> + + <method name="setStunServer"> + <arg type="s" name="server" direction="in"/> + </method> + + <method name="getStunServer"> + <arg type="s" name="server" direction="out"/> + </method> + + <method name="enableStun"> + </method> + + <method name="isStunEnabled"> + <arg type="i" name="state" direction="out"/> + </method> + + <!-- ///////////////////////////// --> + <signal name="parametersChanged"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"/> + </signal> + + <signal name="accountsChanged"> + </signal> + + <signal name="errorAlert"> + <arg type="i" name="code" direction="out"/> + </signal> + + </interface> +</node> diff --git a/sflphone_kde/configurationmanager_interface.cpp b/sflphone_kde/configurationmanager_interface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dd264ef315a61f5855766d15d0a04eb79eaf55af --- /dev/null +++ b/sflphone_kde/configurationmanager_interface.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c ConfigurationManagerInterface -p configurationmanager_interface_p.h:configurationmanager_interface.cpp -i metatypes.h configurationmanager-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "configurationmanager_interface_p.h" + +/* + * Implementation of interface class ConfigurationManagerInterface + */ + +ConfigurationManagerInterface::ConfigurationManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +ConfigurationManagerInterface::~ConfigurationManagerInterface() +{ +} + diff --git a/sflphone_kde/configurationmanager_interface_p.h b/sflphone_kde/configurationmanager_interface_p.h new file mode 100644 index 0000000000000000000000000000000000000000..dcab71c0fd434e74903a1b4c104ddafdc830fa54 --- /dev/null +++ b/sflphone_kde/configurationmanager_interface_p.h @@ -0,0 +1,412 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c ConfigurationManagerInterface -p configurationmanager_interface_p.h:configurationmanager_interface.cpp -i metatypes.h configurationmanager-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef CONFIGURATIONMANAGER_INTERFACE_P_H_1236371540 +#define CONFIGURATIONMANAGER_INTERFACE_P_H_1236371540 + +#include <QtCore/QObject> +#include <QtCore/QByteArray> +#include <QtCore/QList> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QVariant> +#include <QtDBus/QtDBus> +#include "metatypes.h" + +/* + * Proxy class for interface org.sflphone.SFLphone.ConfigurationManager + */ +class ConfigurationManagerInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.sflphone.SFLphone.ConfigurationManager"; } + +public: + ConfigurationManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~ConfigurationManagerInterface(); + +public Q_SLOTS: // METHODS + inline QDBusReply<QString> addAccount(MapStringString details) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(details); + return callWithArgumentList(QDBus::Block, QLatin1String("addAccount"), argumentList); + } + + inline QDBusReply<void> enableStun() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("enableStun"), argumentList); + } + + inline QDBusReply<MapStringString> getAccountDetails(const QString &accountID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(accountID); + return callWithArgumentList(QDBus::Block, QLatin1String("getAccountDetails"), argumentList); + } + + inline QDBusReply<QStringList> getAccountList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getAccountList"), argumentList); + } + + inline QDBusReply<QStringList> getActiveCodecList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getActiveCodecList"), argumentList); + } + + inline QDBusReply<int> getAudioDeviceIndex(const QString &name) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(name); + return callWithArgumentList(QDBus::Block, QLatin1String("getAudioDeviceIndex"), argumentList); + } + + inline QDBusReply<QStringList> getAudioInputDeviceList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getAudioInputDeviceList"), argumentList); + } + + inline QDBusReply<int> getAudioManager() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getAudioManager"), argumentList); + } + + inline QDBusReply<QStringList> getAudioOutputDeviceList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getAudioOutputDeviceList"), argumentList); + } + + inline QDBusReply<QStringList> getCodecDetails(int payload) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(payload); + return callWithArgumentList(QDBus::Block, QLatin1String("getCodecDetails"), argumentList); + } + + inline QDBusReply<QStringList> getCodecList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getCodecList"), argumentList); + } + + inline QDBusReply<QStringList> getCurrentAudioDevicesIndex() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getCurrentAudioDevicesIndex"), argumentList); + } + + inline QDBusReply<QString> getCurrentAudioOutputPlugin() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getCurrentAudioOutputPlugin"), argumentList); + } + + inline QDBusReply<int> getDialpad() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getDialpad"), argumentList); + } + + inline QDBusReply<QStringList> getInputAudioPluginList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getInputAudioPluginList"), argumentList); + } + + inline QDBusReply<int> getMailNotify() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getMailNotify"), argumentList); + } + + inline QDBusReply<int> getMaxCalls() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getMaxCalls"), argumentList); + } + + inline QDBusReply<int> getNotify() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getNotify"), argumentList); + } + + inline QDBusReply<QStringList> getOutputAudioPluginList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getOutputAudioPluginList"), argumentList); + } + + inline QDBusReply<QStringList> getPlaybackDeviceList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getPlaybackDeviceList"), argumentList); + } + + inline QDBusReply<int> getPulseAppVolumeControl() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getPulseAppVolumeControl"), argumentList); + } + + inline QDBusReply<QStringList> getRecordDeviceList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getRecordDeviceList"), argumentList); + } + + inline QDBusReply<QString> getRingtoneChoice() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getRingtoneChoice"), argumentList); + } + + inline QDBusReply<QStringList> getRingtoneList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getRingtoneList"), argumentList); + } + + inline QDBusReply<int> getSearchbar() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getSearchbar"), argumentList); + } + + inline QDBusReply<int> getSipPort() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getSipPort"), argumentList); + } + + inline QDBusReply<QString> getStunServer() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getStunServer"), argumentList); + } + + inline QDBusReply<QStringList> getToneLocaleList() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getToneLocaleList"), argumentList); + } + + inline QDBusReply<QString> getVersion() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getVersion"), argumentList); + } + + inline QDBusReply<int> getVolumeControls() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getVolumeControls"), argumentList); + } + + inline QDBusReply<int> isIax2Enabled() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("isIax2Enabled"), argumentList); + } + + inline QDBusReply<int> isRingtoneEnabled() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("isRingtoneEnabled"), argumentList); + } + + inline QDBusReply<int> isStartHidden() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("isStartHidden"), argumentList); + } + + inline QDBusReply<int> isStunEnabled() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("isStunEnabled"), argumentList); + } + + inline QDBusReply<int> popupMode() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("popupMode"), argumentList); + } + + inline QDBusReply<void> removeAccount(const QString &accoundID) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(accoundID); + return callWithArgumentList(QDBus::Block, QLatin1String("removeAccount"), argumentList); + } + + inline QDBusReply<void> ringtoneEnabled() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("ringtoneEnabled"), argumentList); + } + + inline QDBusReply<void> sendRegister(const QString &accountID, int expire) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(accountID) << qVariantFromValue(expire); + return callWithArgumentList(QDBus::Block, QLatin1String("sendRegister"), argumentList); + } + + inline QDBusReply<void> setAccountDetails(const QString &accountID, MapStringString details) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(accountID) << qVariantFromValue(details); + return callWithArgumentList(QDBus::Block, QLatin1String("setAccountDetails"), argumentList); + } + + inline QDBusReply<void> setActiveCodecList(const QStringList &list) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(list); + return callWithArgumentList(QDBus::Block, QLatin1String("setActiveCodecList"), argumentList); + } + + inline QDBusReply<void> setAudioInputDevice(int index) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(index); + return callWithArgumentList(QDBus::Block, QLatin1String("setAudioInputDevice"), argumentList); + } + + inline QDBusReply<void> setAudioManager(int api) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(api); + return callWithArgumentList(QDBus::Block, QLatin1String("setAudioManager"), argumentList); + } + + inline QDBusReply<void> setAudioOutputDevice(int index) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(index); + return callWithArgumentList(QDBus::Block, QLatin1String("setAudioOutputDevice"), argumentList); + } + + inline QDBusReply<void> setDialpad() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setDialpad"), argumentList); + } + + inline QDBusReply<void> setInputAudioPlugin(const QString &audioPlugin) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(audioPlugin); + return callWithArgumentList(QDBus::Block, QLatin1String("setInputAudioPlugin"), argumentList); + } + + inline QDBusReply<void> setMailNotify() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setMailNotify"), argumentList); + } + + inline QDBusReply<void> setMaxCalls(int calls) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(calls); + return callWithArgumentList(QDBus::Block, QLatin1String("setMaxCalls"), argumentList); + } + + inline QDBusReply<void> setNotify() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setNotify"), argumentList); + } + + inline QDBusReply<void> setOutputAudioPlugin(const QString &audioPlugin) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(audioPlugin); + return callWithArgumentList(QDBus::Block, QLatin1String("setOutputAudioPlugin"), argumentList); + } + + inline QDBusReply<void> setPulseAppVolumeControl() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setPulseAppVolumeControl"), argumentList); + } + + inline QDBusReply<void> setRingtoneChoice(const QString &tone) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(tone); + return callWithArgumentList(QDBus::Block, QLatin1String("setRingtoneChoice"), argumentList); + } + + inline QDBusReply<void> setSearchbar() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setSearchbar"), argumentList); + } + + inline QDBusReply<void> setSipPort(int port) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(port); + return callWithArgumentList(QDBus::Block, QLatin1String("setSipPort"), argumentList); + } + + inline QDBusReply<void> setStunServer(const QString &server) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(server); + return callWithArgumentList(QDBus::Block, QLatin1String("setStunServer"), argumentList); + } + + inline QDBusReply<void> setVolumeControls() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("setVolumeControls"), argumentList); + } + + inline QDBusReply<void> startHidden() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("startHidden"), argumentList); + } + + inline QDBusReply<void> switchPopupMode() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("switchPopupMode"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void accountsChanged(); + void errorAlert(int code); + void parametersChanged(MapStringString details); +}; + +namespace org { + namespace sflphone { + namespace SFLphone { + typedef ::ConfigurationManagerInterface ConfigurationManager; + } + } +} +#endif diff --git a/sflphone_kde/configurationmanager_interface_singleton.cpp b/sflphone_kde/configurationmanager_interface_singleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2af476a4f77c8a67e4be53cdfffb9d792eebe0e2 --- /dev/null +++ b/sflphone_kde/configurationmanager_interface_singleton.cpp @@ -0,0 +1,15 @@ +#include "configurationmanager_interface_singleton.h" + + +ConfigurationManagerInterface * ConfigurationManagerInterfaceSingleton::daemon = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); + + +ConfigurationManagerInterface & ConfigurationManagerInterfaceSingleton::getInstance(){ + if(!daemon){ + daemon = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); + } + if(!daemon->isValid()) + throw "Error : sflphoned not connected"; + return *daemon; +} + \ No newline at end of file diff --git a/sflphone_kde/configurationmanager_interface_singleton.h b/sflphone_kde/configurationmanager_interface_singleton.h new file mode 100644 index 0000000000000000000000000000000000000000..870ff94825a99a159c928cb37d217103d9f990f5 --- /dev/null +++ b/sflphone_kde/configurationmanager_interface_singleton.h @@ -0,0 +1,20 @@ +#ifndef CONFIGURATION_MANAGER_INTERFACE_SINGLETON_H +#define CONFIGURATION_MANAGER_INTERFACE_SINGLETON_H + +#include "configurationmanager_interface_p.h" + +class ConfigurationManagerInterfaceSingleton +{ + +private: + + static ConfigurationManagerInterface * daemon; + +public: + + //TODO verifier pointeur ou pas pour singleton en c++ + static ConfigurationManagerInterface & getInstance(); + +}; + +#endif \ No newline at end of file diff --git a/sflphone_kde/main.cpp b/sflphone_kde/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ea20a93f077c932268db05df9dd5a837ca4850e --- /dev/null +++ b/sflphone_kde/main.cpp @@ -0,0 +1,27 @@ +#include <QApplication> +#include <QtGui> +#include "ConfigDialog.h" +#include "SFLPhone.h" + +int main(int argc, char *argv[]) +{ + try + { + QApplication app(argc, argv); + + QString locale = QLocale::system().name(); + + QTranslator translator; + translator.load(QString("config_") + locale); + app.installTranslator(&translator); + + SFLPhone fenetre; + fenetre.show(); + + return app.exec(); + } + catch(const char * msg) + { + printf("%s\n",msg); + } +} diff --git a/sflphone_kde/mainorig.cpp b/sflphone_kde/mainorig.cpp new file mode 100644 index 0000000000000000000000000000000000000000..21110135832da9116d4ef8fa36d22876dd1f399d --- /dev/null +++ b/sflphone_kde/mainorig.cpp @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include "sflphone_kde.h" +#include <kapplication.h> +#include <kaboutdata.h> +#include <kcmdlineargs.h> +#include <KDE/KLocale> + +static const char description[] = + I18N_NOOP("A KDE 4 Application"); + +static const char version[] = "0.1"; + +int main(int argc, char **argv) +{ + KAboutData about("sflphone_kde", 0, ki18n("sflphone_kde"), version, ki18n(description), + KAboutData::License_GPL, ki18n("(C) 2009 Jérémy Quentin"), KLocalizedString(), 0, "jeremy.quentin@gmail.com"); + about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@gmail.com" ); + KCmdLineArgs::init(argc, argv, &about); + + KCmdLineOptions options; + options.add("+[URL]", ki18n( "Document to open" )); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + sflphone_kde *widget = new sflphone_kde; + + // see if we are starting with session management + if (app.isSessionRestored()) + { + RESTORE(sflphone_kde); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + //sflphone_kde *widget = new sflphone_kde; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + //sflphone_kde *widget = new sflphone_kde; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} diff --git a/sflphone_kde/metatypes.h b/sflphone_kde/metatypes.h new file mode 100644 index 0000000000000000000000000000000000000000..4f308db1d2b51db1072f70474cb13412bb95fec1 --- /dev/null +++ b/sflphone_kde/metatypes.h @@ -0,0 +1,23 @@ +#ifndef METATYPES_H +#define METATYPES_H + +#include <QtCore/QList> +#include <QtCore/QMetaType> +#include <QtDBus/QtDBus> +#include <qmap.h> +#include <qstring.h> + +//class MapStringString:public QMap<QString, QString>{}; +typedef QMap<QString, QString> MapStringString; +typedef QVector<QString> VectorString; + +Q_DECLARE_METATYPE(MapStringString) +//Q_DECLARE_METATYPE(VectorString) + + +inline void registerCommTypes() { + qDBusRegisterMetaType<MapStringString>(); + //qDBusRegisterMetaType<VectorString>(); +} + +#endif \ No newline at end of file diff --git a/sflphone_kde/settings.kcfgc b/sflphone_kde/settings.kcfgc new file mode 100644 index 0000000000000000000000000000000000000000..a535f22e557a69d838c0695ce8a554ef6d9f71bc --- /dev/null +++ b/sflphone_kde/settings.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for kconfig_compiler +File=sflphone_kde.kcfg +ClassName=Settings +Singleton=true +Mutators=col_background,col_foreground +# will create the necessary code for setting those variables diff --git a/sflphone_kde/sflphone-qt.ui b/sflphone_kde/sflphone-qt.ui new file mode 100644 index 0000000000000000000000000000000000000000..c2a2a3b8dbfa4e8ef6b1f8b7ae7881930f329b48 --- /dev/null +++ b/sflphone_kde/sflphone-qt.ui @@ -0,0 +1,500 @@ +<ui version="4.0" > + <class>SFLPhone</class> + <widget class="QMainWindow" name="SFLPhone" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>384</width> + <height>373</height> + </rect> + </property> + <property name="windowTitle" > + <string>SFLPhone</string> + </property> + <widget class="QWidget" name="centralwidget" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QListWidget" name="listWidget_callList" /> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <property name="spacing" > + <number>4</number> + </property> + <property name="sizeConstraint" > + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <item> + <widget class="QSlider" name="verticalSlider_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="layoutDirection" > + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground" > + <bool>false</bool> + </property> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition" > + <enum>QSlider::NoTicks</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton" > + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/mic_75.svg</normaloff>:/Images/mic_75.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="KButtonGroup" name="dialpadButtonGroup" > + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <widget class="QPushButton" name="pushButton_1" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>1</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QPushButton" name="pushButton_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>2</string> + </property> + <property name="shortcut" > + <string>2</string> + </property> + </widget> + </item> + <item row="0" column="2" > + <widget class="QPushButton" name="pushButton_3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>3</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QPushButton" name="pushButton_4" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>4</string> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QPushButton" name="pushButton_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>5</string> + </property> + </widget> + </item> + <item row="1" column="2" > + <widget class="QPushButton" name="pushButton_6" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>6</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QPushButton" name="pushButton_7" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>7</string> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QPushButton" name="pushButton_8" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>8</string> + </property> + </widget> + </item> + <item row="2" column="2" > + <widget class="QPushButton" name="pushButton_9" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>9</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QPushButton" name="pushButton_etoile" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>*</string> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QPushButton" name="pushButton_0" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>0</string> + </property> + </widget> + </item> + <item row="3" column="2" > + <widget class="QPushButton" name="pushButton_diese" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>#</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3" > + <property name="spacing" > + <number>4</number> + </property> + <property name="sizeConstraint" > + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <item> + <widget class="QSlider" name="verticalSlider_3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="layoutDirection" > + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground" > + <bool>false</bool> + </property> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition" > + <enum>QSlider::NoTicks</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_2" > + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/speaker_75.svg</normaloff>:/Images/speaker_75.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>384</width> + <height>25</height> + </rect> + </property> + <widget class="QMenu" name="menuActions" > + <property name="title" > + <string>&Actions</string> + </property> + <addaction name="actionDecrocher" /> + <addaction name="actionRaccrocher" /> + <addaction name="actionMettre_en_attente" /> + <addaction name="actionTransferer" /> + <addaction name="actionBoite_vocale" /> + </widget> + <widget class="QMenu" name="menu_Configuration" > + <property name="title" > + <string>&Configuration</string> + </property> + <addaction name="actionAfficher_les_barres_de_volume" /> + <addaction name="actionAfficher_le_clavier" /> + <addaction name="separator" /> + <addaction name="actionConfigurer_les_comptes" /> + <addaction name="actionConfigurer_le_son" /> + <addaction name="actionConfigurer_SFLPhone" /> + </widget> + <widget class="QMenu" name="menuAide" > + <property name="title" > + <string>Ai&de</string> + </property> + <addaction name="action_About" /> + </widget> + <addaction name="menuActions" /> + <addaction name="menu_Configuration" /> + <addaction name="menuAide" /> + </widget> + <widget class="QStatusBar" name="statusbar" /> + <widget class="QToolBar" name="toolBar" > + <property name="windowTitle" > + <string>toolBar</string> + </property> + <attribute name="toolBarArea" > + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak" > + <bool>false</bool> + </attribute> + <addaction name="actionDecrocher" /> + <addaction name="actionRaccrocher" /> + <addaction name="actionMettre_en_attente" /> + <addaction name="actionTransferer" /> + <addaction name="actionBoite_vocale" /> + <addaction name="separator" /> + <addaction name="actionHistorique" /> + </widget> + <action name="actionDecrocher" > + <property name="icon" > + <iconset> + <normaloff>:/Images/accept.svg</normaloff>:/Images/accept.svg</iconset> + </property> + <property name="text" > + <string>&Décrocher</string> + </property> + </action> + <action name="actionRaccrocher" > + <property name="icon" > + <iconset> + <normaloff>:/Images/hang_up.svg</normaloff>:/Images/hang_up.svg</iconset> + </property> + <property name="text" > + <string>&Raccrocher</string> + </property> + </action> + <action name="actionMettre_en_attente" > + <property name="icon" > + <iconset> + <normaloff>:/Images/hold.svg</normaloff>:/Images/hold.svg</iconset> + </property> + <property name="text" > + <string>Mettre en &Attente</string> + </property> + </action> + <action name="actionTransferer" > + <property name="icon" > + <iconset> + <normaloff>:/Images/transfert.svg</normaloff>:/Images/transfert.svg</iconset> + </property> + <property name="text" > + <string>&Transférer</string> + </property> + </action> + <action name="actionHistorique" > + <property name="icon" > + <iconset> + <normaloff>:/Images/history2.svg</normaloff>:/Images/history2.svg</iconset> + </property> + <property name="text" > + <string>&Historique</string> + </property> + </action> + <action name="actionBoite_vocale" > + <property name="icon" > + <iconset> + <normaloff>:/Images/mailbox.svg</normaloff>:/Images/mailbox.svg</iconset> + </property> + <property name="text" > + <string>&Boîte Vocale</string> + </property> + </action> + <action name="actionConfigurer_les_comptes" > + <property name="icon" > + <iconset> + <normaloff>:/Images/stock_person.svg</normaloff>:/Images/stock_person.svg</iconset> + </property> + <property name="text" > + <string>Configurer les &comptes</string> + </property> + </action> + <action name="actionConfigurer_le_son" > + <property name="icon" > + <iconset> + <normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset> + </property> + <property name="text" > + <string>Configurer le &son</string> + </property> + </action> + <action name="actionConfigurer_SFLPhone" > + <property name="icon" > + <iconset> + <normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset> + </property> + <property name="text" > + <string>&Configurer SFLPhone</string> + </property> + </action> + <action name="actionAfficher_les_barres_de_volume" > + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset> + </property> + <property name="text" > + <string>Afficher les barres de &volume</string> + </property> + </action> + <action name="action_About" > + <property name="text" > + <string>&About</string> + </property> + </action> + <action name="actionAfficher_le_clavier" > + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + <property name="icon" > + <iconset> + <normaloff>:/Images/icon_dialpad.svg</normaloff>:/Images/icon_dialpad.svg</iconset> + </property> + <property name="text" > + <string>Afficher le &clavier</string> + </property> + </action> + </widget> + <customwidgets> + <customwidget> + <class>KButtonGroup</class> + <extends>QGroupBox</extends> + <header>kbuttongroup.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources> + <include location="resources.qrc" /> + </resources> + <connections> + <connection> + <sender>actionAfficher_les_barres_de_volume</sender> + <signal>toggled(bool)</signal> + <receiver>verticalSlider_2</receiver> + <slot>setVisible(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>-1</x> + <y>-1</y> + </hint> + <hint type="destinationlabel" > + <x>16</x> + <y>313</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone_kde/sflphone_const.cpp b/sflphone_kde/sflphone_const.cpp new file mode 100644 index 0000000000000000000000000000000000000000..145a90c93590cc070c34ca9952e313294c556861 --- /dev/null +++ b/sflphone_kde/sflphone_const.cpp @@ -0,0 +1,19 @@ +#include "sflphone_const.h" + +int getProtocoleIndex(QString protocoleName) +{ + if(protocoleName == (QString)"SIP") + return 0; + if(protocoleName == (QString)"IAX") + return 1; + return -1; +} + +QString getIndexProtocole(int protocoleIndex) +{ + if(protocoleIndex == 0) + return "SIP"; + if(protocoleIndex == 1) + return "IAX"; + return "UNKNOWN PROTOCOLE INDEX"; +} \ No newline at end of file diff --git a/sflphone_kde/sflphone_const.h b/sflphone_kde/sflphone_const.h new file mode 100644 index 0000000000000000000000000000000000000000..11f31ea97e2c14e3a420c4369176b45500a25d61 --- /dev/null +++ b/sflphone_kde/sflphone_const.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __SFLPHONE_CONST_H +#define __SFLPHONE_CONST_H + +#include <libintl.h> +#include <QtGui> + +/* @file sflphone_const.h + * @brief Contains the global variables for the client code + */ + +/** Locale */ +#define _(STRING) gettext( STRING ) + +/** Warnings unused variables **/ +#define UNUSED_VAR(var) (void*)var + +#define UNUSED __attribute__((__unused__)) + +#define PAGE_GENERAL 0 +#define PAGE_DISPLAY 1 +#define PAGE_ACCOUNTS 2 +#define PAGE_AUDIO 3 + +#define ACCOUNT_TYPE "Account.type" +#define ACCOUNT_ALIAS "Account.alias" +#define ACCOUNT_ENABLED "Account.enable" +#define ACCOUNT_MAILBOX "Account.mailbox" +#define ACCOUNT_HOSTNAME "hostname" +#define ACCOUNT_USERNAME "username" +#define ACCOUNT_PASSWORD "password" +#define ACCOUNT_STATUS "Status" +#define ACCOUNT_SIP_STUN_SERVER "STUN.server" +#define ACCOUNT_SIP_STUN_ENABLED "STUN.enable" + +#define ACCOUNT_ENABLED_TRUE "TRUE" +#define ACCOUNT_ENABLED_FALSE "FALSE" + +#define ACCOUNT_STATE_REGISTERED "REGISTERED" +#define ACCOUNT_STATE_UNREGISTERED "UNREGISTERED" +#define ACCOUNT_STATE_TRYING "TRYING" +#define ACCOUNT_STATE_ERROR "ERROR" +#define ACCOUNT_STATE_ERROR_AUTH "ERROR_AUTH" +#define ACCOUNT_STATE_ERROR_NETWORK "ERROR_NETWORK" +#define ACCOUNT_STATE_ERROR_HOST "ERROR_HOST" +#define ACCOUNT_STATE_ERROR_CONF_STUN "ERROR_CONF_STUN" +#define ACCOUNT_STATE_ERROR_EXIST_STUN "ERROR_EXIST_STUN" + +#define MAX_HISTORY_CAPACITY 60 + +#define CODEC_NAME 0 +#define CODEC_SAMPLE_RATE 1 +#define CODEC_BIT_RATE 2 +#define CODEC_BANDWIDTH 3 + +/** Error while opening capture device */ +#define ALSA_CAPTURE_DEVICE 0x0001 +/** Error while opening playback device */ +#define ALSA_PLAYBACK_DEVICE 0x0010 +/** Error pulseaudio */ +#define PULSEAUDIO_NOT_RUNNING 0x0100 + + + +/** Tone to play when no voice mails */ +#define TONE_WITHOUT_MESSAGE 0 +/** Tone to play when voice mails */ +#define TONE_WITH_MESSAGE 1 +/** Tells if the main window is reduced to the system tray or not */ +#define MINIMIZED TRUE +/** Behaviour of the main window on incoming calls */ +#define __POPUP_WINDOW ( dbus_popup_mode() ) +/** Show/Hide the dialpad */ +#define SHOW_DIALPAD ( dbus_get_dialpad() ) +/** Show/Hide the volume controls */ +#define SHOW_VOLUME ( dbus_get_volume_controls() ) +/** Show/Hide the dialpad */ +#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) +/** Show/Hide the alsa configuration panel */ +#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) + +/** Audio Managers */ +#define ALSA 0 +#define PULSEAUDIO 1 + +/** Notification levels */ +#define __NOTIF_LEVEL_MIN 0 +#define __NOTIF_LEVEL_MED 1 +#define __NOTIF_LEVEL_HIGH 2 + +/** Messages ID for the status bar - Incoming calls */ +#define __MSG_INCOMING_CALL 0 +/** Messages ID for the status bar - Calling */ +#define __MSG_CALLING 1 +/** Messages ID for the status bar - Voice mails notification */ +#define __MSG_VOICE_MAILS 2 +/** Messages ID for the status bar - Current account */ +#define __MSG_ACCOUNT_DEFAULT 3 + +/** Desktop notifications - Time before to close the notification*/ +#define __TIMEOUT_MODE "default" +/** Desktop notifications - Time before to close the notification*/ +#define __TIMEOUT_TIME 18000 // 30 secondes + +//TODO constantes pour protocoles +int getProtocoleIndex(QString protocoleName); + +QString getIndexProtocole(int protocoleIndex); + +#endif diff --git a/sflphone_kde/sflphone_kde.cpp b/sflphone_kde/sflphone_kde.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ebc6ffe628ee2824f3663cb54c5c6e40aa6810c9 --- /dev/null +++ b/sflphone_kde/sflphone_kde.cpp @@ -0,0 +1,109 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include "sflphone_kde.h" +#include "sflphone_kdeview.h" +#include "settings.h" + +#include <QtGui/QDropEvent> +#include <QtGui/QPainter> + +#include <kconfigdialog.h> +#include <kstatusbar.h> + +#include <kaction.h> +#include <kactioncollection.h> +#include <kstandardaction.h> + +#include <KDE/KLocale> + +sflphone_kde::sflphone_kde() + : KXmlGuiWindow(), + m_view(new sflphone_kdeView(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KXmlGuiWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // add a status bar + statusBar()->show(); + + // a call to KXmlGuiWindow::setupGUI() populates the GUI + // with actions, using KXMLGUI. + // It also applies the saved mainwindow settings, if any, and ask the + // mainwindow to automatically save settings if changed: window size, + // toolbar position, icon size, etc. + setupGUI(); +} + +sflphone_kde::~sflphone_kde() +{ +} + +void sflphone_kde::setupActions() +{ + KStandardAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); + + KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class sflphone_kdeView + KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this); + actionCollection()->addAction( QLatin1String("switch_action"), custom ); + connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors())); +} + +void sflphone_kde::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new sflphone_kde)->show(); +} + +void sflphone_kde::optionsPreferences() +{ + // The preference dialog is derived from prefs_base.ui + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + //avoid to have 2 dialogs shown + if ( KConfigDialog::showDialog( "settings" ) ) { + return; + } + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self()); + QWidget *generalSettingsDlg = new QWidget; + ui_prefs_base.setupUi(generalSettingsDlg); + dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting"); + connect(dialog, SIGNAL(settingsChanged(QString)), m_view, SLOT(settingsChanged())); + dialog->setAttribute( Qt::WA_DeleteOnClose ); + dialog->show(); +} + +#include "sflphone_kde.moc" diff --git a/sflphone_kde/sflphone_kde.desktop b/sflphone_kde/sflphone_kde.desktop new file mode 100644 index 0000000000000000000000000000000000000000..008fad44107a43fdc694af9bd4fe3eaf783ed512 --- /dev/null +++ b/sflphone_kde/sflphone_kde.desktop @@ -0,0 +1,30 @@ +[Desktop Entry] +Name=KApp4 +Name[nds]=KProg4 +Name[sv]=KDE 4-program +Name[zh_TW]=KApp4 ç¨‹å¼ +Exec=kapp4 %i -caption "%c" +Icon=kapp4 +Type=Application +X-DocPath=kapp4/kapp4.html +GenericName=A KDE4 Application +GenericName[ca]=Una aplicació del KDE4 +GenericName[da]=Et KDE4-program +GenericName[de]=Eine KDE 4-Anwendung +GenericName[el]=Μία εφαÏμογή του KDE4 +GenericName[es]=Una aplicación para KDE4 +GenericName[et]=KDE4 rakendus +GenericName[hu]=KDE4-alapú alkalmazás +GenericName[it]=Applicazione KDE4 +GenericName[nds]=En KDE4-Programm +GenericName[nl]=Een KDE4-programma +GenericName[pl]=Program dla KDE4 +GenericName[pt]=Uma Aplicação do KDE4 +GenericName[pt_BR]=Uma Aplicação do KDE4 +GenericName[ru]=Приложение KDE 4 +GenericName[sk]=KDE4 aplikácia +GenericName[sr]=KDE4 програм +GenericName[sr@Latn]=KDE4 program +GenericName[sv]=Ett KDE 4-program +GenericName[zh_TW]=KDE4 æ‡‰ç”¨ç¨‹å¼ +Terminal=false diff --git a/sflphone_kde/sflphone_kde.h b/sflphone_kde/sflphone_kde.h new file mode 100644 index 0000000000000000000000000000000000000000..98f29d4ddbe010a0de9a1a0bc9ca24bf7f0b0059 --- /dev/null +++ b/sflphone_kde/sflphone_kde.h @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef SFLPHONE_KDE_H +#define SFLPHONE_KDE_H + + +#include <kxmlguiwindow.h> + +#include "ui_prefs_base.h" + +class sflphone_kdeView; +class KPrinter; +class KToggleAction; +class KUrl; + +/** + * This class serves as the main window for sflphone_kde. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author Andreas Pakulat <apaku@gmx.de> + * @version 0.1 + */ +class sflphone_kde : public KXmlGuiWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + sflphone_kde(); + + /** + * Default Destructor + */ + virtual ~sflphone_kde(); + +private slots: + void fileNew(); + void optionsPreferences(); + +private: + void setupActions(); + +private: + Ui::prefs_base ui_prefs_base ; + sflphone_kdeView *m_view; + + KPrinter *m_printer; + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _sflphone_kde_H_ diff --git a/sflphone_kde/sflphone_kde.kcfg b/sflphone_kde/sflphone_kde.kcfg new file mode 100644 index 0000000000000000000000000000000000000000..1cbec6deddfde6e9c35c4fb0280ad693dd28d14f --- /dev/null +++ b/sflphone_kde/sflphone_kde.kcfg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="KApp4rc"/> + <group name="Preferences"> + <entry name="col_background" type="Color"> + <label>color of the background</label> + <default>black</default> + </entry> + <entry name="col_foreground" type="Color"> + <label>color of the foreground</label> + <default>yellow</default> + </entry> + <entry name="val_time" type="Int"> + <label>size of a ball</label> + <default>2</default> + </entry> + </group> +</kcfg> diff --git a/sflphone_kde/sflphone_kde.kdevelop b/sflphone_kde/sflphone_kde.kdevelop new file mode 100644 index 0000000000000000000000000000000000000000..3e38334a026c34eb4b72e197144ae1ace7a34c56 --- /dev/null +++ b/sflphone_kde/sflphone_kde.kdevelop @@ -0,0 +1,273 @@ +<?xml version = '1.0'?> +<kdevelop> + <general> + <author>Jérémy Quentin</author> + <email>jeremy.quentin@gmail.com</email> + <version>0.1</version> + <projectmanagement>KDevCustomProject</projectmanagement> + <primarylanguage>C++</primarylanguage> + <keywords> + <keyword>C++</keyword> + <keyword>Code</keyword> + <keyword>Qt</keyword> + <keyword>KDE</keyword> + </keywords> + <projectname>sflphone_kde</projectname> + <projectdirectory>.</projectdirectory> + <absoluteprojectpath>false</absoluteprojectpath> + <description/> + <ignoreparts/> + <defaultencoding/> + </general> + <kdevfileview> + <groups> + <group pattern="*.cpp;*.cxx;*.h" name="Sources" /> + <group pattern="*.ui" name="User Interface" /> + <group pattern="*.png" name="Icons" /> + <group pattern="*.po;*.ts" name="Translations" /> + <group pattern="*" name="Others" /> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidenonlocation>false</hidenonlocation> + </groups> + <tree> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidepatterns>*.o,*.lo,CVS</hidepatterns> + </tree> + </kdevfileview> + <kdevdoctreeview> + <ignoretocs> + <toc>ada</toc> + <toc>ada_bugs_gcc</toc> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>clanlib</toc> + <toc>w3c-dom-level2-html</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>w3c-svg</toc> + <toc>sw</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + </kdevdoctreeview> + <kdevdebugger> + <general> + <dbgshell>libtool</dbgshell> + <programargs/> + <gdbpath/> + <breakonloadinglibs>true</breakonloadinglibs> + <separatetty>false</separatetty> + <floatingtoolbar>false</floatingtoolbar> + <runappinappdirectory>true</runappinappdirectory> + <configGdbScript/> + <runShellScript/> + <runGdbScript/> + <raiseGDBOnStart>false</raiseGDBOnStart> + </general> + <display> + <staticmembers>false</staticmembers> + <demanglenames>true</demanglenames> + <outputradix>10</outputradix> + </display> + </kdevdebugger> + <kdevfilecreate> + <filetypes/> + <useglobaltypes> + <type ext="ui" /> + <type ext="cpp" /> + <type ext="h" /> + </useglobaltypes> + </kdevfilecreate> + <kdevcvs> + <cvsoptions>-f</cvsoptions> + <commitoptions/> + <updateoptions>-dP</updateoptions> + <addoptions/> + <removeoptions>-f</removeoptions> + <diffoptions>-u3 -p</diffoptions> + <logoptions/> + <rshoptions/> + </kdevcvs> + <cppsupportpart> + <codecompletion/> + <filetemplates> + <choosefiles>false</choosefiles> + <interfaceURL/> + <implementationURL/> + <interfacesuffix>.h</interfacesuffix> + <implementationsuffix>.cpp</implementationsuffix> + <lowercasefilenames>true</lowercasefilenames> + </filetemplates> + </cppsupportpart> + <kdevcustomproject> + <run> + <mainprogram/> + <programargs/> + <terminal>false</terminal> + <autocompile>false</autocompile> + <envvars> + <envvar value="/usr/lib/kde4" name="KDEDIR" /> + <envvar value="$KDEDIR" name="KDEDIRS" /> + <envvar value="/home/jquentin/.kde4" name="KDEHOME" /> + <envvar value="/tmp/jquentin-kde4" name="KDETMP" /> + <envvar value="/var/tmp/jquentin-kde4" name="KDEVARTMP" /> + <envvar value="/usr/lib/kde4:usr/lib/qt4:$LD_LIBRARY_PATH" name="LD_LIBRARY_PATH" /> + <envvar value="/usr/bin:$PATH" name="PATH" /> + <envvar value="/usr/lib/pkgconfig" name="PKG_CONFIG_PATH" /> + <envvar value="/usr/lib/qt4/plugins" name="QT_PLUGIN_PATH" /> + </envvars> + <autoinstall>false</autoinstall> + <autokdesu>false</autokdesu> + <globaldebugarguments/> + <useglobalprogram>false</useglobalprogram> + <globalcwd>/home/jquentin/sflphone_kde</globalcwd> + <directoryradio>executable</directoryradio> + </run> + <build> + <buildtool>make</buildtool> + <builddir>/home/jquentin/sflphone_kde/build</builddir> + </build> + <make> + <abortonerror>false</abortonerror> + <numberofjobs>1</numberofjobs> + <prio>0</prio> + <dontact>false</dontact> + <makebin>make</makebin> + <defaulttarget/> + <makeoptions/> + <selectedenvironment>default</selectedenvironment> + <environments> + <default> + <envvar value="/usr/lib/kde4" name="KDEDIR" /> + <envvar value="$KDEDIR" name="KDEDIRS" /> + <envvar value="/home/jquentin/.kde4" name="KDEHOME" /> + <envvar value="/tmp/jquentin-kde4" name="KDETMP" /> + <envvar value="/var/tmp/jquentin-kde4" name="KDEVARTMP" /> + <envvar value="/usr/lib/kde4:usr/lib/qt4:$LD_LIBRARY_PATH" name="LD_LIBRARY_PATH" /> + <envvar value="/usr/bin:$PATH" name="PATH" /> + <envvar value="/usr/lib/pkgconfig" name="PKG_CONFIG_PATH" /> + <envvar value="/usr/lib/qt4/plugins" name="QT_PLUGIN_PATH" /> + </default> + </environments> + </make> + <filetypes> + <filetype>*.h</filetype> + <filetype>*.cpp</filetype> + <filetype>CMakeLists.txt</filetype> + <filetype>*.desktop</filetype> + <filetype>*.kcfg*</filetype> + <filetype>*.ui</filetype> + <filetype>Doxyfile</filetype> + <filetype>*.dox</filetype> + <filetype>*.rc</filetype> + <filetype>*.cmake</filetype> + </filetypes> + <other> + <prio>0</prio> + <otherbin/> + <defaulttarget/> + <otheroptions/> + <selectedenvironment>default</selectedenvironment> + <environments> + <default/> + </environments> + </other> + <blacklist> + <path>build</path> + </blacklist> + </kdevcustomproject> + <kdevcppsupport> + <qt> + <used>true</used> + <version>4</version> + <includestyle>4</includestyle> + <designerintegration>ExternalDesigner</designerintegration> + <designer>/usr/bin/designer-qt4</designer> + <root>/usr/lib/qt4</root> + <qmake>/usr/bin/qmake-qt4</qmake> + <designerpluginpaths/> + </qt> + <codecompletion> + <automaticCodeCompletion>false</automaticCodeCompletion> + <automaticArgumentsHint>true</automaticArgumentsHint> + <automaticHeaderCompletion>true</automaticHeaderCompletion> + <codeCompletionDelay>250</codeCompletionDelay> + <argumentsHintDelay>400</argumentsHintDelay> + <headerCompletionDelay>250</headerCompletionDelay> + <showOnlyAccessibleItems>false</showOnlyAccessibleItems> + <completionBoxItemOrder>0</completionBoxItemOrder> + <howEvaluationContextMenu>true</howEvaluationContextMenu> + <showCommentWithArgumentHint>true</showCommentWithArgumentHint> + <statusBarTypeEvaluation>false</statusBarTypeEvaluation> + <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases> + <processPrimaryTypes>true</processPrimaryTypes> + <processFunctionArguments>false</processFunctionArguments> + <preProcessAllHeaders>false</preProcessAllHeaders> + <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental> + <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental> + <alwaysParseInBackground>true</alwaysParseInBackground> + <usePermanentCaching>true</usePermanentCaching> + <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces> + <includePaths>.;</includePaths> + </codecompletion> + <creategettersetter> + <prefixGet/> + <prefixSet>set</prefixSet> + <prefixVariable>m_,_</prefixVariable> + <parameterName>theValue</parameterName> + <inlineGet>true</inlineGet> + <inlineSet>true</inlineSet> + </creategettersetter> + <splitheadersource> + <enabled>false</enabled> + <synchronize>true</synchronize> + <orientation>Vertical</orientation> + </splitheadersource> + <references> + <pcs>Qt4</pcs> + </references> + </kdevcppsupport> + <kdevclassview> + <folderhierarchy>true</folderhierarchy> + <depthoffolders>2</depthoffolders> + </kdevclassview> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>sflphone_kde.tag</docurl> + </projectdoc> + </kdevdocumentation> + <substmap> + <APPNAME>sflphone_kde</APPNAME> + <APPNAMELC>sflphone_kde</APPNAMELC> + <APPNAMESC>Sflphone_kde</APPNAMESC> + <APPNAMEUC>SFLPHONE_KDE</APPNAMEUC> + <AUTHOR>Jérémy Quentin</AUTHOR> + <EMAIL>jeremy.quentin@gmail.com</EMAIL> + <LICENSE>GPL</LICENSE> + <LICENSEFILE>COPYING</LICENSEFILE> + <VERSION>0.1</VERSION> + <YEAR>2009</YEAR> + <dest>/home/jquentin/sflphone_kde</dest> + </substmap> +</kdevelop> diff --git a/sflphone_kde/sflphone_kde.kdevelop.filelist b/sflphone_kde/sflphone_kde.kdevelop.filelist new file mode 100644 index 0000000000000000000000000000000000000000..dcd5c7ef0ac686846808ae7a504fdf1c929570c5 --- /dev/null +++ b/sflphone_kde/sflphone_kde.kdevelop.filelist @@ -0,0 +1,38 @@ +# KDevelop Custom Project File List +Account.cpp +Account.h +AccountList.cpp +AccountList.h +CMakeLists.txt +Call.cpp +Call.h +CallList.cpp +CallList.h +ConfigDialog.cpp +ConfigDialog.h +ConfigDialog.ui +Doxyfile +SFLPhone.cpp +SFLPhone.h +callmanager_interface.cpp +callmanager_interface_p.h +callmanager_interface_singleton.cpp +callmanager_interface_singleton.h +configurationmanager_interface.cpp +configurationmanager_interface_p.h +configurationmanager_interface_singleton.cpp +configurationmanager_interface_singleton.h +main.cpp +mainorig.cpp +metatypes.h +settings.kcfgc +sflphone-qt.ui +sflphone_const.cpp +sflphone_const.h +sflphone_kde.cpp +sflphone_kde.desktop +sflphone_kde.h +sflphone_kde.kcfg +sflphone_kdeui.rc +sflphone_kdeview.cpp +sflphone_kdeview.h diff --git a/sflphone_kde/sflphone_kde.kdevelop.pcs b/sflphone_kde/sflphone_kde.kdevelop.pcs new file mode 100644 index 0000000000000000000000000000000000000000..7a230fdd5b7adb046fab2e8cc03cb30549209a19 Binary files /dev/null and b/sflphone_kde/sflphone_kde.kdevelop.pcs differ diff --git a/sflphone_kde/sflphone_kde.kdevses b/sflphone_kde/sflphone_kde.kdevses new file mode 100644 index 0000000000000000000000000000000000000000..5fb87698df6d2988168af55f2f1f7fa7f1573f09 --- /dev/null +++ b/sflphone_kde/sflphone_kde.kdevses @@ -0,0 +1,101 @@ +<?xml version = '1.0' encoding = 'UTF-8'?> +<!DOCTYPE KDevPrjSession> +<KDevPrjSession> + <DocsAndViews NumberOfDocuments="24" > + <Doc0 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/ConfigDialog.cpp" > + <View0 Encoding="" line="218" Type="Source" /> + </Doc0> + <Doc1 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/ConfigDialog.h" > + <View0 Encoding="" line="10" Type="Source" /> + </Doc1> + <Doc2 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/configurationmanager_interface_p.h" > + <View0 Encoding="" line="26" Type="Source" /> + </Doc2> + <Doc3 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/configurationmanager_interface_singleton.cpp" > + <View0 Encoding="" line="11" Type="Source" /> + </Doc3> + <Doc4 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/configurationmanager_interface_singleton.h" > + <View0 Encoding="" line="0" Type="Source" /> + </Doc4> + <Doc5 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/configurationmanager_interface.cpp" > + <View0 Encoding="" line="22" Type="Source" /> + </Doc5> + <Doc6 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/Account.cpp" > + <View0 Encoding="" line="64" Type="Source" /> + </Doc6> + <Doc7 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/SFLPhone.cpp" > + <View0 Encoding="" line="121" Type="Source" /> + </Doc7> + <Doc8 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/SFLPhone.h" > + <View0 Encoding="" line="18" Type="Source" /> + </Doc8> + <Doc9 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/CMakeLists.txt" > + <View0 Encoding="" line="29" Type="Source" /> + </Doc9> + <Doc10 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/callmanager_interface_singleton.h" > + <View0 Encoding="" line="15" Type="Source" /> + </Doc10> + <Doc11 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/callmanager_interface_singleton.cpp" > + <View0 Encoding="" line="14" Type="Source" /> + </Doc11> + <Doc12 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/main.cpp" > + <View0 Encoding="" line="24" Type="Source" /> + </Doc12> + <Doc13 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/build/CMakeFiles/sflphone_kde.dir/build.make" > + <View0 Encoding="" line="0" Type="Source" /> + </Doc13> + <Doc14 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/build/CMakeFiles/sflphone_kde.dir/flags.make" > + <View0 Encoding="" line="0" Type="Source" /> + </Doc14> + <Doc15 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/callmanager_interface.cpp" > + <View0 Encoding="" line="19" Type="Source" /> + </Doc15> + <Doc16 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/callmanager-introspec.xml" > + <View0 Encoding="" line="21" Type="Source" /> + </Doc16> + <Doc17 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/configurationmanager-introspec.xml" > + <View0 Encoding="" line="259" Type="Source" /> + </Doc17> + <Doc18 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/sflphone_kde.cpp" > + <View0 Encoding="" line="24" Type="Source" /> + </Doc18> + <Doc19 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/Call.h" > + <View0 Encoding="" line="25" Type="Source" /> + </Doc19> + <Doc20 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/Call.cpp" > + <View0 Encoding="" line="3" Type="Source" /> + </Doc20> + <Doc21 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/Account.h" > + <View0 Encoding="" line="0" Type="Source" /> + </Doc21> + <Doc22 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/CallList.h" > + <View0 Encoding="" line="23" Type="Source" /> + </Doc22> + <Doc23 NumberOfViews="1" URL="file:///home/jquentin/sflphone_kde/CallList.cpp" > + <View0 Encoding="" line="0" Type="Source" /> + </Doc23> + </DocsAndViews> + <pluginList> + <kdevdebugger> + <breakpointList/> + <showInternalCommands value="0" /> + </kdevdebugger> + <kdevastyle> + <Extensions ext="*.cpp *.h *.hpp,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff ,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm" /> + <AStyle IndentPreprocessors="0" FillCount="4" PadParenthesesOut="1" IndentNamespaces="1" IndentLabels="1" Fill="Tabs" MaxStatement="40" Brackets="Break" MinConditional="-1" IndentBrackets="0" PadParenthesesUn="1" BlockBreak="0" KeepStatements="1" KeepBlocks="1" BlockIfElse="0" IndentSwitches="1" PadOperators="0" FStyle="UserDefined" IndentCases="0" FillEmptyLines="0" BracketsCloseHeaders="0" BlockBreakAll="0" PadParenthesesIn="1" IndentClasses="1" IndentBlocks="0" FillForce="0" /> + </kdevastyle> + <kdevbookmarks> + <bookmarks> + <bookmark url="/home/jquentin/sflphone_kde/build/ui_sflphone-qt.h" > + <mark line="36" /> + </bookmark> + </bookmarks> + </kdevbookmarks> + <kdevvalgrind> + <executable path="" params="" /> + <valgrind path="" params="" /> + <calltree path="" params="" /> + <kcachegrind path="" /> + </kdevvalgrind> + </pluginList> +</KDevPrjSession> diff --git a/sflphone_kde/sflphone_kdeui.rc b/sflphone_kde/sflphone_kdeui.rc new file mode 100644 index 0000000000000000000000000000000000000000..406bccc6b93b063f9adfbaffff3d771b1ebf8e7c --- /dev/null +++ b/sflphone_kde/sflphone_kdeui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="KApp4" version="1"> +<MenuBar> + <Menu name="move"><text>&Move</text> + <Action name="switch_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/sflphone_kde/sflphone_kdeview.cpp b/sflphone_kde/sflphone_kdeview.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b89a41ab34b34262e0106fe0fa0b66b4ff84bff --- /dev/null +++ b/sflphone_kde/sflphone_kdeview.cpp @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "sflphone_kdeview.h" +#include "settings.h" + +#include <klocale.h> +#include <QtGui/QLabel> + +sflphone_kdeView::sflphone_kdeView(QWidget *) +{ + ui_sflphone_kdeview_base.setupUi(this); + settingsChanged(); + setAutoFillBackground(true); +} + +sflphone_kdeView::~sflphone_kdeView() +{ + +} + +void sflphone_kdeView::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void sflphone_kdeView::settingsChanged() +{ + QPalette pal; + pal.setColor( QPalette::Window, Settings::col_background()); + pal.setColor( QPalette::WindowText, Settings::col_foreground()); + ui_sflphone_kdeview_base.kcfg_sillyLabel->setPalette( pal ); + + // i18n : internationalization + ui_sflphone_kdeview_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "sflphone_kdeview.moc" diff --git a/sflphone_kde/sflphone_kdeview.h b/sflphone_kde/sflphone_kdeview.h new file mode 100644 index 0000000000000000000000000000000000000000..f83a1a1099696387d5d42915738274b1dd38ce11 --- /dev/null +++ b/sflphone_kde/sflphone_kdeview.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef sflphone_kdeVIEW_H +#define sflphone_kdeVIEW_H + +#include <QtGui/QWidget> + +#include "ui_sflphone_kdeview_base.h" + +class QPainter; +class KUrl; + +/** + * This is the main view class for sflphone_kde. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author Jérémy Quentin <jeremy.quentin@gmail.com> + * @version 0.1 + */ + +class sflphone_kdeView : public QWidget, public Ui::sflphone_kdeview_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + sflphone_kdeView(QWidget *parent); + + /** + * Destructor + */ + virtual ~sflphone_kdeView(); + +private: + Ui::sflphone_kdeview_base ui_sflphone_kdeview_base; + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // sflphone_kdeVIEW_H diff --git a/sflphone_kde/templates/cpp b/sflphone_kde/templates/cpp new file mode 100644 index 0000000000000000000000000000000000000000..43862e93cc02320192c7f1f761384dbfb72f689b --- /dev/null +++ b/sflphone_kde/templates/cpp @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ diff --git a/sflphone_kde/templates/h b/sflphone_kde/templates/h new file mode 100644 index 0000000000000000000000000000000000000000..43862e93cc02320192c7f1f761384dbfb72f689b --- /dev/null +++ b/sflphone_kde/templates/h @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2009 by Jérémy Quentin * + * jeremy.quentin@gmail.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/