Upgrading to GitLab 12.1.0.

Commit 3e328b47 authored by Alf Gaida's avatar Alf Gaida

Cherry-picking upstream version 1.10.16+20151210.

Removed dbg package in favor of dbgsym.
Removed unused files and licenses from copyright.
Installed manpage.
parent 8166a027
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
set(PROJECT qps)
project(${PROJECT})
project(qps)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
......@@ -60,9 +59,9 @@ install(FILES
# building tarball with CPack
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
......
qps (1.10.16+20151210-1) unstable; urgency=medium
* Cherry-picking upstream version 1.10.16+20151210.
* Removed dbg package in favor of dbgsym.
* Removed unused files and licenses from copyright.
* Installed manpage.
-- Alf Gaida <agaida@siduction.org> Sun, 27 Dec 2015 03:37:11 +0100
qps (1.10.16+20150823-1) unstable; urgency=medium
* Initial Release (Closes: #795697)
......
......@@ -22,15 +22,3 @@ Depends: ${shlibs:Depends},
${misc:Depends}
Description: Qt process manager
Qt process manager ported to Qt5
Package: qps-dbg
Architecture: any
Section: debug
Priority: extra
Depends: ${shlibs:Depends},
${misc:Depends},
qps (= ${binary:Version})
Description: Qt process manager (debug)
Qt process manager ported to Qt5
.
This package contains debugging symbols for qps.
......@@ -26,10 +26,6 @@ Copyright: 1997-1999 Mattias Engdegård
2015- daehyun.yang@gmail.com
License: GPL-2.0+
Files: src/qticonloader.*
Copyright: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
License: LGPL-2.1-Nokia-Qt-Exception-1 or GPL-3
Files: src/qttableview.*
Copyright: 1992-2000 Trolltech AS
License: GPL-2.0 or QPL-1.0
......@@ -121,49 +117,6 @@ License: LGPL-2.1+
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in "/usr/share/common-licenses/LGPL-2.1".
License: LGPL-2.1-Nokia-Qt-Exception-1
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
`/usr/share/common-licenses/LGPL-2.1'.
.
Nokia Qt LGPL Exception version 1.0
.
As a special exception to the GNU Lesser General Public License
version 2.1, the object code form of a "work that uses the Library"
may incorporate material from a header file that is part of the
Library. You may distribute such object code under terms of your
choice, provided that the incorporated material (i) does not exceed
more than 5% of the total size of the Library; and (ii) is limited to
numerical parameters, data structure layouts, accessors, macros,
inline functions and templates.
License: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as published by
the Free Software Foundation,
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
License: QPL-1.0
THE Q PUBLIC LICENSE
version 1.0
......
......@@ -4,10 +4,5 @@
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@ --buildsystem=cmake --parallel
override_dh_auto_install:
dh_auto_install -- DESTDIR=$(CURDIR)/debian/qps
override_dh_strip:
dh_strip --dbg-package=qps-dbg
dh ${@} --buildsystem=cmake \
--parallel
......@@ -6,6 +6,5 @@
<file>icon/vcross.png</file>
<file>icon/pause.png</file>
<file>icon/superman.png</file>
<file>icon/preferences-system.png</file>
</qresource>
</RCC>
set(SOURCES
proc.cpp
qpsapp.cpp
qps.cpp
screenshot.cpp
pstable.cpp
......@@ -14,6 +15,14 @@ set(SOURCES
lookup.cpp
details.cpp
command.cpp
commandutils.cpp
commandmodel.cpp
commanddialog.cpp
checkboxdelegate.cpp
execwindow.cpp
watchcond.cpp
listmodel.cpp
watchdogdialog.cpp
misc.cpp
trayicon.cpp
htable.cpp
......@@ -23,6 +32,7 @@ set(SOURCES
)
SET(HEADERS
qpsapp.h
qps.h
screenshot.h
pstable.h
......@@ -32,7 +42,16 @@ SET(HEADERS
infobar.h
lookup.h
details.h
tablefield.h
command.h
commandutils.h
commandmodel.h
commanddialog.h
checkboxdelegate.h
execwindow.h
watchcond.h
listmodel.h
watchdogdialog.h
misc.h
trayicon.h
htable.h
......@@ -46,6 +65,7 @@ set(UIS
message.ui
)
set(RESOURCES "../qps.qrc")
#-----------------------------------------------------------------------------
# Translations
#-----------------------------------------------------------------------------
......@@ -69,22 +89,23 @@ lxqt_translate_desktop(DESKTOP_FILES
#-----------------------------------------------------------------------------
add_executable(${PROJECT}
add_executable(${PROJECT_NAME}
${SOURCES}
${HEADERS}
${UIS}
${QM_FILES}
${QM_LOADER}
${DESKTOP_FILES}
${RESOURCES}
)
target_link_libraries(${PROJECT}
target_link_libraries(${PROJECT_NAME}
Qt5::Widgets
Qt5::X11Extras
Qt5::DBus
)
install(TARGETS ${PROJECT} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
install(FILES
${DESKTOP_FILES}
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
......
// checkboxdelegate.cpp
//
// This program is free software. See the file COPYING for details.
// Author: Mattias Engdeg?rd, 1997-1999
#include "checkboxdelegate.h"
#include <QSpinBox>
checkBoxDelegate::checkBoxDelegate(QObject *parent) : QItemDelegate(parent) {}
//! [0]
//! [1]
QWidget *checkBoxDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
printf("createEditor\n");
// return 0;
if (index.column() == 1)
{
QSpinBox *editor = new QSpinBox(parent);
editor->setMinimum(0);
editor->setMaximum(100);
return editor;
}
return QItemDelegate::createEditor(parent, option, index);
return 0;
}
//! [1]
//! [2]
void checkBoxDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
printf("setEditorData\n");
return;
// if(index
if (index.column() == 1)
{
int value = index.model()->data(index, Qt::EditRole).toInt();
// int value=0;
QSpinBox *spinBox = static_cast<QSpinBox *>(editor);
spinBox->setValue(value);
}
}
//! [2]
//! [3]
void checkBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
printf("setModelData\n");
return;
if (index.column() == 1)
{
QSpinBox *spinBox = static_cast<QSpinBox *>(editor);
spinBox->interpretText();
int value = spinBox->value();
model->setData(index, value, Qt::EditRole);
}
}
//! [3]
//! [4]
void checkBoxDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
printf("updateEditorGeometry\n");
// if(index.column()==1)
editor->setGeometry(option.rect);
}
//! [4]
void checkBoxDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
printf("paint\n");
if (index.column() == 1)
{
QVariant value = 0; // index.model()->data(index, Qt::UserRole);
/* if (!isSupportedType(value.type())) {
QStyleOptionViewItem myOption = option;
myOption.state &= ~QStyle::State_Enabled;
QItemDelegate::paint(painter, myOption, index);
return;
} */
}
QItemDelegate::paint(painter, option, index);
}
// QSize QAbstractItemDelegate::sizeHint ( const QStyleOptionViewItem & option,
// const QModelIndex & index ) const [pure virtual]
// checkboxdelegate.h
//
// This program is free software. See the file COPYING for details.
// Author: Mattias Engdeg?rd, 1997-1999
#ifndef CHECKBOXDELEGATE_H
#define CHECKBOXDELEGATE_H
#include <QItemDelegate>
class checkBoxDelegate : public QItemDelegate
// class checkBoxDelegate : public QAbstractItemDelegate
{
Q_OBJECT
public:
checkBoxDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
};
#endif // CHECKBOXDELEGATE_H
This diff is collapsed.
// command.h emacs, this is written in -*-c++-*-
//
// This program is free software. See the file COPYING for details.
// Author: Mattias Engdegrd, 1997-1999
// Author: Mattias Engdegrd, 1997-1999
#ifndef COMMAND_H
#define COMMAND_H
......@@ -18,8 +18,7 @@
#include "proc.h"
#include "misc.h"
int find_command(QString s);
void add_default_command();
class ListModel;
class Command
{
......@@ -41,186 +40,4 @@ class Command
bool popup;
};
class CommandModel : public QAbstractItemModel
{
Q_OBJECT
public:
CommandModel(QObject *parent = 0);
~CommandModel();
QModelIndex index(int row, int column, const QModelIndex &parent) const;
QModelIndex parent(const QModelIndex &child) const;
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const { return 1; };
QVariant data(const QModelIndex &index, int role) const;
// Qt::ItemFlags flags(const QModelIndex &index) const;
void update(); // TEMP
};
// class CommandDialog : public QWidget
class CommandDialog : public QDialog
{
Q_OBJECT
public:
CommandDialog();
signals:
void command_change();
protected slots:
void new_cmd();
void add_new();
void del_current();
void set_buttons(int);
void reset();
void set_select(const QModelIndex &);
void event_name_midified(const QString &new_name);
void event_cmd_modified();
void event_toolbar_checked(bool);
private:
QListView *listview;
QPushButton *new0, *add, *del, *edit, *button_ok;
QLineEdit *name, *cmdline;
QCheckBox *qcheck1;
QCheckBox *qcheck2;
};
#include <QItemDelegate>
class checkBoxDelegate : public QItemDelegate
// class checkBoxDelegate : public QAbstractItemDelegate
{
Q_OBJECT
public:
checkBoxDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
};
#include <QStandardItemModel>
// class ListModel : public QAbstractItemModel
class ListModel : public QAbstractTableModel
// class ListModel : public QStandardItemModel
{
Q_OBJECT
public:
ListModel(QObject *parent = 0){};
~ListModel(){};
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const; // pure
QModelIndex parent(const QModelIndex &child) const; // pure virtual
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const { return 2; };
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation o, int role) const;
// QMap<int, QVariant> itemData ( const QModelIndex & index ) const
//;
void update()
{ // reset();
}
void update(const QModelIndex &idx);
void update(int row);
// Qt::ItemFlags flags(const QModelIndex &index) const;
// void update(); //TEMP
};
#include "ui_watchdog.h"
class WatchdogDialog : public QDialog, private Ui_EventDialog
{
Q_OBJECT
public:
WatchdogDialog();
ListModel *listmodel;
// signals:
// void command_change();
void checkCombo();
protected slots:
void _new();
void apply();
void add();
void del();
void condChanged(const QString &str);
void Changed(const QString &str);
void comboChanged(int);
void eventcat_slected(const QModelIndex &idx);
protected:
virtual void showEvent(QShowEvent *event);
// void set_select( const QModelIndex & );
// void event_name_midified(const QString &new_name);
// void event_cmd_modified();
// void event_toolbar_checked(bool);
private:
};
#define WATCH_PROCESS_START 0
#define WATCH_PROCESS_FINISH 1
#define WATCH_PROCESS_CPU_OVER 2
#define WATCH_SYS_CPU_OVER 3
#define WATCH_SYS_CPU_UNDER 4
// if process [name] start, exec [command], showmsg [xxx]
// if process [name] finish exec [command], showmsg [xxx]
// if system cpu over [90%], exec [command], msg [xxx]
// if system cpu under [10%], exec [command], msg [xxx]
// if process [name] cpu over [90%] exec [command] msg [xxx]
// if process [name] start, kill_it, msg [xxx]
// if process [name] start, soundplay [ ], msg [xxx]
class watchCond
{
public:
int cond;
int enable;
int cpu;
QString procname;
QString command;
QString message;
watchCond()
{
enable = 0;
// procname[0]=0; command[0]=0;
// message[0]=0;
}
// key [txt] [a]
// QString getVal(QString &str, QString &key)
QString getVal(QString &str, const char *key);
QString getstring();
void putstring(QString str);
};
#include <QProcess>
#include "ui_message.h"
class ExecWindow : public QWidget, private Ui_ExecWindow
{
Q_OBJECT
public:
ExecWindow();
ExecWindow(QString str, QString exec_cmd, int pid = 0, QString cmd = "");
ExecWindow(watchCond *wc, int pid = 0, QString cmd = "");
~ExecWindow();
void setText(QString str);
QProcess *pr;
// QProcess proc;
QString execmd;
int flag_started;
watchCond *wcond;
protected slots:
void cmd_started();
void cmd_finished(int exitCode, QProcess::ExitStatus exitStatus);
void cmd_error(QProcess::ProcessError error);
void cmd_ok();
};
#endif // COMMAND_H
// commanddialog.cpp
//
// This program is free software. See the file COPYING for details.
// Author: Mattias Engdeg?rd, 1997-1999
#include "commanddialog.h"
#include "qps.h"
#include "command.h"
#include "commandutils.h"
#include "commandmodel.h"
#include <QListView>
#include <QPushButton>
#include <QLineEdit>
#include <QCheckBox>
#include <QModelIndex>
#include <QLabel>
#include <QMessageBox>
#include <QLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFrame>
extern QList<Command *> commands;
CommandDialog::CommandDialog()
{
setWindowTitle("Edit Commands 0.1 alpha");
// setWindowFlags(Qt::WindowStaysOnTopHint);
QHBoxLayout *hbox = new QHBoxLayout(this); // TOP
CommandModel *cmdModel = new CommandModel(this);
// item list
listview = new QListView(this);
listview->setModel(cmdModel);
listview->setFixedWidth(fontMetrics().width("0") * 16);
hbox->addWidget(listview);
QVBoxLayout *vbox = new QVBoxLayout; // TOP-> RIGHT
hbox->addLayout(vbox);
QHBoxLayout *h1 = new QHBoxLayout;
vbox->addLayout(h1);
QLabel *l1 = new QLabel("Name:", this);
h1->addWidget(l1);
name = new QLineEdit(this);
name->setMinimumWidth(170);
name->setText("");
h1->addWidget(name);
QHBoxLayout *hbox2 = new QHBoxLayout;
vbox->addLayout(hbox2);
// qcheck1 = new QCheckBox (this);
// qcheck1->setText("Toolbar");
// qcheck1->setEnabled(false);
// hbox2->addWidget(qcheck1);
if (0)
{
qcheck2 = new QCheckBox(this);
qcheck2->setText("Popup");
qcheck2->setEnabled(false);
hbox2->addWidget(qcheck2);
}
QLabel *l2 = new QLabel("Command Line:", this);
l2->setFixedHeight(l2->sizeHint().height());
l2->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
vbox->addWidget(l2);
cmdline = new QLineEdit(this);
cmdline->setFixedHeight(cmdline->sizeHint().height());
cmdline->setMinimumWidth(250);
cmdline->setText("");
vbox->addWidget(cmdline);
QLabel *l3 = new QLabel("Substitutions:\n"
"%p\tPID\n"
"%c\tCOMMAND\n%C\tCMDLINE\n%u\tUSER\n"
"%%\t%\n"
"\n",
this);
l3->setFrameStyle(QFrame::Panel);
l3->setFrameShadow(QFrame::Sunken);
l3->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); // | Qt::ExpandTabs);
vbox->addWidget(l3);
QHBoxLayout *hl = new QHBoxLayout;
vbox->addLayout(hl);
new0 = new QPushButton("New...", this);
hl->addWidget(new0);
add = new QPushButton("Add...", this);
hl->addWidget(add);
del = new QPushButton("Delete", this);
hl->addWidget(del);
button_ok = new QPushButton("Close", this);
hl->addWidget(button_ok);
connect(listview, SIGNAL(clicked(const QModelIndex &)),
SLOT(set_select(const QModelIndex &)));
connect(new0, SIGNAL(clicked()), SLOT(new_cmd()));
connect(add, SIGNAL(clicked()), SLOT(add_new()));
connect(del, SIGNAL(clicked()), SLOT(del_current()));
connect(button_ok, SIGNAL(clicked()), SLOT(close()));
connect(name, SIGNAL(textChanged(const QString &)),
SLOT(event_name_midified(const QString &)));
connect(cmdline, SIGNAL(textChanged(const QString &)),
SLOT(event_cmd_modified()));
// connect(qcheck1, SIGNAL(toggled ( bool ) ),
// SLOT(event_toolbar_checked(bool
// )));
TBloon *bloon = new TBloon(this);
/// for(int i = 0; i < commands.size(); i++)
/// listview->insertItem(commands[i]->name);
// listview->addItem(commands[i]->name);
/// vbox->freeze();
}
// DEL
void CommandDialog::event_toolbar_checked(bool on)
{
// name->text();
int idx = find_command(name->text());
if (idx >= 0)
commands[idx]->toolbar = on;
/// controlbar->update_bar();
}
void CommandDialog::event_name_midified(const QString &new_name)
{
int idx;
FUNC_START;
// printf("debug:changed_description() start \n");
idx = find_command(new_name);
if (idx == -1)
{
add->setEnabled(1);
}
else
add->setEnabled(0);
// printf("debug:changed_description() end \n");
}
// if modified then call this function
void CommandDialog::event_cmd_modified()
{
int idx;
// if(name->text()=="") return;
if (find_command(name->text()) < 0)
return;
idx = find_command(name->text());
commands[idx]->name = name->text();
commands[idx]->cmdline = cmdline->text();
emit command_change();
}
// set the description,cmdline from current selected QListBox item
void CommandDialog::set_buttons(int index)
{
if (index < 0)
{
new_cmd();
return;
}
/*
//bool sel = (lb->currentRow() >= 0);
Command *c ;
if(sel)
//c = commands[find_command(lb->currentText())];
c = commands[find_command(lb->currentText())];
else
c = commands[find_command(lb->text(index))];
name->setText(c->name);
cmdline->setText(c->cmdline);
del->setEnabled(sel);
*/
}
// called when clicked !
void CommandDialog::set_select(const QModelIndex &index)
{
Command *c =
static_cast<Command *>(index.internalPointer()); // never Null ?
/*
if (item==NULL) return; // important
Command *c = commands[find_command(item->text())];
*/
name->setText(c->name);
cmdline->setText(c->cmdline);
// DEL qcheck1->setChecked(c->toolbar);
// qcheck2->setChecked(c->popup);