]> cygwin.com Git - cygwin-apps/setup.git/blob - package_message.h
Add missing file.
[cygwin-apps/setup.git] / package_message.h
1 /*
2 * Copyright (c) Christopher Faylor
3 *
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 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 */
12
13 #ifndef SETUP_PACKAGE_MESSAGE_H
14 #define SETUP_PACKAGE_MESSAGE_H
15
16 #include "UserSettings.h"
17 #include <windows.h>
18
19 class packagemessage
20 {
21 std::string id;
22 std::string message;
23 public:
24 packagemessage (): id (""), message ("") {}
25 void set (const std::string& in_id, const std::string& in_message)
26 {
27 id = in_id;
28 message = in_message;
29 }
30 void display ()
31 {
32 if (!id.length () || UserSettings::instance().get (id.c_str ()))
33 /* No message or already seen */;
34 else if (MessageBox (NULL, message.c_str (), "Setup Alert",
35 MB_OKCANCEL | MB_ICONSTOP | MB_SETFOREGROUND
36 | MB_TOPMOST) != IDCANCEL)
37 UserSettings::instance().set (id.c_str (), "1");
38 else
39 exit (1);
40 }
41 };
42
43 #endif /* SETUP_PACKAGE_MESSAGE_H */
44
This page took 0.037984 seconds and 6 git commands to generate.