| 1 | /* rgrepositorywin.h - gtk editor for the sources.list file |
|---|
| 2 | * |
|---|
| 3 | * Copyright (c) (c) 1999 Patrick Cole <z@amused.net> |
|---|
| 4 | * (c) 2002 Synaptic development team |
|---|
| 5 | * |
|---|
| 6 | * Author: Patrick Cole <z@amused.net> |
|---|
| 7 | * Michael Vogt <mvo@debian.org> |
|---|
| 8 | * Gustavo Niemeyer <niemeyer@conectiva.com> |
|---|
| 9 | * |
|---|
| 10 | * This program is free software; you can redistribute it and/or |
|---|
| 11 | * modify it under the terms of the GNU General Public License as |
|---|
| 12 | * published by the Free Software Foundation; either version 2 of the |
|---|
| 13 | * License, or (at your option) any later version. |
|---|
| 14 | * |
|---|
| 15 | * This program is distributed in the hope that it will be useful, |
|---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 18 | * GNU General Public License for more details. |
|---|
| 19 | * |
|---|
| 20 | * You should have received a copy of the GNU General Public License |
|---|
| 21 | * along with this program; if not, write to the Free Software |
|---|
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 23 | * USA |
|---|
| 24 | */ |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | #ifndef _RGREPOSITORYWIN_H |
|---|
| 28 | #define _RGREPOSITORYWIN_H |
|---|
| 29 | |
|---|
| 30 | #include <gtk/gtk.h> |
|---|
| 31 | #include "rsources.h" |
|---|
| 32 | #include "rggladewindow.h" |
|---|
| 33 | #include "rgvendorswindow.h" |
|---|
| 34 | #include "rguserdialog.h" |
|---|
| 35 | |
|---|
| 36 | typedef list<SourcesList::SourceRecord *>::iterator SourcesListIter; |
|---|
| 37 | typedef list<SourcesList::VendorRecord *>::iterator VendorsListIter; |
|---|
| 38 | |
|---|
| 39 | class RGRepositoryEditor:RGGladeWindow { |
|---|
| 40 | SourcesList _lst, _savedList; |
|---|
| 41 | |
|---|
| 42 | int _selectedRow; |
|---|
| 43 | |
|---|
| 44 | // the gtktreeview |
|---|
| 45 | GtkWidget *_sourcesListView; |
|---|
| 46 | GtkListStore *_sourcesListStore; |
|---|
| 47 | GtkTreeIter *_lastIter; |
|---|
| 48 | |
|---|
| 49 | GtkWidget *_editTable; |
|---|
| 50 | GtkWidget *_optVendor; |
|---|
| 51 | GtkWidget *_optVendorMenu; |
|---|
| 52 | GtkWidget *_entryURI; |
|---|
| 53 | GtkWidget *_entrySect; |
|---|
| 54 | GtkWidget *_optType; |
|---|
| 55 | GtkWidget *_optTypeMenu; |
|---|
| 56 | GtkWidget *_entryDist; |
|---|
| 57 | //GtkWidget *_cbEnabled; |
|---|
| 58 | |
|---|
| 59 | GtkWidget *_upBut; |
|---|
| 60 | GtkWidget *_downBut; |
|---|
| 61 | GtkWidget *_deleteBut; |
|---|
| 62 | |
|---|
| 63 | RGUserDialog *_userDialog; |
|---|
| 64 | |
|---|
| 65 | bool _applied; |
|---|
| 66 | bool _dirty; |
|---|
| 67 | GdkColor _gray; |
|---|
| 68 | |
|---|
| 69 | void UpdateVendorMenu(); |
|---|
| 70 | int VendorMenuIndex(string VendorID); |
|---|
| 71 | |
|---|
| 72 | // static event handlers |
|---|
| 73 | static void DoClear(GtkWidget *, gpointer); |
|---|
| 74 | static void DoAdd(GtkWidget *, gpointer); |
|---|
| 75 | static void DoUpDown(GtkWidget *, gpointer); |
|---|
| 76 | static void DoRemove(GtkWidget *, gpointer); |
|---|
| 77 | static void DoOK(GtkWidget *, gpointer); |
|---|
| 78 | static void DoCancel(GtkWidget *, gpointer); |
|---|
| 79 | static void VendorsWindow(GtkWidget *, gpointer); |
|---|
| 80 | static void SelectionChanged(GtkTreeSelection *selection, gpointer data); |
|---|
| 81 | |
|---|
| 82 | // treeview item toggled |
|---|
| 83 | static void item_toggled(GtkCellRendererToggle *cell, |
|---|
| 84 | gchar *path_str, |
|---|
| 85 | gpointer data); |
|---|
| 86 | // get values |
|---|
| 87 | void doEdit(); |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | public: |
|---|
| 91 | RGRepositoryEditor(RGWindow *parent); |
|---|
| 92 | ~RGRepositoryEditor(); |
|---|
| 93 | |
|---|
| 94 | bool Run(); |
|---|
| 95 | }; |
|---|
| 96 | |
|---|
| 97 | #endif |
|---|