SystemMonitor: Remember the correct size

BUG: 343595
wilder-5.14
Vishesh Handa 11 years ago
parent cde792bdb5
commit 6188a7ad05
  1. 14
      systemmonitor/ksystemactivitydialog.cpp
  2. 4
      systemmonitor/ksystemactivitydialog.h

@ -31,14 +31,14 @@
#include <QPushButton> #include <QPushButton>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QLineEdit> #include <QLineEdit>
#include <QTimer>
#include <KSharedConfig> #include <KSharedConfig>
#include <KConfigGroup> #include <KConfigGroup>
#include <KWindowConfig> #include <KWindowConfig>
#include <KWindowSystem> #include <KWindowSystem>
#include <KLocalizedString> #include <KLocalizedString>
#include <QDebug>
//#include "krunnersettings.h"
KSystemActivityDialog::KSystemActivityDialog(QWidget *parent) KSystemActivityDialog::KSystemActivityDialog(QWidget *parent)
: QDialog(parent), m_processList(0) : QDialog(parent), m_processList(0)
@ -59,7 +59,15 @@ KSystemActivityDialog::KSystemActivityDialog(QWidget *parent)
connect(closeWindow, &QAction::triggered, this, &KSystemActivityDialog::accept); connect(closeWindow, &QAction::triggered, this, &KSystemActivityDialog::accept);
addAction(closeWindow); addAction(closeWindow);
// We need the resizing to be done once the dialog has been initialized
// otherwise we don't actually have a window.
QTimer::singleShot(0, this, SLOT(slotInit()));
}
void KSystemActivityDialog::slotInit()
{
resize(QSize(650, 420)); resize(QSize(650, 420));
KConfigGroup cg = KSharedConfig::openConfig()->group("TaskDialog"); KConfigGroup cg = KSharedConfig::openConfig()->group("TaskDialog");
KWindowConfig::restoreWindowSize(windowHandle(), cg); KWindowConfig::restoreWindowSize(windowHandle(), cg);
@ -67,7 +75,7 @@ KSystemActivityDialog::KSystemActivityDialog(QWidget *parent)
// Since we default to forcing the window to be KeepAbove, if the user turns this off, remember this // Since we default to forcing the window to be KeepAbove, if the user turns this off, remember this
const bool keepAbove = true; // KRunnerSettings::keepTaskDialogAbove(); const bool keepAbove = true; // KRunnerSettings::keepTaskDialogAbove();
if (keepAbove) { if (keepAbove) {
KWindowSystem::setState(winId(), NET::KeepAbove ); KWindowSystem::setState(winId(), NET::KeepAbove);
} }
QDBusConnection con = QDBusConnection::sessionBus(); QDBusConnection con = QDBusConnection::sessionBus();

@ -32,6 +32,7 @@
*/ */
class KSystemActivityDialog : public QDialog class KSystemActivityDialog : public QDialog
{ {
Q_OBJECT
public: public:
KSystemActivityDialog(QWidget *parent = NULL); KSystemActivityDialog(QWidget *parent = NULL);
@ -53,6 +54,9 @@ class KSystemActivityDialog : public QDialog
/** Save the settings if the user clicks (x) button on the window */ /** Save the settings if the user clicks (x) button on the window */
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
private slots:
void slotInit();
private: private:
void saveDialogSettings(); void saveDialogSettings();

Loading…
Cancel
Save