Example #1
0
StartUpWidget::StartUpWidget(QWidget *parent) : MyWidget(parent) {

	this->setFullscreen(true);

	// A close button to close widget
	CustomPushButton *close = new CustomPushButton(tr("Okay, I got enough now. Lets start!"));
	close->setFontSize("12pt");
	QHBoxLayout *butLay = new QHBoxLayout;
	butLay->setMargin(8);
	butLay->addStretch();
	butLay->addWidget(close);
	butLay->addStretch();
	connect(close, SIGNAL(clicked()), this, SLOT(animate()));

	// Line above buttons
	CustomLine *line = new CustomLine;

	// Create and set the main layout
	QVBoxLayout *lay = new QVBoxLayout;
	this->setWidgetLayout(lay);
	this->addWidgetAtBottom(line);
	this->addButtonLayout(butLay);

	// The title is set depending on update or fresh install
	title = new CustomLabel;
	title->setFontSize(20);
	title->setBold(true);
	title->setAlignment(Qt::AlignCenter);
	title->setTextInteractionFlags(Qt::TextSelectableByMouse);

	// The logo
	CustomLabel *logo = new CustomLabel;
	QPixmap splash(":/img/logo.png");
	logo->setPixmap(splash);
	logo->setAlignment(Qt::AlignCenter);

	// The introduction is set depending on update or fresh install
	customIntro = new CustomLabel;
	customIntro->setFontSize(12);
	customIntro->setWordWrap(true);
	customIntro->setTextInteractionFlags(Qt::TextSelectableByMouse);

	// the description is the same in both cases
	CustomLabel *desc = new CustomLabel;
	desc->setFontSize(12);
	desc->setWordWrap(true);
	desc->setTextInteractionFlags(Qt::TextSelectableByMouse);

	QString descTxt = "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/fileformats.png\">";
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Many File Formats") + "</span><br>" + tr("PhotoQt can make use of GraphicsMagick, an image library, to display many different image formats. Currently, there are up to 72 different file formats supported (exact number depends on your system)! You can find a list of it in the settings (Tab 'Other'). There you can en-/disable different ones and also add custom file endings.");
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Make PhotoQt your own") + "</span><br>" + tr("PhotoQt has an extensive settings area. By default you can call it with the shortcut 'e' or through the dropdown menu at the top edge towards the top right corner. You can adjust almost everything in PhotoQt, and it's certainly worth having a look there. Each setting usually comes with a little explanation text.");
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/settings.png\">";
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/thumbnails.png\">";
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Thumbnails") + "</span><br>" + tr("What would be an image viewer without thumbnails support? It would only be half as good. Whenever you load an image, PhotoQt loads the other images in the directory in the background (by default, it tries to be smart about it and only loads the ones that are needed). It lines them up in a row at the bottom edge (move your mouse there to see them). There are many settings just for the thumbnails, like, e.g., size, liftup, en-/disabled, type, filename, permanently shown/hidden, etc. PhotoQt's quite flexible with that.");
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Shortcuts") + "</span><br>" + tr("One of the many strengths of PhotoQt is the ability to easily set a shortcut for almost anything. Even mouse shortcuts are possible! You can choose from a huge number of internal functions, or you can run any custom script or command.");
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/shortcuts.png\">";
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/exif.png\">";
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Image Information (Exif)") + "</span><br>" + tr("Most images store some information about the image in the file. PhotoQt can read and display a good bit of that (currently, only Exif is supported). You can find this information in the slide-in window hidden behind the left edge of PhotoQt.");
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Slideshow") + "</span><br>" + tr("PhotoQt also brings a slideshow feature. When you start a slideshow, it starts at the currently displayed image. There are a couple settings like transition, speed, loop, and shuffle. Plus, you can set a music file that is played in the background. When the slideshow takes longer than the music file, then PhotoQt starts the music file all over from the beginning. At anytime during the slideshow, you can move the mouse cursor to the top edge of the screen to get a little bar, where you can pause/exit the slideshow and adjust the music volume.");
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/slideshow.png\">";
	descTxt += "</td></tr>";

	descTxt += "</table>";
	descTxt += "<table>";

	descTxt += "<tr><td style=\"vertical-align: middle\">";
		descTxt += "<img src=\":/img/startupwidget/localisation.png\">";
	descTxt += "</td><td style=\"vertical-align: middle\">";
		descTxt += "<span style=\"font-size: 15pt; font-weight: bold\">" + tr("Localisation") + "</span><br>" + tr("PhotoQt comes with a number of translations. Many have taken some of their time to create/update one of them (Thank you!). Not all of them are complete... do you want to help?");
	descTxt += "</td></tr>";

	descTxt += "</table><br><br><br>";

	descTxt += tr("There are many many more features. Best is, you just give it a go. Don't forget to check out the settings to make PhotoQt YOUR image viewer.") + "<br><br><br>" + tr("Enjoy :-)") + "<br><br>";

	desc->setText(descTxt);

	lay->addSpacing(40);
	lay->addWidget(logo);
	lay->addSpacing(30);
	lay->addWidget(title);
	lay->addSpacing(20);
	lay->addWidget(customIntro);
	lay->addSpacing(10);
	lay->addWidget(desc);
	lay->addStretch();

}
Example #2
0
About::About(QWidget *parent) : MyWidget(parent) {

	this->setBorderArea(100,50);

	QVBoxLayout *lay = new QVBoxLayout;

	// The string right at the top, giving the license and author information
	license = new CustomLabel;
	license->setWordWrap(true);
	lay->addWidget(license);

	// The new logo
	QLabel *logo = new QLabel;
	logo->setPixmap(QPixmap(":/img/logo.png"));
	QHBoxLayout *logoLay = new QHBoxLayout;
	logo->setStyleSheet("background: transparent");
	logoLay->addStretch();
	logoLay->addWidget(logo);
	logoLay->addStretch();
	lay->addSpacing(20);
	lay->addLayout(logoLay);
	lay->addSpacing(30);

	// The main text block
	QString txt = tr("PhotoQt is a simple image viewer, designed to be good looking, highly configurable, yet easy to use and fast.") +  "<br><br>";
	txt += tr("With PhotoQt I try to be different than other image viewers (after all, there are plenty of good image viewers already out there). Its interface is kept very simple, yet there is an abundance of settings to customize the look and feel to make PhotoQt YOUR image viewer.") + "<br><br>";
	txt += tr("I'm not a trained programmer. I'm a simple Maths student that loves doing stuff like this. Most of my programming knowledge I taught myself over the past 10-ish years, and it has been developing a lot since I started PhotoQt. During my studies in university I learned a lot about the basics of programming that I was missing. And simply working on PhotoQt gave me a lot of invaluable experience. So the code of PhotoQt might in places not quite be done in the best of ways, but I think it's getting better and better with each release.") + "<br><br>";
	txt += tr("I heard a number of times people saying, that PhotoQt is a 'copy' of Picasa's image viewer. Well, it's not. In fact, I myself have never used Picasa. I have seen it in use though by others, and I can't deny that it influenced the basic design idea a little. But I'm not trying to do something 'like Picasa'. I try to do my own thing, and to do it as good as I can.");
	QString txt2 = tr("Don't forget to check out the website:") + " http://PhotoQt.org";
	QString txt3 = tr("If you find a bug or if you have a question or suggestion, tell me. I'm open to any feedback I get :)");
	QString txt4 = "<center><h2>" + tr("Thanks to everybody who contributed to PhotoQt and/or translated PhotoQt to another language! You guys rock!") + "</h2></center>";
	QString txt5 = tr("You want to join the team and do something, e.g. translating PhotoQt to another language? Drop me and email ([email protected]), and for translations, check the project page on Transifex: http://transifex.com/p/photo.");

	CustomLabel *text = new CustomLabel(txt);
	CustomLabel *text2 = new CustomLabel(txt2);
	CustomLabel *text3 = new CustomLabel(txt3);
	CustomLabel *text4 = new CustomLabel(txt4);
	CustomLabel *text5 = new CustomLabel(txt5);
	text->setTextInteractionFlags(Qt::TextSelectableByMouse);
	text->setFontSize(11);
	text->setWordWrap(true);
	text2->setToolTip(tr("Click to go to:") + " http://photoqt.org");
	text2->setTextInteractionFlags(Qt::TextSelectableByMouse);
	text2->setCursor(Qt::PointingHandCursor);
	text2->setFontSize(11);
	text2->setWordWrap(true);
	text3->setTextInteractionFlags(Qt::TextSelectableByMouse);
	text3->setFontSize(11);
	text3->setWordWrap(true);
	text4->setTextInteractionFlags(Qt::TextSelectableByMouse);
	text4->setFontSize(11);
	text4->setWordWrap(true);
	text4->setFixedWidth(600);
	QHBoxLayout *text4Lay = new QHBoxLayout;
	text4Lay->addStretch();
	text4Lay->addWidget(text4);
	text4Lay->addStretch();
	text5->setTextInteractionFlags(Qt::TextSelectableByMouse);
	text5->setFontSize(11);
	text5->setWordWrap(true);
	lay->addWidget(text);
	lay->addSpacing(10);
	lay->addWidget(text2);
	lay->addSpacing(10);
	lay->addWidget(text3);
	lay->addSpacing(20);
	lay->addLayout(text4Lay);
	lay->addSpacing(20);
	lay->addWidget(text5);
	lay->addStretch();
	connect(text2, SIGNAL(clicked()), this, SLOT(openWebsite()));

	this->setWidgetLayout(lay);

	// A close button at the bottom
	//: This string is written onto the "close" button of the about widget
	close = new CustomPushButton(tr("Okay, I got enough of that..."));
	QHBoxLayout *closeLay = new QHBoxLayout;
	closeLay->addStretch();
	closeLay->addWidget(close);
	closeLay->addStretch();
	closeLay->setMargin(10);
	CustomLine *line = new CustomLine;
	QVBoxLayout *botLay = new QVBoxLayout;
	botLay->addWidget(line);
	botLay->addLayout(closeLay);
	this->addButtonLayout(botLay);
	connect(close, SIGNAL(clicked()), this, SLOT(animate()));

}