void ShutDownFrame::inhibitShutdown() { m_login1Inter = new DBusLogin1Manager("org.freedesktop.login1", "/org/freedesktop/login1", QDBusConnection::systemBus(), this); QString reminder_tooltip = QString(); if (m_login1Inter->isValid()) { qDebug() << "m_login1Inter is valid!"; QDBusPendingReply<InhibitorsList> reply = m_login1Inter->ListInhibitors(); reply.waitForFinished(); if (!reply.isError()){ InhibitorsList inhibitList = qdbus_cast<InhibitorsList>(reply.argumentAt(0)); qDebug() << "inhibitList:" << inhibitList.count(); for(int i = 0; i < inhibitList.count();i++) { if (inhibitList.at(i).what == "shutdown" && inhibitList.at(i).dosome == "block") { reminder_tooltip = inhibitList.at(i).why; } } qDebug() << "shutdown Reason!" << reminder_tooltip; showTips(reminder_tooltip); } else { reminder_tooltip = ""; qDebug() << reply.error().message(); } } else { qDebug() << "shutdown login1Manager error!"; reminder_tooltip = ""; } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ontology_viewer.show(); label_viewer.show(); tracker_output_viewer.show(); // Action menu for opening the files connect(this->ui->actionOpen_ontology, SIGNAL(triggered()), this, SLOT(openOntology())); connect(this->ui->actionOpen_dialogs, SIGNAL(triggered()), this, SLOT(openDialogs())); connect(this->ui->actionOpen_tracker_output, SIGNAL(triggered()), this, SLOT(openTrackerOutput())); // Leave on quit connect(this->ui->actionQuit, SIGNAL(triggered()), this, SLOT(close())); // Show an help message when requested connect(this->ui->actionManual, SIGNAL(triggered()), this, SLOT(showTips())); // Detecting that a new dialog is selected connect(this->ui->dialog_combBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeDialog(QString))); // Browsing the dialogs connect(this->ui->dialog_prevButton, SIGNAL(clicked()), this, SLOT(prev_dialog())); connect(this->ui->dialog_nextButton, SIGNAL(clicked()), this, SLOT(next_dialog())); // Using the possibility to filter the dialogs by a prefix connect(this->ui->dialog_prefix_lineedit, SIGNAL(textChanged(QString)), this, SLOT(dialog_prefix_textChanged(QString))); // Getting the info the tracker output wants to be sync to the mainwindow session id connect(&tracker_output_viewer, SIGNAL(sig_sync_to_dialog(bool)), this, SLOT(sync_tracker_output_to_session(bool))); }
void doChoose(ClientEnv* env) { int chose; chose = showTips(); parseInput(env, chose); }
void TipDlg::showTipsSLOT( bool on ) { emit showTips( !on ); }
MainWindow::MainWindow(QAction* actionQuit, QAction* actionNewTab, QAction* actionFullscreen, QAction* actionLoadSession, QAction* actionSaveSession, QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow), fetcher(new Fetcher), local(new LocalFetcher), source(IMAGE_SOURCE_UNKNOWN) { ui->setupUi(this); QStringList sources; sources.append("Google"); sources.append("Local file"); // sources.append("Picsearch"); ui->cbSource->addItems(sources); ui->cbSource->setCurrentIndex(IMAGE_SOURCE_GOOGLE); fetcher->hide(); local->hide(); ui->menuFile->addAction(actionNewTab); ui->menuFile->addAction(actionLoadSession); ui->menuFile->addAction(actionSaveSession); ui->menuFile->addAction(actionQuit); ui->menuView->insertAction(ui->actionResetTransforms,actionFullscreen); ui->tbFullScreen->setDefaultAction(actionFullscreen); ui->tbNewTab->setDefaultAction(actionNewTab); ui->tbResetTransform->setDefaultAction(ui->actionResetTransforms); ui->tbSave->setDefaultAction(actionSaveSession); ui->glTools->addWidget(fetcher,0,6,2,1); ui->glTools->addWidget(local,0,6,2,1); updateSource(); connect(ui->cbSource,SIGNAL(currentIndexChanged(int)),this,SLOT(updateSource())); ui->actionViewOnlyMode->setShortcut(Qt::Key_Tab); QList<QKeySequence> keys; keys << Qt::Key_Delete << Qt::Key_Backspace; ui->actionDeleteSelected->setShortcuts(keys); // These are necessary if the actions are to remain accessible when the menubar is hidden: this->addAction(ui->actionViewOnlyMode); this->addAction(ui->actionResetTransforms); this->addAction(ui->actionZoomToFit); this->addAction(ui->actionIntroduction); this->addAction(ui->actionTips); this->addAction(ui->actionOpenDirectory); this->addAction(ui->actionOpenFile); this->addAction(ui->actionDeleteSelected); this->addAction(ui->actionUncropSelected); this->addAction(ui->actionCentreInView); this->addAction(ui->actionResetRotation); this->addAction(ui->actionResetScale); this->addAction(ui->actionScaleToFit); this->addAction(actionFullscreen); this->addAction(actionLoadSession); this->addAction(actionSaveSession); this->addAction(actionNewTab); this->addAction(actionQuit); connect(ui->actionIntroduction,SIGNAL(triggered()),this,SLOT(showHelp())); connect(ui->actionTips,SIGNAL(triggered()),this,SLOT(showTips())); connect(ui->actionViewOnlyMode,SIGNAL(triggered(bool)),this,SLOT(enterViewOnlyMode(bool))); connect(ui->actionPreferences,SIGNAL(triggered()),this,SLOT(showPreferences())); connect(fetcher,SIGNAL(queryChanged(QString)),this,SIGNAL(queryChanged(QString))); connect(fetcher,SIGNAL(imageResult(QUrl,QUrl,bool)),this,SLOT(processImageResult(QUrl,QUrl,bool))); connect(local,SIGNAL(imageResult(QUrl,QUrl,bool)),this,SLOT(processImageResult(QUrl,QUrl,bool))); connect(local,SIGNAL(queryChanged(QString)),this,SIGNAL(queryChanged(QString))); initBlacklistDocker(); initInfoDocker(); initView(parent); dlDir = QString(DEFAULT_DOWNLOAD_DIRECTORY); dlMgr = new QNetworkAccessManager(this); connect(ui->actionResetTransforms,SIGNAL(triggered()),gvMain,SLOT(resetTransforms())); connect(ui->actionZoomToFit,SIGNAL(triggered()),gvMain,SLOT(zoomToFit())); connect(ui->actionOpenDirectory,SIGNAL(triggered()),local,SLOT(selectDirectory())); connect(ui->actionOpenFile,SIGNAL(triggered()),local,SLOT(selectFile())); connect(ui->actionDeleteSelected,SIGNAL(triggered()),gsMain,SLOT(deleteSelected())); connect(ui->actionUncropSelected,SIGNAL(triggered()),gsMain,SLOT(uncropSelected())); connect(ui->actionCentreInView,SIGNAL(triggered()),gsMain,SLOT(centreSelection())); connect(ui->actionResetRotation,SIGNAL(triggered()),gsMain,SLOT(resetSelectionRotation())); connect(ui->actionResetScale,SIGNAL(triggered()),gsMain,SLOT(resetSelectionScale())); connect(ui->actionScaleToFit,SIGNAL(triggered()),this,SLOT(scaleSelectedToFit())); ui->verticalLayout->removeWidget(ui->toolWidget); ui->toolBar->addWidget(ui->toolWidget); setCentralWidget(gvMain); ui->thumbBar->addWidget(gvCarousel); ui->statusBar->addWidget(fetcher->getStatusText(),0); ui->statusBar->addWidget(fetcher->getProgressBar(),1); connect(this,SIGNAL(settingsChanged()),this,SLOT(loadSettings())); loadSettings(); }