LabelTTF::LabelTTF(CCLabelTTF* label) : loadingValue("") { name = label->getString(); fitType = ResizeFont; fontFile = new CCString(label->getFontName()); alignment = kCCTextAlignmentCenter; realDimensions = label->getDimensions(); delegate = label; label->retain(); fullFontFile = ScreateF("%s%d%s", label->getFontName(), (int)label->getFontSize(), isColorEqual(label->getColor() , ccBLACK) ? "Black" : isColorEqual(label->getColor() , ccWHITE) ? "White" : "Gray"); fullFontFile->retain(); CustomLabel* customLabel = dynamic_cast<CustomLabel*>(label); if(customLabel != NULL) { fitType = customLabel->getFitType(); } if(fitType != NoResize) { label->setDimensions(CCSizeZero); } delegate->setDimensions(CCSizeMake(realDimensions.width / this->getScale(), 0)); delegate->enableUpdate(true); this->adjustLabel(); }
// A click on a context menu item (CustomLabel) void GraphicsView::contextMenuClickedWidgetAction() { CustomLabel *action = (CustomLabel *)sender(); QString cmd = action->objectName(); cmd.startsWith("__CTX__") ? loadContextMenuAction(cmd) : loadContextMenuAction(QString("1:::::%1").arg(cmd)); }
void show(const char* message) { message_label.setText(QString::fromUtf8(message)); // resize and move the window to the top right corner resize(WIDTH, HEIGHT); move(QDesktopWidget().screenGeometry().width() - WIDTH, 0); QMainWindow::show(); startTimer(1000); }
NotifyWindow() : QMainWindow(0, Qt::SplashScreen | Qt::WindowStaysOnTopHint) { QFont font = message_label.font(); font.setBold(true); font.setPointSize(12); message_label.setFont(font); message_label.setWordWrap(true); message_label.setFrameShape(QFrame::WinPanel); message_label.setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); message_label.setGeometry(0, 0, WIDTH, HEIGHT); setCentralWidget(&message_label); setStyleSheet("background-color: white;"); }
Scale::Scale(bool verbose, QWidget *parent) : MyWidget(parent) { this->setVisibleArea(QSize(550,300)); // Some variables ignoreSizeChange = false; this->verbose = verbose; // A title label CustomLabel *title = new CustomLabel("<center><h1>" + tr("Scale Image") + "</h1></center>"); // A label to display the current size curSize = new CustomLabel("<center>" + tr("Current Size:") + "</center>"); // Layout for the spinboxes and their labels QGridLayout *spinLay = new QGridLayout; // Width label and spinbox CustomLabel *widthLabel = new CustomLabel(" " + tr("New Width:")); widthLabel->setAlignment(Qt::AlignRight); widthSpin = new CustomSpinBox; widthSpin->setObjectName("w"); widthSpin->setMaximum(999999); widthSpin->setFixedWidth(70); widthSpin->setBackground("white", "black"); widthSpin->setBorder("black",1); widthSpin->setFontColor("black","grey"); widthSpin->setEnabled(false); spinLay->addWidget(widthLabel,0,0); spinLay->addWidget(widthSpin,0,1); connect(widthSpin, SIGNAL(valueChanged(int)), this, SLOT(sizeChanged())); // Height label and spinbox CustomLabel *heightLabel = new CustomLabel(" " + tr("New Height:")); heightLabel->setAlignment(Qt::AlignRight); heightSpin = new CustomSpinBox; heightSpin->setObjectName("h"); heightSpin->setMaximum(999999); heightSpin->setFixedWidth(70); heightSpin->setBackground("white", "black"); heightSpin->setBorder("black",1); heightSpin->setFontColor("black","grey"); heightSpin->setEnabled(false); spinLay->addWidget(heightLabel,1,0); spinLay->addWidget(heightSpin,1,1); connect(heightSpin, SIGNAL(valueChanged(int)), this, SLOT(sizeChanged())); // Checkbox to keep aspect ratio keepratio = new CustomCheckBox(tr("Aspect Ratio")); keepratio->setIndicatorImage(":/img/ratioKeep.png",":/img/ratioDontKeep.png", ":/img/ratioKeep.png",":/img/ratioDontKeep.png"); keepratio->setChecked(true); keepRatioClicked(); // Set tooltip etc. connect(keepratio, SIGNAL(clicked()), this, SLOT(keepRatioClicked())); connect(keepratio, SIGNAL(clicked()), this, SLOT(sizeChanged())); // Layout to put the above in horizontal order QHBoxLayout *spinCheckLay = new QHBoxLayout; spinCheckLay->addStretch(); spinCheckLay->addLayout(spinLay); spinCheckLay->addWidget(keepratio); spinCheckLay->addStretch(); // Set the quality of the scaling CustomLabel *qualityLabel = new CustomLabel(tr("Quality:")); CustomSpinBox *qualityValue = new CustomSpinBox; qualityValue->setMinimum(0); qualityValue->setMaximum(100); qualityValue->setValue(90); quality = new CustomSlider; quality->setMinimum(0); quality->setMaximum(100); quality->setFixedWidth(150); quality->setValue(90); QHBoxLayout *qualityLay = new QHBoxLayout; qualityLay->addStretch(); qualityLay->addWidget(qualityLabel); qualityLay->addWidget(quality); qualityLay->addWidget(qualityValue); qualityLay->addStretch(); connect(qualityValue, SIGNAL(valueChanged(int)), quality, SLOT(setValue(int))); connect(quality, SIGNAL(valueChanged(int)), qualityValue, SLOT(setValue(int))); // Pushbuttons to go ahead or cancel enterInPlace = new CustomPushButton(tr("Scale in place")); enterInPlace->setObjectName("enterInPlace"); CustomPushButton *enterNew = new CustomPushButton(tr("Scale in new file")); enterNew->setObjectName("enterNew"); CustomPushButton *cancel = new CustomPushButton(tr("Don't Scale")); QHBoxLayout *butLay = new QHBoxLayout; butLay->addStretch(); butLay->addWidget(enterInPlace); butLay->addWidget(enterNew); butLay->addWidget(cancel); butLay->addStretch(); connect(cancel, SIGNAL(clicked()), this, SLOT(disableAllSpinBoxAndClose())); connect(enterInPlace, SIGNAL(clicked()), this, SLOT(enterClicked())); connect(enterNew, SIGNAL(clicked()), this, SLOT(enterClicked())); // Put everything into layout and set to widget QVBoxLayout *lay = new QVBoxLayout; lay->addWidget(title); lay->addSpacing(15); lay->addWidget(curSize); lay->addSpacing(20); lay->addLayout(spinCheckLay); lay->addSpacing(10); lay->addLayout(qualityLay); lay->addSpacing(15); lay->addLayout(butLay); lay->addStretch(); this->setWidgetLayout(lay); // We need to initialise them here, otherwise the system shortcut in mainwindow.cpp might cause a crash confirmNotSupported = new CustomConfirm("",""); confirmInPlace = new CustomConfirm("",""); confirmNew = new CustomConfirm("",""); }
void InputMappingDialog::addProcessorToLayout(const Processor* processor) { tgtAssert(scrollLayout_, "No scroll layout"); // processor's event properties std::vector<EventPropertyBase*> eventProps = processor->getEventProperties(); // processor's interaction handlers (each with its own event property(ies) + maybe normal properties) const std::vector<InteractionHandler*> procHandlers = processor->getInteractionHandlers(); std::vector<EventPropertyBase*> handlerEventProps; std::vector<Property*> handlerProps; for (size_t i=0; i<procHandlers.size(); i++) { for (size_t j=0; j<procHandlers[i]->getEventProperties().size(); j++) { handlerEventProps.push_back(procHandlers[i]->getEventProperties().at(j)); } for (size_t j=0; j<procHandlers[i]->getProperties().size(); j++) { handlerProps.push_back(procHandlers[i]->getProperties().at(j)); } } eventProps.insert(eventProps.begin(), handlerEventProps.begin(), handlerEventProps.end()); if (eventProps.empty() && handlerProps.empty()) return; // create event property widgets for processor QString title = QString::fromStdString(processor->getName()); QGroupBox* processorBox = new QGroupBox(title); QVBoxLayout* boxLayout = new QVBoxLayout(); boxLayout->setSpacing(1); processorBox->setLayout(boxLayout); // add widgets for collected interaction handler's normal properties if (!VoreenApplication::app()) { LERRORC("voreen.qt.InputMappingDialog", "VoreenApplication not instantiated"); return; } for (size_t p=0; p<handlerProps.size(); p++) { Property* prop = handlerProps.at(p); PropertyWidget* propWidget = VoreenApplication::app()->createPropertyWidget(prop); if (propWidget) prop->addWidget(propWidget); if (QPropertyWidget* qPropWidget = dynamic_cast<QPropertyWidget*>(propWidget)) { QHBoxLayout* layoutTemp = new QHBoxLayout(); layoutTemp->setContentsMargins(2,2,2,2); CustomLabel* nameLabel = qPropWidget->getNameLabel(); nameLabel->setMinimumWidth(0); layoutTemp->addWidget(nameLabel); layoutTemp->addSpacing(5); layoutTemp->addWidget(qPropWidget); layoutTemp->addStretch(); boxLayout->addLayout(layoutTemp); } else if (propWidget) { LERRORC("voreenqt.InputMappingDialog", "Created PropertyWidget is not of type QPropertyWidget"); } } // add widgets for collected event properties for (size_t j=0; j<eventProps.size(); j++) { EventPropertyWidget* wdt = new EventPropertyWidget(eventProps[j]); eventProps[j]->addWidget(wdt); boxLayout->addWidget(wdt); } // add processor box processorBoxMap_.insert(const_cast<Processor*>(processor), processorBox); scrollLayout_->addWidget(processorBox); }
void GraphicsView::setupContextMenu() { // Get the last modification date qint64 secs = QFileInfo(QDir::homePath() + "/.photoqt/contextmenu").lastModified().toMSecsSinceEpoch(); // If the menu has been modified since last time or hasn't been setup yet, we set it up if(secs != menuLastChange || !menuSetup) { menuSetup = true; menuLastChange = secs; // Make sure it's empty (after a change, we would re-setup the menu and not calling clear() would lead to double entries) menu->clear(); // Move in directory QWidgetAction *moveImg = new QWidgetAction(menu); CustomLabel *move = new CustomLabel(tr("Move:")); move->setStyleSheet("QLabel {color: rgba(180,180,180,255); background: transparent; }"); CustomLabel *moveFirst = new CustomLabel; moveFirst->setPixmap(QPixmap(":/img/firstSmall.png")); moveFirst->setObjectName("__CTX__movefirst"); moveFirst->setCursor(Qt::PointingHandCursor); CustomLabel *moveLeft = new CustomLabel(tr("Previous")); moveLeft->setObjectName("__CTX__moveprev"); moveLeft->setCursor(Qt::PointingHandCursor); CustomLabel *moveRight = new CustomLabel(tr("Next")); moveRight->setObjectName("__CTX__movenext"); moveRight->setCursor(Qt::PointingHandCursor); CustomLabel *moveLast = new CustomLabel; moveLast->setPixmap(QPixmap(":/img/lastSmall.png")); moveLast->setObjectName("__CTX__movelast"); moveLast->setCursor(Qt::PointingHandCursor); QWidget *moveWid = new QWidget; QHBoxLayout *moveLay = new QHBoxLayout; moveLay->addWidget(move); moveLay->addSpacing(5); moveLay->addWidget(moveFirst); moveLay->addSpacing(5); moveLay->addWidget(moveLeft); moveLay->addWidget(moveRight); moveLay->addSpacing(5); moveLay->addWidget(moveLast); moveLay->addStretch(); moveWid->setLayout(moveLay); moveImg->setDefaultWidget(moveWid); menu->addAction(moveImg); connect(moveFirst, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(moveLeft, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(moveRight, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(moveLast, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); // Rotate Image QWidgetAction *rotateImg = new QWidgetAction(menu); CustomLabel *rot = new CustomLabel(tr("Rotate:")); rot->setStyleSheet("QLabel {color: rgba(180,180,180,255); background: transparent; }"); CustomLabel *rotLeft = new CustomLabel("<img src=\":/img/rotateLeftSmall.png\"> " + tr("Left")); rotLeft->setObjectName("__CTX__rotateleft"); rotLeft->setCursor(Qt::PointingHandCursor); CustomLabel *rotRight = new CustomLabel(tr("Right") + " <img src=\":/img/rotateRightSmall.png\">"); rotRight->setObjectName("__CTX__rotateright"); rotRight->setCursor(Qt::PointingHandCursor); QWidget *rotWid = new QWidget; QHBoxLayout *rotLay = new QHBoxLayout; rotLay->addWidget(rot); rotLay->addSpacing(5); rotLay->addWidget(rotLeft); rotLay->addSpacing(10); rotLay->addWidget(rotRight); rotLay->addStretch(); rotWid->setLayout(rotLay); rotateImg->setDefaultWidget(rotWid); menu->addAction(rotateImg); connect(rotLeft, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(rotRight, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); // Flip Image QWidgetAction *flipImg = new QWidgetAction(menu); CustomLabel *flip = new CustomLabel(tr("Flip:")); flip->setStyleSheet("QLabel {color: rgba(180,180,180,255); background: transparent; }"); CustomLabel *flipHor = new CustomLabel("<img src=\":/img/flipHSmall.png\"> " + tr("Horizontal")); flipHor->setObjectName("__CTX__fliph"); flipHor->setCursor(Qt::PointingHandCursor); CustomLabel *flipVer = new CustomLabel("<img src=\":/img/flipVSmall.png\">" + tr("Vertical")); flipVer->setObjectName("__CTX__flipv"); flipVer->setCursor(Qt::PointingHandCursor); QWidget *flipWid = new QWidget; QHBoxLayout *flipLay = new QHBoxLayout; flipLay->addWidget(flip); flipLay->addSpacing(5); flipLay->addWidget(flipHor); flipLay->addSpacing(5); flipLay->addWidget(flipVer); flipLay->addStretch(); flipWid->setLayout(flipLay); flipImg->setDefaultWidget(flipWid); menu->addAction(flipImg); connect(flipHor, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(flipVer, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); // Zoom Image QWidgetAction *zoomImg = new QWidgetAction(menu); CustomLabel *zoom = new CustomLabel(tr("Zoom:")); zoom->setStyleSheet("QLabel {color: rgba(180,180,180,255); background: transparent; }"); CustomLabel *zoomIn = new CustomLabel("(+) " + tr("In")); zoomIn->setObjectName("__CTX__zoomin"); zoomIn->setCursor(Qt::PointingHandCursor); CustomLabel *zoomOut = new CustomLabel("(-) " + tr("Out")); zoomOut->setObjectName("__CTX__zoomout"); zoomOut->setCursor(Qt::PointingHandCursor); CustomLabel *zoomActual = new CustomLabel("(1:1) " + tr("Actual")); zoomActual->setObjectName("__CTX__zoomactual"); zoomActual->setCursor(Qt::PointingHandCursor); CustomLabel *zoomReset = new CustomLabel("(0) " + tr("Reset")); zoomReset->setObjectName("__CTX__zoomreset"); zoomReset->setCursor(Qt::PointingHandCursor); QWidget *zoomWid = new QWidget; QHBoxLayout *zoomLay = new QHBoxLayout; zoomLay->addWidget(zoom); zoomLay->addSpacing(5); zoomLay->addWidget(zoomIn); zoomLay->addSpacing(5); zoomLay->addWidget(zoomOut); zoomLay->addSpacing(5); zoomLay->addWidget(zoomActual); zoomLay->addSpacing(5); zoomLay->addWidget(zoomReset); zoomLay->addStretch(); zoomWid->setLayout(zoomLay); zoomImg->setDefaultWidget(zoomWid); menu->addAction(zoomImg); connect(zoomIn, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(zoomOut, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(zoomActual, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); connect(zoomReset, SIGNAL(clicked()), this, SLOT(contextMenuClickedWidgetAction())); menu->addSeparator(); QAction *scale = new QAction(tr("Scale Image"), menu); scale->setData("__CTX__scaleimage"); scale->setIcon(QIcon(":/img/scale.png")); menu->addAction(scale); connect(scale, SIGNAL(triggered()), this, SLOT(contextMenuClicked())); menu->addSeparator(); QAction *openInFm = new QAction(tr("Open in default File Manager"), menu); openInFm->setData("__CTX__openinfm"); openInFm->setIcon(QIcon(":/img/open.png")); menu->addAction(openInFm); connect(openInFm, SIGNAL(triggered()), this, SLOT(contextMenuClicked())); QAction *deleteFile = new QAction(tr("Delete File"), menu); deleteFile->setData("__CTX__delete"); deleteFile->setIcon(QIcon(":/img/delete.png")); menu->addAction(deleteFile); connect(deleteFile, SIGNAL(triggered()), this, SLOT(contextMenuClicked())); QAction *renameFile = new QAction(tr("Rename File"), menu); renameFile->setData("__CTX__rename"); renameFile->setIcon(QIcon(":/img/rename.png")); menu->addAction(renameFile); connect(renameFile, SIGNAL(triggered()), this, SLOT(contextMenuClicked())); menu->addSeparator(); // Now read in the additional entries from file QFile file(QDir::homePath() + "/.photoqt/contextmenu"); if(file.open(QIODevice::ReadOnly)) { QTextStream in(&file); QStringList all = in.readAll().split("\n\n",QString::SkipEmptyParts); // And set up the rest of the menu for(int i = 0; i < all.length(); ++i) { QString cmd = all.at(i).split("\n").at(0); QString desc = all.at(i).split("\n").at(1); QString binary = cmd; binary = binary.remove("%f").remove("%d"); binary = binary.trimmed(); QAction *action = new QAction(desc, menu); action->setIcon(QIcon::fromTheme(binary)); action->setData(cmd); menu->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(contextMenuClicked())); } } } }
AboutQtDialog::AboutQtDialog() : QWidget(NULL) { setWindowTitle(tr("About Qt")); StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this, STS_PLUGINMANAGER_ABOUT_QT); CustomBorderContainer *border = CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG); if (border) { border->setAttribute(Qt::WA_DeleteOnClose, true); border->setResizable(false); border->setMinimizeButtonVisible(false); border->setMaximizeButtonVisible(false); } else { setAttribute(Qt::WA_DeleteOnClose, true); setWindowFlags(Qt::Dialog | Qt::WindowTitleHint); } #ifdef Q_WS_MAC setWindowGrowButtonEnabled(this->window(), false); #endif // creating layouts and items // main layout setLayout(new QVBoxLayout(this)); layout()->setContentsMargins(8, 18, 8, 6); layout()->setSpacing(14); // text and icon layout QHBoxLayout * textLayout = new QHBoxLayout; textLayout->setSpacing(6); CustomLabel * icon = new CustomLabel(this); IconStorage::staticStorage(RSR_STORAGE_MENUICONS)->insertAutoIcon(icon, MNI_PLUGINMANAGER_ABOUT_QT, 0, 0, "pixmap"); icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop); icon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); textLayout->addWidget(icon); QVBoxLayout * captLayout = new QVBoxLayout; captLayout->setSpacing(8); CustomLabel * caption = new CustomLabel(this); caption->setObjectName("caption"); caption->setText(tr("About Qt")); CustomLabel * text = new CustomLabel(this); text->setTextFormat(Qt::RichText); text->setWordWrap(true); text->setMaximumWidth(350); text->setOpenExternalLinks(true); text->setObjectName("lblAboutQtText"); GraphicsEffectsStorage::staticStorage(RSR_STORAGE_GRAPHICSEFFECTS)->installGraphicsEffect(text, GFX_LABELS); QString localizedText = tr("<p>This program uses Qt version %1.</p>" "<p>Qt is a C++ toolkit for cross-platform application " "development.</p>" "<p>Qt provides single-source portability across MS Windows, " "Mac OS X, Linux, and all major commercial Unix variants. " "Qt is also available for embedded devices as Qt for Embedded Linux " "and Qt for Windows CE.</p>" "<p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the " "development of Qt applications (proprietary or open source) provided " "you can comply with the terms and conditions of the GNU LGPL version " "2.1.</p>" "<p>Please see <a href=\"http://qt.nokia.com/products/licensing\">qt.nokia.com/products/licensing</a> " "for an overview of Qt licensing.</p>" "<p>Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</p>" "<p>Qt is a Nokia product. See <a href=\"http://qt.nokia.com/\">qt.nokia.com</a> " "for more information.</p>").arg(QLatin1String(QT_VERSION_STR)); // adding shadow (it's a rich text) text->setText(localizedText); captLayout->addWidget(caption); captLayout->addWidget(text); textLayout->addItem(captLayout); // button layout QHBoxLayout * buttonLayout = new QHBoxLayout; buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); QPushButton * okButton = new QPushButton(this); okButton->setDefault(true); okButton->setAutoDefault(false); okButton->setText(tr("OK")); connect(okButton, SIGNAL(clicked()), (parentWidget() ? parentWidget() : this), SLOT(close())); buttonLayout->addWidget(okButton); layout()->addItem(textLayout); layout()->addItem(buttonLayout); }
SettingsTabOther::SettingsTabOther(QWidget *parent, QMap<QString, QVariant> set, bool v) : QWidget(parent) { // The global settings globSet = set; verbose = v; this->setObjectName("tabother"); this->setStyleSheet("#tabother { background: transparent; color: white; }"); tabs = new TabWidget; tabs->expand(false); tabs->setBorderTop("rgba(150,150,150,100)",2); tabs->setBorderBot("rgba(150,150,150,100)",2); QVBoxLayout *mainLay = new QVBoxLayout; mainLay->addWidget(tabs); this->setLayout(mainLay); // the main scroll widget for all LOOK content scrollbarOther = new CustomScrollbar; QScrollArea *scrollOther = new QScrollArea; QVBoxLayout *layOther = new QVBoxLayout(scrollOther); QWidget *scrollWidgOther = new QWidget(scrollOther); scrollWidgOther->setLayout(layOther); scrollOther->setWidget(scrollWidgOther); scrollOther->setWidgetResizable(true); scrollOther->setVerticalScrollBar(scrollbarOther); // the main scroll widget for all FEEL content scrollbarFile = new CustomScrollbar; QScrollArea *scrollFile = new QScrollArea; QVBoxLayout *layFile = new QVBoxLayout(scrollFile); QWidget *scrollWidgFile = new QWidget(scrollFile); scrollWidgFile->setLayout(layFile); scrollFile->setWidget(scrollWidgFile); scrollFile->setWidgetResizable(true); scrollFile->setVerticalScrollBar(scrollbarFile); tabOther = new QWidget; tabFile = new QWidget; QVBoxLayout *scrollLayOther = new QVBoxLayout; scrollLayOther->addWidget(scrollOther); tabOther->setLayout(scrollLayOther); QVBoxLayout *scrollLayFile = new QVBoxLayout; scrollLayFile->addWidget(scrollFile); tabFile->setLayout(scrollLayFile); tabs->addTab(tabOther,tr("Other")); tabs->addTab(tabFile,tr("File Types")); // The titles CustomLabel *titleOther = new CustomLabel("<center><h1>" + tr("Other Settings") + "</h1></center>"); layOther->addWidget(titleOther); layOther->addSpacing(20); CustomLabel *titleFile = new CustomLabel("<center><h1>" + tr("Known File Types") + "</h1></center>"); layFile->addWidget(titleFile); layFile->addSpacing(20); // CHOOSE A LANGUAGE CustomLabel *langLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Choose Language") + "</span></b><br><br>" + tr("There are a good few different languages available. Thanks to everybody who took the time to translate PhotoQt!")); langLabel->setWordWrap(true); layOther->addWidget(langLabel); layOther->addSpacing(15); // All the languages available. They are sorted according to their language code (except English) // A GOOD FEW OF THE TRANSLATIONS HAVEN'T BEEN UPDATED IN A LONG TIME AND ARE STANDING AT 0-5% // These translations are NOT included! langDesc << "English"; langShort << "en"; // Arabic // langDesc << QString::fromUtf8("العربية (Amar T.)"); // langShort << "ar"; // Czech langDesc << QString::fromUtf8("Čeština (Robin H. & Petr Š.)"); langShort << "cs"; // German langDesc << "Deutsch"; langShort << "de"; // Greek langDesc << QString::fromUtf8("Ελληνικά (Dimitrios G.)"); langShort << "el"; // Spanish langDesc << QString::fromUtf8("Español (Hector C. & Victoria P.)"); langShort << "es_ES"; // Finnish langDesc << QString::fromUtf8("Suomen kieli (Jiri G.)"); langShort << "fi"; // French langDesc << QString::fromUtf8("Français (Olivier D. & Tubuntu)"); langShort << "fr"; // Hungarian // langDesc << QString::fromUtf8("Magyar (Zoltan H.)"); // langShort << "hu"; // Hebrew langDesc << QString::fromUtf8("עברית (GenghisKhan)"); langShort << "he"; // Italian langDesc << "Italiano (Vincenzo C. & Fabio M.)"; langShort << "it"; // Japanese langDesc << QString::fromUtf8("日本語 (Obytetest)"); langShort << "ja"; // Norwegian Bokmal // langDesc << QString::fromUtf8("Bokmål (Ola Haugen H.)"); // langShort << "nb_NO"; // Norwegian Nynorsk // langDesc << "Nynorsk (Ola Haugen H.)"; // langShort << "nn_NO"; // Polish // langDesc << "Polski (Daniel K.)"; // langShort << "pl"; // Portugal (Brazil) langDesc << QString::fromUtf8("Português (Brasil) (Rafael N. & Everton)"); langShort << "pt_BR"; // Portugal (Portugal) langDesc << QString::fromUtf8("Português (Portugal) (Sérgio M. & Manuela S. & Willow)"); langShort << "pt_PT"; // Russian langDesc << QString::fromUtf8("Pусский (Yuriy T.)"); langShort << "ru_RU"; //Slovak langDesc << QString::fromUtf8("Slovenčina (Lukáš D.)"); langShort << "sk"; // Serbian // langDesc << QString::fromUtf8("српски екавски (Mladen Pejaković)"); // langShort << "sr_RS"; // Turkish // langDesc << QString::fromUtf8("Türkçe (Onuralp SEZER)"); // langShort << "tr"; // Ukrainian langDesc << QString::fromUtf8("Українська (neeesdfsdf & zubr139)"); langShort << "uk_UA"; // Viatnemese // langDesc << QString::fromUtf8("Tiếng Việt (Nguyễn Hữu Tài)"); // langShort << "vi"; // Chinese (China) langDesc << "Chinese (Min Zhang)"; langShort << "zh_CN"; langDesc << "Chinese (traditional) (Min Zhang)"; langShort << "zh_TW"; FlowLayout *langLay = new FlowLayout; QButtonGroup *langButGrp = new QButtonGroup; for(int i = 0; i < langDesc.length(); ++i) { SettingsTabOtherLanguageTiles *tile = new SettingsTabOtherLanguageTiles(langDesc.at(i), langShort.at(i)); allLangTiles << tile; langButGrp->addButton(tile->button); langLay->addWidget(tile); } QHBoxLayout *langWidgLay = new QHBoxLayout; langWidgLay->addSpacing(50); langWidgLay->addLayout(langLay); langWidgLay->addSpacing(50); layOther->addLayout(langWidgLay); layOther->addSpacing(30); // Adjust quick settings trigering CustomLabel *quickSetLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Quick Settings") + "</span></b><br><br>" + tr("The 'Quick Settings' is a widget hidden on the right side of the screen. When you move the cursor there, it shows up, and you can adjust a few simple settings on the spot without having to go through this settings dialog. Of course, only a small subset of settings is available (the ones needed most often). Here you can disable the dialog so that it doesn't show on mouse movement anymore.")); quickSet = new CustomCheckBox(tr("Show 'Quick Settings' on mouse hovering")); QHBoxLayout *quickSetLay = new QHBoxLayout; quickSetLay->addStretch(); quickSetLay->addWidget(quickSet); quickSetLay->addStretch(); layOther->addWidget(quickSetLabel); layOther->addSpacing(20); layOther->addLayout(quickSetLay); layOther->addSpacing(30); // Adjust context menu CustomLabel *contextMenuLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Adjust Context Menu") + "</span></b><br><br>" + tr("Here you can adjust the context menu. You can simply drag and drop the entries, edit them, add a new one and remove an existing one.")); context = new Context; QHBoxLayout *contextLay = new QHBoxLayout; contextLay->addStretch(); contextLay->addWidget(context); contextLay->addStretch(); CustomPushButton *addNew = new CustomPushButton("+ " + tr("Add new Entry"),this); QHBoxLayout *addNewLay = new QHBoxLayout; connect(addNew, SIGNAL(clicked()), context, SLOT(addNewEntry())); addNewLay->addStretch(); addNewLay->addWidget(addNew); addNewLay->addStretch(); layOther->addWidget(contextMenuLabel); layOther->addSpacing(10); layOther->addLayout(contextLay); layOther->addLayout(addNewLay); layOther->addSpacing(20); allCheckQt.clear(); allCheckGm.clear(); allCheckGmUnstable.clear(); // Adjust known file formats CustomLabel *titleQt = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - Qt") + "</span></b><br><br>" + tr("These are the standard file types supported by Qt. Depending on your system, this list can vary a little.") + "<br>" + tr("If you want to add a file type not in the list, you can add them in the text box below. You have to enter the formats like '*.ending', all seperated by commas.") + "</b>"); titleQt->setWordWrap(true); FlowLayout *layQt = new FlowLayout; QStringList formatsQt; formatsQt << ".bmp" << ".gif" << ".tif" << ".tiff" << ".jpeg2000" << ".jpeg" << ".jpg" << ".png" << ".pbm" << ".pgm" << ".ppm" << ".xbm" << ".xpm"; formatsQt.sort(); for(int i = 0; i < formatsQt.length(); ++i) { SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsQt.at(i)); check->setToolTip(formatsQt.at(i)); allCheckQt.insert(formatsQt.at(i),check); layQt->addWidget(check); } QHBoxLayout *layQtBut = new QHBoxLayout; CustomLabel *extraQt = new CustomLabel(tr("Extra File Types:")); extraQt->setWordWrap(false); extraQtEdit = new CustomLineEdit; CustomPushButton *qtMarkAll = new CustomPushButton(tr("Mark All")); CustomPushButton *qtMarkNone = new CustomPushButton(tr("Mark None")); layQtBut->addWidget(extraQt); layQtBut->addWidget(extraQtEdit); layQtBut->addStretch(); layQtBut->addWidget(qtMarkAll); layQtBut->addWidget(qtMarkNone); layFile->addWidget(titleQt); layFile->addSpacing(10); layFile->addLayout(layQt); layFile->addSpacing(5); layFile->addLayout(layQtBut); layFile->addSpacing(35); QSignalMapper *mapQtMark = new QSignalMapper; mapQtMark->setMapping(qtMarkAll,"qtMark"); connect(qtMarkAll, SIGNAL(clicked()), mapQtMark, SLOT(map())); connect(mapQtMark, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); QSignalMapper *mapQtNone = new QSignalMapper; mapQtNone->setMapping(qtMarkNone,"qtNone"); connect(qtMarkNone, SIGNAL(clicked()), mapQtNone, SLOT(map())); connect(mapQtNone, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); #ifndef GM CustomLabel *gmDisabled = new CustomLabel("<b><i>" + tr("Use of GraphicsMagick has been disabled as PhotoQt was compiled/installed!") + "</i></b>"); gmDisabled->setWordWrap(true); #endif CustomLabel *titleGmWorking = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - GraphicsMagick") + "</span></b><br><br>" + tr("PhotoQt makes use of GraphicsMagick for support of many different file types. Not all of the formats supported by GraphicsMagick make sense in an image viewer. There are some that aren't quite working at the moment, you can find them in the 'Unstable' category below.") + "<br>" + tr("If you want to add a file type not in the list, you can add them in the text box below. You have to enter the formats like '*.ending', all seperated by commas.") + "</b>"); titleGmWorking->setWordWrap(true); FlowLayout *layGm = new FlowLayout; QStringList formatsGm; formatsGm << ".art" << ".avs" << ".x" << ".cals" << ".cgm" << ".cur" << ".cut" << ".acr" << ".dcm" << ".dicom" << ".dic" << ".dcx" << ".dib" << ".dpx" << ".emf" << ".epdf" << ".epi" << ".eps" << ".eps2" << ".eps3" << ".epsf" << ".epsi" << ".ept" << ".fax" << ".fig" << ".fits" << ".fts" << ".fit" << ".fpx" << ".gplt" << ".ico" << ".jbg" << ".jbig" << ".jng" << ".jp2" << ".j2k" << ".jpf" << ".jpx" << ".jpm" << ".mj2" << ".jpc" << ".mat" << ".miff" << ".mng" << ".mpc" << ".mtv" << ".otb" << ".p7" << ".palm" << ".pam" << ".pcd" << ".pcds" << ".pcx" << ".pdb" << ".pdf" << ".picon" << ".pict" << ".pct" << ".pic" << ".pix" << ".pnm" << ".ps" << ".ps2" << ".ps3" << ".psd" << ".ptif" << ".ras" << ".rast" << ".rad" << ".sgi" << ".sun" << ".svg" << ".tga" << ".vicar" << ".viff" << ".wbmp" << ".wbm" << ".xcf" << ".xwd"; formatsGm.sort(); for(int i = 0; i < formatsGm.length(); ++i) { SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsGm.at(i)); allCheckGm.insert(formatsGm.at(i),check); check->setToolTip(formatsGm.at(i)); layGm->addWidget(check); #ifndef GM check->setEnabled(false); #endif } QHBoxLayout *layGmBut = new QHBoxLayout; CustomLabel *extraGm = new CustomLabel(tr("Extra File Types:")); extraGm->setWordWrap(false); extraGmEdit = new CustomLineEdit; CustomPushButton *gmMarkAll = new CustomPushButton(tr("Mark All")); CustomPushButton *gmMarkNone = new CustomPushButton(tr("Mark None")); layGmBut->addWidget(extraGm); layGmBut->addWidget(extraGmEdit); layGmBut->addStretch(); layGmBut->addWidget(gmMarkAll); layGmBut->addWidget(gmMarkNone); #ifndef GM titleGmWorking->setEnabled(false); gmMarkAll->setEnabled(false); gmMarkNone->setEnabled(false); extraGm->setEnabled(false); extraGmEdit->setEnabled(false); layFile->addWidget(gmDisabled); layFile->addSpacing(10); #endif layFile->addWidget(titleGmWorking); layFile->addSpacing(10); layFile->addLayout(layGm); layFile->addSpacing(5); layFile->addLayout(layGmBut); layFile->addSpacing(35); QSignalMapper *mapGmMark = new QSignalMapper; mapGmMark->setMapping(gmMarkAll,"gmMark"); connect(gmMarkAll, SIGNAL(clicked()), mapGmMark, SLOT(map())); connect(mapGmMark, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); QSignalMapper *mapGmNone = new QSignalMapper; mapGmNone->setMapping(gmMarkNone,"gmNone"); connect(gmMarkNone, SIGNAL(clicked()), mapGmNone, SLOT(map())); connect(mapGmNone, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); CustomLabel *titleGmUnstable = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - GraphicsMagick (Unstable)") + "</span></b><br><br>" + tr("The following file types are supported by GraphicsMagick, but aren't quite working in PhotoQt just yet. If you want to experiment around a little, feel free to enable some of them. They shouldn't cause PhotoQt to crash, but you might see an error image instead of the actual image.") + "</b>"); titleGmUnstable->setWordWrap(true); FlowLayout *layGmUnstable = new FlowLayout; QStringList formatsGmUnstable; formatsGmUnstable << ".gray" << ".hpgl" << ".mono" << ".msl" << ".mvg" << ".pcl" << ".pfa" << ".pfb" << ".pwp" << ".rgb" << ".rgba" << ".rla" << ".rle" << ".sct" << ".sfw" << ".tim" << ".uil" << ".uyvy" << ".wmf" << ".wpg" << ".yuv"; formatsGmUnstable.sort(); for(int i = 0; i < formatsGmUnstable.length(); ++i) { SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsGmUnstable.at(i)); check->setToolTip(formatsGmUnstable.at(i)); allCheckGmUnstable.insert(formatsGmUnstable.at(i),check); layGmUnstable->addWidget(check); #ifndef GM check->setEnabled(false); #endif } QHBoxLayout *layGmButUnstable = new QHBoxLayout; CustomPushButton *gmMarkAllUnstable = new CustomPushButton(tr("Mark All")); CustomPushButton *gmMarkNoneUnstable = new CustomPushButton(tr("Mark None")); layGmButUnstable->addStretch(); layGmButUnstable->addWidget(gmMarkAllUnstable); layGmButUnstable->addWidget(gmMarkNoneUnstable); layFile->addWidget(titleGmUnstable); layFile->addSpacing(10); layFile->addLayout(layGmUnstable); layFile->addSpacing(5); layFile->addLayout(layGmButUnstable); layFile->addSpacing(35); #ifndef GM titleGmUnstable->setEnabled(false); gmMarkAllUnstable->setEnabled(false); gmMarkNoneUnstable->setEnabled(false); #endif QSignalMapper *mapGmMarkUnst = new QSignalMapper; mapGmMarkUnst->setMapping(gmMarkAllUnstable,"gmunstMark"); connect(gmMarkAllUnstable, SIGNAL(clicked()), mapGmMarkUnst, SLOT(map())); connect(mapGmMarkUnst, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); QSignalMapper *mapGmNoneUnst = new QSignalMapper; mapGmNoneUnst->setMapping(gmMarkNoneUnstable,"gmunstNone"); connect(gmMarkNoneUnstable, SIGNAL(clicked()), mapGmNoneUnst, SLOT(map())); connect(mapGmNoneUnst, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString))); layOther->addStretch(); layFile->addStretch(); }
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(); }
Wallpaper::Wallpaper(QMap<QString, QVariant> set, bool v, QWidget *parent) : MyWidget(parent) { this->setBorderArea(150,100); verbose = v; globSet = set; // The buttons to proceed or abort are always visible (i.e. not scrolled) ok = new CustomPushButton(tr("Okay, do it!")); cancel = new CustomPushButton(tr("Nooo, don't!")); QHBoxLayout *butLay = new QHBoxLayout; butLay->addStretch(); butLay->addWidget(ok); butLay->addWidget(cancel); butLay->addStretch(); CustomLine *line = new CustomLine; QVBoxLayout *botLay = new QVBoxLayout; botLay->addWidget(line); botLay->addLayout(butLay); this->addButtonLayout(botLay); connect(ok, SIGNAL(clicked()), this, SLOT(goAheadAndSetWallpaper())); connect(cancel, SIGNAL(clicked()), this, SLOT(animate())); QVBoxLayout *lay = new QVBoxLayout; // the widget title QLabel *title = new QLabel("<center><span style=\"font-size: 30pt; font-weight: bold\">" + tr("Set as Wallpaper") + "</span></center>"); title->setStyleSheet("color: white"); lay->addWidget(title); lay->addSpacing(10); // The filename is always set to this label filenameLabel = new CustomLabel("<center>---</center>"); filenameLabel->setFontColor("lightgrey"); filenameLabel->setItalic(true); lay->addWidget(filenameLabel); lay->addSpacing(20); // Label explaining the wm detection CustomLabel *wmDetectedLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Window Manager") + "</span></b> " + "<br><br>" + tr("PhotoQt tries to detect you window manager according to the environment variables set by your system. If it still got it wrong, you can change the window manager here manually.")); wmDetectedLabel->setWordWrap(true); lay->addWidget(wmDetectedLabel); lay->addSpacing(10); // Combobox to change WM wm = new CustomComboBox; wm->setFontSize(15); wm->setBorder(1,"white"); wm->addItem("KDE4","kde"); wm->addItem("Gnome/Unity","gnome"); wm->addItem("XFCE4","xfce"); wm->addItem("Razor-Qt", "razor"); wm->addItem(tr("Other"),"other"); QHBoxLayout *wmLay = new QHBoxLayout; wmLay->addStretch(); wmLay->addWidget(wm); wmLay->addStretch(); lay->addLayout(wmLay); lay->addSpacing(10); // This message is used to show an (error or other) message depending on the window manager wmMessage = new CustomLabel; wmMessage->setAlignment(Qt::AlignCenter); wmMessage->setWordWrap(true); wmMessage->setVisible(false); lay->addSpacing(10); lay->addWidget(wmMessage); lay->addSpacing(20); connect(wm, SIGNAL(currentIndexChanged(int)), this, SLOT(wmSelected())); //////// GNOME SETTINGS ///////////// // Some image options can be set (the label is globsl, because it is hidden/shown depending on wm choice) gnomePicOpsLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Picture Options") + "</span></b> " + "<br><br>" + tr("There are several picture options that can be set for the wallpaper image.")); gnomePicOpsLabel->setMargin(5); gnomePicOpsLabel->setWordWrap(true); // A layout holding the image options QVBoxLayout *gnomePicOpsLayCenter = new QVBoxLayout; gnomeButGrp = new QButtonGroup; gnomePictureOptions.clear(); // These options are possible QStringList picOpts; picOpts << "wallpaper"; picOpts << "centered"; picOpts << "scaled"; picOpts << "zoom"; picOpts << "spanned"; // Setup radiobuttons, add to layout, to button group and store in QMap for(int i = 0; i < picOpts.size(); ++i) { CustomRadioButton *chk = new CustomRadioButton(picOpts.at(i)); if(i == 3) chk->setChecked(true); gnomePicOpsLayCenter->addWidget(chk); gnomeButGrp->addButton(chk); gnomePictureOptions.insert(picOpts.at(i),chk); } // And center in a horizontal layout QHBoxLayout *gnomePicOpsLay = new QHBoxLayout; gnomePicOpsLay->addStretch(); gnomePicOpsLay->addLayout(gnomePicOpsLayCenter); gnomePicOpsLay->addStretch(); // Add label and button layout to central widget layout lay->addWidget(gnomePicOpsLabel); lay->addLayout(gnomePicOpsLay); ////// THE FOLLOWING SCREEN SELECT IS USED BY DIFFERENT WMs ////// QVBoxLayout *wmMonitorLayCenter = new QVBoxLayout; wmMonitorSelect.clear(); QDesktopWidget desk; for(int i = 0; i < desk.screenCount(); ++i) { CustomCheckBox *mon = new CustomCheckBox(tr("Screen") + QString(" #%1").arg(i)); mon->setChecked(true); wmMonitorLayCenter->addWidget(mon); wmMonitorSelect.insert(i,mon); } QHBoxLayout *wmMonitorLay = new QHBoxLayout; wmMonitorLay->addStretch(); wmMonitorLay->addLayout(wmMonitorLayCenter); wmMonitorLay->addStretch(); wmMonitorLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Select Monitors") + "</span></b> " + "<br><br>" + tr("The wallpaper can be set to either of the available monitors (or any combination).")); wmMonitorLabel->setWordWrap(true); wmMonitorLabel->setMargin(5); lay->addWidget(wmMonitorLabel); lay->addLayout(wmMonitorLay); /////// XFCE SETTINGS ///////////// QVBoxLayout *xfcePicOpsLayCenter = new QVBoxLayout; xfceButGrp = new QButtonGroup; xfcePictureOptions.clear(); QStringList xfcePicOpts; xfcePicOpts << "automatic"; xfcePicOpts << "centered"; xfcePicOpts << "tiled"; xfcePicOpts << "spanned"; xfcePicOpts << "scaled"; xfcePicOpts << "magnified"; for(int i = 0; i < xfcePicOpts.size(); ++i) { CustomRadioButton *chk = new CustomRadioButton(xfcePicOpts.at(i)); if(i == 0) chk->setChecked(true); xfcePicOpsLayCenter->addWidget(chk); xfceButGrp->addButton(chk); xfcePictureOptions.insert(xfcePicOpts.at(i),chk); } QHBoxLayout *xfcePicOpsLay = new QHBoxLayout; xfcePicOpsLay->addStretch(); xfcePicOpsLay->addLayout(xfcePicOpsLayCenter); xfcePicOpsLay->addStretch(); xfcePicOpsLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Picture Options") + "</span></b> " + "<br><br>" + tr("There are several picture options that can be set for the wallpaper image.")); xfcePicOpsLabel->setMargin(5); xfcePicOpsLabel->setWordWrap(true); lay->addWidget(xfcePicOpsLabel); lay->addLayout(xfcePicOpsLay); ///////// OTHER SETTINGS /////////// otherFeh = new CustomRadioButton(tr("Use 'feh'")); otherFeh->setIndicatorImage(":/img/checkbox_checked.png",":/img/checkbox_checked.png",":/img/checkbox_unchecked.png",":/img/checkbox_unchecked.png"); otherFeh->setChecked(true); otherNitrogen = new CustomRadioButton(tr("Use 'nitrogen'")); otherNitrogen->setIndicatorImage(":/img/checkbox_checked.png",":/img/checkbox_checked.png",":/img/checkbox_unchecked.png",":/img/checkbox_unchecked.png"); QButtonGroup *otherGrp = new QButtonGroup; otherGrp->addButton(otherFeh); otherGrp->addButton(otherNitrogen); QHBoxLayout *externLay = new QHBoxLayout; externLay->addStretch(); externLay->addWidget(otherFeh); externLay->addWidget(otherNitrogen); externLay->addStretch(); connect(otherFeh, SIGNAL(clicked()), this, SLOT(swapFehNitrogen())); connect(otherNitrogen, SIGNAL(clicked()), this, SLOT(swapFehNitrogen())); otherNitrogenGrp = new QButtonGroup; otherNitrogenOptions.clear(); QVBoxLayout *otherNitrogenPicOptLay = new QVBoxLayout; otherNitrogenPicOptLay->setMargin(5); QStringList listNitrogen; listNitrogen << "auto"; listNitrogen << "centered"; listNitrogen << "scaled"; listNitrogen << "tiled"; listNitrogen << "zoom"; listNitrogen << "zoom-fill"; QString eleN; foreach(eleN, listNitrogen) { CustomRadioButton *r = new CustomRadioButton("--set-" + eleN); r->setObjectName(eleN); if(eleN == "auto") r->setChecked(true); otherNitrogenPicOptLay->addWidget(r); otherNitrogenOptions.insert(eleN,r); otherNitrogenGrp->addButton(r); }
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())); }
SettingsTabThumbnail::SettingsTabThumbnail(QWidget *parent, QMap<QString, QVariant> set, bool v) : QWidget(parent) { // The global settings globSet = set; this->setObjectName("tabthumb"); verbose = v; // Opening the thumbnail database db = QSqlDatabase::database("thumbDB"); // Style the widget this->setStyleSheet("#tabthumb { background: transparent; color: white; }"); tabs = new TabWidget; tabs->expand(false); tabs->setBorderTop("rgba(150,150,150,100)",2); tabs->setBorderBot("rgba(150,150,150,100)",2); QVBoxLayout *mainLay = new QVBoxLayout; mainLay->addWidget(tabs); this->setLayout(mainLay); // the main scroll widget for all LOOK content scrollbarLook = new CustomScrollbar; QScrollArea *scrollLook = new QScrollArea; QVBoxLayout *layLook = new QVBoxLayout(scrollLook); QWidget *scrollWidgLook = new QWidget(scrollLook); scrollWidgLook->setLayout(layLook); scrollLook->setWidget(scrollWidgLook); scrollLook->setWidgetResizable(true); scrollLook->setVerticalScrollBar(scrollbarLook); // the main scroll widget for all FEEL content scrollbarTune = new CustomScrollbar; QScrollArea *scrollTune = new QScrollArea; QVBoxLayout *layTune = new QVBoxLayout(scrollTune); QWidget *scrollWidgTune = new QWidget(scrollTune); scrollWidgTune->setLayout(layTune); scrollTune->setWidget(scrollWidgTune); scrollTune->setWidgetResizable(true); scrollTune->setVerticalScrollBar(scrollbarTune); tabLook = new QWidget; tabTune = new QWidget; QVBoxLayout *scrollLayLook = new QVBoxLayout; scrollLayLook->addWidget(scrollLook); tabLook->setLayout(scrollLayLook); QVBoxLayout *scrollLayTune = new QVBoxLayout; scrollLayTune->addWidget(scrollTune); tabTune->setLayout(scrollLayTune); tabs->addTab(tabLook,tr("Look")); tabs->addTab(tabTune,tr("Fine-Tuning")); // The titles CustomLabel *titleLook = new CustomLabel("<center><h1>" + tr("Thumbnail Look") + "</h1></center>"); layLook->addWidget(titleLook); layLook->addSpacing(20); CustomLabel *titleTune = new CustomLabel("<center><h1>" + tr("Fine-Tuning of Thumbnails") + "</h1></center>"); layTune->addWidget(titleTune); layTune->addSpacing(20); // OPTION TO CHANGE THUMBNAIL SIZE CustomLabel *thumbSizeLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Thumbnail Size") + "</span></b><br><br>" + tr("Here you can adjust the thumbnail size. You can set it to any size between 20 and 256 pixel. Per default it is set to 80 pixel, but with different screen resolutions it might be nice to have them larger/smaller.")); thumbSizeLabel->setWordWrap(true); QHBoxLayout *thumbSizeLay = new QHBoxLayout; thumbSizeSlider = new CustomSlider; thumbSizeSlider->setMinimum(20); thumbSizeSlider->setMaximum(256); thumbSizeSpin = new CustomSpinBox; thumbSizeSpin->setMinimum(20); thumbSizeSpin->setMaximum(256); thumbSizeLay->addStretch(); thumbSizeLay->addWidget(thumbSizeSlider); thumbSizeLay->addWidget(thumbSizeSpin); thumbSizeLay->addStretch(); layLook->addWidget(thumbSizeLabel); layLook->addSpacing(5); layLook->addLayout(thumbSizeLay); layLook->addSpacing(20); connect(thumbSizeSlider, SIGNAL(valueChanged(int)), thumbSizeSpin, SLOT(setValue(int))); connect(thumbSizeSpin, SIGNAL(valueChanged(int)), thumbSizeSlider, SLOT(setValue(int))); // OPTION TO SET SPACING BETWEEN THUMBNAILS borderAroundSlider = new CustomSlider; borderAroundSlider->setMinimum(0); borderAroundSlider->setMaximum(30); borderAroundSlider->setTickInterval(4); borderAroundSpin = new CustomSpinBox; borderAroundSpin->setMinimum(0); borderAroundSpin->setMaximum(30); borderAroundSpin->setSuffix(" px"); CustomLabel *thbBorderAroundLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Spacing Between Thumbnail Images") + "</span></b><br><br>" + tr("The thumbnails are shown in a row at the lower or upper edge (depending on your setup). They are lined up side by side. Per default, there's no empty space between them, however exactly that can be changed here.")); thbBorderAroundLabel->setWordWrap(true); QHBoxLayout *thbBorderLay = new QHBoxLayout; thbBorderLay->addStretch(); thbBorderLay->addWidget(borderAroundSlider); thbBorderLay->addWidget(borderAroundSpin); thbBorderLay->addStretch(); layLook->addWidget(thbBorderAroundLabel); layLook->addSpacing(5); layLook->addLayout(thbBorderLay); layLook->addSpacing(20); connect(borderAroundSlider, SIGNAL(valueChanged(int)), borderAroundSpin, SLOT(setValue(int))); connect(borderAroundSpin, SIGNAL(valueChanged(int)), borderAroundSlider, SLOT(setValue(int))); // OPTION TO ADJUST THE LIFTUP OF HOVERED THUMBNAIL thbLiftUpSlider = new CustomSlider; thbLiftUpSlider->setMinimum(0); thbLiftUpSlider->setMaximum(40); thbLiftUpSlider->setTickInterval(4); thbLiftUpSpin = new CustomSpinBox; thbLiftUpSpin->setMinimum(0); thbLiftUpSpin->setMaximum(40); thbLiftUpSpin->setSuffix(" px"); CustomLabel *thbLiftUpLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Lift-up of Thumbnail Images on Hovering") + "</span></b><br><br>" + tr("When a thumbnail is hovered, it is lifted up some pixels (default 10). Here you can increase/decrease this value according to your personal preference.")); thbLiftUpLabel->setWordWrap(true); QHBoxLayout *thbLiftUpLay = new QHBoxLayout; thbLiftUpLay->addStretch(); thbLiftUpLay->addWidget(thbLiftUpSlider); thbLiftUpLay->addWidget(thbLiftUpSpin); thbLiftUpLay->addStretch(); layLook->addWidget(thbLiftUpLabel); layLook->addSpacing(5); layLook->addLayout(thbLiftUpLay); layLook->addSpacing(20); connect(thbLiftUpSlider, SIGNAL(valueChanged(int)), thbLiftUpSpin, SLOT(setValue(int))); connect(thbLiftUpSpin, SIGNAL(valueChanged(int)), thbLiftUpSlider, SLOT(setValue(int))); // ADJUST THE POSITION OF THE THUMBNAILS CustomLabel *thbPosLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Change Thumbnail Position") + "</span></b><br><bR>" + tr("Per default the bar with the thumbnails is shown at the lower edge. However, some might find it nice and handy to have the thumbnail bar at the upper edge, so that's what can be changed here.")); thbPosLabel->setWordWrap(true); QHBoxLayout *thbPosLay = new QHBoxLayout; thbPosTop = new CustomRadioButton(tr("Show Thumbnails at upper edge")); thbPosBot = new CustomRadioButton(tr("Show Thumbnails at lower edge")); QButtonGroup *thbPosGroup = new QButtonGroup; thbPosGroup->addButton(thbPosTop); thbPosGroup->addButton(thbPosBot); thbPosLay->addStretch(); thbPosLay->addWidget(thbPosTop); thbPosLay->addWidget(thbPosBot); thbPosLay->addStretch(); layLook->addWidget(thbPosLabel); layLook->addSpacing(5); layLook->addLayout(thbPosLay); layLook->addSpacing(20); // OPTION TO KEEP THUMBNAILS VISIBLE OR FADE THEM OUT CustomLabel *thbKeepVisibleLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Keep Thumbnails Visible") + "</span></b><br><bR>" + tr("Per default the Thumbnails slide out over the edge of the screen. Here you can force them to stay visible. The big image is shrunk to fit into the empty space. Note, that the thumbnails will be hidden (and only shown on mouse hovering) once you zoomed the image in/out. Resetting the zoom restores the original visibility of the thumbnails.")); thbKeepVisibleLabel->setWordWrap(true); QHBoxLayout *thbKeepLay = new QHBoxLayout; keepVisible = new CustomCheckBox(tr("Keep Thumbnails Visible")); thbKeepLay->addStretch(); thbKeepLay->addWidget(keepVisible); thbKeepLay->addStretch(); layTune->addWidget(thbKeepVisibleLabel); layTune->addSpacing(5); layTune->addLayout(thbKeepLay); layTune->addSpacing(20); // OPTION TO ENABLE DYNAMIC THUMBNAIL CREATION (handy for faster harddrives) CustomLabel *dynamicThumbnailsLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Dynamic Thumbnail Creation") + "</span></b><br><bR>" + tr("Dynamic thumbnail creation means, that PhotoQt only sets up those thumbnail images that are actually needed, i.e. it stops once it reaches the end of the visible area and sits idle until you scroll left/right.") + "<br><br>" + tr("This feature is very handy, especially if you have bigger directories, since it doesn't occupy the CPU too long, and it doesn't create thumbnails that might never be needed.")); dynamicThumbnailsLabel->setWordWrap(true); QHBoxLayout *dynamicThbLay = new QHBoxLayout; dynamicThumbnails = new CustomCheckBox(tr("Enable Dynamic Thumbnails")); dynamicThbLay->addStretch(); dynamicThbLay->addWidget(dynamicThumbnails); dynamicThbLay->addStretch(); layTune->addWidget(dynamicThumbnailsLabel); layTune->addSpacing(10); layTune->addLayout(dynamicThbLay); layTune->addSpacing(20); // OPTION TO ONLY USE FILENAME AND NO ACTUAL THUMBNAIL CustomLabel *filenameInsteadThbLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Use file-name-only Thumbnails") + "</span></b><br><bR>" + tr("If you don't want PhotoQt to always load the actual image thumbnail in the background, but you still want to have something for better navigating, then you can set a file-name-only thumbnail, i.e. PhotoQt wont load any thumbnail images but simply puts the file name into the box. You can also adjust the font size of this text.")); filenameInsteadThbLabel->setWordWrap(true); filenameInsteadThb = new CustomCheckBox(tr("Use file-name-only Thumbnail")); filenameInsteadThb->setChecked(false); QHBoxLayout *filenameCheckLay = new QHBoxLayout; filenameCheckLay->addStretch(); filenameCheckLay->addWidget(filenameInsteadThb); filenameCheckLay->addStretch(); filenameFontSizeSlider = new CustomSlider; filenameFontSizeSpin = new CustomSpinBox; filenameFontSizeSlider->setEnabled(false); filenameFontSizeSpin->setEnabled(false); filenameFontSizeSlider->setMinimum(6); filenameFontSizeSlider->setMaximum(20); filenameFontSizeSlider->setValue(globSet.value("ThumbnailFilenameInsteadFontSize").toInt()); filenameFontSizeSpin->setMinimum(6); filenameFontSizeSpin->setMaximum(20); filenameFontSizeSpin->setSuffix("pt"); filenameFontSizeSpin->setValue(globSet.value("ThumbnailFilenameInsteadFontSize").toInt()); QHBoxLayout *filenameSpinSliderLay = new QHBoxLayout; filenameSpinSliderLay->addStretch(); filenameSpinSliderLay->addWidget(filenameFontSizeSlider); filenameSpinSliderLay->addWidget(filenameFontSizeSpin); filenameSpinSliderLay->addStretch(); layLook->addWidget(filenameInsteadThbLabel); layLook->addSpacing(5); layLook->addLayout(filenameCheckLay); layLook->addLayout(filenameSpinSliderLay); layLook->addSpacing(20); connect(filenameInsteadThb, SIGNAL(toggled(bool)), filenameFontSizeSlider, SLOT(setEnabled(bool))); connect(filenameInsteadThb, SIGNAL(toggled(bool)), filenameFontSizeSpin, SLOT(setEnabled(bool))); connect(filenameFontSizeSlider, SIGNAL(valueChanged(int)), filenameFontSizeSpin, SLOT(setValue(int))); connect(filenameFontSizeSpin, SIGNAL(valueChanged(int)), filenameFontSizeSlider, SLOT(setValue(int))); // OPTION TO SWITCH BETWEEN FILENAME DIMENSION OR BOTH FOR WRITING ON THUMBNAILS CustomLabel *writeFilenameDimensionsLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Filename? Resolution? Or both?") + "</span></b><br><bR>" + tr("When thumbnails are displayed at the top/bottom, PhotoQt usually writes the filename on them. If wanted, this can be switched to the image resolution. Or even both can be displayed, whatever you want.")); writeFilename = new CustomCheckBox(tr("Write Filename")); writeDimensions = new CustomCheckBox(tr("Write Resolution")); QHBoxLayout *writeCheckLay = new QHBoxLayout; writeCheckLay->addStretch(); writeCheckLay->addWidget(writeFilename); writeCheckLay->addWidget(writeDimensions); writeCheckLay->addStretch(); layLook->addWidget(writeFilenameDimensionsLabel); layLook->addSpacing(5); layLook->addLayout(writeCheckLay); layLook->addSpacing(20); // OPTION TO DISABLE THUMBNAILS ALLTOGETHER CustomLabel *thumbnailDisableLabel = new CustomLabel("<b><span style=\"font-size: 12pt\">" + tr("Disable Thumbnails") + "</span></b><br><bR>" + tr("If you just don't need or don't want any thumbnails whatsoever, then you can disable them here completely. This option can also be toggled remotely via command line (run 'photoqt --help' for more information on that). This might increase the speed of PhotoQt a good bit, however, navigating through a folder might be a little harder without thumbnails.")); thumbnailDisableLabel->setWordWrap(true); thumbDisable = new CustomCheckBox(tr("Disable Thumbnails altogether")); thumbDisable->setChecked(false); QHBoxLayout *thumbDisableLay = new QHBoxLayout; thumbDisableLay->addStretch(); thumbDisableLay->addWidget(thumbDisable); thumbDisableLay->addStretch(); layTune->addWidget(thumbnailDisableLabel); layTune->addSpacing(5); layTune->addLayout(thumbDisableLay); layTune->addSpacing(20); // OPTION FOR THUMBNAIL CACHE CustomLabel *thumbCacheLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Thumbnail Cache") + "</span></b><hr>" + tr("Thumbnails can be cached in two different ways:<br>1) File Caching (following the freedesktop.org standard) or<br>2) Database Caching (better performance and management, default option).") + "<br><br>" + tr("Both ways have their advantages and disadvantages:") + "<br>" + tr("File Caching is done according to the freedesktop.org standard and thus different applications can share the same thumbnail for the same image file. However, it's not possible to check for obsolete thumbnails (thus this may lead to many unneeded thumbnail files).") + "<br>" + tr("Database Caching doesn't have the advantage of sharing thumbnails with other applications (and thus every thumbnails has to be newly created for PhotoQt), but it brings a slightly better performance, and it allows a better handling of existing thumbnails (e.g. deleting obsolete thumbnails).") + "<br><br>" + tr("PhotoQt works with either option, though the second way is set as default.") + "<br><br>" + tr("Although everybody is encouraged to use at least one of the two options, caching can be completely disabled altogether. However, that does affect the performance and usability of PhotoQt, since thumbnails have to be newly re-created every time they are needed.")); thumbCacheLabel->setWordWrap(true); QHBoxLayout *thumbCacheLay = new QHBoxLayout; thumbCache = new CustomCheckBox(tr("Enable Thumbnail Cache")); thumbCacheLay->addStretch(); thumbCacheLay->addWidget(thumbCache); thumbCacheLay->addStretch(); // OPTION TO SELECT CACHE TYPE QHBoxLayout *cacheOption = new QHBoxLayout; QButtonGroup *thbCacheGroup = new QButtonGroup; cacheFile = new CustomRadioButton(tr("File caching")); cacheDatabase = new CustomRadioButton(tr("Database caching")); thbCacheGroup->addButton(cacheFile); thbCacheGroup->addButton(cacheDatabase); cacheOption->addStretch(); cacheOption->addWidget(cacheFile); cacheOption->addWidget(cacheDatabase); cacheOption->addStretch(); cacheDatabase->setChecked(true); layTune->addWidget(thumbCacheLabel); layTune->addSpacing(5); layTune->addLayout(thumbCacheLay); layTune->addSpacing(5); layTune->addLayout(cacheOption); layTune->addSpacing(5); connect(thumbCache, SIGNAL(toggled(bool)), this, SLOT(updateCacheStuff())); // Some info about database QHBoxLayout *dbInfoLay = new QHBoxLayout; dbInfo = new CustomLabel; dbInfo->setAlignment(Qt::AlignCenter); dbInfoLay->addStretch(); dbInfoLay->addWidget(dbInfo); dbInfoLay->addStretch(); layTune->addLayout(dbInfoLay); // The database can be cleaned and erased cleanDatabase = new CustomPushButton(tr("CLEAN up Database")); eraseDatabase = new CustomPushButton(tr("ERASE Database")); QHBoxLayout *dbLay = new QHBoxLayout; dbLay->addStretch(); dbLay->addWidget(cleanDatabase); dbLay->addWidget(eraseDatabase); dbLay->addStretch(); layTune->addSpacing(10); layTune->addLayout(dbLay); layTune->addSpacing(10); connect(cacheDatabase, SIGNAL(toggled(bool)), cleanDatabase, SLOT(setEnabled(bool))); connect(cacheDatabase, SIGNAL(toggled(bool)), eraseDatabase, SLOT(setEnabled(bool))); connect(cacheDatabase, SIGNAL(toggled(bool)), dbInfo, SLOT(setEnabled(bool))); // We ask for confirmation before cleaning up the database confirmClean = new CustomConfirm(tr("Clean Database"),tr("Do you really want to clean up the database? This removes all obsolete thumbnails, thus possibly making PhotoQt a little faster.") + "<bR><br>" + tr("This process might take a little while."),tr("Yes, clean is good"),tr("No, don't have time for that"),QSize(450,250),"default","default",this->parentWidget()); confirmClean->show(); // We ask for confirmation before erasing the entire database confirmErase = new CustomConfirm(tr("Erase Database"),tr("Do you really want to ERASE the entire database? This removes every single item in the database! This step should never really be necessarily. After that, every thumbnail has to be newly re-created. This step cannot be reversed!"),tr("Yes, get rid of it all"),tr("Nooo, I want to keep it"),QSize(450,250),"default","default",this->parentWidget()); confirmErase->show(); connect(cleanDatabase, SIGNAL(clicked()), confirmClean, SLOT(animate())); connect(eraseDatabase, SIGNAL(clicked()), confirmErase, SLOT(animate())); connect(confirmClean, SIGNAL(confirmed()), this, SLOT(doCleanDatabase())); connect(confirmErase, SIGNAL(confirmed()), this, SLOT(doEraseDatabase())); layLook->addStretch(); layTune->addStretch(); }