[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: [PATCH] Show the job progress in separate dialog
From: Andras Mantia <amantia () kde ! org>
Date: 2008-11-27 20:17:47
Message-ID: 200811272217.47412.amantia () kde ! org
[Download RAW message or body]
Hi,
the attached patch introduces a config option to show the job progress
dialogs as separate dialogs. The reason is:
1) people are used to the old ones
2) the new ones, integrated into the systray notification have some
limitation compared to the old ones, like not being visible every time,
so you don't know if a job stuck, finished, whatever; the information
given is not that detailed; they disappear after the timeout, etc.
I know 2) can be improved over time, but the timeframe to 4.2 is short
and as no new strings can be introduced, I doubt it is possible now.
There is no GUI configuration, again because of the string freeze. The
option is global, I don't even know if it would be possible to have both
the separate and the integrated dialogs.
The patch doesn't react to config file changes, if requested, I can do
that part.
There is a question what should be the default. As it is now, I'd think
showing the separate dialogs should be the default because of 2) and
because some bugs. Anyway the patch tries to be not intrusive, so I made
to have the current behavior the default, so people can test in beta
stage and report bugs. :)
Andras
["separatejobs.diff" (text/x-patch)]
Index: core/manager.h
===================================================================
--- core/manager.h (revision 889798)
+++ core/manager.h (working copy)
@@ -62,6 +62,11 @@
**/
QList<Job*> jobs() const;
+ /**
+ * @return integrates the Job progress info into the applet's notification system
+ **/
+ void registerJobProtocol();
+
signals:
/**
* Emitted when a new task has been added
Index: core/manager.cpp
===================================================================
--- core/manager.cpp (revision 889798)
+++ core/manager.cpp (working copy)
@@ -55,23 +55,24 @@
{
public:
Private(Manager *manager)
- : q(manager)
+ : q(manager), jobProtocolRegistered(false)
{
registerTaskProtocol(new Plasmoid::TaskProtocol(q));
registerTaskProtocol(new FDO::TaskProtocol(q));
registerNotificationProtocol(new FDO::NotificationProtocol(q));
registerNotificationProtocol(new DBus::NotificationProtocol(q));
- registerJobProtocol(new DBus::JobProtocol(q));
}
void registerTaskProtocol(TaskProtocol *protocol);
void registerNotificationProtocol(NotificationProtocol *protocol);
+ void registerJobProtocol();
void registerJobProtocol(JobProtocol *protocol);
Manager *q;
QList<Task*> tasks;
QList<Notification*> notifications;
QList<Job*> jobs;
+ bool jobProtocolRegistered;
};
@@ -157,6 +158,19 @@
return d->notifications;
}
+void Manager::registerJobProtocol()
+{
+ d->registerJobProtocol();
+}
+
+void Manager::Private::registerJobProtocol()
+{
+ if (!jobProtocolRegistered) {
+ registerJobProtocol(new DBus::JobProtocol(q));
+ jobProtocolRegistered = true;
+ }
+}
+
void Manager::Private::registerJobProtocol(JobProtocol *protocol)
{
connect(protocol, SIGNAL(jobCreated(SystemTray::Job*)),
Index: ui/applet.cpp
===================================================================
--- ui/applet.cpp (revision 889798)
+++ ui/applet.cpp (working copy)
@@ -121,11 +121,17 @@
d->taskArea->syncTasks(Manager::self()->tasks());
extender()->setEmptyExtenderMessage(i18n("No notifications and no jobs"));
+
connect(SystemTray::Manager::self(), SIGNAL(notificationAdded(SystemTray::Notification*)),
this, SLOT(addNotification(SystemTray::Notification*)));
- connect(SystemTray::Manager::self(), SIGNAL(jobAdded(SystemTray::Job*)),
- this, SLOT(addJob(SystemTray::Job*)));
+ KConfigGroup globalCg = globalConfig();
+ bool separateJobDialogs = globalCg.readEntry("SeparateJobDialogs", false);
+ if (!separateJobDialogs) {
+ SystemTray::Manager::self()->registerJobProtocol();
+ connect(SystemTray::Manager::self(), SIGNAL(jobAdded(SystemTray::Job*)),
+ this, SLOT(addJob(SystemTray::Job*)));
+ }
}
@@ -321,6 +327,7 @@
KConfigGroup cg = config();
cg.writeEntry("hidden", hiddenTypes);
+
emit configNeedsSaving();
}
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic