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
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2013-05-19 09:33:02 +0000
3+++ midori/midori-browser.c 2013-05-20 18:00:37 +0000
4@@ -934,9 +934,9 @@
5 return FALSE;
6
7 if (is_folder)
8- title = new_bookmark ? _("New folder") : _("Edit folder");
9+ title = new_bookmark ? _("New Folder") : _("Edit Folder");
10 else
11- title = new_bookmark ? _("New bookmark") : _("Edit bookmark");
12+ title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark");
13 #ifdef HAVE_GRANITE
14 if (proxy != NULL)
15 {
16@@ -951,34 +951,22 @@
17 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
18 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);
19 }
20+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
21+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
22 gtk_dialog_add_buttons (GTK_DIALOG (dialog),
23 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
24 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
25
26- content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
27- hbox = gtk_hbox_new (FALSE, 0);
28- gtk_box_pack_start (GTK_BOX (hbox),
29- gtk_image_new_from_stock (STOCK_BOOKMARK_ADD, GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 0);
30- vbox = gtk_vbox_new (FALSE, 0);
31- #ifdef HAVE_GRANITE
32- if (proxy != NULL)
33- {
34- gchar* markup = g_strdup_printf ("<b>%s</b>", title);
35- label = gtk_label_new (markup);
36- g_free (markup);
37- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
38- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
39- }
40- #endif
41- label = gtk_label_new (_("Type a name for this bookmark and choose where to keep it."));
42- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 12);
43- gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 12);
44+ if (!is_folder)
45+ label = gtk_label_new (_("Type a name for this bookmark, and choose where to keep it."));
46+ else
47+ label = gtk_label_new (_("Type a name for this folder, and choose where to keep it."));
48
49- gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
50+ vbox = gtk_vbox_new (FALSE, 6);
51+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 6);
52+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
53 gtk_window_set_icon_name (GTK_WINDOW (dialog),
54 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE);
55- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
56- gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
57
58 if (!bookmark)
59 {
60@@ -998,12 +986,15 @@
61 entry_title = gtk_entry_new ();
62 gtk_entry_set_activates_default (GTK_ENTRY (entry_title), TRUE);
63 value = katze_item_get_name (bookmark);
64- gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
65+ if (!is_folder)
66+ {
67+ gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
68+ }
69 midori_browser_edit_bookmark_title_changed_cb (GTK_ENTRY (entry_title),
70 GTK_DIALOG (dialog));
71 g_signal_connect (entry_title, "changed",
72 G_CALLBACK (midori_browser_edit_bookmark_title_changed_cb), dialog);
73- gtk_container_add (GTK_CONTAINER (content_area), entry_title);
74+ gtk_box_pack_start (GTK_BOX (vbox), entry_title, FALSE, FALSE, 0);
75
76 entry_uri = NULL;
77 if (!is_folder)
78@@ -1016,25 +1007,26 @@
79 #endif
80 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
81 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
82- gtk_container_add (GTK_CONTAINER (content_area), entry_uri);
83+ gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
84 }
85
86 combo_folder = midori_bookmark_folder_button_new (browser->bookmarks,
87 new_bookmark, katze_item_get_meta_integer (bookmark, "id"),
88 katze_item_get_meta_integer (bookmark, "parentid"));
89- gtk_container_add (GTK_CONTAINER (content_area), combo_folder);
90+ gtk_box_pack_start (GTK_BOX (vbox), combo_folder, FALSE, FALSE, 0);
91
92 if (new_bookmark && !is_folder)
93 {
94 label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial"));
95 g_signal_connect (label, "clicked",
96 G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark);
97+ return_status = TRUE;
98 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);
99 }
100
101- hbox = gtk_hbox_new (FALSE, 4);
102- gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
103- check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in the tool_bar"));
104+ hbox = gtk_hbox_new (FALSE, 6);
105+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
106+ check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in Bookmarks _Bar"));
107 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar),
108 katze_item_get_meta_boolean (bookmark, "toolbar"));
109 gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, FALSE, FALSE, 0);

Subscribers

People subscribed via source and target branches

to all changes: