Diffstat (limited to 'noncore/apps/confedit/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/confedit/mainwindow.cpp | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp index fc403d2..6de8741 100644 --- a/noncore/apps/confedit/mainwindow.cpp +++ b/noncore/apps/confedit/mainwindow.cpp | |||
@@ -19,2 +19,3 @@ | |||
19 | #include <qpe/qpetoolbar.h> | 19 | #include <qpe/qpetoolbar.h> |
20 | #include <qpe/qpeapplication.h> | ||
20 | #include <qaction.h> | 21 | #include <qaction.h> |
@@ -36,3 +37,3 @@ | |||
36 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 37 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
37 | QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) | 38 | QDialog( parent, name, f ), _currentItem(0), _fileItem(0) |
38 | { | 39 | { |
@@ -40,19 +41,20 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
40 | 41 | ||
41 | QWidget *mainWidget = new QWidget(this); | 42 | //setBaseSize( qApp->globalStrut() ); |
42 | setCentralWidget( mainWidget); | 43 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
43 | QGridLayout *mainLayout = new QGridLayout( mainWidget ); | ||
44 | mainLayout->setSpacing( 3 ); | ||
45 | mainLayout->setMargin( 3 ); | ||
46 | 44 | ||
45 | mainLayout = new QVBoxLayout( this ); | ||
46 | mainLayout->setSpacing( 0 ); | ||
47 | mainLayout->setMargin( 0 ); | ||
47 | 48 | ||
48 | qDebug("settingList"); | 49 | |
50 | qDebug("creating settingList"); | ||
49 | settingList = new ListViewConfDir( "/root/Settings/", this, "settingslist"); | 51 | settingList = new ListViewConfDir( "/root/Settings/", this, "settingslist"); |
50 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding));//, sizePolicy().hasHeightForWidth() ) ); | 52 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
51 | mainLayout->addWidget( settingList, 0, 0 ); | 53 | mainLayout->addWidget( settingList, 0); |
52 | 54 | ||
53 | qDebug("editor"); | 55 | qDebug("creating editor"); |
54 | editor = new EditWidget(this); | 56 | editor = new EditWidget(this); |
55 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum));//, sizePolicy().hasHeightForWidth() ) ); | 57 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); |
56 | // editor->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3));//, sizePolicy().hasHeightForWidth() ) ); | 58 | mainLayout->addWidget( editor, 1 ); |
57 | mainLayout->addWidget( editor, 1, 0 ); | 59 | editor->layoutType( ListViewItemConf::File ); |
58 | 60 | ||
@@ -60,6 +62,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
60 | 62 | ||
61 | qDebug("connect"); | ||
62 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), | 63 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), |
63 | this, SLOT(setCurrent(QListViewItem*))); | 64 | this, SLOT(setCurrent(QListViewItem*))); |
64 | 65 | connect( settingList, SIGNAL( clicked( QListViewItem* ) ), | |
66 | this, SLOT( stopTimer( QListViewItem* ) ) ); | ||
65 | 67 | ||
@@ -71,7 +73,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
71 | SLOT( valueChanged(const QString&) ) ); | 73 | SLOT( valueChanged(const QString&) ) ); |
72 | // qDebug("editor->hide()"); | 74 | |
73 | // editor->hide(); | ||
74 | qDebug("connect"); | ||
75 | connect( settingList, SIGNAL( clicked( QListViewItem* ) ), | ||
76 | this, SLOT( stopTimer( QListViewItem* ) ) ); | ||
77 | setCurrent(0); | 75 | setCurrent(0); |
@@ -81,4 +79,2 @@ void MainWindow::makeMenu() | |||
81 | { | 79 | { |
82 | qDebug("MainWindow::makeMenu()"); | ||
83 | |||
84 | popupTimer = new QTimer(this); | 80 | popupTimer = new QTimer(this); |
@@ -87,3 +83,2 @@ void MainWindow::makeMenu() | |||
87 | 83 | ||
88 | qDebug("Save"); | ||
89 | popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 ); | 84 | popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 ); |
@@ -94,3 +89,2 @@ void MainWindow::makeMenu() | |||
94 | 89 | ||
95 | qDebug("Revert"); | ||
96 | popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 ); | 90 | popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 ); |
@@ -101,3 +95,2 @@ void MainWindow::makeMenu() | |||
101 | 95 | ||
102 | qDebug("Delete"); | ||
103 | popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 ); | 96 | popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 ); |
@@ -108,6 +101,4 @@ void MainWindow::makeMenu() | |||
108 | 101 | ||
109 | qDebug("connect"); | ||
110 | connect( popupTimer, SIGNAL(timeout()), | 102 | connect( popupTimer, SIGNAL(timeout()), |
111 | this, SLOT(showPopup()) ); | 103 | this, SLOT(showPopup()) ); |
112 | qDebug("connect"); | ||
113 | } | 104 | } |
@@ -122,3 +113,3 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
122 | { | 113 | { |
123 | editor->hide(); | 114 | //qDebug("MainWindow::setCurrent"); |
124 | if (!item) return; | 115 | if (!item) return; |
@@ -129,3 +120,3 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
129 | { | 120 | { |
130 | updateGeometry(); | 121 | editor->layoutType(EditWidget::File); |
131 | _currentItem=0; | 122 | _currentItem=0; |
@@ -134,3 +125,2 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
134 | } | 125 | } |
135 | editor->show(); | ||
136 | _fileItem = 0; | 126 | _fileItem = 0; |
@@ -146,3 +136,3 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
146 | { | 136 | { |
147 | editor->isKey(true); | 137 | editor->layoutType(EditWidget::Entry); |
148 | editor->LineEditKey->setText(key); | 138 | editor->LineEditKey->setText(key); |
@@ -150,7 +140,4 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
150 | }else{ | 140 | }else{ |
151 | editor->isKey(false); | 141 | editor->layoutType(EditWidget::Group); |
152 | } | 142 | } |
153 | updateGeometry(); | ||
154 | editor->updateGeometry(); | ||
155 | settingList->updateGeometry(); | ||
156 | } | 143 | } |
@@ -199,2 +186,3 @@ void MainWindow::removeConfFile() | |||
199 | } | 186 | } |
187 | |||
200 | void MainWindow::showPopup() | 188 | void MainWindow::showPopup() |