]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/errors.hpp
Qt: use __MIN when applicable
[vlc] / modules / gui / qt4 / dialogs / errors.hpp
index 2f85c94850da46fc632a3d52e40f5efbd2d2be70..2288aee725470647da11875a497d429889e62737 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 
-#ifndef _ERRORS_DIALOG_H_
-#define _ERRORS_DIALOG_H_
+#ifndef QVLC_ERRORS_DIALOG_H_
+#define QVLC_ERRORS_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class QPushButton;
 class QCheckBox;
 class QGridLayout;
 class QTextEdit;
 
-class ErrorsDialog : public QVLCFrame
+class ErrorsDialog : public QVLCDialog, public Singleton<ErrorsDialog>
 {
-    Q_OBJECT;
+    Q_OBJECT
 public:
-    static ErrorsDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new ErrorsDialog( p_intf );
-        return instance;
-    }
-    virtual ~ErrorsDialog() {};
-
-    void addError( QString, QString );
-    void addWarning( QString, QString );
+
+    void addError( const QString&, const QString& );
+    /*void addWarning( QString, QString );*/
 private:
+    virtual ~ErrorsDialog() {}
     ErrorsDialog( intf_thread_t * );
-    static ErrorsDialog *instance;
-    void add( bool, QString, QString );
+    void add( bool, const QString&, const QString& );
 
     QCheckBox *stopShowing;
     QTextEdit *messages;
@@ -55,6 +50,8 @@ private slots:
     void close();
     void clear();
     void dontShow();
+
+    friend class    Singleton<ErrorsDialog>;
 };
 
 #endif