void SystemTrayIcon::createSystrayActions()
{
    openDashboardAct = new QAction("Open Online Dashboard", this);
    connect(openDashboardAct, SIGNAL(triggered()), this, SLOT(openDashboard()));
    cptFullScreenAct = new QAction("Capture Full Screen", this);
    cptFullScreenAct->setShortcut(keySqFullScreen);
    connect(cptFullScreenAct, SIGNAL(triggered()), this, SLOT(captureFullScreen()));
    cptSelectionAct = new QAction("Capture Selection", this);
    cptSelectionAct->setShortcut(keySqSelection);
    connect(cptSelectionAct, SIGNAL(triggered()), this, SLOT(captureSelection()));
    cptWindowAct = new QAction("Capture Window", this);
    cptWindowAct->setShortcut(keySqWindow);
    connect(cptWindowAct, SIGNAL(triggered()), this, SLOT(captureWindow()));
    preferencesAct = new QAction("Preferences...", this);
    connect(preferencesAct, SIGNAL(triggered()), this, SLOT(openPreferencesWindow()));
    quitAct = new QAction("Quit", this);
    connect(quitAct, SIGNAL(triggered()), this, SLOT(quitApplication()));
    //Sub menu
    askMeAct = new QAction("Ask me..", this);
    askMeAct->setCheckable(true);
    connect(askMeAct, SIGNAL(triggered(bool)), this, SLOT(uploaderMenuItemChecked(bool)));
    submenuActions.insert("askme", askMeAct);
    if(activeUploaderIndex <= -1)
    {
        askMeAct->setChecked(true);
    }
}
Exemplo n.º 2
0
void RunnerView::readSocket()
{
//    qDebug() << "RunnerView::readSocket - bytes available:" << m_socket->bytesAvailable();
    Message* m(Message::read(m_socket));
    if (m) {
        switch (m->type()) {
            case MessageType::Undefined : qWarning("RunnerView::readSocket - message type: Undefined"); break;
            case MessageType::CloneRequest : {
                handleCloneRequest();
                break;
            }
            case MessageType::CloneData : {
                CloneDataMessage* cdm(dynamic_cast<CloneDataMessage*>(m));
                handleCloneData(cdm);
                break;
            }
            case MessageType::Mouse : {
                MouseMessage* mm(dynamic_cast<MouseMessage*>(m));
                handleMouse(mm);
                break;
            }
            case MessageType::Close : quitApplication(); break;
            default : {
                qDebug() << "RunnerView::readSocket - message:" << *m;
                break;
            }
        }
        delete m;
    }
    if (m_socket->bytesAvailable()) {
        QMetaObject::invokeMethod(this, "readSocket", Qt::QueuedConnection);
    }
}
Exemplo n.º 3
0
void    QNetsoul::connectQNetsoulModules(void)
{
  connect(this->_ping, SIGNAL(timeout()), this, SLOT(ping()));
  connect(this->_internUpdater, SIGNAL(quitApplication()),
          this, SLOT(saveStateBeforeQuiting()));
  connect(this->_portraitResolver,
          SIGNAL(downloadedPortrait(const QString&)),
          SLOT(setPortrait(const QString&)));
  connect(this->tree, SIGNAL(openConversation(const QStringList&)),
          this, SLOT(showConversation(const QStringList&)));
  connect(this->tree, SIGNAL(downloadPortrait(const QString&, bool)),
          this->_portraitResolver, SLOT(addRequest(const QString&, bool)));
  connect(this->tree, SIGNAL(contactRemoved(const QString&)),
          SLOT(disableChats(const QString&)));
}
Exemplo n.º 4
0
int MoodBox::AppEventHandler::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: reopenApplication(); break;
        case 1: quitApplication(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
Exemplo n.º 5
0
RunnerView::RunnerView(QString appUid, QString server, QWidget* parent) :
    QQuickWidget(parent),
    m_appUid(appUid),
    m_socket(new QLocalSocket(this)),
    m_shared(new QSharedMemory(appUid, this))
{
    qDebug() << "RunnerView::RunnerView";
    connect(engine(), SIGNAL(quit()), this, SLOT(quitApplication()));
    connect(m_socket, SIGNAL(connected()), this, SLOT(socketConnected()));
    connect(m_socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
    connect(m_socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(socketError(QLocalSocket::LocalSocketError)));
    connect(m_socket, SIGNAL(bytesWritten(qint64)), this, SLOT(socketBytesWritten(qint64)));
    connect(m_socket, SIGNAL(readyRead()), this, SLOT(readSocket()));
    m_socket->connectToServer(server);
    qDebug() << "RunnerView::RunnerView - END";
}
Exemplo n.º 6
0
void MainWindow::startAutoMonitor()
{
	m_mountInfo = new monitor_mountinfo( this ) ;
	m_events = new events( this ) ;

	/*
	 * perform an ordely shut down when the application terminates to prevent an occassional crash with
	 * a warning that says something like "an object was destroyed while a thread is still running"
	 *
	 * On quiting,we first shut down auto_mount object and then monitor_mountinfo object and then we
	 * close the application
	 */
	connect( m_mountInfo,SIGNAL( stopped() ),this,SLOT( quitApplication() ) ) ;
	connect( m_events,SIGNAL( stopped() ),m_mountInfo,SLOT( stop() ) ) ;

	m_mountInfo->start() ;
	m_events->start() ;
}
Exemplo n.º 7
0
void ScreenShoter::createConnects()
{
    //主窗口信号槽*****************************************************************

    connect(ui->pbtnShot, SIGNAL(clicked()), this, SLOT(grapWindowScreen()));
    connect(ui->pbtnShotAndMin, SIGNAL(clicked()), this, SLOT(miniWindows()));
    connect(ui->pbtnMin, SIGNAL(clicked()), this, SLOT(miniWindows()));

    connect(savePixmap, SIGNAL(triggered()), this, SLOT(saveShotPixmap()));

    //主窗口信号槽*****************************************************************

    //托盘信号槽*******************************************************************

    connect(restore, SIGNAL(triggered()), this, SLOT(restoreWindows()));
    connect(mini, SIGNAL(triggered()), this, SLOT(miniWindows()));
    connect(quit, SIGNAL(triggered()), this, SLOT(quitApplication()));

    //托盘信号槽*******************************************************************
}
Exemplo n.º 8
0
/* saves the text in the conversation window */
void fileMenuCall(Widget w, XtPointer clientData, XtPointer callData)
{
    int itemNum;

    itemNum = (int) clientData;
    switch (itemNum)
    {
    case 0:
	setPreferences(mainWindow);
	break;
    case 1:
	saveFile(mainWindow);
	break;
    case 2:
        quitApplication();
	break;
    default:
    	break;
    }
}
Exemplo n.º 9
0
/** Initialize Actions */
void Kiptables::initActions(){
	KStdAction::quit(this,SLOT(quitApplication()),actionCollection());
	settings=new KAction(i18n("&Settings"),CTRL+Key_S,this,SLOT(slotSettings()),actionCollection(),"conf_settings");
	actionHost=new KAction(i18n("Add &Host"),0L,this,SLOT(slotFWAddHost()),actionCollection(),"fw_add_host");
	actionHost->setEnabled(false);
	actionHostModify=new KAction(i18n("Modify H&ost"),0L,this,SLOT(slotFWModifyHost()),actionCollection(),"fw_modify_host");
	actionHostModify->setEnabled(false);
	actionHostDelete=new KAction(i18n("Delete Ho&st"),0L,this,SLOT(slotFWDeleteHost()),actionCollection(),"fw_delete_host");
	actionHostDelete->setEnabled(false);
	actionNetwork=new KAction(i18n("Add &Network"),0L,this,SLOT(slotFWAddNetwork()),actionCollection(),"fw_add_network");
	actionNetwork->setEnabled(false);
	actionNetworkModify=new KAction(i18n("Modify N&etwork"),0L,this,SLOT(slotFWModifyNetwork()),actionCollection(),"fw_modify_network");
	actionNetworkDelete=new KAction(i18n("Delete Ne&twork"),0L,this,SLOT(slotFWDeleteNetwork()),actionCollection(),"fw_delete_network");
	actionNetworkModify->setEnabled(false);
	actionNetworkDelete->setEnabled(false);
	actionTCP=new KAction(i18n("Add &TCP-Port"),0L,this,SLOT(slotFWAddTCPPort()),actionCollection(),"fw_add_tcp_port");
	actionTCP->setEnabled(false);
	actionUDP=new KAction(i18n("Add &UDP-Port"),0L,this,SLOT(slotFWAddUDPPort()),actionCollection(),"fw_add_udp_port");
	actionUDP->setEnabled(false);	
}
Exemplo n.º 10
0
InternUpdater::InternUpdater(QWidget* parent)
  : QObject(parent), _running(false), _checkVersionTimer(NULL),
    _trayIcon(NULL), _server(NULL), _sevenZipReply(NULL),
    _checkVersionReply(NULL), _netManager(NULL)
{
  setupNetworkAccessManager();
  download7zipIfNeeded();
  replaceUpdaterBinaryIfNeeded();
  this->_server = new QLocalServer(this);
  connect(this->_server, SIGNAL(newConnection()), SIGNAL(quitApplication()));
  if (!this->_server->listen("QNetSoul"))
    {
      if (QLocalServer::removeServer("QNetSoul"))
        {
#ifndef QT_NO_DEBUG
          qDebug() << "[InternUpdater::InternUpdater]"
                   << "QLocalServer removed and listened again.";
#endif
          this->_running = this->_server->listen("QNetSoul");
        }
    }
  else this->_running = true;
  // Periodic version checking
  if (this->_running == true)
    {
      this->_checkVersionTimer = new QTimer(this);
      connect(this->_checkVersionTimer, SIGNAL(timeout()),
              this, SLOT(checkLastVersion()));
      this->_checkVersionTimer->start(OneHour);
    }
#ifndef QT_NO_DEBUG
  qDebug() << "[InternUpdater::InternUpdater]"
           << (this->_running?
               "QLocalServer is running." : "QLocalServer is not running.");
#endif
}
void MainForm::quitTheApplication(){
    //will be connected to the QApplicaiton and will quit when emitting this
    emit quitApplication();
}
Exemplo n.º 12
0
void ApplicationController::handleAuthenticationSuccess()
{
    MainWindowView *applicationWindow = new MainWindowView();
    connect(applicationWindow, SIGNAL(quitApplication()), this, SLOT(quitApplication()));
    applicationWindow->show();
}
Exemplo n.º 13
0
void MainMenu::init()
{
#define ADD_ACTION(name, menu, icon, trName, slot, shortcut) \
    action = menu->addAction(icon, trName); \
    action->setShortcut(QKeySequence(QSL(shortcut))); \
    connect(action, SIGNAL(triggered()), this, slot); \
    m_actions[QSL(name)] = action

#define ADD_CHECKABLE_ACTION(name, menu, icon, trName, slot, shortcut) \
    action = menu->addAction(icon, trName); \
    action->setShortcut(QKeySequence(QSL(shortcut))); \
    action->setCheckable(true); \
    connect(action, SIGNAL(triggered(bool)), this, slot); \
    m_actions[QSL(name)] = action

    // Standard actions - needed on Mac to be placed correctly in "application" menu
    QAction* action = new QAction(QIcon::fromTheme(QSL("help-about")), tr("&About QupZilla"), this);
    action->setMenuRole(QAction::AboutRole);
    connect(action, SIGNAL(triggered()), this, SLOT(showAboutDialog()));
    m_actions[QSL("Standard/About")] = action;

    action = new QAction(IconProvider::settingsIcon(), tr("Pr&eferences"), this);
    action->setMenuRole(QAction::PreferencesRole);
    action->setShortcut(QKeySequence(QKeySequence::Preferences));
    connect(action, SIGNAL(triggered()), this, SLOT(showPreferences()));
    m_actions[QSL("Standard/Preferences")] = action;

    action = new QAction(QIcon::fromTheme(QSL("application-exit")), tr("Quit"), this);
    action->setMenuRole(QAction::QuitRole);
    // shortcut set from browserwindow
    connect(action, SIGNAL(triggered()), this, SLOT(quitApplication()));
    m_actions[QSL("Standard/Quit")] = action;

    // File menu
    m_menuFile = new QMenu(tr("&File"));
    connect(m_menuFile, SIGNAL(aboutToShow()), this, SLOT(aboutToShowFileMenu()));
    connect(m_menuFile, SIGNAL(aboutToHide()), this, SLOT(aboutToHideFileMenu()));

    ADD_ACTION("File/NewTab", m_menuFile, IconProvider::newTabIcon(), tr("New Tab"), SLOT(newTab()), "Ctrl+T");
    ADD_ACTION("File/NewWindow", m_menuFile, IconProvider::newWindowIcon(), tr("&New Window"), SLOT(newWindow()), "Ctrl+N");
    ADD_ACTION("File/NewPrivateWindow", m_menuFile, IconProvider::privateBrowsingIcon(), tr("New &Private Window"), SLOT(newPrivateWindow()), "Ctrl+Shift+P");
    ADD_ACTION("File/OpenLocation", m_menuFile, QIcon::fromTheme(QSL("document-open-remote")), tr("Open Location"), SLOT(openLocation()), "Ctrl+L");
    ADD_ACTION("File/OpenFile", m_menuFile, QIcon::fromTheme(QSL("document-open")), tr("Open &File..."), SLOT(openFile()), "Ctrl+O");
    ADD_ACTION("File/CloseWindow", m_menuFile, QIcon::fromTheme(QSL("window-close")), tr("Close Window"), SLOT(closeWindow()), "Ctrl+Shift+W");
    m_menuFile->addSeparator();
    ADD_ACTION("File/SavePageAs", m_menuFile, QIcon::fromTheme(QSL("document-save")), tr("&Save Page As..."), SLOT(savePageAs()), "Ctrl+S");
    ADD_ACTION("File/SavePageScreen", m_menuFile, QIcon::fromTheme(QSL("image-loading")), tr("Save Page Screen"), SLOT(savePageScreen()), "Ctrl+Shift+S");
    ADD_ACTION("File/SendLink", m_menuFile, QIcon::fromTheme(QSL("mail-message-new")), tr("Send Link..."), SLOT(sendLink()), "");
    ADD_ACTION("File/Print", m_menuFile, QIcon::fromTheme(QSL("document-print")), tr("&Print..."), SLOT(printPage()), "Ctrl+P");
    m_menuFile->addSeparator();
    ADD_CHECKABLE_ACTION("File/WorkOffline", m_menuFile, QIcon(), tr("Work &Offline"), SLOT(toggleOfflineMode()), "");
    m_menuFile->addSeparator();
    m_menuFile->addAction(m_actions[QSL("Standard/Quit")]);

    // Edit menu
    m_menuEdit = new QMenu(tr("&Edit"));
    connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
    connect(m_menuEdit, SIGNAL(aboutToHide()), this, SLOT(aboutToHideEditMenu()));

    ADD_ACTION("Edit/Undo", m_menuEdit, QIcon::fromTheme(QSL("edit-undo")), tr("&Undo"), SLOT(editUndo()), "Ctrl+Z");
    ADD_ACTION("Edit/Redo", m_menuEdit, QIcon::fromTheme(QSL("edit-redo")), tr("&Redo"), SLOT(editRedo()), "Ctrl+Shift+Z");
    m_menuEdit->addSeparator();
    ADD_ACTION("Edit/Cut", m_menuEdit, QIcon::fromTheme(QSL("edit-cut")), tr("&Cut"), SLOT(editCut()), "Ctrl+X");
    ADD_ACTION("Edit/Copy", m_menuEdit, QIcon::fromTheme(QSL("edit-copy")), tr("C&opy"), SLOT(editCopy()), "Ctrl+C");
    ADD_ACTION("Edit/Paste", m_menuEdit, QIcon::fromTheme(QSL("edit-paste")), tr("&Paste"), SLOT(editPaste()), "Ctrl+V");
    m_menuEdit->addSeparator();
    ADD_ACTION("Edit/SelectAll", m_menuEdit, QIcon::fromTheme(QSL("edit-select-all")), tr("Select &All"), SLOT(editSelectAll()), "Ctrl+A");
    ADD_ACTION("Edit/Find", m_menuEdit, QIcon::fromTheme(QSL("edit-find")), tr("&Find"), SLOT(editFind()), "Ctrl+F");
    m_menuEdit->addSeparator();

    // View menu
    m_menuView = new QMenu(tr("&View"));
    connect(m_menuView, SIGNAL(aboutToShow()), this, SLOT(aboutToShowViewMenu()));
    connect(m_menuView, SIGNAL(aboutToHide()), this, SLOT(aboutToHideViewMenu()));

    QMenu* toolbarsMenu = new QMenu(tr("Toolbars"));
    connect(toolbarsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolbarsMenu()));
    QMenu* sidebarMenu = new QMenu(tr("Sidebar"));
    connect(sidebarMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowSidebarsMenu()));
    QMenu* encodingMenu = new QMenu(tr("Character &Encoding"));
    connect(encodingMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu()));

    // Create menus to make shortcuts available even before first showing the menu
    m_window->createToolbarsMenu(toolbarsMenu);
    m_window->createSidebarsMenu(sidebarMenu);

    m_menuView->addMenu(toolbarsMenu);
    m_menuView->addMenu(sidebarMenu);
    ADD_CHECKABLE_ACTION("View/ShowStatusBar", m_menuView, QIcon(), tr("Sta&tus Bar"), SLOT(showStatusBar()), "");
    m_menuView->addSeparator();
    ADD_ACTION("View/Stop", m_menuView, QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), SLOT(stop()), "Esc");
    ADD_ACTION("View/Reload", m_menuView, QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), SLOT(reload()), "F5");
    m_menuView->addSeparator();
    ADD_ACTION("View/ZoomIn", m_menuView, QIcon::fromTheme(QSL("zoom-in")), tr("Zoom &In"), SLOT(zoomIn()), "Ctrl++");
    ADD_ACTION("View/ZoomOut", m_menuView, QIcon::fromTheme(QSL("zoom-out")), tr("Zoom &Out"), SLOT(zoomOut()), "Ctrl+-");
    ADD_ACTION("View/ZoomReset", m_menuView, QIcon::fromTheme(QSL("zoom-original")), tr("Reset"), SLOT(zoomReset()), "Ctrl+0");
    m_menuView->addSeparator();
    ADD_CHECKABLE_ACTION("View/CaretBrowsing", m_menuView, QIcon(), tr("&Caret Browsing"), SLOT(toggleCaretBrowsing()), "F7");
    m_menuView->addMenu(encodingMenu);
    m_menuView->addSeparator();
    ADD_ACTION("View/PageSource", m_menuView, QIcon::fromTheme(QSL("text-html")), tr("&Page Source"), SLOT(showPageSource()), "Ctrl+U");
    ADD_CHECKABLE_ACTION("View/FullScreen", m_menuView, QIcon(), tr("&FullScreen"), SLOT(showFullScreen()), "F11");

    // Tools menu
    m_menuTools = new QMenu(tr("&Tools"));
    connect(m_menuTools, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolsMenu()));
    connect(m_menuTools, SIGNAL(aboutToHide()), this, SLOT(aboutToHideToolsMenu()));

    ADD_ACTION("Tools/WebSearch", m_menuTools, QIcon(), tr("&Web Search"), SLOT(webSearch()), "Ctrl+K");
    ADD_ACTION("Tools/SiteInfo", m_menuTools, QIcon::fromTheme(QSL("dialog-information")), tr("Site &Info"), SLOT(showSiteInfo()), "Ctrl+I");
    m_menuTools->addSeparator();
    ADD_ACTION("Tools/DownloadManager", m_menuTools, QIcon(), tr("&Download Manager"), SLOT(showDownloadManager()), "Ctrl+Y");
    ADD_ACTION("Tools/CookiesManager", m_menuTools, QIcon(), tr("&Cookies Manager"), SLOT(showCookieManager()), "");
    ADD_ACTION("Tools/AdBlock", m_menuTools, QIcon(), tr("&AdBlock"), SLOT(showAdBlockDialog()), "");
    ADD_ACTION("Tools/RssReader", m_menuTools, QIcon(), tr("RSS &Reader"), SLOT(showRssManager()), "");
    ADD_ACTION("Tools/WebInspector", m_menuTools, QIcon(), tr("Web In&spector"), SLOT(showWebInspector()), "Ctrl+Shift+I");
    ADD_ACTION("Tools/ClearRecentHistory", m_menuTools, QIcon::fromTheme(QSL("edit-clear")), tr("Clear Recent &History"), SLOT(showClearRecentHistoryDialog()), "Ctrl+Shift+Del");
    m_menuTools->addSeparator();

    // Help menu
    m_menuHelp = new QMenu(tr("&Help"));

