From b485be95c12df907ec7cf1ee6d9994b239593ce0 Mon Sep 17 00:00:00 2001 From: torikul habib Date: Tue, 27 Nov 2018 12:50:25 +0700 Subject: [PATCH] Fix lite code --- ...m.github.torikulhabib.mindi.appdata.xml.in | 13 ++++ po/com.github.torikulhabib.mindi.pot | 74 +++++++++++++----- po/id.po | 77 ++++++++++++++----- src/Widgets/MessageDialog.vala | 14 +++- src/Window.vala | 16 ++-- 5 files changed, 138 insertions(+), 56 deletions(-) diff --git a/data/com.github.torikulhabib.mindi.appdata.xml.in b/data/com.github.torikulhabib.mindi.appdata.xml.in index d62327e..a8050bd 100644 --- a/data/com.github.torikulhabib.mindi.appdata.xml.in +++ b/data/com.github.torikulhabib.mindi.appdata.xml.in @@ -22,6 +22,19 @@ com.github.torikulhabib.mindi + + +

Fix and add feature

+
    +
  • Info Location converted.
  • +
  • Fix close warning.
  • +
  • Fix stop warning.
  • +
  • Add silent notify.
  • +
  • Find location converted.
  • +
  • Ask converter location.
  • +
+
+

Fix and add feature

