Fix problems with special characters on gdb's command line.
[kdbg.git] / kdbg / updateui.cpp
blob954bb8bb518ff8fdbcf28edd2be15c7b2c705331
1 // $Id$
3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
6 #include "updateui.h"
7 #include "updateui.moc"
8 #include <qpopupmenu.h>
9 #include <ktoolbar.h>
10 #ifdef HAVE_CONFIG_H
11 #include "config.h"
12 #endif
13 #include "mydebug.h"
15 UpdateUI::~UpdateUI()
17 disconnect(this);
21 UpdateMenuUI::UpdateMenuUI(QPopupMenu* m, QObject* receiver, const char* slotUpdateItem) :
22 menu(m)
24 ASSERT(menu != 0);
25 connect(this, SIGNAL(updateUIItem(UpdateUI*)), receiver, slotUpdateItem);
28 UpdateMenuUI::~UpdateMenuUI()
32 void UpdateMenuUI::iterateMenu()
34 ASSERT(menu != 0);
36 for (int i = menu->count()-1; i >= 0; i--) {
37 index = i;
38 id = menu->idAt(i);
39 emit updateUIItem(this);
43 void UpdateMenuUI::setCheck(bool check)
45 menu->setItemChecked(id, check);
48 void UpdateMenuUI::enable(bool enable)
50 menu->setItemEnabled(id, enable);
53 void UpdateMenuUI::setText(const QString& text)
55 menu->changeItem(text, id);
58 UpdateToolbarUI::UpdateToolbarUI(KToolBar* t, QObject* receiver, const char* slotUpdateItem,
59 const int* idl, int c) :
60 toolbar(t),
61 count(c),
62 idlist(idl)
64 ASSERT(toolbar != 0);
65 connect(this, SIGNAL(updateUIItem(UpdateUI*)), receiver, slotUpdateItem);
68 void UpdateToolbarUI::iterateToolbar()
70 ASSERT(toolbar != 0);
72 for (int i = count-1; i >= 0; i--) {
73 index = i;
74 id = idlist[i];
75 emit updateUIItem(this);
79 void UpdateToolbarUI::setCheck(bool /*check*/)
81 // checking a toolbar button is not done via UpdateUI
84 void UpdateToolbarUI::enable(bool enable)
86 toolbar->setItemEnabled(id, enable);
89 void UpdateToolbarUI::setText(const QString& /*text*/)