Example #1
0
ProjectManager::ProjectManager(QObject* parent) :
    QObject(parent),
    m_project(0),
    m_trackView(0),
    m_progressDialog(NULL)
{
    m_fileRevert = KStandardAction::revert(this, SLOT(slotRevert()), pCore->window()->actionCollection());
    m_fileRevert->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-revert")));
    m_fileRevert->setEnabled(false);

    QAction *a = KStandardAction::open(this,                   SLOT(openFile()),               pCore->window()->actionCollection());
    a->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-open")));
    a = KStandardAction::saveAs(this,                 SLOT(saveFileAs()),             pCore->window()->actionCollection());
    a->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-save-as")));
    a = KStandardAction::openNew(this,                SLOT(newFile()),                pCore->window()->actionCollection());
    a->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-new")));
    m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openFile(QUrl)), pCore->window()->actionCollection());

    QAction * backupAction = new QAction(KoIconUtils::themedIcon(QStringLiteral("edit-undo")), i18n("Open Backup File"), this);
    pCore->window()->addAction(QStringLiteral("open_backup"), backupAction);
    connect(backupAction, SIGNAL(triggered(bool)), SLOT(slotOpenBackup()));

    m_notesPlugin = new NotesPlugin(this);

    m_autoSaveTimer.setSingleShot(true);
    connect(&m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));

    // Ensure the default data folder exist
    QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
    dir.mkpath(QStringLiteral(".backup"));
    dir.mkdir(QStringLiteral("titles"));
}
Example #2
0
void CVSService::slotRevert()
{
  QStringList files;
  if (!m_defaultFile.isEmpty())
  {
    if (m_defaultFile.startsWith(m_repositoryPath))
    {
      files += m_defaultFile.remove(m_repositoryPath);
      slotRevert(files);
    } else
    {
      notInRepository();
    }
  }
}
Example #3
0
void PerforcePart::contextMenu(QPopupMenu *popup, const Context *context)
{
    if (context->hasType( Context::FileContext )) {
        const FileContext *fcontext = static_cast<const FileContext*>(context);
        popupfile = fcontext->urls().first().path();
        QFileInfo fi( popupfile );
        popup->insertSeparator();

        KPopupMenu *sub = new KPopupMenu(popup);
        QString name = fi.fileName();
        sub->insertTitle( i18n("Actions for %1").arg(name) );

        int id = sub->insertItem( i18n("Edit"),
                           this, SLOT(slotEdit()) );
        sub->setWhatsThis(id, i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
        id = sub->insertItem( i18n("Revert"),
                           this, SLOT(slotRevert()) );
        sub->setWhatsThis(id, i18n("<b>Revert</b><p>Discards changes made to open files."));
        id = sub->insertItem( i18n("Submit"),
                           this, SLOT(slotCommit()) );
        sub->setWhatsThis(id, i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
        id = sub->insertItem( i18n("Sync"),
                           this, SLOT(slotUpdate()) );
        sub->setWhatsThis(id, i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
        sub->insertSeparator();
        id = sub->insertItem( i18n("Diff Against Repository"),
                          this, SLOT(slotDiff()) );
        sub->setWhatsThis(id, i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
        id = sub->insertItem( i18n("Add to Repository"),
                           this, SLOT(slotAdd()) );
        sub->setWhatsThis(id, i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
        id = sub->insertItem( i18n("Remove From Repository"),
                           this, SLOT(slotRemove()) );
        sub->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
        id = popup->insertItem(i18n("Perforce"), sub);
    }
}
Example #4
0
CVSService::CVSService(KActionCollection *ac)
{
  m_menu = new KPopupMenu();
  KAction *action = new KAction(i18n("&Commit..."), "vcs_commit", 0, this, SLOT(slotCommit()), ac, "vcs_commit");
  action->plug(m_menu);
  action = new KAction(i18n("&Update"), "vcs_update", 0, this, SLOT(slotUpdate()), ac, "vcs_update");
  action->plug(m_menu);
  KPopupMenu *updateToMenu = new KPopupMenu(m_menu);
  m_menu->insertItem(SmallIconSet("vcs_update"), i18n("Update &To"), updateToMenu);
  action = new KAction(i18n("&Tag/Date..."), "vcs_update", 0, this, SLOT(slotUpdateToTag()), ac, "vcs_update_tag_date");
  action->plug(updateToMenu);
  action = new KAction(i18n("&HEAD"), "vcs_update", 0, this, SLOT(slotUpdateToHead()), ac, "vcs_update_head");
  action->plug(updateToMenu);
  action = new KAction(i18n("Re&vert"), "reload", 0, this, SLOT(slotRevert()), ac, "vcs_revert");
  action->plug(m_menu);
  m_menu->insertSeparator();
  action = new KAction(i18n("&Add to Repository..."), "vcs_add", 0, this, SLOT(slotAdd()), ac, "vcs_add");
  action->plug(m_menu);
  action = new KAction(i18n("&Remove From Repository..."), "vcs_remove", 0, this, SLOT(slotRemove()), ac, "vcs_remove");
  action->plug(m_menu);
  action = new KAction(i18n("&Ignore in CVS Operations"), 0, this, SLOT(slotAddToCVSIgnore()), ac);
  action->plug(m_menu);
  action = new KAction(i18n("Do &Not Ignore in CVS Operations"), 0, this, SLOT(slotRemoveFromCVSIgnore()), ac);
  action->plug(m_menu);
  
  m_menu->insertSeparator();
  action = new KAction(i18n("Show &Log Messages"), 0, this, SLOT(slotBrowseLog()), ac);
  action->plug(m_menu);
    
  m_cvsJob = 0L;
  m_repository = 0L;
  m_cvsService =0L;
  m_commitDlg = new CVSCommitDlgS();
  m_updateToDlg = new CVSUpdateToDlgS();
  m_timer = new QTimer(this);
  connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
}
Example #5
0
CTrackToolWidget::CTrackToolWidget(QTabWidget * parent)
: QWidget(parent)
, originator(false)
{
    setupUi(this);
    setObjectName("Tracks");
    parent->addTab(this,QIcon(":/icons/iconTrack16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Tracks"));

    connect(&CTrackDB::self(), SIGNAL(sigModified(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigNeedUpdate(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    connect(listTracks,SIGNAL(itemClicked(QListWidgetItem*) ),this,SLOT(slotItemClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemDoubleClicked(QListWidgetItem*) ),this,SLOT(slotItemDoubleClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemSelectionChanged()),this,SLOT(slotSelectionChanged()));

    contextMenu     = new QMenu(this);
    actEdit         = contextMenu->addAction(QPixmap(":/icons/iconEdit16x16.png"),tr("Edit..."),this,SLOT(slotEdit()));
    actRevert       = contextMenu->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Revert"),this,SLOT(slotRevert()));
    contextMenu->addSeparator();
    actDistance     = contextMenu->addAction(QPixmap(":/icons/iconDistance16x16.png"),tr("Make Overlay"),this,SLOT(slotToOverlay()));
    contextMenu->addSeparator();
    actHide         = contextMenu->addAction(tr("Show"),this,SLOT(slotShow()));
    actShowBullets  = contextMenu->addAction(tr("Show Bullets"),this,SLOT(slotShowBullets()));
    actShowMinMax   = contextMenu->addAction(tr("Show Min/Max"),this,SLOT(slotShowMinMax()));
    contextMenu->addSeparator();
    actZoomToFit    = contextMenu->addAction(QPixmap(":/icons/iconZoomArea16x16.png"),tr("Zoom to fit"),this,SLOT(slotZoomToFit()));
    actDel          = contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()));

    actHide->setCheckable(true);
    actShowBullets->setCheckable(true);
    actShowBullets->setChecked(CTrackDB::self().getShowBullets());
    actShowMinMax->setCheckable(true);
    actShowMinMax->setChecked(CTrackDB::self().getShowMinMax());

    connect(listTracks,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));

    QFontMetrics fm(listTracks->font());
    listTracks->setIconSize(QSize(15,N_LINES*fm.height()));

    connect(toolSortAlpha, SIGNAL(clicked()), this, SLOT(slotDBChanged()));
    connect(toolSortTime, SIGNAL(clicked()), this, SLOT(slotDBChanged()));

    toolSortAlpha->setIcon(QPixmap(":/icons/iconDec16x16.png"));
    toolSortTime->setIcon(QPixmap(":/icons/iconTime16x16.png"));

    SETTINGS;
    toolSortAlpha->setChecked(cfg.value("track/sortAlpha", true).toBool());
    toolSortTime->setChecked(cfg.value("track/sortTime", true).toBool());

    listTracks->installEventFilter(this);
}
Example #6
0
BlitzMainWindow::BlitzMainWindow()
    : QMainWindow()
{
    setWindowTitle(tr("Blitz Effect Test"));
    QScrollArea *sa = new QScrollArea(this);
    lbl = new QLabel;
    sa->setWidget(lbl);
    setCentralWidget(sa);

    QToolBar *tBar = addToolBar(tr("Effect Options"));
    QAction *openAct = tBar->addAction(tr("Open"), this, SLOT(slotOpen()));
    QAction *revertAct = tBar->addAction(tr("Revert"), this, SLOT(slotRevert()));
    qualityCB = new QCheckBox(tr("High Quality"), tBar);
    qualityCB->setChecked(true);
    tBar->addWidget(qualityCB);

    QMenuBar *mBar = menuBar();
    QMenu *fileMnu = mBar->addMenu(tr("File"));
    fileMnu->addAction(openAct);
    fileMnu->addAction(revertAct);
    fileMnu->addSeparator();
    fileMnu->addAction(tr("Close"), this, SLOT(close()));

    QMenu *effectMnu = mBar->addMenu(tr("Effects"));
    effectMnu->addAction(tr("Grayscale (MMX)"), this, SLOT(slotGrayscale()));
    effectMnu->addAction(tr("Invert (MMX)"), this, SLOT(slotInvert()));

    QMenu *subMnu = effectMnu->addMenu(tr("Threshold"));
    subMnu->addAction(tr("Threshold (Default)"), this, SLOT(slotThreshold()));
    subMnu->addAction(tr("Threshold (Red)"), this, SLOT(slotThresholdRed()));
    subMnu->addAction(tr("Threshold (Green)"), this, SLOT(slotThresholdGreen()));
    subMnu->addAction(tr("Threshold (Blue)"), this, SLOT(slotThresholdBlue()));
    subMnu->addAction(tr("Threshold (Alpha)"), this, SLOT(slotThresholdAlpha()));
    subMnu = effectMnu->addMenu(tr("Intensity (MMX)"));
    subMnu->addAction(tr("Increment Intensity"), this, SLOT(slotIncIntensity()));
    subMnu->addAction(tr("Decrement Intensity"), this, SLOT(slotDecIntensity()));
    subMnu->addSeparator();
    subMnu->addAction(tr("Increment Red Intensity"), this, SLOT(slotIncRedIntensity()));
    subMnu->addAction(tr("Decrement Red Intensity"), this, SLOT(slotDecRedIntensity()));
    subMnu->addAction(tr("Increment Green Intensity"), this, SLOT(slotIncGreenIntensity()));
    subMnu->addAction(tr("Decrement Green Intensity"), this, SLOT(slotDecGreenIntensity()));
    subMnu->addAction(tr("Increment Blue Intensity"), this, SLOT(slotIncBlueIntensity()));
    subMnu->addAction(tr("Decrement Blue Intensity"), this, SLOT(slotDecBlueIntensity()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Spiff"), this, SLOT(slotSpiff()));
    effectMnu->addAction(tr("Dull"), this, SLOT(slotDull()));
    effectMnu->addSeparator();
    effectMnu->addAction(tr("Desaturate"), this, SLOT(slotDesaturate()));
    effectMnu->addAction(tr("Fade"), this, SLOT(slotFade()));
    effectMnu->addAction(tr("Flatten"), this, SLOT(slotFlatten()));
    effectMnu->addSeparator();
    effectMnu->addAction(tr("Sharpen"), this, SLOT(slotSharpen()));
    effectMnu->addAction(tr("Blur"), this, SLOT(slotBlur()));
    effectMnu->addAction(tr("Gaussian Sharpen (MMX)"), this, SLOT(slotGaussianSharpen()));
    effectMnu->addAction(tr("Gaussian Blur (MMX)"), this, SLOT(slotGaussianBlur()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Sobel Edge (MMX)"), this, SLOT(slotEdge()));
    effectMnu->addAction(tr("Convolve Edge (MMX)"), this, SLOT(slotConvolveEdge()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Equalize"), this, SLOT(slotEqualize()));
    effectMnu->addAction(tr("Normalize"), this, SLOT(slotNormalize()));
    effectMnu->addAction(tr("Despeckle"), this, SLOT(slotDespeckle()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Charcoal"), this, SLOT(slotCharcoal()));
    effectMnu->addAction(tr("Swirl"), this, SLOT(slotSwirl()));
    effectMnu->addAction(tr("Implode"), this, SLOT(slotImplode()));
    effectMnu->addAction(tr("Wave"), this, SLOT(slotWave()));
    effectMnu->addAction(tr("Oil Paint"), this, SLOT(slotOilpaint()));
    effectMnu->addAction(tr("Emboss"), this, SLOT(slotEmboss()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Smoothscale (MMX)..."), this, SLOT(slotSmoothscale()));
    effectMnu->addAction(tr("Smoothscale Filtered..."), this, SLOT(slotSmoothscaleFiltered()));
    effectMnu->addSeparator();
    effectMnu->addAction(tr("Modulate..."), this, SLOT(slotModulate()));
    effectMnu->addSeparator();

    effectMnu->addAction(tr("Gradient..."), this, SLOT(slotGradient()));
    effectMnu->addAction(tr("Unbalanced Gradient..."), this, SLOT(slotUnbalancedGradient()));
    effectMnu->addAction(tr("8bpp Gradient..."), this, SLOT(slotGrayscaleGradient()));
    effectMnu->addAction(tr("8bpp Unbalanced Gradient..."), this, SLOT(slotGrayscaleUnbalancedGradient()));

    resize(sizeHint());
}