Commit f680d74c authored by Sébastien Blin's avatar Sébastien Blin

misc: remove ring references

Change-Id: Icc9702adc6175eab4b4b3b0aceefa1004fedf11c
parent 03672b33
......@@ -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
......
......@@ -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} )
......
......@@ -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
......
......@@ -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 ""
......
......@@ -25,7 +25,7 @@
// LRC
#include "api/newaccountmodel.h"
// Ring Client
// Jami Client
#include "utils/models.h"
#include "avatarmanipulation.h"
#include "accountcreationwizard.h"
......
......@@ -32,7 +32,7 @@
// LRC
#include <api/newaccountmodel.h>
// Ring Client
// Jami Client
#include "accountmigrationview.h"
#include "native/pixbufmanipulator.h"
......
......@@ -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,
......
......@@ -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;
}
......@@ -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_ */
......@@ -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);
......
......@@ -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_