summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/confedit/mainwindow.cpp12
-rw-r--r--noncore/apps/confedit/mainwindow.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index 3b8042f..8e36980 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -26,26 +26,26 @@
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qfile.h> 27#include <qfile.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31 31
32#include "listviewconfdir.h" 32#include "listviewconfdir.h"
33#include "listviewitemconf.h" 33#include "listviewitemconf.h"
34#include "listviewitemconfigentry.h" 34#include "listviewitemconfigentry.h"
35 35
36 36
37MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 37MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
38 QDialog( parent, name, f ), _currentItem(0), _fileItem(0) 38 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0)
39 { 39{
40 setCaption( tr("Conf File Editor") ); 40 setCaption( tr("Conf File Editor") );
41 41
42 //setBaseSize( qApp->globalStrut() ); 42 //setBaseSize( qApp->globalStrut() );
43 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 43 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
44 44
45 mainLayout = new QVBoxLayout( this ); 45 mainLayout = new QVBoxLayout( this );
46 mainLayout->setSpacing( 0 ); 46 mainLayout->setSpacing( 0 );
47 mainLayout->setMargin( 0 ); 47 mainLayout->setMargin( 0 );
48 48
49 49
50 qDebug("creating settingList"); 50 qDebug("creating settingList");
51 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); 51 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist");
@@ -54,25 +54,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
54 54
55 qDebug("creating editor"); 55 qDebug("creating editor");
56 editor = new EditWidget(this); 56 editor = new EditWidget(this);
57 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); 57 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
58 mainLayout->addWidget( editor, 1 ); 58 mainLayout->addWidget( editor, 1 );
59 editor->layoutType( ListViewItemConf::File ); 59 editor->layoutType( ListViewItemConf::File );
60 60
61 makeMenu(); 61 makeMenu();
62 62
63 connect(settingList, SIGNAL( pressed(QListViewItem*) ), 63 connect(settingList, SIGNAL( pressed(QListViewItem*) ),
64 this, SLOT(setCurrent(QListViewItem*))); 64 this, SLOT(setCurrent(QListViewItem*)));
65 connect( settingList, SIGNAL( clicked( QListViewItem* ) ), 65 connect( settingList, SIGNAL( clicked( QListViewItem* ) ),
66 this, SLOT( stopTimer( QListViewItem* ) ) ); 66 this, SLOT( stopTimer( QListViewItem* ) ) );
67 67
68 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ), 68 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ),
69 SLOT( groupChanged(const QString&) ) ); 69 SLOT( groupChanged(const QString&) ) );
70 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ), 70 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ),
71 SLOT( keyChanged(const QString&) ) ); 71 SLOT( keyChanged(const QString&) ) );
72 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ), 72 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ),
73 SLOT( valueChanged(const QString&) ) ); 73 SLOT( valueChanged(const QString&) ) );
74 74
75 setCurrent(0); 75 setCurrent(0);
76 editor->layoutType(EditWidget::File); 76 editor->layoutType(EditWidget::File);
77} 77}
78 78
@@ -161,37 +161,37 @@ void MainWindow::valueChanged(const QString &v)
161 if (!_currentItem) return; 161 if (!_currentItem) return;
162 _currentItem->valueChanged(v); 162 _currentItem->valueChanged(v);
163} 163}
164 164
165 165
166void MainWindow::stopTimer( QListViewItem* ) 166void MainWindow::stopTimer( QListViewItem* )
167{ 167{
168 popupTimer->stop(); 168 popupTimer->stop();
169} 169}
170 170
171void MainWindow::saveConfFile() 171void MainWindow::saveConfFile()
172{ 172{
173 if (!_fileItem) return; 173 if (!_fileItem) return;
174 _fileItem->save(); 174 _fileItem->save();
175} 175}
176 176
177void MainWindow::revertConfFile() 177void MainWindow::revertConfFile()
178{ 178{
179 if (!_item) return; 179 if (!_item) return;
180 _item->revert(); 180 _item->revert();
181} 181}
182 182
183void MainWindow::removeConfFile() 183void MainWindow::removeConfFile()
184{ 184{
185 if (!_item) return; 185 if (!_item) return;
186 _item->remove(); 186 _item->remove();
187} 187}
188 188
189void MainWindow::showPopup() 189void MainWindow::showPopup()
190{ 190{
191qDebug("showPopup"); 191qDebug("showPopup");
192 if (!_item) return; 192 if (!_item) return;
193 popupActionRevert->setEnabled(_item->revertable()); 193 popupActionRevert->setEnabled(_item->revertable());
194 popupActionSave->setEnabled(_item->isChanged()); 194 popupActionSave->setEnabled(_item->isChanged());
195 if (_fileItem) 195 if (_fileItem)
196 { 196 {
197 popupActionSave->setEnabled(_fileItem->isChanged()); 197 popupActionSave->setEnabled(_fileItem->isChanged());
diff --git a/noncore/apps/confedit/mainwindow.h b/noncore/apps/confedit/mainwindow.h
index 5be4a86..878558a 100644
--- a/noncore/apps/confedit/mainwindow.h
+++ b/noncore/apps/confedit/mainwindow.h
@@ -15,25 +15,25 @@
15#include <qmainwindow.h> 15#include <qmainwindow.h>
16#include <qdialog.h> 16#include <qdialog.h>
17#include <qaction.h> 17#include <qaction.h>
18#include <qtimer.h> 18#include <qtimer.h>
19#include <qpopupmenu.h> 19#include <qpopupmenu.h>
20#include "editwidget.h" 20#include "editwidget.h"
21 21
22class QPEToolBar; 22class QPEToolBar;
23class ListViewItemConfFile; 23class ListViewItemConfFile;
24class ListViewConfDir; 24class ListViewConfDir;
25class ListViewItemConf; 25class ListViewItemConf;
26 26
27class MainWindow : public QDialog//QMainWindow 27class MainWindow : public QMainWindow
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 30
31 31
32public: 32public:
33 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 33 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
34 ~MainWindow(); 34 ~MainWindow();
35 35
36 36
37public slots: 37public slots:
38 void setCurrent(QListViewItem*); 38 void setCurrent(QListViewItem*);
39 void groupChanged(const QString&); 39 void groupChanged(const QString&);