[280] | 1 | /* rgsetoptwindow.cc |
---|
| 2 | * |
---|
| 3 | * Copyright (c) 2003 Michael Vogt |
---|
| 4 | * |
---|
| 5 | * Author: Gustavo Niemeyer <niemeyer@conectiva.com> |
---|
| 6 | * |
---|
| 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. |
---|
| 11 | * |
---|
| 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. |
---|
| 16 | * |
---|
| 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 |
---|
| 20 | * USA |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | #include <apt-pkg/configuration.h> |
---|
| 24 | |
---|
| 25 | #include "config.h" |
---|
| 26 | #include "i18n.h" |
---|
| 27 | |
---|
| 28 | #include "rgsetoptwindow.h" |
---|
| 29 | |
---|
| 30 | void RGSetOptWindow::DoApply(GtkWindow *widget, void *data) |
---|
| 31 | { |
---|
| 32 | RGSetOptWindow *me = (RGSetOptWindow *) data; |
---|
| 33 | |
---|
| 34 | GtkWidget *entry_name = glade_xml_get_widget(me->_gladeXML, "entry_name"); |
---|
| 35 | GtkWidget *entry_value = glade_xml_get_widget(me->_gladeXML, "entry_value"); |
---|
| 36 | |
---|
| 37 | const gchar *name = gtk_entry_get_text(GTK_ENTRY(entry_name)); |
---|
| 38 | const gchar *value = gtk_entry_get_text(GTK_ENTRY(entry_value)); |
---|
| 39 | |
---|
| 40 | _config->Set(name, value); |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | void RGSetOptWindow::DoClose(GtkWindow *widget, void *data) |
---|
| 44 | { |
---|
| 45 | RGSetOptWindow *me = (RGSetOptWindow *) data; |
---|
| 46 | |
---|
| 47 | me->hide(); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | RGSetOptWindow::RGSetOptWindow(RGWindow *win) |
---|
| 51 | : RGGladeWindow(win, "setopt") |
---|
| 52 | { |
---|
| 53 | glade_xml_signal_connect_data(_gladeXML, |
---|
| 54 | "on_button_apply_clicked", |
---|
| 55 | G_CALLBACK(DoApply), this); |
---|
| 56 | |
---|
| 57 | glade_xml_signal_connect_data(_gladeXML, |
---|
| 58 | "on_button_close_clicked", |
---|
| 59 | G_CALLBACK(DoClose), this); |
---|
| 60 | |
---|
| 61 | setTitle(""); |
---|
| 62 | skipTaskbar(true); |
---|
| 63 | } |
---|