├── .gitignore ├── .travis.yml ├── AUTHORS ├── COPYING ├── README.md ├── data ├── com.github.basjam.valacompiler.appdata.xml.in ├── com.github.basjam.valacompiler.desktop.in ├── com.github.basjam.valacompiler.gschema.xml ├── icons │ ├── 16 │ │ └── com.github.basjam.valacompiler.svg │ ├── 24 │ │ └── com.github.basjam.valacompiler.svg │ ├── 32 │ │ └── com.github.basjam.valacompiler.svg │ ├── 48 │ │ └── com.github.basjam.valacompiler.svg │ ├── 64 │ │ └── com.github.basjam.valacompiler.svg │ ├── 128 │ │ ├── com.github.basjam.ValaCompiler.svg~ │ │ └── com.github.basjam.valacompiler.svg │ └── meson.build └── meson.build ├── debian ├── changelog ├── compat ├── control ├── copyright ├── rules └── source │ └── format ├── meson.build ├── meson └── post_install.py ├── po ├── LINGUAS ├── POTFILES ├── ar.po ├── com.github.basjam.valacompiler.pot ├── de.po ├── es.po ├── fr.po └── meson.build ├── screenshots ├── ValaCompiler-CompilerReport(ScreenShot).png ├── ValaCompiler-ProjectPage(ScreenShot).png └── ValaCompiler-TestReport(ScreenShot).png └── src ├── Application.vala ├── Settings └── Settings.vala ├── Utils ├── AppTester.vala ├── CompileManager.vala ├── File.vala ├── FileLister.vala ├── FilesManager.vala ├── Option.vala ├── OptionsManager.vala ├── ReportsManager.vala └── ValaC.vala ├── Widgets ├── AddOptionsDialog.vala ├── FilesListBox.vala ├── FilesListRow.vala ├── HeaderBar.vala ├── MainStack.vala ├── OptionsListBox.vala ├── OptionsListRow.vala ├── OptionsSidebar.vala ├── ProjectPage.vala ├── ReportPage.vala └── WelcomePage.vala └── Window.vala /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | --- 3 | 4 | language: node_js 5 | 6 | node_js: 7 | - lts/* 8 | 9 | sudo: required 10 | 11 | services: 12 | - docker 13 | 14 | addons: 15 | apt: 16 | sources: 17 | - ubuntu-toolchain-r-test 18 | packages: 19 | - libstdc++-5-dev 20 | 21 | cache: 22 | directories: 23 | - /tmp/liftoff 24 | 25 | install: 26 | - npm install @elementaryos/houston 27 | 28 | script: 29 | - houston ci 30 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Basem Kheyar 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | logo
3 |

4 | 5 |
6 |

ValaCompiler

7 |

A simple GUI for the command line valac.

8 |
9 | 10 |

11 | Screenshot
12 | Screenshot
13 | Screenshot
14 |

15 | 16 | 17 | ## What the application does 18 | 1-Select your project source folder, and create a "valacompiler" folder in it. 19 | 20 | 2-Scan the folder for valac compilable files and view them in a toggle list. 21 | 22 | 3-Modify the compile instructions by adding user selected options (eg:- pkg=gtk+3.0 pkg=granite .....), and add a "valacompiler.options" file in the "/valacompiler" folder. 23 | 24 | 4-Compile by using the command line (valac) + toggled files + options from step 3 + output a test file "valacompiler.test" in the "/valacompiler" inside the source folder. 25 | 26 | 5-Live report compile output. 27 | 28 | 6-Test run the output file "valacompiler.test". 29 | 30 | 7-Live report the test run output. 31 | 32 | ## Building and Installation 33 | 34 | you'll need the following dependencies: 35 | * cmake 36 | * valac 37 | * libgranite-dev 38 | * libgtk-3-dev 39 | 40 | It is recommended to create a clean build environment 41 | 42 | mkdir build 43 | cd build/ 44 | 45 | Run 'cmake' to configure the build environment and then 'make' to build 46 | 47 | cmake -DCMAKE_INSTALL_PREFIX=/usr .. 48 | make 49 | 50 | To install, use 'make install' 51 | 52 | sudo make install 53 | 54 | ## Arch Linux 55 | Arch Linux users can find ValaCompiler under the name [valacompiler-git](https://aur.archlinux.org/packages/valacompiler-git/) in the **AUR**: 56 | 57 | `$ aurman -S valacompiler-git` 58 | 59 | ## Precautions 60 | 61 | * This app will create a folder named "valacompiler" in your source folder. 62 | -------------------------------------------------------------------------------- /data/com.github.basjam.valacompiler.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.github.basjam.valacompiler.desktop 5 | CC0 6 | GPL-2.0+ 7 | ValaCompiler 8 | A Simple GUI for valac 9 | 10 |

A simple GUI for valac that is aimed at replacing the terminal use in vala development.

11 |
12 | 13 | com.github.basjam.valacompiler 14 | 15 | Basem Kheyar 16 | https://github.com/basjam/ValaCompiler/ 17 | https://github.com/basjam/ValaCompiler/issues 18 | basjam@gmail.com 19 | 20 | none 21 | none 22 | none 23 | none 24 | none 25 | none 26 | none 27 | none 28 | none 29 | none 30 | none 31 | none 32 | none 33 | none 34 | none 35 | none 36 | none 37 | none 38 | none 39 | none 40 | none 41 | none 42 | none 43 | none 44 | none 45 | none 46 | none 47 | 48 | 49 | 50 | 51 | https://raw.githubusercontent.com/basjam/ValaCompiler/master/screenshots/ValaCompiler-ProjectPage(ScreenShot).png 52 | 53 | 54 | https://raw.githubusercontent.com/basjam/ValaCompiler/master/screenshots/ValaCompiler-CompilerReport(ScreenShot).png 55 | 56 | 57 | https://raw.githubusercontent.com/basjam/ValaCompiler/master/screenshots/ValaCompiler-TestReport(ScreenShot).png 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
  • New Logo.
  • 65 |
  • Ready for Juno (Switched to Meson).
  • 66 |
67 |
68 |
69 | 70 | 71 |
    72 |
  • Consistent UI for Files and Options in ProjectPage.
  • 73 |
  • Cool new sliding animation for options side panel.
  • 74 |
  • Ability to manually add and remove to the list.
  • 75 |
  • App remembers options and their status per project.
  • 76 |
  • Smarter buttons on the Headerbar. Compile button is there when you want it. Test button checks weather there is a test file. Kill test button appears only when there is a test to be killed.
  • 77 |
  • Separate App name in title and project address in subtitle on the Headerbar.
  • 78 |
  • Smaller window by default.
  • 79 |
  • Dark button colors.
  • 80 |
81 |
82 |
83 | 84 | 85 |
    86 |
  • Minor UI improvements
  • 87 |
  • Kill button now works through pid instead of "killall TEST"
  • 88 |
89 |
90 |
91 | 92 | 93 |
    94 |
  • Made UI more consistent across pages
  • 95 |
96 |
97 |
98 | 99 | 100 |
    101 |
  • Minor UI improvements
  • 102 |
  • Add granite checkbutton
  • 103 |
  • Fixed bug #14. Files marked as executable can now be listed by the app
  • 104 |
105 |
106 |
107 | 108 | 109 |

Release: Initial Release

110 |
111 |
112 |
113 | 114 | #3f4149 115 | #ffffff 116 | 2 117 | 118 |
119 | -------------------------------------------------------------------------------- /data/com.github.basjam.valacompiler.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=ValaCompiler 3 | GenericName=Vala Compiler 4 | Comment=A simple GUI for valac 5 | Categories=Development; 6 | Exec=com.github.basjam.valacompiler 7 | Icon=com.github.basjam.valacompiler 8 | Terminal=false 9 | Type=Application 10 | X-GNOME-Gettext-Domain=valacompiler 11 | X-GNOME-UsesNotifications=true 12 | Keywords=Vala;Compiler;valacompiler;Valac;ValaC; 13 | -------------------------------------------------------------------------------- /data/com.github.basjam.valacompiler.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "" 6 | Last source folder used 7 | The last source folder used 8 | 9 | 10 | "" 11 | Current source folder 12 | The current working source folder 13 | 14 | 15 | [] 16 | Options for valac 17 | eg: [--pkg=gtk+-3.0, -X, -w ....] 18 | 19 | 20 | "" 21 | custom compiling options 22 | the bottom entry text for compiling options. 23 | 24 | 25 | true 26 | gtk+-3.0 package 27 | add --pkg=gtk+-3.0 to the valac command. 28 | 29 | 30 | true 31 | granite package 32 | add --pkg=granite to the valac command. 33 | 34 | 35 | false 36 | Show c compile warnings 37 | removes -X -w from valac, they silence c compile warnings. 38 | 39 | 40 | false 41 | Show options side pane 42 | In project page 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /data/icons/128/com.github.basjam.ValaCompiler.svg~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | This is a banana 52 | back gradient 53 | 54 | 55 | 56 | C 57 | C 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /data/icons/16/com.github.basjam.valacompiler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 44 | 48 | 52 | 56 | 57 | 60 | 64 | 68 | 69 | 72 | 76 | 80 | 81 | 84 | 88 | 92 | 93 | 103 | 113 | 123 | 131 | 135 | 136 | 146 | 155 | 156 | 183 | 186 | 191 | 196 | 201 | 202 | 210 | 219 | 223 | 227 | 233 | 239 | 240 | 246 | 252 | 256 | 260 | 261 | -------------------------------------------------------------------------------- /data/icons/24/com.github.basjam.valacompiler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 44 | 48 | 52 | 56 | 57 | 60 | 64 | 68 | 69 | 72 | 76 | 80 | 81 | 84 | 88 | 92 | 93 | 103 | 113 | 121 | 125 | 126 | 136 | 146 | 155 | 156 | 180 | 183 | 188 | 193 | 194 | 203 | 211 | 215 | 221 | 227 | 231 | 237 | 241 | 242 | -------------------------------------------------------------------------------- /data/icons/32/com.github.basjam.valacompiler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 44 | 48 | 52 | 56 | 57 | 60 | 64 | 68 | 69 | 72 | 76 | 80 | 81 | 84 | 88 | 92 | 93 | 103 | 113 | 123 | 131 | 135 | 136 | 146 | 155 | 165 | 166 | 190 | 193 | 198 | 203 | 204 | 213 | 221 | 225 | 231 | 237 | 241 | 247 | 253 | 259 | 260 | -------------------------------------------------------------------------------- /data/icons/48/com.github.basjam.valacompiler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 44 | 48 | 52 | 56 | 57 | 60 | 64 | 68 | 69 | 72 | 76 | 80 | 81 | 84 | 88 | 92 | 93 | 103 | 113 | 123 | 131 | 135 | 136 | 146 | 156 | 166 | 167 | 190 | 193 | 198 | 203 | 204 | 213 | 221 | 226 | 232 | 238 | 244 | 248 | 252 | 258 | 259 | -------------------------------------------------------------------------------- /data/icons/64/com.github.basjam.valacompiler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 44 | 48 | 52 | 56 | 57 | 60 | 64 | 68 | 69 | 72 | 76 | 80 | 81 | 84 | 88 | 92 | 93 | 103 | 113 | 123 | 131 | 135 | 136 | 146 | 155 | 156 | 179 | 182 | 187 | 192 | 193 | 202 | 210 | 214 | 220 | 226 | 232 | 236 | 240 | 246 | 247 | -------------------------------------------------------------------------------- /data/icons/meson.build: -------------------------------------------------------------------------------- 1 | icon_sizes = ['16', '24', '32', '48', '64', '128'] 2 | 3 | foreach i : icon_sizes 4 | install_data( 5 | join_paths(i, meson.project_name() + '.svg'), 6 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') 7 | ) 8 | endforeach 9 | 10 | 11 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | meson.project_name() + '.gschema.xml', 3 | install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas') 4 | ) 5 | 6 | #Translate and install our .desktop file 7 | i18n.merge_file( 8 | input: meson.project_name() + '.desktop.in', 9 | output: meson.project_name() + '.desktop', 10 | po_dir: join_paths(meson.source_root(), 'po'), 11 | type: 'desktop', 12 | install: true, 13 | install_dir: join_paths(get_option('datadir'), 'applications') 14 | ) 15 | 16 | #Translate and install our .appdata file 17 | i18n.merge_file( 18 | input: meson.project_name() + '.appdata.xml.in', 19 | output: meson.project_name() + '.appdata.xml', 20 | po_dir: join_paths(meson.source_root(), 'po'), 21 | install: true, 22 | install_dir: join_paths(get_option('datadir'), 'metainfo') 23 | ) 24 | 25 | subdir('icons') 26 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | com.github.basjam.valacompiler (1.0.0) stable; urgency=low 2 | 3 | * Consistent UI for Files and Options in ProjectPage. 4 | * Cool new sliding animation for options side panel. 5 | * Ability to manually add and remove to the list. 6 | * App remembers options and their status per project. 7 | * Smarter buttons on the Headerbar. Compile button is there when you want it. Test button checks weather there is a test file. Kill test button appears only when there is a test to be killed. 8 | * Separate App name in title and project address in subtitle on the Headerbar. 9 | * Smaller window by default. 10 | * Dark button colors. 11 | 12 | -- Basem Kheyar Thu, 14 Jun 2018 06:00:00 -0500 13 | 14 | com.github.basjam.valacompiler (0.1.16) stable; urgency=low 15 | 16 | * Minor UI improvements 17 | * Kill button now works through pid instead of "killall TEST" 18 | 19 | -- Basem Kheyar Mon, 05 Mar 2018 08:25:00 -0500 20 | 21 | com.github.basjam.valacompiler (0.1.15) stable; urgency=low 22 | 23 | * Made UI more consistent across pages 24 | 25 | -- Basem Kheyar Thu, 22 Feb 2018 08:25:00 -0500 26 | 27 | com.github.basjam.valacompiler (0.1.14) stable; urgency=low 28 | 29 | * Minor UI improvements 30 | * Add granite checkbutton 31 | * Fixed bug #14. Files marked as executable can now be listed by the app 32 | 33 | -- Basem Kheyar Mon, 15 Feb 2018 11:20:00 -0500 34 | 35 | com.github.basjam.valacompiler (0.1.11) stable; urgency=low 36 | 37 | * Initial Release 38 | 39 | -- Basem Kheyar Thu, 23 Nov 2017 15:44:39 -0500 40 | 41 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: com.github.basjam.valacompiler 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Basem Kheyar 5 | Build-Depends: debhelper (>= 9), 6 | meson, 7 | libgranite-dev, 8 | libgtk-3-dev, 9 | valac 10 | Standards-Version: 3.9.6 11 | 12 | Package: com.github.basjam.valacompiler 13 | Architecture: any 14 | Depends: ${misc:Depends}, ${shlibs:Depends} 15 | Description: Vala Compiler 16 | A GUI for the command line valac. 17 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://dep.debian.net/deps/dep5 2 | Upstream-Name: valacompiler 3 | Source: https://github.com/basjam/ValaCompiler 4 | 5 | Files: src/* data/* cmake/* debian/* 6 | Copyright: 2017 Basem Kheyar . 7 | License: GPL-3.0+ 8 | 9 | License: GPL-3.0+ 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | . 23 | On Debian systems, the complete text of the GNU General 24 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 25 | 26 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | ## project name and programming language 2 | project('com.github.basjam.valacompiler', 'vala', 'c') 3 | 4 | # Include the translations module 5 | i18n = import('i18n') 6 | 7 | # Set our translation domain 8 | add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c') 9 | 10 | # Create a new executable, list the files we want to compile, list the dependencies we need, and install 11 | executable( 12 | meson.project_name(), 13 | 'src/Window.vala', 14 | 'src/Application.vala', 15 | 'src/Settings/Settings.vala', 16 | 'src/Utils/FileLister.vala', 17 | 'src/Utils/FilesManager.vala', 18 | 'src/Utils/ValaC.vala', 19 | 'src/Utils/AppTester.vala', 20 | 'src/Utils/OptionsManager.vala', 21 | 'src/Utils/Option.vala', 22 | 'src/Utils/CompileManager.vala', 23 | 'src/Utils/ReportsManager.vala', 24 | 'src/Utils/File.vala', 25 | 'src/Widgets/FilesListBox.vala', 26 | 'src/Widgets/FilesListRow.vala', 27 | 'src/Widgets/ProjectPage.vala', 28 | 'src/Widgets/WelcomePage.vala', 29 | 'src/Widgets/ReportPage.vala', 30 | 'src/Widgets/OptionsSidebar.vala', 31 | 'src/Widgets/OptionsListBox.vala', 32 | 'src/Widgets/OptionsListRow.vala', 33 | 'src/Widgets/AddOptionsDialog.vala', 34 | 'src/Widgets/HeaderBar.vala', 35 | 'src/Widgets/MainStack.vala', 36 | dependencies: [ 37 | dependency('gtk+-3.0'), 38 | dependency('granite'), 39 | ], 40 | install: true 41 | ) 42 | 43 | subdir('po') 44 | subdir('data') 45 | meson.add_install_script('meson/post_install.py') 46 | -------------------------------------------------------------------------------- /meson/post_install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | 6 | prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr') 7 | datadir = os.path.join(prefix, 'share') 8 | 9 | # Packaging tools define DESTDIR and this isn't needed for them 10 | if 'DESTDIR' not in os.environ: 11 | print('Compiling gsettings schemas...') 12 | schema_dir = os.path.join(datadir, 'glib-2.0/schemas') 13 | subprocess.call(['glib-compile-schemas', schema_dir]) 14 | 15 | print('Updating icon cache...') 16 | icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') 17 | if not os.path.exists(icon_cache_dir): 18 | os.makedirs(icon_cache_dir) 19 | subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) 20 | 21 | print('Updating desktop database...') 22 | desktop_database_dir = os.path.join(datadir, 'applications') 23 | if not os.path.exists(desktop_database_dir): 24 | os.makedirs(desktop_database_dir) 25 | subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) 26 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | de 2 | es 3 | fr 4 | ar 5 | 6 | -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | src/Window.vala 2 | src/Application.vala 3 | src/Settings/Settings.vala 4 | src/Utils/FileLister.vala 5 | src/Utils/FilesManager.vala 6 | src/Utils/ValaC.vala 7 | src/Utils/AppTester.vala 8 | src/Utils/OptionsManager.vala 9 | src/Utils/Option.vala 10 | src/Utils/CompileManager.vala 11 | src/Utils/ReportsManager.vala 12 | src/Utils/File.vala 13 | src/Widgets/FilesListBox.vala 14 | src/Widgets/FilesListRow.vala 15 | src/Widgets/ProjectPage.vala 16 | src/Widgets/WelcomePage.vala 17 | src/Widgets/ReportPage.vala 18 | src/Widgets/OptionsSidebar.vala 19 | src/Widgets/OptionsListBox.vala 20 | src/Widgets/OptionsListRow.vala 21 | src/Widgets/AddOptionsDialog.vala 22 | src/Widgets/HeaderBar.vala 23 | src/Widgets/MainStack.vala 24 | data/com.github.basjam.valacompiler.desktop.in 25 | data/com.github.basjam.valacompiler.appdata.xml.in 26 | 27 | -------------------------------------------------------------------------------- /po/ar.po: -------------------------------------------------------------------------------- 1 | # Arabic translations for com.github.basjam.valacompiler package. 2 | # Copyright (C) 2018 THE com.github.basjam.valacompiler'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.basjam.valacompiler package. 4 | # Automatically generated, 2018. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.basjam.valacompiler\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-08-08 18:04-0400\n" 11 | "PO-Revision-Date: 2018-08-08 18:04-0400\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: ar\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=ASCII\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/Window.vala:62 20 | msgid "Select Project Folder" 21 | msgstr "" 22 | 23 | #: src/Window.vala:65 24 | msgid "Cancel" 25 | msgstr "" 26 | 27 | #: src/Window.vala:67 28 | msgid "Open" 29 | msgstr "" 30 | 31 | #: src/Window.vala:72 32 | msgid "Vala files" 33 | msgstr "" 34 | 35 | #: src/Window.vala:76 36 | msgid "All Files" 37 | msgstr "" 38 | 39 | #: src/Widgets/FilesListBox.vala:58 40 | msgid "Files" 41 | msgstr "" 42 | 43 | #: src/Widgets/FilesListBox.vala:59 44 | msgid "Toggle files to be compiled" 45 | msgstr "" 46 | 47 | #: src/Widgets/FilesListBox.vala:85 48 | msgid "Change source folder" 49 | msgstr "" 50 | 51 | #: src/Widgets/FilesListRow.vala:47 52 | msgid "Click to toggle file" 53 | msgstr "" 54 | 55 | #: src/Widgets/WelcomePage.vala:29 56 | #: data/com.github.basjam.valacompiler.desktop.in:4 57 | msgid "Vala Compiler" 58 | msgstr "" 59 | 60 | #: src/Widgets/WelcomePage.vala:29 61 | msgid "A simple GUI for the command line valac" 62 | msgstr "" 63 | 64 | #: src/Widgets/WelcomePage.vala:35 65 | msgid "Source folder" 66 | msgstr "" 67 | 68 | #: src/Widgets/WelcomePage.vala:35 69 | msgid "Open your source folder." 70 | msgstr "" 71 | 72 | #: src/Widgets/WelcomePage.vala:38 73 | msgid "Open last source folder" 74 | msgstr "" 75 | 76 | #: src/Widgets/ReportPage.vala:57 77 | msgid "Compile Report" 78 | msgstr "" 79 | 80 | #: src/Widgets/ReportPage.vala:58 81 | msgid "Live Test Report" 82 | msgstr "" 83 | 84 | #: src/Widgets/ReportPage.vala:92 src/Widgets/ReportPage.vala:120 85 | #: src/Widgets/ReportPage.vala:132 86 | msgid "Clear Report" 87 | msgstr "" 88 | 89 | #: src/Widgets/ReportPage.vala:99 src/Widgets/ReportPage.vala:123 90 | #: src/Widgets/ReportPage.vala:135 91 | msgid "Undo Last Clear" 92 | msgstr "" 93 | 94 | #: src/Widgets/OptionsSidebar.vala:55 src/Widgets/HeaderBar.vala:72 95 | msgid "Options" 96 | msgstr "" 97 | 98 | #: src/Widgets/OptionsSidebar.vala:63 src/Widgets/AddOptionsDialog.vala:39 99 | #: src/Widgets/AddOptionsDialog.vala:50 100 | msgid "Add options" 101 | msgstr "" 102 | 103 | #: src/Widgets/OptionsSidebar.vala:72 104 | msgid "Clear all options" 105 | msgstr "" 106 | 107 | #: src/Widgets/OptionsListRow.vala:43 108 | msgid "Remove option" 109 | msgstr "" 110 | 111 | #: src/Widgets/OptionsListRow.vala:59 112 | msgid "Click to toggle option" 113 | msgstr "" 114 | 115 | #: src/Widgets/AddOptionsDialog.vala:30 116 | msgid "Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0" 117 | msgstr "" 118 | 119 | #: src/Widgets/HeaderBar.vala:82 120 | msgid "Compile" 121 | msgstr "" 122 | 123 | #: src/Widgets/HeaderBar.vala:88 124 | msgid "Test the app" 125 | msgstr "" 126 | 127 | #: src/Widgets/HeaderBar.vala:97 128 | msgid "Kill all running tests" 129 | msgstr "" 130 | 131 | #: src/Widgets/HeaderBar.vala:152 132 | msgid "Welcome Page" 133 | msgstr "" 134 | 135 | #: src/Widgets/HeaderBar.vala:154 136 | msgid "Report Page" 137 | msgstr "" 138 | 139 | #: src/Widgets/HeaderBar.vala:163 140 | msgid "Project Page" 141 | msgstr "" 142 | 143 | #: data/com.github.basjam.valacompiler.desktop.in:3 144 | #: data/com.github.basjam.valacompiler.appdata.xml.in:7 145 | msgid "ValaCompiler" 146 | msgstr "" 147 | 148 | #: data/com.github.basjam.valacompiler.desktop.in:5 149 | msgid "A simple GUI for valac" 150 | msgstr "" 151 | 152 | #: data/com.github.basjam.valacompiler.desktop.in:8 153 | msgid "com.github.basjam.valacompiler" 154 | msgstr "" 155 | 156 | #: data/com.github.basjam.valacompiler.desktop.in:12 157 | msgid "Vala;Compiler;valacompiler;Valac;ValaC;" 158 | msgstr "" 159 | 160 | #: data/com.github.basjam.valacompiler.appdata.xml.in:8 161 | msgid "A Simple GUI for valac" 162 | msgstr "" 163 | 164 | #: data/com.github.basjam.valacompiler.appdata.xml.in:10 165 | msgid "" 166 | "A simple GUI for valac that is aimed at replacing the terminal use in vala " 167 | "development." 168 | msgstr "" 169 | 170 | #: data/com.github.basjam.valacompiler.appdata.xml.in:15 171 | msgid "Basem Kheyar" 172 | msgstr "" 173 | -------------------------------------------------------------------------------- /po/com.github.basjam.valacompiler.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.basjam.valacompiler package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: com.github.basjam.valacompiler\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-08-08 18:04-0400\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/Window.vala:62 21 | msgid "Select Project Folder" 22 | msgstr "" 23 | 24 | #: src/Window.vala:65 25 | msgid "Cancel" 26 | msgstr "" 27 | 28 | #: src/Window.vala:67 29 | msgid "Open" 30 | msgstr "" 31 | 32 | #: src/Window.vala:72 33 | msgid "Vala files" 34 | msgstr "" 35 | 36 | #: src/Window.vala:76 37 | msgid "All Files" 38 | msgstr "" 39 | 40 | #: src/Widgets/FilesListBox.vala:58 41 | msgid "Files" 42 | msgstr "" 43 | 44 | #: src/Widgets/FilesListBox.vala:59 45 | msgid "Toggle files to be compiled" 46 | msgstr "" 47 | 48 | #: src/Widgets/FilesListBox.vala:85 49 | msgid "Change source folder" 50 | msgstr "" 51 | 52 | #: src/Widgets/FilesListRow.vala:47 53 | msgid "Click to toggle file" 54 | msgstr "" 55 | 56 | #: src/Widgets/WelcomePage.vala:29 57 | #: data/com.github.basjam.valacompiler.desktop.in:4 58 | msgid "Vala Compiler" 59 | msgstr "" 60 | 61 | #: src/Widgets/WelcomePage.vala:29 62 | msgid "A simple GUI for the command line valac" 63 | msgstr "" 64 | 65 | #: src/Widgets/WelcomePage.vala:35 66 | msgid "Source folder" 67 | msgstr "" 68 | 69 | #: src/Widgets/WelcomePage.vala:35 70 | msgid "Open your source folder." 71 | msgstr "" 72 | 73 | #: src/Widgets/WelcomePage.vala:38 74 | msgid "Open last source folder" 75 | msgstr "" 76 | 77 | #: src/Widgets/ReportPage.vala:57 78 | msgid "Compile Report" 79 | msgstr "" 80 | 81 | #: src/Widgets/ReportPage.vala:58 82 | msgid "Live Test Report" 83 | msgstr "" 84 | 85 | #: src/Widgets/ReportPage.vala:92 src/Widgets/ReportPage.vala:120 86 | #: src/Widgets/ReportPage.vala:132 87 | msgid "Clear Report" 88 | msgstr "" 89 | 90 | #: src/Widgets/ReportPage.vala:99 src/Widgets/ReportPage.vala:123 91 | #: src/Widgets/ReportPage.vala:135 92 | msgid "Undo Last Clear" 93 | msgstr "" 94 | 95 | #: src/Widgets/OptionsSidebar.vala:55 src/Widgets/HeaderBar.vala:72 96 | msgid "Options" 97 | msgstr "" 98 | 99 | #: src/Widgets/OptionsSidebar.vala:63 src/Widgets/AddOptionsDialog.vala:39 100 | #: src/Widgets/AddOptionsDialog.vala:50 101 | msgid "Add options" 102 | msgstr "" 103 | 104 | #: src/Widgets/OptionsSidebar.vala:72 105 | msgid "Clear all options" 106 | msgstr "" 107 | 108 | #: src/Widgets/OptionsListRow.vala:43 109 | msgid "Remove option" 110 | msgstr "" 111 | 112 | #: src/Widgets/OptionsListRow.vala:59 113 | msgid "Click to toggle option" 114 | msgstr "" 115 | 116 | #: src/Widgets/AddOptionsDialog.vala:30 117 | msgid "Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0" 118 | msgstr "" 119 | 120 | #: src/Widgets/HeaderBar.vala:82 121 | msgid "Compile" 122 | msgstr "" 123 | 124 | #: src/Widgets/HeaderBar.vala:88 125 | msgid "Test the app" 126 | msgstr "" 127 | 128 | #: src/Widgets/HeaderBar.vala:97 129 | msgid "Kill all running tests" 130 | msgstr "" 131 | 132 | #: src/Widgets/HeaderBar.vala:152 133 | msgid "Welcome Page" 134 | msgstr "" 135 | 136 | #: src/Widgets/HeaderBar.vala:154 137 | msgid "Report Page" 138 | msgstr "" 139 | 140 | #: src/Widgets/HeaderBar.vala:163 141 | msgid "Project Page" 142 | msgstr "" 143 | 144 | #: data/com.github.basjam.valacompiler.desktop.in:3 145 | #: data/com.github.basjam.valacompiler.appdata.xml.in:7 146 | msgid "ValaCompiler" 147 | msgstr "" 148 | 149 | #: data/com.github.basjam.valacompiler.desktop.in:5 150 | msgid "A simple GUI for valac" 151 | msgstr "" 152 | 153 | #: data/com.github.basjam.valacompiler.desktop.in:8 154 | msgid "com.github.basjam.valacompiler" 155 | msgstr "" 156 | 157 | #: data/com.github.basjam.valacompiler.desktop.in:12 158 | msgid "Vala;Compiler;valacompiler;Valac;ValaC;" 159 | msgstr "" 160 | 161 | #: data/com.github.basjam.valacompiler.appdata.xml.in:8 162 | msgid "A Simple GUI for valac" 163 | msgstr "" 164 | 165 | #: data/com.github.basjam.valacompiler.appdata.xml.in:10 166 | msgid "" 167 | "A simple GUI for valac that is aimed at replacing the terminal use in vala " 168 | "development." 169 | msgstr "" 170 | 171 | #: data/com.github.basjam.valacompiler.appdata.xml.in:15 172 | msgid "Basem Kheyar" 173 | msgstr "" 174 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | # German translations for com.github.basjam.valacompiler package. 2 | # Copyright (C) 2018 THE com.github.basjam.valacompiler'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.basjam.valacompiler package. 4 | # Automatically generated, 2018. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.basjam.valacompiler\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-08-08 18:04-0400\n" 11 | "PO-Revision-Date: 2018-08-08 18:04-0400\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: de\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=ASCII\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: src/Window.vala:62 21 | msgid "Select Project Folder" 22 | msgstr "" 23 | 24 | #: src/Window.vala:65 25 | msgid "Cancel" 26 | msgstr "" 27 | 28 | #: src/Window.vala:67 29 | msgid "Open" 30 | msgstr "" 31 | 32 | #: src/Window.vala:72 33 | msgid "Vala files" 34 | msgstr "" 35 | 36 | #: src/Window.vala:76 37 | msgid "All Files" 38 | msgstr "" 39 | 40 | #: src/Widgets/FilesListBox.vala:58 41 | msgid "Files" 42 | msgstr "" 43 | 44 | #: src/Widgets/FilesListBox.vala:59 45 | msgid "Toggle files to be compiled" 46 | msgstr "" 47 | 48 | #: src/Widgets/FilesListBox.vala:85 49 | msgid "Change source folder" 50 | msgstr "" 51 | 52 | #: src/Widgets/FilesListRow.vala:47 53 | msgid "Click to toggle file" 54 | msgstr "" 55 | 56 | #: src/Widgets/WelcomePage.vala:29 57 | #: data/com.github.basjam.valacompiler.desktop.in:4 58 | msgid "Vala Compiler" 59 | msgstr "" 60 | 61 | #: src/Widgets/WelcomePage.vala:29 62 | msgid "A simple GUI for the command line valac" 63 | msgstr "" 64 | 65 | #: src/Widgets/WelcomePage.vala:35 66 | msgid "Source folder" 67 | msgstr "" 68 | 69 | #: src/Widgets/WelcomePage.vala:35 70 | msgid "Open your source folder." 71 | msgstr "" 72 | 73 | #: src/Widgets/WelcomePage.vala:38 74 | msgid "Open last source folder" 75 | msgstr "" 76 | 77 | #: src/Widgets/ReportPage.vala:57 78 | msgid "Compile Report" 79 | msgstr "" 80 | 81 | #: src/Widgets/ReportPage.vala:58 82 | msgid "Live Test Report" 83 | msgstr "" 84 | 85 | #: src/Widgets/ReportPage.vala:92 src/Widgets/ReportPage.vala:120 86 | #: src/Widgets/ReportPage.vala:132 87 | msgid "Clear Report" 88 | msgstr "" 89 | 90 | #: src/Widgets/ReportPage.vala:99 src/Widgets/ReportPage.vala:123 91 | #: src/Widgets/ReportPage.vala:135 92 | msgid "Undo Last Clear" 93 | msgstr "" 94 | 95 | #: src/Widgets/OptionsSidebar.vala:55 src/Widgets/HeaderBar.vala:72 96 | msgid "Options" 97 | msgstr "" 98 | 99 | #: src/Widgets/OptionsSidebar.vala:63 src/Widgets/AddOptionsDialog.vala:39 100 | #: src/Widgets/AddOptionsDialog.vala:50 101 | msgid "Add options" 102 | msgstr "" 103 | 104 | #: src/Widgets/OptionsSidebar.vala:72 105 | msgid "Clear all options" 106 | msgstr "" 107 | 108 | #: src/Widgets/OptionsListRow.vala:43 109 | msgid "Remove option" 110 | msgstr "" 111 | 112 | #: src/Widgets/OptionsListRow.vala:59 113 | msgid "Click to toggle option" 114 | msgstr "" 115 | 116 | #: src/Widgets/AddOptionsDialog.vala:30 117 | msgid "Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0" 118 | msgstr "" 119 | 120 | #: src/Widgets/HeaderBar.vala:82 121 | msgid "Compile" 122 | msgstr "" 123 | 124 | #: src/Widgets/HeaderBar.vala:88 125 | msgid "Test the app" 126 | msgstr "" 127 | 128 | #: src/Widgets/HeaderBar.vala:97 129 | msgid "Kill all running tests" 130 | msgstr "" 131 | 132 | #: src/Widgets/HeaderBar.vala:152 133 | msgid "Welcome Page" 134 | msgstr "" 135 | 136 | #: src/Widgets/HeaderBar.vala:154 137 | msgid "Report Page" 138 | msgstr "" 139 | 140 | #: src/Widgets/HeaderBar.vala:163 141 | msgid "Project Page" 142 | msgstr "" 143 | 144 | #: data/com.github.basjam.valacompiler.desktop.in:3 145 | #: data/com.github.basjam.valacompiler.appdata.xml.in:7 146 | msgid "ValaCompiler" 147 | msgstr "" 148 | 149 | #: data/com.github.basjam.valacompiler.desktop.in:5 150 | msgid "A simple GUI for valac" 151 | msgstr "" 152 | 153 | #: data/com.github.basjam.valacompiler.desktop.in:8 154 | msgid "com.github.basjam.valacompiler" 155 | msgstr "" 156 | 157 | #: data/com.github.basjam.valacompiler.desktop.in:12 158 | msgid "Vala;Compiler;valacompiler;Valac;ValaC;" 159 | msgstr "" 160 | 161 | #: data/com.github.basjam.valacompiler.appdata.xml.in:8 162 | msgid "A Simple GUI for valac" 163 | msgstr "" 164 | 165 | #: data/com.github.basjam.valacompiler.appdata.xml.in:10 166 | msgid "" 167 | "A simple GUI for valac that is aimed at replacing the terminal use in vala " 168 | "development." 169 | msgstr "" 170 | 171 | #: data/com.github.basjam.valacompiler.appdata.xml.in:15 172 | msgid "Basem Kheyar" 173 | msgstr "" 174 | -------------------------------------------------------------------------------- /po/es.po: -------------------------------------------------------------------------------- 1 | # Spanish translations for com.github.basjam.valacompiler package. 2 | # Copyright (C) 2018 THE com.github.basjam.valacompiler'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.basjam.valacompiler package. 4 | # Automatically generated, 2018. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.basjam.valacompiler\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-08-08 18:04-0400\n" 11 | "PO-Revision-Date: 2018-08-08 18:04-0400\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: es\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=ASCII\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: src/Window.vala:62 21 | msgid "Select Project Folder" 22 | msgstr "" 23 | 24 | #: src/Window.vala:65 25 | msgid "Cancel" 26 | msgstr "" 27 | 28 | #: src/Window.vala:67 29 | msgid "Open" 30 | msgstr "" 31 | 32 | #: src/Window.vala:72 33 | msgid "Vala files" 34 | msgstr "" 35 | 36 | #: src/Window.vala:76 37 | msgid "All Files" 38 | msgstr "" 39 | 40 | #: src/Widgets/FilesListBox.vala:58 41 | msgid "Files" 42 | msgstr "" 43 | 44 | #: src/Widgets/FilesListBox.vala:59 45 | msgid "Toggle files to be compiled" 46 | msgstr "" 47 | 48 | #: src/Widgets/FilesListBox.vala:85 49 | msgid "Change source folder" 50 | msgstr "" 51 | 52 | #: src/Widgets/FilesListRow.vala:47 53 | msgid "Click to toggle file" 54 | msgstr "" 55 | 56 | #: src/Widgets/WelcomePage.vala:29 57 | #: data/com.github.basjam.valacompiler.desktop.in:4 58 | msgid "Vala Compiler" 59 | msgstr "" 60 | 61 | #: src/Widgets/WelcomePage.vala:29 62 | msgid "A simple GUI for the command line valac" 63 | msgstr "" 64 | 65 | #: src/Widgets/WelcomePage.vala:35 66 | msgid "Source folder" 67 | msgstr "" 68 | 69 | #: src/Widgets/WelcomePage.vala:35 70 | msgid "Open your source folder." 71 | msgstr "" 72 | 73 | #: src/Widgets/WelcomePage.vala:38 74 | msgid "Open last source folder" 75 | msgstr "" 76 | 77 | #: src/Widgets/ReportPage.vala:57 78 | msgid "Compile Report" 79 | msgstr "" 80 | 81 | #: src/Widgets/ReportPage.vala:58 82 | msgid "Live Test Report" 83 | msgstr "" 84 | 85 | #: src/Widgets/ReportPage.vala:92 src/Widgets/ReportPage.vala:120 86 | #: src/Widgets/ReportPage.vala:132 87 | msgid "Clear Report" 88 | msgstr "" 89 | 90 | #: src/Widgets/ReportPage.vala:99 src/Widgets/ReportPage.vala:123 91 | #: src/Widgets/ReportPage.vala:135 92 | msgid "Undo Last Clear" 93 | msgstr "" 94 | 95 | #: src/Widgets/OptionsSidebar.vala:55 src/Widgets/HeaderBar.vala:72 96 | msgid "Options" 97 | msgstr "" 98 | 99 | #: src/Widgets/OptionsSidebar.vala:63 src/Widgets/AddOptionsDialog.vala:39 100 | #: src/Widgets/AddOptionsDialog.vala:50 101 | msgid "Add options" 102 | msgstr "" 103 | 104 | #: src/Widgets/OptionsSidebar.vala:72 105 | msgid "Clear all options" 106 | msgstr "" 107 | 108 | #: src/Widgets/OptionsListRow.vala:43 109 | msgid "Remove option" 110 | msgstr "" 111 | 112 | #: src/Widgets/OptionsListRow.vala:59 113 | msgid "Click to toggle option" 114 | msgstr "" 115 | 116 | #: src/Widgets/AddOptionsDialog.vala:30 117 | msgid "Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0" 118 | msgstr "" 119 | 120 | #: src/Widgets/HeaderBar.vala:82 121 | msgid "Compile" 122 | msgstr "" 123 | 124 | #: src/Widgets/HeaderBar.vala:88 125 | msgid "Test the app" 126 | msgstr "" 127 | 128 | #: src/Widgets/HeaderBar.vala:97 129 | msgid "Kill all running tests" 130 | msgstr "" 131 | 132 | #: src/Widgets/HeaderBar.vala:152 133 | msgid "Welcome Page" 134 | msgstr "" 135 | 136 | #: src/Widgets/HeaderBar.vala:154 137 | msgid "Report Page" 138 | msgstr "" 139 | 140 | #: src/Widgets/HeaderBar.vala:163 141 | msgid "Project Page" 142 | msgstr "" 143 | 144 | #: data/com.github.basjam.valacompiler.desktop.in:3 145 | #: data/com.github.basjam.valacompiler.appdata.xml.in:7 146 | msgid "ValaCompiler" 147 | msgstr "" 148 | 149 | #: data/com.github.basjam.valacompiler.desktop.in:5 150 | msgid "A simple GUI for valac" 151 | msgstr "" 152 | 153 | #: data/com.github.basjam.valacompiler.desktop.in:8 154 | msgid "com.github.basjam.valacompiler" 155 | msgstr "" 156 | 157 | #: data/com.github.basjam.valacompiler.desktop.in:12 158 | msgid "Vala;Compiler;valacompiler;Valac;ValaC;" 159 | msgstr "" 160 | 161 | #: data/com.github.basjam.valacompiler.appdata.xml.in:8 162 | msgid "A Simple GUI for valac" 163 | msgstr "" 164 | 165 | #: data/com.github.basjam.valacompiler.appdata.xml.in:10 166 | msgid "" 167 | "A simple GUI for valac that is aimed at replacing the terminal use in vala " 168 | "development." 169 | msgstr "" 170 | 171 | #: data/com.github.basjam.valacompiler.appdata.xml.in:15 172 | msgid "Basem Kheyar" 173 | msgstr "" 174 | -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- 1 | # French translations for com.github.basjam.valacompiler package. 2 | # Copyright (C) 2019 THE com.github.basjam.valacompiler'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.basjam.valacompiler package. 4 | # NathanBnm, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.basjam.valacompiler\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-08-08 18:04-0400\n" 11 | "PO-Revision-Date: 2019-01-18 16:33+0100\n" 12 | "Last-Translator: NathanBnm\n" 13 | "Language-Team: Français\n" 14 | "Language: fr\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/Window.vala:62 20 | msgid "Select Project Folder" 21 | msgstr "Sélectionner le dossier projet" 22 | 23 | #: src/Window.vala:65 24 | msgid "Cancel" 25 | msgstr "Annuler" 26 | 27 | #: src/Window.vala:67 28 | msgid "Open" 29 | msgstr "Ouvrir" 30 | 31 | #: src/Window.vala:72 32 | msgid "Vala files" 33 | msgstr "Fichiers Vala" 34 | 35 | #: src/Window.vala:76 36 | msgid "All Files" 37 | msgstr "Tous les fichiers" 38 | 39 | #: src/Widgets/FilesListBox.vala:58 40 | msgid "Files" 41 | msgstr "Fichiers" 42 | 43 | #: src/Widgets/FilesListBox.vala:59 44 | msgid "Toggle files to be compiled" 45 | msgstr "Basculer les fichiers à compiler" 46 | 47 | #: src/Widgets/FilesListBox.vala:85 48 | msgid "Change source folder" 49 | msgstr "Changer le dossier source" 50 | 51 | #: src/Widgets/FilesListRow.vala:47 52 | msgid "Click to toggle file" 53 | msgstr "Cliquez pour basculer le fichier" 54 | 55 | #: src/Widgets/WelcomePage.vala:29 56 | #: data/com.github.basjam.valacompiler.desktop.in:4 57 | msgid "Vala Compiler" 58 | msgstr "Compilateur Vala" 59 | 60 | #: src/Widgets/WelcomePage.vala:29 61 | msgid "A simple GUI for the command line valac" 62 | msgstr "Une simple interface graphique pour la ligne de commande valac" 63 | 64 | #: src/Widgets/WelcomePage.vala:35 65 | msgid "Source folder" 66 | msgstr "Dossier source" 67 | 68 | #: src/Widgets/WelcomePage.vala:35 69 | msgid "Open your source folder." 70 | msgstr "Ouvrir votre dossier source." 71 | 72 | #: src/Widgets/WelcomePage.vala:38 73 | msgid "Open last source folder" 74 | msgstr "Ouvrir le dernier dossier source" 75 | 76 | #: src/Widgets/ReportPage.vala:57 77 | msgid "Compile Report" 78 | msgstr "Rapport de compilation" 79 | 80 | #: src/Widgets/ReportPage.vala:58 81 | msgid "Live Test Report" 82 | msgstr "Rapport de test en temps réél" 83 | 84 | #: src/Widgets/ReportPage.vala:92 src/Widgets/ReportPage.vala:120 85 | #: src/Widgets/ReportPage.vala:132 86 | msgid "Clear Report" 87 | msgstr "Effacer le rapport" 88 | 89 | #: src/Widgets/ReportPage.vala:99 src/Widgets/ReportPage.vala:123 90 | #: src/Widgets/ReportPage.vala:135 91 | msgid "Undo Last Clear" 92 | msgstr "Annuler le dernier effacement" 93 | 94 | #: src/Widgets/OptionsSidebar.vala:55 src/Widgets/HeaderBar.vala:72 95 | msgid "Options" 96 | msgstr "Options" 97 | 98 | #: src/Widgets/OptionsSidebar.vala:63 src/Widgets/AddOptionsDialog.vala:39 99 | #: src/Widgets/AddOptionsDialog.vala:50 100 | msgid "Add options" 101 | msgstr "Ajouter des options" 102 | 103 | #: src/Widgets/OptionsSidebar.vala:72 104 | msgid "Clear all options" 105 | msgstr "Effacer toutes les options" 106 | 107 | #: src/Widgets/OptionsListRow.vala:43 108 | msgid "Remove option" 109 | msgstr "Enlever l'option" 110 | 111 | #: src/Widgets/OptionsListRow.vala:59 112 | msgid "Click to toggle option" 113 | msgstr "Cliquez pour basculer l'option" 114 | 115 | #: src/Widgets/AddOptionsDialog.vala:30 116 | msgid "Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0" 117 | msgstr "Entrez des options séparées par un espace ex : --pkg=granite --pkg=gtk+-3.0" 118 | 119 | #: src/Widgets/HeaderBar.vala:82 120 | msgid "Compile" 121 | msgstr "Compiler" 122 | 123 | #: src/Widgets/HeaderBar.vala:88 124 | msgid "Test the app" 125 | msgstr "Tester l'application" 126 | 127 | #: src/Widgets/HeaderBar.vala:97 128 | msgid "Kill all running tests" 129 | msgstr "Stopper tous les tests en cours" 130 | 131 | #: src/Widgets/HeaderBar.vala:152 132 | msgid "Welcome Page" 133 | msgstr "Pas d'accueil" 134 | 135 | #: src/Widgets/HeaderBar.vala:154 136 | msgid "Report Page" 137 | msgstr "Page de rapport" 138 | 139 | #: src/Widgets/HeaderBar.vala:163 140 | msgid "Project Page" 141 | msgstr "Page de projet" 142 | 143 | #: data/com.github.basjam.valacompiler.desktop.in:3 144 | #: data/com.github.basjam.valacompiler.appdata.xml.in:7 145 | msgid "ValaCompiler" 146 | msgstr "ValaCompiler" 147 | 148 | #: data/com.github.basjam.valacompiler.desktop.in:5 149 | msgid "A simple GUI for valac" 150 | msgstr "Une simple interface graphique pour valac" 151 | 152 | #: data/com.github.basjam.valacompiler.desktop.in:8 153 | msgid "com.github.basjam.valacompiler" 154 | msgstr "com.github.basjam.valacompiler" 155 | 156 | #: data/com.github.basjam.valacompiler.desktop.in:12 157 | msgid "Vala;Compiler;valacompiler;Valac;ValaC;" 158 | msgstr "Vala;Compilateur;valacompiler;Valac;ValaC;" 159 | 160 | #: data/com.github.basjam.valacompiler.appdata.xml.in:8 161 | msgid "A Simple GUI for valac" 162 | msgstr "Une simple interface graphique pour valac" 163 | 164 | #: data/com.github.basjam.valacompiler.appdata.xml.in:10 165 | msgid "" 166 | "A simple GUI for valac that is aimed at replacing the terminal use in vala " 167 | "development." 168 | msgstr "" 169 | "Une interface graphique simple pour valac qui remplace l'usage du terminal en vala " 170 | "développement." 171 | 172 | #: data/com.github.basjam.valacompiler.appdata.xml.in:15 173 | msgid "Basem Kheyar" 174 | msgstr "Basem Kheyar" 175 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | args: [ 3 | '--directory=' + meson.source_root(), 4 | '--from-code=UTF-8' 5 | ] 6 | ) 7 | -------------------------------------------------------------------------------- /screenshots/ValaCompiler-CompilerReport(ScreenShot).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basjam/ValaCompiler/17b50cefa727a95e73d1784a35d44d0f06a4ca2a/screenshots/ValaCompiler-CompilerReport(ScreenShot).png -------------------------------------------------------------------------------- /screenshots/ValaCompiler-ProjectPage(ScreenShot).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basjam/ValaCompiler/17b50cefa727a95e73d1784a35d44d0f06a4ca2a/screenshots/ValaCompiler-ProjectPage(ScreenShot).png -------------------------------------------------------------------------------- /screenshots/ValaCompiler-TestReport(ScreenShot).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basjam/ValaCompiler/17b50cefa727a95e73d1784a35d44d0f06a4ca2a/screenshots/ValaCompiler-TestReport(ScreenShot).png -------------------------------------------------------------------------------- /src/Application.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler { 18 | public Settings settings; 19 | 20 | public class App : Granite.Application { 21 | public Window window; 22 | public Utils.OptionsManager options_manager; 23 | public Widgets.OptionsListBox options_list_box; 24 | 25 | construct { 26 | program_name = "ValaCompiler"; 27 | exec_name = "com.github.basjam.ValaCompiler"; 28 | application_id = "com.github.basjam.ValaCompiler"; 29 | } 30 | 31 | public App () { 32 | settings = new Settings (); 33 | shutdown.connect (() => { 34 | window.shut_down (); 35 | }); 36 | } 37 | 38 | private static App app; 39 | public static App get_instance (){ 40 | if (app == null) 41 | app = new App (); 42 | return app; 43 | } 44 | 45 | public override void activate () { 46 | settings.project_location = ""; 47 | window = Window.get_instance (); 48 | window.application = this; 49 | window.title = program_name; 50 | 51 | } 52 | } 53 | } 54 | 55 | public static void main (string[] args){ 56 | var app = ValaCompiler.App.get_instance (); 57 | app.run (args); 58 | } 59 | -------------------------------------------------------------------------------- /src/Settings/Settings.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | public class ValaCompiler.Settings : Granite.Services.Settings { 18 | public string last_folder {get; set;} 19 | public string project_location {get; set;} 20 | public string[] valac_options {get; set;} 21 | public string custom_compile_options {get; set;} 22 | public bool gtk {get; set;} 23 | public bool granite {get; set;} 24 | public bool show_c_warnings {get; set;} 25 | public bool options_button {get; set;} 26 | 27 | public Settings () { 28 | base ("com.github.basjam.valacompiler"); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Utils/AppTester.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class AppTester { 19 | public signal void test_line_out (string line); 20 | public signal void test_done (); 21 | public signal void kill_test_signal (string kill_report); 22 | private string test_pids = ""; 23 | 24 | public bool test_running = false; 25 | public bool test_exists = false; 26 | 27 | public static AppTester instance = null; 28 | public static AppTester get_instance () { 29 | if (instance == null) { 30 | instance = new AppTester (); 31 | }; 32 | return instance; 33 | } 34 | 35 | public async void test_app () { 36 | try { 37 | string location = settings.project_location; 38 | string[] spawn_args = {"./valacompiler/valacompiler.test"}; 39 | string[] spawn_env = Environ.get (); 40 | Pid child_pid; 41 | 42 | int standard_input; 43 | int standard_output; 44 | int standard_error; 45 | 46 | Process.spawn_async_with_pipes ( 47 | location, 48 | spawn_args, 49 | spawn_env, 50 | SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD, 51 | null, 52 | out child_pid, 53 | out standard_input, 54 | out standard_output, 55 | out standard_error); 56 | 57 | test_pids += child_pid.to_string () + " "; 58 | 59 | IOChannel output = new IOChannel.unix_new (standard_output); 60 | output.add_watch (IOCondition.IN | IOCondition.HUP, (channel, condition) => { 61 | return process_line (channel, condition, "stdout"); 62 | }); 63 | 64 | IOChannel error = new IOChannel.unix_new (standard_error); 65 | error.add_watch (IOCondition.IN | IOCondition.HUP, (channel, condition) => { 66 | return process_line (channel, condition, "stderr"); 67 | }); 68 | 69 | ChildWatch.add (child_pid, (pid, status) => { 70 | Process.close_pid (pid); 71 | }); 72 | } catch (SpawnError e) { 73 | stdout.printf ("Error: %s\n", e.message); 74 | } 75 | return; 76 | } 77 | 78 | public bool process_line (IOChannel channel, IOCondition condition, string stream_name) { 79 | if (condition == IOCondition.HUP) { 80 | if (stream_name == "stdout"){ 81 | test_done(); 82 | //print ("ValaC: " + stream_name + " is done. \n"); 83 | }; 84 | if (stream_name == "stderr"){ 85 | //print ("ValaC: " + stream_name + " is done.\n"); 86 | } 87 | return false; 88 | } 89 | 90 | try { 91 | string line; 92 | channel.read_line (out line, null, null); 93 | test_line_out (line); 94 | //print ("ValaC: " + stream_name + ": " + line ); 95 | } catch (IOChannelError e) { 96 | stdout.printf ("%s: IOChannelError: %s\n", stream_name, e.message); 97 | } catch (ConvertError e) { 98 | stdout.printf ("%s: ConvertError: %s\n", stream_name, e.message); 99 | } 100 | return true; 101 | } 102 | 103 | public void kill_test () { 104 | if (check_test_running ()) { 105 | kill_test_signal (" - TEST was Killed.\n"); 106 | } else { 107 | kill_test_signal (" - There are no instances of TEST to kill. \n"); 108 | } 109 | 110 | string command = "kill " + test_pids; 111 | string stdout; 112 | string stderr; 113 | int status; 114 | 115 | try { 116 | Process.spawn_command_line_sync ( 117 | command, 118 | out stdout, 119 | out stderr, 120 | out status 121 | ); 122 | } catch (SpawnError e) { 123 | print ("Error: %s\n", e.message); 124 | } 125 | 126 | test_pids = ""; 127 | } 128 | 129 | public bool check_test_running () { 130 | string[] pids = test_pids.split (" "); 131 | 132 | string stdout; 133 | string stderr; 134 | int status; 135 | 136 | try { 137 | Process.spawn_command_line_sync ( 138 | "ps -e", 139 | out stdout, 140 | out stderr, 141 | out status 142 | ); 143 | } catch (SpawnError e) { 144 | print ("Error: %s\n", e.message); 145 | } 146 | 147 | foreach (string pid in pids) { 148 | if (stdout.contains (pid) && pid != "") { 149 | test_running = true; 150 | return true; 151 | } 152 | } 153 | test_running = false; 154 | return false; 155 | } 156 | 157 | public bool check_test_exists () { 158 | if (FileUtils.test (settings.project_location + "/valacompiler/valacompiler.test", GLib.FileTest.EXISTS)) { 159 | test_exists = true; 160 | return true; 161 | } else { 162 | test_exists = false; 163 | return false; 164 | } 165 | } 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/Utils/CompileManager.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class CompileManager { 19 | public Utils.ValaC valac; 20 | public FilesManager files_manager; 21 | public OptionsManager options_manager; 22 | public bool test_exists = false; 23 | 24 | 25 | public static CompileManager instance = null; 26 | public static CompileManager get_instance () { 27 | if (instance == null) { 28 | instance = new CompileManager (); 29 | }; 30 | return instance; 31 | } 32 | public CompileManager () { 33 | valac = Utils.ValaC.get_instance (); 34 | files_manager = Utils.FilesManager.get_instance (); 35 | options_manager = Utils.OptionsManager.get_instance (); 36 | } 37 | 38 | 39 | public void compile () { 40 | string[] files = files_manager.get_files (); 41 | string[] options = options_manager.get_options (); 42 | string[] args = {}; 43 | foreach (string file in files) { 44 | args += file; 45 | }; 46 | foreach (string option in options) { 47 | args += option; 48 | }; 49 | debug ("Beginning compile process"); 50 | valac.compile.begin (args); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Utils/File.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class File { 19 | private string file; 20 | private bool active; 21 | 22 | public File (string file_incoming, bool active_incoming) { 23 | this.file = file_incoming; 24 | this.active = active_incoming; 25 | } 26 | 27 | public string get_file () { 28 | return this.file; 29 | } 30 | 31 | public bool get_active () { 32 | return this.active; 33 | } 34 | 35 | public void set_active (bool active_incoming) { 36 | this.active = active_incoming; 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Utils/FileLister.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | 19 | public class FileLister { 20 | public signal void found_a_file (string file); 21 | public signal void listing_files_done (); 22 | 23 | public ValaCompiler.Utils.FilesManager files_manager; 24 | 25 | public static FileLister instance = null; 26 | public static FileLister get_instance () { 27 | if (instance == null) { 28 | instance = new FileLister (); 29 | }; 30 | return instance; 31 | } 32 | 33 | public async void scan_files (string location) { 34 | try { 35 | string[] spawn_args = {"ls", "-B", "-R", "--file-type"}; 36 | string[] spawn_env = Environ.get (); 37 | Pid child_pid; 38 | 39 | int standard_error; 40 | int standard_output; 41 | int standard_input; 42 | 43 | Process.spawn_async_with_pipes ( 44 | location, 45 | spawn_args, 46 | spawn_env, 47 | SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD, 48 | null, 49 | out child_pid, 50 | out standard_input, 51 | out standard_output, 52 | out standard_error); 53 | 54 | // stdout: 55 | IOChannel output = new IOChannel.unix_new (standard_output); 56 | output.add_watch (IOCondition.IN | IOCondition.HUP, (channel, 57 | condition) => { 58 | return process_line (channel, condition, "stdout"); 59 | }); 60 | 61 | // stderr: 62 | IOChannel error = new IOChannel.unix_new 63 | (standard_error); 64 | error.add_watch (IOCondition.IN | IOCondition.HUP, 65 | (channel, condition) => { 66 | return process_line (channel, condition, "stderr"); 67 | }); 68 | 69 | ChildWatch.add (child_pid, (pid, status) => { 70 | Process.close_pid (pid); 71 | }); 72 | } catch (SpawnError e) { 73 | stdout.printf ("Error: %s\n", e.message); 74 | } 75 | return; 76 | } 77 | 78 | public bool process_line (IOChannel channel, 79 | IOCondition condition, string stream_name) { 80 | if (condition == IOCondition.HUP) { 81 | 82 | if (stream_name == "stdout"){ 83 | listing_files_done (); 84 | }; 85 | //stdout.printf ("check 2 \n"); 86 | return false; 87 | } 88 | 89 | try { 90 | string line; 91 | channel.read_line (out line, null, null); 92 | 93 | found_a_file (line.to_string ()); 94 | } catch (IOChannelError e) { 95 | stdout.printf ("%s: IOChannelError: %s\n", 96 | stream_name, e.message); 97 | return false; 98 | } catch (ConvertError e) { 99 | stdout.printf ("%s: ConvertError: %s\n", 100 | stream_name, e.message); 101 | return false; 102 | } 103 | return true; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/Utils/FilesManager.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class FilesManager : GLib.Object { 19 | private string location = null; 20 | 21 | public signal void start_project (string location); 22 | public signal void files_array_ready (); 23 | public signal void compile_done (); 24 | 25 | public Utils.FileLister file_lister; 26 | 27 | public Widgets.FilesListBox files_list_box; 28 | 29 | private string[] dirty_files_string_array = {}; 30 | private string[] files_string_array = {}; 31 | 32 | 33 | 34 | public static FilesManager instance = null; 35 | public static FilesManager get_instance () { 36 | if (instance == null) { 37 | instance = new FilesManager (); 38 | }; 39 | return instance; 40 | } 41 | 42 | public FilesManager () { 43 | file_lister = Utils.FileLister.get_instance (); 44 | file_lister.found_a_file.connect ((file_string) => { 45 | add_file (file_string); 46 | }); 47 | file_lister.listing_files_done.connect (() => { 48 | clean_up_files_list (); 49 | }); 50 | 51 | files_list_box = Widgets.FilesListBox.get_instance (); 52 | } 53 | 54 | public void clean_up_files_list () { 55 | 56 | string[] temp_files_string_array = {}; 57 | string[] temp2_files_string_array = {}; 58 | string parent_folder = ""; 59 | string temp_file_string = ""; 60 | 61 | //Remove empty and unecessary strings 62 | foreach (string file_string in dirty_files_string_array) { 63 | file_string = file_string.strip (); 64 | if (!(file_string.has_suffix ("*") || 65 | file_string.has_suffix (".:") || 66 | file_string.has_suffix ("/") || file_string == "")) { 67 | temp_files_string_array += file_string; 68 | }; 69 | }; 70 | 71 | //Arrange files inro hierarchy & Remove parents from list 72 | foreach (string file_string in temp_files_string_array) { 73 | if (file_string.has_prefix ("./")) { 74 | 75 | parent_folder = file_string.slice (2, file_string.length - 1) + "/"; 76 | } else { 77 | temp_file_string = parent_folder + file_string; 78 | temp2_files_string_array += temp_file_string; 79 | }; 80 | }; 81 | 82 | //Only keep .vala .vapi .gs. and .c files 83 | foreach (string file_string in temp2_files_string_array) { 84 | if (file_string.has_suffix (".vala") || 85 | file_string.has_suffix (".vapi") || 86 | file_string.has_suffix (".gs") || 87 | file_string.has_suffix (".c")) { 88 | files_string_array += file_string; 89 | }; 90 | }; 91 | 92 | dirty_files_string_array = {}; 93 | populate_files_list_box (); 94 | } 95 | 96 | public void populate_files_list_box () { 97 | files_list_box = Widgets.FilesListBox.get_instance (); 98 | files_list_box.populate (files_string_array); 99 | } 100 | 101 | public void add_file (string file){ 102 | dirty_files_string_array += file; 103 | return; 104 | } 105 | 106 | public void list_files () { 107 | location = settings.project_location; 108 | debug ("starting file_lister.scan"); 109 | file_lister.scan_files.begin (location); 110 | } 111 | 112 | public string[] get_files () { 113 | return convert_to_string (files_list_box.get_files ()); 114 | } 115 | 116 | public string[] convert_to_string (Utils.File[] file_objects) { 117 | string[] converted = {}; 118 | foreach (Utils.File file in file_objects) { 119 | if (file.get_active ()) { 120 | converted += file.get_file (); 121 | }; 122 | }; 123 | 124 | return converted; 125 | } 126 | 127 | public void clear_files () { 128 | files_list_box = Widgets.FilesListBox.get_instance (); 129 | files_list_box.clear_files (); 130 | 131 | dirty_files_string_array = {}; 132 | files_string_array = {}; 133 | } 134 | 135 | public void compile () { 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/Utils/Option.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2018 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class Option { 19 | public string option {set; get;} 20 | public bool active {set; get;} 21 | 22 | public Option (string option_incoming, bool active_incoming) { 23 | this.option = option_incoming; 24 | this.active = active_incoming; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Utils/OptionsManager.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2018 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class OptionsManager { 19 | public string location; 20 | public Widgets.OptionsListBox options_list_box; 21 | 22 | private Utils.Option[] options_object_array; 23 | private string[] options_string_array; 24 | 25 | public static OptionsManager instance = null; 26 | public static OptionsManager get_instance () { 27 | if (instance == null) { 28 | instance = new OptionsManager (); 29 | }; 30 | return instance; 31 | } 32 | 33 | public OptionsManager () { 34 | } 35 | 36 | public void start_project () { 37 | location = settings.project_location; 38 | options_list_box = Widgets.OptionsListBox.get_instance (); 39 | options_list_box.set_options (load_options ()); 40 | } 41 | 42 | private Utils.Option[] load_options () { 43 | string[] processed_options = {}; 44 | string options_raw = ""; 45 | 46 | if (FileUtils.test (location + "/valacompiler/valacompiler.options", 47 | GLib.FileTest.EXISTS)) { 48 | try { 49 | FileUtils.get_contents (location + 50 | "/valacompiler/valacompiler.options", out options_raw); 51 | processed_options = process_options (options_raw); 52 | } catch (FileError e){ 53 | debug (e.message); 54 | } 55 | } else { 56 | debug (location + 57 | "\nOptionsManager: there is no valacompiler.options file.\n"); 58 | } 59 | options_object_array = convert_to_objects (processed_options); 60 | return options_object_array; 61 | } 62 | 63 | private string[] process_options (string raw) { 64 | //clean up the raw string 65 | string raw_temp = raw.strip (); 66 | raw_temp = raw_temp.escape (); 67 | //split into items by comma "," and save them in the local 68 | return raw_temp.split (","); 69 | } 70 | 71 | public Utils.Option[] convert_to_objects (string[] options_incoming) { 72 | //read options so that "<<>>" means option not active. 73 | Utils.Option[] temp_options_object_array = null; 74 | foreach (string option_string in options_incoming) { 75 | bool active = true; 76 | //Check and remove "&&" if it exists 77 | if (option_string.has_prefix ("<<>>")) { 78 | active = false; 79 | option_string = option_string.replace ("<<>>", ""); 80 | }; 81 | 82 | Utils.Option option_object = new Utils.Option (option_string, active); 83 | temp_options_object_array += option_object; 84 | }; 85 | return temp_options_object_array; 86 | } 87 | 88 | public string[] convert_to_string (Utils.Option[] options_incoming) { 89 | string[] temp_options_string_array = null; 90 | foreach (Utils.Option option_incoming in options_incoming) { 91 | string temp_option_string = null; 92 | //Add "&&" for not compilable files 93 | if (!option_incoming.active) { 94 | temp_option_string = "<<>>" + option_incoming.option; 95 | } else { 96 | temp_option_string = option_incoming.option; 97 | }; 98 | temp_options_string_array += temp_option_string; 99 | }; 100 | return temp_options_string_array; 101 | } 102 | 103 | public void clear_options_list () { 104 | options_string_array = {}; 105 | options_object_array = {}; 106 | options_list_box.set_options (null); 107 | location = ""; 108 | } 109 | 110 | public void save_options () { 111 | //Build the string_array from objects_array from options_list_box 112 | options_list_box = Widgets.OptionsListBox.get_instance (); 113 | options_object_array = options_list_box.get_options (); 114 | options_string_array = convert_to_string (options_object_array); 115 | string to_be_saved = string.joinv (",", options_string_array); 116 | 117 | DirUtils.create_with_parents (location + "/valacompiler", 509 ); 118 | 119 | try { 120 | FileUtils.set_contents (location + "/valacompiler/valacompiler.options", to_be_saved); 121 | } catch (FileError e) { 122 | debug ("Banana" + e.message); 123 | }; 124 | } 125 | 126 | public string[] get_options () { 127 | save_options (); 128 | string[] active_options_string_array = {}; 129 | foreach (string option in options_string_array) { 130 | if (!option.has_prefix ("<<>>")) { 131 | active_options_string_array += option; 132 | }; 133 | } 134 | return active_options_string_array; 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/Utils/ReportsManager.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2018 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class ReportsManager { 19 | 20 | public Utils.ValaC valac; 21 | public Utils.AppTester app_tester; 22 | 23 | public static ReportsManager instance = null; 24 | public static ReportsManager get_instance () { 25 | if (instance == null) { 26 | instance = new ReportsManager (); 27 | }; 28 | return instance; 29 | } 30 | 31 | public ReportsManager () { 32 | app_tester = Utils.AppTester.get_instance (); 33 | app_tester.test_line_out.connect ((line) => { 34 | test_line_out (line); 35 | }); 36 | valac = Utils.ValaC.get_instance (); 37 | valac.compile_line_out.connect ((line) => { 38 | compile_line_out (line); 39 | }); 40 | } 41 | 42 | public void compile_line_out (string line) { 43 | parse_compile_line (line); 44 | } 45 | 46 | public void test_line_out (string line) { 47 | debug ("test-line-out: %s", line); 48 | } 49 | 50 | public void parse_compile_line (string line) { 51 | 52 | } 53 | 54 | 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Utils/ValaC.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Utils { 18 | public class ValaC { 19 | public signal void compile_line_out (string line); 20 | public signal void compile_done (); 21 | 22 | public static ValaC instance = null; 23 | public static ValaC get_instance () { 24 | if (instance == null) { 25 | instance = new ValaC (); 26 | }; 27 | return instance; 28 | } 29 | 30 | public async void compile (string[] args) { 31 | string location = settings.project_location; 32 | DirUtils.create_with_parents (location + "/valacompiler", 509 ); 33 | try { 34 | string[] spawn_args = {"valac", "--output=valacompiler/valacompiler.test"}; 35 | foreach (string arg in args) { 36 | spawn_args += arg; 37 | }; 38 | string[] spawn_env = Environ.get (); 39 | Pid child_pid; 40 | 41 | int standard_input; 42 | int standard_output; 43 | int standard_error; 44 | 45 | Process.spawn_async_with_pipes ( 46 | location, 47 | spawn_args, 48 | spawn_env, 49 | SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD, 50 | null, 51 | out child_pid, 52 | out standard_input, 53 | out standard_output, 54 | out standard_error); 55 | 56 | IOChannel output = new IOChannel.unix_new (standard_output); 57 | output.add_watch (IOCondition.IN | IOCondition.HUP, (channel, condition) => { 58 | return process_line (channel, condition, "stdout"); 59 | }); 60 | 61 | IOChannel error = new IOChannel.unix_new (standard_error); 62 | error.add_watch (IOCondition.IN | IOCondition.HUP, (channel, condition) => { 63 | return process_line (channel, condition, "stderr"); 64 | }); 65 | 66 | ChildWatch.add (child_pid, (pid, status) => { 67 | Process.close_pid (pid); 68 | }); 69 | } catch (SpawnError e) { 70 | stdout.printf ("Error: %s\n", e.message); 71 | } 72 | return; 73 | } 74 | 75 | public bool process_line (IOChannel channel, IOCondition condition, string stream_name) { 76 | if (condition == IOCondition.HUP) { 77 | if (stream_name == "stdout"){ 78 | compile_done (); 79 | //print ("ValaC: " + stream_name + " is done. \n"); 80 | }; 81 | if (stream_name == "stderr"){ 82 | //print ("ValaC: " + stream_name + " is done.\n"); 83 | } 84 | return false; 85 | } 86 | 87 | try { 88 | string line; 89 | channel.read_line (out line, null, null); 90 | compile_line_out (line); 91 | //print (line); 92 | //print ("ValaC: " + stream_name + ": " + line ); 93 | } catch (IOChannelError e) { 94 | stdout.printf ("%s: IOChannelError: %s\n", stream_name, e.message); 95 | } catch (ConvertError e) { 96 | stdout.printf ("%s: ConvertError: %s\n", stream_name, e.message); 97 | } 98 | return true; 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/Widgets/AddOptionsDialog.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class AddOptionsDialog : Gtk.Dialog { 19 | private Gtk.Entry options_entry; 20 | private Gtk.Button add_options_button; 21 | 22 | public signal void signal_add_options (string[] options); 23 | 24 | public AddOptionsDialog () { 25 | this.border_width = 6; 26 | build_ui (); 27 | } 28 | 29 | public void build_ui () { 30 | var label = new Gtk.Label (_("Enter options separated by a space eg: --pkg=granite --pkg=gtk+-3.0")); 31 | 32 | options_entry = new Gtk.Entry (); 33 | options_entry.activate.connect (() => { 34 | add_options (); 35 | }); 36 | 37 | add_options_button = new Gtk.Button.from_icon_name ("list-add", Gtk.IconSize.SMALL_TOOLBAR); 38 | add_options_button.relief = Gtk.ReliefStyle.NONE; 39 | add_options_button.tooltip_text = _("Add options"); 40 | add_options_button.clicked.connect (() => { 41 | add_options (); 42 | }); 43 | 44 | var box = get_content_area () as Gtk.Box; 45 | box.add (label); 46 | box.add (options_entry); 47 | 48 | var headerbar = new Gtk.HeaderBar (); 49 | headerbar.subtitle = _("Add options"); 50 | headerbar.show_close_button = true; 51 | headerbar.pack_end (add_options_button); 52 | 53 | this.set_titlebar (headerbar); 54 | 55 | var window = Window.get_instance (); 56 | this.set_transient_for (window); 57 | } 58 | 59 | private void add_options () { 60 | string[] options = parse_options (options_entry.text);; 61 | signal_add_options (options); 62 | destroy (); 63 | } 64 | 65 | private string[] parse_options (string text) { 66 | string[] options_temp = text.split (" "); 67 | string[] options = null; 68 | //next step is to remove items added accidentaly by a multiple spaces in a row 69 | foreach (string option in options_temp) { 70 | if (option != "") { 71 | options += option; 72 | }; 73 | }; 74 | return options; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Widgets/FilesListBox.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class FilesListBox : Gtk.Box { 19 | public Utils.FilesManager files_manager; 20 | public Widgets.ProjectPage project_page; 21 | public Widgets.FilesListRow row; 22 | public Gtk.Label file_title; 23 | public Gtk.Box files_list_box; 24 | 25 | private string[] files_string_array; 26 | private Utils.File[] files_object_array; 27 | 28 | public static FilesListBox instance = null; 29 | public static FilesListBox get_instance () { 30 | if (instance == null) { 31 | instance = new FilesListBox (); 32 | }; 33 | return instance; 34 | } 35 | 36 | construct { 37 | } 38 | 39 | public FilesListBox () { 40 | this.orientation = Gtk.Orientation.VERTICAL; 41 | } 42 | //instance retriever with a boolean to create a new instance 43 | 44 | 45 | public void populate (string[] files_string_array_incoming) { 46 | files_string_array = files_string_array_incoming; 47 | build_ui (); 48 | } 49 | 50 | public void build_ui () { 51 | this.margin = 0; 52 | //row_list = new List (); 53 | 54 | //var event_box = new Gtk.EventBox (); 55 | 56 | 57 | //TOP TITLE REGION; 58 | file_title = new Gtk.Label (_("Files")); 59 | file_title.tooltip_text = _("Toggle files to be compiled"); 60 | file_title.halign = Gtk.Align.START; 61 | file_title.margin = 6; 62 | file_title.margin_left = 50; 63 | file_title.ellipsize = Pango.EllipsizeMode.END; 64 | 65 | //FILES REGION 66 | files_list_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 67 | 68 | var files_scroll = new Gtk.ScrolledWindow (null, null); 69 | files_scroll.expand = true; 70 | files_scroll.kinetic_scrolling = true; 71 | files_scroll.add (files_list_box); 72 | files_scroll.get_style_context ().add_class (Gtk.STYLE_CLASS_BACKGROUND); 73 | 74 | //BOTTOM PART 75 | this.pack_start (file_title, false, false, 0); 76 | this.pack_start (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), false, false, 0); 77 | this.pack_start (files_scroll, true, true, 0); 78 | 79 | populate_row_list (); 80 | 81 | var change_location_button = new Gtk.Button.from_icon_name ("folder-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 82 | change_location_button.relief = Gtk.ReliefStyle.NONE; 83 | change_location_button.hexpand = false; 84 | change_location_button.halign = Gtk.Align.START; 85 | change_location_button.tooltip_text = _("Change source folder"); 86 | change_location_button.clicked.connect (() => { 87 | var window = Window.get_instance (); 88 | window.run_open_folder (); 89 | }); 90 | 91 | 92 | var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 93 | button_box.pack_start (change_location_button, false, true, 0); 94 | 95 | //FINISHING 96 | this.pack_end (button_box, false, true, 0); 97 | this.show_all(); 98 | } 99 | 100 | public void populate_row_list () { 101 | foreach (string file in files_string_array) { 102 | var files_list_row = new Widgets.FilesListRow (file); 103 | files_list_row.active_changed.connect ((file_incoming, active_incoming) => { 104 | active_changed (file_incoming, active_incoming); 105 | }); 106 | 107 | 108 | files_object_array += new Utils.File (file, true); 109 | 110 | 111 | files_list_box.add (files_list_row); 112 | }; 113 | } 114 | 115 | public void active_changed (string file_incoming, bool active_incoming) { 116 | foreach (Utils.File file in files_object_array) { 117 | if (file.get_file() == file_incoming) { 118 | file.set_active (active_incoming); 119 | }; 120 | } 121 | } 122 | 123 | public Utils.File[] get_files () { 124 | return this.files_object_array; 125 | } 126 | 127 | public void clear_files () { 128 | this.get_children ().foreach ((child) => { 129 | child.destroy (); 130 | }); 131 | 132 | files_object_array = {}; 133 | files_string_array = {}; 134 | } 135 | } 136 | } 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/Widgets/FilesListRow.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class FilesListRow : Gtk.Box { 19 | public Gtk.ToggleButton toggle_button; 20 | public Gtk.Image active_icon; 21 | 22 | private string file; 23 | private bool active; 24 | 25 | public signal void active_changed (string file, bool active); 26 | 27 | public FilesListRow (string file_incoming) { 28 | this.file = file_incoming; 29 | this.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); 30 | this.orientation = Gtk.Orientation.HORIZONTAL; 31 | this.spacing = 0; 32 | this.hexpand = true; 33 | this.active = true; 34 | 35 | active_icon = new Gtk.Image (); 36 | update_active_icon (); 37 | active_icon.halign = Gtk.Align.FILL; 38 | active_icon.margin_top = 5; 39 | active_icon.margin_bottom = 7; 40 | active_icon.margin_left = 12; 41 | 42 | toggle_button = new Gtk.ToggleButton.with_mnemonic (file); 43 | toggle_button.draw_indicator = true; 44 | toggle_button.xalign = 0; 45 | toggle_button.image = active_icon; 46 | toggle_button.always_show_image = true; 47 | toggle_button.tooltip_text = _("Click to toggle file"); 48 | toggle_button.toggled.connect (() => { 49 | this.active = toggle_button.active; 50 | active_changed (file, active); 51 | update_active_icon (); 52 | }); 53 | 54 | this.pack_start (toggle_button, true, true, 0); 55 | } 56 | 57 | public bool get_active () { 58 | return this.active; 59 | } 60 | 61 | public string get_file () { 62 | return this.file; 63 | } 64 | 65 | public void update_active_icon () { 66 | if (active) { 67 | active_icon.set_from_icon_name ("user-available", Gtk.IconSize.DND); 68 | } else { 69 | active_icon.set_from_icon_name ("user-busy", Gtk.IconSize.DND); 70 | }; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Widgets/HeaderBar.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class HeaderBar : Gtk.HeaderBar { 19 | public Gtk.Button forward_button; 20 | public Gtk.Button back_button; 21 | public Gtk.Button compile_button; 22 | public Gtk.Button test_button; 23 | public Gtk.Button kill_test_button; 24 | public Gtk.ToggleButton options_button; 25 | 26 | public Widgets.MainStack main_stack; 27 | public Widgets.ProjectPage project_page; 28 | public Utils.AppTester app_tester; 29 | public Utils.CompileManager compile_manager; 30 | public Utils.ValaC valac; 31 | 32 | public static HeaderBar instance = null; 33 | public static HeaderBar get_instance () { 34 | if (instance == null) { 35 | instance = new HeaderBar (); 36 | }; 37 | return instance; 38 | } 39 | 40 | 41 | 42 | construct { 43 | app_tester = Utils.AppTester.get_instance (); 44 | app_tester.test_done.connect (() => { 45 | update_buttons (); 46 | }); 47 | compile_manager = Utils.CompileManager.get_instance (); 48 | valac = Utils.ValaC.get_instance (); 49 | valac.compile_done.connect (() => { 50 | check_test_ready (); 51 | }); 52 | project_page = Widgets.ProjectPage.get_instance (); 53 | 54 | this.set_show_close_button (true); 55 | this.height_request = 47; 56 | 57 | back_button = new Gtk.Button.from_icon_name ("go-previous-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 58 | back_button.clicked.connect (() => { 59 | navigate ("back"); 60 | }); 61 | this.pack_start (back_button); 62 | 63 | forward_button = new Gtk.Button.from_icon_name ("go-next-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 64 | forward_button.clicked.connect (() => { 65 | navigate ("forward"); 66 | }); 67 | this.pack_start (forward_button); 68 | 69 | options_button = new Gtk.ToggleButton (); 70 | options_button.active = settings.options_button; 71 | options_button.image = new Gtk.Image.from_icon_name ("open-menu", Gtk.IconSize.LARGE_TOOLBAR); 72 | options_button.tooltip_text = _("Options"); 73 | options_button.toggled.connect (() => { 74 | options_toggled (); 75 | }); 76 | this.pack_end (options_button); 77 | 78 | compile_button = new Gtk.Button.from_icon_name ("applications-development-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 79 | compile_button.clicked.connect (() => { 80 | compile (); 81 | }); 82 | compile_button.tooltip_text = _("Compile"); 83 | this.pack_end (compile_button); 84 | 85 | 86 | 87 | test_button = new Gtk.Button.from_icon_name ("media-playback-start-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 88 | test_button.tooltip_text = _("Test the app"); 89 | test_button.clicked.connect (() => { 90 | test_app (); 91 | navigate ("test-report"); 92 | }); 93 | 94 | this.pack_end (test_button); 95 | 96 | kill_test_button = new Gtk.Button.from_icon_name ("process-stop", Gtk.IconSize.LARGE_TOOLBAR); 97 | kill_test_button.tooltip_text = _("Kill all running tests"); 98 | kill_test_button.clicked.connect (() => { 99 | kill_test (); 100 | }); 101 | 102 | this.pack_start (kill_test_button); 103 | } 104 | 105 | public void navigate (string instruction) { 106 | main_stack = Widgets.MainStack.get_instance (); 107 | main_stack.navigate (instruction); 108 | } 109 | 110 | public void options_toggled () { 111 | settings.options_button = options_button.active; 112 | project_page.toggle_options (); 113 | } 114 | 115 | public void compile () { 116 | compile_manager.compile (); 117 | navigate ("compile-report"); 118 | } 119 | 120 | public void test_app () { 121 | app_tester.test_app.begin (); 122 | update_buttons (); 123 | navigate ("test-report"); 124 | } 125 | 126 | public void kill_test () { 127 | app_tester.kill_test (); 128 | update_buttons (); 129 | } 130 | 131 | public void update_buttons () { 132 | app_tester = Utils.AppTester.get_instance (); 133 | kill_test_button.visible = app_tester.check_test_running (); 134 | kill_test_button.sensitive = app_tester.check_test_running (); 135 | 136 | test_button.sensitive = app_tester.check_test_exists (); 137 | 138 | main_stack = Widgets.MainStack.get_instance (); 139 | string page = main_stack.get_page (); 140 | switch (page) { 141 | case "welcome": 142 | subtitle = null; 143 | back_button.hide (); 144 | forward_button.hide (); 145 | compile_button.hide (); 146 | test_button.hide (); 147 | options_button.hide (); 148 | break; 149 | case "project": 150 | subtitle = "(" + settings.project_location + ")"; 151 | back_button.show (); 152 | back_button.tooltip_text = _("Welcome Page"); 153 | forward_button.show (); 154 | forward_button.tooltip_text = _("Report Page"); 155 | forward_button.sensitive = true; 156 | compile_button.show (); 157 | compile_button.sensitive = true; 158 | check_test_ready (); 159 | options_button.show (); 160 | break; 161 | case "report": 162 | subtitle = "(" + settings.project_location + ")"; 163 | back_button.tooltip_text = _("Project Page"); 164 | back_button.show (); 165 | forward_button.show (); 166 | forward_button.sensitive = false; 167 | forward_button.tooltip_text = ""; 168 | check_test_ready (); 169 | options_button.hide (); 170 | break; 171 | }; 172 | } 173 | 174 | public void check_test_ready () { 175 | app_tester = Utils.AppTester.get_instance (); 176 | test_button.sensitive = app_tester.check_test_exists (); 177 | test_button.visible = app_tester.check_test_exists (); 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/Widgets/MainStack.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class MainStack : Gtk.Stack { 19 | public Widgets.HeaderBar header; 20 | public Utils.FilesManager files_manager; 21 | public Widgets.WelcomePage welcome_page; 22 | public Widgets.ReportPage report_page; 23 | public App app; 24 | 25 | public static MainStack instance = null; 26 | public static MainStack get_instance () { 27 | if (instance == null) { 28 | instance = new MainStack (); 29 | } 30 | return instance; 31 | } 32 | 33 | construct { 34 | header = Widgets.HeaderBar.get_instance (); 35 | 36 | this.expand = true; 37 | this.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; 38 | 39 | } 40 | 41 | public void navigate (string instruction) { 42 | switch (instruction) { 43 | case "back": 44 | switch (get_page ()) { 45 | case "project": 46 | show_welcome_page (); 47 | break; 48 | case "report": 49 | show_project_page (); 50 | break; 51 | }; 52 | break; 53 | case "forward": 54 | show_report_page (null); 55 | break; 56 | case "compile-report": 57 | show_report_page ("compile"); 58 | break; 59 | case "test-report": 60 | show_report_page ("test"); 61 | break; 62 | 63 | }; 64 | } 65 | 66 | public string get_page () { 67 | return this.get_visible_child_name (); 68 | } 69 | 70 | public void show_project_page () { 71 | this.set_visible_child_name ("project"); 72 | header.update_buttons (); 73 | } 74 | 75 | 76 | public void show_report_page (string? panel) { 77 | this.set_visible_child_name ("report"); 78 | report_page = Widgets.ReportPage.get_instance (); 79 | 80 | if (panel == "compile") { 81 | report_page.view_button.set_active (0); 82 | } else if (panel == "test") { 83 | report_page.view_button.set_active (1); 84 | } 85 | 86 | header.update_buttons (); 87 | } 88 | 89 | 90 | public void show_welcome_page () { 91 | this.set_visible_child_name ("welcome"); 92 | header.update_buttons (); 93 | 94 | files_manager = Utils.FilesManager.get_instance (); 95 | files_manager.clear_files (); 96 | 97 | welcome_page = Widgets.WelcomePage.get_instance (); 98 | welcome_page.refresh (); 99 | 100 | app = App.get_instance (); 101 | header.title = app.program_name; 102 | } 103 | 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Widgets/OptionsListBox.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class OptionsListBox : Gtk.Box { 19 | 20 | private Utils.Option[] options_object_array; 21 | 22 | public Utils.OptionsManager options_manager; 23 | 24 | public OptionsListBox () { 25 | this.orientation = Gtk.Orientation.VERTICAL; 26 | this.margin = 0; 27 | this.expand = true; 28 | 29 | } 30 | 31 | public static OptionsListBox instance = null; 32 | public static OptionsListBox get_instance () { 33 | if (instance == null) { 34 | instance = new OptionsListBox (); 35 | }; 36 | return instance; 37 | } 38 | 39 | public void set_options (Utils.Option[]? options_incoming) { 40 | if (options_incoming == null) { 41 | this.options_object_array = {}; 42 | } else { 43 | this.options_object_array = options_incoming; 44 | } 45 | refresh_list (); 46 | } 47 | 48 | private void refresh_list () { 49 | 50 | clear_list (); 51 | foreach (Utils.Option option in options_object_array) { 52 | //make & display a new row from each option in local Utils.option 53 | var option_row = new Widgets.OptionListRow (option); 54 | this.add (option_row); 55 | 56 | //Link change in row active state with local Utils.Option[] options 57 | option_row.active_changed.connect ((option, active) => { 58 | option_active_change (option, active); 59 | }); 60 | 61 | //Link row removal with local Utils.Option[] options 62 | option_row.option_removed.connect ((option_string) => { 63 | remove_option (option_string); 64 | option_row.destroy (); 65 | }); 66 | }; 67 | show_all (); 68 | } 69 | 70 | private void option_active_change (string option_incoming, bool active_incoming) { 71 | //go through local Utils.Option and if strings match, match active_incoming 72 | foreach (Utils.Option option_sift in options_object_array) { 73 | if (option_sift.option == option_incoming) { 74 | option_sift.active = active_incoming; 75 | }; 76 | }; 77 | } 78 | 79 | private void remove_option (string option_string_incoming) { 80 | //go through local Utils.Option[]. If strings match, remove 81 | Utils.Option[] temp_options_object_array = {}; 82 | foreach (Utils.Option option_sift in options_object_array) { 83 | if (option_sift.option != option_string_incoming) { 84 | temp_options_object_array += option_sift; 85 | }; 86 | }; 87 | options_object_array = temp_options_object_array; 88 | } 89 | 90 | private void clear_list () { 91 | this.get_children ().foreach ((row) => { 92 | this.remove (row); 93 | row.destroy (); 94 | }); 95 | } 96 | 97 | public Utils.Option[] get_options () { 98 | return options_object_array; 99 | } 100 | 101 | public void add_options (string[] options_incoming) { 102 | options_manager = Utils.OptionsManager.get_instance (); 103 | Utils.Option[] options_object_array_temp = options_manager.convert_to_objects (options_incoming); 104 | 105 | foreach (Utils.Option option in options_object_array_temp) { 106 | options_object_array += option; 107 | }; 108 | 109 | set_options (options_object_array); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/Widgets/OptionsListRow.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class OptionListRow : Gtk.Box { 19 | public Gtk.Button remove_button; 20 | public Gtk.ToggleButton toggle_button; 21 | public Gtk.Image active_icon; 22 | private string option; 23 | private bool active; 24 | 25 | public signal void option_removed (string option); 26 | public signal void active_changed (string option, bool active); 27 | 28 | public OptionListRow (Utils.Option option_incoming) { 29 | this.active = option_incoming.active; 30 | this.margin_top = 0; 31 | this.margin_bottom = 3; 32 | this.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); 33 | this.orientation = Gtk.Orientation.HORIZONTAL; 34 | this.spacing = 0; 35 | this.hexpand = true; 36 | this.option = option_incoming.option; 37 | 38 | 39 | remove_button = new Gtk.Button.from_icon_name ("list-remove", Gtk.IconSize.LARGE_TOOLBAR); 40 | remove_button.margin_top = 1; 41 | remove_button.margin_bottom = 2; 42 | remove_button.relief = Gtk.ReliefStyle.NONE; 43 | remove_button.tooltip_text = _("Remove option"); 44 | remove_button.clicked.connect (() => { 45 | option_removed (option); 46 | }); 47 | 48 | 49 | active_icon = new Gtk.Image (); 50 | check_active_icon (); 51 | active_icon.halign = Gtk.Align.START; 52 | 53 | toggle_button = new Gtk.ToggleButton.with_mnemonic (option); 54 | toggle_button.active = option_incoming.active; 55 | toggle_button.xalign = 0; 56 | toggle_button.draw_indicator = true; 57 | toggle_button.image = active_icon; 58 | toggle_button.always_show_image = true; 59 | toggle_button.tooltip_text = _("Click to toggle option"); 60 | toggle_button.toggled.connect (() => { 61 | this.active = toggle_button.active; 62 | active_changed (option, active); 63 | check_active_icon (); 64 | }); 65 | 66 | this.pack_start (toggle_button, true, true, 0); 67 | this.pack_end (remove_button, false, false, 0); 68 | this.width_request = 180; 69 | 70 | } 71 | 72 | public bool get_active () { 73 | return this.active; 74 | } 75 | 76 | public string get_option () { 77 | return this.option; 78 | } 79 | 80 | public void check_active_icon () { 81 | if (active) { 82 | active_icon.set_from_icon_name ("user-available", Gtk.IconSize.DND); 83 | } else { 84 | active_icon.set_from_icon_name ("user-busy", Gtk.IconSize.DND); 85 | }; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/Widgets/OptionsSidebar.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class OptionsSidebar : Gtk.Box { 19 | public Gtk.Box options_pane; 20 | public Gtk.Box options_checkbutton_box; 21 | public Gtk.Label options_label; 22 | public bool toggle_options_pane; 23 | public Gtk.Stack options_pane_stack; 24 | 25 | public Widgets.AddOptionsDialog add_options_dialog; 26 | public Widgets.OptionsListBox options_list_box; 27 | 28 | public Utils.OptionsManager options_manager; 29 | 30 | construct { 31 | this.orientation = Gtk.Orientation.VERTICAL; 32 | this.margin = 0; 33 | this.halign = Gtk.Align.END; 34 | this.valign = Gtk.Align.FILL; 35 | this.resize_mode = Gtk.ResizeMode.PARENT; 36 | 37 | 38 | options_pane_stack = new Gtk.Stack (); 39 | options_pane_stack.hexpand = true; 40 | options_pane_stack.transition_duration = 350; 41 | options_pane_stack.width_request = 1; 42 | 43 | var nothing_grid = new Gtk.Grid (); 44 | nothing_grid.width_request = 0; 45 | options_pane_stack.add_named (nothing_grid, "nothing"); 46 | 47 | options_pane = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 48 | options_pane.hexpand = true; 49 | options_pane.margin_right = 0; 50 | options_pane.pack_end (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), false, false,0); 51 | 52 | options_checkbutton_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 53 | options_checkbutton_box.hexpand = true; 54 | 55 | var options_label = new Gtk.Label (_("Options")); 56 | options_label.margin = 6; 57 | 58 | 59 | var add_option_button = new Gtk.Button.from_icon_name ("list-add", Gtk.IconSize.LARGE_TOOLBAR); 60 | add_option_button.relief = Gtk.ReliefStyle.NONE; 61 | add_option_button.hexpand = false; 62 | add_option_button.halign = Gtk.Align.END; 63 | add_option_button.tooltip_text = _("Add options"); 64 | add_option_button.clicked.connect (() => { 65 | add_options (); 66 | }); 67 | 68 | var clear_all_button = new Gtk.Button.from_icon_name ("edit-clear-all-symbolic",Gtk.IconSize.LARGE_TOOLBAR); 69 | clear_all_button.relief = Gtk.ReliefStyle.NONE; 70 | clear_all_button.hexpand = false; 71 | clear_all_button.halign = Gtk.Align.START; 72 | clear_all_button.tooltip_text = _("Clear all options"); 73 | clear_all_button.clicked.connect (() => { 74 | clear_all_options (); 75 | }); 76 | 77 | var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 78 | button_box.add (clear_all_button); 79 | button_box.pack_end (add_option_button, false, true, 0); 80 | 81 | options_checkbutton_box.pack_start (options_label, false, true, 0); 82 | options_checkbutton_box.pack_start (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), false, true, 0); 83 | options_checkbutton_box.pack_end (button_box, false, true, 0); 84 | 85 | var options_scroll = new Gtk.ScrolledWindow (null, null); 86 | options_scroll.kinetic_scrolling = true; 87 | options_scroll.expand = true; 88 | options_scroll.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC; 89 | options_scroll.hscrollbar_policy = Gtk.PolicyType.NEVER; 90 | options_list_box = Widgets.OptionsListBox.get_instance (); 91 | options_scroll.add (options_list_box); 92 | 93 | options_checkbutton_box.pack_start (options_scroll, false, true, 0); 94 | 95 | options_pane.pack_start (options_checkbutton_box, false, true, 0); 96 | 97 | var options_pane_hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 98 | 99 | options_pane_hbox.get_style_context ().add_class (Gtk.STYLE_CLASS_BACKGROUND); 100 | options_pane_hbox.pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL), false, false, 0); 101 | options_pane_hbox.pack_end (options_pane, false, true, 0); 102 | options_pane_hbox.margin_bottom = 0; 103 | 104 | options_pane_stack.add_named (options_pane_hbox, "options"); 105 | 106 | toggle_options_pane = settings.options_button; 107 | this.add (options_pane_stack); 108 | toggle_visibility (); 109 | } 110 | 111 | public string[] get_checkbuttons_status () { 112 | string[] options_string = {}; 113 | return options_string; 114 | } 115 | 116 | public void toggle_visibility () { 117 | toggle_options_pane = settings.options_button; 118 | 119 | if (toggle_options_pane) { 120 | this.show_all (); 121 | options_pane_stack.set_visible_child_full ("options", Gtk.StackTransitionType.SLIDE_LEFT); 122 | } else { 123 | options_pane_stack.set_visible_child_full ("nothing", Gtk.StackTransitionType.SLIDE_RIGHT); 124 | this.width_request = options_pane_stack.width_request; 125 | 126 | //Trick from https://wiki.gnome.org/Projects/Vala/AsyncSamples to sleep until the stack transition finishes 127 | hide_options.begin (() => { 128 | if (!settings.options_button) { 129 | this.hide (); 130 | }; 131 | }); 132 | }; 133 | } 134 | 135 | private async void hide_options () { 136 | uint duration = options_pane_stack.transition_duration; 137 | yield transition_finished (duration); 138 | } 139 | 140 | public async void transition_finished (uint duration, int priority = GLib.Priority.DEFAULT) { 141 | GLib.Timeout.add (duration, () => { 142 | transition_finished.callback (); 143 | return false; 144 | }, priority); 145 | yield; 146 | } 147 | 148 | public void add_options () { 149 | add_options_dialog = new Widgets.AddOptionsDialog (); 150 | add_options_dialog.signal_add_options.connect ((options_incoming) => { 151 | options_list_box.add_options (options_incoming); 152 | }); 153 | add_options_dialog.show_all (); 154 | } 155 | 156 | public void clear_all_options () { 157 | options_list_box.set_options (null); 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /src/Widgets/ProjectPage.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class ProjectPage : Gtk.Box { 19 | public Widgets.FilesListBox files_list_box; 20 | public Gtk.Overlay overlay; 21 | public Widgets.OptionsSidebar options_sidebar; 22 | 23 | public static ProjectPage instance = null; 24 | public static ProjectPage get_instance () { 25 | if (instance == null) { 26 | instance = new ProjectPage (); 27 | }; 28 | return instance; 29 | } 30 | 31 | construct { 32 | this.instance = this; 33 | this.margin = 0; 34 | overlay = new Gtk.Overlay (); 35 | files_list_box = Widgets.FilesListBox.get_instance (); 36 | overlay.add (files_list_box); 37 | 38 | this.orientation = Gtk.Orientation.VERTICAL; 39 | this.pack_start (overlay, true, true, 0); 40 | 41 | options_sidebar = new Widgets.OptionsSidebar (); 42 | overlay.add_overlay (options_sidebar); 43 | } 44 | 45 | public void toggle_options () { 46 | options_sidebar.toggle_visibility (); 47 | } 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/Widgets/ReportPage.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class ReportPage : Gtk.Box { 19 | 20 | public Utils.AppTester app_tester; 21 | public Utils.ReportsManager reports_manager; 22 | public Gtk.Box bottom_box; 23 | public Gtk.Button clear_button; 24 | public string clear_target; 25 | public bool compile_failed; 26 | public Gtk.TextView compile_report; 27 | public string compile_report_string; 28 | public Gtk.Stack report_stack; 29 | public bool test_available; 30 | public Gtk.TextView test_report; 31 | public string test_report_string; 32 | public Gtk.Button undo_button; 33 | public bool undo_chance_compile; 34 | public bool undo_chance_test; 35 | public Utils.ValaC valac; 36 | public Gtk.ScrolledWindow compile_scroll; 37 | public Gtk.ScrolledWindow test_scroll; 38 | 39 | public Granite.Widgets.ModeButton view_button; 40 | 41 | public static ReportPage instance = null; 42 | public static ReportPage get_instance () { 43 | if (instance == null) { 44 | instance = new ReportPage (); 45 | }; 46 | return instance; 47 | } 48 | 49 | construct { 50 | reports_manager = Utils.ReportsManager.get_instance (); 51 | this.orientation = Gtk.Orientation.VERTICAL; 52 | this.spacing = 12; 53 | this.margin = 0; 54 | 55 | //Granite.Widgets.ModeButton setup 56 | view_button = new Granite.Widgets.ModeButton (); 57 | view_button.append_text (_("Compile Report")); 58 | view_button.append_text (_("Live Test Report")); 59 | view_button.halign = Gtk.Align.CENTER; 60 | 61 | //Reports View setup 62 | compile_report_string = ""; 63 | test_report_string = ""; 64 | 65 | compile_report = new Gtk.TextView (); 66 | compile_report.monospace = true; 67 | compile_report.editable = false; 68 | 69 | test_report = new Gtk.TextView (); 70 | test_report.monospace = true; 71 | test_report.editable = false; 72 | test_report.wrap_mode = Gtk.WrapMode.WORD; 73 | 74 | compile_scroll = new Gtk.ScrolledWindow (null, null); 75 | compile_scroll.add (compile_report); 76 | 77 | var compile_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 2); 78 | compile_box.pack_start (compile_scroll, true, true, 0); 79 | 80 | test_scroll = new Gtk.ScrolledWindow (null, null); 81 | test_scroll.add (test_report); 82 | 83 | report_stack = new Gtk.Stack (); 84 | report_stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; 85 | report_stack.add_named (compile_box, "compile"); 86 | report_stack.add_named (test_scroll, "test"); 87 | 88 | //Setup bottom_box 89 | clear_target = "compile"; 90 | clear_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 91 | clear_button.relief = Gtk.ReliefStyle.NONE; 92 | clear_button.tooltip_text = _("Clear Report"); 93 | clear_button.sensitive = target_contains_text (); 94 | 95 | undo_chance_test = false; 96 | undo_chance_compile = false; 97 | undo_button = new Gtk.Button.from_icon_name ("edit-undo-symbolic", Gtk.IconSize.LARGE_TOOLBAR); 98 | undo_button.relief = Gtk.ReliefStyle.NONE; 99 | undo_button.tooltip_text = _("Undo Last Clear"); 100 | if (undo_chance_compile) { 101 | undo_button.sensitive = true; 102 | } else { 103 | undo_button.sensitive = false; 104 | }; 105 | 106 | bottom_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); 107 | bottom_box.pack_end (clear_button, false, false, 0); 108 | bottom_box.pack_end (undo_button, false, false, 0); 109 | 110 | //Add stuff to Report Page 111 | this.pack_start (view_button,false, false, 0); 112 | this.pack_start (report_stack, true, true, 0); 113 | this.pack_end (bottom_box, false, false, 0); 114 | 115 | //Setup event listeners 116 | view_button.mode_changed.connect (() => { 117 | switch (view_button.selected) { 118 | case 0: 119 | report_stack.set_visible_child_full ("compile", Gtk.StackTransitionType.SLIDE_RIGHT); 120 | clear_button.tooltip_text = _("Clear Report"); 121 | clear_target = "compile"; 122 | clear_button.sensitive = target_contains_text (); 123 | undo_button.tooltip_text = _("Undo Last Clear"); 124 | if (undo_chance_compile) { 125 | undo_button.sensitive = true; 126 | } else { 127 | undo_button.sensitive = false; 128 | }; 129 | break; 130 | case 1: 131 | report_stack.set_visible_child_full ("test", Gtk.StackTransitionType.SLIDE_LEFT); 132 | clear_button.tooltip_text = _("Clear Report"); 133 | clear_target = "test"; 134 | clear_button.sensitive = target_contains_text (); 135 | undo_button.tooltip_text = _("Undo Last Clear"); 136 | if (undo_chance_test) { 137 | undo_button.sensitive = true; 138 | } else { 139 | undo_button.sensitive = false; 140 | }; 141 | 142 | break; 143 | }; 144 | }); 145 | 146 | test_available = false; 147 | compile_failed = false; 148 | valac = Utils.ValaC.get_instance (); 149 | valac.compile_done.connect (() => { 150 | if (!compile_failed) { 151 | test_available = true; 152 | }; 153 | }); 154 | 155 | valac.compile_line_out.connect ((line) => { 156 | //check for test button 157 | if (line.contains ("Compilation failed")) { 158 | compile_failed = true; 159 | }; 160 | 161 | if (compile_report.buffer.text == "") { 162 | compile_report_string = ""; // removes the undo chance 163 | }; 164 | compile_report_string += " - "; 165 | compile_report_string += line; 166 | undo_chance_compile =false; 167 | undo_button.sensitive = undo_chance_compile; 168 | clear_button.sensitive = target_contains_text (); 169 | refresh_compile (); 170 | }); 171 | 172 | app_tester = Utils.AppTester.get_instance (); 173 | app_tester.test_line_out.connect ((line) => { 174 | if (test_report.buffer.text == "") { 175 | test_report_string = ""; // removes the undo chance 176 | }; 177 | test_report_string += " - "; 178 | test_report_string += line; 179 | undo_chance_test = false; 180 | undo_button.sensitive = undo_chance_test; 181 | clear_button.sensitive = target_contains_text (); 182 | refresh_test (); 183 | }); 184 | 185 | clear_button.clicked.connect (() => { 186 | switch (clear_target) { 187 | case "compile": 188 | compile_report.buffer.text = ""; //gives a chance for undo 189 | undo_chance_compile = true; 190 | break; 191 | case "test": 192 | test_report.buffer.text = ""; //give a chance for undo 193 | undo_chance_test = true; 194 | break; 195 | }; 196 | undo_button.sensitive = true; 197 | clear_button.sensitive = target_contains_text (); 198 | }); 199 | 200 | undo_button.clicked.connect (() => { 201 | switch (clear_target) { 202 | case "compile": 203 | refresh_compile (); 204 | break; 205 | case "test": 206 | refresh_test (); 207 | break; 208 | } 209 | undo_button.sensitive = false; 210 | clear_button.sensitive = target_contains_text (); 211 | }); 212 | } 213 | 214 | public bool target_contains_text () { 215 | switch (clear_target) { 216 | case "compile": 217 | if (compile_report.buffer.text == "") { 218 | return false; 219 | } else { 220 | return true; 221 | }; 222 | case "test": 223 | if (test_report.buffer.text == "") { 224 | return false; 225 | } else { 226 | return true; 227 | }; 228 | }; 229 | return false; //to be able to compile 230 | } 231 | 232 | public void refresh_compile () { 233 | Gtk.TextIter iter; 234 | compile_report.buffer.text = compile_report_string; 235 | compile_report.buffer.get_end_iter (out iter); 236 | compile_report.scroll_to_iter (iter, 0, true ,0 ,0); 237 | } 238 | 239 | public void refresh_test () { 240 | Gtk.TextIter iter; 241 | test_report.buffer.text = test_report_string; 242 | test_report.buffer.get_end_iter (out iter); 243 | test_report.scroll_to_iter (iter, 0, true ,0 ,0); 244 | 245 | } 246 | 247 | public void clear_compile_report () { 248 | compile_report_string = ""; 249 | refresh_compile (); 250 | } 251 | 252 | public void clear_test_report () { 253 | test_report_string = ""; 254 | refresh_test (); 255 | } 256 | } 257 | } 258 | 259 | -------------------------------------------------------------------------------- /src/Widgets/WelcomePage.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler.Widgets { 18 | public class WelcomePage : Granite.Widgets.Welcome { 19 | 20 | public static WelcomePage instance = null; 21 | public static WelcomePage get_instance () { 22 | if (instance == null) { 23 | instance = new WelcomePage (); 24 | }; 25 | return instance; 26 | } 27 | 28 | public WelcomePage () { 29 | base (_("Vala Compiler"), _("A simple GUI for the command line valac")); 30 | } 31 | 32 | construct { 33 | bool show_last_folder = settings.last_folder != ""; 34 | 35 | append ("document-open", _("Source folder"), _("Open your source folder.")); 36 | set_item_visible (0, true); 37 | 38 | append ("document-open", _("Open last source folder"), settings.last_folder); 39 | set_item_visible (1, show_last_folder); 40 | 41 | activated.connect ((index) => { 42 | var window = App.get_instance ().window; 43 | switch (index) { 44 | case 0: 45 | window.run_open_folder (); 46 | break; 47 | case 1: 48 | window.start_project (settings.last_folder); 49 | }; 50 | }); 51 | } 52 | 53 | public void refresh () { 54 | var last_folder_button = get_button_from_index (1); 55 | bool show_last_folder = settings.last_folder != ""; 56 | 57 | last_folder_button.description = settings.last_folder; 58 | set_item_visible (1 ,show_last_folder); 59 | this.show_all (); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Window.vala: -------------------------------------------------------------------------------- 1 | /*** 2 | BEGIN LICENSE 3 | Copyright (C) 2017 Basem Kheyar 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU Lesser General Public License version 3, as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranties of 10 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | PURPOSE. See the GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License along 13 | with this program. If not, see 14 | END LICENSE 15 | ***/ 16 | 17 | namespace ValaCompiler { 18 | public class Window : Gtk.Window { 19 | public Widgets.MainStack main_stack; 20 | public Widgets.HeaderBar header; 21 | public Widgets.WelcomePage welcome_page; 22 | public Widgets.ProjectPage project_page; 23 | public Widgets.ReportPage report_page; 24 | public Widgets.OptionsListBox options_list_box; 25 | public Utils.FilesManager files_manager; 26 | public Utils.ValaC valac; 27 | public Utils.AppTester app_tester; 28 | public Utils.OptionsManager options_manager; 29 | public App app; 30 | 31 | public static Window instance = null; 32 | public static Window get_instance () { 33 | if (instance == null) { 34 | instance = new Window (); 35 | }; 36 | return instance; 37 | } 38 | 39 | construct { 40 | main_stack = Widgets.MainStack.get_instance (); 41 | welcome_page = Widgets.WelcomePage.get_instance (); 42 | project_page = Widgets.ProjectPage.get_instance (); 43 | report_page = Widgets.ReportPage.get_instance (); 44 | 45 | set_default_geometry (600, 600); 46 | 47 | header = Widgets.HeaderBar.get_instance (); 48 | set_titlebar (header); 49 | 50 | main_stack.add_named (welcome_page, "welcome"); 51 | main_stack.add_named (project_page, "project"); 52 | main_stack.add_named (report_page, "report"); 53 | 54 | add (main_stack); 55 | main_stack.set_visible_child_full ("welcome", Gtk.StackTransitionType.NONE); 56 | 57 | show_all (); 58 | header.update_buttons (); 59 | } 60 | 61 | public void run_open_folder () { 62 | var folder_chooser = new Gtk.FileChooserDialog (_("Select Project Folder"), 63 | this, 64 | Gtk.FileChooserAction.SELECT_FOLDER, 65 | _("Cancel"), 66 | Gtk.ResponseType.CANCEL, 67 | _("Open"), 68 | Gtk.ResponseType.ACCEPT); 69 | folder_chooser.set_transient_for (this); 70 | 71 | var vala_filter = new Gtk.FileFilter (); 72 | vala_filter.set_filter_name (_("Vala files")); 73 | vala_filter.add_pattern ("*.vala"); 74 | 75 | var all_files_filter = new Gtk.FileFilter (); 76 | all_files_filter.set_filter_name (_("All Files")); 77 | all_files_filter.add_pattern ("*"); 78 | 79 | folder_chooser.add_filter (all_files_filter); 80 | folder_chooser.add_filter (vala_filter); 81 | 82 | if (folder_chooser.run () == Gtk.ResponseType.ACCEPT) { 83 | string project_location = ""; 84 | 85 | try { 86 | project_location = Filename.from_uri (folder_chooser.get_uri ()); 87 | } catch (ConvertError e) { 88 | debug (e.message); 89 | }; 90 | 91 | start_project (project_location); 92 | settings.last_folder = folder_chooser.get_current_folder (); 93 | } 94 | folder_chooser.destroy (); 95 | } 96 | 97 | public void start_project (string project_location) { 98 | settings.project_location = project_location; 99 | 100 | main_stack.show_project_page (); 101 | 102 | files_manager = Utils.FilesManager.get_instance (); 103 | files_manager.clear_files (); 104 | files_manager.list_files (); 105 | 106 | options_manager = Utils.OptionsManager.get_instance (); 107 | options_manager.start_project (); 108 | } 109 | 110 | public void shut_down () { 111 | options_manager.save_options(); 112 | } 113 | } 114 | } --------------------------------------------------------------------------------