[glade] Revert "Mark every survey notification dialog string as translatable"



commit 60e0670b4350bddfc203de7157549ec434f8ba04
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Mon Mar 17 22:40:12 2014 -0300

    Revert "Mark every survey notification dialog string as translatable"
    
    This reverts commit 2d04be13169d95677332f49d43e81ed00bfb4e8d.
    
    Revert "Added message dialog at startup to advertise the user survey."
    
    This reverts commit 5716cbb64b281e2325d21bb4ae53a4ba7a07e906.

 src/glade-registration.c |   65 ----------------------------------------------
 src/glade-window.c       |   61 ++++--------------------------------------
 src/glade-window.h       |    2 -
 src/main.c               |    2 -
 4 files changed, 6 insertions(+), 124 deletions(-)
---
diff --git a/src/glade-registration.c b/src/glade-registration.c
index 96b2f47..8941561 100644
--- a/src/glade-registration.c
+++ b/src/glade-registration.c
@@ -26,8 +26,6 @@
 #include <gladeui/glade.h>
 #include <glib/gi18n.h>
 
-#define CONFIG_GROUP             "User & Survey"
-
 struct _GladeRegistrationPrivate
 {
   GtkWidget    *infobar;
@@ -102,12 +100,6 @@ struct _GladeRegistrationPrivate
 
 G_DEFINE_TYPE_WITH_PRIVATE (GladeRegistration, glade_registration, GTK_TYPE_DIALOG);
 
-enum 
-{
-  PROP_0,
-  PROP_COMPLETED,
-  PROP_SKIP_REMINDER
-};
 
 static void
 string_append_input_key_value_tuple (GString *string,
@@ -409,9 +401,6 @@ on_http_request_done (GladeHTTP         *http,
               glade_util_ui_message (GTK_WIDGET (registration), GLADE_UI_INFO, NULL,
                                      "<big>%s</big>", _("Thank you for taking the time to complete the 
survey, we appreciate it!"));
               gtk_widget_hide (GTK_WIDGET (registration));
-
-              g_object_set (registration, "completed", TRUE, NULL);
-              glade_app_config_save ();
             }
           else if (g_strcmp0 (status, "error_required_field") == 0)
             glade_registration_show_message (registration, GTK_MESSAGE_INFO,
@@ -656,42 +645,6 @@ glade_registration_finalize (GObject *object)
 }
 
 static void
-glade_registration_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
-  GKeyFile *config = glade_app_get_config ();
-  g_return_if_fail (GLADE_IS_REGISTRATION (object));
-
-  switch (prop_id)
-    {
-      case PROP_SKIP_REMINDER:
-      case PROP_COMPLETED:
-        g_key_file_set_boolean (config, CONFIG_GROUP, pspec->name, g_value_get_boolean (value));
-        break;
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-        break;
-    }
-}
-
-static void
-glade_registration_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
-  GKeyFile *config = glade_app_get_config ();
-  g_return_if_fail (GLADE_IS_REGISTRATION (object));
-
-  switch (prop_id)
-    {
-      case PROP_SKIP_REMINDER:
-      case PROP_COMPLETED:
-        g_value_set_boolean (value, g_key_file_get_boolean (config, CONFIG_GROUP, pspec->name, NULL));
-        break;
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-        break;
-    }
-}
-
-static void
 glade_registration_class_init (GladeRegistrationClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -769,24 +722,6 @@ glade_registration_class_init (GladeRegistrationClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, on_viewport_draw);
   
   object_class->finalize = glade_registration_finalize;
-  object_class->set_property = glade_registration_set_property;
-  object_class->get_property = glade_registration_get_property;
-
-  g_object_class_install_property (object_class,
-                                   PROP_COMPLETED,
-                                   g_param_spec_boolean ("completed",
-                                                         "Completed",
-                                                         "Registration was completed successfully",
-                                                         FALSE,
-                                                         G_PARAM_READWRITE));
-
-  g_object_class_install_property (object_class,
-                                   PROP_SKIP_REMINDER,
-                                   g_param_spec_boolean ("skip-reminder",
-                                                         "Skip reminder",
-                                                         "Skip registration reminder dialog",
-                                                         FALSE,
-                                                         G_PARAM_READWRITE));
 }
 
 GtkWidget*
diff --git a/src/glade-window.c b/src/glade-window.c
index 2890495..64b4961 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -115,7 +115,6 @@ struct _GladeWindowPrivate
   GladeEditor  *editor;                 /* The editor */
 
   GtkWidget *statusbar;                 /* A pointer to the status bar. */
-  guint statusbar_context_id;           /* The context id of general messages */
   guint statusbar_menu_context_id;      /* The context id of the menu bar */
   guint statusbar_actions_context_id;   /* The context id of actions messages */
 
@@ -2546,7 +2545,12 @@ static void
 on_registration_action_activate (GtkAction   *action,
                                  GladeWindow *window)
 {
-  gtk_window_present (GTK_WINDOW (window->priv->registration));
+  GladeWindowPrivate *priv = window->priv;
+
+  if (!priv->registration)
+    priv->registration = glade_registration_new ();
+
+  gtk_window_present (GTK_WINDOW (priv->registration));
 }
 
 void
@@ -3172,8 +3176,6 @@ glade_window_init (GladeWindow *window)
   glade_init ();
 
   gtk_widget_init_template (GTK_WIDGET (window));
-
-  priv->registration = glade_registration_new ();
 }
 
 static void
@@ -3218,7 +3220,6 @@ glade_window_constructed (GObject *object)
               _("Properties"), "properties", priv->right_paned, FALSE);
 
   /* status bar */
