[epiphany] Remove UI to define a homepage



commit 0caf7b0f44349cbfd072cb49dbdc609de317a971
Author: Xan Lopez <xan igalia com>
Date:   Sat Dec 3 16:55:49 2011 +0100

    Remove UI to define a homepage
    
    Later we can remove all the internals to implement the feature.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665469

 data/glade/prefs-dialog.ui |  156 ++++++-------------------------------------
 src/prefs-dialog.c         |   75 +++------------------
 2 files changed, 33 insertions(+), 198 deletions(-)
---
diff --git a/data/glade/prefs-dialog.ui b/data/glade/prefs-dialog.ui
index 4334cd2..471ef77 100644
--- a/data/glade/prefs-dialog.ui
+++ b/data/glade/prefs-dialog.ui
@@ -199,139 +199,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
-                <property name="spacing">18</property>
-                <child>
-                  <object class="GtkVBox" id="vbox152">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="label1238">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Home page</property>
-                        <property name="justify">center</property>
-                        <property name="mnemonic_widget">homepage_entry</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkAlignment" id="alignment7">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="left_padding">12</property>
-                        <child>
-                          <object class="GtkVBox" id="vbox154">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkHBox" id="hbox138">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">12</property>
-                                <child>
-                                  <object class="GtkLabel" id="label1243">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="label" translatable="yes">_Address:</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">homepage_entry</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkEntry" id="homepage_entry">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">â</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHButtonBox" id="hbuttonbox12">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">6</property>
-                                <property name="layout_style">end</property>
-                                <child>
-                                  <object class="GtkButton" id="homepage_current_button">
-                                    <property name="label" translatable="yes">Set to Current _Page</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="homepage_blank_button">
-                                    <property name="label" translatable="yes">Set to _Blank Page</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
                 <child>
                   <object class="GtkVBox" id="ui_page_box">
                     <property name="visible">True</property>
@@ -354,7 +221,7 @@
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
+                            <property name="fill">True</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
@@ -1362,6 +1229,27 @@
                                 <property name="height">1</property>
                               </packing>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index d7c80ec..a49e2d5 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -21,25 +21,25 @@
  */
 
 #include "config.h"
-
 #include "prefs-dialog.h"
+
+#include "ephy-debug.h"
 #include "ephy-dialog.h"
-#include "ephy-prefs.h"
-#include "ephy-settings.h"
 #include "ephy-embed-container.h"
-#include "ephy-embed-shell.h"
-#include "ephy-embed-utils.h"
-#include "ephy-favicon-cache.h"
-#include "ephy-session.h"
 #include "ephy-embed-prefs.h"
+#include "ephy-embed-shell.h"
 #include "ephy-embed-single.h"
-#include "ephy-shell.h"
-#include "ephy-gui.h"
-#include "ephy-langs.h"
+#include "ephy-embed-utils.h"
 #include "ephy-encodings.h"
-#include "ephy-debug.h"
+#include "ephy-favicon-cache.h"
 #include "ephy-file-chooser.h"
 #include "ephy-file-helpers.h"
+#include "ephy-gui.h"
+#include "ephy-langs.h"
+#include "ephy-prefs.h"
+#include "ephy-session.h"
+#include "ephy-settings.h"
+#include "ephy-shell.h"
 #include "ephy-tree-model-node.h"
 #include "ephy-tree-model-sort.h"
 #include "pdm-dialog.h"
@@ -911,39 +911,6 @@ clear_cache_button_clicked_cb (GtkWidget *button,
 					  CLEAR_ALL_CACHE);
 }
 
-static void
-homepage_current_button_clicked_cb (GtkWidget *button,
-				    EphyDialog *dialog)
-{
-	EphySession *session;
-	EphyWindow *window;
-	EphyEmbed *embed;
-	EphyWebView *view;
-
-	session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
-	window = ephy_session_get_active_window (session);
-
-	/* can't do anything in this case */
-	if (window == NULL) return;
-
-	embed = ephy_embed_container_get_active_child 
-          (EPHY_EMBED_CONTAINER (window));
-	g_return_if_fail (embed != NULL);
-
-	view = ephy_embed_get_web_view (embed);
-
-	g_settings_set_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL,
-			       ephy_web_view_get_address (view));
-}
-
-static void
-homepage_blank_button_clicked_cb (GtkWidget *button,
-				  EphyDialog *dialog)
-{
-	g_settings_set_string (EPHY_SETTINGS_MAIN,
-			       EPHY_PREFS_HOMEPAGE_URL, "");
-}
-
 static gboolean
 cookies_get_mapping (GValue *value,
 		     GVariant *variant,
@@ -993,9 +960,6 @@ typedef struct
 
 static const PrefsDialogPreference preferences[] =
 {
-	{ "homepage_entry", "text",
-	  EPHY_PREFS_SCHEMA, EPHY_PREFS_HOMEPAGE_URL,
-	  G_SETTINGS_BIND_DEFAULT, NULL, NULL },
 	{ "automatic_downloads_checkbutton", "active",
 	  EPHY_PREFS_SCHEMA, EPHY_PREFS_AUTO_DOWNLOADS,
 	  G_SETTINGS_BIND_DEFAULT, NULL, NULL },
@@ -1097,8 +1061,6 @@ prefs_dialog_init (PrefsDialog *pd)
 
 	ephy_dialog_get_controls (dialog,
 				  "prefs_dialog", &window,
-				  "homepage_current_button", &curr_button,
-				  "homepage_blank_button", &blank_button,
 				  "css_checkbox", &css_checkbox,
 				  "css_edit_button", &css_edit_button,
 				  "clear_cache_button", &clear_cache_button,
@@ -1109,21 +1071,6 @@ prefs_dialog_init (PrefsDialog *pd)
 	g_signal_connect (window, "response",
 			  G_CALLBACK (prefs_dialog_response_cb), dialog);
 
-	g_signal_connect (curr_button, "clicked",
-			  G_CALLBACK (homepage_current_button_clicked_cb),
-			  dialog);
-	g_signal_connect (blank_button, "clicked",
-			  G_CALLBACK (homepage_blank_button_clicked_cb),
-			  dialog);
-
-	/* set homepage button sensitivity */
-	g_settings_bind_writable (EPHY_SETTINGS_MAIN,
-				  EPHY_PREFS_HOMEPAGE_URL,
-				  curr_button, "sensitive", FALSE);
-	g_settings_bind_writable (EPHY_SETTINGS_MAIN,
-				  EPHY_PREFS_HOMEPAGE_URL,
-				  blank_button, "sensitive", FALSE);
-
 	g_signal_connect (css_edit_button, "clicked",
 			  G_CALLBACK (css_edit_button_clicked_cb), dialog);
 



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