D
Daniel Koch
Hi, I've this Exception class:
// exception.h file
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include <glibmm.h>
#include <gtkmm/messagedialog.h>
class Exception
{
private:
Glib::ustring error_message;
public:
Exception(Glib::ustring s);
void DisplayError();
protected:
Glib::ustring getErrorMessage(){ return error_message; }
};
#endif
// exception.cpp file
#include "exception.h"
Exception::Exception(Glib::ustring s)
{
error_message = s;
}
void Exception:isplayError()
{
// display dialog
Gtk::MessageDialog dialog("System Error", false, Gtk::MESSAGE_ERROR);
dialog.set_secondary_text(error_message);
dialog.run();
}
I need to identify when it is a System Error or when it is an
Application Error. Then it could be extended to a child class:
ApplicationException.
My question is about "System Error" MessageDialog's title. How it can
be implemented? How it can be changed when I'll define the
ApplicationError class?
Thank you,
Daniel Koch
// exception.h file
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include <glibmm.h>
#include <gtkmm/messagedialog.h>
class Exception
{
private:
Glib::ustring error_message;
public:
Exception(Glib::ustring s);
void DisplayError();
protected:
Glib::ustring getErrorMessage(){ return error_message; }
};
#endif
// exception.cpp file
#include "exception.h"
Exception::Exception(Glib::ustring s)
{
error_message = s;
}
void Exception:isplayError()
{
// display dialog
Gtk::MessageDialog dialog("System Error", false, Gtk::MESSAGE_ERROR);
dialog.set_secondary_text(error_message);
dialog.run();
}
I need to identify when it is a System Error or when it is an
Application Error. Then it could be extended to a child class:
ApplicationException.
My question is about "System Error" MessageDialog's title. How it can
be implemented? How it can be changed when I'll define the
ApplicationError class?
Thank you,
Daniel Koch