-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.vala
77 lines (65 loc) · 2.02 KB
/
main.vala
1
2
3
4
5
6
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Copyright (C) 2015 Daniel Pfeifer <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/
namespace CMake
{
class Application : Gtk.Application
{
private Gtk.Window window = null;
protected override void activate()
{
window = new SetupWindow(this);
window.show();
}
protected override void startup()
{
base.startup();
var action = new SimpleAction("about", null);
action.activate.connect(about);
this.add_action(action);
action = new SimpleAction("quit", null);
action.activate.connect(this.quit);
this.add_action(action);
var builder = new Gtk.Builder.from_resource("/net/purplekarrot/cmake/app-menu.ui");
this.app_menu = builder.get_object("appmenu") as MenuModel;
}
void new_callback(SimpleAction action, Variant? parameter)
{
print ("You clicked \"New\".\n");
}
void open_callback(SimpleAction action, Variant? parameter)
{
print ("You clicked \"Open\".\n");
}
void about()
{
const string authors[] = {"Daniel Pfeifer"};
Gtk.show_about_dialog(window,
"authors", authors,
"copyright", "Copyright (c) 2015 Daniel Pfeifer",
"license-type", Gtk.License.GPL_3_0,
"program-name", "CMake Cache Editor",
"version", "0.1",
"website", "http:https://purplekarrot.net",
"website-label", "purplekarrot.net"
);
}
}
int main(string[] args)
{
return new Application().run(args);
}
} // namespace CMake