1
// Stephen Smally © 2012
2
// This program is free software; you can redistribute it and/or modify
3
// it under the terms of the GNU General Public License as published by
4
// the Free Software Foundation; either version 2 of the License, or
5
// (at your option) any later version.
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// 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, write to the Free Software
14
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15
// MA 02110-1301, USA.
20
namespace Lsc.Widgets {
21
public class InfoMessage : InfoBar {
23
public signal void choosed ();
27
public Button info_button;
28
public Button action_button;
31
private Pk.Package pkg;
33
public enum ResponseId {
38
public void update (string pkg_name) {
39
stdout.printf("%s\n", pkg_name);
43
text.set_label(@"Selected package <b>$(pkg.get_name())</b>");
46
public InfoMessage () {
47
message_type = MessageType.INFO;
48
((Box) get_action_area()).orientation = Orientation.HORIZONTAL;
49
Box main = get_content_area() as Box;
50
main.orientation = Orientation.HORIZONTAL;
52
orientation = Orientation.HORIZONTAL;
55
text.use_markup = true;
56
text.ellipsize = Pango.EllipsizeMode.END;
58
add_button(Stock.INFO, ResponseId.INFO);
59
add_button("Install", ResponseId.INSTALL);
61
focus_out_event.connect(() => {
66
main.pack_start(text, false, false, 0);
69
pkg = new Pk.Package();
b'\\ No newline at end of file'