Write.as GTK desktop app https://write.as/apps/desktop
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
1.4 KiB

  1. /*
  2. Copyright © 2018 Write.as
  3. This file is part of the Write.as GTK desktop app.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. public class WriteAs.Application : Gtk.Application {
  16. construct {
  17. this.flags |= ApplicationFlags.HANDLES_OPEN;
  18. Intl.setlocale(LocaleCategory.ALL, "");
  19. Intl.textdomain("write.as");
  20. application_id = "com.github.writeas.writeas-gtk.desktop";
  21. }
  22. public override void activate() {
  23. if (get_windows().length() == 0)
  24. new WriteAs.MainWindow(this).show_all();
  25. }
  26. public override void open(File[] files, string hint) {
  27. activate(); // ensure we have a window open.
  28. }
  29. public static int main(string[] args) {
  30. return new WriteAs.Application().run(args);
  31. }
  32. }