Commit 31a51a63 authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin

Remove account

parent 029a6c9c
......@@ -71,7 +71,6 @@ delete_account( GtkWidget *widget, gpointer data )
if(selectedAccount)
{
dbus_remove_account(selectedAccount->accountID);
fill_account_list ();
}
}
......@@ -84,7 +83,6 @@ edit_account( GtkWidget *widget, gpointer data )
if(selectedAccount)
{
show_account_window(selectedAccount);
fill_account_list ();
}
}
......@@ -96,7 +94,6 @@ static void
add_account( GtkWidget *widget, gpointer data )
{
show_account_window(NULL);
fill_account_list ();
}
/* Call back when the user click on an account in the list */
......@@ -121,8 +118,7 @@ select_account(GtkTreeSelection *sel, GtkTreeModel *model)
if(selectedAccount)
{
gtk_widget_set_sensitive( GTK_WIDGET(editButton), TRUE);
/*TODO Set to TRUE when removeAccount is implemented */
gtk_widget_set_sensitive( GTK_WIDGET(deleteButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(deleteButton), TRUE);
}
g_print("select");
......@@ -206,7 +202,7 @@ create_accounts_tab()
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_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);
g_signal_connect_swapped(G_OBJECT(addButton), "clicked",
......
......@@ -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 */
TokenList
ConfigTree::getSections()
......
......@@ -65,7 +65,7 @@ public:
~ConfigTree();
void createSection(const std::string& section);
void removeSection(const std::string& section);
/**
* Return an array of strings, listing the sections of the config file
*
......
......@@ -1713,15 +1713,14 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
}
saveConfig();
unloadAccountMap();
loadAccountMap();
/** @todo Make the daemon use the new settings */
if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
}
void
ManagerImpl::removeAccount(const AccountID& accountID)
{
_debug("Not implemented\n");
_config.removeSection(accountID);
//TODO
/*AccountMap::iterator iter = _accountMap.begin();
while ( iter != _accountMap.end() ) {
......@@ -1731,6 +1730,7 @@ ManagerImpl::removeAccount(const AccountID& accountID)
}
iter++;
}*/
saveConfig();
}
//THREAD=Main
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment