void ProjectsView::updateSelection()
{
    updateActions();

    if ( m_selectedProjectId != 0 )
        emit projectSelected( m_selectedProjectId );
    else
        emit selectionChanged( m_currentFolderId, m_currentTypeId, m_selectedViewId );
}
Exemple #2
0
TimerWidget::TimerWidget(QWidget *parent) : QFrame(parent),
ui(new Ui::TimerWidget),
timer(new QTimer(this)),
duration(0),
project(""),
tagsHolder(""),
timeEntryAutocompleteNeedsUpdate(false),
descriptionModel(new AutocompleteListModel(this)),
timeEntry(nullptr),
selectedTaskId(0),
selectedProjectId(0) {
    ui->setupUi(this);

    ui->start->installEventFilter(this);

    connect(TogglApi::instance, SIGNAL(displayStoppedTimerState()),
            this, SLOT(displayStoppedTimerState()));

    connect(TogglApi::instance, SIGNAL(displayRunningTimerState(TimeEntryView*)),  // NOLINT
            this, SLOT(displayRunningTimerState(TimeEntryView*)));  // NOLINT

    connect(TogglApi::instance, SIGNAL(displayMinitimerAutocomplete(QVector<AutocompleteView*>)),  // NOLINT
            this, SLOT(displayMinitimerAutocomplete(QVector<AutocompleteView*>)));  // NOLINT

    connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
            this, SLOT(focusChanged(QWidget*, QWidget*)));

    connect(timer, SIGNAL(timeout()), this, SLOT(timeout()));

    connect(ui->description, SIGNAL(returnPressed()),
            this, SLOT(descriptionReturnPressed()));
    connect(ui->description, SIGNAL(projectSelected(QString,uint64_t,QString,QString,uint64_t)),
            this, SLOT(descriptionProjectSelected(QString,uint64_t,QString,QString,uint64_t)));
    connect(ui->description, SIGNAL(billableChanged(bool)),
            this, SLOT(descriptionBillableChanged(bool)));
    connect(ui->description, SIGNAL(tagsChanged(QString)),
            this, SLOT(descriptionTagsChanged(QString)));
    connect(ui->description, &QComboBox::editTextChanged,
            this, &TimerWidget::updateCoverLabel);

    connect(ui->deleteProject, &QPushButton::clicked, this, &TimerWidget::clearProject);
    connect(ui->deleteTask, &QPushButton::clicked, this, &TimerWidget::clearTask);

    ui->description->setModel(descriptionModel);
    ui->taskFrame->setVisible(false);
    ui->projectFrame->setVisible(false);

    ui->billable->setVisible(false);
    ui->tags->setVisible(false);

    descriptionPlaceholder = "What are you doing?";
    tagsHolder = "";
}
bool MainWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        showProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 1:
        updateProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 2:
        showDialogHelp();
        break;
    case 3:
        showDebugStep((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 4:
        showStackFrame((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 5:
        showErrorMessage((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 6:
        finishedRun();
        break;
    case 7:
        breakPointsChanged();
        break;
    case 8:
        fileNew();
        break;
    case 9:
        fileNewDialog();
        break;
    case 10:
        fileNewFile();
        break;
    case 11:
        fileClose();
        break;
    case 12:
        fileQuit();
        break;
    case 13:
        fileCloseProject();
        break;
    case 14:
        fileOpen();
        break;
    case 15:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2));
        break;
    case 16:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 17:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(bool)static_QUType_bool.get(_o+4));
        break;
    case 18:
        static_QUType_bool.set(_o,fileSave());
        break;
    case 19:
        static_QUType_bool.set(_o,fileSaveForm());
        break;
    case 20:
        static_QUType_bool.set(_o,fileSaveProject());
        break;
    case 21:
        static_QUType_bool.set(_o,fileSaveAs());
        break;
    case 22:
        fileSaveAll();
        break;
    case 23:
        fileCreateTemplate();
        break;
    case 24:
        editUndo();
        break;
    case 25:
        editRedo();
        break;
    case 26:
        editCut();
        break;
    case 27:
        editCopy();
        break;
    case 28:
        editPaste();
        break;
    case 29:
        editDelete();
        break;
    case 30:
        editSelectAll();
        break;
    case 31:
        editLower();
        break;
    case 32:
        editRaise();
        break;
    case 33:
        editAdjustSize();
        break;
    case 34:
        editLayoutHorizontal();
        break;
    case 35:
        editLayoutVertical();
        break;
    case 36:
        editLayoutHorizontalSplit();
        break;
    case 37:
        editLayoutVerticalSplit();
        break;
    case 38:
        editLayoutGrid();
        break;
    case 39:
        editLayoutContainerHorizontal();
        break;
    case 40:
        editLayoutContainerVertical();
        break;
    case 41:
        editLayoutContainerGrid();
        break;
    case 42:
        editBreakLayout();
        break;
    case 43:
        editAccels();
        break;
    case 44:
        editFunctions();
        break;
    case 45:
        editConnections();
        break;
    case 46:
        static_QUType_ptr.set(_o,editSource());
        break;
    case 47:
        static_QUType_ptr.set(_o,editSource((SourceFile*)static_QUType_ptr.get(_o+1)));
        break;
    case 48:
        static_QUType_ptr.set(_o,openSourceEditor());
        break;
    case 49:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2)));
        break;
    case 50:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)));
        break;
    case 51:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4)));
        break;
    case 52:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4),(bool)static_QUType_bool.get(_o+5)));
        break;
    case 53:
        editFormSettings();
        break;
    case 54:
        editProjectSettings();
        break;
    case 55:
        editPixmapCollection();
        break;
    case 56:
        editDatabaseConnections();
        break;
    case 57:
        editPreferences();
        break;
    case 58:
        projectInsertFile();
        break;
    case 59:
        searchFind();
        break;
    case 60:
        searchIncremetalFindMenu();
        break;
    case 61:
        searchIncremetalFind();
        break;
    case 62:
        searchIncremetalFindNext();
        break;
    case 63:
        searchReplace();
        break;
    case 64:
        searchGotoLine();
        break;
    case 65:
        previewForm();
        break;
    case 66:
        previewForm((const QString&)static_QUType_QString.get(_o+1));
        break;
    case 67:
        toolsCustomWidget();
        break;
    case 68:
        toolsConfigure();
        break;
    case 69:
        helpContents();
        break;
    case 70:
        helpManual();
        break;
    case 71:
        helpAbout();
        break;
    case 72:
        helpAboutQt();
        break;
    case 73:
        helpRegister();
        break;
    case 74:
        activeWindowChanged((QWidget*)static_QUType_ptr.get(_o+1));
        break;
    case 75:
        updateUndoRedo((bool)static_QUType_bool.get(_o+1),(bool)static_QUType_bool.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4));
        break;
    case 76:
        updateEditorUndoRedo();
        break;
    case 77:
        toolSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 78:
        clipboardChanged();
        break;
    case 79:
        selectionChanged();
        break;
    case 80:
        windowsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 81:
        setupWindowActions();
        break;
    case 82:
        createNewTemplate();
        break;
    case 83:
        projectSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 84:
        setupRecentlyFilesMenu();
        break;
    case 85:
        setupRecentlyProjectsMenu();
        break;
    case 86:
        recentlyFilesMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 87:
        recentlyProjectsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 88:
        emitProjectSignals();
        break;
    case 89:
        showStartDialog();
        break;
    case 90:
        doFunctionsChanged();
        break;
    case 91:
        static_QUType_bool.set(_o,openProjectSettings((Project*)static_QUType_ptr.get(_o+1)));
        break;
    default:
        return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}
CApplicationInstaller::CApplicationInstaller(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CApplicationInstaller)
{
    qDebug("CApplicationInstaller Init");
    ui->setupUi(this);
    //updateNeeded = false;
    ui->uninstallButton->setToolTip("Uninstall application");

    ui->optionsRunCheckBox->setToolTip("Run program after install completes");
    ui->optionsRamCheckBox->setToolTip("Install program in RAM");
    ui->optionsStartupCheckBox->setToolTip("Run program on startup");
    ui->optionsFilesCheckBox->setToolTip("Install files with application");

    ui->dataSizeSpinBox->setAttribute(Qt::WA_MacShowFocusRect, 0);
    ui->dataSizeLockCheckBox->setObjectName("lock");
    ui->dataSizeLockCheckBox->setEnabled(true);
    ui->dataSizeLockCheckBox->setToolTip("Lock/unlock size of RAM");
    ui->dataSizeSpinBox->setToolTip("Size of RAM (data/bss/stack) for application ");

    ui->uninstallButton->setObjectName("blueButton");
    ui->uninstallButton->setText(CFont::iconTrash());

    ui->installButton->setObjectName("blueButton");
    ui->installButton->setText(CFont::iconDownloadAlt());
    ui->installButton->setToolTip("Install Application");

    ui->filesInstallButton->setObjectName("blueButton");
    ui->filesInstallButton->setText(CFont::iconCopy());
    ui->filesInstallButton->setToolTip("Install associated files");

    ui->installAllCheckBox->setToolTip("Install all workspace applications");

    ui->installPath->setObjectName("unified");
    connect(ui->installPath->lineEdit(), SIGNAL(editingFinished()), this, SLOT(installPathUpdated()));

    ui->installer->setPrefix("APPLICATION");
    ui->installer->setSettings(CApplicationSettings::settings());
    ui->installer->loadPreferences();


    connect(ui->installer, SIGNAL(addProject(QString)), this, SLOT(addProject(QString)));
    connect(ui->installer, SIGNAL(projectSelected(QString)), this, SLOT(projectSelected(QString)));
    //need to load the previously loaded workspace

    connect(ui->installer, SIGNAL(projectUpdated(QString, QString, QString)),
            this, SIGNAL(projectUpdated(QString, QString, QString)));

    connect(ui->dataSizeLockCheckBox, SIGNAL(clicked(bool)), ui->dataSizeSpinBox, SLOT(setEnabled(bool)));

    ui->installer->updateProjectList();

    ui->stackLabel->setToolTip("Stack size");
    ui->stackLabel->setObjectName("warningLabel");

    connected(false);
    qDebug("CApplicationInstaller Done");

    CEventFilter * wheelFilter = new CEventFilter(QEvent::Wheel);
    ui->dataSizeSpinBox->installEventFilter(wheelFilter);
}