JobWidget::JobWidget(QWidget *parent) : QWidget(parent), _ui(new Ui::JobWidget) { _ui->setupUi(this); _ui->restoreListWidget->setAttribute(Qt::WA_MacShowFocusRect, false); connect(_ui->listArchivesButton, &QPushButton::clicked, [=](){ _ui->stackedWidget->setCurrentWidget(_ui->jobRestorePage); }); connect(_ui->restoreBackButton, &QPushButton::clicked, [=](){ _ui->stackedWidget->setCurrentWidget(_ui->jobDetailPage); }); connect(_ui->optionsBackButton, &QPushButton::clicked, [=](){ if(_job->objectKey().isEmpty()) _ui->stackedWidget->setCurrentWidget(_ui->jobNewPage); else _ui->stackedWidget->setCurrentWidget(_ui->jobDetailPage); }); connect(_ui->optionsButton, &QPushButton::clicked, [=](){ _ui->stackedWidget->setCurrentWidget(_ui->jobOptionsPage); }); connect(_ui->jobNameLineEdit, &QLineEdit::textChanged, [=](){ emit enableSave(canSaveNew()); }); connect(_ui->newJobTreeWidget, &FilePicker::selectionChanged, [=](){ emit enableSave(canSaveNew()); }); connect(_ui->newJobOptionsButton, &QPushButton::clicked, [=](){ _ui->stackedWidget->setCurrentWidget(_ui->jobOptionsPage); }); connect(_ui->detailTreeWidget, SIGNAL(focusLost()), this, SLOT(save())); connect(_ui->preservePathsCheckBox, SIGNAL(toggled(bool)), this, SLOT(save())); connect(_ui->traverseMountCheckBox, SIGNAL(toggled(bool)), this, SLOT(save())); connect(_ui->followSymLinksCheckBox, SIGNAL(toggled(bool)), this, SLOT(save())); connect(_ui->skipFilesSpinBox, SIGNAL(valueChanged(int)), this, SLOT(save())); connect(_ui->cancelButton, SIGNAL(clicked()), this, SIGNAL(cancel())); connect(_ui->restoreLatestArchiveButton, SIGNAL(clicked()), this, SLOT(restoreLatestArchive())); connect(_ui->restoreListWidget, SIGNAL(inspectArchive(ArchivePtr)), this, SIGNAL(inspectJobArchive(ArchivePtr))); connect(_ui->restoreListWidget, SIGNAL(restoreArchive(ArchivePtr,ArchiveRestoreOptions)), this, SIGNAL(restoreJobArchive(ArchivePtr,ArchiveRestoreOptions))); connect(_ui->restoreListWidget, SIGNAL(deleteArchives(QList<ArchivePtr>)), this, SIGNAL(deleteJobArchives(QList<ArchivePtr>))); }
ScreenControl::ScreenControl(QWidget *parent) : QWidget(parent) { setupUi(this); _autoSave=false; _keyColumns=1; _searchType=Query; _shown=false; _listReportName=QString(); _print->setVisible(! _listReportName.isEmpty()); _model = new XSqlTableModel; connect (_new, SIGNAL(clicked()), this, SLOT(newRow())); connect (_save, SIGNAL(clicked()), this, SIGNAL(saveClicked())); connect (_save, SIGNAL(clicked()), this, SLOT(save())); connect (_print, SIGNAL(clicked()), this, SIGNAL(printClicked())); connect (_print, SIGNAL(clicked()), this, SLOT(print())); connect (_prev, SIGNAL(clicked()), this, SLOT(toPrevious())); connect (_next, SIGNAL(clicked()), this, SLOT(toNext())); connect (_search, SIGNAL(clicked()), this, SLOT(search())); connect (_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(enableSave())); _view->setVisible(FALSE); _save->setEnabled(false); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); }
QueueItem::QueueItem( const QueueItem& rhs ) : DataOStream() , _impl( new detail::QueueItem( *rhs._impl )) { enableSave(); _enable(); }
/** * \brief Supprime une ligne d'éditeur des lignes d'éditeur du DocumentEditor * \param row ligne d'éditeur */ void DocumentEditor::supress(DocumentEditorRow* row){ rows.removeOne(row); scrollLayout->removeWidget(row); delete row; enableSave(); updateNote(); }
QueueItem::QueueItem( QueueMaster& master ) : DataOStream() , _impl( new detail::QueueItem( master )) { enableSave(); _enable(); }
/** * \brief Constructeur de l'éditeur de note binaires * \param b binaire ressource */ BinaryEditor::BinaryEditor(Binary *b, QWidget *parent) : NoteEditor(b, parent), resource(b) { description = new QTextEdit(); description->setText(resource->getDescription()); QObject::connect(description, SIGNAL(textChanged()), this, SLOT(enableSave())); QObject::connect(description, SIGNAL(textChanged()), this, SLOT(updateNote())); layout->addWidget(description); }
/** * \brief Constructeur d'un éditeur d'article * \param note Pointeur sur l'article à éditer */ ArticleEditor::ArticleEditor(Article *a, QWidget *parent) : NoteEditor(a, parent), resource(a) { text = new QTextEdit(); QObject::connect(text, SIGNAL(textChanged()), this, SLOT(enableSave())); QObject::connect(text, SIGNAL(textChanged()), this, SLOT(updateNote())); text->setText(resource->getText()); layout->addWidget(text); }
/** * \brief Constructeur d'un éditeur de note * \details Construit les parties permettant d'associer un tag à une note, * editer le titre de la note et sauvegarder la note * \param note Pointeur sur la note à éditer */ NoteEditor::NoteEditor(Note *note, QWidget *parent) : resource(note) { setParent(parent); // top tag row QLabel* tagsLabel = new QLabel("Tags associés : "); tags = new QComboBox(this); QLabel* deleteTagLabel = new QLabel("Supprimer un tag : "); deleteTag = new QComboBox(this); for(QMultiMap<QString, QString>::iterator it = TagManager::getInstance().getAssociatedTagsBegin() ; it != TagManager::getInstance().getAssociatedTagsEnd(); ++it){ if (it.value() == note->getId()) { tags->addItem(it.key()); deleteTag->addItem(it.key()); } } deleteTagBtn = new QPushButton(this); deleteTagBtn->setIcon(QIcon("supprimer.png")); QObject::connect(deleteTagBtn, SIGNAL(clicked()), this, SLOT(deleteAssociatedTag())); QLabel* addTagLabel = new QLabel("Associer un tag : "); addTag = new QComboBox(this); for(QSet<QString>::iterator it = TagManager::getInstance().getTagsBegin() ; it != TagManager::getInstance().getTagsEnd(); ++it){ addTag->addItem((*it)); } addTagBtn = new QPushButton(this); addTagBtn->setIcon(QIcon("ajouter.png")); QObject::connect(addTagBtn, SIGNAL(clicked()), this, SLOT(addAssociatedTag())); QHBoxLayout* tagRowLayout = new QHBoxLayout; tagRowLayout->addWidget(tagsLabel); tagRowLayout->addWidget(tags); tagRowLayout->addWidget(deleteTagLabel); tagRowLayout->addWidget(deleteTag); tagRowLayout->addWidget(deleteTagBtn); tagRowLayout->addWidget(addTagLabel); tagRowLayout->addWidget(addTag); tagRowLayout->addWidget(addTagBtn); // title and save title = new QLineEdit; save = new QPushButton; save->setIcon(QIcon("sauvegarder.png")); title->setText(note->getTitle()); QObject::connect(title, SIGNAL(textChanged(QString)), this, SLOT(enableSave())); QObject::connect(title, SIGNAL(textChanged(QString)), this, SLOT(updateNote())); save->setEnabled(false); QObject::connect(save, SIGNAL(clicked()), this, SLOT(saveNote())); layout = new QVBoxLayout; QHBoxLayout* hLayout = new QHBoxLayout; hLayout->addWidget(title); hLayout->addWidget(save); layout->addLayout(tagRowLayout); layout->addLayout(hLayout); this->setLayout(layout); QObject::connect(&TagManager::getInstance(), SIGNAL(onTagAdd(QString)), this, SLOT(tagCreated(QString))); QObject::connect(&TagManager::getInstance(), SIGNAL(onTagDelete(QString)), this, SLOT(tagDeleted(QString))); }
void OCommand::_init( const uint32_t cmd, const uint32_t type ) { #ifndef COLLAGE_BIGENDIAN // big endian hosts swap handshake commands to little endian... LBASSERTINFO( cmd < CMD_NODE_MAXIMUM, std::hex << "0x" << cmd << std::dec ); #endif enableSave(); _enable(); *this << 0ull /* size */ << type << cmd; }
void editFieldForm::getCustomType() { addFieldTypeForm * addForm = new addFieldTypeForm( this, "addfieldtype", TRUE ); if (addForm->exec()) { //QString nospaces = addForm->typeNameEdit->text().remove(" "); QString nospaces = addForm->typeNameEdit->text(); setInitialValues(nameLineEdit->text(),nospaces ); enableSave(); } }
/** * \brief Insère une nouvelle ligne d'éditeur dans l'éditeur du document * \param row ligne d'éditeur * \param rowIndex index où la ligne doit être inséré dans la liste des lignes d'éditeurs * \param layoutIndex index où la ligne doit être inséré dans le layout des lignes d'éditeurs */ void DocumentEditor::insertRow(DocumentEditorRow *row, int rowIndex, int layoutIndex){ rows.insert(rowIndex, row); scrollLayout->insertWidget(layoutIndex, row); QObject::connect(row, SIGNAL(onMoveUp(DocumentEditorRow*)), this, SLOT(moveUp(DocumentEditorRow*))); QObject::connect(row, SIGNAL(onMoveDown(DocumentEditorRow*)), this, SLOT(moveDown(DocumentEditorRow*))); QObject::connect(row, SIGNAL(onEdit(DocumentEditorRow*)), this, SLOT(edit(DocumentEditorRow*))); QObject::connect(row, SIGNAL(onSupress(DocumentEditorRow*)), this, SLOT(supress(DocumentEditorRow*))); QObject::connect(row, SIGNAL(onAdd(DocumentEditorRow*)), this, SLOT(add(DocumentEditorRow*))); QObject::connect(row, SIGNAL(onCreate(DocumentEditorRow*)), this, SLOT(create(DocumentEditorRow*))); enableSave(); updateNote(); }
/** * \brief Descend une ligne d'éditeur d'un cran * \param row ligne d'éditeur */ void DocumentEditor::moveDown(DocumentEditorRow* row){ int list_index = rows.indexOf(row); int layout_index = scrollLayout->indexOf(row); if(list_index < rows.count() - 1){ rows.swap(list_index + 1, list_index); } if(layout_index < scrollLayout->count() -1){ // for tag row and title row scrollLayout->removeWidget(row); scrollLayout->insertWidget(layout_index + 1, row); } enableSave(); updateNote(); }
int editFieldForm::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: setInitialValues((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 1: confirmEdit(); break; case 2: enableSave(); break; case 3: getCustomType(); break; case 4: languageChange(); break; default: ; } _id -= 5; } return _id; }
PDFExportDialog::PDFExportDialog( QWidget* parent, const QString & docFileName, const QMap<QString, int > & DocFonts, ScribusView *currView, PDFOptions & pdfOptions, const QList<PDFPresentationData> & Eff, const ProfilesL & PDFXProfiles, const SCFonts &AllFonts, double unitRatio, const ProfilesL & printerProfiles) : QDialog( parent ), doc(currView->Doc), EffVal(Eff), Opts(pdfOptions), docUnitRatio(unitRatio), cmsDescriptorName(""), components(3), appPrinterProfiles(printerProfiles) { setModal(true); setWindowTitle( tr( "Save as PDF" ) ); setWindowIcon(loadIcon("AppIcon.png")); PDFExportLayout = new QVBoxLayout( this ); PDFExportLayout->setSpacing( 5 ); PDFExportLayout->setMargin( 10 ); Name = new QGroupBox( this ); Name->setTitle( tr( "O&utput to File:" ) ); NameLayout = new QGridLayout( Name ); NameLayout->setSpacing( 5 ); NameLayout->setMargin( 10 ); NameLayout->setAlignment( Qt::AlignTop ); fileNameLineEdit = new QLineEdit( Name ); fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) ); if (!Opts.fileName.isEmpty()) fileNameLineEdit->setText( QDir::toNativeSeparators(Opts.fileName) ); else { QFileInfo fi(docFileName); if (fi.exists()) { QString fileName(fi.path()+"/"+fi.baseName()+".pdf"); fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) ); } else { PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs"); QString pdfdir = dirs->get("pdf", fi.path()); if (pdfdir.right(1) != "/") pdfdir += "/"; QString fileName(pdfdir+fi.baseName()+".pdf"); fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) ); } } NameLayout->addWidget( fileNameLineEdit, 0, 0 ); FileC = new QToolButton( Name ); FileC->setText( tr( "Cha&nge..." ) ); FileC->setMinimumSize( QSize( 88, 24 ) ); NameLayout->addWidget( FileC, 0, 1 ); multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name ); multiFile->setChecked(Opts.doMultiFile); NameLayout->addWidget( multiFile, 1, 0 ); PDFExportLayout->addWidget( Name ); Options = new TabPDFOptions( this, pdfOptions, AllFonts, PDFXProfiles, DocFonts, Eff, currView->Doc->unitIndex(), currView->Doc->pageHeight, currView->Doc->pageWidth, currView->Doc, true ); PDFExportLayout->addWidget( Options ); Layout7 = new QHBoxLayout; Layout7->setSpacing( 5 ); Layout7->setMargin( 0 ); QSpacerItem* spacer_2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout7->addItem( spacer_2 ); OK = new QPushButton( tr( "&Save" ), this ); OK->setAutoDefault( true ); OK->setDefault( true ); Layout7->addWidget( OK ); Cancel = new QPushButton( CommonStrings::tr_Cancel, this ); Layout7->addWidget( Cancel ); PDFExportLayout->addLayout( Layout7 ); if ((Opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty())) OK->setEnabled(false); resize(sizeHint()); // setMaximumSize( sizeHint() ); //tooltips multiFile->setToolTip( "<qt>" + tr( "This enables exporting one individually named PDF file for each page in the document. Page numbers are added automatically. This is most useful for imposing PDF for commercial printing.") + "</qt>" ); OK->setToolTip( "<qt>" + tr( "The save button will be disabled if you are trying to export PDF/X-3 and the info string is missing from the PDF/X-3 tab.") + "</qt>" ); // signals and slots connections connect( FileC, SIGNAL( clicked() ), this, SLOT( ChangeFile() ) ); connect( OK, SIGNAL( clicked() ), this, SLOT( DoExport() ) ); connect( Cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( fileNameLineEdit, SIGNAL( editingFinished() ), this, SLOT( fileNameChanged() ) ); connect( Options, SIGNAL(noInfo()), this, SLOT(disableSave())); connect( Options, SIGNAL(hasInfo()), this, SLOT(enableSave())); }
PDFExportDialog::PDFExportDialog( QWidget* parent, const QString & docFileName, const QMap<QString, int > & DocFonts, ScribusView *currView, PDFOptions & pdfOptions, const ProfilesL & PDFXProfiles, const SCFonts &AllFonts, const ProfilesL & printerProfiles) : QDialog( parent ), m_doc(currView->Doc), m_opts(pdfOptions), m_unitRatio(currView->Doc->unitRatio()), m_cmsDescriptor(""), m_components(3), m_printerProfiles(printerProfiles) { setModal(true); setWindowTitle( tr( "Save as PDF" ) ); setWindowIcon(loadIcon("AppIcon.png")); PDFExportLayout = new QVBoxLayout( this ); PDFExportLayout->setSpacing( 5 ); PDFExportLayout->setMargin( 10 ); Name = new QGroupBox( this ); Name->setTitle( tr( "O&utput to File:" ) ); NameLayout = new QGridLayout( Name ); NameLayout->setSpacing( 5 ); NameLayout->setMargin( 10 ); NameLayout->setAlignment( Qt::AlignTop ); fileNameLineEdit = new QLineEdit( Name ); fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) ); if (!m_opts.fileName.isEmpty()) fileNameLineEdit->setText( QDir::toNativeSeparators(m_opts.fileName) ); else { QFileInfo fi(docFileName); QString completeBaseName = fi.completeBaseName(); if (completeBaseName.endsWith(".sla", Qt::CaseInsensitive)) if (completeBaseName.length() > 4) completeBaseName.chop(4); if (completeBaseName.endsWith(".gz", Qt::CaseInsensitive)) if (completeBaseName.length() > 3) completeBaseName.chop(3); if (fi.exists()) { QString fileName(fi.path() + "/" + completeBaseName + ".pdf"); fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) ); } else { PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs"); QString pdfdir = dirs->get("pdf", fi.path()); if (pdfdir.right(1) != "/") pdfdir += "/"; QString fileName(pdfdir + completeBaseName + ".pdf"); fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) ); } } NameLayout->addWidget( fileNameLineEdit, 0, 0 ); changeButton = new QPushButton( Name ); changeButton->setText( tr( "Cha&nge..." ) ); changeButton->setMinimumSize( QSize( 88, 24 ) ); NameLayout->addWidget( changeButton, 0, 1 ); multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name ); multiFile->setChecked(m_opts.doMultiFile); NameLayout->addWidget( multiFile, 1, 0 ); openAfterExportCheckBox = new QCheckBox( tr( "Open PDF after Export" ), Name ); openAfterExportCheckBox->setChecked(m_opts.openAfterExport); NameLayout->addWidget( openAfterExportCheckBox, 2, 0 ); PDFExportLayout->addWidget( Name ); Options = new TabPDFOptions( this, pdfOptions, AllFonts, PDFXProfiles, DocFonts, currView->Doc->unitIndex(), currView->Doc->pageHeight(), currView->Doc->pageWidth(), currView->Doc, true ); PDFExportLayout->addWidget( Options ); Layout7 = new QHBoxLayout; Layout7->setSpacing( 5 ); Layout7->setMargin( 0 ); QSpacerItem* spacer_2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout7->addItem( spacer_2 ); okButton = new QPushButton( tr( "&Save" ), this ); okButton->setAutoDefault( true ); okButton->setDefault( true ); Layout7->addWidget( okButton ); cancelButton = new QPushButton( CommonStrings::tr_Cancel, this ); Layout7->addWidget( cancelButton ); PDFExportLayout->addLayout( Layout7 ); if ((m_opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty())) okButton->setEnabled(false); resize(sizeHint()); // setMaximumSize( sizeHint() ); //tooltips multiFile->setToolTip( "<qt>" + tr( "This enables exporting one individually named PDF file for each page in the document. Page numbers are added automatically. This is most useful for imposing PDF for commercial printing.") + "</qt>" ); openAfterExportCheckBox->setToolTip( "<qt>" + tr( "Open the exported PDF with the PDF viewer as set in External Tools preferences, when not exporting to a multi-file export destination.") + "</qt>" ); okButton->setToolTip( "<qt>" + tr( "The save button will be disabled if you are trying to export PDF/X and the info string is missing from the PDF/X tab.") + "</qt>" ); // signals and slots connections connect( changeButton, SIGNAL( clicked() ), this, SLOT( ChangeFile() ) ); connect( okButton, SIGNAL( clicked() ), this, SLOT( DoExport() ) ); connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( fileNameLineEdit, SIGNAL( editingFinished() ), this, SLOT( fileNameChanged() ) ); connect( Options, SIGNAL(noInfo()), this, SLOT(disableSave())); connect( Options, SIGNAL(hasInfo()), this, SLOT(enableSave())); }
//-------------------------------------------------------------- ofxCameraMove::ofxCameraMove(){ active = false; enableSave(); }
RMainWnd::RMainWnd(reditor::REditor* edit) : QMainWindow(), medit(edit) { setWindowTitle(tr("Room Editor")); setWindowIcon(QIcon(":/resources/favicon.ico")); // central widget meditWnd = new REditWnd(medit->objects(), medit->camera(), this); setCentralWidget(meditWnd); // set corners for docks setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); // docks mloggerDock = new QDockWidget(this); mloggerDock->setWindowTitle(tr("Editor Log")); mlogger = new RLogger(mloggerDock); mloggerDock->setWidget(mlogger); addDockWidget(Qt::BottomDockWidgetArea, mloggerDock); // TODO attach dock window with objects on the scene // File menu QMenu* fileMenu = menuBar()->addMenu(tr("&File")); QAction* newAction = fileMenu->addAction(tr("&New Project"), this, SIGNAL(newProject()), QKeySequence::New); newAction->setIcon(QIcon(":/resources/new.png")); QAction* openAction = fileMenu->addAction(tr("&Open Project.."), this, SIGNAL(openProject()), QKeySequence::Open); openAction->setIcon(QIcon(":/resources/open.png")); fileMenu->addSeparator(); msaveAction = fileMenu->addAction(tr("&Save Project"), this, SIGNAL(saveProject()), QKeySequence::Save); msaveAction->setIcon(QIcon(":/resources/save.png")); msaveAsAction = fileMenu->addAction(tr("S&ave Project As..."), this, SIGNAL(saveProjectAs()), Qt::SHIFT + Qt::CTRL + Qt::Key_S); msaveAsAction->setIcon(QIcon(":/resources/saveAs.png")); enableSave(false); // activate after user makes some changes, no sense to save empty project fileMenu->addSeparator(); fileMenu->addAction(tr("&Exit.."), this, SLOT(close()), QKeySequence::Quit); // Help menu QMenu* helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(tr("&About RoomEdit"), this, SIGNAL(helpAbout())); // File toolbar QToolBar* fileToolBar = addToolBar(tr("File")); fileToolBar->addAction(newAction); fileToolBar->addAction(openAction); fileToolBar->addSeparator(); fileToolBar->addAction(msaveAction); fileToolBar->addAction(msaveAsAction); // Camera view toolbar QToolBar* cameraToolBar = addToolBar(tr("Camera")); mcameraGroup = new QButtonGroup(cameraToolBar); QPushButton * cam1 = new QPushButton(QString("1"), this); QPushButton * cam2 = new QPushButton(QString("2"), this); QPushButton * cam3 = new QPushButton(QString("3"), this); cam1->setCheckable(true); cam2->setCheckable(true); cam3->setCheckable(true); cam1->setChecked(true); mcameraGroup->addButton(cam1, 1); mcameraGroup->addButton(cam2, 2); mcameraGroup->addButton(cam3, 3); mcameraGroup->setExclusive(true); connect(mcameraGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(switchCamera(int))); cameraToolBar->addWidget(cam1); cameraToolBar->addWidget(cam2); cameraToolBar->addWidget(cam3); }