Commit d61e3719 authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin
Browse files

New call button not enabled when no accounts

parent 3ec90c19
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -132,6 +132,7 @@ sflphone_fill_account_list() ...@@ -132,6 +132,7 @@ sflphone_fill_account_list()
} }
toolbar_update_buttons();
} }
gboolean gboolean
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -89,7 +89,7 @@ unhold( GtkWidget *widget, gpointer data ) ...@@ -89,7 +89,7 @@ unhold( GtkWidget *widget, gpointer data )
} }
void void
update_buttons () toolbar_update_buttons ()
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), FALSE);
...@@ -145,7 +145,14 @@ update_buttons () ...@@ -145,7 +145,14 @@ update_buttons ()
} }
else else
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); if( account_list_get_size() > 0 )
{
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE);
}
else
{
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
}
} }
} }
/* Call back when the user click on a call in the list */ /* Call back when the user click on a call in the list */
...@@ -164,7 +171,7 @@ selected(GtkTreeSelection *sel, GtkTreeModel *model) ...@@ -164,7 +171,7 @@ selected(GtkTreeSelection *sel, GtkTreeModel *model)
call_select((call_t*) g_value_get_pointer(&val)); call_select((call_t*) g_value_get_pointer(&val));
g_value_unset(&val); g_value_unset(&val);
update_buttons(); toolbar_update_buttons();
} }
/* A row is activated when it is double clicked */ /* A row is activated when it is double clicked */
...@@ -309,6 +316,8 @@ create_call_tree (){ ...@@ -309,6 +316,8 @@ create_call_tree (){
gtk_widget_show(ret); gtk_widget_show(ret);
toolbar_update_buttons();
return ret; return ret;
} }
...@@ -340,7 +349,7 @@ update_call_tree_remove (call_t * c) ...@@ -340,7 +349,7 @@ update_call_tree_remove (call_t * c)
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
if(selectedCall == c) if(selectedCall == c)
call_select(NULL); call_select(NULL);
update_buttons(); toolbar_update_buttons();
} }
void void
...@@ -430,7 +439,7 @@ update_call_tree (call_t * c) ...@@ -430,7 +439,7 @@ update_call_tree (call_t * c)
} }
} }
update_buttons(); toolbar_update_buttons();
//return row_ref; //return row_ref;
} }
...@@ -486,6 +495,6 @@ update_call_tree_add (call_t * c) ...@@ -486,6 +495,6 @@ update_call_tree_add (call_t * c)
//g_free(markup); //g_free(markup);
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter);
update_buttons(); toolbar_update_buttons();
//return row_ref; //return row_ref;
} }
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
*/ */
GtkWidget * create_call_tree(); GtkWidget * create_call_tree();
void toolbar_update_buttons();
void update_call_tree_add (call_t * c); void update_call_tree_add (call_t * c);
void update_call_tree (call_t * c); void update_call_tree (call_t * c);
void update_call_tree_remove (call_t * c); void update_call_tree_remove (call_t * c);
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
Supports Markdown
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