Пример #1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowTitle(tr("Emily"));
    ui->okButton->setFocus();

    m_storage = NULL;
    m_changeVoice = NULL;

    //Waiting for readSettings is too slow
    //So clipboard settings are read first
    QSettings settings("Emily", "Emily");
    //bool clip = settings.value("Clipboard").toBool();
    //setUseClipboard(clip);

    createActions();
    createTrayAndIcons();
    createAndInitializeObjects();
    createShortcuts();
    createConnections();
    startMaryServer();
    //readSettings();
    installAddon();
}
Пример #2
0
Toerstein::Toerstein(QWidget *parent) : QMainWindow(parent)
{
    toersteBase = new ToersteBase(this);
    toerstelliSense = new ToerstelliSense(this,toersteBase);

    connect(this,SIGNAL(fileLoaded(QString)),toerstelliSense->worker(),SLOT(indexFile(QString)));

    createMenuBar();
    createShortcuts();

    /* Create tab view */
    tabView = new TabView(this);
    tabView->setTabsClosable(true);
    setCentralWidget(tabView);

    connect(tabView,SIGNAL(tabCloseRequested(int)),this,SLOT(closeTab(int)));

    QCommandLineOption diffMode(QStringList() << "d" << "diff");
    QCommandLineParser parser;

    parser.addOption(diffMode);
    parser.process(QCoreApplication::arguments());

    const QStringList args = parser.positionalArguments();

    if ( args.length() > 0 )
    {
        if ( parser.isSet(diffMode) )
        {
            createNewFile();

            if ( args.length() > 1 )
            {
                open(args.at(0), args.at(1));
            }
            else
            {
                open(args.at(0));
            }
        }
        else
        {
            for(int i=0; i < args.length(); i++)
            {
                createNewFile();
                open(args.at(i));
            }
        }
    }
    else
    {
        createNewFile();
    }
}
Пример #3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent), m_ApplicationOpenReminderEnabled(true),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    setWindowTitle(Version::getApplicationName().append(" (Version ").append(Version::getApplicationVersion().append(")")));
    setWindowIcon(QIcon(":/icon.ico"));

    createShortcuts();

    m_GraphicsScene = new GraphicalGridScene(m_Crossword);
    ui->graphicsView->setScene(m_GraphicsScene);

    m_TableModel = new CrosswordEntryTableModel(m_Crossword, m_Crossword.getRefEntries());
    m_ProxyModel = new QSortFilterProxyModel(this);
    m_ProxyModel->setSourceModel(m_TableModel);
    ui->wordTableView->setModel(m_ProxyModel);

    m_IdleReminder = new IdleReminder(60000);
    m_ClueReader = new ClueReader();

    connect(this, SIGNAL(puzzleLoaded()), m_TableModel, SLOT(crosswordEntriesChanged()));
    connect(this, SIGNAL(puzzleLoaded()), ui->wordTableView, SLOT(setFocus(Qt::OtherFocusReason)));
    connect(this, SIGNAL(puzzleLoaded()), m_GraphicsScene, SLOT(buildPuzzleGrid()));

    connect(m_TableModel, SIGNAL(conflictingWordError()), ui->wordTableView, SLOT(conflictingWordError()));
    connect(ui->wordTableView, SIGNAL(modelIndexChanged(const QModelIndex&, const QModelIndex&)), m_TableModel, SLOT(tableViewSelectionChanged(const QModelIndex&, const QModelIndex&)));

    connect(ui->wordTableView, SIGNAL(guessSubmitted(QString,QModelIndex)), this, SLOT(checkIfPuzzleWasCompleted()));
    connect(ui->wordTableView, SIGNAL(guessSubmitted(QString, QModelIndex)), m_TableModel, SLOT(enterGuess(QString, QModelIndex)));
    connect(ui->wordTableView, SIGNAL(guessAmendationRequested(QString, QModelIndex)), m_TableModel, SLOT(amendGuess(QString, QModelIndex)));
    connect(ui->wordTableView, SIGNAL(guessErasureRequested(QModelIndex)), m_TableModel, SLOT(eraseGuess(QModelIndex)));

    connect(m_TableModel, SIGNAL(guessValidated(QString)), ui->wordTableView, SLOT(reportGuessAccepted(QString)));
    connect(m_TableModel, SIGNAL(guessAmended(QString)), ui->wordTableView, SLOT(reportGuessAmended(QString)));
    connect(m_TableModel, SIGNAL(guessErased()), ui->wordTableView, SLOT(reportGuessErased()));
    connect(m_TableModel, SIGNAL(guessAmendationRequestRejected()), ui->wordTableView, SLOT(reportGuessAmendationRejected()));

    connect(m_TableModel, SIGNAL(guessValidated(QString)), m_GraphicsScene, SLOT(repaintPuzzleGrid()));
    connect(m_TableModel, SIGNAL(guessAmended(QString)), m_GraphicsScene, SLOT(repaintPuzzleGrid()));
    connect(m_TableModel, SIGNAL(guessErased()), m_GraphicsScene, SLOT(repaintPuzzleGrid()));
    connect(m_TableModel, SIGNAL(crosswordEntrySelectionChanged(CrosswordEntry)), m_GraphicsScene, SLOT(highlightSelection(CrosswordEntry)));

    connect(&m_CrosswordLoader, SIGNAL(loaderError(QString, QString)), this, SLOT(showError(QString, QString)));

    connect(m_IdleReminder, SIGNAL(timedOut()), this, SLOT(onIdleReminderTimeout()));
    qApp->installEventFilter(m_IdleReminder);

    connect(m_TableModel, SIGNAL(crosswordEntrySelectionChanged(CrosswordEntry)), m_ClueReader, SLOT(setText(CrosswordEntry)));

    ITextToSpeech::instance().speak(getIntroString());
}
Пример #4
0
MainWindow::MainWindow()
  : m_ui(new Ui::MainWindow),
    m_logWindow(NULL),
    m_openWithManagerDialog(NULL),
    m_queueManagerDialog(NULL),
    m_minimizeAction(NULL),
    m_maximizeAction(NULL),
    m_restoreAction(NULL),
    m_trayIcon(NULL),
    m_trayIconMenu(NULL),
    m_statusTotalJobs(new QLabel(this)),
    m_statusHiddenJobs(new QLabel(this)),
    m_server(new Server (this))
{
  m_ui->setupUi(this);

  QIcon icon(":/icons/molequeue.png");
  setWindowIcon(icon);

  createActions();
  createActionFactories();
  createShortcuts();
  createMainMenu();
  createTrayIcon();
  createJobTable();
  createStatusBar();

  readSettings();

  connect(m_server, SIGNAL(connectionError(MoleQueue::ConnectionListener::Error,QString)),
          this, SLOT(handleServerConnectionError(MoleQueue::ConnectionListener::Error, QString)));

  connect(Logger::getInstance(), SIGNAL(firstNewErrorOccurred()),
          this, SLOT(errorOccurred()));
  connect(Logger::getInstance(), SIGNAL(newErrorCountReset()),
          this, SLOT(errorCleared()));
  connect(m_ui->errorNotificationLabel, SIGNAL(linkActivated(QString)),
          this, SLOT(handleErrorNotificationLabelAction(QString)));
  connect(m_server->jobManager(), SIGNAL(jobStateChanged(MoleQueue::Job,
                                                         MoleQueue::JobState,
                                                         MoleQueue::JobState)),
          this, SLOT(notifyJobStateChange(MoleQueue::Job,
                                          MoleQueue::JobState,
                                          MoleQueue::JobState)));

  m_server->start();

  m_ui->errorNotificationLabel->hide();
  m_trayIcon->show();
}
Пример #5
0
RichTextLineEdit::RichTextLineEdit(QWidget *parent)
    : QTextEdit(parent)
{
    setLineWrapMode(QTextEdit::NoWrap);
    setWordWrapMode(QTextOption::NoWrap);
    setAcceptRichText(true);
    setTabChangesFocus(true);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    createShortcuts();
    createActions();
    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(customContextMenuRequested(const QPoint&)));
}
Пример #6
0
MusicPlayer::MusicPlayer(QWidget *parent) : QWidget(parent),
    taskbarButton(0), taskbarProgress(0), thumbnailToolBar(0),
    playToolButton(0), forwardToolButton(0), backwardToolButton(0),
    mediaPlayer(0), playButton(0), volumeButton(0),
    positionSlider(0), positionLabel(0), infoLabel(0)
{
    //playList = playlist;
    createWidgets();
    createShortcuts();
    createJumpList();
    createTaskbar();
    createThumbnailToolBar();

    connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(updatePosition(qint64)));
    connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(updateDuration(qint64)));
    connect(&mediaPlayer, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(updateInfo()));
    connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError()));
    connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(updateState(QMediaPlayer::State)));
}
Пример #7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    m_currentIssueId(0)
{
    ui->setupUi(this);

    // set default settings
    QCoreApplication::setOrganizationName("Adyax");
    QCoreApplication::setOrganizationDomain("adyax.com");
    QCoreApplication::setApplicationName("qRedmine");

    createWidgets();
    createActions();
//    createTrayIcon();
    createShortcuts();

    // FIXME: comment do to qt5 tray icon bug
//#ifdef Q_OS_LINUX
//    QProcess process;
//    QStringList listIdentifierOfAllowedDistros;
//    listIdentifierOfAllowedDistros << "ksmserver" << "openbox";
//    process.start("pidof", listIdentifierOfAllowedDistros);
//    if (!process.waitForFinished() || !process.readAllStandardOutput().isEmpty()) {
//        m_trayIcon->show();
//    }
//#else
//    m_trayIcon->show();
//#endif

    // check that we have all crucial parameters configured
    readSettings();
    verifySettings();

    loadStyleSheet();

    m_redmine->fetchActivities();
    m_progress_dialog->show();
    fetchIssues();
    m_redmine->fetchTimeEntries();
}
Пример #8
0
MainWindow::MainWindow(Arguments *args)
    : QMainWindow(),
      ui(new Ui::MainWindow),
      _hasPlaylist(false),
      _isLite(false),
      _select(0),
      _locale(new LocaleManager()),
      _model(new PlaylistModel(this)),
      _modelUpdate(new PlaylistUpdate(_model)),
      _channel(0),
      _xmltv(new XmltvManager()),
      _previewTimer(new QTimer(this)),
      _udpxy(new NetworkUdpxy()),
      _osdFloat(0),
      _playlistEditor(0),
      _trayIcon(0)
{
    _arguments = args;

    ui->setupUi(this);

#if defined(Q_OS_LINUX)
    ui->menuAbout->removeAction(ui->actionUpdate);
#else
    ui->actionUpdate->setMenuRole(QAction::ApplicationSpecificRole);
#endif

    createDesktopStartup();
    createBackend();
    createMenus();
    createSettings();
    createGui();
    createShortcuts();
    createConnections();
    _mediaPlayer->createSession(_hasPlaylist && _model->validate());

    qApp->installEventFilter(this);

    tooltip();
}
Пример #9
0
	QMSMMainWindow::QMSMMainWindow(QWidget* pParent, NData::CDataHandler& rDataHandler, QApplication* pApplication) :
		QMainWindow(pParent),
		MainWindow(),
		mpApplication(pApplication),
		mpFormInfo(0),
		mpFormSettings(0),
		mpFormSystemOverview(0),
		mrDataHandler(rDataHandler),
		mpFormPower(0),
		mpFormTemperature(0),
		mpFormClock(0),
		mpFormUtilization(0),
		mpFormMemory(0),
		mpFormHeatmapUtilization(0),
		mpFormHeatmapTemperature(0),
		mGuiMarker(this)
		{
		
		setupUi(this);
		
		QString windowTitleKey = "MSMonitor v";
		windowTitleKey += QString::number(MS_MAJOR_VERSION);
		windowTitleKey += ".";
		windowTitleKey += QString::number(MS_MINOR_VERSION);
		windowTitleKey += ".";
		windowTitleKey += QString::number(MS_REVISION_VERSION);
		
		setWindowTitle(QApplication::translate("MainWindow", qPrintable(windowTitleKey), 0, QApplication::UnicodeUTF8));
		
		mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
		mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
		
		pushButtonStop->setEnabled(false);
		
		createActions();
		createShortcuts();
		
		mpFormInfo					= QMSMFormInfo::construct(this);
		mpFormSettings				= QMSMFormSettings::construct(this, mrDataHandler.getSettings());
		mpFormSystemOverview		= QMSMFormSystemOverview::construct(this, &mrDataHandler);
		mpFormPower					= QMSMFormPower::construct(this, &mrDataHandler);
		mpFormTemperature			= QMSMFormTemperature::construct(this, &mrDataHandler);
		mpFormClock					= QMSMFormClock::construct(this, &mrDataHandler);
		mpFormUtilization			= QMSMFormUtilization::construct(this, &mrDataHandler);
		mpFormMemory				= QMSMFormMemory::construct(this, &mrDataHandler);
		mpFormHeatmapUtilization	= QMSMFormHeatmapUtilization::construct(this, &mrDataHandler);
		mpFormHeatmapTemperature	= QMSMFormHeatmapTemperature::construct(this, &mrDataHandler);
		
		mdiArea->addSubWindow(mpFormInfo);
		mdiArea->addSubWindow(mpFormSettings);
		mdiArea->addSubWindow(mpFormSystemOverview);
		mdiArea->addSubWindow(mpFormPower);
		mdiArea->addSubWindow(mpFormTemperature);
		mdiArea->addSubWindow(mpFormClock);
		mdiArea->addSubWindow(mpFormUtilization);
		mdiArea->addSubWindow(mpFormMemory);
		mdiArea->addSubWindow(mpFormHeatmapUtilization);
		mdiArea->addSubWindow(mpFormHeatmapTemperature);
		
		mpFormInfo->hide();
		mpFormSettings->hide();
		mpFormSystemOverview->hide();
		mpFormPower->hide();
		mpFormTemperature->hide();
		mpFormClock->hide();
		mpFormUtilization->hide();
		mpFormMemory->hide();
		mpFormHeatmapUtilization->hide();
		mpFormHeatmapTemperature->hide();
		
		QString status_message("Listening on socket \"");
		status_message += mGuiMarker.getSocketName();
		status_message += "\".";
		QLabel status_label(status_message);
		statusBar()->addPermanentWidget(&status_label);
		
		show();
		
		statusbar->showMessage(status_message);
	}
Пример #10
0
bool QxtMediaKeys::activate()
{
    createShortcuts();
    return true; // Hmm... How to detect if this failed?
}
Пример #11
0
DwarfClipboard::DwarfClipboard()
{

    setupUi(this);
    createActions();
    createTrayIcon();
    trayIcon->setIcon(QIcon(":/icons/images/DwarfClipboard.png"));
    trayIcon->show();
    setWindowTitle(tr("DwarfClipboard"));
    inputDelay = 100;
    thumbnailSize = 64;
    prevCursor.x = -30000;
    createShortcuts();
    heartbeatTimer = new QTimer(this);
    connectedLabel = new QLabel();
    createConnections();
    recentModel = new DwarfClipboardModel();
    tableViewRecent->setModel(recentModel);
    libraryModel = new DwarfClipboardModel();
    treeViewLibrary->setModel(libraryModel);

    DFMgr = NULL;
    DF = NULL;
    Pos = NULL;

    connected = connectToDF();
    loadConfig();
    thumbnailSizeLineEdit->setText(QString("%1").arg(thumbnailSize));
    inputDelayMsLineEdit->setText(QString("%1").arg(inputDelay));

    tilesetPathButton->setText(DwarfClipboardPng::getTileSetPath());
    colorPathButton->setText(DwarfClipboardPng::getColorPath());

    copyShortcutButton->setText(copyShortcut->shortcut());
    pasteDesignationShortcutButton->setText(pasteDesignationShortcut->shortcut());
    pasteBuildingShortcutButton->setText(pasteBuildingShortcut->shortcut());
    setCursorToPreviousPasteShortcutButton->setText(setCursorToPreviousPasteShortcut->shortcut());
    
    heartbeatTimer->start(1000);

    Ui_MainWindow::statusBar->addPermanentWidget(connectedLabel);
    
    connectedIcon = QPixmap(":/icons/images/connect.png");
    
    //This mess just converts the disconnected icon to look the same as a disabled one
    //It is the same code used in the icon object
    disconnectedIcon = QPixmap(":/icons/images/disconnect.png");
    QStyleOption opt(0);
    opt.palette = QApplication::palette();
    QPixmap generated = QApplication::style()->generatedIconPixmap(QIcon::Disabled, disconnectedIcon, &opt);
    disconnectedIcon = generated;
    loadDirectory();
    loadBuildCommands();
    if(connected){
        connected = false; //this is ugly, but just ensures everything will be set proprly
        setConnected();
    }
    else{
        connected = true;
        setDisconnected();
    }
    setupViews();   
}
Пример #12
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
	mUnsavedChangesDialog = NULL;
	mCurrentSyntaxMenuItem = NULL;

	setWindowTitle(tr("PonyEdit"));

	setAcceptDrops(true);

	gWindowManager = new WindowManager(this);
	gWindowManager->setMinimumWidth(200);
	setCentralWidget(gWindowManager);

	mFileList = new FileList();
	addDockWidget(Qt::LeftDockWidgetArea, mFileList, Qt::Vertical);
	mFileList->setObjectName("File List");

	mTabbedFileList = new TabbedFileList();
	addDockWidget(Qt::TopDockWidgetArea, mTabbedFileList, Qt::Horizontal);
	mTabbedFileList->setObjectName("Tabbed File List");

	if(Options::FileListType == Options::QuickList)
	{
		mFileList->setVisible(true);
		mTabbedFileList->setVisible(false);
	}
	else
	{
		mFileList->setVisible(false);
		mTabbedFileList->setVisible(true);
	}

	mStatusLine = new QLabel();
	mStatusBar = new QStatusBar();
	mStatusBar->addPermanentWidget(mStatusLine);
	setStatusBar(mStatusBar);

	createToolbar();

	createFileMenu();
	createEditMenu();
	createViewMenu();
	createToolsMenu();
	createWindowMenu();
	createHelpMenu();
	createMacDockMenu();

	createShortcuts();

	connect(gDispatcher, SIGNAL(generalErrorMessage(QString)), this, SLOT(showErrorMessage(QString)), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(generalStatusMessage(QString)), this, SLOT(showStatusMessage(QString)), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(selectFile(BaseFile*)), this, SLOT(fileSelected(BaseFile*)));
	connect(gWindowManager, SIGNAL(currentChanged()), this, SLOT(currentEditorChanged()), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(syntaxChanged(BaseFile*)), this, SLOT(updateSyntaxSelection()));
	connect(&gOpenFileManager, SIGNAL(fileOpened(BaseFile*)), this, SLOT(openFileListChanged()));
	connect(&gOpenFileManager, SIGNAL(fileClosed(BaseFile*)), this, SLOT(openFileListChanged()));
	connect(gWindowManager, SIGNAL(splitChanged()), this, SLOT(viewSplittingChanged()));

	mRecentFiles = Tools::loadRecentFiles();
	updateRecentFilesMenu();

	// Set the default size to something relatively sane
	resize(QSize(800, 600));
	restoreState();

	openFileListChanged();
	viewSplittingChanged();
}