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

Proposed by Danielle Foré
Status: Superseded
Proposed branch: lp:~danrabbit/midori/fix-1172589
Merge into: lp:midori
Diff against target: 166 lines (+38/-37)
1 file modified
midori/midori-browser.c (+38/-37)
To merge this branch: bzr merge lp:~danrabbit/midori/fix-1172589
Reviewer Review Type Date Requested Status
Danielle Foré (community) Needs Resubmitting
Paweł Forysiuk Needs Fixing
Review via email: mp+164652@code.launchpad.net

This proposal has been superseded by a proposal from 2013-05-20.

Commit message

clean up bookmarks dialog

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 :

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
lp:~danrabbit/midori/fix-1172589 updated
6164. By Danielle Foré

revert code style changes, fix typo

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

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.

Unmerged revisions

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 17:39:27 +0000
4@@ -934,9 +934,10 @@
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+
14 #ifdef HAVE_GRANITE
15 if (proxy != NULL)
16 {
17@@ -946,39 +947,32 @@
18 GRANITE_WIDGETS_POP_OVER (dialog), proxy, TRUE);
19 }
20 else
21- #endif
22+ #endif
23+
24 {
25 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
26 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);
27 }
28+
29+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
30+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
31+
32 gtk_dialog_add_buttons (GTK_DIALOG (dialog),
33- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
34- new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
35+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
36+ new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
37
38- content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
39- hbox = gtk_hbox_new (FALSE, 0);
40- gtk_box_pack_start (GTK_BOX (hbox),
41- gtk_image_new_from_stock (STOCK_BOOKMARK_ADD, GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 0);
42- vbox = gtk_vbox_new (FALSE, 0);
43- #ifdef HAVE_GRANITE
44- if (proxy != NULL)
45- {
46- gchar* markup = g_strdup_printf ("<b>%s</b>", title);
47- label = gtk_label_new (markup);
48- g_free (markup);
49- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
50- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
51+ if (!is_folder) {
52+ label = gtk_label_new (_("Type a name for this bookmark, and choose where to keep it."));
53+ } else {
54+ label = gtk_label_new (_("Type a name for this folder, and choose where to keep it."));
55 }
56- #endif
57- label = gtk_label_new (_("Type a name for this bookmark and choose where to keep it."));
58- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 12);
59- gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 12);
60-
61- gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
62+
63+ vbox = gtk_vbox_new (FALSE, 6);
64+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 6);
65+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
66+
67 gtk_window_set_icon_name (GTK_WINDOW (dialog),
68 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE);
69- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
70- gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
71
72 if (!bookmark)
73 {
74@@ -998,16 +992,18 @@
75 entry_title = gtk_entry_new ();
76 gtk_entry_set_activates_default (GTK_ENTRY (entry_title), TRUE);
77 value = katze_item_get_name (bookmark);
78- gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
79+ if (!is_folder)
80+ {
81+ gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
82+ }
83 midori_browser_edit_bookmark_title_changed_cb (GTK_ENTRY (entry_title),
84 GTK_DIALOG (dialog));
85 g_signal_connect (entry_title, "changed",
86 G_CALLBACK (midori_browser_edit_bookmark_title_changed_cb), dialog);
87- gtk_container_add (GTK_CONTAINER (content_area), entry_title);
88+ gtk_box_pack_start (GTK_BOX (vbox), entry_title, FALSE, FALSE, 0);
89
90 entry_uri = NULL;
91- if (!is_folder)
92- {
93+ if (!is_folder) {
94 entry_uri = katze_uri_entry_new (
95 #if GTK_CHECK_VERSION (2, 20, 0)
96 gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT));
97@@ -1016,25 +1012,26 @@
98 #endif
99 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
100 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
101- gtk_container_add (GTK_CONTAINER (content_area), entry_uri);
102+ gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
103 }
104
105 combo_folder = midori_bookmark_folder_button_new (browser->bookmarks,
106 new_bookmark, katze_item_get_meta_integer (bookmark, "id"),
107 katze_item_get_meta_integer (bookmark, "parentid"));
108- gtk_container_add (GTK_CONTAINER (content_area), combo_folder);
109+ gtk_box_pack_start (GTK_BOX (vbox), combo_folder, FALSE, FALSE, 0);
110
111 if (new_bookmark && !is_folder)
112 {
113 label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial"));
114 g_signal_connect (label, "clicked",
115 G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark);
116+ return_status = TRUE;
117 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);
118 }
119
120- hbox = gtk_hbox_new (FALSE, 4);
121- gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
122- check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in the tool_bar"));
123+ hbox = gtk_hbox_new (FALSE, 6);
124+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
125+ check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in BooKmarks _Bar"));
126 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar),
127 katze_item_get_meta_boolean (bookmark, "toolbar"));
128 gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, FALSE, FALSE, 0);
129@@ -1047,17 +1044,18 @@
130 katze_item_get_meta_boolean (bookmark, "app"));
131 gtk_box_pack_start (GTK_BOX (hbox), check_app, FALSE, FALSE, 0);
132 }
133+
134 gtk_widget_show_all (content_area);
135
136 gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
137- if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
138- {
139+ if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
140 gint64 selected;
141
142 katze_item_set_name (bookmark,
143 gtk_entry_get_text (GTK_ENTRY (entry_title)));
144 katze_item_set_meta_integer (bookmark, "toolbar",
145 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_toolbar)));
146+
147 if (!is_folder)
148 {
149 katze_item_set_uri (bookmark,
150@@ -1073,13 +1071,16 @@
151 katze_array_add_item (browser->bookmarks, bookmark);
152 else
153 midori_bookmarks_update_item_db (db, bookmark);
154+
155 midori_browser_update_history (bookmark, "bookmark", new_bookmark ? "create" : "modify");
156
157 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_toolbar)))
158 if (!gtk_widget_get_visible (browser->bookmarkbar))
159 _action_set_active (browser, "Bookmarkbar", TRUE);
160+
161 return_status = TRUE;
162 }
163+
164 if (gtk_widget_get_visible (browser->bookmarkbar))
165 midori_bookmarkbar_populate (browser);
166 gtk_widget_destroy (dialog);

Subscribers

People subscribed via source and target branches

to all changes: