00001 /*************************************************************************** 00002 qgsmessageviewer.h - description 00003 ------------------- 00004 begin : Wed Jun 4 2003 00005 copyright : (C) 2002 by Gary E.Sherman 00006 email : sherman at mrcc.com 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 /* $Id$ */ 00018 #ifndef QGSMESSAGEVIEWER_H 00019 #define QGSMESSAGEVIEWER_H 00020 00021 #include <ui_qgsmessageviewer.h> 00022 #include <qgisgui.h> 00023 #include "qgsmessageoutput.h" 00024 00025 #include <QString> 00026 00027 00031 class GUI_EXPORT QgsMessageViewer: public QDialog, public QgsMessageOutput, private Ui::QgsMessageViewer 00032 { 00033 Q_OBJECT 00034 public: 00035 QgsMessageViewer( QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags ); 00036 ~QgsMessageViewer(); 00037 00038 virtual void setMessage( const QString& message, MessageType msgType ); 00039 00040 virtual void appendMessage( const QString& message ); 00041 00042 virtual void showMessage( bool blocking = true ); 00043 00044 virtual void setTitle( const QString& title ); 00045 00046 // Call one of the setMessage...() functions first. 00047 // Subsequent calls to appendMessage use the format as determined 00048 // by the call to setMessage...() 00049 00050 // Treats the given text as html. 00051 void setMessageAsHtml( const QString& msg ); 00052 // Treats the given text as plain text 00053 void setMessageAsPlainText( const QString& msg ); 00054 // A checkbox that can be used for something like 00055 // "don't show this message again" 00056 void setCheckBoxText( const QString& text ); 00057 // Make the check box visible/invisible 00058 void setCheckBoxVisible( bool visible ); 00059 // Sets the check state 00060 void setCheckBoxState( Qt::CheckState state ); 00061 // Get checkbox state 00062 Qt::CheckState checkBoxState(); 00063 // Specifies a QSettings tag to store/retrieve the checkbox 00064 // state to/from. Use an empty QString to disable this feature. 00065 void setCheckBoxQSettingsLabel( QString label ); 00066 00067 private slots: 00068 void on_checkBox_toggled( bool ); 00069 00070 00071 private: 00072 QString mCheckBoxQSettingsLabel; 00073 }; 00074 00075 #endif