diff --git a/data/devede.desktop b/data/devede_ng.desktop similarity index 100% rename from data/devede.desktop rename to data/devede_ng.desktop diff --git a/data/interface/wmain.ui b/data/interface/wmain.ui new file mode 100644 index 0000000..17a66bd --- /dev/null +++ b/data/interface/wmain.ui @@ -0,0 +1,849 @@ + + + + + + + + + + + + 8.5 GB DVD + + + 4.7 GB DVD + + + 1.4 GB DVD + + + 700 MB CD + + + 659 MB CD + + + 185 MB CD + + + + + + 750 + 440 + False + center + + + True + False + vertical + + + True + False + + + True + False + _Archivo + True + + + True + False + + + gtk-new + True + False + True + True + + + + + gtk-open + True + False + True + True + + + + + gtk-save + True + False + True + True + + + + + gtk-save-as + True + False + True + True + + + + + True + False + + + + + gtk-quit + True + False + True + True + + + + + + + + + True + False + _Editar + True + + + True + False + + + gtk-cut + True + False + True + True + + + + + gtk-copy + True + False + True + True + + + + + gtk-paste + True + False + True + True + + + + + gtk-delete + True + False + True + True + + + + + + + + + True + False + _Ver + True + + + + + True + False + Ay_uda + True + + + True + False + + + gtk-about + True + False + True + True + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + True + in + + + True + True + liststore2 + True + horizontal + + + + + + + + True + True + 0 + + + + + True + False + + + gtk-add + True + True + True + True + top + True + + + False + True + 0 + + + + + gtk-remove + True + True + True + True + top + True + + + False + True + 1 + + + + + gtk-go-down + True + True + True + True + top + True + + + False + True + 2 + + + + + gtk-go-up + True + True + True + True + top + True + + + False + True + 3 + + + + + gtk-properties + True + True + True + True + top + True + + + False + True + 4 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Titles</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + True + in + + + True + True + + + + + + + + True + True + 0 + + + + + True + False + + + gtk-add + True + True + True + True + top + True + + + False + True + 0 + + + + + gtk-remove + True + True + True + True + top + True + + + False + True + 1 + + + + + gtk-go-down + True + True + True + True + top + True + + + False + True + 2 + + + + + gtk-go-up + True + True + True + True + top + True + + + False + True + 3 + + + + + gtk-properties + True + True + True + True + top + True + + + False + True + 4 + + + + + Preview + True + True + True + 0.4699999988079071 + top + + + False + True + 5 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Files</b> + True + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + False + 0 + Media size: + middle + + + False + True + 0 + + + + + True + False + + + True + False + liststore1 + 1 + 0 + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + Adjust disc usage + True + True + True + + + False + True + 2 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Disc usage</b> + True + + + + + False + True + 2 + + + + + True + False + True + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + PAL + True + True + False + 0 + True + True + radiobutton2 + + + False + True + 4 + 0 + + + + + NTSC + True + True + False + 0 + True + True + + + False + True + 4 + 1 + + + + + + + + + True + False + <b>Default format</b> + True + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + Create a menu with the titles + True + True + False + 0 + True + + + 0 + 0 + 2 + 1 + + + + + Menu options + True + True + True + + + 0 + 1 + 1 + 1 + + + + + Preview menu + True + True + True + + + 1 + 1 + 1 + 1 + + + + + + + + + True + False + <b>Menus</b> + True + + + + + False + True + 1 + + + + + False + True + 3 + + + + + True + False + + + False + True + 7 + 4 + + + + + True + False + end + + + gtk-help + True + True + True + True + + + False + True + 0 + True + + + + + gtk-quit + True + True + True + True + + + False + True + 1 + + + + + gtk-go-forward + True + True + True + True + + + False + True + 2 + + + + + False + True + 5 + + + + + + diff --git a/data/interface/wmain.ui~ b/data/interface/wmain.ui~ new file mode 100644 index 0000000..c156b3f --- /dev/null +++ b/data/interface/wmain.ui~ @@ -0,0 +1,849 @@ + + + + + + + + + + + + 8.5 GB DVD + + + 4.7 GB DVD + + + 1.4 GB DVD + + + 700 MB CD + + + 659 MB CD + + + 185 MB CD + + + + + + 750 + 440 + False + center + + + True + False + vertical + + + True + False + + + True + False + _Archivo + True + + + True + False + + + gtk-new + True + False + True + True + + + + + gtk-open + True + False + True + True + + + + + gtk-save + True + False + True + True + + + + + gtk-save-as + True + False + True + True + + + + + True + False + + + + + gtk-quit + True + False + True + True + + + + + + + + + True + False + _Editar + True + + + True + False + + + gtk-cut + True + False + True + True + + + + + gtk-copy + True + False + True + True + + + + + gtk-paste + True + False + True + True + + + + + gtk-delete + True + False + True + True + + + + + + + + + True + False + _Ver + True + + + + + True + False + Ay_uda + True + + + True + False + + + gtk-about + True + False + True + True + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + True + in + + + True + True + liststore2 + True + horizontal + + + + + + + + True + True + 0 + + + + + True + False + + + gtk-add + True + True + True + True + top + True + + + False + True + 0 + + + + + gtk-remove + True + True + True + True + top + True + + + False + True + 1 + + + + + gtk-go-down + True + True + True + True + top + True + + + False + True + 2 + + + + + gtk-go-up + True + True + True + True + top + True + + + False + True + 3 + + + + + gtk-properties + True + True + True + True + top + True + + + False + True + 4 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Titles</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + True + in + + + True + True + + + + + + + + True + True + 0 + + + + + True + False + + + gtk-add + True + True + True + True + top + True + + + False + True + 0 + + + + + gtk-remove + True + True + True + True + top + True + + + False + True + 1 + + + + + gtk-go-down + True + True + True + True + top + True + + + False + True + 2 + + + + + gtk-go-up + True + True + True + True + top + True + + + False + True + 3 + + + + + gtk-properties + True + True + True + True + top + True + + + False + True + 4 + + + + + Preview + True + True + True + 0.4699999988079071 + top + + + False + True + 5 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Files</b> + True + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + False + 0 + Media size: + middle + + + False + True + 0 + + + + + True + False + + + True + False + liststore1 + 1 + 0 + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + Adjust disc usage + True + True + True + + + False + True + 2 + + + + + False + True + 1 + + + + + + + + + True + False + <b>Disc usage</b> + True + + + + + False + True + 2 + + + + + True + False + True + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + PAL + True + True + False + 0 + True + True + radiobutton2 + + + False + True + 4 + 0 + + + + + NTSC + True + True + False + 0 + True + True + + + False + True + 4 + 1 + + + + + + + + + True + False + <b>Default format</b> + True + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + Create a menu with the titles + True + True + False + 0 + True + + + 0 + 0 + 2 + 1 + + + + + Menu options + True + True + True + + + 0 + 1 + 1 + 1 + + + + + Preview menu + True + True + True + + + 1 + 1 + 1 + 1 + + + + + + + + + True + False + <b>Menus</b> + True + + + + + False + True + 1 + + + + + False + True + 3 + + + + + True + False + + + False + True + 7 + 4 + + + + + True + False + end + + + gtk-help + True + True + True + True + + + False + True + 0 + True + + + + + gtk-quit + True + True + True + True + + + False + True + 1 + + + + + gtk-go-forward + True + True + True + True + + + False + True + 2 + + + + + False + True + 5 + + + + + + diff --git a/data/interface/wselect_disk.ui b/data/interface/wselect_disk.ui new file mode 100644 index 0000000..dde2f06 --- /dev/null +++ b/data/interface/wselect_disk.ui @@ -0,0 +1,266 @@ + + + + + + False + center + + + + True + False + vertical + + + True + False + <b>Choose the disc type you want to create with DeVeDe</b> + True + + + True + True + 15 + 0 + + + + + True + True + True + + + + True + False + + + True + False + icon_dvd.png + + + False + True + 0 + + + + + True + False + 0 + <b>Video DVD</b> +Creates a video DVD suitable for all DVD home players + True + + + True + True + 4 + 1 + + + + + + + True + True + 1 + + + + + True + True + True + + + + True + False + + + True + False + icon_vcd.png + + + False + True + 0 + + + + + True + False + 0 + <b>VideoCD</b> +Creates a VideoCD, with a picture quality equivalent to VHS + True + + + True + True + 4 + 1 + + + + + + + True + True + 2 + + + + + True + True + True + + + + True + False + + + True + False + icon_svcd.png + + + False + True + 0 + + + + + True + False + 0 + <b>Super VideoCD</b> +Creates a VideoCD with better picture quality + True + + + True + True + 4 + 1 + + + + + + + True + True + 3 + + + + + True + True + True + + + + True + False + + + True + False + icon_cvd.png + + + False + True + 0 + + + + + True + False + 0 + <b>China VideoDisc</b> +Another kind of Super VideoCD + True + + + True + True + 4 + 1 + + + + + + + True + True + 4 + + + + + True + True + True + + + + True + False + + + True + False + icon_divx.png + + + False + True + 0 + + + + + True + False + 0 + <b>DivX / MPEG-4</b> +Creates files compliant with DivX home players + True + + + True + True + 4 + 1 + + + + + + + True + True + 5 + + + + + + diff --git a/data/interface/wselect_disk.ui~ b/data/interface/wselect_disk.ui~ new file mode 100644 index 0000000..e14011b --- /dev/null +++ b/data/interface/wselect_disk.ui~ @@ -0,0 +1,265 @@ + + + + + + False + + + + True + False + vertical + + + True + False + <b>Choose the disc type you want to create with DeVeDe</b> + True + + + True + True + 15 + 0 + + + + + True + True + True + + + + True + False + + + True + False + icon_dvd.png + + + False + True + 0 + + + + + True + False + 0 + <b>Video DVD</b> +Creates a video DVD suitable for all DVD home players + True + + + True + True + 4 + 1 + + + + + + + True + True + 1 + + + + + True + True + True + + + + True + False + + + True + False + icon_vcd.png + + + False + True + 0 + + + + + True + False + 0 + <b>VideoCD</b> +Creates a VideoCD, with a picture quality equivalent to VHS + True + + + True + True + 4 + 1 + + + + + + + True + True + 2 + + + + + True + True + True + + + + True + False + + + True + False + icon_svcd.png + + + False + True + 0 + + + + + True + False + 0 + <b>Super VideoCD</b> +Creates a VideoCD with better picture quality + True + + + True + True + 4 + 1 + + + + + + + True + True + 3 + + + + + True + True + True + + + + True + False + + + True + False + icon_cvd.png + + + False + True + 0 + + + + + True + False + 0 + <b>China VideoDisc</b> +Another kind of Super VideoCD + True + + + True + True + 4 + 1 + + + + + + + True + True + 4 + + + + + True + True + True + + + + True + False + + + True + False + icon_divx.png + + + False + True + 0 + + + + + True + False + 0 + <b>DivX / MPEG-4</b> +Creates files compliant with DivX home players + True + + + True + True + 4 + 1 + + + + + + + True + True + 5 + + + + + + diff --git a/po/ca.po b/po/ca.po index 4d45d8a..e82e29d 100644 --- a/po/ca.po +++ b/po/ca.po @@ -1053,8 +1053,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Mida del medi: " +msgid " Media size:" +msgstr " Mida del medi:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index e22a384..c117ac8 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -1045,8 +1045,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Velikost média: " +msgid " Media size:" +msgstr " Velikost média:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/da.po b/po/da.po index b7854c2..9cf66dc 100644 --- a/po/da.po +++ b/po/da.po @@ -1042,8 +1042,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr "Medie størrelse: " +msgid " Media size:" +msgstr "Medie størrelse:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/de_DE.po b/po/de_DE.po index a57249b..69bce58 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -1058,8 +1058,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Kapazität der Disk: " +msgid " Media size:" +msgstr " Kapazität der Disk:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/el.po b/po/el.po index f1ead0b..cae77dc 100644 --- a/po/el.po +++ b/po/el.po @@ -1058,8 +1058,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Μέγεθος μέσου: " +msgid " Media size:" +msgstr " Μέγεθος μέσου:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/es.po b/po/es.po index 9e0a6d6..cc8bf3c 100644 --- a/po/es.po +++ b/po/es.po @@ -1069,8 +1069,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr "Tamaño del disco: " +msgid " Media size:" +msgstr "Tamaño del disco:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/fr.po b/po/fr.po index 2f1c590..47ff27d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1055,8 +1055,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Taille du disque :" +msgid " Media size:" +msgstr " Taille du disque:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/po/gl.po b/po/gl.po index 8c856ff..8d16f03 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1066,8 +1066,8 @@ msgid "0.0%" msgstr "0.0%" #: ../interface/wmain.ui.h:28 -msgid " Media size: " -msgstr " Tamaño do disco: " +msgid " Media size:" +msgstr " Tamaño do disco:" #: ../interface/wmain.ui.h:29 msgid "Disc usage" diff --git a/setup.py b/setup.py index ce1a0f8..2d67292 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def get_mopath(pofile): # Function to determine right locale path for a .po file lang = os.path.basename(pofile)[:-3] # len('.po') == 3 modir = os.path.join('locale', lang, 'LC_MESSAGES') # e.g. locale/fr/LC_MESSAGES/ - mofile = os.path.join(modir, 'devede.mo') # e.g. locale/fr/LC_MESSAGES/devede.mo + mofile = os.path.join(modir, 'devede_ng.mo') # e.g. locale/fr/LC_MESSAGES/devede_ng.mo return modir, mofile def get_data_files(): @@ -27,7 +27,8 @@ def get_data_files(): for pofile in [f for f in os.listdir('po') if f.endswith('.po')]: pofile = os.path.join('po', pofile) # po/fr.po modir, mofile = get_mopath(pofile) - target = os.path.join('share', modir) # share/locale/fr/LC_MESSAGES/ + # translations must be always in /usr/share because Gtk.builder only search there + target = os.path.join('/usr','share', modir) # share/locale/fr/LC_MESSAGES/ data_files.append((target, [mofile])) return data_files diff --git a/src/devede/convert.py b/src/devede/convert.py index 9d314b6..5ce867c 100644 --- a/src/devede/convert.py +++ b/src/devede/convert.py @@ -13,7 +13,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see def test(): - print("Test function") \ No newline at end of file + print("Test function2") \ No newline at end of file diff --git a/src/devede/devede.py b/src/devede/devede.py index 5b91709..88801aa 100644 --- a/src/devede/devede.py +++ b/src/devede/devede.py @@ -13,11 +13,19 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see import devede.convert +import devede.main_window +from gi.repository import Gtk +# This is the first call made, where we initializate everything -def main(argv): +def main(argv,paths): - devede.convert.test() \ No newline at end of file + global _ + + Gtk.init(argv) + + ventana = devede.main_window.choose_disk(paths) + Gtk.main() diff --git a/src/devede/main_window.py b/src/devede/main_window.py new file mode 100644 index 0000000..5a601d1 --- /dev/null +++ b/src/devede/main_window.py @@ -0,0 +1,83 @@ +# Copyright 2014 (C) Raster Software Vigo (Sergio Costas) +# +# This file is part of DeVeDe-NG +# +# DeVeDe-NG is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# DeVeDe-NG is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +from gi.repository import Gtk +import os + +class choose_disk: + + def __init__(self,paths): + + self.paths = paths + + self.builder = Gtk.Builder() + self.builder.set_translation_domain("devede_ng") + + self.builder.add_from_file(os.path.join(paths.glade,"wselect_disk.ui")) + self.builder.connect_signals(self) + self.window = self.builder.get_object("wselect_disk") + + self.window.show_all() + + def main_window(self,disk_type): + + self.window.hide() + self.window.destroy() + self.main_window = main_window(self.paths,disk_type) + + + def on_button_dvd_clicked(self,b): + + self.main_window("dvd") + + def on_button_vcd_clicked(self,b): + + self.main_window("vcd") + + def on_button_svcd_clicked(self,b): + + self.main_window("svcd") + + def on_button_cvd_clicked(self,b): + + self.main_window("cvd") + + def on_button_divx_clicked(self,b): + + self.main_window("divx") + + def on_wselect_disk_delete_event(self,w,e): + Gtk.main_quit() + return False + + + +class main_window: + + def __init__(self,paths,disk_type): + + self.paths = paths + self.disk_type = disk_type + + self.builder = Gtk.Builder() + self.builder.set_translation_domain("devede_ng") + + self.builder.add_from_file(os.path.join(paths.glade,"wmain.ui")) + self.builder.connect_signals(self) + self.window = self.builder.get_object("wmain") + + self.window.show_all() \ No newline at end of file diff --git a/src/devede_ng.py b/src/devede_ng.py index 9facf7c..399542d 100755 --- a/src/devede_ng.py +++ b/src/devede_ng.py @@ -15,9 +15,63 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see import sys +import os +import gettext +import locale import devede.devede -devede.devede.main(sys.argv) \ No newline at end of file +class config_paths: + + def __init__(self,is_local): + + if (is_local): + # locales must be always at /usr/share/locale because Gtk.Builder always search there + self.share_locale="/usr/share/locale" + self.glade="/usr/local/share/devede_ng" + self.font_path="/usr/local/share/devede_ng" + self.pic_path="/usr/local/share/devede_ng" + self.other_path="/usr/local/share/devede_ng" + self.help_path="/usr/local/share/doc/devede_ng" + else: + self.share_locale="/usr/share/locale" + self.glade="/usr/share/devede_ng" + self.font_path="/usr/share/devede_ng" + self.pic_path="/usr/share/devede_ng" + self.other_path="/usr/share/devede_ng" + self.help_path="/usr/share/doc/devede_ng" + + + +paths = None + +try: + os.stat("/usr/share/devede_ng/wselect_disk.ui") + paths = config_paths(False) +except: + pass + +if paths == None: + try: + os.stat("/usr/local/share/devede_ng/wselect_disk.ui") + paths = config_paths(True) + except: + pass + +if paths == None: + print ("Can't locate extra files. Aborting.") + sys.exit(1) + +gettext.bindtextdomain('devede_ng',paths.share_locale) +try: + locale.setlocale(locale.LC_ALL,"") +except locale.Error: + pass +gettext.textdomain('devede_ng') +gettext.install("devede_ng",localedir=paths.share_locale) + +_ = gettext.gettext + +devede.devede.main(sys.argv,paths) \ No newline at end of file