Touched up the error icon, show the error icon in the set contents dialog if the contents are gibberish.

Tue, 09 Apr 2013 18:16:01 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 09 Apr 2013 18:16:01 +0300
changeset 82
e61c50fdb8cc
parent 81
3970b22a836f
child 83
614ec2640e40

Touched up the error icon, show the error icon in the set contents dialog if the contents are gibberish.

icons/error.png file | annotate | diff | comparison | revisions
zz_setContentsDialog.cpp file | annotate | diff | comparison | revisions
zz_setContentsDialog.h file | annotate | diff | comparison | revisions
Binary file icons/error.png has changed
--- a/zz_setContentsDialog.cpp	Tue Apr 09 18:07:57 2013 +0300
+++ b/zz_setContentsDialog.cpp	Tue Apr 09 18:16:01 2013 +0300
@@ -43,6 +43,11 @@
 		qErrorLabel = new QLabel;
 		qErrorLabel->setText (str::mkfmt ("<span style=\"color: #900\">%s</span>",
 			static_cast<LDGibberish*> (obj)->zReason.chars()));
+		
+		QPixmap qErrorPixmap = QPixmap ("icons/error.png").scaledToHeight (16);
+		
+		qErrorIcon = new QLabel;
+		qErrorIcon->setPixmap (qErrorPixmap);
 	}
 	
 	IMPLEMENT_DIALOG_BUTTONS
@@ -53,8 +58,10 @@
 	
 	QHBoxLayout* layout2 = new QHBoxLayout;
 	
-	if (obj->getType() == OBJ_Gibberish)
+	if (obj->getType() == OBJ_Gibberish) {
+		layout2->addWidget (qErrorIcon);
 		layout2->addWidget (qErrorLabel);
+	}
 	
 	layout2->addWidget (qButtons);
 	layout->addLayout (layout2);
--- a/zz_setContentsDialog.h	Tue Apr 09 18:07:57 2013 +0300
+++ b/zz_setContentsDialog.h	Tue Apr 09 18:16:01 2013 +0300
@@ -31,7 +31,7 @@
 // =============================================================================
 class SetContentsDialog : public QDialog {
 public:
-	QLabel* qContentsLabel, *qErrorLabel;
+	QLabel* qContentsLabel, *qErrorIcon, *qErrorLabel;
 	QLineEdit* qContents;
 	QDialogButtonBox* qButtons;
 	

mercurial