Introduce CallsAccountOverview: A UI to allow managing VoIP accounts

CallsAccountOverview allows user to view, add and edit VoIP accounts
(currently SIP only).

Each CallsAccount is represented by a CallsAccountRow.

account-row: Staying alive
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-05-11 18:18:35 +02:00
committed by Evangelos Ribeiro Tzaras
parent fadeaeb6b5
commit fc7156fe75
12 changed files with 733 additions and 16 deletions

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.24"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsAccountOverview" parent="HdyWindow">
<property name="visible">True</property>
<property name="default-width">380</property>
<property name="default-height">660</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar">
<property name="title" translatable="yes">VoIP Accounts</property>
<property name="show-close-button">True</property>
<property name="visible">True</property>
<child>
<object class="GtkSpinner" id="spinner">
<property name="visible">True</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="vexpand">True</property>
<property name="transition-type">crossfade</property>
<!-- First child type: No accounts present: Show a blurb and a Add button -->
<child>
<object class="HdyStatusPage" id="intro">
<property name="visible">True</property>
<property name="title" translatable="yes">Add VoIP Accounts</property>
<property name="icon-name">system-users-symbolic</property>
<property name="description" translatable="yes">You can add VoIP account here. It will allow you to place and receive VoIP calls using the SIP protocol. This feature is still relatively new and not yet feature complete (i.e. no encrypted media).</property>
<child>
<object class="GtkButton" id="add_btn">
<property name="visible">True</property>
<property name="margin">6</property>
<property name="halign">center</property>
<property name="use-underline">True</property>
<property name="label" translatable="yes">_Add Account</property>
<signal name="clicked" handler="on_add_account_clicked" swapped="yes"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
<packing>
<property name="name">intro-page</property>
</packing>
</child>
<!-- Second child type: Some accounts present: Show a Listbox to manage accounts -->
<child>
<object class="GtkListBox" id="overview">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<!-- placeholder -->
<child type="placeholder"/>
</object>
<packing>
<property name="name">overview-page</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="HdyActionRow" id="add_row">
<property name="visible">True</property>
<property name="use-underline">True</property>
<property name="activatable">True</property>
<property name="title" translatable="yes">_Add Account</property>
<signal name="activated" handler="on_add_account_clicked" swapped="yes"/>
</object>
<object class="HdyWindow" id="account_window">
<property name="visible">False</property>
<property name="default-width">380</property>
<property name="default-height">660</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
</object>
</interface>

41
src/ui/account-row.ui Normal file
View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsAccountRow" parent="HdyActionRow">
<property name="visible">True</property>
<property name="title">Title</property>
<property name="subtitle">Subtitle</property>
<property name="activatable">True</property>
<child type="prefix">
<object class="HdyAvatar" id="avatar">
<property name="visible">True</property>
<property name="show-initials">True</property>
<property name="size">48</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="online_switch">
<property name="valign">center</property>
<property name="visible">True</property>
<property name="active">False</property>
<signal name="notify::active" handler="on_online_switched" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkButton" id="edit_btn">
<property name="visible">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">go-next-symbolic</property>
</object>
</child>
<signal name="clicked" handler="on_edit_clicked" swapped="yes"/>
</object>
</child>
</template>
</interface>

View File

@@ -30,7 +30,7 @@
</child>
<child>
<object class="GtkMenuButton">
<property name="visible">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="popover">menu_popover</property>
<child>
@@ -225,8 +225,8 @@
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="text" translatable="yes">VoIP Accounts</property>
<!--<property name="action-name">app.voip-accounts</property>-->
<property name="text" translatable="yes">_VoIP Accounts</property>
<property name="action-name">app.accounts</property>
</object>
</child>
<child>
@@ -237,20 +237,21 @@
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="text" translatable="yes">Keyboard shortcuts</property>
<property name="visible">False</property>
<property name="text" translatable="yes">_Keyboard shortcuts</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">False</property>
<property name="text" translatable="yes">_Help</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="text" translatable="yes">Help</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="text" translatable="yes">About Calls</property>
<property name="text" translatable="yes">_About Calls</property>
<property name="action-name">app.about</property>
</object>
</child>