mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
cleanup of setting dialogs (no Q3 classes anymore)
svn path=/trunk/KDE/kdebase/apps/; revision=642623
This commit is contained in:
parent
e8686083b9
commit
ed35e27bb7
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Peter Penz *
|
||||
* peter.penz@gmx.at *
|
||||
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
|
@ -20,24 +19,21 @@
|
|||
|
||||
#include "detailsviewsettingspage.h"
|
||||
|
||||
#include <qcheckbox.h>
|
||||
#include <kfontrequester.h>
|
||||
#include <klocale.h>
|
||||
#include <kdialog.h>
|
||||
#include <qfontcombobox.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <q3grid.h>
|
||||
#include <q3buttongroup.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qcombobox.h>
|
||||
#include <q3groupbox.h>
|
||||
#include <q3groupbox.h>
|
||||
#include <kvbox.h>
|
||||
|
||||
#include "dolphinsettings.h"
|
||||
#include "dolphin_detailsmodesettings.h"
|
||||
#include "dolphindetailsview.h"
|
||||
|
||||
#include <kdialog.h>
|
||||
#include <kfontrequester.h>
|
||||
#include <klocale.h>
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QGroupBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QRadioButton>
|
||||
#include <QSpinBox>
|
||||
|
||||
DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
|
||||
QWidget* parent) :
|
||||
|
@ -63,30 +59,34 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
Q_ASSERT(settings != 0);
|
||||
|
||||
// create "Columns" properties
|
||||
Q3GroupBox* columnsGroup = new Q3GroupBox(4, Qt::Vertical, i18n("Columns"), this);
|
||||
columnsGroup->setSizePolicy(sizePolicy);
|
||||
columnsGroup->setMargin(margin);
|
||||
QGroupBox* columnsBox = new QGroupBox(i18n("Columns"), this);
|
||||
columnsBox->setSizePolicy(sizePolicy);
|
||||
|
||||
KHBox* visibleColumnsLayout = new KHBox(columnsGroup);
|
||||
m_dateBox = new QCheckBox(i18n("Date"), visibleColumnsLayout);
|
||||
m_dateBox = new QCheckBox(i18n("Date"), this);
|
||||
m_dateBox->setChecked(settings->showDate());
|
||||
|
||||
m_permissionsBox = new QCheckBox(i18n("Permissions"), visibleColumnsLayout);
|
||||
m_permissionsBox = new QCheckBox(i18n("Permissions"), this);
|
||||
m_permissionsBox->setChecked(settings->showPermissions());
|
||||
|
||||
m_ownerBox = new QCheckBox(i18n("Owner"), visibleColumnsLayout);
|
||||
m_ownerBox = new QCheckBox(i18n("Owner"), this);
|
||||
m_ownerBox->setChecked(settings->showOwner());
|
||||
|
||||
m_groupBox = new QCheckBox(i18n("Group"), visibleColumnsLayout);
|
||||
m_groupBox = new QCheckBox(i18n("Group"), this);
|
||||
m_groupBox->setChecked(settings->showGroup());
|
||||
|
||||
QHBoxLayout* columnsLayout = new QHBoxLayout(columnsBox);
|
||||
columnsLayout->addWidget(m_dateBox);
|
||||
columnsLayout->addWidget(m_permissionsBox);
|
||||
columnsLayout->addWidget(m_ownerBox);
|
||||
columnsLayout->addWidget(m_groupBox);
|
||||
|
||||
// Create "Icon" properties
|
||||
Q3ButtonGroup* iconSizeGroup = new Q3ButtonGroup(3, Qt::Horizontal, i18n("Icon Size"), this);
|
||||
iconSizeGroup->setSizePolicy(sizePolicy);
|
||||
iconSizeGroup->setMargin(margin);
|
||||
m_smallIconSize = new QRadioButton(i18n("Small"), iconSizeGroup);
|
||||
m_mediumIconSize = new QRadioButton(i18n("Medium"), iconSizeGroup);
|
||||
m_largeIconSize = new QRadioButton(i18n("Large"), iconSizeGroup);
|
||||
QGroupBox* iconSizeBox = new QGroupBox(i18n("Icon Size"), this);
|
||||
iconSizeBox->setSizePolicy(sizePolicy);
|
||||
|
||||
m_smallIconSize = new QRadioButton(i18n("Small"), this);
|
||||
m_mediumIconSize = new QRadioButton(i18n("Medium"), this);
|
||||
m_largeIconSize = new QRadioButton(i18n("Large"), this);
|
||||
switch (settings->iconSize()) {
|
||||
case K3Icon::SizeLarge:
|
||||
m_largeIconSize->setChecked(true);
|
||||
|
@ -101,19 +101,32 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_smallIconSize->setChecked(true);
|
||||
}
|
||||
|
||||
// create "Text" properties
|
||||
Q3GroupBox* textGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Text"), this);
|
||||
textGroup->setSizePolicy(sizePolicy);
|
||||
textGroup->setMargin(margin);
|
||||
QButtonGroup* iconSizeGroup = new QButtonGroup(this);
|
||||
iconSizeGroup->addButton(m_smallIconSize);
|
||||
iconSizeGroup->addButton(m_mediumIconSize);
|
||||
iconSizeGroup->addButton(m_largeIconSize);
|
||||
|
||||
new QLabel(i18n("Font:"), textGroup);
|
||||
m_fontRequester = new KFontRequester(textGroup);
|
||||
QHBoxLayout* iconSizeLayout = new QHBoxLayout(iconSizeBox);
|
||||
iconSizeLayout->addWidget(m_smallIconSize);
|
||||
iconSizeLayout->addWidget(m_mediumIconSize);
|
||||
iconSizeLayout->addWidget(m_largeIconSize);
|
||||
|
||||
// create "Text" properties
|
||||
QGroupBox* textBox = new QGroupBox(i18n("Text"), this);
|
||||
textBox->setSizePolicy(sizePolicy);
|
||||
|
||||
QLabel* fontLabel = new QLabel(i18n("Font:"), textBox);
|
||||
m_fontRequester = new KFontRequester(textBox);
|
||||
QFont font(settings->fontFamily(),
|
||||
settings->fontSize());
|
||||
font.setItalic(settings->italicFont());
|
||||
font.setBold(settings->boldFont());
|
||||
m_fontRequester->setFont(font);
|
||||
|
||||
QHBoxLayout* textLayout = new QHBoxLayout(textBox);
|
||||
textLayout->addWidget(fontLabel);
|
||||
textLayout->addWidget(m_fontRequester);
|
||||
|
||||
// Add a dummy widget with no restriction regarding
|
||||
// a vertical resizing. This assures that the dialog layout
|
||||
// is not stretched vertically.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Peter Penz *
|
||||
* peter.penz@gmx.at *
|
||||
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Peter Penz *
|
||||
* peter.penz@gmx.at *
|
||||
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
|
@ -24,8 +23,6 @@
|
|||
#include "dolphin_generalsettings.h"
|
||||
#include "viewproperties.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QGroupBox>
|
||||
#include <QRadioButton>
|
||||
|
@ -48,7 +45,7 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_maxPreviewSize(0)
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
assert(settings != 0);
|
||||
Q_ASSERT(settings != 0);
|
||||
|
||||
const int spacing = KDialog::spacingHint();
|
||||
const int margin = KDialog::marginHint();
|
||||
|
@ -133,7 +130,7 @@ void GeneralViewSettingsPage::applySettings()
|
|||
const bool useGlobalProps = m_globalProps->isChecked();
|
||||
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
assert(settings != 0);
|
||||
Q_ASSERT(settings != 0);
|
||||
settings->setGlobalViewProps(useGlobalProps);
|
||||
|
||||
if (useGlobalProps) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Peter Penz *
|
||||
* peter.penz@gmx.at *
|
||||
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
|
|
|
@ -63,10 +63,6 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_iconSize = settings->iconSize();
|
||||
m_previewSize = settings->previewSize();
|
||||
|
||||
KHBox* sizesLayout = new KHBox(this);
|
||||
sizesLayout->setSpacing(spacing);
|
||||
sizesLayout->setSizePolicy(sizePolicy);
|
||||
|
||||
m_iconSizeButton = new QPushButton(i18n("Change icon and preview size..."), this);
|
||||
connect(m_iconSizeButton, SIGNAL(clicked()),
|
||||
this, SLOT(openIconSizeDialog()));
|
||||
|
|
Loading…
Reference in a new issue