commit 1bdb0791ee56fa081f8af1c18b457a1cf1c471fd parent 394afaba0b6410c163b459404d36a805c3166d51 Author: TheJackiMonster <thejackimonster@gmail.com> Date: Fri, 18 Feb 2022 15:26:52 +0100 Added dialog to delete with custom delay Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> Diffstat:
25 files changed, 458 insertions(+), 64 deletions(-)
diff --git a/Makefile b/Makefile @@ -19,6 +19,7 @@ SOURCES = messenger_gtk.c\ ui/chat.c\ ui/contact_entry.c\ ui/contacts.c\ + ui/delete_messages.c\ ui/file_load_entry.c\ ui/invite_contact.c\ ui/message.c\ diff --git a/resources/ui.gresource.xml b/resources/ui.gresource.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/org/gnunet/Messenger"> + <file compressed="true">ui/accounts.ui</file> <file compressed="true">ui/chat_entry.ui</file> <file compressed="true">ui/chat.ui</file> <file compressed="true">ui/contact_entry.ui</file> <file compressed="true">ui/contacts.ui</file> + <file compressed="true">ui/delete_messages.ui</file> <file compressed="true">ui/file_load_entry.ui</file> <file compressed="true">ui/invite_contact.ui</file> <file compressed="true">ui/message_content.ui</file> @@ -20,6 +22,5 @@ <file compressed="true">ui/account_entry.ui</file> <file compressed="true">ui/send_file.ui</file> <file compressed="true">ui/settings.ui</file> - <file compressed="true">ui/accounts.ui</file> </gresource> </gresources> diff --git a/resources/ui/accounts.ui b/resources/ui/accounts.ui @@ -24,6 +24,7 @@ Author: Tobias Frisch <requires lib="gtk+" version="3.24"/> <object class="GtkDialog" id="accounts_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">Accounts</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/contacts.ui b/resources/ui/contacts.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -24,6 +24,7 @@ Author: Tobias Frisch <requires lib="gtk+" version="3.24"/> <object class="GtkDialog" id="contacts_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">Contacts</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/delete_messages.ui b/resources/ui/delete_messages.ui @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 --> +<interface> + <requires lib="gtk+" version="3.24"/> + <object class="GtkListStore" id="delay_store"> + <columns> + <!-- column-name name --> + <column type="gchararray"/> + <!-- column-name value --> + <column type="gulong"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Off</col> + <col id="1">0</col> + </row> + <row> + <col id="0" translatable="yes">4 weeks</col> + <col id="1">2419200</col> + </row> + <row> + <col id="0" translatable="yes">1 week</col> + <col id="1">604800</col> + </row> + <row> + <col id="0" translatable="yes">1 day</col> + <col id="1">86400</col> + </row> + <row> + <col id="0" translatable="yes">8 hours</col> + <col id="1">28800</col> + </row> + <row> + <col id="0" translatable="yes">1 hour</col> + <col id="1">3600</col> + </row> + <row> + <col id="0" translatable="yes">5 minutes</col> + <col id="1">300</col> + </row> + <row> + <col id="0" translatable="yes">30 seconds</col> + <col id="1">30</col> + </row> + </data> + </object> + <object class="GtkDialog" id="delete_messages_dialog"> + <property name="can-focus">False</property> + <property name="title" translatable="yes">Delete Messages</property> + <property name="modal">True</property> + <property name="window-position">center-on-parent</property> + <property name="type-hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can-focus">False</property> + <property name="layout-style">end</property> + <child> + <object class="GtkButton" id="cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="confirm_button"> + <property name="label" translatable="yes">Confirm</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">center</property> + <property name="border-width">8</property> + <property name="orientation">vertical</property> + <property name="spacing">8</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">When do you want those messages to be deleted?</property> + <property name="wrap">True</property> + <property name="wrap-mode">word-char</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">-1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="delay_combobox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="model">delay_store</property> + <property name="active">0</property> + <child> + <object class="GtkCellRendererText"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="hide_checkbox"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Hide this dialog in the future</property> + <property name="ellipsize">end</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/resources/ui/invite_contact.ui b/resources/ui/invite_contact.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -24,6 +24,7 @@ Author: Tobias Frisch <requires lib="gtk+" version="3.24"/> <object class="GtkDialog" id="invite_contact_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">Invite Contact</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/messenger.ui b/resources/ui/messenger.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published diff --git a/resources/ui/new_account.ui b/resources/ui/new_account.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,6 +25,7 @@ Author: Tobias Frisch <requires lib="libhandy" version="1.2"/> <object class="GtkDialog" id="new_account_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">New Account</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/new_contact.ui b/resources/ui/new_contact.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -24,6 +24,7 @@ Author: Tobias Frisch <requires lib="gtk+" version="3.24"/> <object class="GtkDialog" id="new_contact_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">New Contact</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/new_group.ui b/resources/ui/new_group.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,6 +25,7 @@ Author: Tobias Frisch <requires lib="libhandy" version="1.2"/> <object class="GtkDialog" id="new_group_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">New Group</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/resources/ui/new_platform.ui b/resources/ui/new_platform.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 -Copyright (C) 2021 GNUnet e.V. +Copyright (C) 2021‑‑2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,6 +25,7 @@ Author: Tobias Frisch <requires lib="libhandy" version="1.2"/> <object class="GtkDialog" id="new_platform_dialog"> <property name="can-focus">False</property> + <property name="title" translatable="yes">New Platform</property> <property name="modal">True</property> <property name="window-position">center-on-parent</property> <property name="type-hint">dialog</property> diff --git a/src/application.c b/src/application.c @@ -99,8 +99,6 @@ application_init(MESSENGER_Application *app, pthread_mutex_init(&(app->chat.mutex), NULL); - app->ui.mobile = FALSE; - app->ui.bindings = g_hash_table_new(g_direct_hash, g_direct_equal); g_application_add_main_option( @@ -155,7 +153,7 @@ _application_chat_thread(void *args) 'm', "mobile", "Optimize UI spacing for mobile devices", - &(app->ui.mobile) + &(app->settings.mobile_design) ), GNUNET_GETOPT_option_string ( 'e', diff --git a/src/application.h b/src/application.h @@ -32,6 +32,7 @@ #include "ui/accounts.h" #include "ui/contacts.h" +#include "ui/delete_messages.h" #include "ui/invite_contact.h" #include "ui/messenger.h" #include "ui/new_account.h" @@ -71,7 +72,6 @@ typedef struct MESSENGER_Application struct { int status; - gboolean mobile; GHashTable *bindings; @@ -79,6 +79,7 @@ typedef struct MESSENGER_Application UI_INVITE_CONTACT_Handle invite_contact; UI_SEND_FILE_Handle send_file; + UI_DELETE_MESSAGES_Handle delete_messages; UI_NEW_CONTACT_Handle new_contact; UI_NEW_GROUP_Handle new_group; @@ -89,6 +90,14 @@ typedef struct MESSENGER_Application UI_CONTACTS_Handle contacts; UI_SETTINGS_Handle settings; } ui; + + struct { + gboolean mobile_design; + gboolean hide_delete_dialog; + gboolean disable_notifications; + gboolean accept_all_files; + gboolean accept_all_invites; + } settings; } MESSENGER_Application; void diff --git a/src/ui/accounts.c b/src/ui/accounts.c @@ -148,11 +148,6 @@ ui_accounts_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "accounts_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("Accounts") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/chat.c b/src/ui/chat.c @@ -33,6 +33,7 @@ #include "../application.h" #include "../contact.h" #include "account_entry.h" +#include "delete_messages.h" static gboolean _flap_reveal_switch(gpointer user_data) @@ -214,13 +215,11 @@ handle_chat_selection_close_button_click(UNUSED GtkButton *button, gtk_list_box_unselect_all(listbox); } -static void -handle_chat_selection_delete_button_click(UNUSED GtkButton *button, - gpointer user_data) +void +_delete_messages_callback(GHashTable *bindings, + GList *selected, + gulong delay) { - UI_CHAT_Handle *handle = (UI_CHAT_Handle*) user_data; - - GList *selected = gtk_list_box_get_selected_rows(handle->messages_listbox); UI_MESSAGE_Handle *message; while (selected) @@ -230,14 +229,17 @@ handle_chat_selection_delete_button_click(UNUSED GtkButton *button, if (!row) goto skip_row; - message = g_hash_table_lookup(handle->bindings, row); + message = g_hash_table_lookup(bindings, row); if ((!message) || (!(message->msg))) goto skip_row; GNUNET_CHAT_message_delete( - message->msg, - GNUNET_TIME_relative_get_zero_() + message->msg, + GNUNET_TIME_relative_multiply( + GNUNET_TIME_relative_get_second_(), + delay + ) ); skip_row: @@ -246,6 +248,32 @@ handle_chat_selection_delete_button_click(UNUSED GtkButton *button, } static void +handle_chat_selection_delete_button_click(UNUSED GtkButton *button, + gpointer user_data) +{ + UI_CHAT_Handle *handle = (UI_CHAT_Handle*) user_data; + + MESSENGER_Application *app = handle->app; + + GList *selected = gtk_list_box_get_selected_rows(handle->messages_listbox); + + if (app->settings.hide_delete_dialog) + _delete_messages_callback(app->ui.bindings, selected, 0); + else + { + ui_delete_messages_dialog_init(app, &(app->ui.delete_messages)); + + ui_delete_messages_dialog_link( + &(app->ui.delete_messages), + _delete_messages_callback, + selected + ); + + gtk_widget_show(GTK_WIDGET(app->ui.delete_messages.dialog)); + } +} + +static void handle_attach_file_button_click(GtkButton *button, gpointer user_data) { @@ -366,7 +394,7 @@ handle_send_text_key_press (GtkWidget *widget, { MESSENGER_Application *app = (MESSENGER_Application*) user_data; - if ((app->ui.mobile) || + if ((app->settings.mobile_design) || (event->state & GDK_SHIFT_MASK) || ((event->keyval != GDK_KEY_Return) && (event->keyval != GDK_KEY_KP_Enter))) @@ -393,7 +421,7 @@ ui_chat_new(MESSENGER_Application *app) UI_CHAT_Handle *handle = g_malloc(sizeof(UI_CHAT_Handle)); UI_MESSENGER_Handle *messenger = &(app->ui.messenger); - handle->bindings = app->ui.bindings; + handle->app = app; handle->messages = NULL; handle->edge_value = 0; diff --git a/src/ui/chat.h b/src/ui/chat.h @@ -38,7 +38,7 @@ typedef struct UI_FILE_LOAD_ENTRY_Handle UI_FILE_LOAD_ENTRY_Handle; typedef struct UI_CHAT_Handle { - GHashTable *bindings; + MESSENGER_Application *app; GList *messages; gdouble edge_value; diff --git a/src/ui/contacts.c b/src/ui/contacts.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -188,11 +188,6 @@ ui_contacts_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "contacts_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("Contacts") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/delete_messages.c b/src/ui/delete_messages.c @@ -0,0 +1,152 @@ +/* + This file is part of GNUnet. + Copyright (C) 2022 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +/* + * @author Tobias Frisch + * @file ui/delete_messages.c + */ + +#include "delete_messages.h" + +#include "../application.h" + +static void +handle_cancel_button_click(UNUSED GtkButton *button, + gpointer user_data) +{ + GtkDialog *dialog = GTK_DIALOG(user_data); + gtk_window_close(GTK_WINDOW(dialog)); +} + +static void +handle_confirm_button_click(UNUSED GtkButton *button, + gpointer user_data) +{ + MESSENGER_Application *app = (MESSENGER_Application*) user_data; + + app->settings.hide_delete_dialog = gtk_toggle_button_get_active( + GTK_TOGGLE_BUTTON(app->ui.delete_messages.hide_checkbox) + ); + + GtkTreeModel *model = gtk_combo_box_get_model( + app->ui.delete_messages.delay_combobox + ); + + gulong delay = 0; + + GtkTreeIter iter; + if (gtk_combo_box_get_active_iter(app->ui.delete_messages.delay_combobox, + &iter)) + gtk_tree_model_get(model, &iter, 1, &delay, -1); + + if (app->ui.delete_messages.callback) + app->ui.delete_messages.callback( + app->ui.bindings, + app->ui.delete_messages.selected, + delay + ); + + gtk_window_close(GTK_WINDOW(app->ui.delete_messages.dialog)); +} + +static void +handle_dialog_destroy(UNUSED GtkWidget *window, + gpointer user_data) +{ + MESSENGER_Application *app = (MESSENGER_Application*) user_data; + + ui_delete_messages_dialog_cleanup(&(app->ui.delete_messages)); +} + +void +ui_delete_messages_dialog_init(MESSENGER_Application *app, + UI_DELETE_MESSAGES_Handle *handle) +{ + handle->selected = NULL; + handle->callback = NULL; + + handle->builder = gtk_builder_new_from_resource( + application_get_resource_path(app, "ui/delete_messages.ui") + ); + + handle->dialog = GTK_DIALOG( + gtk_builder_get_object(handle->builder, "delete_messages_dialog") + ); + + gtk_window_set_transient_for( + GTK_WINDOW(handle->dialog), + GTK_WINDOW(app->ui.messenger.main_window) + ); + + handle->delay_store = GTK_LIST_STORE( + gtk_builder_get_object(handle->builder, "delay_store") + ); + + handle->delay_combobox = GTK_COMBO_BOX( + gtk_builder_get_object(handle->builder, "delay_combobox") + ); + + handle->hide_checkbox = GTK_CHECK_BUTTON( + gtk_builder_get_object(handle->builder, "hide_checkbox") + ); + + handle->cancel_button = GTK_BUTTON( + gtk_builder_get_object(handle->builder, "cancel_button") + ); + + g_signal_connect( + handle->cancel_button, + "clicked", + G_CALLBACK(handle_cancel_button_click), + handle->dialog + ); + + handle->confirm_button = GTK_BUTTON( + gtk_builder_get_object(handle->builder, "confirm_button") + ); + + g_signal_connect( + handle->confirm_button, + "clicked", + G_CALLBACK(handle_confirm_button_click), + app + ); + + g_signal_connect( + handle->dialog, + "destroy", + G_CALLBACK(handle_dialog_destroy), + app + ); +} + +void +ui_delete_messages_dialog_link(UI_DELETE_MESSAGES_Handle *handle, + UI_DELETE_MESSAGES_Callback callback, + GList *selected) +{ + handle->selected = selected; + handle->callback = callback; +} + +void +ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle) +{ + g_object_unref(handle->builder); +} diff --git a/src/ui/delete_messages.h b/src/ui/delete_messages.h @@ -0,0 +1,65 @@ +/* + This file is part of GNUnet. + Copyright (C) 2022 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +/* + * @author Tobias Frisch + * @file ui/delete_messages.h + */ + +#ifndef UI_DELETE_MESSAGES_H_ +#define UI_DELETE_MESSAGES_H_ + +#include "messenger.h" + +typedef void +(*UI_DELETE_MESSAGES_Callback) (GHashTable *bindings, + GList *selected, + gulong delay); + +typedef struct UI_DELETE_MESSAGES_Handle +{ + GList *selected; + + UI_DELETE_MESSAGES_Callback callback; + + GtkBuilder *builder; + GtkDialog *dialog; + + GtkListStore *delay_store; + + GtkComboBox *delay_combobox; + GtkCheckButton *hide_checkbox; + + GtkButton *cancel_button; + GtkButton *confirm_button; +} UI_DELETE_MESSAGES_Handle; + +void +ui_delete_messages_dialog_init(MESSENGER_Application *app, + UI_DELETE_MESSAGES_Handle *handle); + +void +ui_delete_messages_dialog_link(UI_DELETE_MESSAGES_Handle *handle, + UI_DELETE_MESSAGES_Callback callback, + GList *selected); + +void +ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle); + +#endif /* UI_DELETE_MESSAGES_H_ */ diff --git a/src/ui/invite_contact.c b/src/ui/invite_contact.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -180,11 +180,6 @@ ui_invite_contact_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "invite_contact_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("Invite Contact") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/messenger.c b/src/ui/messenger.c @@ -308,7 +308,7 @@ ui_messenger_init(MESSENGER_Application *app, G_BINDING_INVERT_BOOLEAN ); - if (app->ui.mobile) + if (app->settings.mobile_design) g_object_bind_property( handle->leaflet_chat, "folded", diff --git a/src/ui/new_account.c b/src/ui/new_account.c @@ -123,11 +123,6 @@ ui_new_account_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "new_account_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("New Account") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c @@ -295,11 +295,6 @@ ui_new_contact_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "new_contact_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("New Contact") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/new_group.c b/src/ui/new_group.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -206,11 +206,6 @@ ui_new_group_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "new_group_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("New Group") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window) diff --git a/src/ui/new_platform.c b/src/ui/new_platform.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -108,11 +108,6 @@ ui_new_platform_dialog_init(MESSENGER_Application *app, gtk_builder_get_object(handle->builder, "new_platform_dialog") ); - gtk_window_set_title( - GTK_WINDOW(handle->dialog), - _("New Platform") - ); - gtk_window_set_transient_for( GTK_WINDOW(handle->dialog), GTK_WINDOW(app->ui.messenger.main_window)