diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a78bdc6184a9427c896d394cc0bc9ecde38dbcf..6222237a57d41c35022bbf5c338ca93e3fbf1686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,13 +26,13 @@ ENDIF() IF( NOT ("$ENV{SOURCE_DATE_EPOCH}" STREQUAL "")) EXECUTE_PROCESS( COMMAND date -u -d "1970-01-01 UTC $ENV{SOURCE_DATE_EPOCH} seconds" "+%Y-%m-%d %H:%M:%S UTC" - OUTPUT_VARIABLE RING_CLIENT_BUILD_DATE + OUTPUT_VARIABLE CLIENT_BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) -ELSEIF( "${RING_CLIENT_BUILD_DATE}" STREQUAL "") +ELSEIF( "${CLIENT_BUILD_DATE}" STREQUAL "") EXECUTE_PROCESS( COMMAND date -u "+%Y-%m-%d %H:%M:%S UTC" - OUTPUT_VARIABLE RING_CLIENT_BUILD_DATE + OUTPUT_VARIABLE CLIENT_BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) ENDIF() @@ -54,9 +54,9 @@ SET(ENABLE_QT5 true) SET(CMAKE_BUILD_TYPE Debug) # during packaging the CMAKE_INSTALL_PREFIX is used to specify where to install the files, but it -# may not be the same as where the package will put them, use RING_INSTALL_PREFIX to let the client +# may not be the same as where the package will put them, use JAMI_INSTALL_PREFIX to let the client # know at runtime where to expect installed files to be located -SET(RING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} +SET(JAMI_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "prefix where the package will be installed on the user's system (eg: /usr/local); defaults to the CMAKE_INSTALL_PREFIX" ) @@ -235,7 +235,7 @@ ADD_CUSTOM_TARGET( COMMAND ${CMAKE_COMMAND} -DGIT_REVISION_INPUT_FILE=${GIT_REVISION_INPUT_FILE} -DGIT_REVISION_OUTPUT_FILE=${GIT_REVISION_OUTPUT_FILE} - -DRING_CLIENT_BUILD_DATE=${RING_CLIENT_BUILD_DATE} + -DCLIENT_BUILD_DATE=${CLIENT_BUILD_DATE} -P ${CMAKE_SOURCE_DIR}/cmake/GitRevision.cmake COMMENT "generating ${GIT_REVISION_OUTPUT_FILE}" ) @@ -248,12 +248,12 @@ ADD_CUSTOM_COMMAND( # source files to compile SET( SRC_FILES src/main.cpp - src/ring_client.h - src/ring_client.cpp - src/ring_client_options.h - src/ring_client_options.c - src/ringmainwindow.h - src/ringmainwindow.cpp + src/client.h + src/client.cpp + src/client_options.h + src/client_options.c + src/mainwindow.h + src/mainwindow.cpp src/incomingcallview.h src/incomingcallview.cpp src/currentcallview.h @@ -289,15 +289,15 @@ SET( SRC_FILES src/native/pixbufmanipulator.cpp src/utils/models.h src/utils/models.cpp - src/ringnotify.h - src/ringnotify.cpp + src/notifier.h + src/notifier.cpp src/utils/files.h src/utils/files.cpp ${GIT_REVISION_OUTPUT_FILE} src/native/dbuserrorhandler.h src/native/dbuserrorhandler.cpp - src/ringwelcomeview.h - src/ringwelcomeview.cpp + src/welcomeview.h + src/welcomeview.cpp src/webkitchatcontainer.h src/webkitchatcontainer.cpp src/chatview.h diff --git a/cmake/GitRevision.cmake b/cmake/GitRevision.cmake index eff05e3271cd4801c9f3bdadb10e0de315fafcda..81ea0e4a0e1c378051f9d17391741851cc676611 100644 --- a/cmake/GitRevision.cmake +++ b/cmake/GitRevision.cmake @@ -21,13 +21,13 @@ FIND_PACKAGE(Git) IF(GIT_FOUND) EXECUTE_PROCESS( COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD - OUTPUT_VARIABLE RING_CLIENT_REVISION + OUTPUT_VARIABLE CLIENT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) ENDIF() -IF( "${RING_CLIENT_REVISION}" STREQUAL "") - SET(RING_CLIENT_REVISION "unknown") +IF( "${CLIENT_REVISION}" STREQUAL "") + SET(CLIENT_REVISION "unknown") ENDIF() MESSAGE( STATUS "GIT_REVISION_INPUT_FILE: " ${GIT_REVISION_INPUT_FILE} ) diff --git a/po/POTFILES.in b/po/POTFILES.in index 169e303052af42e32b9e6328d08cf6c171a4c70f..d758427e048392e94d84573ff1698edbe9093439 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -17,7 +17,7 @@ ui/avatarmanipulation.ui src/conversationsview.cpp src/mediasettingsview.cpp src/ring_client.cpp -src/ringnotify.cpp +src/notifier.cpp src/marshals.cpp src/usernameregistrationbox.cpp src/generalsettingsview.cpp diff --git a/po/ring-client-gnome.pot b/po/ring-client-gnome.pot index 2ae553d6a46854cca5b9ca6c30bee1d44107c2c1..3e7e16d6a45abc72171fd7177ce101e6db3eca50 100644 --- a/po/ring-client-gnome.pot +++ b/po/ring-client-gnome.pot @@ -378,7 +378,7 @@ msgstr "" #: ui/accountcreationwizard.ui:561 msgid "" "By checking this, you will register a unique username on the Jami network. " -"People can use it to contact you instead of using your RingID, which is 40 " +"People can use it to contact you instead of using your ID, which is 40 " "characters long." msgstr "" @@ -946,22 +946,22 @@ msgstr "" msgid "Quit" msgstr "" -#: src/ringnotify.cpp:336 +#: src/notifier.cpp:336 msgctxt "" msgid "Open conversation" msgstr "" -#: src/ringnotify.cpp:344 src/ringnotify.cpp:360 +#: src/notifier.cpp:344 src/notifier.cpp:360 msgctxt "" msgid "Accept" msgstr "" -#: src/ringnotify.cpp:351 +#: src/notifier.cpp:351 msgctxt "" msgid "Refuse" msgstr "" -#: src/ringnotify.cpp:367 +#: src/notifier.cpp:367 msgctxt "" msgid "Decline" msgstr "" diff --git a/src/accountcreationwizard.cpp b/src/accountcreationwizard.cpp index a81659599781e99c76bb0aefe7e3af95562c020a..dc60be775ccd54341d447ae1cb515e109459399b 100644 --- a/src/accountcreationwizard.cpp +++ b/src/accountcreationwizard.cpp @@ -25,7 +25,7 @@ // LRC #include "api/newaccountmodel.h" -// Ring Client +// Jami Client #include "utils/models.h" #include "avatarmanipulation.h" #include "accountcreationwizard.h" diff --git a/src/accountmigrationview.cpp b/src/accountmigrationview.cpp index 1f173bc83c1be02e0d0e371440b06cec387f4ac1..97f9e179acd55d35146a0de30acdcffc076cb3d1 100644 --- a/src/accountmigrationview.cpp +++ b/src/accountmigrationview.cpp @@ -32,7 +32,7 @@ // LRC #include <api/newaccountmodel.h> -// Ring Client +// Jami Client #include "accountmigrationview.h" #include "native/pixbufmanipulator.h" diff --git a/src/avatarmanipulation.cpp b/src/avatarmanipulation.cpp index 28881beb830633e8008105f680be687241eedb8c..d77d71c5b08bb350b0f2fff26263c34e0378d734 100644 --- a/src/avatarmanipulation.cpp +++ b/src/avatarmanipulation.cpp @@ -406,10 +406,10 @@ choose_picture(AvatarManipulation *self) auto preview = gtk_image_new(); - GtkWidget *ring_main_window = gtk_widget_get_toplevel(GTK_WIDGET(self)); + GtkWidget *main_window = gtk_widget_get_toplevel(GTK_WIDGET(self)); auto dialog = gtk_file_chooser_dialog_new (_("Open Avatar Image"), - GTK_WINDOW(ring_main_window), + GTK_WINDOW(main_window), action, _("_Cancel"), GTK_RESPONSE_CANCEL, diff --git a/src/ring_client.cpp b/src/client.cpp similarity index 80% rename from src/ring_client.cpp rename to src/client.cpp index d580ac86e58b7efba345b4a6ae4ae72335501dbe..b072429fe85c88c17ce6c89aa6dd6c4c7db8ff92 100644 --- a/src/ring_client.cpp +++ b/src/client.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ring_client.h" +#include "client.h" // system #include <memory> @@ -40,13 +40,13 @@ #include <smartinfohub.h> #include <globalinstances.h> -// Ring client -#include "ring_client_options.h" -#include "ringmainwindow.h" +// Jami Client +#include "client_options.h" +#include "mainwindow.h" #include "dialogs.h" #include "native/pixbufmanipulator.h" #include "native/dbuserrorhandler.h" -#include "ringnotify.h" +#include "notifier.h" #include "config.h" #include "utils/files.h" #include "revision.h" @@ -57,19 +57,19 @@ #include <libappindicator/app-indicator.h> #endif -struct _RingClientClass +struct _ClientClass { GtkApplicationClass parent_class; }; -struct _RingClient +struct _Client { GtkApplication parent; }; -typedef struct _RingClientPrivate RingClientPrivate; +typedef struct _ClientPrivate ClientPrivate; -struct _RingClientPrivate { +struct _ClientPrivate { /* args */ int argc; char **argv; @@ -78,7 +78,7 @@ struct _RingClientPrivate { /* main window */ GtkWidget *win; - /* for libRingclient */ + /* for libRingClient */ QCoreApplication *qtapp; /* UAM */ QMetaObject::Connection uam_updated; @@ -100,9 +100,9 @@ typedef union _int_ptr_t gpointer ptr; } int_ptr_t; -G_DEFINE_TYPE_WITH_PRIVATE(RingClient, ring_client, GTK_TYPE_APPLICATION); +G_DEFINE_TYPE_WITH_PRIVATE(Client, client, GTK_TYPE_APPLICATION); -#define RING_CLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), RING_CLIENT_TYPE, RingClientPrivate)) +#define CLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLIENT_TYPE, ClientPrivate)) static void @@ -121,7 +121,7 @@ exception_dialog(const char* msg) } static void -ring_accelerators(RingClient *client) +accelerators(Client *client) { #if GTK_CHECK_VERSION(3,12,0) const gchar *quit_accels[2] = {"<Ctrl>Q", NULL}; @@ -195,7 +195,7 @@ action_quit(G_GNUC_UNUSED GSimpleAction *simple, #if GLIB_CHECK_VERSION(2,32,0) g_application_quit(G_APPLICATION(user_data)); #else - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(user_data); + ClientPrivate *priv = CLIENT_GET_PRIVATE(user_data); gtk_widget_destroy(priv->win); #endif } @@ -206,9 +206,9 @@ action_about(G_GNUC_UNUSED GSimpleAction *simple, gpointer user_data) { g_return_if_fail(G_IS_APPLICATION(user_data)); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(user_data); + ClientPrivate *priv = CLIENT_GET_PRIVATE(user_data); - ring_about_dialog(priv->win); + about_dialog(priv->win); } static void @@ -217,7 +217,7 @@ exec_action(GSimpleAction *simple, gpointer user_data) { g_return_if_fail(G_IS_APPLICATION(user_data)); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(user_data); + ClientPrivate *priv = CLIENT_GET_PRIVATE(user_data); GValue value = G_VALUE_INIT; g_value_init(&value, G_TYPE_STRING); @@ -226,33 +226,33 @@ exec_action(GSimpleAction *simple, std::string name = g_value_get_string(&value); if (name == "display_account_list") - ring_main_window_display_account_list(RING_MAIN_WINDOW(priv->win)); + main_window_display_account_list(MAIN_WINDOW(priv->win)); else if (name == "search") - ring_main_window_search(RING_MAIN_WINDOW(priv->win)); + main_window_search(MAIN_WINDOW(priv->win)); else if (name == "conversations_list") - ring_main_window_conversations_list(RING_MAIN_WINDOW(priv->win)); + main_window_conversations_list(MAIN_WINDOW(priv->win)); else if (name == "requests_list") - ring_main_window_requests_list(RING_MAIN_WINDOW(priv->win)); + main_window_requests_list(MAIN_WINDOW(priv->win)); else if (name == "audio_call") - ring_main_window_audio_call(RING_MAIN_WINDOW(priv->win)); + main_window_audio_call(MAIN_WINDOW(priv->win)); else if (name == "clear_history") - ring_main_window_clear_history(RING_MAIN_WINDOW(priv->win)); + main_window_clear_history(MAIN_WINDOW(priv->win)); else if (name == "remove_conversation") - ring_main_window_remove_conversation(RING_MAIN_WINDOW(priv->win)); + main_window_remove_conversation(MAIN_WINDOW(priv->win)); else if (name == "block_contact") - ring_main_window_block_contact(RING_MAIN_WINDOW(priv->win)); + main_window_block_contact(MAIN_WINDOW(priv->win)); else if (name == "unblock_contact") - ring_main_window_unblock_contact(RING_MAIN_WINDOW(priv->win)); + main_window_unblock_contact(MAIN_WINDOW(priv->win)); else if (name == "copy_contact") - ring_main_window_copy_contact(RING_MAIN_WINDOW(priv->win)); + main_window_copy_contact(MAIN_WINDOW(priv->win)); else if (name == "add_contact") - ring_main_window_add_contact(RING_MAIN_WINDOW(priv->win)); + main_window_add_contact(MAIN_WINDOW(priv->win)); else if (name == "accept_call") - ring_main_window_accept_call(RING_MAIN_WINDOW(priv->win)); + main_window_accept_call(MAIN_WINDOW(priv->win)); else if (name == "decline_call") - ring_main_window_decline_call(RING_MAIN_WINDOW(priv->win)); + main_window_decline_call(MAIN_WINDOW(priv->win)); else if (name == "toggle_fullscreen") - ring_main_window_toggle_fullscreen(RING_MAIN_WINDOW(priv->win)); + main_window_toggle_fullscreen(MAIN_WINDOW(priv->win)); else g_warning("Missing implementation for this action: %s", name.c_str()); } @@ -272,7 +272,7 @@ static void action_show_shortcuts(G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVariant *parameter, gpointer user_data) { g_return_if_fail(G_IS_APPLICATION(user_data)); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(user_data); + ClientPrivate *priv = CLIENT_GET_PRIVATE(user_data); GtkBuilder *builder = gtk_builder_new_from_resource("/net/jami/JamiGnome/help-overlay.ui"); GtkWidget *overlay = GTK_WIDGET(gtk_builder_get_object (builder, "help_overlay")); @@ -283,7 +283,7 @@ action_show_shortcuts(G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVarian g_object_unref(builder); } -static const GActionEntry ring_actions[] = { +static const GActionEntry actions[] = { {"accept", NULL, NULL, NULL, NULL, {0}}, {"hangup", NULL, NULL, NULL, NULL, {0}}, {"hold", NULL, NULL, "false", NULL, {0}}, @@ -317,9 +317,9 @@ autostart_toggled(GSettings *settings, G_GNUC_UNUSED gchar *key, G_GNUC_UNUSED g } static void -show_main_window_toggled(RingClient *client) +show_main_window_toggled(Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); if (g_settings_get_boolean(priv->settings, "show-main-window")) { gtk_window_present(GTK_WINDOW(priv->win)); @@ -329,31 +329,31 @@ show_main_window_toggled(RingClient *client) } static void -ring_window_show(RingClient *client) +window_show(Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); g_settings_set_boolean(priv->settings, "show-main-window", TRUE); } static void -ring_window_hide(RingClient *client) +window_hide(Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); g_settings_set_boolean(priv->settings, "show-main-window", FALSE); } static gboolean -on_close_window(GtkWidget *window, G_GNUC_UNUSED GdkEvent *event, RingClient *client) +on_close_window(GtkWidget *window, G_GNUC_UNUSED GdkEvent *event, Client *client) { - g_return_val_if_fail(GTK_IS_WINDOW(window) && IS_RING_CLIENT(client), FALSE); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + g_return_val_if_fail(GTK_IS_WINDOW(window) && IS_CLIENT(client), FALSE); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); if (g_settings_get_boolean(priv->settings, "show-status-icon")) { /* we want to simply hide the window and keep the client running */ - auto closeWindow = ring_main_window_can_close(RING_MAIN_WINDOW(window)); + auto closeWindow = main_window_can_close(MAIN_WINDOW(window)); if (closeWindow) { - ring_window_hide(client); - ring_main_window_reset(RING_MAIN_WINDOW(window)); + window_hide(client); + main_window_reset(MAIN_WINDOW(window)); } return TRUE; /* do not propagate event */ } else { @@ -368,9 +368,9 @@ static void popup_menu(GtkStatusIcon *self, guint button, guint when, - RingClient *client) + Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); G_GNUC_BEGIN_IGNORE_DEPRECATIONS // GtkStatusIcon is deprecated since 3.14, but we fallback on it gtk_menu_popup(GTK_MENU(priv->icon_menu), NULL, NULL, gtk_status_icon_position_menu, self, button, when); G_GNUC_END_IGNORE_DEPRECATIONS @@ -379,9 +379,9 @@ popup_menu(GtkStatusIcon *self, #endif static void -init_systray(RingClient *client) +init_systray(Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); // init menu if (!priv->icon_menu) { @@ -422,7 +422,7 @@ init_systray(RingClient *client) auto status_icon = gtk_status_icon_new_from_pixbuf(icon); gtk_status_icon_set_title(status_icon, "jami"); G_GNUC_END_IGNORE_DEPRECATIONS - g_signal_connect_swapped(status_icon, "activate", G_CALLBACK(ring_window_show), client); + g_signal_connect_swapped(status_icon, "activate", G_CALLBACK(window_show), client); g_signal_connect(status_icon, "popup-menu", G_CALLBACK(popup_menu), client); priv->systray_icon = status_icon; } @@ -430,9 +430,9 @@ init_systray(RingClient *client) } static void -systray_toggled(GSettings *settings, const gchar *key, RingClient *client) +systray_toggled(GSettings *settings, const gchar *key, Client *client) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); if (g_settings_get_boolean(settings, key)) { if (!priv->systray_icon) @@ -444,14 +444,14 @@ systray_toggled(GSettings *settings, const gchar *key, RingClient *client) } static void -ring_client_activate(GApplication *app) +client_activate(GApplication *app) { - RingClient *client = RING_CLIENT(app); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + Client *client = CLIENT(app); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); if (priv->win == NULL) { // activate being called for the first time - priv->win = ring_main_window_new(GTK_APPLICATION(app)); + priv->win = main_window_new(GTK_APPLICATION(app)); /* make sure win is set to NULL when the window is destroyed */ g_object_add_weak_pointer(G_OBJECT(priv->win), (gpointer *)&priv->win); @@ -462,7 +462,7 @@ ring_client_activate(GApplication *app) /* if we didn't launch with the '-r' (--restore-last-window-state) option then force the * show-main-window to true */ if (!priv->restore_window_state) - ring_window_show(client); + window_show(client); show_main_window_toggled(client); g_signal_connect_swapped(priv->settings, "changed::show-main-window", G_CALLBACK(show_main_window_toggled), client); @@ -471,27 +471,27 @@ ring_client_activate(GApplication *app) systray_toggled(priv->settings, "show-status-icon", client); } else { // activate not being called for the first time, force showing of main window - ring_window_show(client); + window_show(client); } } // TODO add some args! static void -ring_client_open(GApplication *app, GFile ** /*file*/, gint /*arg3*/, const gchar* /*arg4*/) +client_open(GApplication *app, GFile ** /*file*/, gint /*arg3*/, const gchar* /*arg4*/) { - ring_client_activate(app); + client_activate(app); // TODO migrate place call at begining } static void -ring_client_startup(GApplication *app) +client_startup(GApplication *app) { - RingClient *client = RING_CLIENT(app); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + Client *client = CLIENT(app); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); - g_message("Jami GNOME client version: %s", RING_VERSION); - g_message("git ref: %s", RING_CLIENT_REVISION); + g_message("Jami GNOME client version: %s", VERSION); + g_message("git ref: %s", CLIENT_REVISION); /* make sure that the system corresponds to the autostart setting */ autostart_symlink(g_settings_get_boolean(priv->settings, "start-on-login")); @@ -559,23 +559,23 @@ ring_client_startup(GApplication *app) /* add GActions */ g_action_map_add_action_entries( - G_ACTION_MAP(app), ring_actions, G_N_ELEMENTS(ring_actions), app); + G_ACTION_MAP(app), actions, G_N_ELEMENTS(actions), app); /* GActions for settings */ auto action_window_visible = g_settings_create_action(priv->settings, "show-main-window"); g_action_map_add_action(G_ACTION_MAP(app), action_window_visible); /* add accelerators */ - ring_accelerators(RING_CLIENT(app)); + accelerators(CLIENT(app)); - G_APPLICATION_CLASS(ring_client_parent_class)->startup(app); + G_APPLICATION_CLASS(client_parent_class)->startup(app); } static void -ring_client_shutdown(GApplication *app) +client_shutdown(GApplication *app) { - RingClient *self = RING_CLIENT(app); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(self); + Client *self = CLIENT(app); + ClientPrivate *priv = CLIENT_GET_PRIVATE(self); gtk_widget_destroy(priv->win); @@ -594,41 +594,41 @@ ring_client_shutdown(GApplication *app) g_clear_object(&priv->settings); /* Chain up to the parent class */ - G_APPLICATION_CLASS(ring_client_parent_class)->shutdown(app); + G_APPLICATION_CLASS(client_parent_class)->shutdown(app); } static void -ring_client_init(RingClient *self) +client_init(Client *self) { - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(self); + ClientPrivate *priv = CLIENT_GET_PRIVATE(self); priv->win = NULL; priv->qtapp = NULL; priv->settings = g_settings_new_full(get_settings_schema(), NULL, NULL); /* add custom cmd line options */ - ring_client_add_options(G_APPLICATION(self)); + client_add_options(G_APPLICATION(self)); } static void -ring_client_class_init(RingClientClass *klass) +client_class_init(ClientClass *klass) { - G_APPLICATION_CLASS(klass)->startup = ring_client_startup; - G_APPLICATION_CLASS(klass)->activate = ring_client_activate; - G_APPLICATION_CLASS(klass)->open = ring_client_open; - G_APPLICATION_CLASS(klass)->shutdown = ring_client_shutdown; + G_APPLICATION_CLASS(klass)->startup = client_startup; + G_APPLICATION_CLASS(klass)->activate = client_activate; + G_APPLICATION_CLASS(klass)->open = client_open; + G_APPLICATION_CLASS(klass)->shutdown = client_shutdown; } -RingClient* -ring_client_new(int argc, char *argv[]) +Client* +client_new(int argc, char *argv[]) { - RingClient *client = (RingClient *)g_object_new(ring_client_get_type(), + Client *client = (Client *)g_object_new(client_get_type(), "application-id", JAMI_CLIENT_APP_ID, "flags", G_APPLICATION_HANDLES_OPEN , NULL); /* copy the cmd line args before they get processed by the GApplication*/ - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); priv->argc = argc; priv->argv = g_strdupv((gchar **)argv); @@ -636,19 +636,19 @@ ring_client_new(int argc, char *argv[]) } GtkWindow* -ring_client_get_main_window(RingClient *client) +client_get_main_window(Client *client) { - g_return_val_if_fail(IS_RING_CLIENT(client), NULL); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + g_return_val_if_fail(IS_CLIENT(client), NULL); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); return (GtkWindow *)priv->win; } void -ring_client_set_restore_main_window_state(RingClient *client, gboolean restore) +client_set_restore_main_window_state(Client *client, gboolean restore) { - g_return_if_fail(IS_RING_CLIENT(client)); - RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(client); + g_return_if_fail(IS_CLIENT(client)); + ClientPrivate *priv = CLIENT_GET_PRIVATE(client); priv->restore_window_state = restore; } diff --git a/src/ring_client.h b/src/client.h similarity index 57% rename from src/ring_client.h rename to src/client.h index 8b85677faa6d456f6eee39f6a3cc8673314864aa..c6f831e6e24f166b4ec369a510e4c33626270f79 100644 --- a/src/ring_client.h +++ b/src/client.h @@ -17,37 +17,37 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef RING_CLIENT_H_ -#define RING_CLIENT_H_ +#ifndef CLIENT_H_ +#define CLIENT_H_ #include <gtk/gtk.h> #include "config.h" G_BEGIN_DECLS -#define RING_GSETTINGS_SCHEMA JAMI_CLIENT_APP_ID +#define GSETTINGS_SCHEMA JAMI_CLIENT_APP_ID -#define RING_CLIENT_TYPE (ring_client_get_type()) -#define RING_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), RING_CLIENT_TYPE, RingClient)) -#define RING_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RING_CLIENT_TYPE, RingClientClass)) -#define IS_RING_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_CLIENT_TYPE)) -#define IS_RING_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RING_CLIENT_TYPE)) +#define CLIENT_TYPE (client_get_type()) +#define CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CLIENT_TYPE, Client)) +#define CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CLIENT_TYPE, ClientClass)) +#define IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CLIENT_TYPE)) +#define IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CLIENT_TYPE)) -typedef struct _RingClientClass RingClientClass; -typedef struct _RingClient RingClient; +typedef struct _ClientClass ClientClass; +typedef struct _Client Client; /* Public interface */ -GType ring_client_get_type (void) G_GNUC_CONST; -RingClient *ring_client_new (int argc, char *argv[]); -GtkWindow *ring_client_get_main_window(RingClient *client); +GType client_get_type (void) G_GNUC_CONST; +Client *client_new (int argc, char *argv[]); +GtkWindow *client_get_main_window(Client *client); /** * Sets if the client should attempt to restore the main window state (hidden or not) to what it was * when it was last quit (stored by the "show-main-window" gsetting). This function must be * called before the main window is created for the first time for it to have an effect. */ -void ring_client_set_restore_main_window_state(RingClient *client, gboolean restore); +void client_set_restore_main_window_state(Client *client, gboolean restore); G_END_DECLS -#endif /* RING_CLIENT_H_ */ +#endif /* CLIENT_H_ */ diff --git a/src/ring_client_options.c b/src/client_options.c similarity index 89% rename from src/ring_client_options.c rename to src/client_options.c index e8d4e5c953be7624d0849fa3e9a93f2afb140b11..2621082d3684978f3fa00dbc1fec410cf091461b 100644 --- a/src/ring_client_options.c +++ b/src/client_options.c @@ -18,11 +18,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ring_client_options.h" +#include "client_options.h" #include "config.h" #include "revision.h" -#include "ring_client.h" +#include "client.h" #include <glib/gi18n.h> #include <gtk/gtk.h> #include <stdlib.h> @@ -33,7 +33,7 @@ option_version_cb(G_GNUC_UNUSED const gchar *option_name, G_GNUC_UNUSED gpointer data, G_GNUC_UNUSED GError **error) { - g_print("%s - %s\n", RING_VERSION, RING_CLIENT_REVISION); + g_print("%s - %s\n", VERSION, CLIENT_REVISION); exit(EXIT_SUCCESS); } @@ -44,7 +44,7 @@ option_debug_cb(G_GNUC_UNUSED const gchar *option_name, G_GNUC_UNUSED GError **error) { g_setenv("G_MESSAGES_DEBUG", "all", TRUE); - g_setenv("RING_CHATVIEW_DEBUG", "true", TRUE); + g_setenv("CHATVIEW_DEBUG", "true", TRUE); g_debug("debug enabled"); return TRUE; } @@ -56,8 +56,8 @@ option_restore_cb(G_GNUC_UNUSED const gchar *option_name, G_GNUC_UNUSED GError **error) { GApplication *client = g_application_get_default(); - if (IS_RING_CLIENT(client)) - ring_client_set_restore_main_window_state(RING_CLIENT(client), TRUE); + if (IS_CLIENT(client)) + client_set_restore_main_window_state(CLIENT(client), TRUE); return TRUE; } @@ -71,7 +71,7 @@ static const GOptionEntry all_options[] = { #if GLIB_CHECK_VERSION(2,40,0) void -ring_client_add_options(GApplication *app) { +client_add_options(GApplication *app) { /* NOTE: using this function, the options do not get translated in glib versions <2.45 due to * bug 750322: https://bugzilla.gnome.org/show_bug.cgi?id=750322 */ @@ -80,7 +80,7 @@ ring_client_add_options(GApplication *app) { #else GOptionContext * -ring_client_options_get_context() +client_options_get_context() { GOptionContext *context = g_option_context_new(_("- GNOME client for Jami")); g_option_context_set_ignore_unknown_options(context, TRUE); diff --git a/src/ring_client_options.h b/src/client_options.h similarity index 82% rename from src/ring_client_options.h rename to src/client_options.h index 2ebe0ea2f4b5175d8cc91a4473a3472099cd08f4..1269e922e329002fa42e9e40e07484717bec9f0e 100644 --- a/src/ring_client_options.h +++ b/src/client_options.h @@ -17,19 +17,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef RING_CLIENT_OPTIONS_H_ -#define RING_CLIENT_OPTIONS_H_ +#ifndef CLIENT_OPTIONS_H_ +#define CLIENT_OPTIONS_H_ #include <gio/gio.h> G_BEGIN_DECLS #if GLIB_CHECK_VERSION(2,40,0) -void ring_client_add_options(GApplication *app); +void client_add_options(GApplication *app); #else -GOptionContext *ring_client_options_get_context(void); +GOptionContext *client_options_get_context(void); #endif G_END_DECLS -#endif /* RING_CLIENT_OPTIONS_H_ */ +#endif /* CLIENT_OPTIONS_H_ */ diff --git a/src/config.h.in b/src/config.h.in index 2a4164694185b3b37822698e7a9462b57b7c4118..383cdc3c7807b18d57b0726eaaf56bcc9c201833 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1,6 +1,6 @@ /* cmake will generate config.h with defines containing the values defined in cmake */ -#define RING_VERSION "@PROJECT_VERSION@" +#define VERSION "@PROJECT_VERSION@" #define USE_LIBNOTIFY @USE_LIBNOTIFY@ #define HAVE_APPINDICATOR @HAVE_APPINDICATOR@ @@ -11,9 +11,9 @@ #define JAMI_CLIENT_NAME "Jami" #define JAMI_CLIENT_APP_ID "net.jami.Jami" -#define JAMI_CLIENT_INSTALL "@RING_INSTALL_PREFIX@" +#define JAMI_CLIENT_INSTALL "@JAMI_INSTALL_PREFIX@" #define JAMI_DATA_DIR "/share/jami-gnome" #define PACKAGE_NAME "@PROJECT_NAME@" -#define LOCALEDIR "@RING_INSTALL_PREFIX@/share/locale" -#define SOUNDSDIR "@RING_INSTALL_PREFIX@/share/sounds/jami-gnome" +#define LOCALEDIR "@JAMI_INSTALL_PREFIX@/share/locale" +#define SOUNDSDIR "@JAMI_INSTALL_PREFIX@/share/sounds/jami-gnome" diff --git a/src/currentcallview.cpp b/src/currentcallview.cpp index 6a5972deceb67b2f7bd61879ff940b122ac58c85..65c71ca94b79a152873088c711291677652fb7a5 100644 --- a/src/currentcallview.cpp +++ b/src/currentcallview.cpp @@ -22,7 +22,7 @@ // Client #include "chatview.h" #include "native/pixbufmanipulator.h" -#include "ringnotify.h" +#include "notifier.h" #include "utils/drawing.h" #include "utils/files.h" #include "video/video_widget.h" diff --git a/src/dialogs.c b/src/dialogs.c index 8451eb98c3620b6f6f53858216d82c68a5f7e86a..57ead9c160c775d5ec0dd86aaad9231ad127c065 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -26,7 +26,7 @@ #include "revision.h" GtkWidget * -ring_dialog_working(GtkWidget *parent, const gchar *msg) +dialog_working(GtkWidget *parent, const gchar *msg) { GtkWidget *dialog = gtk_dialog_new(); gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); @@ -66,7 +66,7 @@ ring_dialog_working(GtkWidget *parent, const gchar *msg) } void -ring_about_dialog(GtkWidget *parent) +about_dialog(GtkWidget *parent) { /* get parent window */ if (parent && GTK_IS_WIDGET(parent)) @@ -82,7 +82,7 @@ ring_about_dialog(GtkWidget *parent) gchar *version = g_strdup_printf(C_("Do not translate the release name nor the status (beta, final, ...)", "\"Free as in Freedom\"\nbuilt on %.25s"), - RING_CLIENT_BUILD_DATE); + CLIENT_BUILD_DATE); const gchar *authors[] = { "Adrien Béraud", diff --git a/src/dialogs.h b/src/dialogs.h index 25f1763d6507ce2d039baed0ca01a3e23f8c2a3c..66013306226f39a025d3f422d228a1caceebb264 100644 --- a/src/dialogs.h +++ b/src/dialogs.h @@ -24,8 +24,8 @@ G_BEGIN_DECLS -GtkWidget *ring_dialog_working(GtkWidget *parent, const gchar *msg); -void ring_about_dialog(GtkWidget *parent); +GtkWidget *dialog_working(GtkWidget *parent, const gchar *msg); +void about_dialog(GtkWidget *parent); G_END_DECLS diff --git a/src/generalsettingsview.cpp b/src/generalsettingsview.cpp index 1c0e9f8557032710856e41eeb63448fb585511e3..5d39da72bda39aba50ea870b407debe8c488f58b 100644 --- a/src/generalsettingsview.cpp +++ b/src/generalsettingsview.cpp @@ -27,7 +27,7 @@ // LRC #include <api/avmodel.h> -// Ring client +// Jami Client #include "utils/files.h" #include "avatarmanipulation.h" @@ -37,7 +37,7 @@ class CppImpl; enum { - PROP_RING_MAIN_WIN_PNT = 1, + PROP_MAIN_WIN_PNT = 1, }; struct _GeneralSettingsView @@ -78,7 +78,7 @@ struct _GeneralSettingsViewPrivate GtkWidget *filechooserbutton_record_path; /* ring main window pointer */ - GtkWidget* ring_main_window_pnt; + GtkWidget* main_window_pnt; details::CppImpl* cpp; ///< Non-UI and C++ only code }; @@ -213,13 +213,13 @@ choose_downloads_directory(GeneralSettingsView *self) gint res; gchar* filename = nullptr; - if (!priv->ring_main_window_pnt) { + if (!priv->main_window_pnt) { g_debug("Internal error: NULL main window pointer in GeneralSettingsView."); return; } GtkWidget *dialog = gtk_file_chooser_dialog_new (_("Choose download folder"), - GTK_WINDOW(priv->ring_main_window_pnt), + GTK_WINDOW(priv->main_window_pnt), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Cancel"), GTK_RESPONSE_CANCEL, @@ -363,15 +363,15 @@ general_settings_view_set_property (GObject *object, GeneralSettingsView *self = GENERAL_SETTINGS_VIEW (object); GeneralSettingsViewPrivate *priv = GENERAL_SETTINGS_VIEW_GET_PRIVATE(self); - if (property_id == PROP_RING_MAIN_WIN_PNT) { - GtkWidget *ring_main_window_pnt = (GtkWidget*) g_value_get_pointer(value); + if (property_id == PROP_MAIN_WIN_PNT) { + GtkWidget *main_window_pnt = (GtkWidget*) g_value_get_pointer(value); - if (!ring_main_window_pnt) { + if (!main_window_pnt) { g_debug("Internal error: NULL main window pointer passed to set_property"); return; } - priv->ring_main_window_pnt = ring_main_window_pnt; + priv->main_window_pnt = main_window_pnt; } else { // Invalid property id passed @@ -388,8 +388,8 @@ general_settings_view_get_property (GObject *object, GeneralSettingsView *self = GENERAL_SETTINGS_VIEW (object); GeneralSettingsViewPrivate *priv = GENERAL_SETTINGS_VIEW_GET_PRIVATE(self); - if (property_id == PROP_RING_MAIN_WIN_PNT) { - g_value_set_pointer(value, priv->ring_main_window_pnt); + if (property_id == PROP_MAIN_WIN_PNT) { + g_value_set_pointer(value, priv->main_window_pnt); } else { // Invalid property id passed @@ -447,15 +447,15 @@ general_settings_view_class_init(GeneralSettingsViewClass *klass) object_class->get_property = general_settings_view_get_property; GParamFlags flags = (GParamFlags) (G_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_RING_MAIN_WIN_PNT, - g_param_spec_pointer ("ring_main_window_pnt", - "RingMainWindow pointer", - "Pointer to the Ring Main Window. This property is used by modal dialogs.", + g_object_class_install_property (object_class, PROP_MAIN_WIN_PNT, + g_param_spec_pointer ("main_window_pnt", + "MainWindow pointer", + "Pointer to the Main Window. This property is used by modal dialogs.", flags)); } GtkWidget * -general_settings_view_new(GtkWidget* ring_main_window_pointer, lrc::api::AVModel& avModel) +general_settings_view_new(GtkWidget* main_window_pointer, lrc::api::AVModel& avModel) { auto self = g_object_new(GENERAL_SETTINGS_VIEW_TYPE, NULL); auto* priv = GENERAL_SETTINGS_VIEW_GET_PRIVATE(GENERAL_SETTINGS_VIEW (self)); @@ -466,8 +466,8 @@ general_settings_view_new(GtkWidget* ring_main_window_pointer, lrc::api::AVModel // set_up ring main window pointer (needed by modal dialogs) GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_POINTER); - g_value_set_pointer (&val, ring_main_window_pointer); - g_object_set_property (G_OBJECT (self), "ring_main_window_pnt", &val); + g_value_set_pointer (&val, main_window_pointer); + g_object_set_property (G_OBJECT (self), "main_window_pnt", &val); g_value_unset (&val); g_signal_connect_swapped(priv->button_choose_downloads_directory, "clicked", G_CALLBACK(choose_downloads_directory), self); diff --git a/src/generalsettingsview.h b/src/generalsettingsview.h index 3394f9beffe1a49d0ebd1449d232ac4a984be8b5..8fdfee5fec3f791676dd14e0d27b686d7701a301 100644 --- a/src/generalsettingsview.h +++ b/src/generalsettingsview.h @@ -38,7 +38,7 @@ typedef struct _GeneralSettingsView GeneralSettingsView; typedef struct _GeneralSettingsViewClass GeneralSettingsViewClass; GType general_settings_view_get_type (void) G_GNUC_CONST; -GtkWidget *general_settings_view_new (GtkWidget* ring_main_window_pnt, lrc::api::AVModel& avModel); +GtkWidget *general_settings_view_new (GtkWidget* main_window_pnt, lrc::api::AVModel& avModel); G_END_DECLS diff --git a/src/main.cpp b/src/main.cpp index 8ce0f853d3c0af1c17e4a38cf1223cddce86b600..8236dd1f6093746600cd49b7ffdee4f4e4f7673e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,7 @@ #include <glib/gi18n.h> #include <cstdlib> #include "config.h" -#include "ring_client.h" +#include "client.h" int main(int argc, char *argv[]) @@ -33,7 +33,7 @@ main(int argc, char *argv[]) bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); textdomain(PACKAGE_NAME); - RingClient *client = ring_client_new(argc, argv); + Client *client = client_new(argc, argv); g_set_application_name(JAMI_CLIENT_NAME); return g_application_run(G_APPLICATION(client), argc, argv); } diff --git a/src/ringmainwindow.cpp b/src/mainwindow.cpp similarity index 87% rename from src/ringmainwindow.cpp rename to src/mainwindow.cpp index 168c8e6ed3c70737f7816ed831222b11a1a101bc..a99e1284b046ad2fe1bfc7b45214566b7f59d446 100644 --- a/src/ringmainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ringmainwindow.h" +#include "mainwindow.h" // GTK+ related #include <glib/gi18n.h> @@ -43,7 +43,7 @@ #include <api/newcallmodel.h> #include <api/profile.h> -// Ring client +// Jami Client #include "config.h" #include "newaccountsettingsview.h" #include "accountmigrationview.h" @@ -56,13 +56,13 @@ #include "incomingcallview.h" #include "mediasettingsview.h" #include "models/gtkqtreemodel.h" -#include "ringwelcomeview.h" +#include "welcomeview.h" #include "utils/drawing.h" #include "utils/files.h" -#include "ringnotify.h" +#include "notifier.h" #include "accountinfopointer.h" #include "native/pixbufmanipulator.h" -#include "ringnotify.h" +#include "notifier.h" #if USE_LIBNM #include <NetworkManager.h> @@ -75,21 +75,21 @@ namespace { namespace details class CppImpl; }} -struct _RingMainWindow +struct _MainWindow { GtkApplicationWindow parent; }; -struct _RingMainWindowClass +struct _MainWindowClass { GtkApplicationWindowClass parent_class; }; -struct RingMainWindowPrivate +struct MainWindowPrivate { - GtkWidget *ring_menu; + GtkWidget *menu; GtkWidget *image_ring; - GtkWidget *ring_settings; + GtkWidget *settings; GtkWidget *image_settings; GtkWidget *hbox_settings; GtkWidget *notebook_contacts; @@ -120,7 +120,7 @@ struct RingMainWindowPrivate GtkWidget *notifier; - GSettings *settings; + GSettings *window_settings; bool useDarkTheme {false}; details::CppImpl* cpp; ///< Non-UI and C++ only code @@ -144,9 +144,9 @@ struct RingMainWindowPrivate #endif }; -G_DEFINE_TYPE_WITH_PRIVATE(RingMainWindow, ring_main_window, GTK_TYPE_APPLICATION_WINDOW); +G_DEFINE_TYPE_WITH_PRIVATE(MainWindow, main_window, GTK_TYPE_APPLICATION_WINDOW); -#define RING_MAIN_WINDOW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), RING_MAIN_WINDOW_TYPE, RingMainWindowPrivate)) +#define MAIN_WINDOW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MAIN_WINDOW_TYPE, MainWindowPrivate)) //============================================================================== @@ -305,7 +305,7 @@ foreachLrcAccount(const lrc::api::Lrc& lrc, class CppImpl { public: - explicit CppImpl(RingMainWindow& widget); + explicit CppImpl(MainWindow& widget); ~CppImpl(); void init(); @@ -334,8 +334,8 @@ public: WebKitChatContainer* webkitChatContainer(bool redraw_webview = false); - RingMainWindow* self = nullptr; // The GTK widget itself - RingMainWindowPrivate* widgets = nullptr; + MainWindow* self = nullptr; // The GTK widget itself + MainWindowPrivate* widgets = nullptr; std::unique_ptr<lrc::api::Lrc> lrc_; AccountInfoPointer accountInfo_ = nullptr; @@ -419,26 +419,26 @@ private: inline namespace gtk_callbacks { static void -on_video_double_clicked(RingMainWindow* self) +on_video_double_clicked(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->toggleFullScreen(); } static void -on_hide_view_clicked(RingMainWindow* self) +on_hide_view_clicked(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->resetToWelcome(); } static gboolean -place_call_event(RingMainWindow* self) +place_call_event(MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), G_SOURCE_REMOVE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), G_SOURCE_REMOVE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->eventUid_.empty()) priv->cpp->accountInfo_->conversationModel->placeCall(priv->cpp->eventUid_); @@ -447,20 +447,20 @@ place_call_event(RingMainWindow* self) } static void -on_place_call_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, RingMainWindow* self) +on_place_call_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && uid); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && uid); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->eventUid_ = uid; g_idle_add((GSourceFunc)place_call_event, self); } static gboolean -add_conversation_event(RingMainWindow* self) +add_conversation_event(MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), G_SOURCE_REMOVE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), G_SOURCE_REMOVE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->eventUid_.empty()) priv->cpp->accountInfo_->conversationModel->makePermanent(priv->cpp->eventUid_); @@ -469,20 +469,20 @@ add_conversation_event(RingMainWindow* self) } static void -on_add_conversation_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, RingMainWindow* self) +on_add_conversation_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && uid); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && uid); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->eventUid_ = uid; g_idle_add((GSourceFunc)add_conversation_event, self); } static gboolean -send_text_event(RingMainWindow* self) +send_text_event(MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), G_SOURCE_REMOVE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), G_SOURCE_REMOVE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->eventUid_.empty()) priv->cpp->accountInfo_->conversationModel->sendMessage(priv->cpp->eventUid_, priv->cpp->eventBody_); @@ -491,17 +491,17 @@ send_text_event(RingMainWindow* self) } gboolean -on_redraw(GtkWidget*, cairo_t*, RingMainWindow* self) +on_redraw(GtkWidget*, cairo_t*, MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), G_SOURCE_REMOVE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), G_SOURCE_REMOVE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); auto color = get_ambient_color(GTK_WIDGET(self)); bool current_theme = (color.red + color.green + color.blue) / 3 < .5; conversations_view_set_theme(CONVERSATIONS_VIEW(priv->treeview_conversations), current_theme); if (priv->useDarkTheme != current_theme) { - ring_welcome_set_theme(RING_WELCOME_VIEW(priv->welcome_view), current_theme); - ring_welcome_update_view(RING_WELCOME_VIEW(priv->welcome_view)); + welcome_set_theme(WELCOME_VIEW(priv->welcome_view), current_theme); + welcome_update_view(WELCOME_VIEW(priv->welcome_view)); gtk_image_set_from_resource(GTK_IMAGE(priv->image_contact_requests_list), current_theme? "/net/jami/JamiGnome/contact_requests_list_white" : "/net/jami/JamiGnome/contact_requests_list"); @@ -533,10 +533,10 @@ on_redraw(GtkWidget*, cairo_t*, RingMainWindow* self) } static void -on_send_text_clicked(G_GNUC_UNUSED GtkWidget*, gchar* uid, gchar* body, RingMainWindow* self) +on_send_text_clicked(G_GNUC_UNUSED GtkWidget*, gchar* uid, gchar* body, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && uid); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && uid); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->eventUid_ = uid; priv->cpp->eventBody_ = body; @@ -544,10 +544,10 @@ on_send_text_clicked(G_GNUC_UNUSED GtkWidget*, gchar* uid, gchar* body, RingMain } static gboolean -place_audio_call_event(RingMainWindow* self) +place_audio_call_event(MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), G_SOURCE_REMOVE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), G_SOURCE_REMOVE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->eventUid_.empty()) priv->cpp->accountInfo_->conversationModel->placeAudioOnlyCall(priv->cpp->eventUid_); @@ -556,45 +556,45 @@ place_audio_call_event(RingMainWindow* self) } static void -on_place_audio_call_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, RingMainWindow* self) +on_place_audio_call_clicked(G_GNUC_UNUSED GtkWidget*, gchar *uid, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && uid); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && uid); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->eventUid_ = uid; g_idle_add((GSourceFunc)place_audio_call_event, self); } static void -on_account_creation_completed(RingMainWindow* self) +on_account_creation_completed(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->isCreatingAccount = false; priv->cpp->leaveAccountCreationWizard(); } static void -on_account_creation_unlock(RingMainWindow* self) +on_account_creation_unlock(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->isCreatingAccount = false; } static void -on_account_creation_lock(RingMainWindow* self) +on_account_creation_lock(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->cpp->isCreatingAccount = true; } static void -on_account_changed(RingMainWindow* self) +on_account_changed(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); auto changeTopAccount = priv->set_top_account_flag; if (!priv->set_top_account_flag) { priv->set_top_account_flag = true; @@ -623,10 +623,10 @@ on_account_changed(RingMainWindow* self) } static void -on_settings_clicked(RingMainWindow* self) +on_settings_clicked(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->show_settings) priv->cpp->enterSettingsView(); @@ -635,10 +635,10 @@ on_settings_clicked(RingMainWindow* self) } static void -on_show_media_settings(GtkToggleButton* navbutton, RingMainWindow* self) +on_show_media_settings(GtkToggleButton* navbutton, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (gtk_toggle_button_get_active(navbutton)) { media_settings_view_show_preview(MEDIA_SETTINGS_VIEW(priv->media_settings_view), TRUE); @@ -651,10 +651,10 @@ on_show_media_settings(GtkToggleButton* navbutton, RingMainWindow* self) static void -on_show_new_account_settings(GtkToggleButton* navbutton, RingMainWindow* self) +on_show_new_account_settings(GtkToggleButton* navbutton, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (gtk_toggle_button_get_active(navbutton)) { new_account_settings_view_show(NEW_ACCOUNT_SETTINGS_VIEW(priv->new_account_settings_view), TRUE); @@ -666,10 +666,10 @@ on_show_new_account_settings(GtkToggleButton* navbutton, RingMainWindow* self) } static void -on_show_general_settings(GtkToggleButton* navbutton, RingMainWindow* self) +on_show_general_settings(GtkToggleButton* navbutton, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (gtk_toggle_button_get_active(navbutton)) { gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), GENERAL_SETTINGS_VIEW_NAME); @@ -678,10 +678,10 @@ on_show_general_settings(GtkToggleButton* navbutton, RingMainWindow* self) } static void -on_search_entry_text_changed(GtkSearchEntry* search_entry, RingMainWindow* self) +on_search_entry_text_changed(GtkSearchEntry* search_entry, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); // Filter model const gchar *text = gtk_entry_get_text(GTK_ENTRY(search_entry)); @@ -689,10 +689,10 @@ on_search_entry_text_changed(GtkSearchEntry* search_entry, RingMainWindow* self) } static void -on_search_entry_activated(RingMainWindow* self) +on_search_entry_activated(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); // Select the first conversation of the list auto& conversationModel = priv->cpp->accountInfo_->conversationModel; @@ -705,10 +705,10 @@ on_search_entry_activated(RingMainWindow* self) } static gboolean -on_search_entry_key_released(G_GNUC_UNUSED GtkEntry* search_entry, GdkEventKey* key, RingMainWindow* self) +on_search_entry_key_released(G_GNUC_UNUSED GtkEntry* search_entry, GdkEventKey* key, MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); // if esc key pressed, clear the regex (keep the text, the user might not want to actually delete it) if (key->keyval == GDK_KEY_Escape) { @@ -729,10 +729,10 @@ on_current_call_clicked(GtkWidget *widget, G_GNUC_UNUSED GdkEventButton *event) } static gboolean -on_dtmf_pressed(RingMainWindow* self, GdkEventKey* event, gpointer user_data) +on_dtmf_pressed(MainWindow* self, GdkEventKey* event, gpointer user_data) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if(priv->key_pressed && !(event->state & GDK_SHIFT_MASK)){ return GDK_EVENT_PROPAGATE; @@ -786,22 +786,22 @@ on_dtmf_pressed(RingMainWindow* self, GdkEventKey* event, gpointer user_data) } static gboolean -on_dtmf_released(RingMainWindow* self, GdkEventKey* event, gpointer user_data) +on_dtmf_released(MainWindow* self, GdkEventKey* event, gpointer user_data) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), GDK_EVENT_PROPAGATE); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); priv->key_pressed = false; return GDK_EVENT_PROPAGATE; } static void -on_tab_changed(GtkNotebook* notebook, GtkWidget* page, guint page_num, RingMainWindow* self) +on_tab_changed(GtkNotebook* notebook, GtkWidget* page, guint page_num, MainWindow* self) { (void)notebook; (void)page; - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); auto newType = page_num == 0 ? priv->cpp->accountInfo_->profileInfo.type : lrc::api::profile::Type::PENDING; if (priv->cpp->currentTypeFilter_ != newType) { @@ -813,11 +813,11 @@ on_tab_changed(GtkNotebook* notebook, GtkWidget* page, guint page_num, RingMainW static gboolean on_window_state_event(GtkWidget *widget, GdkEventWindowState *event) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(widget), GDK_EVENT_PROPAGATE); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(widget)); + g_return_val_if_fail(IS_MAIN_WINDOW(widget), GDK_EVENT_PROPAGATE); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(widget)); - g_settings_set_boolean(priv->settings, "window-maximized", ((event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0)); - g_settings_set_boolean(priv->settings, "window-fullscreen", ((event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0)); + g_settings_set_boolean(priv->window_settings, "window-maximized", ((event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0)); + g_settings_set_boolean(priv->window_settings, "window-fullscreen", ((event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0)); return GDK_EVENT_PROPAGATE; } @@ -825,20 +825,20 @@ on_window_state_event(GtkWidget *widget, GdkEventWindowState *event) static void on_window_size_changed(GtkWidget *self, G_GNUC_UNUSED GdkRectangle*, G_GNUC_UNUSED gpointer) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); int new_width, new_height; gtk_window_get_size(GTK_WINDOW(self), &new_width, &new_height); - g_settings_set_int(priv->settings, "window-width", new_width); - g_settings_set_int(priv->settings, "window-height", new_height); + g_settings_set_int(priv->window_settings, "window-width", new_width); + g_settings_set_int(priv->window_settings, "window-height", new_height); } static void -on_search_entry_places_call_changed(GSettings* settings, const gchar* key, RingMainWindow* self) +on_search_entry_places_call_changed(GSettings* settings, const gchar* key, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (g_settings_get_boolean(settings, key)) { gtk_widget_set_tooltip_text(priv->button_new_conversation, @@ -851,10 +851,10 @@ on_search_entry_places_call_changed(GSettings* settings, const gchar* key, RingM } static void -on_handle_account_migrations(RingMainWindow* self) +on_handle_account_migrations(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); /* If there is an existing migration view, remove it */ if (priv->account_migration_view) { @@ -872,7 +872,7 @@ on_handle_account_migrations(RingMainWindow* self) g_signal_connect_swapped(priv->account_migration_view, "account-migration-failed", G_CALLBACK(on_handle_account_migrations), self); - gtk_widget_hide(priv->ring_settings); + gtk_widget_hide(priv->settings); priv->cpp->showAccountSelectorWidget(false); gtk_widget_show(priv->account_migration_view); gtk_stack_add_named( @@ -889,7 +889,7 @@ on_handle_account_migrations(RingMainWindow* self) priv->cpp->accountInfoForMigration_ = nullptr; on_account_changed(self); gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), CALL_VIEW_NAME); - gtk_widget_show(priv->ring_settings); + gtk_widget_show(priv->settings); } enum class Action { @@ -899,10 +899,10 @@ enum class Action { }; static void -action_notification(gchar* title, RingMainWindow* self, Action action) +action_notification(gchar* title, MainWindow* self, Action action) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && title); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && title); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->accountInfo_) { g_warning("Notification clicked but accountInfo_ currently empty"); return; @@ -966,28 +966,28 @@ action_notification(gchar* title, RingMainWindow* self, Action action) static void on_notification_chat_clicked(G_GNUC_UNUSED GtkWidget* notifier, - gchar *title, RingMainWindow* self) + gchar *title, MainWindow* self) { action_notification(title, self, Action::SELECT); } static void -on_notification_accept_pending(GtkWidget*, gchar *title, RingMainWindow* self) +on_notification_accept_pending(GtkWidget*, gchar *title, MainWindow* self) { action_notification(title, self, Action::ACCEPT); } static void -on_notification_refuse_pending(GtkWidget*, gchar *title, RingMainWindow* self) +on_notification_refuse_pending(GtkWidget*, gchar *title, MainWindow* self) { action_notification(title, self, Action::REFUSE); } static void -on_notification_accept_call(GtkWidget*, gchar *title, RingMainWindow* self) +on_notification_accept_call(GtkWidget*, gchar *title, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && title); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && title); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->accountInfo_) { g_warning("Notification clicked but accountInfo_ currently empty"); return; @@ -1016,10 +1016,10 @@ on_notification_accept_call(GtkWidget*, gchar *title, RingMainWindow* self) } static void -on_notification_decline_call(GtkWidget*, gchar *title, RingMainWindow* self) +on_notification_decline_call(GtkWidget*, gchar *title, MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self) && title); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self) && title); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!priv->cpp->accountInfo_) { g_warning("Notification clicked but accountInfo_ currently empty"); return; @@ -1045,9 +1045,9 @@ on_notification_decline_call(GtkWidget*, gchar *title, RingMainWindow* self) } // namespace gtk_callbacks -CppImpl::CppImpl(RingMainWindow& widget) +CppImpl::CppImpl(MainWindow& widget) : self {&widget} - , widgets {RING_MAIN_WINDOW_GET_PRIVATE(&widget)} + , widgets {MAIN_WINDOW_GET_PRIVATE(&widget)} { lrc_ = std::make_unique<lrc::api::Lrc>([this](){ widgets->migratingDialog_ = gtk_message_dialog_new( @@ -1082,10 +1082,10 @@ CppImpl::CppImpl(RingMainWindow& widget) } static void -on_clear_all_history_clicked(RingMainWindow* self) +on_clear_all_history_clicked(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); g_return_if_fail(priv && priv->cpp); for (const auto &account_id : priv->cpp->lrc_->getAccountModel().getAccountList()) { @@ -1113,12 +1113,12 @@ update_data_transfer(lrc::api::DataTransferModel& model, GSettings* settings) } static void -update_download_folder(RingMainWindow* self) +update_download_folder(MainWindow* self) { - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); g_return_if_fail(priv); - update_data_transfer(priv->cpp->lrc_->getDataTransferModel(), priv->settings); + update_data_transfer(priv->cpp->lrc_->getDataTransferModel(), priv->window_settings); } #if USE_LIBNM @@ -1136,18 +1136,18 @@ log_connection_info(NMActiveConnection *connection) } static void -primary_connection_changed(NMClient *nm, GParamSpec*, RingMainWindow* self) +primary_connection_changed(NMClient *nm, GParamSpec*, MainWindow* self) { - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); auto connection = nm_client_get_primary_connection(nm); log_connection_info(connection); priv->cpp->lrc_->connectivityChanged(); } static void -nm_client_cb(G_GNUC_UNUSED GObject *source_object, GAsyncResult *result, RingMainWindow* self) +nm_client_cb(G_GNUC_UNUSED GObject *source_object, GAsyncResult *result, MainWindow* self) { - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); GError* error = nullptr; if (auto nm_client = nm_client_new_finish(result, &error)) { @@ -1233,25 +1233,25 @@ CppImpl::init() [this](const std::string& id){ slotInvalidAccountFromLrc(id); }); /* bind to window size settings */ - widgets->settings = g_settings_new_full(get_settings_schema(), nullptr, nullptr); - auto width = g_settings_get_int(widgets->settings, "window-width"); - auto height = g_settings_get_int(widgets->settings, "window-height"); + widgets->window_settings = g_settings_new_full(get_settings_schema(), nullptr, nullptr); + auto width = g_settings_get_int(widgets->window_settings, "window-width"); + auto height = g_settings_get_int(widgets->window_settings, "window-height"); gtk_window_set_default_size(GTK_WINDOW(self), width, height); g_signal_connect(self, "size-allocate", G_CALLBACK(on_window_size_changed), nullptr); g_signal_connect(self, "window-state-event", G_CALLBACK(on_window_state_event), nullptr); - if (g_settings_get_boolean(widgets->settings, "window-maximized")) + if (g_settings_get_boolean(widgets->window_settings, "window-maximized")) gtk_window_maximize(GTK_WINDOW(self)); - widgets->is_fullscreen_main_win = g_settings_get_boolean(widgets->settings, "window-fullscreen"); + widgets->is_fullscreen_main_win = g_settings_get_boolean(widgets->window_settings, "window-fullscreen"); if (widgets->is_fullscreen_main_win) gtk_window_fullscreen(GTK_WINDOW(self)); - update_data_transfer(lrc_->getDataTransferModel(), widgets->settings); + update_data_transfer(lrc_->getDataTransferModel(), widgets->window_settings); /* search-entry-places-call setting */ - on_search_entry_places_call_changed(widgets->settings, "search-entry-places-call", self); - g_signal_connect(widgets->settings, "changed::search-entry-places-call", + on_search_entry_places_call_changed(widgets->window_settings, "search-entry-places-call", self); + g_signal_connect(widgets->window_settings, "changed::search-entry-places-call", G_CALLBACK(on_search_entry_places_call_changed), self); /* set window icon */ @@ -1273,9 +1273,9 @@ CppImpl::init() gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->image_ring), image_ring); /* ring menu */ - GtkBuilder *builder = gtk_builder_new_from_resource("/net/jami/JamiGnome/ringgearsmenu.ui"); + GtkBuilder *builder = gtk_builder_new_from_resource("/net/jami/JamiGnome/gearsmenu.ui"); GMenuModel *menu = G_MENU_MODEL(gtk_builder_get_object(builder, "menu")); - gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(widgets->ring_menu), menu); + gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(widgets->menu), menu); g_object_unref(builder); /* settings icon */ @@ -1283,7 +1283,7 @@ CppImpl::init() GTK_ICON_SIZE_SMALL_TOOLBAR); /* connect settings button signal */ - g_signal_connect_swapped(widgets->ring_settings, "clicked", + g_signal_connect_swapped(widgets->settings, "clicked", G_CALLBACK(on_settings_clicked), self); /* add the call view to the main stack */ @@ -1328,7 +1328,7 @@ CppImpl::init() g_signal_connect(widgets->notebook_contacts, "switch-page", G_CALLBACK(on_tab_changed), self); /* welcome/default view */ - widgets->welcome_view = ring_welcome_view_new(accountInfo_); + widgets->welcome_view = welcome_view_new(accountInfo_); g_object_ref(widgets->welcome_view); // increase ref because don't want it to be destroyed when not displayed gtk_container_add(GTK_CONTAINER(widgets->frame_call), widgets->welcome_view); gtk_widget_show(widgets->welcome_view); @@ -1370,7 +1370,7 @@ CppImpl::init() (GtkCellLayoutDataFunc )print_account_and_state, widgets, nullptr); - // we closing any view opened to avoid confusion (especially between SIP and Ring protocols). + // we closing any view opened to avoid confusion (especially between SIP and protocols). g_signal_connect_swapped(widgets->combobox_account_selector, "changed", G_CALLBACK(on_account_changed), self); // initialize the pending contact request icon. @@ -1387,7 +1387,7 @@ CppImpl::init() } // delete obsolete history if (not accountIds.empty()) { - auto days = g_settings_get_int(widgets->settings, "history-limit"); + auto days = g_settings_get_int(widgets->window_settings, "history-limit"); for (auto& accountId : accountIds) { auto& accountInfo = lrc_->getAccountModel().getAccountInfo(accountId); accountInfo.conversationModel->deleteObsoleteHistory(days); @@ -1467,7 +1467,7 @@ CppImpl::changeView(GType type, lrc::api::conversation::Info conversation) gtk_container_add(GTK_CONTAINER(widgets->frame_call), new_view); gtk_widget_show(new_view); - if (conversation.uid != "" && type != RING_WELCOME_VIEW_TYPE) + if (conversation.uid != "" && type != WELCOME_VIEW_TYPE) conversations_view_select_conversation( CONVERSATIONS_VIEW(widgets->treeview_conversations), conversation.uid); @@ -1537,7 +1537,7 @@ CppImpl::displayChatView(lrc::api::conversation::Info conversation, bool redraw_ auto isPending = contactInfo.profileInfo.type == lrc::api::profile::Type::PENDING; if (isPending) { auto notifId = accountInfo_->id + ":request:" + contactUri; - ring_hide_notification(RING_NOTIFIER(widgets->notifier), notifId); + hide_notification(NOTIFIER(widgets->notifier), notifId); } } catch(...) { } @@ -1605,7 +1605,7 @@ CppImpl::resetToWelcome() lrc::api::conversation::Info current_item; if (IS_CHAT_VIEW(old_view)) current_item = chat_view_get_conversation(CHAT_VIEW(old_view)); - changeView(RING_WELCOME_VIEW_TYPE, current_item); + changeView(WELCOME_VIEW_TYPE, current_item); } void @@ -1725,7 +1725,7 @@ CppImpl::enterAccountCreationWizard(bool showControls) /* hide settings button until account creation is complete */ gtk_widget_hide(widgets->hbox_settings); - gtk_widget_hide(widgets->ring_settings); + gtk_widget_hide(widgets->settings); showAccountSelectorWidget(showControls); gtk_widget_show(widgets->account_creation_wizard); @@ -1752,7 +1752,7 @@ CppImpl::leaveAccountCreationWizard() } /* show the settings button */ - gtk_widget_show(widgets->ring_settings); + gtk_widget_show(widgets->settings); /* show the account selector */ showAccountSelectorWidget(); @@ -1794,13 +1794,13 @@ CppImpl::onAccountSelectionChange(const std::string& id) if (id != oldId) { // Go to welcome view - changeView(RING_WELCOME_VIEW_TYPE); + changeView(WELCOME_VIEW_TYPE); // Show conversation panel gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->notebook_contacts), 0); // Reinit LRC updateLrc(id); // Update the welcome view - ring_welcome_update_view(RING_WELCOME_VIEW(widgets->welcome_view)); + welcome_update_view(WELCOME_VIEW(widgets->welcome_view)); // Show pending contacts tab if necessary refreshPendingContactRequestTab(); // Update account settings @@ -1818,7 +1818,7 @@ CppImpl::enterSettingsView() /* show settings */ gtk_image_set_from_icon_name(GTK_IMAGE(widgets->image_settings), "go-previous-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_widget_set_tooltip_text(GTK_WIDGET(widgets->ring_settings), _("Leave settings page")); + gtk_widget_set_tooltip_text(GTK_WIDGET(widgets->settings), _("Leave settings page")); gtk_widget_show(widgets->hbox_settings); @@ -1843,7 +1843,7 @@ CppImpl::leaveSettingsView() /* show calls */ gtk_image_set_from_icon_name(GTK_IMAGE(widgets->image_settings), "emblem-system-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_widget_set_tooltip_text(GTK_WIDGET(widgets->ring_settings), _("Settings")); + gtk_widget_set_tooltip_text(GTK_WIDGET(widgets->settings), _("Settings")); gtk_widget_hide(widgets->hbox_settings); @@ -2064,7 +2064,7 @@ CppImpl::slotAccountAddedFromLrc(const std::string& id) } if (!accountInfo_) { updateLrc(id); - ring_welcome_update_view(RING_WELCOME_VIEW(widgets->welcome_view)); + welcome_update_view(WELCOME_VIEW(widgets->welcome_view)); if (!gtk_stack_get_child_by_name(GTK_STACK(widgets->stack_main_view), NEW_ACCOUNT_SETTINGS_VIEW_NAME)) { widgets->new_account_settings_view = new_account_settings_view_new(accountInfo_, lrc_->getAVModel()); gtk_stack_add_named(GTK_STACK(widgets->stack_main_view), widgets->new_account_settings_view, @@ -2122,7 +2122,7 @@ CppImpl::slotAccountNeedsMigration(const std::string& id) g_signal_connect_swapped(widgets->account_migration_view, "account-migration-failed", G_CALLBACK(on_handle_account_migrations), self); - gtk_widget_hide(widgets->ring_settings); + gtk_widget_hide(widgets->settings); showAccountSelectorWidget(false); gtk_widget_show(widgets->account_migration_view); gtk_stack_add_named( @@ -2156,7 +2156,7 @@ CppImpl::slotAccountStatusChanged(const std::string& id) { if (!accountInfo_) { updateLrc(id); - ring_welcome_update_view(RING_WELCOME_VIEW(widgets->welcome_view)); + welcome_update_view(WELCOME_VIEW(widgets->welcome_view)); return; } @@ -2229,7 +2229,7 @@ CppImpl::slotCallStatusChanged(const std::string& callId) if (call.status == lrc::api::call::Status::IN_PROGRESS || call.status == lrc::api::call::Status::ENDED) { // Call ended, close the notification - ring_hide_notification(RING_NOTIFIER(widgets->notifier), notifId); + hide_notification(NOTIFIER(widgets->notifier), notifId); } } catch (const std::exception& e) { g_warning("Can't get call %s for this account.", callId.c_str()); @@ -2269,8 +2269,8 @@ CppImpl::slotNewIncomingCall(const std::string& callId) if (!accountInfo_) { return; } - if (g_settings_get_boolean(widgets->settings, "bring-window-to-front")) { - g_settings_set_boolean(widgets->settings, "show-main-window", TRUE); + if (g_settings_get_boolean(widgets->window_settings, "bring-window-to-front")) { + g_settings_set_boolean(widgets->window_settings, "show-main-window", TRUE); } try { auto call = accountInfo_->callModel->getCall(callId); @@ -2297,10 +2297,10 @@ CppImpl::slotNewIncomingCall(const std::string& callId) return; } - if (g_settings_get_boolean(widgets->settings, "enable-call-notifications")) { + if (g_settings_get_boolean(widgets->window_settings, "enable-call-notifications")) { name.erase(std::remove(name.begin(), name.end(), '\r'), name.end()); auto body = name + _(" is calling you!"); - ring_show_notification(RING_NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("Incoming call"), body, NotificationType::CALL); + show_notification(NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("Incoming call"), body, NotificationType::CALL); } } catch (const std::exception& e) { g_warning("Can't get call %s for this account.", callId.c_str()); @@ -2327,7 +2327,7 @@ CppImpl::slotFilterChanged() if (IS_CHAT_VIEW(old_view)) { if (isInConv) { - changeView(RING_WELCOME_VIEW_TYPE); + changeView(WELCOME_VIEW_TYPE); } else { /* Refresh chat view. In some cases (like when a contact is unbanned) a changing filter also implies the need of redrawing the chat */ @@ -2345,7 +2345,7 @@ CppImpl::slotNewConversation(const std::string& uid) accountInfo_->conversationModel->setFilter(""); // Select new conversation if contact added auto* old_view = gtk_bin_get_child(GTK_BIN(widgets->frame_call)); - if (IS_RING_WELCOME_VIEW(old_view)) { + if (IS_WELCOME_VIEW(old_view)) { accountInfo_->conversationModel->selectConversation(uid); if (chatViewConversation_) { try { @@ -2370,7 +2370,7 @@ CppImpl::slotConversationRemoved(const std::string& uid) else if (IS_INCOMING_CALL_VIEW(old_view)) current_item = incoming_call_view_get_conversation(INCOMING_CALL_VIEW(old_view)); if (current_item.uid == uid) - changeView(RING_WELCOME_VIEW_TYPE); + changeView(WELCOME_VIEW_TYPE); } void @@ -2441,10 +2441,10 @@ CppImpl::slotNewTrustRequest(const std::string& id, const std::string& contactUr g_warning("Can't get contact for account %s. Don't show notification", accountInfo.id.c_str()); return; } - if (g_settings_get_boolean(widgets->settings, "enable-pending-notifications")) { + if (g_settings_get_boolean(widgets->window_settings, "enable-pending-notifications")) { name.erase(std::remove(name.begin(), name.end(), '\r'), name.end()); auto body = _("New request from ") + name; - ring_show_notification(RING_NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("Trust request"), body, NotificationType::REQUEST); + show_notification(NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("Trust request"), body, NotificationType::REQUEST); } } catch (...) { g_warning("Can't get account %s", id.c_str()); @@ -2457,7 +2457,7 @@ CppImpl::slotCloseTrustRequest(const std::string& id, const std::string& contact try { auto& accountInfo = lrc_->getAccountModel().getAccountInfo(id); auto notifId = accountInfo.id + ":request:" + contactUri; - ring_hide_notification(RING_NOTIFIER(widgets->notifier), notifId); + hide_notification(NOTIFIER(widgets->notifier), notifId); } catch (...) { g_warning("Can't get account %s", id.c_str()); } @@ -2502,10 +2502,10 @@ CppImpl::slotNewInteraction(const std::string& accountId, const std::string& con return; } - if (g_settings_get_boolean(widgets->settings, "enable-chat-notifications")) { + if (g_settings_get_boolean(widgets->window_settings, "enable-chat-notifications")) { name.erase(std::remove(name.begin(), name.end(), '\r'), name.end()); auto body = name + ": " + interaction.body; - ring_show_notification(RING_NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("New message"), body, NotificationType::CHAT); + show_notification(NOTIFIER(widgets->notifier), avatar, uri, name, notifId, _("New message"), body, NotificationType::CHAT); } } } @@ -2524,7 +2524,7 @@ CppImpl::slotCloseInteraction(const std::string& accountId, const std::string& c try { auto& accountInfo = lrc_->getAccountModel().getAccountInfo(accountId); auto notifId = accountInfo.id + ":interaction:" + conversation + ":" + std::to_string(interactionId); - ring_hide_notification(RING_NOTIFIER(widgets->notifier), notifId); + hide_notification(NOTIFIER(widgets->notifier), notifId); } catch (...) { g_warning("Can't get account %s", accountId.c_str()); } @@ -2553,19 +2553,19 @@ CppImpl::slotProfileUpdated(const std::string& id) }} // namespace <anonymous>::details void -ring_main_window_reset(RingMainWindow* self) +main_window_reset(MainWindow* self) { - g_return_if_fail(IS_RING_MAIN_WINDOW(self)); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_if_fail(IS_MAIN_WINDOW(self)); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (priv->cpp->show_settings) priv->cpp->leaveSettingsView(); } bool -ring_main_window_can_close(RingMainWindow* self) +main_window_can_close(MainWindow* self) { - g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), true); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + g_return_val_if_fail(IS_MAIN_WINDOW(self), true); + auto* priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(self)); if (!lrc::api::Lrc::activeCalls().empty()) { auto res = priv->cpp->showOkCancelDialog( _("Stop current call?"), @@ -2577,26 +2577,26 @@ ring_main_window_can_close(RingMainWindow* self) } void -ring_main_window_display_account_list(RingMainWindow *win) +main_window_display_account_list(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); gtk_combo_box_popup(GTK_COMBO_BOX(priv->combobox_account_selector)); } void -ring_main_window_search(RingMainWindow *win) +main_window_search(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); gtk_widget_grab_focus(GTK_WIDGET(priv->search_entry)); } void -ring_main_window_conversations_list(RingMainWindow *win) +main_window_conversations_list(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); auto smartViewPageNum = gtk_notebook_page_num(GTK_NOTEBOOK(priv->notebook_contacts), priv->scrolled_window_smartview); gtk_notebook_set_current_page(GTK_NOTEBOOK(priv->notebook_contacts), smartViewPageNum); @@ -2604,10 +2604,10 @@ ring_main_window_conversations_list(RingMainWindow *win) } void -ring_main_window_requests_list(RingMainWindow *win) +main_window_requests_list(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); if (!priv->cpp->accountInfo_->contactModel->hasPendingRequests()) return; auto contactRequestsPageNum = gtk_notebook_page_num(GTK_NOTEBOOK(priv->notebook_contacts), priv->scrolled_window_contact_requests); @@ -2616,10 +2616,10 @@ ring_main_window_requests_list(RingMainWindow *win) } void -ring_main_window_audio_call(RingMainWindow *win) +main_window_audio_call(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp); priv->cpp->forCurrentConversation([&](const auto& conversation){ @@ -2628,10 +2628,10 @@ ring_main_window_audio_call(RingMainWindow *win) } void -ring_main_window_clear_history(RingMainWindow *win) +main_window_clear_history(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); priv->cpp->forCurrentConversation([&](const auto &conversation) { @@ -2644,10 +2644,10 @@ ring_main_window_clear_history(RingMainWindow *win) } void -ring_main_window_remove_conversation(RingMainWindow *win) +main_window_remove_conversation(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); priv->cpp->forCurrentConversation([&](const auto& conversation){ @@ -2660,10 +2660,10 @@ ring_main_window_remove_conversation(RingMainWindow *win) } void -ring_main_window_block_contact(RingMainWindow *win) +main_window_block_contact(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); priv->cpp->forCurrentConversation([&](const auto& conversation){ @@ -2676,10 +2676,10 @@ ring_main_window_block_contact(RingMainWindow *win) } void -ring_main_window_unblock_contact(RingMainWindow *win) +main_window_unblock_contact(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); priv->cpp->forCurrentConversation([&](const auto& conversation){ @@ -2692,10 +2692,10 @@ ring_main_window_unblock_contact(RingMainWindow *win) } void -ring_main_window_copy_contact(RingMainWindow *win) +main_window_copy_contact(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); priv->cpp->forCurrentConversation([&](const auto& conversation){ @@ -2710,10 +2710,10 @@ ring_main_window_copy_contact(RingMainWindow *win) } void -ring_main_window_add_contact(RingMainWindow *win) +main_window_add_contact(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp); priv->cpp->forCurrentConversation([&](const auto &conversation) { @@ -2722,10 +2722,10 @@ ring_main_window_add_contact(RingMainWindow *win) } void -ring_main_window_accept_call(RingMainWindow *win) +main_window_accept_call(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_); // Select the first conversation of the list @@ -2747,10 +2747,10 @@ ring_main_window_accept_call(RingMainWindow *win) } void -ring_main_window_decline_call(RingMainWindow *win) +main_window_decline_call(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp); priv->cpp->forCurrentConversation([&](const auto &conversation) { @@ -2759,10 +2759,10 @@ ring_main_window_decline_call(RingMainWindow *win) } void -ring_main_window_toggle_fullscreen(RingMainWindow *win) +main_window_toggle_fullscreen(MainWindow *win) { - g_return_if_fail(IS_RING_MAIN_WINDOW(win)); - auto *priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(win)); + g_return_if_fail(IS_MAIN_WINDOW(win)); + auto *priv = MAIN_WINDOW_GET_PRIVATE(MAIN_WINDOW(win)); g_return_if_fail(priv && priv->cpp); if (priv->cpp->is_fullscreen) return; @@ -2778,9 +2778,9 @@ ring_main_window_toggle_fullscreen(RingMainWindow *win) //============================================================================== static void -ring_main_window_init(RingMainWindow *win) +main_window_init(MainWindow *win) { - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(win); + auto* priv = MAIN_WINDOW_GET_PRIVATE(win); gtk_widget_init_template(GTK_WIDGET(win)); #if USE_LIBNM @@ -2789,15 +2789,15 @@ ring_main_window_init(RingMainWindow *win) // CppImpl ctor priv->cpp = new details::CppImpl {*win}; - priv->notifier = ring_notifier_new(); + priv->notifier = notifier_new(); priv->cpp->init(); } static void -ring_main_window_dispose(GObject *object) +main_window_dispose(GObject *object) { - auto* self = RING_MAIN_WINDOW(object); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(self); + auto* self = MAIN_WINDOW(object); + auto* priv = MAIN_WINDOW_GET_PRIVATE(self); if (priv->cpp) { delete priv->cpp; @@ -2837,55 +2837,55 @@ ring_main_window_dispose(GObject *object) priv->notifier = nullptr; } - G_OBJECT_CLASS(ring_main_window_parent_class)->dispose(object); + G_OBJECT_CLASS(main_window_parent_class)->dispose(object); } static void -ring_main_window_finalize(GObject *object) +main_window_finalize(GObject *object) { - auto* self = RING_MAIN_WINDOW(object); - auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(self); + auto* self = MAIN_WINDOW(object); + auto* priv = MAIN_WINDOW_GET_PRIVATE(self); g_clear_object(&priv->settings); - G_OBJECT_CLASS(ring_main_window_parent_class)->finalize(object); + G_OBJECT_CLASS(main_window_parent_class)->finalize(object); } static void -ring_main_window_class_init(RingMainWindowClass *klass) +main_window_class_init(MainWindowClass *klass) { - G_OBJECT_CLASS(klass)->finalize = ring_main_window_finalize; - G_OBJECT_CLASS(klass)->dispose = ring_main_window_dispose; + G_OBJECT_CLASS(klass)->finalize = main_window_finalize; + G_OBJECT_CLASS(klass)->dispose = main_window_dispose; gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS (klass), - "/net/jami/JamiGnome/ringmainwindow.ui"); - - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, vbox_left_pane); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, notebook_contacts); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, scrolled_window_smartview); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, ring_menu); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, image_ring); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, ring_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, image_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, hbox_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, search_entry); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, stack_main_view); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, vbox_call_view); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, frame_call); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, button_new_conversation ); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, radiobutton_general_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, radiobutton_media_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, radiobutton_new_account_settings); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, combobox_account_selector); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, scrolled_window_contact_requests); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, image_contact_requests_list); - gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), RingMainWindow, image_conversations_list); + "/net/jami/JamiGnome/mainwindow.ui"); + + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, vbox_left_pane); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, notebook_contacts); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, scrolled_window_smartview); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, menu); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, image_ring); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, image_settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, hbox_settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, search_entry); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, stack_main_view); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, vbox_call_view); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, frame_call); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, button_new_conversation ); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, radiobutton_general_settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, radiobutton_media_settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, radiobutton_new_account_settings); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, combobox_account_selector); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, scrolled_window_contact_requests); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, image_contact_requests_list); + gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MainWindow, image_conversations_list); } GtkWidget * -ring_main_window_new(GtkApplication *app) +main_window_new(GtkApplication *app) { - gpointer win = g_object_new(RING_MAIN_WINDOW_TYPE, "application", app, NULL); + gpointer win = g_object_new(MAIN_WINDOW_TYPE, "application", app, NULL); gtk_window_set_title(GTK_WINDOW(win), JAMI_CLIENT_NAME); return (GtkWidget *)win; } diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000000000000000000000000000000000000..625f94e4056aec20c060804a1ace711b20499afb --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2015-2019 Savoir-faire Linux Inc. + * Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com> + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +#define MAIN_WINDOW_TYPE (main_window_get_type ()) +#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIN_WINDOW_TYPE, MainWindow)) +#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MAIN_WINDOW_TYPE, MainWindowClass)) +#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAIN_WINDOW_TYPE)) +#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MAIN_WINDOW_TYPE)) + + +typedef struct _MainWindow MainWindow; +typedef struct _MainWindowClass MainWindowClass; + + +GType main_window_get_type (void) G_GNUC_CONST; +GtkWidget *main_window_new (GtkApplication *app); +void main_window_reset (MainWindow *win); +bool main_window_can_close(MainWindow *win); +void main_window_display_account_list(MainWindow *win); +void main_window_search(MainWindow *win); + +void main_window_conversations_list(MainWindow *win); +void main_window_requests_list(MainWindow *win); +void main_window_audio_call(MainWindow *win); +void main_window_clear_history(MainWindow *win); +void main_window_remove_conversation(MainWindow *win); +void main_window_block_contact(MainWindow *win); +void main_window_unblock_contact(MainWindow *win); +void main_window_copy_contact(MainWindow *win); +void main_window_add_contact(MainWindow *win); +void main_window_accept_call(MainWindow *win); +void main_window_decline_call(MainWindow *win); +void main_window_toggle_fullscreen(MainWindow *win); + +G_END_DECLS diff --git a/src/native/dbuserrorhandler.cpp b/src/native/dbuserrorhandler.cpp index 5163664cfd5be2cecc5ce5bd9289aab0580e10ce..a7c53497f07a84064bcd03c8e4ece0866e14d01a 100644 --- a/src/native/dbuserrorhandler.cpp +++ b/src/native/dbuserrorhandler.cpp @@ -20,7 +20,7 @@ #include <glib/gi18n.h> #include <globalinstances.h> -#include "../ring_client.h" +#include "../client.h" #include <api/lrc.h> namespace Interfaces { @@ -37,7 +37,7 @@ dring_crash_dialog() /* get the main window */ if (auto app = g_application_get_default()) { - auto win = ring_client_get_main_window(RING_CLIENT(app)); + auto win = client_get_main_window(CLIENT(app)); if (win) { gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(win)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); @@ -70,12 +70,12 @@ dring_crash_dialog() } static GtkWidget* -ring_quitting_dialog() +quitting_dialog() { /* get the main window */ GtkWindow *win = NULL; if (auto app = g_application_get_default()) { - win = ring_client_get_main_window(RING_CLIENT(app)); + win = client_get_main_window(CLIENT(app)); } else { g_warning("no default GApplication exists"); } @@ -108,7 +108,7 @@ check_connection_cb(GtkWidget *warning_dialog) if ((!lrc::api::Lrc::isConnected()) || (!lrc::api::Lrc::dbusIsValid())) { g_warning("could not reconnect to the daemon"); - auto quit_dialog = ring_quitting_dialog(); + auto quit_dialog = quitting_dialog(); /* wait for the user to exit the dialog */ gtk_dialog_run(GTK_DIALOG(quit_dialog)); diff --git a/src/native/pixbufmanipulator.cpp b/src/native/pixbufmanipulator.cpp index 32653d0c668743b00e64b35a91f48e3709cf9a94..d3735fe4af2fa3a2116034752d55964209ad3266 100644 --- a/src/native/pixbufmanipulator.cpp +++ b/src/native/pixbufmanipulator.cpp @@ -36,7 +36,7 @@ namespace Interfaces { PixbufManipulator::PixbufManipulator() - : conferenceAvatar_{ring_draw_conference_avatar(FALLBACK_AVATAR_SIZE), g_object_unref} + : conferenceAvatar_{draw_conference_avatar(FALLBACK_AVATAR_SIZE), g_object_unref} { } @@ -72,7 +72,7 @@ PixbufManipulator::generateAvatar(const std::string& alias, const std::string& u } return std::shared_ptr<GdkPixbuf> { - ring_draw_fallback_avatar( + draw_fallback_avatar( FALLBACK_AVATAR_SIZE, letter, color @@ -114,18 +114,18 @@ PixbufManipulator::scaleAndFrame(const GdkPixbuf *photo, /* frame photo */ std::shared_ptr<GdkPixbuf> result { - ring_frame_avatar(scaled_photo.get()), + frame_avatar(scaled_photo.get()), g_object_unref }; /* draw information */ if (displayInformation) { /* draw status */ - result.reset(ring_draw_status(result.get(), status), g_object_unref); + result.reset(draw_status(result.get(), status), g_object_unref); /* draw visual notification for unread messages */ if (unreadMessages) - result.reset(ring_draw_unread_messages(result.get(), unreadMessages), g_object_unref); + result.reset(draw_unread_messages(result.get(), unreadMessages), g_object_unref); } return result; diff --git a/src/newaccountsettingsview.cpp b/src/newaccountsettingsview.cpp index add0518e0ab2c26f7124514a07aa869fb74145cb..3716d8a1d510e4948bc72325a82f74990ab7dc7d 100644 --- a/src/newaccountsettingsview.cpp +++ b/src/newaccountsettingsview.cpp @@ -34,7 +34,7 @@ #include <api/newaccountmodel.h> #include <api/newcodecmodel.h> -// Ring client +// Jami Client #include "avatarmanipulation.h" #include "defines.h" #include "utils/files.h" @@ -42,7 +42,7 @@ enum { - PROP_RING_MAIN_WIN_PNT = 1, + PROP_MAIN_WIN_PNT = 1, }; struct _NewAccountSettingsView diff --git a/src/ringnotify.cpp b/src/notifier.cpp similarity index 77% rename from src/ringnotify.cpp rename to src/notifier.cpp index cd6726b705a7c46ed1b409e9cf62df02c849f593..1b3357669013bb5a4dea13a7a654ec8e63a592f1 100644 --- a/src/ringnotify.cpp +++ b/src/notifier.cpp @@ -18,9 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ringnotify.h" +#include "notifier.h" #include "config.h" -#include "ring_client.h" +#include "client.h" #if USE_CANBERRA #include <canberra-gtk.h> @@ -45,26 +45,26 @@ namespace details class CppImpl; } -struct _RingNotifier +struct _Notifier { GtkBox parent; }; -struct _RingNotifierClass +struct _NotifierClass { GtkBoxClass parent_class; }; -typedef struct _RingNotifierPrivate RingNotifierPrivate; +typedef struct _NotifierPrivate NotifierPrivate; -struct _RingNotifierPrivate +struct _NotifierPrivate { details::CppImpl* cpp; ///< Non-UI and C++ only code0 }; -G_DEFINE_TYPE_WITH_PRIVATE(RingNotifier, ring_notifier, GTK_TYPE_BOX); +G_DEFINE_TYPE_WITH_PRIVATE(Notifier, notifier, GTK_TYPE_BOX); -#define RING_NOTIFIER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), RING_NOTIFIER_TYPE, RingNotifierPrivate)) +#define NOTIFIER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), NOTIFIER_TYPE, NotifierPrivate)) /* signals */ enum { @@ -76,7 +76,7 @@ enum { LAST_SIGNAL }; -static guint ring_notifier_signals[LAST_SIGNAL] = { 0 }; +static guint notifier_signals[LAST_SIGNAL] = { 0 }; namespace details { @@ -84,11 +84,11 @@ namespace details class CppImpl { public: - explicit CppImpl(RingNotifier& widget); + explicit CppImpl(Notifier& widget); ~CppImpl(); - RingNotifier* self = nullptr; // The GTK widget itself - RingNotifierPrivate* priv = nullptr; + Notifier* self = nullptr; // The GTK widget itself + NotifierPrivate* priv = nullptr; /* server info and capabilities */ char *name = nullptr; @@ -107,7 +107,7 @@ private: CppImpl& operator=(const CppImpl&) = delete; }; -CppImpl::CppImpl(RingNotifier& widget) +CppImpl::CppImpl(Notifier& widget) : self {&widget} { } @@ -127,10 +127,10 @@ CppImpl::~CppImpl() } // namespace details static void -ring_notifier_dispose(GObject *object) +notifier_dispose(GObject *object) { - auto* self = RING_NOTIFIER(object); - auto* priv = RING_NOTIFIER_GET_PRIVATE(self); + auto* self = NOTIFIER(object); + auto* priv = NOTIFIER_GET_PRIVATE(self); delete priv->cpp; priv->cpp = nullptr; @@ -140,17 +140,17 @@ ring_notifier_dispose(GObject *object) notify_uninit(); #endif - G_OBJECT_CLASS(ring_notifier_parent_class)->dispose(object); + G_OBJECT_CLASS(notifier_parent_class)->dispose(object); } static void -ring_notifier_init(RingNotifier *view) +notifier_init(Notifier *view) { - RingNotifierPrivate *priv = RING_NOTIFIER_GET_PRIVATE(view); + NotifierPrivate *priv = NOTIFIER_GET_PRIVATE(view); priv->cpp = new details::CppImpl {*view}; #if USE_LIBNOTIFY - notify_init("Ring"); + notify_init("Jami"); /* get notify server info */ if (notify_get_server_info(&priv->cpp->name, @@ -180,11 +180,11 @@ ring_notifier_init(RingNotifier *view) } static void -ring_notifier_class_init(RingNotifierClass *klass) +notifier_class_init(NotifierClass *klass) { - G_OBJECT_CLASS(klass)->dispose = ring_notifier_dispose; + G_OBJECT_CLASS(klass)->dispose = notifier_dispose; - ring_notifier_signals[SHOW_CHAT] = g_signal_new( + notifier_signals[SHOW_CHAT] = g_signal_new( "showChatView", G_TYPE_FROM_CLASS(klass), (GSignalFlags) (G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED), @@ -194,7 +194,7 @@ ring_notifier_class_init(RingNotifierClass *klass) g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - ring_notifier_signals[ACCEPT_PENDING] = g_signal_new( + notifier_signals[ACCEPT_PENDING] = g_signal_new( "acceptPending", G_TYPE_FROM_CLASS(klass), (GSignalFlags) (G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED), @@ -204,7 +204,7 @@ ring_notifier_class_init(RingNotifierClass *klass) g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - ring_notifier_signals[REFUSE_PENDING] = g_signal_new( + notifier_signals[REFUSE_PENDING] = g_signal_new( "refusePending", G_TYPE_FROM_CLASS(klass), (GSignalFlags) (G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED), @@ -214,7 +214,7 @@ ring_notifier_class_init(RingNotifierClass *klass) g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - ring_notifier_signals[ACCEPT_CALL] = g_signal_new( + notifier_signals[ACCEPT_CALL] = g_signal_new( "acceptCall", G_TYPE_FROM_CLASS(klass), (GSignalFlags) (G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED), @@ -224,7 +224,7 @@ ring_notifier_class_init(RingNotifierClass *klass) g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - ring_notifier_signals[DECLINE_CALL] = g_signal_new( + notifier_signals[DECLINE_CALL] = g_signal_new( "declineCall", G_TYPE_FROM_CLASS(klass), (GSignalFlags) (G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED), @@ -236,58 +236,58 @@ ring_notifier_class_init(RingNotifierClass *klass) } GtkWidget * -ring_notifier_new() +notifier_new() { - gpointer view = g_object_new(RING_NOTIFIER_TYPE, NULL); + gpointer view = g_object_new(NOTIFIER_TYPE, NULL); return (GtkWidget *)view; } #if USE_LIBNOTIFY static void -show_chat_view(NotifyNotification*, char* id, RingNotifier* view) +show_chat_view(NotifyNotification*, char* id, Notifier* view) { - g_signal_emit(G_OBJECT(view), ring_notifier_signals[SHOW_CHAT], 0, id); + g_signal_emit(G_OBJECT(view), notifier_signals[SHOW_CHAT], 0, id); } static void -accept_pending(NotifyNotification*, char* id, RingNotifier* view) +accept_pending(NotifyNotification*, char* id, Notifier* view) { std::string newId = id; - g_signal_emit(G_OBJECT(view), ring_notifier_signals[ACCEPT_PENDING], 0, newId.substr(std::string("add:").length()).c_str()); + g_signal_emit(G_OBJECT(view), notifier_signals[ACCEPT_PENDING], 0, newId.substr(std::string("add:").length()).c_str()); } static void -refuse_pending(NotifyNotification*, char* id, RingNotifier* view) +refuse_pending(NotifyNotification*, char* id, Notifier* view) { std::string newId = id; - g_signal_emit(G_OBJECT(view), ring_notifier_signals[REFUSE_PENDING], 0, newId.substr(std::string("rm:").length()).c_str()); + g_signal_emit(G_OBJECT(view), notifier_signals[REFUSE_PENDING], 0, newId.substr(std::string("rm:").length()).c_str()); } static void -accept_call(NotifyNotification*, char* id, RingNotifier* view) +accept_call(NotifyNotification*, char* id, Notifier* view) { std::string newId = id; - g_signal_emit(G_OBJECT(view), ring_notifier_signals[ACCEPT_CALL], 0, newId.substr(std::string("accept:").length()).c_str()); + g_signal_emit(G_OBJECT(view), notifier_signals[ACCEPT_CALL], 0, newId.substr(std::string("accept:").length()).c_str()); } static void -decline_call(NotifyNotification*, char* id, RingNotifier* view) +decline_call(NotifyNotification*, char* id, Notifier* view) { std::string newId = id; - g_signal_emit(G_OBJECT(view), ring_notifier_signals[DECLINE_CALL], 0, newId.substr(std::string("decline:").length()).c_str()); + g_signal_emit(G_OBJECT(view), notifier_signals[DECLINE_CALL], 0, newId.substr(std::string("decline:").length()).c_str()); } #endif gboolean -ring_show_notification(RingNotifier* view, const std::string& icon, +show_notification(Notifier* view, const std::string& icon, const std::string& uri, const std::string& name, const std::string& id, const std::string& title, const std::string& body, NotificationType type) { - g_return_val_if_fail(IS_RING_NOTIFIER(view), false); + g_return_val_if_fail(IS_NOTIFIER(view), false); gboolean success = FALSE; - RingNotifierPrivate *priv = RING_NOTIFIER_GET_PRIVATE(view); + NotifierPrivate *priv = NOTIFIER_GET_PRIVATE(view); #if USE_LIBNOTIFY std::shared_ptr<NotifyNotification> notification( @@ -383,10 +383,10 @@ ring_show_notification(RingNotifier* view, const std::string& icon, } gboolean -ring_hide_notification(RingNotifier* view, const std::string& id) +hide_notification(Notifier* view, const std::string& id) { - g_return_val_if_fail(IS_RING_NOTIFIER(view), false); - RingNotifierPrivate *priv = RING_NOTIFIER_GET_PRIVATE(view); + g_return_val_if_fail(IS_NOTIFIER(view), false); + NotifierPrivate *priv = NOTIFIER_GET_PRIVATE(view); #if USE_LIBNOTIFY // Search diff --git a/src/ringnotify.h b/src/notifier.h similarity index 62% rename from src/ringnotify.h rename to src/notifier.h index 93c45a998045227ad3e4caa122ec59c0770e59a7..38f2a8c544e1f776a5400b28c5f075a7c7336da2 100644 --- a/src/ringnotify.h +++ b/src/notifier.h @@ -18,21 +18,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef RING_NOTIFY_H_ -#define RING_NOTIFY_H_ +#ifndef NOTIFY_H_ +#define NOTIFY_H_ #include <gtk/gtk.h> #include <string> G_BEGIN_DECLS -#define RING_NOTIFIER_TYPE (ring_notifier_get_type ()) -#define RING_NOTIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RING_NOTIFIER_TYPE, RingNotifier)) -#define RING_NOTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RING_NOTIFIER_TYPE, RingNotifierClass)) -#define IS_RING_NOTIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_NOTIFIER_TYPE)) -#define IS_RING_NOTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RING_NOTIFIER_TYPE)) +#define NOTIFIER_TYPE (notifier_get_type ()) +#define NOTIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFIER_TYPE, Notifier)) +#define NOTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NOTIFIER_TYPE, NotifierClass)) +#define IS_NOTIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NOTIFIER_TYPE)) +#define IS_NOTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NOTIFIER_TYPE)) -typedef struct _RingNotifier RingNotifier; -typedef struct _RingNotifierClass RingNotifierClass; +typedef struct _Notifier Notifier; +typedef struct _NotifierClass NotifierClass; enum class NotificationType { @@ -41,10 +41,10 @@ enum class NotificationType CHAT }; -GType ring_notifier_get_type (void) G_GNUC_CONST; -GtkWidget* ring_notifier_new (void); +GType notifier_get_type (void) G_GNUC_CONST; +GtkWidget* notifier_new (void); -gboolean ring_show_notification(RingNotifier* view, +gboolean show_notification(Notifier* view, const std::string& icon, const std::string& uri, const std::string& name, @@ -52,8 +52,8 @@ gboolean ring_show_notification(RingNotifier* view, const std::string& title, const std::string& body, NotificationType type); -gboolean ring_hide_notification(RingNotifier* view, const std::string& id); +gboolean hide_notification(Notifier* view, const std::string& id); G_END_DECLS -#endif /* RING_NOTIFY_H_ */ +#endif /* NOTIFY_H_ */ diff --git a/src/revision.h.in b/src/revision.h.in index 6db09dd85d3090661966e9da72481d296ec6f248..e35a6588d5aaf34481759a03bc3bf2d3a75a27a2 100644 --- a/src/revision.h.in +++ b/src/revision.h.in @@ -1,4 +1,4 @@ /* cmake will generate revision.h with a define containing the git revision (if found) */ -#define RING_CLIENT_REVISION "@RING_CLIENT_REVISION@" -#define RING_CLIENT_BUILD_DATE "@RING_CLIENT_BUILD_DATE@" +#define CLIENT_REVISION "@CLIENT_REVISION@" +#define CLIENT_BUILD_DATE "@CLIENT_BUILD_DATE@" diff --git a/src/ringmainwindow.h b/src/ringmainwindow.h deleted file mode 100644 index b485698993c4e1fd76ae02093d9394f36b3004c8..0000000000000000000000000000000000000000 --- a/src/ringmainwindow.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2015-2019 Savoir-faire Linux Inc. - * Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com> - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef _RINGMAINWINDOW_H -#define _RINGMAINWINDOW_H - -#include <gtk/gtk.h> - -G_BEGIN_DECLS - -#define RING_MAIN_WINDOW_TYPE (ring_main_window_get_type ()) -#define RING_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RING_MAIN_WINDOW_TYPE, RingMainWindow)) -#define RING_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RING_MAIN_WINDOW_TYPE, RingMainWindowClass)) -#define IS_RING_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_MAIN_WINDOW_TYPE)) -#define IS_RING_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RING_MAIN_WINDOW_TYPE)) - - -typedef struct _RingMainWindow RingMainWindow; -typedef struct _RingMainWindowClass RingMainWindowClass; - - -GType ring_main_window_get_type (void) G_GNUC_CONST; -GtkWidget *ring_main_window_new (GtkApplication *app); -void ring_main_window_reset (RingMainWindow *win); -bool ring_main_window_can_close(RingMainWindow *win); -void ring_main_window_display_account_list(RingMainWindow *win); -void ring_main_window_search(RingMainWindow *win); - -void ring_main_window_conversations_list(RingMainWindow *win); -void ring_main_window_requests_list(RingMainWindow *win); -void ring_main_window_audio_call(RingMainWindow *win); -void ring_main_window_clear_history(RingMainWindow *win); -void ring_main_window_remove_conversation(RingMainWindow *win); -void ring_main_window_block_contact(RingMainWindow *win); -void ring_main_window_unblock_contact(RingMainWindow *win); -void ring_main_window_copy_contact(RingMainWindow *win); -void ring_main_window_add_contact(RingMainWindow *win); -void ring_main_window_accept_call(RingMainWindow *win); -void ring_main_window_decline_call(RingMainWindow *win); -void ring_main_window_toggle_fullscreen(RingMainWindow *win); - -G_END_DECLS - -#endif /* _RINGMAINWINDOW_H */ diff --git a/src/usernameregistrationbox.cpp b/src/usernameregistrationbox.cpp index 5d1738b9a5a143f1309329cf5d0c3feedcda836f..7b51adc6176d879dd57e2b88379e9337dbdd1a39 100644 --- a/src/usernameregistrationbox.cpp +++ b/src/usernameregistrationbox.cpp @@ -25,7 +25,7 @@ #include <api/newaccountmodel.h> #include <namedirectory.h> -// Ring Client +// Jami Client #include "usernameregistrationbox.h" #include "utils/models.h" diff --git a/src/utils/drawing.cpp b/src/utils/drawing.cpp index a9d6bdc2a3a52cba103baafe7db02d0ac6672b30..8a0939c0bab115cb0e7775ab73ef3c8c7eea340e 100644 --- a/src/utils/drawing.cpp +++ b/src/utils/drawing.cpp @@ -51,7 +51,7 @@ static constexpr GdkRGBA COLOR_PALETTE[] = {{0.956862, 0.262745, 0.211764, 1 {0.376470, 0.490196, 0.545098, 1.0}};// red 95, green 124, blue 138, 1 (blue grey) GdkPixbuf * -ring_draw_fallback_avatar(int size, const std::string& letter, const char color) { +draw_fallback_avatar(int size, const std::string& letter, const char color) { cairo_surface_t *surface; cairo_t *cr; @@ -99,7 +99,7 @@ ring_draw_fallback_avatar(int size, const std::string& letter, const char color) } GdkPixbuf * -ring_draw_conference_avatar(int size) { +draw_conference_avatar(int size) { cairo_surface_t *surface; cairo_t *cr; @@ -136,7 +136,7 @@ ring_draw_conference_avatar(int size) { } GdkPixbuf * -ring_frame_avatar(GdkPixbuf *avatar) { +frame_avatar(GdkPixbuf *avatar) { auto w = gdk_pixbuf_get_width(avatar); auto h = gdk_pixbuf_get_height(avatar); @@ -253,7 +253,7 @@ draw_qrcode(cairo_t* cr, const std::string& to_encode, uint32_t size) * Draws the presence icon in the top right corner of the given image. */ GdkPixbuf * -ring_draw_status(const GdkPixbuf *avatar, IconStatus status) { +draw_status(const GdkPixbuf *avatar, IconStatus status) { if (status == IconStatus::INVALID) { // simply return a copy of the original pixbuf return gdk_pixbuf_copy(avatar); @@ -320,7 +320,7 @@ ring_draw_status(const GdkPixbuf *avatar, IconStatus status) { * In the case that the count is less than or equal to 0, nothing is drawn. */ GdkPixbuf * -ring_draw_unread_messages(const GdkPixbuf *avatar, int unread_count) { +draw_unread_messages(const GdkPixbuf *avatar, int unread_count) { if (unread_count <= 0) { // simply return a copy of the original pixbuf return gdk_pixbuf_copy(avatar); diff --git a/src/utils/drawing.h b/src/utils/drawing.h index 72f5018c95043855cac4e0be66f9a83d6706d9a3..fd9812b8741bbf4602a2c599cd0ac2b02fb0e04c 100644 --- a/src/utils/drawing.h +++ b/src/utils/drawing.h @@ -23,13 +23,13 @@ #include <gtk/gtk.h> #include <string> -GdkPixbuf *ring_draw_fallback_avatar(int size, const std::string& letter, const char color = 0); +GdkPixbuf *draw_fallback_avatar(int size, const std::string& letter, const char color = 0); -GdkPixbuf *ring_draw_conference_avatar(int size); +GdkPixbuf *draw_conference_avatar(int size); -GdkPixbuf *ring_frame_avatar(GdkPixbuf *avatar); +GdkPixbuf *frame_avatar(GdkPixbuf *avatar); -GdkPixbuf *ring_draw_unread_messages(const GdkPixbuf *avatar, int unread_count); +GdkPixbuf *draw_unread_messages(const GdkPixbuf *avatar, int unread_count); gboolean draw_qrcode(cairo_t* cr, const std::string& to_encode, uint32_t size); @@ -42,7 +42,7 @@ enum class IconStatus { CONNECTED, INVALID }; -GdkPixbuf *ring_draw_status(const GdkPixbuf *avatar, IconStatus status); +GdkPixbuf *draw_status(const GdkPixbuf *avatar, IconStatus status); GdkRGBA get_ambient_color(GtkWidget* widget); diff --git a/src/utils/files.cpp b/src/utils/files.cpp index e78a6ca029c0e5a5a8a6445cdc08ed59b950c37d..2eba0b15cc61b663cac8a7e31a9534ef117c9f42 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -136,10 +136,10 @@ GSettingsSchema * get_settings_schema() { static std::unique_ptr<GSettingsSchema, decltype(g_settings_schema_unref )&> - ring_schema(nullptr, g_settings_schema_unref); + schema(nullptr, g_settings_schema_unref); - if (ring_schema.get() == nullptr) { - GSettingsSchema *schema = NULL; + if (schema.get() == nullptr) { + GSettingsSchema *settings_schema = NULL; /* find gschema.compiled by checking the following dirs in order: * - current bin dir @@ -160,7 +160,7 @@ get_settings_schema() &error); if (!error) { - schema = g_settings_schema_source_lookup(schema_source_local, + settings_schema = g_settings_schema_source_lookup(schema_source_local, JAMI_CLIENT_APP_ID, TRUE); g_settings_schema_source_unref(schema_source_local); @@ -170,7 +170,7 @@ get_settings_schema() } g_free(schema_dir_local); - if (!schema) { + if (!settings_schema) { /* try install dir */ g_debug("looking for schema in insall dir"); gchar *schema_dir_install = g_strconcat(JAMI_CLIENT_INSTALL, "/share/glib-2.0/schemas", NULL); @@ -182,7 +182,7 @@ get_settings_schema() &error); if (!error) { - schema = g_settings_schema_source_lookup(schema_source_install, + settings_schema = g_settings_schema_source_lookup(schema_source_install, JAMI_CLIENT_APP_ID, TRUE); g_settings_schema_source_unref(schema_source_install); @@ -193,16 +193,16 @@ get_settings_schema() g_free(schema_dir_install); } - if (!schema) { + if (!settings_schema) { /* try default dir */ g_debug("looking for schema in default dir"); - schema = g_settings_schema_source_lookup(g_settings_schema_source_get_default(), + settings_schema = g_settings_schema_source_lookup(g_settings_schema_source_get_default(), JAMI_CLIENT_APP_ID, TRUE); } - ring_schema.reset(schema); + schema.reset(settings_schema); } - return ring_schema.get(); + return schema.get(); } diff --git a/src/webkitchatcontainer.cpp b/src/webkitchatcontainer.cpp index b8f5ff607b652f07cc325c12ea566db44c36142c..9a2e9bc8da5f7cac3838588686e8a409a313224f 100644 --- a/src/webkitchatcontainer.cpp +++ b/src/webkitchatcontainer.cpp @@ -35,7 +35,7 @@ #include <api/conversationmodel.h> #include <api/account.h> -// Ring Client +// Jami Client #include "native/pixbufmanipulator.h" struct _WebKitChatContainer @@ -527,8 +527,8 @@ build_view(WebKitChatContainer *view) WebKitChatContainerPrivate *priv = WEBKIT_CHAT_CONTAINER_GET_PRIVATE(view); priv->chatview_debug = FALSE; - auto ring_chatview_debug = g_getenv("RING_CHATVIEW_DEBUG"); - if (ring_chatview_debug || g_strcmp0(ring_chatview_debug, "true") == 0) + auto chatview_debug = g_getenv("CHATVIEW_DEBUG"); + if (chatview_debug || g_strcmp0(chatview_debug, "true") == 0) { priv->chatview_debug = TRUE; } diff --git a/src/ringwelcomeview.cpp b/src/welcomeview.cpp similarity index 84% rename from src/ringwelcomeview.cpp rename to src/welcomeview.cpp index b1cb9fa053cc04a3643a97ebf6729962e36bc842..7c1203523c8aed173f54827d7d01c03c63cbc43a 100644 --- a/src/ringwelcomeview.cpp +++ b/src/welcomeview.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ringwelcomeview.h" +#include "welcomeview.h" #include "utils/drawing.h" #include <gtk/gtk.h> @@ -31,19 +31,19 @@ #include <QObject> #include <QItemSelectionModel> -struct _RingWelcomeView +struct _WelcomeView { GtkScrolledWindow parent; }; -struct _RingWelcomeViewClass +struct _WelcomeViewClass { GtkScrolledWindowClass parent_class; }; -typedef struct _RingWelcomeViewPrivate RingWelcomeViewPrivate; +typedef struct _WelcomeViewPrivate WelcomeViewPrivate; -struct _RingWelcomeViewPrivate +struct _WelcomeViewPrivate { GtkWidget *box_overlay; GtkWidget *label_explanation; @@ -59,16 +59,16 @@ struct _RingWelcomeViewPrivate }; -G_DEFINE_TYPE_WITH_PRIVATE(RingWelcomeView, ring_welcome_view, GTK_TYPE_SCROLLED_WINDOW); +G_DEFINE_TYPE_WITH_PRIVATE(WelcomeView, welcome_view, GTK_TYPE_SCROLLED_WINDOW); -#define RING_WELCOME_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), RING_WELCOME_VIEW_TYPE, RingWelcomeViewPrivate)) +#define WELCOME_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), WELCOME_VIEW_TYPE, WelcomeViewPrivate)) -static gboolean draw_qr_event(GtkWidget*,cairo_t*,RingWelcomeView*); -static void switch_qrcode(RingWelcomeView* self); +static gboolean draw_qr_event(GtkWidget*,cairo_t*,WelcomeView*); +static void switch_qrcode(WelcomeView* self); void -ring_welcome_update_view(RingWelcomeView* self) { - auto priv = RING_WELCOME_VIEW_GET_PRIVATE(self); +welcome_update_view(WelcomeView* self) { + auto priv = WELCOME_VIEW_GET_PRIVATE(self); // Only draw a basic view for SIP accounts if (not *priv->accountInfo_ || (*priv->accountInfo_)->profileInfo.type == lrc::api::profile::Type::SIP) { @@ -85,13 +85,13 @@ ring_welcome_update_view(RingWelcomeView* self) { auto color = priv->useDarkTheme? "white" : "black"; // Get registeredName, else the ID - gchar *ring_id = nullptr; + gchar *id = nullptr; if(! (*priv->accountInfo_)->registeredName.empty()){ gtk_label_set_text( GTK_LABEL(priv->label_explanation), _("This is your Jami username.\nCopy and share it with your friends!") ); - ring_id = g_markup_printf_escaped("<span fgcolor=\"%s\">%s</span>", color, + id = g_markup_printf_escaped("<span fgcolor=\"%s\">%s</span>", color, (*priv->accountInfo_)->registeredName.c_str()); } else if (!(*priv->accountInfo_)->profileInfo.uri.empty()) { @@ -99,14 +99,14 @@ ring_welcome_update_view(RingWelcomeView* self) { GTK_LABEL(priv->label_explanation), _("This is your ID.\nCopy and share it with your friends!") ); - ring_id = g_markup_printf_escaped("<span fgcolor=\"%s\">%s</span>", color, + id = g_markup_printf_escaped("<span fgcolor=\"%s\">%s</span>", color, (*priv->accountInfo_)->profileInfo.uri.c_str()); } else { gtk_label_set_text(GTK_LABEL(priv->label_explanation), NULL); - ring_id = g_strdup(""); + id = g_strdup(""); } - gtk_label_set_markup(GTK_LABEL(priv->label_ringid), ring_id); + gtk_label_set_markup(GTK_LABEL(priv->label_ringid), id); gtk_widget_show(priv->label_explanation); gtk_widget_show(priv->hbox_idlayout); @@ -114,7 +114,7 @@ ring_welcome_update_view(RingWelcomeView* self) { gtk_widget_show(priv->button_qrcode); gtk_widget_show(priv->revealer_qrcode); - g_free(ring_id); + g_free(id); GError *error = NULL; @@ -145,19 +145,19 @@ ring_welcome_update_view(RingWelcomeView* self) { } void -ring_welcome_set_theme(RingWelcomeView* self, bool useDarkTheme) +welcome_set_theme(WelcomeView* self, bool useDarkTheme) { - g_return_if_fail(IS_RING_WELCOME_VIEW(self)); - auto* priv = RING_WELCOME_VIEW_GET_PRIVATE(self); + g_return_if_fail(IS_WELCOME_VIEW(self)); + auto* priv = WELCOME_VIEW_GET_PRIVATE(self); priv->useDarkTheme = useDarkTheme; } static void -ring_welcome_view_init(RingWelcomeView *self) +welcome_view_init(WelcomeView *self) { - g_return_if_fail(IS_RING_WELCOME_VIEW(self)); - auto* priv = RING_WELCOME_VIEW_GET_PRIVATE(self); + g_return_if_fail(IS_WELCOME_VIEW(self)); + auto* priv = WELCOME_VIEW_GET_PRIVATE(self); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(self), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); @@ -277,33 +277,33 @@ ring_welcome_view_init(RingWelcomeView *self) } static void -ring_welcome_view_dispose(GObject *object) +welcome_view_dispose(GObject *object) { - auto* priv = RING_WELCOME_VIEW_GET_PRIVATE(object); + auto* priv = WELCOME_VIEW_GET_PRIVATE(object); QObject::disconnect(priv->nameRegistrationEnded_); - G_OBJECT_CLASS(ring_welcome_view_parent_class)->dispose(object); + G_OBJECT_CLASS(welcome_view_parent_class)->dispose(object); } static void -ring_welcome_view_finalize(GObject *object) +welcome_view_finalize(GObject *object) { - G_OBJECT_CLASS(ring_welcome_view_parent_class)->finalize(object); + G_OBJECT_CLASS(welcome_view_parent_class)->finalize(object); } static void -ring_welcome_view_class_init(RingWelcomeViewClass *klass) +welcome_view_class_init(WelcomeViewClass *klass) { - G_OBJECT_CLASS(klass)->finalize = ring_welcome_view_finalize; - G_OBJECT_CLASS(klass)->dispose = ring_welcome_view_dispose; + G_OBJECT_CLASS(klass)->finalize = welcome_view_finalize; + G_OBJECT_CLASS(klass)->dispose = welcome_view_dispose; } GtkWidget * -ring_welcome_view_new(AccountInfoPointer const & accountInfo) +welcome_view_new(AccountInfoPointer const & accountInfo) { - gpointer self = g_object_new(RING_WELCOME_VIEW_TYPE, NULL); - auto priv = RING_WELCOME_VIEW_GET_PRIVATE(self); + gpointer self = g_object_new(WELCOME_VIEW_TYPE, NULL); + auto priv = WELCOME_VIEW_GET_PRIVATE(self); priv->accountInfo_ = &accountInfo; - ring_welcome_update_view(RING_WELCOME_VIEW(self)); + welcome_update_view(WELCOME_VIEW(self)); return (GtkWidget *)self; } @@ -312,17 +312,17 @@ ring_welcome_view_new(AccountInfoPointer const & accountInfo) static gboolean draw_qr_event(G_GNUC_UNUSED GtkWidget* diese, cairo_t* cr, - RingWelcomeView* self) + WelcomeView* self) { - auto priv = RING_WELCOME_VIEW_GET_PRIVATE(self); + auto priv = WELCOME_VIEW_GET_PRIVATE(self); g_return_val_if_fail(priv, false); return draw_qrcode(cr, (*priv->accountInfo_)->profileInfo.uri.c_str(), 200); } static void -switch_qrcode(RingWelcomeView* self) +switch_qrcode(WelcomeView* self) { - auto priv = RING_WELCOME_VIEW_GET_PRIVATE(self); + auto priv = WELCOME_VIEW_GET_PRIVATE(self); auto to_reveal = !gtk_revealer_get_reveal_child(GTK_REVEALER(priv->revealer_qrcode)); gtk_revealer_set_reveal_child(GTK_REVEALER(priv->revealer_qrcode), to_reveal); diff --git a/src/ringwelcomeview.h b/src/welcomeview.h similarity index 54% rename from src/ringwelcomeview.h rename to src/welcomeview.h index 0386365c3c28864b664ae7f36c4c75797e600d05..e7beb7dcc34f2b39d1b9e9d07c1baa5e62f9954e 100644 --- a/src/ringwelcomeview.h +++ b/src/welcomeview.h @@ -29,18 +29,18 @@ G_BEGIN_DECLS -#define RING_WELCOME_VIEW_TYPE (ring_welcome_view_get_type ()) -#define RING_WELCOME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RING_WELCOME_VIEW_TYPE, RingWelcomeView)) -#define RING_WELCOME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RING_WELCOME_VIEW_TYPE, RingWelcomeViewClass)) -#define IS_RING_WELCOME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_WELCOME_VIEW_TYPE)) -#define IS_RING_WELCOME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RING_WELCOME_VIEW_TYPE)) - -typedef struct _RingWelcomeView RingWelcomeView; -typedef struct _RingWelcomeViewClass RingWelcomeViewClass; - -GType ring_welcome_view_get_type (void) G_GNUC_CONST; -GtkWidget* ring_welcome_view_new (AccountInfoPointer const & accountInfo); -void ring_welcome_update_view (RingWelcomeView* self); -void ring_welcome_set_theme (RingWelcomeView* self, bool useDarkTheme); +#define WELCOME_VIEW_TYPE (welcome_view_get_type ()) +#define WELCOME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WELCOME_VIEW_TYPE, WelcomeView)) +#define WELCOME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WELCOME_VIEW_TYPE, WelcomeViewClass)) +#define IS_WELCOME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WELCOME_VIEW_TYPE)) +#define IS_WELCOME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WELCOME_VIEW_TYPE)) + +typedef struct _WelcomeView WelcomeView; +typedef struct _WelcomeViewClass WelcomeViewClass; + +GType welcome_view_get_type (void) G_GNUC_CONST; +GtkWidget* welcome_view_new (AccountInfoPointer const & accountInfo); +void welcome_update_view (WelcomeView* self); +void welcome_set_theme (WelcomeView* self, bool useDarkTheme); G_END_DECLS diff --git a/ui/accountcreationwizard.ui b/ui/accountcreationwizard.ui index 528929462cad10bcc01b6ce57f9e13d7ffbfee84..ba7243b45ab282239fc320c3ce0cb6d6100294ab 100644 --- a/ui/accountcreationwizard.ui +++ b/ui/accountcreationwizard.ui @@ -135,7 +135,7 @@ <property name="border_width">10</property> <property name="orientation">vertical</property> <property name="spacing">15</property> - + <child> <object class="GtkLabel" id="existing_account_label"> <property name="visible">True</property> @@ -558,7 +558,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Register username</property> - <property name="tooltip_text" translatable="yes">By checking this, you will register a unique username on the Jami network. People can use it to contact you instead of using your RingID, which is 40 characters long.</property> + <property name="tooltip_text" translatable="yes">By checking this, you will register a unique username on the Jami network. People can use it to contact you instead of using your ID, which is 40 characters long.</property> </object> </child> <child> @@ -756,8 +756,8 @@ <property name="border_width">10</property> <property name="orientation">vertical</property> <property name="spacing">15</property> - - + + <child> <object class="GtkLabel"> <property name="visible">True</property> @@ -769,7 +769,7 @@ </attributes> </object> </child> - + <child> <object class="GtkLabel"> <property name="visible">True</property> @@ -783,7 +783,7 @@ </object> </child> - + <child> <object class="GtkCheckButton" id="button_never_show_again"> <property name="label" translatable="yes">Never show me this again</property> @@ -793,8 +793,8 @@ <property name="halign">fill</property> </object> </child> - - + + <child> <object class="GtkButtonBox"> <property name="visible">True</property> @@ -819,7 +819,7 @@ </child> </object> </child> - + </object> </child> <!-- End existing account wizard --> @@ -929,7 +929,7 @@ <property name="border_width">10</property> <property name="orientation">vertical</property> <property name="spacing">15</property> - + <child> <object class="GtkLabel"> <property name="visible">True</property> diff --git a/ui/ringgearsmenu.ui b/ui/gearsmenu.ui similarity index 100% rename from ui/ringgearsmenu.ui rename to ui/gearsmenu.ui diff --git a/ui/ringmainwindow.ui b/ui/mainwindow.ui similarity index 98% rename from ui/ringmainwindow.ui rename to ui/mainwindow.ui index b55a53273385aabeacb55ae226beccbaf47c3979..42c344d847b8c7809f0a2ed81f41511e872ecff1 100644 --- a/ui/ringmainwindow.ui +++ b/ui/mainwindow.ui @@ -31,7 +31,7 @@ <property name="icon_name">applications-multimedia-symbolic</property> <property name="icon_size">2</property> </object> - <template class="RingMainWindow" parent="GtkApplicationWindow"> + <template class="MainWindow" parent="GtkApplicationWindow"> <property name="title" translatable="no">Jami</property> <property name="can_focus">False</property> <property name="show_menubar">False</property> @@ -50,7 +50,7 @@ <property name="can_focus">False</property> <property name="show_close_button">True</property> <child> - <object class="GtkMenuButton" id="ring_menu"> + <object class="GtkMenuButton" id="menu"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> @@ -143,7 +143,7 @@ <property name="can_focus">False</property> <property name="spacing">0</property> <child> - <object class="GtkButton" id="ring_settings"> + <object class="GtkButton" id="settings"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> diff --git a/ui/newaccountsettingsview.ui b/ui/newaccountsettingsview.ui index 9745b34a72cfc47c2abdd404441646171426b52d..6d08a17b4bb305b316196150fd136722eaea7a12 100644 --- a/ui/newaccountsettingsview.ui +++ b/ui/newaccountsettingsview.ui @@ -603,7 +603,7 @@ </child> <!-- RING Enable account --> <child> - <object class="GtkBox" id="ring_enable_account"> + <object class="GtkBox" id="enable_account"> <property name="visible">True</property> <property name="halign">fill</property> <property name="orientation">horizontal</property> diff --git a/ui/ui.gresource.xml b/ui/ui.gresource.xml index 8e1b83e2f386343027d60b6bd975066e449afcc4..89c3f3de93f015761f7077bea3da58ec2e81ffef 100644 --- a/ui/ui.gresource.xml +++ b/ui/ui.gresource.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/net/jami/JamiGnome"> - <file preprocess="xml-stripblanks">ringmainwindow.ui</file> - <file preprocess="xml-stripblanks">ringgearsmenu.ui</file> + <file preprocess="xml-stripblanks">mainwindow.ui</file> + <file preprocess="xml-stripblanks">gearsmenu.ui</file> <file preprocess="xml-stripblanks">incomingcallview.ui</file> <file preprocess="xml-stripblanks">currentcallview.ui</file> <file preprocess="xml-stripblanks">accountcreationwizard.ui</file>