Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:epopov:branches:openSUSE:Factory
ksysguard5
2002-main-window.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2002-main-window.patch of Package ksysguard5
diff --git a/gui/ksysguard.cpp b/gui/ksysguard.cpp index 9bab616811eed81128509067e76748c202c019f6..81509ba0989a5a77ba0a2a82f4e5a462d41d7a6c 100644 --- a/gui/ksysguard.cpp +++ b/gui/ksysguard.cpp @@ -136,7 +136,12 @@ TopLevel::TopLevel() mHotNewWorksheetUploadAction->setIcon( QIcon::fromTheme(QStringLiteral("network-server")) ); connect(mHotNewWorksheetUploadAction, &QAction::triggered, mWorkSpace, &Workspace::uploadHotNewWorksheet); - mQuitAction = nullptr; + KStandardAction::quit(this, &TopLevel::close, actionCollection()); + + QAction *closeAction = new QAction; + closeAction->setShortcuts({ QKeySequence::Cancel, QKeySequence::Close }); + connect(closeAction, &QAction::triggered, this, &TopLevel::close); + addAction(closeAction); mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") ); mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) ); @@ -182,16 +187,7 @@ void TopLevel::retranslateUi() mMonitorRemoteAction->setText( i18n( "Monitor &Remote Machine..." ) ); mHotNewWorksheetAction->setText( i18n( "&Download New Tabs..." ) ); mHotNewWorksheetUploadAction->setText( i18n( "&Upload Current Tab..." ) ); - mConfigureSheetAction->setText( i18n( "Tab &Properties" ) ); - if(mQuitAction) { - QAction *tmpQuitAction = KStandardAction::quit( nullptr, nullptr, nullptr ); - mQuitAction->setText(tmpQuitAction->text()); - mQuitAction->setWhatsThis(tmpQuitAction->whatsThis()); - mQuitAction->setToolTip(tmpQuitAction->toolTip()); - delete tmpQuitAction; - } else - mQuitAction = KStandardAction::quit( this, SLOT(close()), actionCollection() ); } void TopLevel::configureCurrentSheet() { @@ -601,6 +597,18 @@ int main( int argc, char** argv ) parser.process(app); aboutData.processCommandLine(&parser); + const KDBusService dbusService(KDBusService::Unique | KDBusService::NoExitOnFailure); + QObject::connect(&dbusService, &KDBusService::activateRequested, &app, []() { + const QWindowList windows = qApp->topLevelWindows(); + if (!windows.isEmpty()) { + QWindow *firstWindow = windows.first(); + KWindowSystem::updateStartupId(firstWindow); + KWindowSystem::activateWindow(firstWindow); + } + }); + if (!dbusService.isRegistered()) + return 0; + KSGRD::SensorMgr = new KSGRD::SensorManager(); KSGRD::Style = new KSGRD::StyleEngine(); @@ -626,9 +634,6 @@ int main( int argc, char** argv ) Toplevel->show(); KSGRD::SensorMgr->setBroadcaster( Toplevel ); // SensorMgr uses a QPointer for toplevel, so it is okay if Toplevel is deleted first - // register to DBus - const KDBusService dbusService(KDBusService::Multiple); - // run the application int result = app.exec(); diff --git a/gui/ksysguard.h b/gui/ksysguard.h index 67b6510d36c7ff2d72386e33146d0b47f50933c0..e7ecf4a6bd6ab35fa59bc10064ccb3ffbe241ad6 100644 --- a/gui/ksysguard.h +++ b/gui/ksysguard.h @@ -100,7 +100,6 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient QAction *mTabRemoveAction; QAction *mMonitorRemoteAction; QAction *mHotNewWorksheetAction; - QAction *mQuitAction; QAction *mConfigureSheetAction; QAction *mHotNewWorksheetUploadAction; QAction *mRefreshTabAction;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor