Merge lp:~danrabbit/midori/fix-1172589 into lp:midori

Proposed by Danielle Foré
Status: Merged
Merged at revision: 6167
Proposed branch: lp:~danrabbit/midori/fix-1172589
Merge into: lp:midori
Diff against target: 109 lines (+22/-30)
1 file modified
midori/midori-browser.c (+22/-30)
To merge this branch: bzr merge lp:~danrabbit/midori/fix-1172589
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Paweł Forysiuk Pending
Review via email: mp+164775@code.launchpad.net

This proposal supersedes a proposal from 2013-05-19.

Description of the change

This branch removes the unecessary icon, adds a "," in the label, organized things into a neatly spaced vbox (instead of packing directly into the dialog), Changes the label for Folders, and generally un-fucks the Add Bookmark dialog.

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) wrote : Posted in a previous version of this proposal

Please clean up this patch before proposing to merge.

You should not change code style (adding brackets, changing where they appear) unless it really helps readability. Your style changes makes this patch way bigger than it needs to be and makes it hard to see real changes. Patches should be as small as possible generally. Also there is a typo in line 157 - "Boomarks".

review: Needs Fixing
Revision history for this message
Danielle Foré (danrabbit) wrote : Posted in a previous version of this proposal

Hey Pawel,

sorry I guess I misunderstood the code style guideline. I thought I was cleaning up a bad code style and aiding readability. At least for me, its not very straightforward to see where conditions end without brackets. Sometimes there are brackets, sometimes there are not. Maybe I'm just not used to C code :p

I've removed the brackets and fixed the typo on diff line 157

review: Needs Resubmitting
lp:~danrabbit/midori/fix-1172589 updated
6165. By Danielle Foré

diff exposed a couple more issues. fixed

6166. By Danielle Foré

make diff as small as possible.

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Looks nice.

Is code ifdefed for granite and label not needed anymore?

Otherwise looks good to me, but let's hear Christian's opinion too.

Revision history for this message
Danielle Foré (danrabbit) wrote :

