3
* Copyright (c) 2003 Michael Vogt
5
* Author: Gustavo Niemeyer <niemeyer@conectiva.com>
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License as
9
* published by the Free Software Foundation; either version 2 of the
10
* License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23
#include <apt-pkg/configuration.h>
28
#include "rgsetoptwindow.h"
30
void RGSetOptWindow::DoApply(GtkWindow *widget, void *data)
32
RGSetOptWindow *me = (RGSetOptWindow *) data;
34
GtkWidget *entry_name = GTK_WIDGET(gtk_builder_get_object(me->_builder, "entry_name"));
35
GtkWidget *entry_value = GTK_WIDGET(gtk_builder_get_object(me->_builder, "entry_value"));
37
const gchar *name = gtk_entry_get_text(GTK_ENTRY(entry_name));
38
const gchar *value = gtk_entry_get_text(GTK_ENTRY(entry_value));
40
_config->Set(name, value);
43
void RGSetOptWindow::DoClose(GtkWindow *widget, void *data)
45
RGSetOptWindow *me = (RGSetOptWindow *) data;
50
RGSetOptWindow::RGSetOptWindow(RGWindow *win)
51
: RGGtkBuilderWindow(win, "setopt")
53
g_signal_connect(GTK_WIDGET(gtk_builder_get_object
54
(_builder, "button_apply")),
56
G_CALLBACK(DoApply), this);
58
g_signal_connect(GTK_WIDGET(gtk_builder_get_object
59
(_builder, "button_close")),
61
G_CALLBACK(DoClose), this);