Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
472 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,40 @@ | ||
#include "aboutdialog.h" | ||
#include "guishellapp.h" | ||
#include "utils.h" | ||
#include <QLabel> | ||
#include <QDialogButtonBox> | ||
#include <QVBoxLayout> | ||
#include <QPushButton> | ||
//#include "utils.h" | ||
//#include <QLabel> | ||
//#include <QDialogButtonBox> | ||
//#include <QVBoxLayout> | ||
//#include <QPushButton> | ||
|
||
AboutDialog::AboutDialog(QWidget *parent) | ||
: QDialog(parent) | ||
AboutDialog::AboutDialog() | ||
{ | ||
setWindowTitle(tr("About Doomsday Shell")); | ||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); | ||
title().setText("Doomsday Shell"); | ||
|
||
QVBoxLayout *box = new QVBoxLayout; | ||
setLayout(box); | ||
box->setSizeConstraint(QLayout::SetFixedSize); | ||
// QVBoxLayout *box = new QVBoxLayout; | ||
// setLayout(box); | ||
// box->setSizeConstraint(QLayout::SetFixedSize); | ||
|
||
QImage logo(imageResourcePath(":/images/shell.png")); | ||
// QImage logo(imageResourcePath(":/images/shell.png")); | ||
|
||
QLabel *img = new QLabel; | ||
img->setPixmap(QPixmap::fromImage(logo)); | ||
box->addWidget(img, 0, Qt::AlignHCenter); | ||
// QLabel *img = new QLabel; | ||
// img->setPixmap(QPixmap::fromImage(logo)); | ||
// box->addWidget(img, 0, Qt::AlignHCenter); | ||
|
||
QLabel *txt = new QLabel; | ||
box->addWidget(txt); | ||
txt->setMaximumWidth(logo.width() * 1.5f); | ||
txt->setTextFormat(Qt::RichText); | ||
txt->setWordWrap(true); | ||
txt->setText(tr("<b><big>Doomsday Shell %1</big></b><p>Copyright © %2<p>" | ||
"The Shell is a utility for controlling and monitoring " | ||
"Doomsday servers.") | ||
.arg(SHELL_VERSION) | ||
.arg("2013-2018 <a href=\"http://dengine.net/\">Deng Team</a>")); | ||
// QLabel *txt = new QLabel; | ||
// box->addWidget(txt); | ||
// txt->setMaximumWidth(logo.width() * 1.5f); | ||
// txt->setTextFormat(Qt::RichText); | ||
// txt->setWordWrap(true); | ||
// txt->setText(tr("<b><big>Doomsday Shell %1</big></b><p>Copyright © %2<p>" | ||
// "The Shell is a utility for controlling and monitoring " | ||
// "Doomsday servers.") | ||
// .arg(SHELL_VERSION) | ||
// .arg("2013-2018 <a href=\"http://dengine.net/\">Deng Team</a>")); | ||
|
||
connect(txt, SIGNAL(linkActivated(QString)), &GuiShellApp::app(), SLOT(openWebAddress(QString))); | ||
// connect(txt, SIGNAL(linkActivated(QString)), &GuiShellApp::app(), SLOT(openWebAddress(QString))); | ||
|
||
QDialogButtonBox *bbox = new QDialogButtonBox; | ||
box->addWidget(bbox); | ||
QPushButton *button = bbox->addButton(QDialogButtonBox::Close); | ||
connect(button, SIGNAL(clicked()), this, SLOT(accept())); | ||
// QDialogButtonBox *bbox = new QDialogButtonBox; | ||
// box->addWidget(bbox); | ||
// QPushButton *button = bbox->addButton(QDialogButtonBox::Close); | ||
// connect(button, SIGNAL(clicked()), this, SLOT(accept())); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,53 @@ | ||
#include "errorlogdialog.h" | ||
#include "preferences.h" | ||
#include <QLabel> | ||
#include <QDialogButtonBox> | ||
#include <QTextEdit> | ||
#include <QVBoxLayout> | ||
//#include <QLabel> | ||
//#include <QDialogButtonBox> | ||
//#include <QTextEdit> | ||
//#include <QVBoxLayout> | ||
|
||
using namespace de; | ||
|
||
DE_PIMPL(ErrorLogDialog) | ||
{ | ||
QLabel *msg; | ||
QTextEdit *text; | ||
// QLabel *msg; | ||
// QTextEdit *text; | ||
|
||
Impl(Public *i) : Base(i) | ||
{ | ||
QVBoxLayout *layout = new QVBoxLayout; | ||
// QVBoxLayout *layout = new QVBoxLayout; | ||
|
||
msg = new QLabel; | ||
layout->addWidget(msg, 0); | ||
// msg = new QLabel; | ||
// layout->addWidget(msg, 0); | ||
|
||
text = new QTextEdit; | ||
text->setReadOnly(true); | ||
text->setFont(Preferences::consoleFont()); | ||
QFontMetrics metrics(text->font()); | ||
text->setMinimumWidth(metrics.width("A") * 120); | ||
text->setMinimumHeight(metrics.height() * 15); | ||
layout->addWidget(text, 1); | ||
// text = new QTextEdit; | ||
// text->setReadOnly(true); | ||
// text->setFont(Preferences::consoleFont()); | ||
// QFontMetrics metrics(text->font()); | ||
// text->setMinimumWidth(metrics.width("A") * 120); | ||
// text->setMinimumHeight(metrics.height() * 15); | ||
// layout->addWidget(text, 1); | ||
|
||
QDialogButtonBox *buttons = new QDialogButtonBox; | ||
buttons->addButton(QDialogButtonBox::Ok); | ||
QObject::connect(buttons, SIGNAL(accepted()), thisPublic, SLOT(accept())); | ||
layout->addWidget(buttons, 0); | ||
// QDialogButtonBox *buttons = new QDialogButtonBox; | ||
// buttons->addButton(QDialogButtonBox::Ok); | ||
// QObject::connect(buttons, SIGNAL(accepted()), thisPublic, SLOT(accept())); | ||
// layout->addWidget(buttons, 0); | ||
|
||
self().setLayout(layout); | ||
// self().setLayout(layout); | ||
} | ||
}; | ||
|
||
ErrorLogDialog::ErrorLogDialog(QWidget *parent) : QDialog(parent), | ||
d(new Impl(this)) | ||
ErrorLogDialog::ErrorLogDialog() | ||
: d(new Impl(this)) | ||
{ | ||
setWindowTitle(tr("Error Log")); | ||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); | ||
title().setText("Error Log"); | ||
} | ||
|
||
void ErrorLogDialog::setMessage(QString const &message) | ||
void ErrorLogDialog::setMessage(const String &messageText) | ||
{ | ||
d->msg->setText(message); | ||
message().setText(messageText); | ||
} | ||
|
||
void ErrorLogDialog::setLogContent(QString const &text) | ||
void ErrorLogDialog::setLogContent(const String &text) | ||
{ | ||
d->text->setText(text); | ||
//d->text->setText(text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.