Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
31a51a63
Commit
31a51a63
authored
Sep 29, 2007
by
Pierre-Luc Beaudoin
Browse files
Remove account
parent
029a6c9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
sflphone-gtk/src/configwindow.c
View file @
31a51a63
...
@@ -71,7 +71,6 @@ delete_account( GtkWidget *widget, gpointer data )
...
@@ -71,7 +71,6 @@ delete_account( GtkWidget *widget, gpointer data )
if
(
selectedAccount
)
if
(
selectedAccount
)
{
{
dbus_remove_account
(
selectedAccount
->
accountID
);
dbus_remove_account
(
selectedAccount
->
accountID
);
fill_account_list
();
}
}
}
}
...
@@ -84,7 +83,6 @@ edit_account( GtkWidget *widget, gpointer data )
...
@@ -84,7 +83,6 @@ edit_account( GtkWidget *widget, gpointer data )
if
(
selectedAccount
)
if
(
selectedAccount
)
{
{
show_account_window
(
selectedAccount
);
show_account_window
(
selectedAccount
);
fill_account_list
();
}
}
}
}
...
@@ -96,7 +94,6 @@ static void
...
@@ -96,7 +94,6 @@ static void
add_account
(
GtkWidget
*
widget
,
gpointer
data
)
add_account
(
GtkWidget
*
widget
,
gpointer
data
)
{
{
show_account_window
(
NULL
);
show_account_window
(
NULL
);
fill_account_list
();
}
}
/* Call back when the user click on an account in the list */
/* Call back when the user click on an account in the list */
...
@@ -121,8 +118,7 @@ select_account(GtkTreeSelection *sel, GtkTreeModel *model)
...
@@ -121,8 +118,7 @@ select_account(GtkTreeSelection *sel, GtkTreeModel *model)
if
(
selectedAccount
)
if
(
selectedAccount
)
{
{
gtk_widget_set_sensitive
(
GTK_WIDGET
(
editButton
),
TRUE
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
editButton
),
TRUE
);
/*TODO Set to TRUE when removeAccount is implemented */
gtk_widget_set_sensitive
(
GTK_WIDGET
(
deleteButton
),
TRUE
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
deleteButton
),
FALSE
);
}
}
g_print
(
"select"
);
g_print
(
"select"
);
...
@@ -206,7 +202,7 @@ create_accounts_tab()
...
@@ -206,7 +202,7 @@ create_accounts_tab()
gtk_box_set_spacing
(
GTK_BOX
(
bbox
),
10
);
//GAIM_HIG_BOX_SPACE
gtk_box_set_spacing
(
GTK_BOX
(
bbox
),
10
);
//GAIM_HIG_BOX_SPACE
gtk_button_box_set_layout
(
GTK_BUTTON_BOX
(
bbox
),
GTK_BUTTONBOX_START
);
gtk_button_box_set_layout
(
GTK_BUTTON_BOX
(
bbox
),
GTK_BUTTONBOX_START
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
bbox
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
bbox
,
FALSE
,
FALSE
,
0
);
gtk_widget_show
(
bbox
);
gtk_widget_show
(
bbox
);
addButton
=
gtk_button_new_from_stock
(
GTK_STOCK_ADD
);
addButton
=
gtk_button_new_from_stock
(
GTK_STOCK_ADD
);
g_signal_connect_swapped
(
G_OBJECT
(
addButton
),
"clicked"
,
g_signal_connect_swapped
(
G_OBJECT
(
addButton
),
"clicked"
,
...
...
src/config/config.cpp
View file @
31a51a63
...
@@ -51,6 +51,18 @@ ConfigTree::createSection(const std::string& section) {
...
@@ -51,6 +51,18 @@ ConfigTree::createSection(const std::string& section) {
}
}
}
}
/**
* Remove the section only if it exists
*/
void
ConfigTree
::
removeSection
(
const
std
::
string
&
section
)
{
// if we doesn't find the item, create it
SectionMap
::
iterator
iter
=
_sections
.
find
(
section
);
if
(
iter
!=
_sections
.
end
())
{
_sections
.
erase
(
iter
);
}
}
/** Retrieve the sections as an array */
/** Retrieve the sections as an array */
TokenList
TokenList
ConfigTree
::
getSections
()
ConfigTree
::
getSections
()
...
...
src/config/config.h
View file @
31a51a63
...
@@ -65,7 +65,7 @@ public:
...
@@ -65,7 +65,7 @@ public:
~
ConfigTree
();
~
ConfigTree
();
void
createSection
(
const
std
::
string
&
section
);
void
createSection
(
const
std
::
string
&
section
);
void
removeSection
(
const
std
::
string
&
section
);
/**
/**
* Return an array of strings, listing the sections of the config file
* Return an array of strings, listing the sections of the config file
*
*
...
...
src/managerimpl.cpp
View file @
31a51a63
...
@@ -1713,15 +1713,14 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
...
@@ -1713,15 +1713,14 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
}
}
saveConfig
();
saveConfig
();
unloadAccountMap
();
/** @todo Make the daemon use the new settings */
loadAccountMap
();
if
(
_dbus
)
_dbus
->
getConfigurationManager
()
->
accountsChanged
();
if
(
_dbus
)
_dbus
->
getConfigurationManager
()
->
accountsChanged
();
}
}
void
void
ManagerImpl
::
removeAccount
(
const
AccountID
&
accountID
)
ManagerImpl
::
removeAccount
(
const
AccountID
&
accountID
)
{
{
_
debug
(
"Not implemented
\n
"
);
_
config
.
removeSection
(
accountID
);
//TODO
//TODO
/*AccountMap::iterator iter = _accountMap.begin();
/*AccountMap::iterator iter = _accountMap.begin();
while ( iter != _accountMap.end() ) {
while ( iter != _accountMap.end() ) {
...
@@ -1731,6 +1730,7 @@ ManagerImpl::removeAccount(const AccountID& accountID)
...
@@ -1731,6 +1730,7 @@ ManagerImpl::removeAccount(const AccountID& accountID)
}
}
iter++;
iter++;
}*/
}*/
saveConfig
();
}
}
//THREAD=Main
//THREAD=Main
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment