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