void ZLQtDialogManager::errorBox(const ZLResourceKey &key, const std::string &message) const {
    QWidget *parent = qApp->activeWindow();
    if (parent == 0) {
        parent = myStoredWindow;
    }
    QMessageBox::critical(parent, ::qtString(dialogTitle(key)), ::qtString(message), ::qtButtonName(OK_BUTTON));
}
int ZLQtDialogManager::questionBox(const ZLResourceKey &key, const std::string &message, const ZLResourceKey &button0, const ZLResourceKey &button1, const ZLResourceKey &button2) const {
    QWidget *parent = qApp->activeWindow();
    if (parent == 0) {
        parent = myStoredWindow;
    }
    return QMessageBox::question(parent, ::qtString(dialogTitle(key)), ::qtString(message), ::qtButtonName(button0), ::qtButtonName(button1), ::qtButtonName(button2));
}
Ejemplo n.º 3
0
void ZLQtDialogManager::errorBox(const ZLResourceKey &key, const std::string &message) const {
	QMessageBox::critical(
		qApp->mainWidget(),
		::qtString(dialogTitle(key)),
		::qtString(message),
		::qtButtonName(OK_BUTTON)
	);
}
Ejemplo n.º 4
0
int ZLQtDialogManager::questionBox(const ZLResourceKey &key, const std::string &message, const ZLResourceKey &button0, const ZLResourceKey &button1, const ZLResourceKey &button2) const {
	return QMessageBox::question(
		qApp->mainWidget(),
		::qtString(dialogTitle(key)),
		::qtString(message),
		::qtButtonName(button0),
		::qtButtonName(button1),
		::qtButtonName(button2)
	);
}
Ejemplo n.º 5
0
shared_ptr<ZLOpenFileDialog> ZLQtDialogManager::createOpenFileDialog(const ZLResourceKey &key, const std::string &directoryPath, const std::string &filePath, const ZLOpenFileDialog::Filter &filter) const {
	return new ZLQtOpenFileDialog(dialogTitle(key), directoryPath, filePath, filter);
}
Ejemplo n.º 6
0
bool ZLGtkDialogManager::selectionDialog(const ZLResourceKey &key, ZLTreeHandler &handler) const {
	return ZLGtkSelectionDialog(dialogTitle(key).c_str(), handler).run();
}
bool ZLQtDialogManager::selectionDialog(const ZLResourceKey &key, ZLTreeHandler &handler) const {
    myStoredWindow = qApp->activeWindow();
    return ZLQtSelectionDialog(dialogTitle(key), handler).runWithSize();
}
bool ZLQtDialogManager::selectionDialog(const ZLResourceKey &key, ZLTreeHandler &handler) const {
	bool result = ZLQtSelectionDialog(dialogTitle(key), handler).run();
	fullScreenWorkaround();
	return result;
}
Ejemplo n.º 9
0
QString Telegram::title(int id) const
{
    return isDialog(id)? dialogTitle(id) : contactTitle(id);
}
Ejemplo n.º 10
0
void ZLQtDialogManager::errorBox(const ZLResourceKey &key, const std::string &message) const {
	QMessageBox::critical(myApplicationWindow->mainWindow(), ::qtString(dialogTitle(key)), ::qtString(message), ::qtButtonName(OK_BUTTON));
	fullScreenWorkaround();
}
Ejemplo n.º 11
0
int ZLQtDialogManager::questionBox(const ZLResourceKey &key, const std::string &message, const ZLResourceKey &button0, const ZLResourceKey &button1, const ZLResourceKey &button2) const {
	int code = QMessageBox::information(myApplicationWindow->mainWindow(), ::qtString(dialogTitle(key)), ::qtString(message), ::qtButtonName(button0), ::qtButtonName(button1), ::qtButtonName(button2));
	fullScreenWorkaround();
	return code;
}
Ejemplo n.º 12
0
int ZLGtkDialogManager::questionBox(const ZLResourceKey &key, const std::string &message, const ZLResourceKey &button0, const ZLResourceKey &button1, const ZLResourceKey &button2) const {
	return internalBox(GTK_STOCK_DIALOG_QUESTION, dialogTitle(key), message, button0, button1, button2);
}
Ejemplo n.º 13
0
void ZLGtkDialogManager::errorBox(const ZLResourceKey &key, const std::string &message) const {
	internalBox(GTK_STOCK_DIALOG_ERROR, dialogTitle(key), message);
}
Ejemplo n.º 14
0
void MainWindow::availableUpdateCheck(bool showOnlyPositives)
{

	char curVersionStr[] = DRUID4ARDUINO_VERSION_STRING();


	wxMessageDialog * msgDial = NULL;

	wxString versionURLStr(wxT(DRUID4ARDUINO_LATESTVERSION_URL));
	wxURL versionURL(versionURLStr);


	wxString dialogTitle(wxT("Version Check"));
	if (versionURL.GetError() != wxURL_NOERR)
	{
		if (! showOnlyPositives)
			msgDial = new wxMessageDialog(this, wxT("Could not connect to check version"),
					dialogTitle, wxOK | wxICON_ERROR);
	} else {
		// no error connecting...
		DRUID4ARDUINO_DEBUG("Connecting to verion #...");
		wxInputStream *in_stream;

		in_stream = versionURL.GetInputStream();

		if (! in_stream)
		{

			if (! showOnlyPositives)
				msgDial = new wxMessageDialog(this, wxT("Could not read (remote) version info"),
					dialogTitle, wxOK | wxICON_ERROR);

		} else {
			char buf[20];
			while (! in_stream->Eof())
			{
				in_stream->Read(buf, 20);
			}

			if (strncmp(curVersionStr, buf, strlen(curVersionStr)) == 0)
			{

				if (! showOnlyPositives)
					msgDial = new wxMessageDialog(this, wxT("Druid4Arduino is up to date!"),
						dialogTitle, wxOK | wxICON_INFORMATION);
			} else {

				wxString notifMsg(wxT("A newer version is available, upgrade to "));
				notifMsg += wxString(buf, wxConvUTF8);
				notifMsg += wxT(" at ");
				notifMsg += wxString(_T(DRUID4ARDUINO_SITE_URL));

				msgDial = new wxMessageDialog(this, notifMsg,
						dialogTitle, wxOK | wxICON_EXCLAMATION);
			}
		}

	} // end if we could get the URL

	if (msgDial != NULL)
		msgDial->ShowModal();
}
Ejemplo n.º 15
0
void ZLDialogManager::informationBox(const ZLResourceKey &key, const std::string &message) const {
	informationBox(dialogTitle(key), message);
}
bool ZLQtDialogManager::selectionDialog(const ZLResourceKey &key, ZLTreeHandler &handler) const {
	return ZLQtSelectionDialog(dialogTitle(key), handler).runWithSize();
}