Merge lp:~artem-anufrij/scratch/Bugfix-1386443 into lp:~elementary-apps/scratch/scratch

Proposed by Artem Anufrij
Status: Merged
Approved by: Danielle Foré
Approved revision: 1401
Merged at revision: 1399
Proposed branch: lp:~artem-anufrij/scratch/Bugfix-1386443
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 381 lines (+74/-74)
2 files modified
plugins/pastebin/pastebin_dialog.vala (+57/-57)
src/MainWindow.vala (+17/-17)
To merge this branch: bzr merge lp:~artem-anufrij/scratch/Bugfix-1386443
Reviewer Review Type Date Requested Status
Danielle Foré Needs Fixing
Review via email: mp+240054@code.launchpad.net

Commit message

Gtk.Stock replaced with named icons

Description of the change

Gtk.Stock replaced with named icons

To post a comment you must log in.
1399. By artem-anufrij

clipboard-icon

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

There are still two stock items in the pastebin plugin on lines 360 and 362

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

in plugins/pastebin/pastebin_dialog.vala

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

Gtk.Stock.Quit -> application-exit
Gtk.Stock.Preferences -> preferences-desktop
Gtk.Stock.Fullscreen -> view-fullscreen

review: Needs Fixing
1400. By artem-anufrij

some changes (see merge comments)

1401. By artem-anufrij

some changes (see merge comments)

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

Daniel,

done...

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