Yes, I'm not sure why an extra label was being added for Granite but its not needed so I removed it.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice cleanup, and I like shaving off needlessly complex code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'midori/midori-browser.c'
--- midori/midori-browser.c 2013-05-19 09:33:02 +0000
+++ midori/midori-browser.c 2013-05-20 18:00:37 +0000
@@ -934,9 +934,9 @@
934 return FALSE;934 return FALSE;
935935
936 if (is_folder)936 if (is_folder)
937 title = new_bookmark ? _("New folder") : _("Edit folder");937 title = new_bookmark ? _("New Folder") : _("Edit Folder");
938 else938 else
939 title = new_bookmark ? _("New bookmark") : _("Edit bookmark");939 title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark");
940 #ifdef HAVE_GRANITE940 #ifdef HAVE_GRANITE
941 if (proxy != NULL)941 if (proxy != NULL)
942 {942 {
@@ -951,34 +951,22 @@
951 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),951 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
952 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);952 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);
953 }953 }
954 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
955 gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
954 gtk_dialog_add_buttons (GTK_DIALOG (dialog),956 gtk_dialog_add_buttons (GTK_DIALOG (dialog),
955 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,957 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
956 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);958 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
957959
958 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));960 if (!is_folder)
959 hbox = gtk_hbox_new (FALSE, 0);961 label = gtk_label_new (_("Type a name for this bookmark, and choose where to keep it."));
960 gtk_box_pack_start (GTK_BOX (hbox),962 else
961 gtk_image_new_from_stock (STOCK_BOOKMARK_ADD, GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 0);963 label = gtk_label_new (_("Type a name for this folder, and choose where to keep it."));
962 vbox = gtk_vbox_new (FALSE, 0);
963 #ifdef HAVE_GRANITE
964 if (proxy != NULL)
965 {
966 gchar* markup = g_strdup_printf ("<b>%s</b>", title);
967 label = gtk_label_new (markup);
968 g_free (markup);
969 gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
970 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
971 }
972 #endif
973 label = gtk_label_new (_("Type a name for this bookmark and choose where to keep it."));
974 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 12);
975 gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 12);
976964
977 gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);965 vbox = gtk_vbox_new (FALSE, 6);
966 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 6);
967 gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
978 gtk_window_set_icon_name (GTK_WINDOW (dialog),968 gtk_window_set_icon_name (GTK_WINDOW (dialog),
979 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE);969 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE);
980 gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
981 gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
982970
983 if (!bookmark)971 if (!bookmark)
984 {972 {
@@ -998,12 +986,15 @@
998 entry_title = gtk_entry_new ();986 entry_title = gtk_entry_new ();
999 gtk_entry_set_activates_default (GTK_ENTRY (entry_title), TRUE);987 gtk_entry_set_activates_default (GTK_ENTRY (entry_title), TRUE);
1000 value = katze_item_get_name (bookmark);988 value = katze_item_get_name (bookmark);
1001 gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));989 if (!is_folder)
990 {
991 gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
992 }
1002 midori_browser_edit_bookmark_title_changed_cb (GTK_ENTRY (entry_title),993 midori_browser_edit_bookmark_title_changed_cb (GTK_ENTRY (entry_title),
1003 GTK_DIALOG (dialog));994 GTK_DIALOG (dialog));
1004 g_signal_connect (entry_title, "changed",995 g_signal_connect (entry_title, "changed",
1005 G_CALLBACK (midori_browser_edit_bookmark_title_changed_cb), dialog);996 G_CALLBACK (midori_browser_edit_bookmark_title_changed_cb), dialog);
1006 gtk_container_add (GTK_CONTAINER (content_area), entry_title);997 gtk_box_pack_start (GTK_BOX (vbox), entry_title, FALSE, FALSE, 0);
1007998
1008 entry_uri = NULL;999 entry_uri = NULL;
1009 if (!is_folder)1000 if (!is_folder)
@@ -1016,25 +1007,26 @@
1016 #endif1007 #endif
1017 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);1008 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
1018 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));1009 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
1019 gtk_container_add (GTK_CONTAINER (content_area), entry_uri);1010 gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
1020 }1011 }
10211012
1022 combo_folder = midori_bookmark_folder_button_new (browser->bookmarks,1013 combo_folder = midori_bookmark_folder_button_new (browser->bookmarks,
1023 new_bookmark, katze_item_get_meta_integer (bookmark, "id"),1014 new_bookmark, katze_item_get_meta_integer (bookmark, "id"),
1024 katze_item_get_meta_integer (bookmark, "parentid"));1015 katze_item_get_meta_integer (bookmark, "parentid"));
1025 gtk_container_add (GTK_CONTAINER (content_area), combo_folder);1016 gtk_box_pack_start (GTK_BOX (vbox), combo_folder, FALSE, FALSE, 0);
10261017
1027 if (new_bookmark && !is_folder)1018 if (new_bookmark && !is_folder)
1028 {1019 {
1029 label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial"));1020 label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial"));
1030 g_signal_connect (label, "clicked",1021 g_signal_connect (label, "clicked",
1031 G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark);1022 G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark);
1023 return_status = TRUE;
1032 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);1024 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);
1033 }1025 }
10341026
1035 hbox = gtk_hbox_new (FALSE, 4);1027 hbox = gtk_hbox_new (FALSE, 6);
1036 gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);1028 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
1037 check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in the tool_bar"));1029 check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in Bookmarks _Bar"));
1038 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar),1030 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar),
1039 katze_item_get_meta_boolean (bookmark, "toolbar"));1031 katze_item_get_meta_boolean (bookmark, "toolbar"));
1040 gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, FALSE, FALSE, 0);1032 gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, FALSE, FALSE, 0);

Subscribers

People subscribed via source and target branches

to all changes: