X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/df8f2e3646017bf6ba99bb18ef0df7defaf2eb10..665ca266e9a6cedb1a014b730e64c91f3c57e11d:/src/iconsviewsettingspage.cpp diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp index c4d07f53b..56e75ac10 100644 --- a/src/iconsviewsettingspage.cpp +++ b/src/iconsviewsettingspage.cpp @@ -30,14 +30,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent) : @@ -49,6 +50,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, m_textWidthBox(0), m_fontRequester(0), m_textlinesCountBox(0), + m_showAdditionalInfo(0), m_arrangementBox(0), m_gridSpacingBox(0) { @@ -59,28 +61,35 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, setSpacing(spacing); setMargin(margin); - m_iconSizeButton = new QPushButton(i18n("Change Icon && Preview Size..."), this); + m_iconSizeButton = new QPushButton(i18nc("@action:button", "Change Icon && Preview Size..."), this); connect(m_iconSizeButton, SIGNAL(clicked()), this, SLOT(openIconSizeDialog())); // create 'Text' group for selecting the font, the number of lines // and the text width - QGroupBox* textGroup = new QGroupBox(i18n("Text"), this); + QGroupBox* textGroup = new QGroupBox(i18nc("@title:group", "Text"), this); textGroup->setSizePolicy(sizePolicy); - QLabel* fontLabel = new QLabel(i18n("Font:"), textGroup); + QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textGroup); m_fontRequester = new KFontRequester(textGroup); - QLabel* textlinesCountLabel = new QLabel(i18n("Number of lines:"), textGroup); - m_textlinesCountBox = new QSpinBox(1, 5, 1, textGroup); + QLabel* textlinesCountLabel = new QLabel(i18nc("@label:textbox", "Number of lines:"), textGroup); + m_textlinesCountBox = new QSpinBox(textGroup); + m_textlinesCountBox->setMinimum(1); + m_textlinesCountBox->setMaximum(5); - QLabel* textWidthLabel = new QLabel(i18n("Text width:"), textGroup); + QLabel* textWidthLabel = new QLabel(i18nc("@label:listbox", "Text width:"), textGroup); m_textWidthBox = new QComboBox(textGroup); - m_textWidthBox->addItem(i18nc("Text width", "Small")); - m_textWidthBox->addItem(i18nc("Text width", "Medium")); - m_textWidthBox->addItem(i18nc("Text width", "Large")); + m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Small")); + m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Medium")); + m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Large")); - QGridLayout* textGroupLayout = new QGridLayout(textGroup); + m_showAdditionalInfo = new QCheckBox(i18nc("@option:check", + "Allow showing of additional information"), textGroup); + + QVBoxLayout* textVBoxLayout = new QVBoxLayout(textGroup); + + QGridLayout* textGroupLayout = new QGridLayout(); textGroupLayout->addWidget(fontLabel, 0, 0); textGroupLayout->addWidget(m_fontRequester, 0, 1); textGroupLayout->addWidget(textlinesCountLabel, 1, 0); @@ -88,20 +97,23 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, textGroupLayout->addWidget(textWidthLabel, 2, 0); textGroupLayout->addWidget(m_textWidthBox, 2, 1); + textVBoxLayout->addLayout(textGroupLayout); + textVBoxLayout->addWidget(m_showAdditionalInfo); + // create the 'Grid' group for selecting the arrangement and the grid spacing - QGroupBox* gridGroup = new QGroupBox(i18n("Grid"), this); + QGroupBox* gridGroup = new QGroupBox(i18nc("@title:group", "Grid"), this); gridGroup->setSizePolicy(sizePolicy); - QLabel* arrangementLabel = new QLabel(i18n("Arrangement:"), gridGroup); + QLabel* arrangementLabel = new QLabel(i18nc("@label:listbox", "Arrangement:"), gridGroup); m_arrangementBox = new QComboBox(gridGroup); - m_arrangementBox->addItem(i18n("Left to Right")); - m_arrangementBox->addItem(i18n("Top to Bottom")); + m_arrangementBox->addItem(i18nc("@item:inlistbox Arrangement", "Left to Right")); + m_arrangementBox->addItem(i18nc("@item:inlistbox Arrangement", "Top to Bottom")); - QLabel* gridSpacingLabel = new QLabel(i18n("Grid spacing:"), gridGroup); + QLabel* gridSpacingLabel = new QLabel(i18nc("@label:listbox", "Grid spacing:"), gridGroup); m_gridSpacingBox = new QComboBox(gridGroup); - m_gridSpacingBox->addItem(i18nc("Grid spacing", "Small")); - m_gridSpacingBox->addItem(i18nc("Grid spacing", "Medium")); - m_gridSpacingBox->addItem(i18nc("Grid spacing", "Large")); + m_gridSpacingBox->addItem(i18nc("@item:inlistbox Grid spacing", "Small")); + m_gridSpacingBox->addItem(i18nc("@item:inlistbox Grid spacing", "Medium")); + m_gridSpacingBox->addItem(i18nc("@item:inlistbox Grid spacing", "Large")); QGridLayout* gridGroupLayout = new QGridLayout(gridGroup); gridGroupLayout->addWidget(arrangementLabel, 0, 0); @@ -118,7 +130,8 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, } IconsViewSettingsPage::~IconsViewSettingsPage() -{} +{ +} void IconsViewSettingsPage::applySettings() { @@ -143,7 +156,7 @@ void IconsViewSettingsPage::applySettings() const int textSizeIndex = m_textWidthBox->currentIndex(); if (arrangement == QListView::TopToBottom) { itemWidth += TopToBottomBase + textSizeIndex * TopToBottomInc; - itemHeight += fontHeight * numberOfTextlines + 16; + itemHeight += fontHeight * numberOfTextlines + 10; } else { itemWidth += LeftToRightBase + textSizeIndex * LeftToRightInc; } @@ -158,6 +171,8 @@ void IconsViewSettingsPage::applySettings() settings->setNumberOfTextlines(numberOfTextlines); + settings->setShowAdditionalInfo(m_showAdditionalInfo->isChecked()); + settings->setGridSpacing(GridSpacingBase + m_gridSpacingBox->currentIndex() * GridSpacingInc); } @@ -193,6 +208,8 @@ void IconsViewSettingsPage::loadSettings() m_textlinesCountBox->setValue(settings->numberOfTextlines()); + m_showAdditionalInfo->setChecked(settings->showAdditionalInfo()); + const bool leftToRightArrangement = (settings->arrangement() == QListView::LeftToRight); int textWidthIndex = 0; const int remainingWidth = settings->itemWidth() - settings->iconSize();