#ifndef Q_OS_MAC
    ADD_ACTION("Help/AboutQt", m_menuHelp, QIcon(QSL(":/icons/menu/qt.png")), tr("About &Qt"), SLOT(aboutQt()), "");
    m_menuHelp->addAction(m_actions[QSL("Standard/About")]);
    m_menuHelp->addSeparator();
#endif

    ADD_ACTION("Help/InfoAboutApp", m_menuHelp, QIcon::fromTheme(QSL("help-contents")), tr("Information about application"), SLOT(showInfoAboutApp()), "");
    ADD_ACTION("Help/ConfigInfo", m_menuHelp, QIcon(), tr("Configuration Information"), SLOT(showConfigInfo()), "");
    ADD_ACTION("Help/ReportIssue", m_menuHelp, QIcon(), tr("Report &Issue"), SLOT(reportIssue()), "");

    m_actions[QSL("Help/InfoAboutApp")]->setShortcut(QKeySequence(QKeySequence::HelpContents));

    // History menu
    m_menuHistory = new HistoryMenu();
    m_menuHistory->setMainWindow(m_window);

    // Bookmarks menu
    m_menuBookmarks = new BookmarksMenu();
    m_menuBookmarks->setMainWindow(m_window);

    // Other actions
    action = new QAction(QIcon::fromTheme(QSL("user-trash")), tr("Restore &Closed Tab"), this);
    action->setShortcut(QKeySequence(QSL("Ctrl+Shift+T")));
    connect(action, SIGNAL(triggered()), this, SLOT(restoreClosedTab()));
    m_actions[QSL("Other/RestoreClosedTab")] = action;

