void LightscreenWindow::executeArgument(const QString &message) { if (message == "--wake") { show(); os::setForegroundWindow(this); qApp->alert(this, 2000); } else if (message == "--screen") { screenshotAction(Screenshot::WholeScreen); } else if (message == "--area") { screenshotAction(Screenshot::SelectedArea); } else if (message == "--activewindow") { screenshotAction(Screenshot::ActiveWindow); } else if (message == "--pickwindow") { screenshotAction(Screenshot::SelectedWindow); } else if (message == "--folder") { action(OpenScreenshotFolder); } else if (message == "--uploadlast") { uploadLast(); } else if (message == "--viewhistory") { showHistoryDialog(); } else if (message == "--options") { showOptions(); } else if (message == "--quit") { qApp->quit(); } }
SoundCloudSearchDialog::SoundCloudSearchDialog(QWidget *parent) : Dialog(parent), m_typeModel(new SoundCloudSearchTypeModel(this)), m_typeSelector(new ValueSelector(tr("Search for"), this)), m_searchEdit(new QLineEdit(this)), m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Vertical, this)), m_historyButton(new QPushButton(tr("History"), this)), m_searchButton(new QPushButton(tr("Done"), this)), m_layout(new QGridLayout(this)) { setWindowTitle(tr("Search")); m_typeSelector->setModel(m_typeModel); m_typeSelector->setCurrentIndex(qMax(0, m_typeModel->match("name", Settings::defaultSearchType(Resources::SOUNDCLOUD)))); m_searchEdit->setPlaceholderText(tr("Search")); m_searchEdit->setFocus(Qt::OtherFocusReason); m_searchButton->setDefault(true); m_searchButton->setEnabled(false); m_buttonBox->addButton(m_historyButton, QDialogButtonBox::ActionRole); m_buttonBox->addButton(m_searchButton, QDialogButtonBox::ActionRole); m_layout->addWidget(m_searchEdit, 0, 0); m_layout->addWidget(m_typeSelector, 1, 0); m_layout->addWidget(m_buttonBox, 0, 1, 2, 1, Qt::AlignBottom); connect(m_searchEdit, SIGNAL(textChanged(QString)), this, SLOT(onQueryChanged(QString))); connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(m_historyButton, SIGNAL(clicked()), this, SLOT(showHistoryDialog())); connect(m_searchButton, SIGNAL(clicked()), this, SLOT(accept())); }
PluginSearchDialog::PluginSearchDialog(const QString &service, QWidget *parent) : Dialog(parent), m_typeModel(new PluginSearchTypeModel(this)), m_typeSelector(new ValueSelector(tr("Search for"), this)), m_searchEdit(new QLineEdit(this)), m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Vertical, this)), m_historyButton(new QPushButton(tr("History"), this)), m_searchButton(new QPushButton(tr("Done"), this)), m_layout(new QGridLayout(this)) { setWindowTitle(tr("Search")); m_typeModel->setService(service); m_typeSelector->setModel(m_typeModel); m_typeSelector->setCurrentIndex(qMax(0, m_typeModel->match("name", Settings::instance()->defaultSearchType(service)))); m_searchEdit->setPlaceholderText(tr("Search")); m_searchButton->setDefault(true); m_searchButton->setEnabled(false); m_buttonBox->addButton(m_historyButton, QDialogButtonBox::ActionRole); m_buttonBox->addButton(m_searchButton, QDialogButtonBox::ActionRole); m_layout->addWidget(m_searchEdit, 0, 0); m_layout->addWidget(m_typeSelector, 1, 0); m_layout->addWidget(m_buttonBox, 0, 1, 2, 1, Qt::AlignBottom); connect(m_typeSelector, SIGNAL(valueChanged(QVariant)), this, SLOT(onSearchTypeChanged())); connect(m_searchEdit, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString))); connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(m_historyButton, SIGNAL(clicked()), this, SLOT(showHistoryDialog())); connect(m_searchButton, SIGNAL(clicked()), this, SLOT(search())); }
void HistoryMenu::postPopulated() { if (m_history->history().count() > 0) addSeparator(); QAction *showAllAction = new QAction(tr("Show All History"), this); connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); addAction(showAllAction); QAction *clearAction = new QAction(tr("Clear History"), this); connect(clearAction, SIGNAL(triggered()), m_history, SLOT(clear())); addAction(clearAction); }
void HistoryMenu::postPopulated() { if (m_history->history().count() > 0) addSeparator(); QAction *showAllAction = new QAction(tr("Show All History"), this); #if !defined(Q_WS_MAC) showAllAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_H)); #endif connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); addAction(showAllAction); QAction *clearAction = new QAction(tr("Clear History..."), this); connect(clearAction, SIGNAL(triggered()), this, SLOT(clearHistoryDialog())); addAction(clearAction); }