3
public Notes.PagesList pages_list;
4
public Notes.Editor editor;
5
public Notes.Services.Settings settings;
6
public Notes.Window window;
7
3
public string NOTES_DIR;
4
public static const string APP_NAME = "Notes";
5
public static const string CODE_NAME = "pantheon-notes";
10
8
public class Notes.Application : Granite.Application {
9
private Notes.Window window;
11
11
public const string PROGRAM_NAME = N_("Notes");
12
12
public const string COMMENT = N_("Simple notes editing");
13
13
public const string ABOUT_STOCK = N_("About Notes");
15
15
public bool running = false;
17
public static int main (string[] args) {
18
Application app = Application.instance;
19
return app.run (args);
23
flags |= ApplicationFlags.HANDLES_OPEN;
25
program_name = APP_NAME;
26
exec_name = "pantheon-notes";
27
app_years = "2011-2015";
28
app_icon = "accessories-notes";
29
app_launcher = "pantheon-notes.desktop";
30
application_id = "org.elementary." + CODE_NAME.down ();
31
main_url = "https://launchpad.net/pantheon-notes";
32
bug_url = "https://bugs.launchpad.net/pantheon-notes";
33
help_url = "https://elementary.io/help/pantheon-notes";
34
translate_url = "https://translations.launchpad.net/pantheon-notes";
35
about_authors = { "Felipe Escoto <felescoto95@hotmail.com>", null};
36
about_documenters = { "",null };
37
about_artists = { "", null};
38
about_translators = _("translator-credits");
39
about_license_type = Gtk.License.GPL_3_0;
17
42
public Application () {
18
Object (application_id: "org.pantheon-notes");
43
Intl.setlocale (LocaleCategory.ALL, Intl.get_language_names ()[0]);
44
Environment.set_application_name (APP_NAME);
45
Environment.set_prgname (APP_NAME);
48
public static Application _instance = null;
50
public static Application instance {
52
if (_instance == null)
53
_instance = new Application ();
21
58
public override void activate () {
60
stdout.printf ("activated\n");
64
public override int command_line (ApplicationCommandLine command_line) {
66
int res = _command_line (command_line);
71
private void app_window () {
23
settings = new Notes.Services.Settings ();
73
var settings = new Notes.Services.Settings ();
25
75
if (settings.notes_location == "") {
26
76
settings.notes_location = Path.build_filename (Environment.get_user_data_dir (), CODE_NAME);
37
87
window.show_app ();
90
private void file_window (string file) {
91
var window = new Notes.Window.with_file (this, file);
96
private int _command_line (ApplicationCommandLine command_line) {
99
OptionEntry[] options = new OptionEntry[1];
100
options[0] = { "file", 0, 0, OptionArg.FILENAME, ref file, "World name to load", "Open file" };
102
string[] args = command_line.get_arguments ();
103
string*[] _args = new string[args.length];
104
for (int i = 0; i < args.length; i++) {
109
var opt_context = new OptionContext ("- OptionContext example");
110
opt_context.set_help_enabled (true);
111
opt_context.add_main_entries (options, null);
112
unowned string[] tmp = _args;
113
opt_context.parse (ref tmp);
114
} catch (OptionError e) {
115
command_line.print ("error: %s\n", e.message);
116
command_line.print ("Run '%s --help' to see a full list of available command line options.\n", args[0]);