Skip to content

Commit

Permalink
add PROCESSING state in CallHanupAction
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyusa committed Feb 3, 2013
1 parent 8bec6bc commit e78ac82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion actions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ private class CallHangupAction : Gtk.Action {
}

public enum State {
PROCESSING,
TO_CALL,
TO_HANGUP,
}

private Gtk.ActionEntry[] entries = {
Gtk.ActionEntry () { name = null,
stock_id = "process-stop-symbolic",
label = _("Processing"),
accelerator = null,
tooltip = _("Processing"),
callback = null },
Gtk.ActionEntry () { name = null,
stock_id = "call-start-symbolic",
label = _("Call"),
Expand All @@ -45,7 +52,6 @@ private class CallHangupAction : Gtk.Action {

public CallHangupAction (View view, State state) {
Object (name: "ViewCombinedCallHangup", view: view, state: state);
set_sensitive (false);
}

private void _set_state (State state) {
Expand All @@ -67,6 +73,9 @@ private class CallHangupAction : Gtk.Action {
} else if (state == State.TO_CALL) {
sensitive = true;
handler_id = this.activate.connect (view.cmd_op_call);
} else if (state == State.PROCESSING) {
sensitive = false;
handler_id = 0;
} else {
assert_not_reached ();
}
Expand Down
4 changes: 2 additions & 2 deletions view.vala
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public class View : Window {
state = new_state;
} else if (state == State.IDLE && new_state == State.RINGING) {
// a remote party is calling us
action.state = CallHangupAction.State.TO_HANGUP;
action.state = CallHangupAction.State.PROCESSING;
toolbar.location.sensitive = false;
state = new_state;
} else if (state == State.ALERTING && new_state == State.IDLE) {
Expand Down Expand Up @@ -231,7 +231,7 @@ public class View : Window {

toolbar_action_group = new Gtk.ActionGroup ("SpecialToolbarActions");

Gtk.Action action = new CallHangupAction (this, CallHangupAction.State.TO_CALL);
Gtk.Action action = new CallHangupAction (this, CallHangupAction.State.PROCESSING);
toolbar_action_group.add_action (action);

action = new PageMenuAction (this);
Expand Down

0 comments on commit e78ac82

Please sign in to comment.