Commit d39df532 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'master' of...

Merge branch 'master' of git+ssh://repos-sflphone-git@git.sflphone.org/var/repos/sflphone/git/sflphone
parents c3fdb98f 7754c2ff
......@@ -2,6 +2,14 @@
# SFLphone
################################################
* 2010-03-25: 0.9.8 beta has been released
* 2009-12-10: SFLphone 0.9.7 has been released
* 2009-12-03: SFLphone 0.9.7~rc2 has been released
* 2009-11-20: SFLphone 0.9.7~rc1 has been released
* 2009-10-27: SFLphone 0.9.7~beta has been released
* 2009-07-27: SFLphone 0.9.6 has been released
......
AC_INIT([SFLphone],[0.9.7],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome])
AC_INIT([SFLphone],[0.9.8~beta],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome])
AM_CONFIG_HEADER(config.h)
LT_INIT
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY app "SFLphone">
<!ENTITY appversion "0.9.7">
<!ENTITY appversion "0.9.8~beta">
<!ENTITY docversion "1.0">
]>
......@@ -17,6 +17,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>Savoir-faire Linux</holder>
</copyright>
......@@ -73,6 +74,16 @@
</authorgroup>
<revhistory>
<revision>
<revnumber>SFLphone Manual v1.0.1</revnumber>
<date>March 2010</date>
<revdescription>
<para role="author">SFLphone team</para>
<para role="publisher">Savoir-faire Linux</para>
<para>Minor changes</para>
</revdescription>
</revision>
<revision>
<revnumber>SFLphone Manual v1.0</revnumber>
<date>September 2009</date>
......
......@@ -26,7 +26,7 @@ GtkWidget*
create_shortcuts_settings()
{
GtkWidget *vbox, *result_frame, *window, *treeview, *scrolled_window, *label;
GtkListStore *store;
GtkTreeIter iter;
guint i = 0;
......@@ -40,7 +40,7 @@ create_shortcuts_settings()
treeview = gtk_tree_view_new();
setup_tree_view(treeview);
store = gtk_list_store_new(COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT);
GtkListStore *store = gtk_list_store_new(COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT);
Accelerator* list = shortcuts_get_list();
......@@ -100,14 +100,29 @@ accel_edited(GtkCellRendererAccel *renderer, gchar *path, guint accel_key,
GtkTreeModel *model;
GtkTreeIter iter;
// Update treeview
Accelerator* list = shortcuts_get_list();
model = gtk_tree_view_get_model(treeview);
gint code = XKeysymToKeycode(GDK_DISPLAY(), accel_key);
// Disable existing binding if key already used
int i = 0;
gtk_tree_model_get_iter_first(model, &iter);
while (list[i].action != NULL)
{
if(list[i].value == code)
{
gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1);
WARN("This key was already affected");
}
gtk_tree_model_iter_next(model, &iter);
i++;
}
// Update treeview
if (gtk_tree_model_get_iter_from_string(model, &iter, path))
gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, (gint) mask, VALUE,
accel_key, -1);
gint code = XKeysymToKeycode(GDK_DISPLAY(), accel_key);
// Update GDK bindings
shortcuts_update_bindings(atoi(path), code);
}
......
......@@ -42,6 +42,39 @@ static GHashTable* shortcutsMap;
* Callbacks
*/
static void
toggle_pick_up_hang_up_callback ()
{
callable_obj_t * selectedCall = calltab_get_selected_call (active_calltree);
conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree);
g_print("toggle_pick_up_hang_up_callback\n");
if (selectedCall)
{
switch (selectedCall->_state)
{
case CALL_STATE_INCOMING:
case CALL_STATE_TRANSFERT:
sflphone_pick_up ();
break;
case CALL_STATE_DIALING:
case CALL_STATE_HOLD:
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
case CALL_STATE_RINGING:
sflphone_hang_up ();
break;
}
}
else if (selectedConf)
{
dbus_hang_up_conference (selectedConf);
}
else
sflphone_pick_up ();
}
static void
pick_up_callback ()
{
......@@ -54,6 +87,33 @@ hang_up_callback ()
sflphone_hang_up ();
}
static void
toggle_hold_callback ()
{
callable_obj_t * selectedCall = calltab_get_selected_call (current_calls);
conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree);
if (selectedCall)
{
switch (selectedCall->_state)
{
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
g_print("on hold\n");
sflphone_on_hold();
break;
case CALL_STATE_HOLD:
g_print("off hold\n");
sflphone_off_hold();
break;
}
}
else if (selectedConf)
dbus_hold_conference (selectedConf);
else
ERROR("Should not happen");
}
static void
popup_window_callback ()
{
......@@ -84,6 +144,12 @@ get_action_callback (const gchar* action)
if (strcmp (action, "popup_window") == 0)
return popup_window_callback;
if (strcmp (action, "toggle_pick_up_hang_up") == 0)
return toggle_pick_up_hang_up_callback;
if (strcmp (action, "toggle_hold") == 0)
return toggle_hold_callback;
return default_callback;
}
......@@ -225,6 +291,35 @@ initialize_accelerators_list ()
accelerators_list[index].value = 0;
}
static void
update_bindings_data (const guint index, const guint code)
{
// we need to be sure this code is not already affected
// to another action
int i = 0;
while (accelerators_list[i].action != NULL)
{
if (accelerators_list[i].value == code)
{
// disable old binding
accelerators_list[i].value = 0;
// update config table
g_hash_table_replace (shortcutsMap, g_strdup (
accelerators_list[i].action), GINT_TO_POINTER (0));
}
i++;
}
// store new value
accelerators_list[index].value = code;
// update value in hashtable (used for dbus calls)
g_hash_table_replace (shortcutsMap,
g_strdup (accelerators_list[index].action), GINT_TO_POINTER (
accelerators_list[index].value));
}
/*
* "Public" functions
*/
......@@ -238,13 +333,8 @@ shortcuts_update_bindings (const guint index, const guint code)
// first remove all existing bindings
remove_bindings ();
// store new value
accelerators_list[index].value = code;
// update value in hashtable (used for dbus calls)
g_hash_table_replace (shortcutsMap,
g_strdup (accelerators_list[index].action), GINT_TO_POINTER (
accelerators_list[index].value));
// update data
update_bindings_data (index, code);
// recreate all bindings
create_bindings ();
......
......@@ -26,53 +26,62 @@ typedef struct
GdkModifierType mask;
guint value;
void
(*callback)(void);
(*callback) (void);
} Accelerator;
static void
grab_key(int key_code, GdkWindow *root);
grab_key (int key_code, GdkWindow *root);
static void
ungrab_key(int key_code, GdkWindow *root);
ungrab_key (int key_code, GdkWindow *root);
static GdkFilterReturn
filter_keys(GdkXEvent *xevent, GdkEvent *event, gpointer data);
filter_keys (GdkXEvent *xevent, GdkEvent *event, gpointer data);
static void
remove_bindings();
remove_bindings ();
static void
create_bindings();
create_bindings ();
static void
pick_up_callback();
pick_up_callback ();
static void
hang_up_callback();
hang_up_callback ();
static void
initialize_binding(const gchar* action, const guint code);
toggle_pick_up_hang_up_callback ();
static void
initialize_shortcuts_keys();
toggle_hold_callback ();
static void
initialize_binding (const gchar* action, const guint code);
static void
initialize_shortcuts_keys ();
static void*
get_action_callback(const gchar* action);
get_action_callback (const gchar* action);
static void
update_bindings_data (const guint index, const guint code);
/*
* "Public" functions
*/
void
shortcuts_initialize_bindings();
shortcuts_initialize_bindings ();
void
shortcuts_update_bindings(const guint index, const guint code);
shortcuts_update_bindings (const guint index, const guint code);
void
shortcuts_destroy_bindings();
shortcuts_destroy_bindings ();
Accelerator*
shortcuts_get_list();
shortcuts_get_list ();
#endif /* SHORTCUTS_H_ */
......@@ -8,7 +8,7 @@ SET(CMAKE_MODULE_PATH "${LOCAL_CMAKE_MODULE_PATH}")
# --- custom targets: ---
INCLUDE( ${LOCAL_CMAKE_MODULE_PATH}/TargetDistclean.cmake REQUIRED)
FIND_PACKAGE ( Kabc REQUIRED )
#FIND_PACKAGE ( Kabc REQUIRED )
# FIND_PACKAGE ( PkgConfig REQUIRED )
FIND_PACKAGE ( KDE4 REQUIRED )
FIND_PACKAGE ( Qt4 REQUIRED )
......
......@@ -61,7 +61,7 @@ void ConfigurationSkeleton::readConfig()
////////////////////////
//Call history settings
setEnableHistory(configurationManager.getHistoryEnabled());
//setEnableHistory(configurationManager.getHistoryEnabled()); //TODO uncomment
setHistoryMax(configurationManager.getHistoryLimit());
//SIP port settings
......@@ -119,10 +119,10 @@ void ConfigurationSkeleton::readConfig()
setAlsaPlugin(configurationManager.getCurrentAudioOutputPlugin());
bool ok;
QStringList devices = configurationManager.getCurrentAudioDevicesIndex();
qDebug() << "inputDevice = " << devices[1];
int inputDevice = devices[1].toInt(& ok);
if(!ok) qDebug() << "inputDevice is not a number";
setAlsaInputDevice(inputDevice);
//qDebug() << "inputDevice = " << devices[1]; //TODO uncomment
//int inputDevice = devices[1].toInt(& ok); //TODO uncomment
//if(!ok) qDebug() << "inputDevice is not a number"; //TODO uncomment
//setAlsaInputDevice(inputDevice); //TODO uncomment
qDebug() << "outputDevice = " << devices[0];
int outputDevice = devices[0].toInt(& ok);
......@@ -191,7 +191,7 @@ void ConfigurationSkeleton::writeConfig()
qDebug() << "Writing General settings";
//Call history settings
if(enableHistory() != configurationManager.getHistoryEnabled()) configurationManager.setHistoryEnabled();
//TODO if(enableHistory() != configurationManager.getHistoryEnabled()) configurationManager.setHistoryEnabled();
configurationManager.setHistoryLimit(historyMax());
//SIP port settings
configurationManager.setSipPort(sIPPort());
......
......@@ -40,35 +40,66 @@ DlgAccounts::DlgAccounts(KConfigDialog *parent)
accountList = new AccountList(false);
loadAccountList();
accountListHasChanged = false;
toolButton_accountsApply->setEnabled(false);
//toolButton_accountsApply->setEnabled(false);
connect(edit1_alias, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit2_protocol, SIGNAL(activated(int)),
this, SLOT(changedAccountList()));
connect(edit3_server, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit4_user, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit5_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit6_mailbox, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_regExpire, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(checkBox_conformRFC, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(button_accountUp, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountDown, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountAdd, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountRemove, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(edit1_alias, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit2_protocol, SIGNAL(activated(int)),
this, SLOT(changedAccountList()));
connect(edit3_server, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit4_user, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit5_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit6_mailbox, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_regExpire, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(checkBox_conformRFC, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(button_accountUp, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountDown, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountAdd, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountRemove, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_tls_listener, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(file_tls_authority, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(file_tls_endpoint, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(file_tls_private_key, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(combo_tls_method, SIGNAL(currentIndexChanged(int)),
this, SLOT(changedAccountList()));
connect(edit_tls_cipher, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit_tls_outgoing, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_tls_timeout_sec, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(spinbox_tls_timeout_msec, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(check_tls_incoming, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(check_tls_answer, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(check_tls_requier_cert, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(group_security_tls, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(&configurationManager, SIGNAL(accountsChanged()),
this, SLOT(updateAccountStates()));
connect(&configurationManager, SIGNAL(accountsChanged()),
this, SLOT(updateAccountStates()));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons()));
......@@ -156,6 +187,24 @@ void DlgAccounts::saveAccount(QListWidgetItem * item)
account->setAccountDetail(ACCOUNT_RESOLVE_ONCE, checkBox_conformRFC->isChecked() ? "FALSE" : "TRUE");
account->setAccountDetail(ACCOUNT_EXPIRE, QString::number(spinbox_regExpire->value()));
account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE);
//Security
account->setAccountDetail(TLS_PASSWORD,edit_tls_private_key_password->text());
account->setAccountDetail(TLS_LISTENER_PORT,QString::number(spinbox_tls_listener->value()));
account->setAccountDetail(TLS_CA_LIST_FILE,file_tls_authority->text());
account->setAccountDetail(TLS_CERTIFICATE_FILE,file_tls_endpoint->text());
account->setAccountDetail(TLS_PRIVATE_KEY_FILE,file_tls_private_key->text());
//qDebug() << "\n\n\n\nSET: " << combo_tls_method->currentText() << "\n\n\n";
account->setAccountDetail(TLS_METHOD,combo_tls_method->currentText());
account->setAccountDetail(TLS_CIPHERS,edit_tls_cipher->text());
account->setAccountDetail(TLS_SERVER_NAME,edit_tls_outgoing->text());
account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC,QString::number(spinbox_tls_timeout_sec->value()));
account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC,QString::number(spinbox_tls_timeout_msec->value()));
account->setAccountDetail(TLS_VERIFY_SERVER,check_tls_incoming->isChecked()?"true":"false");
account->setAccountDetail(TLS_VERIFY_CLIENT,check_tls_answer->isChecked()?"true":"false");
account->setAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE,check_tls_requier_cert->isChecked()?"true":"false");
account->setAccountDetail(TLS_ENABLE,group_security_tls->isChecked()?"true":"false");
account->setAccountDetail(TLS_METHOD, QString::number(combo_security_STRP->currentIndex()));
}
void DlgAccounts::loadAccount(QListWidgetItem * item)
......@@ -186,6 +235,27 @@ void DlgAccounts::loadAccount(QListWidgetItem * item)
bool ok;
int val = account->getAccountDetail(ACCOUNT_EXPIRE).toInt(&ok);
spinbox_regExpire->setValue(ok ? val : ACCOUNT_EXPIRE_DEFAULT);
//Security
edit_tls_private_key_password->setText( account->getAccountDetail(TLS_PASSWORD ));
spinbox_tls_listener->setValue( account->getAccountDetail(TLS_LISTENER_PORT ).toInt());
file_tls_authority->setText( account->getAccountDetail(TLS_CA_LIST_FILE ));
file_tls_endpoint->setText( account->getAccountDetail(TLS_CERTIFICATE_FILE ));
file_tls_private_key->setText( account->getAccountDetail(TLS_PRIVATE_KEY_FILE ));
//qDebug() << "\n\n\n\nTHIS: " << account->getAccountDetail(TLS_METHOD ) << "\n\n\n";
combo_tls_method->setCurrentIndex( combo_tls_method->findText(account->getAccountDetail(TLS_METHOD )));
edit_tls_cipher->setText( account->getAccountDetail(TLS_CIPHERS ));
edit_tls_outgoing->setText( account->getAccountDetail(TLS_SERVER_NAME ));
spinbox_tls_timeout_sec->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC ).toInt());
spinbox_tls_timeout_msec->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC ).toInt());
check_tls_incoming->setChecked( (account->getAccountDetail(TLS_VERIFY_SERVER ) == "true")?1:0);
check_tls_answer->setChecked( (account->getAccountDetail(TLS_VERIFY_CLIENT ) == "true")?1:0);
check_tls_requier_cert->setChecked( (account->getAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE ) == "true")?1:0);
group_security_tls->setChecked( (account->getAccountDetail(TLS_ENABLE ) == "true")?1:0);
combo_security_STRP->setCurrentIndex(account->getAccountDetail(TLS_METHOD ).toInt());
updateStatusLabel(account);
frame2_editAccounts->setEnabled(true);
}
......@@ -220,7 +290,7 @@ void DlgAccounts::changedAccountList()
qDebug() << "changedAccountList";
accountListHasChanged = true;
emit updateButtons();
toolButton_accountsApply->setEnabled(true);
//toolButton_accountsApply->setEnabled(true);
}
......@@ -288,12 +358,12 @@ void DlgAccounts::on_button_accountRemove_clicked()
listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r );
}
void DlgAccounts::on_toolButton_accountsApply_clicked()
{
qDebug() << "on_toolButton_accountsApply_clicked";
updateSettings();
updateWidgets();
}
// void DlgAccounts::on_toolButton_accountsApply_clicked() //This button have been removed, coded kept for potential reversal
// {
// qDebug() << "on_toolButton_accountsApply_clicked";
// updateSettings();
// updateWidgets();
// }
void DlgAccounts::on_edit1_alias_textChanged(const QString & text)
{
......@@ -365,7 +435,7 @@ void DlgAccounts::updateSettings()
if(accountListHasChanged)
{
saveAccountList();
toolButton_accountsApply->setEnabled(false);
//toolButton_accountsApply->setEnabled(false);
accountListHasChanged = false;
}
}
......@@ -374,7 +444,7 @@ void DlgAccounts::updateWidgets()
{
qDebug() << "DlgAccounts::updateWidgets";
loadAccountList();
toolButton_accountsApply->setEnabled(false);
//toolButton_accountsApply->setEnabled(false);
accountListHasChanged = false;
}
......@@ -78,7 +78,7 @@ private slots:
void on_button_accountRemove_clicked();
void on_edit1_alias_textChanged(const QString & text);
void on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous );
void on_toolButton_accountsApply_clicked();
//void on_toolButton_accountsApply_clicked(); //Disabled for future removal
void updateAccountStates();
void addAccountToAccountList(Account * account);
void updateAccountListCommands();
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>603</width>
<height>455</height>
<width>748</width>
<height>447</height>
</rect>
</property>
<property name="windowTitle">
......@@ -29,8 +29,8 @@
<item>
<widget class="QFrame" name="frame1_accountList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
......@@ -46,6 +46,12 @@
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>