Commit d6a68ebb authored by larchunix's avatar larchunix Committed by larchunix

Rename UNIQUE_APPNAME to REMMINA_APP_ID and use it wherever possible

parent a4a55b90
......@@ -116,10 +116,8 @@ if(NOT REMMINA_GIT_REVISION OR ${REMMINA_GIT_REVISION} STREQUAL "n/a")
endif()
message(STATUS "Git Revision ${REMMINA_GIT_REVISION}")
if(NOT UNIQUE_APPNAME)
# UNIQUE_APPNAME should follow Gnome Application ID rules
set(UNIQUE_APPNAME "org.remmina.Remmina")
endif()
# REMMINA_APP_ID should follow Gnome Application ID rules
set(REMMINA_APP_ID "org.remmina.Remmina")
if(NOT REMMINA_DATADIR)
set(REMMINA_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}")
......
......@@ -13,7 +13,7 @@
#cmakedefine HAVE_ERRNO_H
#define remmina "remmina"
#define UNIQUE_APPNAME "${UNIQUE_APPNAME}"
#define REMMINA_APP_ID "${REMMINA_APP_ID}"
#define VERSION "${REMMINA_VERSION}"
#define REMMINA_GIT_REVISION "${REMMINA_GIT_REVISION}"
......
......@@ -32,6 +32,7 @@
# version. If you delete this exception statement from all source
# files in the program, then also delete it here.
set(REMMINA_ICON ${REMMINA_APP_ID})
set(ICON16_DIR "${REMMINA_DATADIR}/icons/hicolor/16x16/apps")
set(ICON22_DIR "${REMMINA_DATADIR}/icons/hicolor/22x22/apps")
......@@ -45,25 +46,25 @@ set(ICON128_DIR "${REMMINA_DATADIR}/icons/hicolor/128x128/apps")
set(ICON256_DIR "${REMMINA_DATADIR}/icons/hicolor/256x256/apps")
set(ICONSVG_DIR "${REMMINA_DATADIR}/icons/hicolor/scalable/apps")
set(ICON16_DATA 16x16/apps/org.remmina.Remmina.png)
set(ICON22_DATA 22x22/apps/org.remmina.Remmina.png)
set(ICON24_DATA 24x24/apps/org.remmina.Remmina.png)
set(ICON16_DATA 16x16/apps/${REMMINA_ICON}.png)
set(ICON22_DATA 22x22/apps/${REMMINA_ICON}.png)
set(ICON24_DATA 24x24/apps/${REMMINA_ICON}.png)
set(ICON16_DATA_PANEL 16x16/apps/remmina-panel.png)
set(ICON22_DATA_PANEL 22x22/apps/remmina-panel.png)
set(ICON24_DATA_PANEL 24x24/apps/remmina-panel.png)
set(ICON16_DATA_PANEL_LIGHT 16x16/apps/remmina-panel-inverted.png)
set(ICON22_DATA_PANEL_LIGHT 22x22/apps/remmina-panel-inverted.png)
set(ICON24_DATA_PANEL_LIGHT 24x24/apps/remmina-panel-inverted.png)
set(ICON32_DATA 32x32/apps/org.remmina.Remmina.png)
set(ICON48_DATA 48x48/apps/org.remmina.Remmina.png)
set(ICON64_DATA 64x64/apps/org.remmina.Remmina.png)
set(ICON72_DATA 72x72/apps/org.remmina.Remmina.png)
set(ICON96_DATA 96x96/apps/org.remmina.Remmina.png)
set(ICON128_DATA 128x128/apps/org.remmina.Remmina.png)
set(ICON256_DATA 256x256/apps/org.remmina.Remmina.png)
set(ICON32_DATA 32x32/apps/${REMMINA_ICON}.png)
set(ICON48_DATA 48x48/apps/${REMMINA_ICON}.png)
set(ICON64_DATA 64x64/apps/${REMMINA_ICON}.png)
set(ICON72_DATA 72x72/apps/${REMMINA_ICON}.png)
set(ICON96_DATA 96x96/apps/${REMMINA_ICON}.png)
set(ICON128_DATA 128x128/apps/${REMMINA_ICON}.png)
set(ICON256_DATA 256x256/apps/${REMMINA_ICON}.png)
set(ICONSVG_DATA scalable/apps/remmina-panel.svg)
set(ICONSVG_DATA scalable/apps/remmina-panel-inverted.svg)
set(ICONSVG_DATA scalable/apps/org.remmina.Remmina.svg)
set(ICONSVG_DATA scalable/apps/${REMMINA_ICON}.svg)
install(FILES ${ICON16_DATA} DESTINATION ${ICON16_DIR})
install(FILES ${ICON22_DATA} DESTINATION ${ICON22_DIR})
......@@ -84,17 +85,16 @@ install(FILES ${ICON256_DATA} DESTINATION ${ICON256_DIR})
install(FILES ${ICONSVG_DATA} DESTINATION ${ICONSVG_DIR})
set(REMMINA_BINARY_PATH ${CMAKE_INSTALL_FULL_BINDIR}/remmina)
set(REMMINA_ICON "org.remmina.Remmina")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.remmina.Remmina.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/org.remmina.Remmina.desktop @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${REMMINA_APP_ID}.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/${REMMINA_APP_ID}.desktop @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/remmina-file.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/remmina-file.desktop @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.remmina.Remmina.desktop
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${REMMINA_APP_ID}.desktop
DESTINATION "${REMMINA_DATADIR}/applications")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/remmina-file.desktop
DESTINATION "${REMMINA_DATADIR}/applications")
install(FILES org.remmina.Remmina.appdata.xml
install(FILES ${REMMINA_APP_ID}.appdata.xml
DESTINATION "${REMMINA_DATADIR}/metainfo")
# XML mime types
set( SHARED_MIME_INFO_MINIMUM_VERSION "0.30" )
......
......@@ -213,7 +213,7 @@ static void remmina_on_startup(GApplication *app)
remmina_icon_init();
g_set_application_name("Remmina");
gtk_window_set_default_icon_name("org.remmina.Remmina");
gtk_window_set_default_icon_name(REMMINA_APP_ID);
gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
REMMINA_RUNTIME_DATADIR G_DIR_SEPARATOR_S "icons");
......@@ -276,7 +276,7 @@ int main(int argc, char* argv[])
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif /* !HAVE_LIBGCRYPT */
app_id = g_application_id_is_valid(UNIQUE_APPNAME) ? UNIQUE_APPNAME : NULL;
app_id = g_application_id_is_valid(REMMINA_APP_ID) ? REMMINA_APP_ID : NULL;
app = gtk_application_new(app_id, G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect(app, "startup", G_CALLBACK(remmina_on_startup), NULL);
g_signal_connect(app, "command-line", G_CALLBACK(remmina_on_command_line), NULL);
......
......@@ -497,7 +497,7 @@ remmina_file_get_icon_name(RemminaFile *remminafile)
plugin = (RemminaProtocolPlugin*)remmina_plugin_manager_get_plugin(REMMINA_PLUGIN_TYPE_PROTOCOL,
remmina_file_get_string(remminafile, "protocol"));
if (!plugin)
return "remmina";
return REMMINA_APP_ID;
return (remmina_file_get_int(remminafile, "ssh_enabled", FALSE) ? plugin->icon_name_ssh : plugin->icon_name);
}
......
......@@ -345,20 +345,21 @@ static void remmina_icon_create_autostart_file(void)
TRACE_CALL(__func__);
GKeyFile *gkeyfile;
if (!g_file_test(remmina_icon.autostart_file, G_FILE_TEST_EXISTS)) {
gkeyfile = g_key_file_new();
g_key_file_set_string(gkeyfile, "Desktop Entry", "Version", "1.0");
g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment",
_("Connect to remote desktops through the applet menu"));
g_key_file_set_string(gkeyfile, "Desktop Entry", "Icon", "remmina");
g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "remmina -i");
g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Terminal", FALSE);
g_key_file_set_string(gkeyfile, "Desktop Entry", "Type", "Application");
g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", TRUE);
remmina_icon_save_autostart_file(gkeyfile);
g_key_file_free(gkeyfile);
}
if (g_file_test(remmina_icon.autostart_file, G_FILE_TEST_EXISTS))
return;
gkeyfile = g_key_file_new();
g_key_file_set_string(gkeyfile, "Desktop Entry", "Version", "1.0");
g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment",
_("Connect to remote desktops through the applet menu"));
g_key_file_set_string(gkeyfile, "Desktop Entry", "Icon", REMMINA_APP_ID);
g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "remmina -i");
g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Terminal", FALSE);
g_key_file_set_string(gkeyfile, "Desktop Entry", "Type", "Application");
g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", TRUE);
remmina_icon_save_autostart_file(gkeyfile);
g_key_file_free(gkeyfile);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment