Commit 24434f0e authored by Chris Schlaeger's avatar Chris Schlaeger
Browse files

Bug #6841 fixed.

Handling of icons with "broken" masks fixed.
Crash when dropping display and clicking beside popup menu fixed.
README updated.
desktop file updated.

svn path=/trunk/kdebase/ksysguard/; revision=59069
parent 583083f5
......@@ -20,7 +20,7 @@ and merging becomes a real headache so your code will be lost.
This does not mean that I don't appreciate your help. Especially
porting to other platforms is difficult for me. Each platform has it's
specific back-end. See the ktopd directory for details.
specific back-end. See the ksysguardd directory for details.
5-Jan-2000 Chris Schlaeger <cs@kde.org>
......
......@@ -137,6 +137,7 @@ ProcessList::ProcessList(QWidget *parent, const char* name)
parent, SLOT(timerOn()));
treeViewEnabled = false;
openAll = TRUE;
filterMode = FILTER_ALL;
......@@ -192,7 +193,7 @@ ProcessList::update(const QString& list)
int vpos = verticalScrollBar()->value();
int hpos = horizontalScrollBar()->value();
updateSelectedPIds();
updateMetaInfo();
clear();
#if 0
......@@ -282,7 +283,7 @@ ProcessList::buildTree()
pl.remove();
if (selectedPIds.findIndex(pid) != -1)
pli->setSelected(true);
pli->setSelected(TRUE);
// insert all child processes of current process
extendTree(&pl, pli, pid);
......@@ -340,8 +341,11 @@ ProcessList::extendTree(QList<SensorPSLine>* pl, ProcessLVI* parent, int ppid)
if (selectedPIds.findIndex(ps->getPid()) != -1)
pli->setSelected(true);
// set parent to 'open'
setOpen(parent, TRUE);
if (ps->getPPid() != INIT_PID &&
closedSubTrees.findIndex(ps->getPPid()) != -1)
setOpen(parent, FALSE);
else
setOpen(parent, TRUE);
// remove the process from the process list, ps is now invalid
int pid = ps->getPid();
......@@ -370,13 +374,9 @@ ProcessList::addProcess(SensorPSLine* p, ProcessLVI* pli)
* with this name. */
QPixmap pix = icons->loadIcon(p->getName(), KIcon::Desktop,
KIcon::SizeSmall);
if (pix.isNull())
{
pix = QPixmap(BarIcon(p->getName()));
if (pix.isNull())
pix = icons->loadIcon("unkown", KIcon::Desktop,
KIcon::SizeSmall);
}
if (pix.isNull() || !pix.mask())
pix = icons->loadIcon("unkown", KIcon::Desktop,
KIcon::SizeSmall);
/* We copy the icon into a 24x16 pixmap to add a 4 pixel margin on
* the left and right side. In tree view mode we use the original
......@@ -403,9 +403,10 @@ ProcessList::addProcess(SensorPSLine* p, ProcessLVI* pli)
}
void
ProcessList::updateSelectedPIds(void)
ProcessList::updateMetaInfo(void)
{
selectedPIds.clear();
closedSubTrees.clear();
QListViewItemIterator it(this);
......@@ -414,7 +415,20 @@ ProcessList::updateSelectedPIds(void)
{
if (it.current()->isSelected())
selectedPIds.append(it.current()->text(1).toInt());
}
if (treeViewEnabled && !it.current()->isOpen())
closedSubTrees.append(it.current()->text(1).toInt());
}
/* In list view mode all list items are set to closed by QListView.
* If the tree view is now selected, all item will be closed. This is
* annoying. So we use the openAll flag to force all trees to open when
* the treeViewEnbled flag was set to true. */
if (openAll)
{
if (treeViewEnabled)
closedSubTrees.clear();
openAll = FALSE;
}
}
void
......
/*
KTop, the KDE Task Manager and System Monitor
Copyright (c) 1999 Chris Schlaeger <cs@kde.org>
Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of version 2 of the GNU General Public
......@@ -108,7 +108,8 @@ public:
public slots:
void setTreeView(bool tv)
{
treeViewEnabled = tv;
if (treeViewEnabled = tv)
openAll = TRUE;
}
/**
......@@ -136,10 +137,10 @@ private:
};
/**
* This function returns the process ID of the currently selected
* process. If there isn't any -1 is returned.
* This function updates the lists of selected PID und the closed
* sub trees.
*/
void updateSelectedPIds(void);
void updateMetaInfo(void);
/**
* This function determines whether a process matches the current
......@@ -219,12 +220,15 @@ private:
int refreshRate;
int currColumn;
bool treeViewEnabled;
bool openAll;
QList<SensorPSLine> pl;
QValueList<KeyFunc> sortFunc;
QValueList<int> selectedPIds;
QValueList<int> closedSubTrees;
KIconLoader* icons;
ProcessMenu* processMenu;
QPopupMenu* headerPM;
......
......@@ -278,6 +278,8 @@ WorkSheet::addDisplay(const QString& hostName, const QString& sensorName,
case 2:
newDisplay = new MultiMeter(this, "MultiMeter", sensorDescr);
break;
default:
return (0);
}
}
else if (sensorType == "table")
......
......@@ -45,6 +45,7 @@
#include <kstdaccel.h>
#include <kaction.h>
#include <kstdaction.h>
#include <kedittoolbar.h>
#include <dcopclient.h>
#include "SensorBrowser.h"
......@@ -54,19 +55,7 @@
#include "HostConnector.h"
#include "../version.h"
#include "ksysguard.h"
#undef RESTORE
#define RESTORE(type)\
{\
int n = 1;\
while (KMainWindow::canBeRestored(n)) {\
(new type)->restore(n);\
n++;\
fprintf(stderr,"N IS %d\n", n); fflush(stderr);\
}\
}
#include "ksysguard.moc"
static const char* Description = I18N_NOOP("KDE System Guard");
TopLevel* Toplevel;
......@@ -131,18 +120,12 @@ TopLevel::TopLevel(const char *name)
statusBarTog = KStdAction::showStatusbar(this, SLOT(showStatusBar()),
actionCollection(),
"showstatusbar");
fprintf(stderr,"NOT WANTING TO, ATTEMPTING TO\n");fflush(stderr);
KStdAction::configureToolbars(this, SLOT(editToolbars()),
actionCollection());
statusBarTog->setChecked(FALSE);
createGUI("ksysguard.rc");
fprintf(stderr,"NOT WANTING TO, ATTEMPTING TO\n");fflush(stderr);
// Hide XML GUI generated toolbar.
//enableToolBar(KToolBar::Hide);
fprintf(stderr,"NOT WANTING TO, ATTEMPTING TO\n");fflush(stderr);
// show the dialog box
show();
fprintf(stderr,"NOT WANTING TO, ATTEMPTING TO\n");fflush(stderr);
}
TopLevel::~TopLevel()
......@@ -262,6 +245,15 @@ TopLevel::showStatusBar()
enableStatusBar(KStatusBar::Toggle);
}
void
TopLevel::editToolbars()
{
KEditToolbar dlg(actionCollection());
if (dlg.exec())
createGUI();
}
void
TopLevel::customEvent(QCustomEvent* ev)
{
......@@ -447,15 +439,13 @@ main(int argc, char** argv)
// create top-level widget
if (a->isRestored()) {
fprintf(stderr,"RESTORING\n");
fflush(stderr);
if (a->isRestored())
{
RESTORE(TopLevel)
} else
}
else
{
fprintf(stderr,"WANTED TO ALLOCATED NEW TOPLEV\n");fflush(stderr);
Toplevel = new TopLevel("KSysGuard");
fprintf(stderr,"ALLOCATED NEW TOPLEV\n");fflush(stderr);
if (args->isSet("showprocesses"))
{
Toplevel->beATaskManager();
......@@ -475,6 +465,3 @@ fprintf(stderr,"ALLOCATED NEW TOPLEV\n");fflush(stderr);
return (result);
}
#include "ksysguard.moc"
[Desktop Entry]
BinaryPattern=ksysguard;
Comment=Task Manager and Performance Monitor
Comment[ca]=Gestor de tasques i monitor del sistema
Comment[ca]=Gestor de tasques i monitor de rendiment
Comment[cs]=Správce úloh a monitor výkonu
Comment[da]=Opgavemanager og ydelsesmåler
Comment[de]=Verwaltung laufender Programme und Systemüberwachung
Comment[de]=Verwaltung laufender Programme und Überwachung ihrer Leistung
Comment[eo]=Taskadministrilo kaj montrilo por procezilo kaj memoro
Comment[es]=Administrador de tareas y monitor del sistema
Comment[et]=Protsesside haldamine ja süsteemi monitooring
Comment[fi]=Prosessien- ja järjestelmänvalvontaohjelma
Comment[es]=Administrador de tareas y monitor de rendimiento
Comment[et]=Protsesside haldamine ja jõudluse monitooring
Comment[fi]=Proessien- ja suorituskyvynhallinta
Comment[fr]=Gestionnaire de tâches et Indicateur ressources
Comment[he]=תכרעמ גצו תומישמ להנמ
Comment[hr]=Upravitelj zadacima i stanje sustava
Comment[he]=םיעוציב גצו תומישמ להנמ
Comment[hr]=Upravitelj zadacima i ocjenitelj učinka
Comment[hu]=Feladatkezelő és teljesítményfigyelő
Comment[is]=ksysguard: Ferlastjóri og álagsmælir
Comment[it]=Gestione task e monitor di sistema
Comment[ja]=タスクマネージャーとシステムモニター
Comment[mk]=Менаџер на процеси и монитор на процеси
Comment[nl]=Takenbeheerder en systeemmonitor
Comment[no]=Oppgavebehandler og systemovervåker
Comment[no_NY]=Oppgåvehandsamar og systemovervakar
Comment[pt]=Gestor de tarefas e monitor de sistema
Comment[pt_BR]=Gerenciador de tarefas e monitor do sistema
Comment[ro]=Administrează procesele sistemului şi monitorizează performanţa
Comment[is]=ktop: Ferlastjóri og álagsmælir
Comment[it]=Gestione task e monitor delle prestazioni
Comment[ja]=タスクマネージャーとパフォーマンスモニター
Comment[mk]=Менаџер на процеси и монитор на перформанси
Comment[nl]=Takenbeheerder en prestatiemonitor
Comment[no]=Oppgavebehandler og ytelsesovervåker
Comment[no_NY]=Oppgåvehandsamar og ytingsmålar
Comment[pl]=Zarządca procesów i monitor obciążenia
Comment[pt]=Gestor de tarefas e monitor de performance
Comment[pt_BR]=Monitor de performance e gerenciador de tarefas
Comment[ro]=Administreaz�procesele sistemului i monitorizeaz�performana
Comment[ru]=Монитор процессов
Comment[sl]=Upravljalnik opravil in sistemski nadzornik
Comment[sl]=Upravljalnik opravil in nadzornik zmogljivosti
Comment[sr]=MenadĹžer za procese i pregled performansi sistema
Comment[sv]=Aktivitetshanterare och systemmonitor
Comment[ta]=பணிகஂகடமஂ ேமலாளரஂ மறஂறுமஂ கணினி கணஂகாணிபபாளரஂ
Comment[tr]=Görev Yöneticisi ve Sistem İzleyici
Comment[uk]=Менеджер задач там системний монітор
Comment[sv]=Hanterar aktiviteter och visar prestanda
Comment[ta]=பணிகஂகடமஂ ேமலாளரஂ மறஂறுமஂ ெசயலஂதிறனஂ கணஂகாணி
Comment[tr]=Görev Yöneticisi ve Performans İzleyici
Comment[uk]=Менеджер задач та монітор завантаження системи
Name=KDE System Guard
Name[ca]=Gestor de tasques i monitor del sistema
Name[cs]=Správce úloh a monitor výkonu
Name[da]=Opgavemanager og ydelsesmåler
Name[de]=Ktop
Name[eo]=Taskadministrilo kaj Sistemmonitoro
Name[es]=Administrador de tareas y monitor del sistema
Name[et]=Protsessihaldur ja süsteemi monitor
Name[fi]=Prosessien- ja järjestelmänvalvonta
Name[fr]=Gestionnaire de tâches et Indicateurs système
Name[he]=תכרעמ גצו תומישמ להנמ
Name[hr]=Upravitelj zadacima i stanje sustava
Name[hu]=Feladatkezelő és teljesítményfigyelő
Name[is]=Ferlastjóri og álagsmælir
Name[it]=Gestione task e monitor di sistema
Name[ja]=タスクマネージャーとシステムモニター
Name[mk]=Менаџер на процеси и монитор на процеси
Name[nl]=Takenbeheerder en systeemmonitor
Name[no]=Oppgavebehandler og systemovervåker
Name[no_NY]=Oppgåvehandsamar og systemovervakar
Name[pl]=Zarządca procesów i monitor obciążenia
Name[pt]=Gestor de Tarefas e Monitor de Sistema
Name[pt_BR]=Gerenciador de tarefas e monitor do sistema
Name[ro]=Manager de procese şi monitor de sistem
Name[ru]=Монитор процессов
Name[sl]=Upravljalnik opravil in sistemski nadzornik
Name[sr]=MenadĹžer za procese i pregled performansi sistema
Name[sv]=Aktivitetshanterare och systemmonitor
Name[ta]=பணிகஂகடமஂ ேமலாளரஂ மறஂறுமஂ கணினி கணஂகாணிபபாளரஂ
Name[tr]=Görev Yöneticisi ve Sistem İzleyici
Name[uk]=Менеджер задач та системний монітор
Name[ca]=Vigilant del sistema KDE
Name[cs]=Kontrola systému pro prostředí KDE
Name[da]=KDE Kontrolvagt
Name[de]=KDE-Systemkontrolle
Name[eo]=KDE-Sistemgardilo
Name[et]=KDE süsteemi valvur
Name[hu]=KDE Rendszerfelügyelő
Name[ja]=KDEシステムガード
Name[nl]=KDE Systeem Bewaking
Name[no]=KDE Systemovervåker
Name[no_NY]=KDE-systemvakt
Name[pt]=Vigilante do Sistema KDE
Name[pt_BR]=Guarda do Sistema
Name[ro]=Sistemul de gardă KDE
Name[sv]=KDE Systemvakt
Exec=ksysguard
Icon=ksysguard
Type=Application
DocPath=ksysguard/ksysguard.html
DocPath=ksysguard/index.html
TerminalOptions=
Terminal=0
Path=
SwallowTitle=xload
SwallowExec=xload -jumpscroll 1 -fg green3 -bg black -nolabel -geometry 50x50+10000+10000
......@@ -80,6 +80,7 @@ protected slots:
void disconnectHost();
void showToolBar();
void showStatusBar();
void editToolbars();
private:
KStatusBar* statusbar;
......
......@@ -9,6 +9,7 @@
<Action name="showmenubar"/>
<Action name="showtoolbar"/>
<Action name="showstatusbar"/>
<Action name="configureToolbar"/>
</Menu>
</MenuBar>
</kpartgui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment