summaryrefslogtreecommitdiff
path: root/noncore/apps/confedit
authorleseb <leseb>2002-07-22 10:55:05 (UTC)
committer leseb <leseb>2002-07-22 10:55:05 (UTC)
commit661f9756e33aa7f4335814c87e5d442164449f57 (patch) (side-by-side diff)
treee56710f838127043542f4c8789e2f6d123d8fb8e /noncore/apps/confedit
parent3878c4883ce02dd98122695ffa678c3f54f704bb (diff)
downloadopie-661f9756e33aa7f4335814c87e5d442164449f57.zip
opie-661f9756e33aa7f4335814c87e5d442164449f57.tar.gz
opie-661f9756e33aa7f4335814c87e5d442164449f57.tar.bz2
Fix bug 134
Diffstat (limited to 'noncore/apps/confedit') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/confedit/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index c91c846..e7db86a 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -1,99 +1,100 @@
/***************************************************************************
* *
* 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 <qpe/qpemenubar.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/qpetoolbar.h>
#include <qpe/qpeapplication.h>
#include <qaction.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#include <qstring.h>
#include <qlabel.h>
#include <qfile.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qlineedit.h>
#include "listviewconfdir.h"
#include "listviewitemconf.h"
#include "listviewitemconfigentry.h"
+#include <stdlib.h>
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
QDialog( 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");
- settingList = new ListViewConfDir( "/root/Settings/", this, "settingslist");
+ settingList = new ListViewConfDir( QString(getenv("HOME")) + "/Settings", this, "settingslist");
settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
mainLayout->addWidget( settingList, 0);
qDebug("creating editor");
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* ) ) );
connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ),
SLOT( groupChanged(const QString&) ) );
connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ),
SLOT( keyChanged(const QString&) ) );
connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ),
SLOT( valueChanged(const QString&) ) );
setCurrent(0);
editor->layoutType(EditWidget::File);
}
void MainWindow::makeMenu()
{
popupTimer = new QTimer(this);
popupMenuFile = new QPopupMenu(this);
popupMenuEntry = new QPopupMenu(this);
popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 );
popupActionSave->addTo( popupMenuFile );
// popupActionSave->addTo( popupMenuEntry );
connect( popupActionSave, SIGNAL( activated() ),
this , SLOT( saveConfFile() ) );
popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 );
popupActionRevert->addTo( popupMenuFile );
popupActionRevert->addTo( popupMenuEntry );
connect( popupActionRevert, SIGNAL( activated() ),
this , SLOT( revertConfFile() ) );
popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 );
popupActionDelete->addTo( popupMenuFile );
popupActionDelete->addTo( popupMenuEntry );