[280] | 1 | /* rginstallprogress.h |
---|
| 2 | * |
---|
| 3 | * Copyright (c) 2000, 2001 Conectiva S/A |
---|
| 4 | * |
---|
| 5 | * Author: Alfredo K. Kojima <kojima@conectiva.com.br> |
---|
| 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 | |
---|
| 24 | #ifndef _RGINSTALLPROGRESS_H_ |
---|
| 25 | #define _RGINSTALLPROGRESS_H_ |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | #include "rinstallprogress.h" |
---|
| 29 | #include "rggladewindow.h" |
---|
| 30 | #include "rgslideshow.h" |
---|
| 31 | |
---|
| 32 | class RGMainWindow; |
---|
| 33 | |
---|
| 34 | class RGInstallProgressMsgs:public RGGladeWindow { |
---|
| 35 | |
---|
| 36 | GtkTextBuffer *_textBuffer; |
---|
| 37 | static void onCloseClicked(GtkWidget *self, void *data); |
---|
| 38 | |
---|
| 39 | const char *_currentPackage; |
---|
| 40 | bool _hasHeader; |
---|
| 41 | |
---|
| 42 | protected: |
---|
| 43 | virtual void addText(const char *text, bool bold = false); |
---|
| 44 | |
---|
| 45 | public: |
---|
| 46 | virtual void newPackage(const char *name); |
---|
| 47 | virtual void addLine(const char *line); |
---|
| 48 | |
---|
| 49 | virtual bool empty(); |
---|
| 50 | virtual void run(); |
---|
| 51 | virtual bool close(); |
---|
| 52 | |
---|
| 53 | RGInstallProgressMsgs(RGWindow *win); |
---|
| 54 | }; |
---|
| 55 | |
---|
| 56 | class RGInstallProgress:public RInstallProgress, public RGGladeWindow { |
---|
| 57 | |
---|
| 58 | GtkWidget *_label; |
---|
| 59 | GtkWidget *_labelSummary; |
---|
| 60 | |
---|
| 61 | GtkWidget *_pbar; |
---|
| 62 | GtkWidget *_pbarTotal; |
---|
| 63 | |
---|
| 64 | GtkWidget *_image; |
---|
| 65 | |
---|
| 66 | bool _startCounting; |
---|
| 67 | |
---|
| 68 | map<string, string> _summaryMap; |
---|
| 69 | |
---|
| 70 | RGInstallProgressMsgs _msgs; |
---|
| 71 | |
---|
| 72 | RGSlideShow *_ss; |
---|
| 73 | |
---|
| 74 | protected: |
---|
| 75 | virtual void startUpdate(); |
---|
| 76 | virtual void updateInterface(); |
---|
| 77 | virtual void finishUpdate(); |
---|
| 78 | |
---|
| 79 | virtual void prepare(RPackageLister *lister); |
---|
| 80 | |
---|
| 81 | public: |
---|
| 82 | RGInstallProgress(RGMainWindow *main, RPackageLister *lister); |
---|
| 83 | ~RGInstallProgress(); |
---|
| 84 | }; |
---|
| 85 | |
---|
| 86 | #endif |
---|