diff --git a/po/com.github.torikulhabib.mindi.pot b/po/com.github.torikulhabib.mindi.pot index b5247b1..3c9fa6b 100644 --- a/po/com.github.torikulhabib.mindi.pot +++ b/po/com.github.torikulhabib.mindi.pot @@ -63,88 +63,120 @@ msgstr "" msgid "Yes" msgstr "" -#: src/Window.vala:51 +#: src/Window.vala:78 msgid "Change" msgstr "" -#: src/Window.vala:54 src/Window.vala:223 src/Window.vala:226 +#: src/Window.vala:85 src/Window.vala:334 src/Window.vala:390 src/Window.vala:392 src/Window.vala:732 msgid "Open" msgstr "" -#: src/Window.vala:87 +#: src/Window.vala:115 msgid "Light background" msgstr "" -#: src/Window.vala:88 +#: src/Window.vala:116 msgid "Dark background" msgstr "" -#: src/Window.vala:189 +#: src/Window.vala:133 src/Window.vala:423 src/Window.vala:424 src/Window.vala:610 +msgid "Location" +msgstr "" + +#: src/Window.vala:150 +msgid "Notify" +msgstr "" + +#: src/Window.vala:157 +msgid "Open custom location" +msgstr "" + +#: src/Window.vala:169 +msgid "Close" +msgstr "" + +#: src/Window.vala:176 +msgid "Find location" +msgstr "" + +#: src/Window.vala:337 +msgid "Folder" +msgstr "" + +#: src/Window.vala:357 msgid "Video" msgstr "" -#: src/Window.vala:205 +#: src/Window.vala:373 msgid "Select Video" msgstr "" -#: src/Window.vala:220 +#: src/Window.vala:384 msgid "Choose a video file…" msgstr "" -#: src/Window.vala:228 src/Window.vala:345 +#: src/Window.vala:521 src/Window.vala:345 msgid "Cancel" msgstr "" -#: src/Window.vala:232 +#: src/Window.vala:395 msgid "All files" msgstr "" -#: src/Window.vala:235 +#: src/Window.vala:398 msgid "Video files" msgstr "" -#: src/Window.vala:241 +#: src/Window.vala:404 msgid "Audio files" msgstr "" -#: src/Window.vala:264 +#: src/Window.vala:442 msgid "Audio" msgstr "" -#: src/Window.vala:281 +#: src/Window.vala:459 msgid "Select" msgstr "" -#: src/Window.vala:328 +#: src/Window.vala:503 msgid "Convert" msgstr "" -#: src/Window.vala:372 +#: src/Window.vala:580 src/Window.vala:588 +msgid "Audio folder location" +msgstr "" + +#: src/Window.vala:596 src/Window.vala:636 +msgid "Where you save the audio file" +msgstr "" + +#: src/Window.vala:602 msgid "No Video file choosen…" msgstr "" -#: src/Window.vala:374 +#: src/Window.vala:604 msgid "Ready!" msgstr "" -#: src/Window.vala:424 +#: src/Window.vala:657 #, c-format msgid "%s was convert into %s" msgstr "" -#: src/Window.vala:426 +#: src/Window.vala:659 #, c-format msgid "Error while = convert %s into %s" msgstr "" -#: src/Window.vala:438 src/Window.vala:130 src/Window.vala:449 +#: src/Window.vala:234 src/Window.vala:667 src/Window.vala:695 src/Window.vala:681 msgid "Finished" msgstr "" -#: src/Window.vala:440 src/Window.vala:466 +#: src/Window.vala:683 src/Window.vala:712 msgid "Error" msgstr "" -#: src/Window.vala:451 src/Window.vala:468 +#: src/Window.vala:697 src/Window.vala:714 msgid "Automatic Close" msgstr "" diff --git a/po/id.po b/po/id.po index b4de2e0..51a2857 100644 --- a/po/id.po +++ b/po/id.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: com.github.torikulhabib.mindi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-06 23:58-0600\n" -"PO-Revision-Date: 2018-11-20 18:55+0700\n" +"PO-Revision-Date: 2018-11-27 12:19+0700\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -64,59 +64,85 @@ msgstr "Tidak" msgid "Yes" msgstr "Ya" -#: src/Window.vala:51 +#: src/Window.vala:78 msgid "Change" msgstr "Ubah" -#: src/Window.vala:54 src/Window.vala:223 src/Window.vala:226 +#: src/Window.vala:85 src/Window.vala:334 src/Window.vala:390 +#: src/Window.vala:392 src/Window.vala:732 msgid "Open" msgstr "Buka" -#: src/Window.vala:87 +#: src/Window.vala:115 msgid "Light background" msgstr "Latar belakag terang" -#: src/Window.vala:88 +#: src/Window.vala:116 msgid "Dark background" msgstr "Latar belakang hitam" -#: src/Window.vala:189 +#: src/Window.vala:133 src/Window.vala:423 src/Window.vala:424 +#: src/Window.vala:610 +msgid "Location" +msgstr "Lokasi" + +#: src/Window.vala:150 +msgid "Notify" +msgstr "Pemberitahuan" + +#: src/Window.vala:157 +msgid "Open custom location" +msgstr "" + +#: src/Window.vala:169 +msgid "Close" +msgstr "Tutup" + +#: src/Window.vala:176 +msgid "Find location" +msgstr "Temukan lokasi" + +#: src/Window.vala:337 +msgid "Folder" +msgstr "Map" + +#: src/Window.vala:357 msgid "Video" msgstr "Video" -#: src/Window.vala:205 +#: src/Window.vala:373 msgid "Select Video" msgstr "Pilih Video" -#: src/Window.vala:220 +#: src/Window.vala:384 msgid "Choose a video file…" msgstr "Pilih sebuah video…" -#: src/Window.vala:228 src/Window.vala:345 +#: src/Window.vala:521 src/Window.vala:345 msgid "Cancel" msgstr "Batal" -#: src/Window.vala:232 +#: src/Window.vala:395 msgid "All files" msgstr "Semua berkas" -#: src/Window.vala:235 +#: src/Window.vala:398 msgid "Video files" msgstr "Berkas video" -#: src/Window.vala:241 +#: src/Window.vala:404 msgid "Audio files" msgstr "Berkas Suara" -#: src/Window.vala:264 +#: src/Window.vala:442 msgid "Audio" msgstr "Suara" -#: src/Window.vala:281 +#: src/Window.vala:459 msgid "Select" msgstr "Pilih" -#: src/Window.vala:328 +#: src/Window.vala:503 msgid "Convert" msgstr "Konversi" @@ -124,28 +150,37 @@ msgstr "Konversi" msgid "No Video file choosen…" msgstr "Tidak ada berkas terpilih…" -#: src/Window.vala:374 +#: src/Window.vala:580 src/Window.vala:588 +msgid "Audio folder location" +msgstr "Temukan lokasi map" + +#: src/Window.vala:596 src/Window.vala:636 +msgid "Where you save the audio file" +msgstr "Diamana kamu menyimpan berkas" + +#: src/Window.vala:604 msgid "Ready!" msgstr "Siap!" -#: src/Window.vala:424 +#: src/Window.vala:657 #, c-format msgid "%s was convert into %s" msgstr "%s sudah terkonversi %s" -#: src/Window.vala:426 +#: src/Window.vala:659 #, c-format msgid "Error while = convert %s into %s" msgstr "Bermasalah selama = mengubah %s menjadi %s" -#: src/Window.vala:438 src/Window.vala:130 src/Window.vala:449 +#: src/Window.vala:234 src/Window.vala:667 src/Window.vala:695 +#: src/Window.vala:681 msgid "Finished" msgstr "Selesai" -#: src/Window.vala:440 src/Window.vala:466 +#: src/Window.vala:683 src/Window.vala:712 msgid "Error" msgstr "Masalah" -#: src/Window.vala:451 src/Window.vala:468 +#: src/Window.vala:697 src/Window.vala:714 msgid "Automatic Close" msgstr "Otomatis tutup" diff --git a/src/Widgets/MessageDialog.vala b/src/Widgets/MessageDialog.vala index a8fa873..13e2b2c 100644 --- a/src/Widgets/MessageDialog.vala +++ b/src/Widgets/MessageDialog.vala @@ -59,21 +59,27 @@ public class Mindi.MessageDialog : Gtk.Dialog { private class SingleWidgetBin : Gtk.Bin {} - public MessageDialog (string primary_text, string secondary_text, GLib.Icon image_icon, Gtk.ButtonsType buttons = Gtk.ButtonsType.CLOSE) { + public MessageDialog (Gtk.Window? parent, string primary_text, string secondary_text, GLib.Icon image_icon, Gtk.ButtonsType buttons = Gtk.ButtonsType.CLOSE) { Object ( primary_text: primary_text, secondary_text: secondary_text, image_icon: image_icon, - buttons: buttons + buttons: buttons, + transient_for: parent, + destroy_with_parent: true, + window_position: Gtk.WindowPosition.CENTER_ON_PARENT ); } - public MessageDialog.with_image_from_icon_name (string primary_text, string secondary_text, string image_icon_name = "dialog-information", Gtk.ButtonsType buttons = Gtk.ButtonsType.CLOSE) { + public MessageDialog.with_image_from_icon_name (Gtk.Window? parent, string primary_text, string secondary_text, string image_icon_name = "dialog-information", Gtk.ButtonsType buttons = Gtk.ButtonsType.CLOSE) { Object ( primary_text: primary_text, secondary_text: secondary_text, image_icon: new ThemedIcon (image_icon_name), - buttons: buttons + buttons: buttons, + transient_for: parent, + destroy_with_parent: true, + window_position: Gtk.WindowPosition.CENTER_ON_PARENT ); } diff --git a/src/Window.vala b/src/Window.vala index 6a836a4..c128384 100755 --- a/src/Window.vala +++ b/src/Window.vala @@ -18,7 +18,6 @@ namespace Mindi { private Label format_name; private Grid format_container; - private Image convert_logo; private Grid convert_container; private Label convert_label; private Button convert_start; @@ -155,7 +154,7 @@ namespace Mindi { }); open_button = new Button.from_icon_name ("folder-open-symbolic", IconSize.SMALL_TOOLBAR); - open_button.tooltip_text = _("Open custom folder"); + open_button.tooltip_text = _("Open custom location"); open_button.can_focus = false; open_button.clicked.connect (() => { select_audio_place (); @@ -174,7 +173,7 @@ namespace Mindi { find_button = new Button.from_icon_name ("folder-saved-search-symbolic", IconSize.SMALL_TOOLBAR); find_button.vexpand = true; - find_button.tooltip_text = _("Find Folder"); + find_button.tooltip_text = _("Find location"); find_button.clicked.connect (() => { if (folder_set == false) { link_set = MindiApp.settings.get_string ("output-folder"); @@ -413,10 +412,10 @@ namespace Mindi { if (file.run () == Gtk.ResponseType.ACCEPT) { selected_video = file.get_file (); + input_find_folder (); } file.destroy (); - input_find_folder (); } private void status_location () { @@ -501,7 +500,6 @@ namespace Mindi { progressbar_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE; progressbar_revealer.valign = Gtk.Align.CENTER; convert_container.attach (progressbar_revealer, 0, 0, 2, 1); - progressbar_revealer.remove (converter); convert_start = new Gtk.Button.with_label (_ ("Convert")); convert_start.vexpand = true; convert_start.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); @@ -615,10 +613,9 @@ namespace Mindi { video_name.sensitive = false; video_logo.sensitive = false; select_format.sensitive = false; - format_name.sensitive = false; format_logo.sensitive = false; + format_name.sensitive = false; convert_start.sensitive = false; - convert_logo.sensitive = false; convert_revealer.visible = false; convert_revealer.set_reveal_child (false); @@ -653,7 +650,6 @@ namespace Mindi { select_format.sensitive = true; format_logo.sensitive = true; format_name.sensitive = true; - convert_logo.sensitive = true; convert_start.sensitive = true; string message; @@ -696,7 +692,7 @@ namespace Mindi { } private void create_dialog_finish (string text) { - var message_dialog = new Mindi.MessageDialog.with_image_from_icon_name ("Finished",text,"com.github.torikulhabib.mindi", + var message_dialog = new Mindi.MessageDialog.with_image_from_icon_name (this, "Finished",text,"com.github.torikulhabib.mindi", Gtk.ButtonsType.CLOSE); var auto_close = new Gtk.CheckButton.with_label ("Automatic Close"); auto_close.show (); @@ -713,7 +709,7 @@ namespace Mindi { } private void create_dialog_error (string text) { - var message_dialog = new Mindi.MessageDialog.with_image_from_icon_name ("Error",text,"com.github.torikulhabib.mindi", + var message_dialog = new Mindi.MessageDialog.with_image_from_icon_name (this, "Error",text,"com.github.torikulhabib.mindi", Gtk.ButtonsType.CLOSE); var auto_close = new Gtk.CheckButton.with_label ("Automatic Close"); auto_close.show ();