#ifdef Q_OS_MAC
    m_actions[QSL("View/FullScreen")]->setShortcut(QKeySequence(QSL("F11")));

    // Add standard actions to File Menu (as it won't be ever cleared) and Mac menubar should move them to "Application" menu
    m_menuFile->addAction(m_actions[QSL("Standard/About")]);
    m_menuFile->addAction(m_actions[QSL("Standard/Preferences")]);
#endif

#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
    m_menuEdit->addAction(m_actions[QSL("Standard/Preferences")]);
#elif !defined(Q_OS_MAC)
    m_menuTools->addAction(m_actions[QSL("Standard/Preferences")]);
#endif

#ifndef QTWEBKIT_FROM_2_3
    m_actions[QSL("View/CaretBrowsing")]->setVisible(false);
#endif

    // Menus are hidden by default
    aboutToHideFileMenu();
    aboutToHideViewMenu();
    aboutToHideEditMenu();
    aboutToHideToolsMenu();

    addActionsToWindow();
}
Exemplo n.º 14
0
void Snakes::on_quitButton_clicked() {
	quitApplication();
}
Exemplo n.º 15
0
void MainWindow::createActions() {
  newAct = new QAction(QIcon(":/images/filenew.png"), tr("&New"), this);
  newAct->setShortcut(tr("Ctrl+N"));
  newAct->setStatusTip(tr("Create a new file"));
  connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));

  closeAct = new QAction(QIcon(":/images/fileclose.png"), tr("&Close"), this);
