Commit 99f38281 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

Remove the deprecated HdyDialer

parent d3aa407b
......@@ -6,7 +6,6 @@
- [ ] documentation
- [ ] example application
- [ ] HdyColumn
- [ ] HdyDialer
- [ ] HdyLeaflet
- [ ] somewhere else (please elaborate)
......
......@@ -68,7 +68,6 @@ The documentation can be found online
to use the widgets in your favorite programming language can be found here:
### C
- [calls](https://source.puri.sm/Librem5/calls) (HdyDialer)
- [gnome-bluetooth](https://gitlab.gnome.org/GNOME/gnome-bluetooth) (HdyColumn)
- [GNOME Settings](https://gitlab.gnome.org/GNOME/gnome-control-center) (HdyActionRow, HdyColumn, HdyLeaflet, HdyTitleBar)
- [GNOME Web](https://gitlab.gnome.org/GNOME/epiphany) (HdyActionRow, HdyColumn, HdyComboRow, HdySearchBar)
......
......@@ -38,7 +38,6 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
hdy_dialer_button_get_symbols@LIBHANDY_1_0 0.0.3
hdy_dialer_button_get_type@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_button_new@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_clear_number@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_cycle_button_get_current_symbol@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_cycle_button_get_cycle_timeout@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_cycle_button_get_type@LIBHANDY_1_0 0.0~git20180429
......@@ -46,14 +45,6 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
hdy_dialer_cycle_button_new@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_cycle_button_set_cycle_timeout@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_cycle_button_stop_cycle@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_get_number@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_get_relief@LIBHANDY_1_0 0.0.3
hdy_dialer_get_show_action_buttons@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_get_type@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_new@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_set_number@LIBHANDY_1_0 0.0~git20180429
hdy_dialer_set_relief@LIBHANDY_1_0 0.0.3
hdy_dialer_set_show_action_buttons@LIBHANDY_1_0 0.0~git20180429
hdy_dialog_get_narrow@LIBHANDY_1_0 0.0.11
hdy_dialog_get_type@LIBHANDY_1_0 0.0.7
hdy_dialog_new@LIBHANDY_1_0 0.0.7
......
......@@ -39,7 +39,6 @@
<xi:include href="xml/hdy-animation.xml"/>
<xi:include href="xml/hdy-column.xml"/>
<xi:include href="xml/hdy-combo-row.xml"/>
<xi:include href="xml/hdy-dialer.xml"/>
<xi:include href="xml/hdy-dialer-button.xml"/>
<xi:include href="xml/hdy-dialer-cycle-button.xml"/>
<xi:include href="xml/hdy-dialog.xml"/>
......
......@@ -20,7 +20,6 @@ private_headers = [
]
images = [
'images/dialer.png',
'images/dialog-desktop.png',
'images/dialog-mobile.png',
'images/header-bar.png',
......
......@@ -18,9 +18,6 @@
<refsect2>
<title>Widgets</title>
<para role="gallery">
<link linkend="HdyDialer">
<inlinegraphic fileref="dialer.png" format="PNG"></inlinegraphic>
</link>
<link linkend="HdyKeypad">
<inlinegraphic fileref="keypad.png" format="PNG"></inlinegraphic>
</link>
......
......@@ -10,7 +10,6 @@
</glade-widget-class>
<glade-widget-class name="HdyColumn" generic-name="column" title="Column"/>
<glade-widget-class name="HdyComboRow" generic-name="comborow" title="Combo Row" since="0.0.6"/>
<glade-widget-class name="HdyDialer" generic-name="dialer" title="Dialer"/>
<glade-widget-class name="HdyDialog" generic-name="dialog" title="Dialog" since="0.0.7"/>
<glade-widget-class name="HdyExpanderRow" generic-name="expanderrow" title="Expander Row" since="0.0.6"/>
<glade-widget-class name="HdyHeaderBar" generic-name="headerbar" title="Header Bar" since="0.0.10"/>
......@@ -106,7 +105,6 @@
<glade-widget-class-ref name="HdyActionRow"/>
<glade-widget-class-ref name="HdyColumn"/>
<glade-widget-class-ref name="HdyComboRow"/>
<glade-widget-class-ref name="HdyDialer"/>
<glade-widget-class-ref name="HdyDialog"/>
<glade-widget-class-ref name="HdyExpanderRow"/>
<glade-widget-class-ref name="HdyHeaderBar"/>
......
src/gtkprogresstracker.c
src/hdy-column.c
src/hdy-dialer-button.c
src/hdy-dialer.c
src/hdy-dialer-cycle-button.c
src/hdy-fold.c
src/hdy-header-group.c
......
......@@ -3,7 +3,6 @@
<gresource prefix="/sm/puri/handy/ui">
<file preprocess="xml-stripblanks">hdy-action-row.ui</file>
<file preprocess="xml-stripblanks">hdy-combo-row.ui</file>
<file preprocess="xml-stripblanks">hdy-dialer.ui</file>
<file preprocess="xml-stripblanks">hdy-dialer-button.ui</file>
<file preprocess="xml-stripblanks">hdy-expander-row.ui</file>
<file preprocess="xml-stripblanks">hdy-keypad.ui</file>
......
......@@ -33,7 +33,6 @@ G_BEGIN_DECLS
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
#include "hdy-dialer-button.h"
#include "hdy-dialer-cycle-button.h"
#include "hdy-dialer.h"
G_GNUC_END_IGNORE_DEPRECATIONS
#include "hdy-dialog.h"
#include "hdy-enum-value-object.h"
......
This diff is collapsed.
/*
* Copyright (C) 2017 Purism SPC
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#if !defined(_HANDY_INSIDE) && !defined(HANDY_COMPILATION)
#error "Only <handy.h> can be included directly."
#endif
#include "hdy-deprecation-macros.h"
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define HDY_TYPE_DIALER (hdy_dialer_get_type())
G_DECLARE_DERIVABLE_TYPE (HdyDialer, hdy_dialer, HDY, DIALER, GtkBin)
/**
* HdyDialerClass:
* @parent_class: The parent class
* @submitted: Class handler for the #HdyDialer::submitted signal
*/
_HDY_DEPRECATED
struct _HdyDialerClass
{
GtkBinClass parent_class;
/* Signals
*/
void (*submitted) (HdyDialer *self,
const gchar *number);
};
_HDY_DEPRECATED
GtkWidget *hdy_dialer_new (void);
_HDY_DEPRECATED
const gchar *hdy_dialer_get_number (HdyDialer *self);
_HDY_DEPRECATED
void hdy_dialer_set_number (HdyDialer *self,
const char *number);
_HDY_DEPRECATED
void hdy_dialer_clear_number (HdyDialer *self);
_HDY_DEPRECATED
gboolean hdy_dialer_get_show_action_buttons (HdyDialer *self);
_HDY_DEPRECATED
void hdy_dialer_set_show_action_buttons (HdyDialer *self,
gboolean show);
_HDY_DEPRECATED
GtkReliefStyle hdy_dialer_get_relief (HdyDialer *self);
_HDY_DEPRECATED
void hdy_dialer_set_relief (HdyDialer *self,
GtkReliefStyle relief);
G_END_DECLS
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="HdyDialer" parent="GtkBin">
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="grid">
<property name="can_focus">False</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<property name="column_homogeneous">True</property>
<property name="no_show_all">True</property>
<property name="visible">True</property>
<child>
<object class="HdyDialerButton" id="btn_1">
<property name="symbols">1</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_2">
<property name="symbols">2ABC</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_3">
<property name="symbols">3DEF</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_4">
<property name="symbols">4GHI</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_5">
<property name="symbols">5JKL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_6">
<property name="symbols">6MNO</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_7">
<property name="symbols">7PQRS</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_8">
<property name="symbols">8TUV</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_9">
<property name="symbols">9WXYZ</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="HdyDialerCycleButton" id="btn_star">
<property name="symbols">*+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="HdyDialerButton" id="btn_0">
<property name="symbols">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="HdyDialerCycleButton" id="btn_hash">
<property name="symbols">#</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief" bind-source="btn_0" bind-property="relief" bind-flags="bidirectional|sync-create"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_submit">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="always_show_image">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_del">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">4</property>
</packing>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup">
<property name="mode">vertical</property>
<widgets>
<widget name="btn_1"/>
<widget name="btn_2"/>
<widget name="btn_3"/>
<widget name="btn_4"/>
<widget name="btn_5"/>
<widget name="btn_6"/>
<widget name="btn_7"/>
<widget name="btn_8"/>
<widget name="btn_9"/>
<widget name="btn_0"/>
<widget name="btn_star"/>
<widget name="btn_hash"/>
<widget name="btn_submit"/>
<widget name="btn_del"/>
</widgets>
</object>
</interface>
......@@ -67,7 +67,6 @@ src_headers = [
'hdy-deprecation-macros.h',
'hdy-dialer-button.h',
'hdy-dialer-cycle-button.h',
'hdy-dialer.h',
'hdy-dialog.h',
'hdy-enum-value-object.h',
'hdy-expander-row.h',
......@@ -113,7 +112,6 @@ src_sources = [
'hdy-combo-row.c',
'hdy-dialer-button.c',
'hdy-dialer-cycle-button.c',
'hdy-dialer.c',
'hdy-dialog.c',
'hdy-enum-value-object.c',
'hdy-expander-row.c',
......
......@@ -21,7 +21,6 @@ test_link_args = [
test_names = [
'test-action-row',
'test-combo-row',
'test-dialer',
'test-dialer-cycle-button',
'test-dialog',
'test-expander-row',
......
/*
* Copyright (C) 2017 Purism SPC
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
gint notified;
static void
notify_cb (GtkWidget *widget, gpointer data)
{
notified++;
}
static void
test_hdy_dialer_setnumber (void)
{
GtkWidget *dialer;
notified = 0;
dialer = hdy_dialer_new ();
g_signal_connect (dialer, "notify::number", G_CALLBACK (notify_cb), NULL);
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), ==, "");
hdy_dialer_set_number (HDY_DIALER (dialer), "#1234");
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), ==, "#1234");
g_assert_cmpint (notified, ==, 1);
/* Check that we're assigning to the string and not overwriting */
hdy_dialer_set_number (HDY_DIALER (dialer), "#123");
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), !=, "#1234");
g_assert_cmpint (notified, ==, 2);
/* Do the same using the GObject property */
g_object_set (G_OBJECT (dialer), "number", "#12", NULL);
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), !=, "#123");
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), ==, "#12");
g_assert_cmpint (notified, ==, 3);
}
static void
test_hdy_dialer_clear_number (void)
{
GtkWidget *dialer;
notified = 0;
dialer = hdy_dialer_new ();
g_signal_connect (dialer, "notify::number", G_CALLBACK (notify_cb), NULL);
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), ==, "");
hdy_dialer_clear_number (HDY_DIALER (dialer));
g_assert_cmpint (notified, ==, 0);
hdy_dialer_set_number (HDY_DIALER (dialer), "#1234");
g_assert_cmpstr (hdy_dialer_get_number (HDY_DIALER (dialer)), ==, "#1234");
g_assert_cmpint (notified, ==, 1);
hdy_dialer_clear_number (HDY_DIALER (dialer));
g_assert_cmpint (notified, ==, 2);
hdy_dialer_clear_number (HDY_DIALER (dialer));
g_assert_cmpint (notified, ==, 2);
}
static void
test_hdy_dialer_action_buttons (void)
{
HdyDialer *dialer = HDY_DIALER (hdy_dialer_new ());
gboolean val;
notified = 0;
g_signal_connect (dialer, "notify::show-action-buttons", G_CALLBACK (notify_cb), NULL);
/* Getters/setters */
g_assert_true (hdy_dialer_get_show_action_buttons (dialer));
hdy_dialer_set_show_action_buttons (dialer, FALSE);
g_assert_false (hdy_dialer_get_show_action_buttons (dialer));
hdy_dialer_set_show_action_buttons (dialer, TRUE);
g_assert_true (hdy_dialer_get_show_action_buttons (dialer));
g_assert_cmpint (notified, ==, 2);
/* Property */
g_object_set (dialer, "show-action-buttons", FALSE, NULL);
g_object_get (dialer, "show-action-buttons", &val, NULL);
g_assert_false (val);
g_assert_cmpint (notified, ==, 3);
/* Setting the same value should not notify */
hdy_dialer_set_show_action_buttons (dialer, FALSE);
g_assert_cmpint (notified, ==, 3);
}
static void
test_hdy_dialer_relief (void)
{
HdyDialer *dialer = HDY_DIALER (hdy_dialer_new ());
GtkReliefStyle style;
notified = 0;
g_signal_connect (dialer, "notify::relief", G_CALLBACK (notify_cb), NULL);
g_assert_cmpint (hdy_dialer_get_relief (dialer), ==, GTK_RELIEF_NORMAL);
hdy_dialer_set_relief (dialer, GTK_RELIEF_NONE);
g_assert_cmpint (hdy_dialer_get_relief (dialer), ==, GTK_RELIEF_NONE);
hdy_dialer_set_relief (dialer, GTK_RELIEF_NORMAL);
g_assert_cmpint (hdy_dialer_get_relief (dialer), ==, GTK_RELIEF_NORMAL);
g_assert_cmpint (notified, ==, 2);
/* Property */
g_object_set (dialer, "relief", GTK_RELIEF_NONE, NULL);
g_object_get (dialer, "relief", &style, NULL);
g_assert_cmpint (style, ==, GTK_RELIEF_NONE);
/* Setting the same value should not notify */
hdy_dialer_set_relief (dialer, GTK_RELIEF_NONE);
g_assert_cmpint (notified, ==, 3);
}
gint
main (gint argc,
gchar *argv[])
{
gtk_test_init (&argc, &argv, NULL);
hdy_init (&argc, &argv);
g_test_add_func ("/Handy/Dialer/setnumber", test_hdy_dialer_setnumber);
g_test_add_func ("/Handy/Dialer/clear_number", test_hdy_dialer_clear_number);
g_test_add_func ("/Handy/Dialer/action_buttons", test_hdy_dialer_action_buttons);
g_test_add_func ("/Handy/Dialer/relief", test_hdy_dialer_relief);
return g_test_run ();
}
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