please revert changing from spaces to tabs

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/pastebin/pastebin_dialog.vala'
--- plugins/pastebin/pastebin_dialog.vala 2014-06-25 10:20:01 +0000
+++ plugins/pastebin/pastebin_dialog.vala 2014-10-29 21:26:30 +0000
@@ -1,21 +1,21 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2/***2/***
3 BEGIN LICENSE3 BEGIN LICENSE
4 4
5 Copyright (C) 2011-2012 Giulio Collura <random.cpp@gmail.com>5 Copyright (C) 2011-2012 Giulio Collura <random.cpp@gmail.com>
6 This program is free software: you can redistribute it and/or modify it 6 This program is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License version 3, as published 7 under the terms of the GNU Lesser General Public License version 3, as published
8 by the Free Software Foundation.8 by the Free Software Foundation.
9 9
10 This program is distributed in the hope that it will be useful, but 10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranties of 11 WITHOUT ANY WARRANTY; without even the implied warranties of
12 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 12 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13 PURPOSE. See the GNU General Public License for more details.13 PURPOSE. See the GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License along 15 You should have received a copy of the GNU General Public License along
16 with this program. If not, see <http://www.gnu.org/licenses/> 16 with this program. If not, see <http://www.gnu.org/licenses/>
17 17
18 END LICENSE 18 END LICENSE
19***/19***/
2020
21using Gtk;21using Gtk;
@@ -25,7 +25,7 @@
25namespace Scratch.Dialogs {25namespace Scratch.Dialogs {
2626
27 public class PasteBinDialog : Granite.Widgets.LightWindow {27 public class PasteBinDialog : Granite.Widgets.LightWindow {
28 28
29 public string[,] languages = {29 public string[,] languages = {
30 //if default, code, desc, scratch-equivalent30 //if default, code, desc, scratch-equivalent
31 {"n", "4cs", "4CS", ""},31 {"n", "4cs", "4CS", ""},
@@ -228,16 +228,16 @@
228 {"n", "yaml", "YAML", ""},228 {"n", "yaml", "YAML", ""},
229 {"n", "z80", "Z80 Assembler", ""},229 {"n", "z80", "Z80 Assembler", ""},
230 {"n", "zxbasic", "ZXBasic", ""} };230 {"n", "zxbasic", "ZXBasic", ""} };
231 231
232 private Scratch.Services.Document doc;232 private Scratch.Services.Document doc;
233 233
234 private Box content;234 private Box content;
235 private Box padding;235 private Box padding;
236236
237 private Entry name_entry;237 private Entry name_entry;
238 private ComboBoxText expiry_combo;238 private ComboBoxText expiry_combo;
239 private CheckButton private_check;239 private CheckButton private_check;
240 240
241 private ComboBoxText format_combo;241 private ComboBoxText format_combo;
242 private Window format_others_win;242 private Window format_others_win;
243 private TreeView format_others_view;243 private TreeView format_others_view;
@@ -245,15 +245,15 @@
245245
246 private Button send_button;246 private Button send_button;
247247
248 248
249 public PasteBinDialog (Gtk.Window? parent, Scratch.Services.Document doc) {249 public PasteBinDialog (Gtk.Window? parent, Scratch.Services.Document doc) {
250 this.doc = doc; 250 this.doc = doc;
251 251
252 if (parent != null)252 if (parent != null)
253 this.set_transient_for (parent);253 this.set_transient_for (parent);
254 this.title = _("Share via PasteBin");254 this.title = _("Share via PasteBin");
255 this.type_hint = Gdk.WindowTypeHint.DIALOG;255 this.type_hint = Gdk.WindowTypeHint.DIALOG;
256 256
257 create_dialog ();257 create_dialog ();
258258
259 send_button.clicked.connect (send_button_clicked);259 send_button.clicked.connect (send_button_clicked);
@@ -279,26 +279,26 @@
279 format_combo = new ComboBoxText();279 format_combo = new ComboBoxText();
280 var format_button = new Button.with_label (_("Others..."));280 var format_button = new Button.with_label (_("Others..."));
281 format_button.clicked.connect (format_button_clicked);281 format_button.clicked.connect (format_button_clicked);
282 282
283 //populate combo box283 //populate combo box
284 var sel_lang = doc.get_language_id ();284 var sel_lang = doc.get_language_id ();
285 for (var i=0; i < languages.length[0]; i++) {285 for (var i=0; i < languages.length[0]; i++) {
286 286
287 //insert all languages that are in the scratch combo, and also those that are marked with "y"287 //insert all languages that are in the scratch combo, and also those that are marked with "y"
288 if ( (languages[i, 3] != "") || (languages[i, 0] == "y")) format_combo.append (languages[i, 1], languages[i, 2]);288 if ( (languages[i, 3] != "") || (languages[i, 0] == "y")) format_combo.append (languages[i, 1], languages[i, 2]);
289 //if the inserted language is selected in scratch combo, select it as default289 //if the inserted language is selected in scratch combo, select it as default
290 if ( languages[i, 3] == sel_lang ) format_combo.set_active_id(languages[i, 1]);290 if ( languages[i, 3] == sel_lang ) format_combo.set_active_id(languages[i, 1]);
291 }291 }
292 292
293 //if no language is selected, select text as default293 //if no language is selected, select text as default
294 if (format_combo.get_active_id() == null) format_combo.set_active_id("text");294 if (format_combo.get_active_id() == null) format_combo.set_active_id("text");
295 295
296 296
297 var format_box = new Box (Gtk.Orientation.HORIZONTAL, 28);297 var format_box = new Box (Gtk.Orientation.HORIZONTAL, 28);
298 format_box.pack_start (format_label);298 format_box.pack_start (format_label);
299 format_box.pack_start (format_combo);299 format_box.pack_start (format_combo);
300 format_box.pack_start (format_button);300 format_box.pack_start (format_button);
301 301
302302
303 expiry_combo = new ComboBoxText ();303 expiry_combo = new ComboBoxText ();
304 populate_expiry_combo ();304 populate_expiry_combo ();
@@ -329,77 +329,77 @@
329 read_settings ();329 read_settings ();
330330
331 show_all ();331 show_all ();
332 332
333 send_button.grab_focus ();333 send_button.grab_focus ();
334334
335 }335 }
336336
337337
338 private void format_button_clicked() {338 private void format_button_clicked() {
339 339
340 format_others_win = new Window();340 format_others_win = new Window();
341 format_others_win.set_modal(true);341 format_others_win.set_modal(true);
342 format_others_win.set_title(_("Other formats"));342 format_others_win.set_title(_("Other formats"));
343 format_others_win.set_default_size (250, 300);343 format_others_win.set_default_size (250, 300);
344 344
345 format_others_view = new TreeView();345 format_others_view = new TreeView();
346 format_others_view.set_headers_visible(false);346 format_others_view.set_headers_visible(false);
347 format_store = new ListStore (2, typeof (string), typeof (string));347 format_store = new ListStore (2, typeof (string), typeof (string));
348 format_others_view.set_model (format_store);348 format_others_view.set_model (format_store);
349 format_others_view.insert_column_with_attributes (-1, "Language", new CellRendererText (), "text", 0); 349 format_others_view.insert_column_with_attributes (-1, "Language", new CellRendererText (), "text", 0);
350350
351 TreeIter iter;351 TreeIter iter;
352 for (var i=0; i < languages.length[0]; i++) { 352 for (var i=0; i < languages.length[0]; i++) {
353 format_store.append (out iter);353 format_store.append (out iter);
354 format_store.set (iter, 0, languages[i, 2], 1, languages[i, 1]);354 format_store.set (iter, 0, languages[i, 2], 1, languages[i, 1]);
355 }355 }
356356
357 var format_others_scroll = new ScrolledWindow(null, null);357 var format_others_scroll = new ScrolledWindow(null, null);
358 format_others_scroll.add(format_others_view);358 format_others_scroll.add(format_others_view);
359 359
360 var format_others_ok = new Button.from_stock ("gtk-ok");360 var format_others_ok = new Button.from_icon_name ("dialog-ok", IconSize.BUTTON);
361 format_others_ok.clicked.connect (format_others_ok_clicked); 361 format_others_ok.clicked.connect (format_others_ok_clicked);
362 var format_others_cancel = new Button.from_stock ("gtk-cancel");362 var format_others_cancel = new Button.from_icon_name ("dialog-cancel", IconSize.BUTTON);
363 format_others_cancel.clicked.connect (format_others_cancel_clicked);363 format_others_cancel.clicked.connect (format_others_cancel_clicked);
364 var format_others_buttons = new ButtonBox (Orientation.HORIZONTAL);364 var format_others_buttons = new ButtonBox (Orientation.HORIZONTAL);
365 format_others_buttons.set_layout (ButtonBoxStyle.CENTER);365 format_others_buttons.set_layout (ButtonBoxStyle.CENTER);
366 format_others_buttons.pack_start (format_others_cancel);366 format_others_buttons.pack_start (format_others_cancel);
367 format_others_buttons.pack_start (format_others_ok);367 format_others_buttons.pack_start (format_others_ok);
368 368
369 var format_others_box = new Box (Gtk.Orientation.VERTICAL, 10);369 var format_others_box = new Box (Gtk.Orientation.VERTICAL, 10);
370 format_others_box.pack_start (format_others_scroll);370 format_others_box.pack_start (format_others_scroll);
371 format_others_box.pack_start (format_others_buttons); 371 format_others_box.pack_start (format_others_buttons);
372 372
373 format_others_win.add (format_others_box);373 format_others_win.add (format_others_box);
374 format_others_win.show_all();374 format_others_win.show_all();
375 375
376 }376 }
377 377
378 private void format_others_cancel_clicked() {378 private void format_others_cancel_clicked() {
379 format_others_win.destroy();379 format_others_win.destroy();
380 }380 }
381381
382 private void format_others_ok_clicked() {382 private void format_others_ok_clicked() {
383 383
384 var selection = format_others_view.get_selection ();384 var selection = format_others_view.get_selection ();
385 TreeIter iter;385 TreeIter iter;
386 if (selection.get_selected (null, out iter) == true) {386 if (selection.get_selected (null, out iter) == true) {
387 387
388 Value lang_name;388 Value lang_name;
389 Value lang_code; 389 Value lang_code;
390 format_store.get_value(iter, 0, out lang_name);390 format_store.get_value(iter, 0, out lang_name);
391 format_store.get_value(iter, 1, out lang_code);391 format_store.get_value(iter, 1, out lang_code);
392 392
393 format_combo.append ((string) lang_code, (string) lang_name);393 format_combo.append ((string) lang_code, (string) lang_name);
394 format_combo.set_active_id((string) lang_code);394 format_combo.set_active_id((string) lang_code);
395 395
396 }396 }
397 397
398 format_others_win.destroy();398 format_others_win.destroy();
399 399
400 }400 }
401401
402 402
403 private static Alignment wrap_alignment (Widget widget, int top, int right,403 private static Alignment wrap_alignment (Widget widget, int top, int right,
404 int bottom, int left) {404 int bottom, int left) {
405405
@@ -408,7 +408,7 @@
408 alignment.right_padding = right;408 alignment.right_padding = right;
409 alignment.bottom_padding = bottom;409 alignment.bottom_padding = bottom;
410 alignment.left_padding = left;410 alignment.left_padding = left;
411 411
412 alignment.add(widget);412 alignment.add(widget);
413 return alignment;413 return alignment;
414414
@@ -450,17 +450,17 @@
450 spinner.hide ();450 spinner.hide ();
451451
452 var box = new Box (Gtk.Orientation.VERTICAL, 10);452 var box = new Box (Gtk.Orientation.VERTICAL, 10);
453 453
454 if (submit_result == 0) {454 if (submit_result == 0) {
455 455
456 //paste successfully456 //paste successfully
457 var link_button = new LinkButton (link);457 var link_button = new LinkButton (link);
458 box.pack_start (link_button, false, true, 25);458 box.pack_start (link_button, false, true, 25);
459 } else {459 } else {
460 460
461 //paste error461 //paste error
462 var error_desc = new StringBuilder();462 var error_desc = new StringBuilder();
463 463
464 switch(submit_result) {464 switch(submit_result) {
465 case 2:465 case 2:
466 error_desc.append("The text is void!");466 error_desc.append("The text is void!");
@@ -469,11 +469,11 @@
469 case 3:469 case 3:
470 error_desc.append("The text format doesn't exist");470 error_desc.append("The text format doesn't exist");
471 break;471 break;
472 472
473 default:473 default:
474 error_desc.append("An error occured"); 474 error_desc.append("An error occured");
475 break;475 break;
476 476
477 }477 }
478478
479 error_desc.append("\n" + "The text was sent");479 error_desc.append("\n" + "The text was sent");
@@ -518,4 +518,4 @@
518518
519 }519 }
520520
521}521}
522\ No newline at end of file522\ No newline at end of file
523523
=== modified file 'src/MainWindow.vala'
--- src/MainWindow.vala 2014-10-26 08:26:36 +0000
+++ src/MainWindow.vala 2014-10-29 21:26:30 +0000
@@ -713,23 +713,23 @@
713713
714 // Actions array714 // Actions array
715 static const Gtk.ActionEntry[] main_entries = {715 static const Gtk.ActionEntry[] main_entries = {
716 { "Fetch", Gtk.Stock.FIND,716 { "Fetch", "edit-find",
717 /* label, accelerator */ N_("Find…"), "<Control>f",717 /* label, accelerator */ N_("Find…"), "<Control>f",
718 /* tooltip */ N_("Find…"),718 /* tooltip */ N_("Find…"),
719 action_fetch },719 action_fetch },
720 { "ShowGoTo", Gtk.Stock.OK,720 { "ShowGoTo", "dialog-ok",
721 /* label, accelerator */ N_("Go to line…"), "<Control>i",721 /* label, accelerator */ N_("Go to line…"), "<Control>i",
722 /* tooltip */ N_("Go to line…"),722 /* tooltip */ N_("Go to line…"),
723 action_go_to },723 action_go_to },
724 { "Quit", Gtk.Stock.QUIT,724 { "Quit", "application-exit",
725 /* label, accelerator */ N_("Quit"), "<Control>q",725 /* label, accelerator */ N_("Quit"), "<Control>q",
726 /* tooltip */ N_("Quit"),726 /* tooltip */ N_("Quit"),
727 action_quit },727 action_quit },
728 { "CloseTab", Gtk.Stock.CLOSE,728 { "CloseTab", "window-close",
729 /* label, accelerator */ N_("Close"), "<Control>w",729 /* label, accelerator */ N_("Close"), "<Control>w",
730 /* tooltip */ N_("Close"),730 /* tooltip */ N_("Close"),
731 action_close_tab },731 action_close_tab },
732 { "ShowReplace", Gtk.Stock.OK,732 { "ShowReplace", "dialog-ok",
733 /* label, accelerator */ N_("Replace"), "<Control>r",733 /* label, accelerator */ N_("Replace"), "<Control>r",
734 /* tooltip */ N_("Replace"),734 /* tooltip */ N_("Replace"),
735 action_fetch },735 action_fetch },
@@ -737,27 +737,27 @@
737 /* label, accelerator */ N_("Reopen closed document"), "<Control><Shift>t",737 /* label, accelerator */ N_("Reopen closed document"), "<Control><Shift>t",
738 /* tooltip */ N_("Open last closed document in a new tab"),738 /* tooltip */ N_("Open last closed document in a new tab"),
739 action_restore_tab },739 action_restore_tab },
740 { "NewTab", Gtk.Stock.NEW,740 { "NewTab", "add",
741 /* label, accelerator */ N_("Add New Tab"), "<Control>n",741 /* label, accelerator */ N_("Add New Tab"), "<Control>n",
742 /* tooltip */ N_("Add a new tab"),742 /* tooltip */ N_("Add a new tab"),
743 action_new_tab },743 action_new_tab },
744 { "NewView", Gtk.Stock.NEW,744 { "NewView", "add",
745 /* label, accelerator */ N_("Add New View"), "F3",745 /* label, accelerator */ N_("Add New View"), "F3",
746 /* tooltip */ N_("Add a new view"),746 /* tooltip */ N_("Add a new view"),
747 action_new_view },747 action_new_view },
748 { "RemoveView", Gtk.Stock.CLOSE,748 { "RemoveView", "window-close",
749 /* label, accelerator */ N_("Remove Current View"), null,749 /* label, accelerator */ N_("Remove Current View"), null,
750 /* tooltip */ N_("Remove this view"),750 /* tooltip */ N_("Remove this view"),
751 action_remove_view },751 action_remove_view },
752 { "Undo", Gtk.Stock.UNDO,752 { "Undo", "edit-undo",
753 /* label, accelerator */ N_("Undo"), "<Control>z",753 /* label, accelerator */ N_("Undo"), "<Control>z",
754 /* tooltip */ N_("Undo the last action"),754 /* tooltip */ N_("Undo the last action"),
755 action_undo },755 action_undo },
756 { "Redo", Gtk.Stock.REDO,756 { "Redo", "edit-redo",
757 /* label, accelerator */ N_("Redo"), "<Control><shift>z",757 /* label, accelerator */ N_("Redo"), "<Control><shift>z",
758 /* tooltip */ N_("Redo the last undone action"),758 /* tooltip */ N_("Redo the last undone action"),
759 action_redo },759 action_redo },
760 { "Revert", Gtk.Stock.REVERT_TO_SAVED,760 { "Revert", "document-revert",
761 /* label, accelerator */ N_("Revert"), "<Control><shift>o",761 /* label, accelerator */ N_("Revert"), "<Control><shift>o",
762 /* tooltip */ N_("Restore this file"),762 /* tooltip */ N_("Restore this file"),
763 action_revert },763 action_revert },
@@ -765,19 +765,19 @@
765 /* label, accelerator */ N_("Duplicate selected strings"), "<Control>d",765 /* label, accelerator */ N_("Duplicate selected strings"), "<Control>d",
766 /* tooltip */ N_("Duplicate selected strings"),766 /* tooltip */ N_("Duplicate selected strings"),
767 action_duplicate },767 action_duplicate },
768 { "Open", Gtk.Stock.OPEN,768 { "Open", "document-open",
769 /* label, accelerator */ N_("Open"), "<Control>o",769 /* label, accelerator */ N_("Open"), "<Control>o",
770 /* tooltip */ N_("Open a file"),770 /* tooltip */ N_("Open a file"),
771 action_open },771 action_open },
772 { "Clipboard", Gtk.Stock.OPEN,772 { "Clipboard", "edit-paste",
773 /* label, accelerator */ N_("Clipboard"), null,773 /* label, accelerator */ N_("Clipboard"), null,
774 /* tooltip */ N_("New file from Clipboard"),774 /* tooltip */ N_("New file from Clipboard"),
775 action_new_tab_from_clipboard },775 action_new_tab_from_clipboard },
776 { "SaveFile", Gtk.Stock.SAVE,776 { "SaveFile", "document-save",
777 /* label, accelerator */ N_("Save"), "<Control>s",777 /* label, accelerator */ N_("Save"), "<Control>s",
778 /* tooltip */ N_("Save this file"),778 /* tooltip */ N_("Save this file"),
779 action_save },779 action_save },
780 { "SaveFileAs", Gtk.Stock.SAVE_AS,780 { "SaveFileAs", "document-save-as",
781 /* label, accelerator */ N_("Save As…"), "<Control><shift>s",781 /* label, accelerator */ N_("Save As…"), "<Control><shift>s",
782 /* tooltip */ N_("Save this file with a different name"),782 /* tooltip */ N_("Save this file with a different name"),
783 action_save_as },783 action_save_as },
@@ -785,7 +785,7 @@
785 /* label, accelerator */ N_("Templates"), null,785 /* label, accelerator */ N_("Templates"), null,
786 /* tooltip */ N_("Project templates"),786 /* tooltip */ N_("Project templates"),
787 action_templates },787 action_templates },
788 { "Preferences", Gtk.Stock.PREFERENCES,788 { "Preferences", "preferences-desktop",
789 /* label, accelerator */ N_("Preferences"), null,789 /* label, accelerator */ N_("Preferences"), null,
790 /* tooltip */ N_("Change Scratch settings"),790 /* tooltip */ N_("Change Scratch settings"),
791 action_preferences },791 action_preferences },
@@ -810,7 +810,7 @@
810 };810 };
811811
812 static const Gtk.ToggleActionEntry[] toggle_entries = {812 static const Gtk.ToggleActionEntry[] toggle_entries = {
813 { "Fullscreen", Gtk.Stock.FULLSCREEN,813 { "Fullscreen", "view-fullscreen",
814 /* label, accelerator */ N_("Fullscreen"), "F11",814 /* label, accelerator */ N_("Fullscreen"), "F11",
815 /* tooltip */ N_("Fullscreen"),815 /* tooltip */ N_("Fullscreen"),
816 action_fullscreen }816 action_fullscreen }

Subscribers

People subscribed via source and target branches