author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/confedit | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/apps/confedit/confedit.pro | 24 | ||||
-rw-r--r-- | noncore/apps/confedit/config.in | 2 | ||||
-rw-r--r-- | noncore/apps/confedit/listviewconfdir.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/confedit/listviewitemconffile.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/confedit/mainwindow.cpp | 19 |
5 files changed, 41 insertions, 40 deletions
diff --git a/noncore/apps/confedit/confedit.pro b/noncore/apps/confedit/confedit.pro index 5a71680..785c588 100644 --- a/noncore/apps/confedit/confedit.pro +++ b/noncore/apps/confedit/confedit.pro | |||
@@ -1,21 +1,9 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h | 2 | HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h |
3 | SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp | 3 | SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp |
4 | INCLUDEPATH += $(OPIEDIR)/include | 4 | INCLUDEPATH += $(OPIEDIR)/include |
5 | DEPENDPATH += $(OPIEDIR)/include | 5 | DEPENDPATH += $(OPIEDIR)/include |
6 | INTERFACES = | 6 | LIBS += -lqpe -lopiecore2 |
7 | LIBS += -lopiecore2 | ||
8 | TARGET = confedit | 7 | TARGET = confedit |
9 | 8 | ||
10 | !contains( platform, x11 ) { | 9 | include ( $(OPIEDIR)/include.pro ) |
11 | |||
12 | include ( $(OPIEDIR)/include.pro ) | ||
13 | LIBS += -lqpe | ||
14 | } | ||
15 | |||
16 | contains( platform, x11 ) { | ||
17 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | ||
18 | } | ||
19 | |||
20 | |||
21 | |||
diff --git a/noncore/apps/confedit/config.in b/noncore/apps/confedit/config.in index e377307..d7682dc 100644 --- a/noncore/apps/confedit/config.in +++ b/noncore/apps/confedit/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config CONFEDIT | 1 | config CONFEDIT |
2 | boolean "opie-confeditor (generic editor for all Opie settings)" | 2 | boolean "opie-confedit (generic editor for all Opie settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp index 0c2feeb..33bffe1 100644 --- a/noncore/apps/confedit/listviewconfdir.cpp +++ b/noncore/apps/confedit/listviewconfdir.cpp | |||
@@ -1,61 +1,65 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> |
10 | 10 | ||
11 | #include "listviewconfdir.h" | 11 | #include "listviewconfdir.h" |
12 | #include "listviewitemconffile.h" | ||
12 | 13 | ||
13 | #include <qmessagebox.h> | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | ||
16 | using namespace Opie::Core; | ||
14 | 17 | ||
15 | #include "listviewitemconffile.h" | 18 | /* QT */ |
19 | #include <qmessagebox.h> | ||
16 | 20 | ||
17 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) | 21 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) |
18 | : QListView(parent,name), confDir(settingsPath) | 22 | : QListView(parent,name), confDir(settingsPath) |
19 | { | 23 | { |
20 | 24 | ||
21 | setRootIsDecorated( true ); | 25 | setRootIsDecorated( true ); |
22 | addColumn(tr("Files")); | 26 | addColumn(tr("Files")); |
23 | 27 | ||
24 | if (!confDir.isReadable()) | 28 | if (!confDir.isReadable()) |
25 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); | 29 | QMessageBox::critical(this,tr("Could not open"),tr("The directory ")+settingsPath+tr(" could not be opened."),1,0); |
26 | readConfFiles(); | 30 | readConfFiles(); |
27 | 31 | ||
28 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); | 32 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); |
29 | } | 33 | } |
30 | 34 | ||
31 | 35 | ||
32 | ListViewConfDir::~ListViewConfDir() | 36 | ListViewConfDir::~ListViewConfDir() |
33 | { | 37 | { |
34 | } | 38 | } |
35 | 39 | ||
36 | void ListViewConfDir::readConfFiles() | 40 | void ListViewConfDir::readConfFiles() |
37 | { | 41 | { |
38 | 42 | ||
39 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); | 43 | confDir.setFilter( QDir::Files | QDir::NoSymLinks ); |
40 | confDir.setSorting( QDir::Name ); | 44 | confDir.setSorting( QDir::Name ); |
41 | confDir.setNameFilter("*.conf"); | 45 | confDir.setNameFilter("*.conf"); |
42 | const QFileInfoList *list = confDir.entryInfoList(); | 46 | const QFileInfoList *list = confDir.entryInfoList(); |
43 | QFileInfoListIterator it( *list ); | 47 | QFileInfoListIterator it( *list ); |
44 | QFileInfo *fi; | 48 | QFileInfo *fi; |
45 | 49 | ||
46 | ListViewItemConfFile *fileEntry; | 50 | ListViewItemConfFile *fileEntry; |
47 | 51 | ||
48 | while ( (fi=it.current()) ) | 52 | while ( (fi=it.current()) ) |
49 | { | 53 | { |
50 | qDebug( "opening: >%s<", fi->fileName().data() ); | 54 | odebug << "opening: >" << fi->fileName().data() << "<" << oendl; |
51 | fileEntry = new ListViewItemConfFile( fi, this ); | 55 | fileEntry = new ListViewItemConfFile( fi, this ); |
52 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); | 56 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); |
53 | ++it; | 57 | ++it; |
54 | } | 58 | } |
55 | } | 59 | } |
56 | 60 | ||
57 | void ListViewConfDir::expand(QListViewItem *item) | 61 | void ListViewConfDir::expand(QListViewItem *item) |
58 | { | 62 | { |
59 | ((ListViewItemConf*)item)->expand(); | 63 | ((ListViewItemConf*)item)->expand(); |
60 | } | 64 | } |
61 | 65 | ||
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 1ff2c44..2958cf5 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp | |||
@@ -1,91 +1,97 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
10 | 10 | ||
11 | #include "listviewitemconffile.h" | 11 | #include "listviewitemconffile.h" |
12 | #include "listviewitemconfigentry.h" | ||
13 | |||
14 | /* OPIE */ | ||
15 | #include <opie2/odebug.h> | ||
16 | using namespace Opie::Core; | ||
17 | |||
18 | /* QT */ | ||
12 | #include <qmessagebox.h> | 19 | #include <qmessagebox.h> |
13 | #include <qtextstream.h> | 20 | #include <qtextstream.h> |
14 | #include "listviewitemconfigentry.h" | ||
15 | 21 | ||
16 | #define tr QObject::tr | 22 | #define tr QObject::tr |
17 | 23 | ||
18 | ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) | 24 | ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) |
19 | : ListViewItemConf(parent), _valid(false) | 25 | : ListViewItemConf(parent), _valid(false) |
20 | { | 26 | { |
21 | confFileInfo = file; | 27 | confFileInfo = file; |
22 | // parseFile(); | 28 | // parseFile(); |
23 | displayText(); | 29 | displayText(); |
24 | } | 30 | } |
25 | 31 | ||
26 | ListViewItemConfFile::~ListViewItemConfFile() | 32 | ListViewItemConfFile::~ListViewItemConfFile() |
27 | { | 33 | { |
28 | } | 34 | } |
29 | 35 | ||
30 | 36 | ||
31 | void ListViewItemConfFile::displayText() | 37 | void ListViewItemConfFile::displayText() |
32 | { | 38 | { |
33 | setText(0,(_changed?"*":"")+confFileInfo->fileName()); | 39 | setText(0,(_changed?"*":"")+confFileInfo->fileName()); |
34 | } | 40 | } |
35 | 41 | ||
36 | QString ListViewItemConfFile::fileName() | 42 | QString ListViewItemConfFile::fileName() |
37 | { | 43 | { |
38 | return confFileInfo->fileName(); | 44 | return confFileInfo->fileName(); |
39 | } | 45 | } |
40 | 46 | ||
41 | void ListViewItemConfFile::parseFile() | 47 | void ListViewItemConfFile::parseFile() |
42 | { | 48 | { |
43 | //qDebug("ListViewItemConfFile::parseFile BEGIN"); | 49 | //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl; |
44 | QFile confFile(confFileInfo->absFilePath()); | 50 | QFile confFile(confFileInfo->absFilePath()); |
45 | if(! confFile.open(IO_ReadOnly)) | 51 | if(! confFile.open(IO_ReadOnly)) |
46 | QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); | 52 | QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); |
47 | QTextStream t( &confFile ); | 53 | QTextStream t( &confFile ); |
48 | QString s; | 54 | QString s; |
49 | QString group; | 55 | QString group; |
50 | ListViewItemConfigEntry *groupItem; | 56 | ListViewItemConfigEntry *groupItem; |
51 | ListViewItemConfigEntry *item; | 57 | ListViewItemConfigEntry *item; |
52 | while ( !t.atEnd() ) | 58 | while ( !t.atEnd() ) |
53 | { | 59 | { |
54 | s = t.readLine().stripWhiteSpace(); | 60 | s = t.readLine().stripWhiteSpace(); |
55 | //qDebug( "line: >%s<\n", s.latin1() ); | 61 | //odebug << "line: >" << s.latin1() << "<\n" << oendl; |
56 | if (s.contains("<?xml")) | 62 | if (s.contains("<?xml")) |
57 | { | 63 | { |
58 | _valid = false; | 64 | _valid = false; |
59 | break; | 65 | break; |
60 | }else | 66 | }else |
61 | if ( s[0] == '[' && s[s.length()-1] == ']' ) | 67 | if ( s[0] == '[' && s[s.length()-1] == ']' ) |
62 | { | 68 | { |
63 | // qDebug("got group"+s); | 69 | // odebug << "got group"+s << oendl; |
64 | group = s.mid(1,s.length()-2); | 70 | group = s.mid(1,s.length()-2); |
65 | if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); | 71 | if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); |
66 | groupItem = new ListViewItemConfigEntry(this, group ); | 72 | groupItem = new ListViewItemConfigEntry(this, group ); |
67 | insertItem( groupItem ); | 73 | insertItem( groupItem ); |
68 | } else | 74 | } else |
69 | if ( int pos = s.find('=') ) | 75 | if ( int pos = s.find('=') ) |
70 | { | 76 | { |
71 | // qDebug("got key"+s); | 77 | // odebug << "got key"+s << oendl; |
72 | if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); | 78 | if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl; |
73 | item = new ListViewItemConfigEntry(this, group, s ); | 79 | item = new ListViewItemConfigEntry(this, group, s ); |
74 | groupItem->insertItem( item ); | 80 | groupItem->insertItem( item ); |
75 | } | 81 | } |
76 | } | 82 | } |
77 | confFile.close(); | 83 | confFile.close(); |
78 | setExpandable( _valid ); | 84 | setExpandable( _valid ); |
79 | //qDebug("ListViewItemConfFile::parseFile END"); | 85 | //odebug << "ListViewItemConfFile::parseFile END" << oendl; |
80 | } | 86 | } |
81 | 87 | ||
82 | 88 | ||
83 | void ListViewItemConfFile::remove() | 89 | void ListViewItemConfFile::remove() |
84 | { | 90 | { |
85 | QFile::remove(confFileInfo->absFilePath()); | 91 | QFile::remove(confFileInfo->absFilePath()); |
86 | QFile::remove(backupFileName()); | 92 | QFile::remove(backupFileName()); |
87 | delete this; | 93 | delete this; |
88 | } | 94 | } |
89 | 95 | ||
90 | void ListViewItemConfFile::revert() | 96 | void ListViewItemConfFile::revert() |
91 | { | 97 | { |
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 @@ | |||
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
11 | 11 | ||
12 | 12 | ||
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | #include "listviewconfdir.h" | ||
15 | #include "listviewitemconfigentry.h" | ||
14 | 16 | ||
17 | /* OPIE */ | ||
18 | #include <opie2/odebug.h> | ||
19 | using namespace Opie::Core; | ||
20 | |||
21 | /* QT */ | ||
15 | #include <qlabel.h> | 22 | #include <qlabel.h> |
16 | #include <qlayout.h> | 23 | #include <qlayout.h> |
17 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
18 | 25 | ||
19 | #include "listviewconfdir.h" | ||
20 | #include "listviewitemconfigentry.h" | ||
21 | |||
22 | |||
23 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 26 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
24 | QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) | 27 | QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) |
25 | { | 28 | { |
26 | setCaption( tr("Conf File Editor") ); | 29 | setCaption( tr("Conf File Editor") ); |
27 | 30 | ||
28 | //setBaseSize( qApp->globalStrut() ); | 31 | //setBaseSize( qApp->globalStrut() ); |
29 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); | 32 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
30 | 33 | ||
31 | mainLayout = new QVBoxLayout( this ); | 34 | mainLayout = new QVBoxLayout( this ); |
32 | mainLayout->setSpacing( 0 ); | 35 | mainLayout->setSpacing( 0 ); |
33 | mainLayout->setMargin( 0 ); | 36 | mainLayout->setMargin( 0 ); |
34 | 37 | ||
35 | 38 | ||
36 | qDebug("creating settingList"); | 39 | odebug << "creating settingList" << oendl; |
37 | settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); | 40 | settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); |
38 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); | 41 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
39 | mainLayout->addWidget( settingList, 0); | 42 | mainLayout->addWidget( settingList, 0); |
40 | 43 | ||
41 | qDebug("creating editor"); | 44 | odebug << "creating editor" << oendl; |
42 | editor = new EditWidget(this); | 45 | editor = new EditWidget(this); |
43 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); | 46 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); |
44 | mainLayout->addWidget( editor, 1 ); | 47 | mainLayout->addWidget( editor, 1 ); |
45 | editor->layoutType( ListViewItemConf::File ); | 48 | editor->layoutType( ListViewItemConf::File ); |
46 | 49 | ||
47 | makeMenu(); | 50 | makeMenu(); |
48 | 51 | ||
49 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), | 52 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), |
50 | this, SLOT(setCurrent(QListViewItem*))); | 53 | this, SLOT(setCurrent(QListViewItem*))); |
51 | connect( settingList, SIGNAL( clicked(QListViewItem*) ), | 54 | connect( settingList, SIGNAL( clicked(QListViewItem*) ), |
52 | this, SLOT( stopTimer(QListViewItem*) ) ); | 55 | this, SLOT( stopTimer(QListViewItem*) ) ); |
53 | 56 | ||
@@ -89,25 +92,25 @@ void MainWindow::makeMenu() | |||
89 | connect( popupTimer, SIGNAL(timeout()), | 92 | connect( popupTimer, SIGNAL(timeout()), |
90 | this, SLOT(showPopup()) ); | 93 | this, SLOT(showPopup()) ); |
91 | } | 94 | } |
92 | 95 | ||
93 | MainWindow::~MainWindow() | 96 | MainWindow::~MainWindow() |
94 | { | 97 | { |
95 | } | 98 | } |
96 | 99 | ||
97 | 100 | ||
98 | 101 | ||
99 | void MainWindow::setCurrent(QListViewItem *item) | 102 | void MainWindow::setCurrent(QListViewItem *item) |
100 | { | 103 | { |
101 | //qDebug("MainWindow::setCurrent"); | 104 | //odebug << "MainWindow::setCurrent" << oendl; |
102 | if (!item) return; | 105 | if (!item) return; |
103 | _item = (ListViewItemConf*) item; | 106 | _item = (ListViewItemConf*) item; |
104 | if (!_item) return; | 107 | if (!_item) return; |
105 | popupTimer->start( 750, true ); | 108 | popupTimer->start( 750, true ); |
106 | if (_item->getType() == ListViewItemConf::File) | 109 | if (_item->getType() == ListViewItemConf::File) |
107 | { | 110 | { |
108 | editor->layoutType(EditWidget::File); | 111 | editor->layoutType(EditWidget::File); |
109 | _currentItem=0; | 112 | _currentItem=0; |
110 | _fileItem = (ListViewItemConfFile*)item; | 113 | _fileItem = (ListViewItemConfFile*)item; |
111 | return; | 114 | return; |
112 | } | 115 | } |
113 | _fileItem = 0; | 116 | _fileItem = 0; |
@@ -165,25 +168,25 @@ void MainWindow::revertConfFile() | |||
165 | if (!_item) return; | 168 | if (!_item) return; |
166 | _item->revert(); | 169 | _item->revert(); |
167 | } | 170 | } |
168 | 171 | ||
169 | void MainWindow::removeConfFile() | 172 | void MainWindow::removeConfFile() |
170 | { | 173 | { |
171 | if (!_item) return; | 174 | if (!_item) return; |
172 | _item->remove(); | 175 | _item->remove(); |
173 | } | 176 | } |
174 | 177 | ||
175 | void MainWindow::showPopup() | 178 | void MainWindow::showPopup() |
176 | { | 179 | { |
177 | qDebug("showPopup"); | 180 | odebug << "showPopup" << oendl; |
178 | if (!_item) return; | 181 | if (!_item) return; |
179 | popupActionRevert->setEnabled(_item->revertable()); | 182 | popupActionRevert->setEnabled(_item->revertable()); |
180 | popupActionSave->setEnabled(_item->isChanged()); | 183 | popupActionSave->setEnabled(_item->isChanged()); |
181 | if (_fileItem) | 184 | if (_fileItem) |
182 | { | 185 | { |
183 | popupActionSave->setEnabled(_fileItem->isChanged()); | 186 | popupActionSave->setEnabled(_fileItem->isChanged()); |
184 | popupMenuFile->popup( QCursor::pos() ); | 187 | popupMenuFile->popup( QCursor::pos() ); |
185 | }else if(_currentItem) | 188 | }else if(_currentItem) |
186 | { | 189 | { |
187 | popupMenuEntry->popup( QCursor::pos() ); | 190 | popupMenuEntry->popup( QCursor::pos() ); |
188 | } | 191 | } |
189 | } | 192 | } |