summaryrefslogtreecommitdiff
path: root/noncore/apps/confedit/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/confedit/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/confedit/mainwindow.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index 6ef1043..4b04c97 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -2,52 +2,55 @@
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#include "mainwindow.h"
+#include "listviewconfdir.h"
+#include "listviewitemconfigentry.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
-#include "listviewconfdir.h"
-#include "listviewitemconfigentry.h"
-
-
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0)
{
setCaption( tr("Conf File Editor") );
// setBaseSize( qApp->globalStrut() );
setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
mainLayout = new QVBoxLayout( this );
mainLayout->setSpacing( 0 );
mainLayout->setMargin( 0 );
- qDebug("creating settingList");
+ odebug << "creating settingList" << oendl;
settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist");
settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
mainLayout->addWidget( settingList, 0);
- qDebug("creating editor");
+ odebug << "creating editor" << oendl;
editor = new EditWidget(this);
editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
mainLayout->addWidget( editor, 1 );
editor->layoutType( ListViewItemConf::File );
makeMenu();
connect(settingList, SIGNAL( pressed(QListViewItem*) ),
this, SLOT(setCurrent(QListViewItem*)));
connect( settingList, SIGNAL( clicked(QListViewItem*) ),
this, SLOT( stopTimer(QListViewItem*) ) );
@@ -89,25 +92,25 @@ void MainWindow::makeMenu()
connect( popupTimer, SIGNAL(timeout()),
this, SLOT(showPopup()) );
}
MainWindow::~MainWindow()
{
}
void MainWindow::setCurrent(QListViewItem *item)
{
-// qDebug("MainWindow::setCurrent");
+// odebug << "MainWindow::setCurrent" << oendl;
if (!item) return;
_item = (ListViewItemConf*) item;
if (!_item) return;
popupTimer->start( 750, true );
if (_item->getType() == ListViewItemConf::File)
{
editor->layoutType(EditWidget::File);
_currentItem=0;
_fileItem = (ListViewItemConfFile*)item;
return;
}
_fileItem = 0;
@@ -165,25 +168,25 @@ void MainWindow::revertConfFile()
if (!_item) return;
_item->revert();
}
void MainWindow::removeConfFile()
{
if (!_item) return;
_item->remove();
}
void MainWindow::showPopup()
{
-qDebug("showPopup");
+odebug << "showPopup" << oendl;
if (!_item) return;
popupActionRevert->setEnabled(_item->revertable());
popupActionSave->setEnabled(_item->isChanged());
if (_fileItem)
{
popupActionSave->setEnabled(_fileItem->isChanged());
popupMenuFile->popup( QCursor::pos() );
}else if(_currentItem)
{
popupMenuEntry->popup( QCursor::pos() );
}
}