diff --git a/kuiserver/CMakeLists.txt b/kuiserver/CMakeLists.txt index 57d2b6de..10f43fa0 100644 --- a/kuiserver/CMakeLists.txt +++ b/kuiserver/CMakeLists.txt @@ -9,17 +9,10 @@ include(MacroDBusAddActivationService) set(kuiserver_SRCS main.cpp - uiserver.cpp jobview.cpp progresslistmodel.cpp progresslistdelegate.cpp requestviewcallwatcher.cpp - configdialog.ui -) - -set(kuiserver_KDEINIT_PRIVATE - progresslistdelegate_p.h - uiserver_p.h ) # diff --git a/kuiserver/configdialog.ui b/kuiserver/configdialog.ui deleted file mode 100644 index 852ca460..00000000 --- a/kuiserver/configdialog.ui +++ /dev/null @@ -1,99 +0,0 @@ - - - configurationDialog - - - - 0 - 0 - 337 - 259 - - - - - 10 - - - 9 - - - - - 6 - - - 0 - - - - - Finished Jobs - - - - 6 - - - 9 - - - - - Move them to a different list - - - - - - - Remove them - - - - - - - - - - Appearance - - - - 6 - - - 9 - - - - - Show all jobs in a list - - - - - - - Show all jobs in a tree - - - - - - - Show separate windows - - - - - - - - - - - - - diff --git a/kuiserver/jobview.cpp b/kuiserver/jobview.cpp index b43ffc32..d2b47dac 100644 --- a/kuiserver/jobview.cpp +++ b/kuiserver/jobview.cpp @@ -19,7 +19,6 @@ * along with this program. If not, see . * *****************************************************************************/ -#include "uiserver.h" #include "jobviewadaptor.h" #include "requestviewcallwatcher.h" #include "jobview_interface.h" diff --git a/kuiserver/main.cpp b/kuiserver/main.cpp index 53dc6be0..eb118c8a 100644 --- a/kuiserver/main.cpp +++ b/kuiserver/main.cpp @@ -21,9 +21,6 @@ * Boston, MA 02110-1301, USA. */ -#include "uiserver.h" -#include "uiserver_p.h" - #include "progresslistmodel.h" #include diff --git a/kuiserver/progresslistmodel.cpp b/kuiserver/progresslistmodel.cpp index 5faed076..b3182e85 100644 --- a/kuiserver/progresslistmodel.cpp +++ b/kuiserver/progresslistmodel.cpp @@ -19,21 +19,17 @@ */ #include "progresslistmodel.h" - -#include - -#include - #include "jobviewserveradaptor.h" #include "kuiserveradaptor.h" #include "jobviewserver_interface.h" #include "requestviewcallwatcher.h" -#include "uiserver.h" + +#include +#include #include ProgressListModel::ProgressListModel(QObject *parent) - : QAbstractItemModel(parent), QDBusContext(), m_jobId(1), - m_uiServer(0) + : QAbstractItemModel(parent), QDBusContext(), m_jobId(1) { m_serviceWatcher = new QDBusServiceWatcher(this); m_serviceWatcher->setConnection(QDBusConnection::sessionBus()); @@ -57,12 +53,6 @@ ProgressListModel::ProgressListModel(QObject *parent) if (!sessionBus.registerObject(QLatin1String("/JobViewServer"), this)) { kDebug(7024) << "failed to register object JobViewServer."; } - - /* unused - if (m_registeredServices.isEmpty() && !m_uiServer) { - m_uiServer = new UiServer(this); - } - */ } ProgressListModel::~ProgressListModel() @@ -73,8 +63,6 @@ ProgressListModel::~ProgressListModel() qDeleteAll(m_jobViews); qDeleteAll(m_registeredServices); - - delete m_uiServer; } QModelIndex ProgressListModel::parent(const QModelIndex&) const @@ -235,14 +223,11 @@ QStringList ProgressListModel::gatherJobUrls() void ProgressListModel::jobFinished(JobView *jobView) { - // Job finished, delete it if we are not in self-ui mode, *and* the config option to keep finished jobs is set - //TODO: does not check for case for the config - if (!m_uiServer) { - kDebug(7024) << "removing jobview from list, it finished"; - m_jobViews.removeOne(jobView); - //job dies, dest. URL's change.. - emit jobUrlsChanged(gatherJobUrls()); - } + // Job finished, delete it if we are not in self-ui mode, *and* the config option to keep finished jobs is set + kDebug(7024) << "removing jobview from list, it finished"; + m_jobViews.removeOne(jobView); + //job dies, dest. URL's change.. + emit jobUrlsChanged(gatherJobUrls()); } void ProgressListModel::jobChanged(uint jobId) @@ -268,10 +253,6 @@ void ProgressListModel::registerService(const QString &serviceName, const QStrin new org::kde::JobViewServer(serviceName, objectPath, sessionBus); if (client->isValid()) { - - delete m_uiServer; - m_uiServer = 0; - m_serviceWatcher->addWatchedService(serviceName); m_registeredServices.insert(serviceName, client); @@ -309,13 +290,6 @@ void ProgressListModel::serviceUnregistered(const QString &name) emit serviceDropped(name); m_registeredServices.remove(name); - - /* unused (FIXME) - if (m_registeredServices.isEmpty()) { - //the last service dropped, we *need* to show our GUI - m_uiServer = new UiServer(this); - } - */ } QList jobs = m_jobViewsOwners.values(name); diff --git a/kuiserver/progresslistmodel.h b/kuiserver/progresslistmodel.h index bb6e8814..db409b3c 100644 --- a/kuiserver/progresslistmodel.h +++ b/kuiserver/progresslistmodel.h @@ -21,12 +21,9 @@ #ifndef PROGRESSLISTMODEL_H #define PROGRESSLISTMODEL_H -#include "uiserver.h" #include "jobview.h" #include - - #include #include @@ -34,8 +31,6 @@ class ProgressListModel: public QAbstractItemModel, protected QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.JobViewServer") - - public: explicit ProgressListModel(QObject *parent = 0); @@ -187,7 +182,6 @@ private: */ QHash m_registeredServices; - UiServer *m_uiServer; QDBusServiceWatcher *m_serviceWatcher; }; diff --git a/kuiserver/uiserver.cpp b/kuiserver/uiserver.cpp deleted file mode 100644 index 5f93c434..00000000 --- a/kuiserver/uiserver.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * This file is part of the KDE project - * Copyright (C) 2009 Shaun Reich - * Copyright (C) 2006-2008 Rafael Fernández López - * Copyright (C) 2001 George Staikos - * Copyright (C) 2000 Matej Koss - * David Faure - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. -*/ - -#include "uiserver.h" -#include "uiserver_p.h" - -#include "progresslistmodel.h" -#include "progresslistdelegate.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -UiServer::UiServer(ProgressListModel* model) - : KXmlGuiWindow(0), m_systemTray(0) -{ - //NOTE: if enough people really hate this dialog (having centralized information and such), - //I imagine we could somehow forward it to the old dialogs, which would be displayed 1 for each job. - //Or create our own. no worries, we'll see how it plays out.. - - QString configure = i18n("Configure..."); - - toolBar = addToolBar(configure); - toolBar->setMovable(false); - toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - - QAction *configureAction = toolBar->addAction(configure); - configureAction->setIcon(KIcon("configure")); - configureAction->setIconText(configure); - - connect(configureAction, SIGNAL(triggered(bool)), this, - SLOT(showConfigurationDialog())); - - toolBar->addSeparator(); - - listProgress = new QListView(this); - listProgress->setAlternatingRowColors(true); - listProgress->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - listProgress->setUniformItemSizes(true); - listProgress->setSelectionMode(QAbstractItemView::NoSelection); - listProgress->setModel(model); - - setCentralWidget(listProgress); - - progressListDelegate = new ProgressListDelegate(this, listProgress); - progressListDelegate->setSeparatorPixels(5); - progressListDelegate->setLeftMargin(10); - progressListDelegate->setRightMargin(10); - progressListDelegate->setMinimumItemHeight(100); - progressListDelegate->setMinimumContentWidth(300); - progressListDelegate->setEditorHeight(20); - listProgress->setItemDelegate(progressListDelegate); - - - m_systemTray = new KSystemTrayIcon(this); - m_systemTray->setIcon(KSystemTrayIcon::loadIcon("view-process-system")); - m_systemTray->setToolTip(i18n("List of running file transfers/jobs (kuiserver)")); - m_systemTray->show(); - resize(450, 450); - applySettings(); -} - -UiServer::~UiServer() -{ -} - - -void UiServer::updateConfiguration() -{ - Configuration::self()->writeConfig(); - applySettings(); -} - -void UiServer::applySettings() -{ - /* not used. - int finishedIndex = tabWidget->indexOf(listFinished); - if (Configuration::radioMove()) { - if (finishedIndex == -1) { - tabWidget->addTab(listFinished, i18n("Finished")); - } - } else if (finishedIndex != -1) { - tabWidget->removeTab(finishedIndex); - } */ -} - -void UiServer::closeEvent(QCloseEvent *event) -{ - event->ignore(); - hide(); -} - -void UiServer::showConfigurationDialog() -{ - if (KConfigDialog::showDialog("configuration")) - return; - - KConfigDialog *dialog = new KConfigDialog(this, "configuration", - Configuration::self()); - - UIConfigurationDialog *configurationUI = new UIConfigurationDialog(0); - - dialog->addPage(configurationUI, i18n("Behavior"), "configure"); - - connect(dialog, SIGNAL(settingsChanged(const QString&)), this, - SLOT(updateConfiguration())); - dialog->button(KDialog::Help)->hide(); - dialog->show(); -} - -/// =========================================================== - - -UIConfigurationDialog::UIConfigurationDialog(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); - adjustSize(); -} - -UIConfigurationDialog::~UIConfigurationDialog() -{ -} - - -/// =========================================================== - - -#include "moc_uiserver.cpp" -#include "moc_uiserver_p.cpp" diff --git a/kuiserver/uiserver.h b/kuiserver/uiserver.h deleted file mode 100644 index 3f8b4272..00000000 --- a/kuiserver/uiserver.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the KDE project - * Copyright (C) 2009 Shaun Reich - * Copyright (C) 2006-2008 Rafael Fernández López - * Copyright (C) 2000 Matej Koss - * David Faure - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. -*/ - -#ifndef UISERVER_H -#define UISERVER_H - -#include - -#include - -#include "jobview.h" - - -#include - -class ProgressListModel; -class ProgressListDelegate; -#include -class KSystemTrayIcon; - -class UiServer : public KXmlGuiWindow -{ - Q_OBJECT - -public: - explicit UiServer(ProgressListModel* model); - ~UiServer(); - -public Q_SLOTS: - void updateConfiguration(); - void applySettings(); - -protected: - virtual void closeEvent(QCloseEvent *event); - -private Q_SLOTS: - void showConfigurationDialog(); - -private: - ProgressListDelegate *progressListDelegate; - QListView *listProgress; - - QToolBar *toolBar; - KSystemTrayIcon *m_systemTray; - -}; - -#endif // UISERVER_H diff --git a/kuiserver/uiserver_p.h b/kuiserver/uiserver_p.h deleted file mode 100644 index 120ff67f..00000000 --- a/kuiserver/uiserver_p.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the KDE project - * Copyright (C) 2007 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. -*/ - -#ifndef UISERVER_P_H -#define UISERVER_P_H - -#include - -#include "ui_configdialog.h" - -class UIConfigurationDialog - : public QWidget - , private Ui::configurationDialog -{ - Q_OBJECT - -public: - UIConfigurationDialog(QWidget *parent); - ~UIConfigurationDialog(); -}; - -#endif // UISERVER_P_H