Index: kstars/indi/guimanager.h =================================================================== --- kstars/indi/guimanager.h +++ kstars/indi/guimanager.h @@ -39,7 +39,7 @@ public: static GUIManager *Instance(); - void updateStatus(); + void updateStatus(bool toggle_behavior); INDI_D *findGUIDevice(const QString &deviceName); Index: kstars/indi/guimanager.cpp =================================================================== --- kstars/indi/guimanager.cpp +++ kstars/indi/guimanager.cpp @@ -131,7 +131,7 @@ ** Traverse the drivers list, check for updated drivers and take ** appropriate action *********************************************************************/ -void GUIManager::updateStatus() +void GUIManager::updateStatus(bool toggle_behavior) { QAction *showINDIPanel = KStars::Instance()->actionCollection()->action("show_control_panel"); @@ -151,9 +151,16 @@ showINDIPanel->setChecked(true); - raise(); - activateWindow(); - showNormal(); + if (isVisible() && isActiveWindow() && toggle_behavior) + { + hide(); + } + else + { + raise(); + activateWindow(); + showNormal(); + } } INDI_D *GUIManager::findGUIDevice(const QString &deviceName) @@ -290,5 +297,5 @@ guidevices.append(gdm); - updateStatus(); + updateStatus(false); } Index: kstars/kstarsactions.cpp =================================================================== --- kstars/kstarsactions.cpp +++ kstars/kstarsactions.cpp @@ -637,7 +637,7 @@ } } #endif - GUIManager::Instance()->updateStatus(); + GUIManager::Instance()->updateStatus(true); #endif } @@ -708,9 +708,16 @@ } #endif - ekosManager()->raise(); - ekosManager()->activateWindow(); - ekosManager()->showNormal(); + if (ekosManager()->isVisible() && ekosManager()->isActiveWindow()) + { + ekosManager()->hide(); + } + else + { + ekosManager()->raise(); + ekosManager()->activateWindow(); + ekosManager()->showNormal(); + } #endif #endif Index: kstars/kstarsinit.cpp =================================================================== --- kstars/kstarsinit.cpp +++ kstars/kstarsinit.cpp @@ -158,8 +158,7 @@ #endif actionCollection()->addAction("export_image", this, SLOT(slotExportImage())) << i18n("&Save Sky Image...") - << QIcon::fromTheme("document-export-image", QIcon(":/icons/breeze/default/document-export.svg")) - << QKeySequence(Qt::CTRL + Qt::Key_I); + << QIcon::fromTheme("document-export-image", QIcon(":/icons/breeze/default/document-export.svg")); actionCollection()->addAction("run_script", this, SLOT(slotRunScript())) << i18n("&Run Script...") << QIcon::fromTheme("system-run", QIcon(":/icons/breeze/default/system-run.svg")) << QKeySequence(Qt::CTRL + Qt::Key_R); @@ -393,7 +392,9 @@ actionCollection()->addAction("skycalendar", this, SLOT(slotCalendar())) << i18n("Sky Calendar"); #ifdef HAVE_INDI - actionCollection()->addAction("ekos", this, SLOT(slotEkos())) << i18n("Ekos") << QKeySequence(Qt::CTRL + Qt::Key_K); + ka = actionCollection()->addAction("ekos", this, SLOT(slotEkos())) << i18n("Ekos") << + QKeySequence(Qt::CTRL + Qt::Key_K); + ka->setShortcutContext(Qt::ApplicationShortcut); #endif //FIXME: implement glossary @@ -442,7 +443,10 @@ << i18n("Device Manager...") << QIcon::fromTheme("network-server", QIcon(":/icons/breeze/default/network-server.svg")) << QKeySequence(Qt::CTRL + Qt::Key_D); - ka = actionCollection()->addAction("indi_cpl", this, SLOT(slotINDIPanel())) << i18n("INDI Control Panel..."); + ka = actionCollection()->addAction("indi_cpl", this, SLOT(slotINDIPanel())) + << i18n("INDI Control Panel...") + << QKeySequence(Qt::CTRL + Qt::Key_I); + ka->setShortcutContext(Qt::ApplicationShortcut); ka->setEnabled(false); #else //FIXME need to disable/hide devices submenu in the tools menu. It is created from the kstarsui.rc file