author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kresources/configdialog.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kresources/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/configdialog.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp index 55253c0..4820faf 100644 --- a/microkde/kresources/configdialog.cpp +++ b/microkde/kresources/configdialog.cpp | |||
@@ -12,90 +12,93 @@ | |||
12 | 12 | ||
13 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Library General Public License for more details. | 16 | Library General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU Library General Public License | 18 | You should have received a copy of the GNU Library General Public License |
19 | along with this library; see the file COPYING.LIB. If not, write to | 19 | along with this library; see the file COPYING.LIB. If not, write to |
20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. | 21 | Boston, MA 02111-1307, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <klocale.h> | 24 | #include <klocale.h> |
25 | #include <kglobal.h> | 25 | #include <kglobal.h> |
26 | #include <kmessagebox.h> | 26 | #include <kmessagebox.h> |
27 | 27 | ||
28 | #include <qgroupbox.h> | 28 | #include <q3groupbox.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qvbox.h> | 32 | #include <q3vbox.h> |
33 | 33 | ||
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | #include <qscrollview.h> | 35 | #include <q3scrollview.h> |
36 | //Added by qt3to4: | ||
37 | #include <Q3VBoxLayout> | ||
38 | #include <Q3Frame> | ||
36 | 39 | ||
37 | #include <kbuttonbox.h> | 40 | #include <kbuttonbox.h> |
38 | #include <kdialog.h> | 41 | #include <kdialog.h> |
39 | #include <klineedit.h> | 42 | #include <klineedit.h> |
40 | 43 | ||
41 | #include "factory.h" | 44 | #include "factory.h" |
42 | #include "configwidget.h" | 45 | #include "configwidget.h" |
43 | #include "configdialog.h" | 46 | #include "configdialog.h" |
44 | 47 | ||
45 | using namespace KRES; | 48 | using namespace KRES; |
46 | 49 | ||
47 | ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | 50 | ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, |
48 | Resource* resource, const char *name ) | 51 | Resource* resource, const char *name ) |
49 | : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), | 52 | : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), |
50 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) | 53 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) |
51 | { | 54 | { |
52 | 55 | ||
53 | Factory *factory = Factory::self( resourceFamily ); | 56 | Factory *factory = Factory::self( resourceFamily ); |
54 | 57 | ||
55 | //US resize( 250, 240 ); | 58 | //US resize( 250, 240 ); |
56 | resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); | 59 | resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); |
57 | 60 | ||
58 | QFrame *main; | 61 | Q3Frame *main; |
59 | 62 | ||
60 | main = plainPage(); | 63 | main = plainPage(); |
61 | 64 | ||
62 | QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); | 65 | Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() ); |
63 | 66 | ||
64 | 67 | ||
65 | QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); | 68 | Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); |
66 | generalGroupBox->layout()->setSpacing( spacingHint() ); | 69 | generalGroupBox->layout()->setSpacing( spacingHint() ); |
67 | generalGroupBox->setTitle( i18n( "General Settings" ) ); | 70 | generalGroupBox->setTitle( i18n( "General Settings" ) ); |
68 | 71 | ||
69 | new QLabel( i18n( "Name:" ), generalGroupBox ); | 72 | new QLabel( i18n( "Name:" ), generalGroupBox ); |
70 | 73 | ||
71 | mName = new KLineEdit( generalGroupBox ); | 74 | mName = new KLineEdit( generalGroupBox ); |
72 | 75 | ||
73 | new QLabel("", generalGroupBox ); | 76 | new QLabel("", generalGroupBox ); |
74 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); | 77 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); |
75 | mReadOnly->setChecked( mResource->readOnly() ); | 78 | mReadOnly->setChecked( mResource->readOnly() ); |
76 | 79 | ||
77 | new QLabel("", generalGroupBox ); | 80 | new QLabel("", generalGroupBox ); |
78 | mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); | 81 | mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); |
79 | mIncludeInSync->setChecked( mResource->includeInSync() ); | 82 | mIncludeInSync->setChecked( mResource->includeInSync() ); |
80 | 83 | ||
81 | mName->setText( mResource->resourceName() ); | 84 | mName->setText( mResource->resourceName() ); |
82 | 85 | ||
83 | mainLayout->addWidget( generalGroupBox ); | 86 | mainLayout->addWidget( generalGroupBox ); |
84 | 87 | ||
85 | QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); | 88 | Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); |
86 | resourceGroupBox->layout()->setSpacing( spacingHint()); | 89 | resourceGroupBox->layout()->setSpacing( spacingHint()); |
87 | resourceGroupBox->setTitle( i18n( "%1 Resource Settings" ) | 90 | resourceGroupBox->setTitle( i18n( "%1 Resource Settings" ) |
88 | .arg( factory->typeName( resource->type() ) ) ); | 91 | .arg( factory->typeName( resource->type() ) ) ); |
89 | mainLayout->addWidget( resourceGroupBox ); | 92 | mainLayout->addWidget( resourceGroupBox ); |
90 | 93 | ||
91 | mainLayout->addStretch(); | 94 | mainLayout->addStretch(); |
92 | 95 | ||
93 | mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); | 96 | mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); |
94 | if ( mConfigWidget ) { | 97 | if ( mConfigWidget ) { |
95 | connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), | 98 | connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), |
96 | SLOT( setReadOnly( bool ) ) ); | 99 | SLOT( setReadOnly( bool ) ) ); |
97 | connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ), | 100 | connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ), |
98 | SLOT( setIncludeInSync( bool ) ) ); | 101 | SLOT( setIncludeInSync( bool ) ) ); |
99 | connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), | 102 | connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), |
100 | SLOT( setPersistentReadOnly( bool ) ) ); | 103 | SLOT( setPersistentReadOnly( bool ) ) ); |
101 | mConfigWidget->setInEditMode( false ); | 104 | mConfigWidget->setInEditMode( false ); |