#include "../config.h"
#endif
-#if defined(_WIN32) || defined(__WIN32__)
+#if defined(_WIN32)
#include <windows.h>
#elif defined(__APPLE__) && defined(__MACH__)
#include <Carbon/Carbon.h>
std::string text2;
+
+ ModalDialog(Type pType = INFO,
+ const std::string& pTitle = "",
+ const std::string& pText1 = "",
+ const std::string& pText2 = "") :
+ title(pTitle),
+ type(pType),
+ text1(pText1),
+ text2(pText2) {}
+
+
void run() const
{
switch (type)
break;
}
-#if defined(_WIN32) || defined(__WIN32__)
+#if defined(_WIN32)
int iconType;
switch (type)
"%s", text2.c_str());
gtk_window_set_title(GTK_WINDOW(dialog), title.c_str());
- std::string iconPath = Resource::getPath(PACKAGE".png");
- GdkPixbuf* iconPixbuf = gdk_pixbuf_new_from_file(iconPath.c_str(),
- NULL);
- gtk_window_set_icon(GTK_WINDOW(dialog), iconPixbuf);
+ std::string iconPath(PACKAGE".png");
+ if (Resource::getPath(iconPath))
+ {
+ GdkPixbuf* iconPixbuf = gdk_pixbuf_new_from_file(iconPath.c_str(),
+ NULL);
+ gtk_window_set_icon(GTK_WINDOW(dialog), iconPixbuf);
+ }
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
dialog.setInformativeText(text2.c_str());
dialog.setStandardButtons(QMessageBox::Close);
- std::string iconPath = Resource::getPath(PACKAGE".png");
- QIcon icon(iconPath.c_str());
- dialog.setWindowIcon(icon);
+ std::string iconPath(PACKAGE".png");
+ if (Resource::getPath(iconPath))
+ {
+ QIcon icon(iconPath.c_str());
+ dialog.setWindowIcon(icon);
+ }
dialog.exec();