Commit 2aad1e48 authored by Antenore Gatta's avatar Antenore Gatta

Remmina survey webkit implmentation

parent 90a82cc7
......@@ -107,6 +107,7 @@ set(REMMINA_LOCALEDIR "${CMAKE_INSTALL_FULL_DATADIR}/locale")
set(REMMINA_PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/remmina/plugins")
set(REMMINA_UIDIR "${CMAKE_INSTALL_FULL_DATADIR}/remmina/ui")
# Uninstall support
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
......@@ -120,6 +121,11 @@ find_required_package(PTHREAD)
find_suggested_package(GCRYPT)
find_suggested_package(AVAHI)
IF (NOT DEFINED REMMINA_SURVEY_URI)
SET(REMMINA_SURVEY_URI "http://www.remmina.org/")
ENDIF()
ADD_DEFINITIONS(-DREMMINA_SURVEY_URI=${REMMINA_SURVEY_URI})
if(WITH_TRACE_CALLS)
message(STATUS "Enabling trace calls.")
add_definitions(-DWITH_TRACE_CALLS)
......
......@@ -23,4 +23,6 @@
#define REMMINA_PLUGINDIR "${REMMINA_PLUGINDIR}"
#define REMMINA_UIDIR "${REMMINA_UIDIR}"
#define REMMINA_SURVEY_URI "${REMMINA_SURVEY_URI}"
#endif
......@@ -114,6 +114,10 @@ add_executable(remmina ${REMMINA_SRCS})
include_directories(${GTK_INCLUDE_DIRS})
target_link_libraries(remmina ${GTK_LIBRARIES})
pkg_check_modules(WEBKIT REQUIRED webkitgtk-3.0)
target_link_libraries(remmina ${WEBKIT_LIBRARIES})
include_directories(${WEBKIT_INCLUDE_DIRS})
find_package(X11)
include_directories(${X11_INCLUDE_DIR})
target_link_libraries(remmina ${X11_LIBRARIES})
......
......@@ -35,11 +35,19 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <webkit/webkit.h>
#include <stdlib.h>
#include <ctype.h>
#include "config.h"
#include "remmina_survey.h"
#include "remmina_pref.h"
#include "remmina_public.h"
#include "remmina/remmina_trace_calls.h"
static gchar* survey_uri = REMMINA_SURVEY_URI;
static WebKitWebView* web_view;
/* Show the preliminary survey dialog when remmina start */
void remmina_survey_on_startup(GtkWindow *parent)
{
......@@ -87,7 +95,11 @@ void remmina_survey_start(GtkWindow *parent)
{
TRACE_CALL("remmina_survey_start");
GtkBuilder *builder = remmina_public_gtk_builder_new_from_file("remmina_survey.glade");
GtkDialog *dialog = GTK_DIALOG (gtk_builder_get_object(builder, "dialog_remmina_survey"));
GtkDialog *dialog
= GTK_DIALOG (gtk_builder_get_object(builder, "dialog_remmina_survey"));
GtkScrolledWindow *scrolledwindow
= GTK_SCROLLED_WINDOW (gtk_builder_get_object(builder, "scrolledwindow"));
web_view = WEBKIT_WEB_VIEW(webkit_web_view_new());
if (parent)
{
......@@ -98,5 +110,8 @@ void remmina_survey_start(GtkWindow *parent)
g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_window_present(GTK_WINDOW(dialog));
gtk_container_add(GTK_CONTAINER(scrolledwindow), GTK_WIDGET(web_view));
gtk_widget_show(GTK_WIDGET(web_view));
webkit_web_view_load_uri(web_view, survey_uri);
g_object_unref(G_OBJECT(builder));
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0
<!-- Generated with glade 3.18.3
-
Copyright (C) Copyright (C) 2014-2015 Antenore Gatta
......@@ -83,22 +83,31 @@ Author: Antenore Gatta
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
<object class="GtkLabel" id="surveylabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Remmina User Survey</property>
<property name="justify">center</property>
<property name="single_line_mode">True</property>
<attributes>
<attribute name="font-desc" value="DejaVu Sans Bold 16"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="min_content_width">640</property>
<property name="min_content_height">480</property>
<child>
<object class="GtkViewport" id="viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<placeholder/>
</child>
</object>
<packing>
......
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