-  priv->statusbar_context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar), "general");
   priv->statusbar_menu_context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar), "menu");
   priv->statusbar_actions_context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar), 
"actions");
 
@@ -3451,53 +3452,3 @@ glade_window_check_devhelp (GladeWindow *window)
   if (glade_util_have_devhelp ())
     g_signal_connect (glade_app_get (), "doc-search", G_CALLBACK (doc_search_cb), window);
 }
-
-void
-glade_window_registration_notify_user (GladeWindow *window)
-{
-  gboolean skip_reminder, completed;
-  GladeWindowPrivate *priv;
-
-  g_return_if_fail (GLADE_IS_WINDOW (window));
-  priv = window->priv;
-
-  g_object_get (priv->registration,
-                "completed", &completed,
-                "skip-reminder", &skip_reminder,
-                NULL);
-  
-  if (!completed && !skip_reminder)
-    {
-      GtkWidget *dialog, *check;
-
-      dialog = gtk_message_dialog_new (GTK_WINDOW (glade_app_get_window ()),
-                                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                                       GTK_MESSAGE_QUESTION,
-                                       GTK_BUTTONS_YES_NO,
-                                       "%s",
-                                       _("We are conducting a user survey\n would you like to take it 
now?"));
-
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s",
-                                                _("If not, you can always find it in the Help menu."));
-
-      check = gtk_check_button_new_with_label (_("Do not show this dialog again"));
-      gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-                        check, FALSE, FALSE, 4);
-      gtk_widget_set_halign (check, GTK_ALIGN_START);
-      gtk_widget_show (check);
-
-      if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)
-          gtk_window_present (GTK_WINDOW (priv->registration));
-      
-      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
-        {
-          g_object_set (priv->registration, "skip-reminder", TRUE, NULL);
-          glade_app_config_save ();
-        }
-
-      gtk_widget_destroy (dialog);
-    }
-  else if (!completed)
-    glade_util_flash_message (priv->statusbar, priv->statusbar_context_id, "%s",
-                              _("Go to Help -> Registration & User Survey and complete our survey!"));
-}
diff --git a/src/glade-window.h b/src/glade-window.h
index f72323d..d66758b 100644
--- a/src/glade-window.h
+++ b/src/glade-window.h
@@ -59,8 +59,6 @@ gboolean    glade_window_open_project  (GladeWindow *window,
 
 void        glade_window_check_devhelp (GladeWindow *window);
 
-void        glade_window_registration_notify_user (GladeWindow *window);
-
 G_END_DECLS
 
 #endif /* __GLADE_WINDOW_H__ */
diff --git a/src/main.c b/src/main.c
index 3646de0..15b01af 100644
--- a/src/main.c
+++ b/src/main.c
@@ -197,8 +197,6 @@ main (int argc, char *argv[])
   
   if (!opened_project)
     glade_window_new_project (window);
-
-  glade_window_registration_notify_user (window);
   
   gtk_main ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]