#ifndef Q_WS_MAC
  closeAct->setShortcut(tr("Ctrl+F4"));
#else
  closeAct->setShortcut(tr("Ctrl+W"));
#endif
  closeAct->setStatusTip(tr("Close the current file"));
  connect(closeAct, SIGNAL(triggered()), this, SLOT(closeFile()));

  openAct = new QAction(QIcon(":/images/fileopen.png"), tr("&Open..."), this);
  openAct->setShortcut(tr("Ctrl+O"));
  openAct->setStatusTip(tr("Open an existing file"));
  connect(openAct, SIGNAL(triggered()), this, SLOT(open()));

  saveAct = new QAction(QIcon(":/images/filesave.png"), tr("&Save"), this);
  saveAct->setShortcut(tr("Ctrl+S"));
  saveAct->setStatusTip(tr("Save the document to disk"));
  connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));

  saveAsAct = new QAction(QIcon(":/images/filesaveas.png"), tr("Save &As..."), this);
  saveAsAct->setStatusTip(tr("Save the document under a new name"));
  connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));

  exitAct = new QAction(QIcon(":/images/fileexit.png"), tr("E&xit"), this);
  exitAct->setShortcut(tr("Ctrl+Q"));
  exitAct->setStatusTip(tr("Exit QSciTE"));
  connect(exitAct, SIGNAL(triggered()), launcher, SLOT(quitApplication()));

  undoAct = new QAction(QIcon(":/images/undo.png"), tr("Undo"), this);
  undoAct->setShortcut(tr("Ctrl+Z"));
  undoAct->setStatusTip(tr("Undo the last action performed."));
  connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));

  redoAct = new QAction(QIcon(":/images/redo.png"), tr("Redo"), this);
  redoAct->setShortcut(tr("Ctrl+Shift+Z"));
  redoAct->setStatusTip(tr("Redo an action previously undone."));
  connect(redoAct, SIGNAL(triggered()), this, SLOT(redo()));

  cutAct = new QAction(QIcon(":/images/editcut.png"), tr("Cu&t"), this);
  cutAct->setShortcut(tr("Ctrl+X"));
  cutAct->setStatusTip(tr("Cut the current selection's contents to the "
                          "clipboard"));
  connect(cutAct, SIGNAL(triggered()), this, SLOT(editCut()));

  copyAct = new QAction(QIcon(":/images/editcopy.png"), tr("&Copy"), this);
  copyAct->setShortcut(tr("Ctrl+C"));
  copyAct->setStatusTip(tr("Copy the current selection's contents to the "
                           "clipboard"));
  connect(copyAct, SIGNAL(triggered()), this, SLOT(editCopy()));

  pasteAct = new QAction(QIcon(":/images/editpaste.png"), tr("&Paste"), this);
  pasteAct->setShortcut(tr("Ctrl+V"));
  pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
                            "selection"));
  connect(pasteAct, SIGNAL(triggered()), this, SLOT(editPaste()));

  prefsAct = new QAction(QIcon(":/images/configure.png"), tr("P&references"), this);
  // TODO: set shortcut, tip, etc.
  connect(prefsAct, SIGNAL(triggered()), this, SLOT(globalPrefs()));

  fontAct = new QAction(QIcon(":/images/font.png"), tr("&Font"), this);
  //fontAct->setShortcut(tr(""))
  fontAct->setStatusTip(tr("Set the display font."));

  connect(fontAct, SIGNAL(triggered()), this, SLOT(fontDialog()));

  terminalAct = new QAction(QIcon(":/images/terminal.png"), tr("Terminal"), this);
  terminalAct->setStatusTip(tr("Show/hide terminal"));
  connect(terminalAct, SIGNAL(triggered()), this, SLOT(toggleTerminal()));

  textDisplayAct = new QAction(QIcon(":/images/font.png"), tr("Text &Display..."), this);
  connect(textDisplayAct, SIGNAL(triggered()), this, SLOT(textDisplay()));

  aboutAct = new QAction(tr("&About QSciTE"), this);
  aboutAct->setStatusTip(tr("Show QSciTE's About box"));
  connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

  aboutQtAct = new QAction(tr("About &Qt"), this);
  aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
  connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

  nextAct = new QAction(QIcon(":/images/nextTab.png"), tr("Forward"), this);
  nextAct->setStatusTip(tr("Change to the next open document"));
  nextAct->setShortcut(tr("Alt+Right"));
  connect(nextAct, SIGNAL(triggered()), this, SLOT(nextDoc()));

  prevAct = new QAction(QIcon(":/images/prevTab.png"), tr("Back"), this);
  prevAct->setStatusTip(tr("Change to the previous open document"));
  prevAct->setShortcut(tr("Alt+Left"));
  connect(prevAct, SIGNAL(triggered()), this, SLOT(prevDoc()));

  cutAct->setEnabled(false);
  copyAct->setEnabled(false);

  convertEndings = new QAction(tr("&Convert Line End Characters"), this);
  connect(convertEndings, SIGNAL(triggered()), this, SLOT(convertEols()));
  lineEndCr = new QAction(tr("&CR (old Macintosh)"), this);
  lineEndCr->setCheckable(true);
  connect(lineEndCr, SIGNAL(triggered()), this, SLOT(setEolCr()));
  lineEndLf = new QAction(tr("&LF (Unix)"), this);
  lineEndLf->setCheckable(true);
  connect(lineEndLf, SIGNAL(triggered()), this, SLOT(setEolLf()));
  lineEndCrLf = new QAction(tr("CR &+ LF (Windows)"), this);
  lineEndCrLf->setCheckable(true);
  connect(lineEndCrLf, SIGNAL(triggered()), this, SLOT(setEolCrLf()));

  lineEnds = new QActionGroup(this);
  lineEnds->addAction(lineEndCr);
  lineEnds->addAction(lineEndLf);
  lineEnds->addAction(lineEndCrLf);
  lineEndLf->setChecked(true);

  showLineEndsAct = new QAction(tr("&Show End of Line"), this);
  showLineEndsAct->setCheckable(true);
  connect(showLineEndsAct, SIGNAL(toggled(bool)), this, SLOT(setEolVisibility(bool)));

  convertIndentAct = new QAction(tr("Convert &Indentation..."), this);
  connect(convertIndentAct, SIGNAL(triggered()), this, SLOT(convertIndentation()));

  codeFoldingAct = new QAction(tr("Use Code Folding"), this);
  codeFoldingAct->setCheckable(true);
  connect(codeFoldingAct, SIGNAL(triggered()), this, SLOT(toggleFolding()));

  findTextAct = new QAction(tr("&Find..."), this);
  findTextAct->setShortcut(tr("Ctrl+F"));
  connect(findTextAct, SIGNAL(triggered()), this, SLOT(showFindDialog()));
  
  replaceTextAct = new QAction(tr("Replace..."), this);
  replaceTextAct->setShortcut(tr("Ctrl+H"));
  connect(replaceTextAct, SIGNAL(triggered()), this, SLOT(showReplaceDialog()));

  //ScriptConsole
  scriptConsoleAct = new QAction(tr("Script Console"), this);
  connect(scriptConsoleAct, SIGNAL(triggered()), this, SLOT(showScriptConsole()));

  newWindowAct = new QAction(QIcon(":/images/newwindow.png"), tr("&New Window"), this);
  connect(newWindowAct, SIGNAL(triggered()), this, SLOT(newWindow()));

  lexers = new QActionGroup(this);
  for (int i = 0; !supportedLexers[i].isEmpty(); ++i) {
    QAction * tmp = new QAction(tr(supportedLexers[i].toStdString().c_str()), this);
    tmp->setCheckable(true);
    connect(tmp, SIGNAL(triggered()), this, SLOT(lexerMenuChanged()));
    lexers->addAction(tmp);
  }
  
}
Exemplo n.º 16
0
TestApplication::~TestApplication()
{
	quitApplication();
	thread_.join();
}