bool SpriteDocument::loadFile() { SpriteEditorFrame* sef = qobject_cast<SpriteEditorFrame*>(m_widget); if (!filePath().isEmpty()) { try { Athena::io::SpriteFileReader reader(filePath().toStdString()); m_spriteContainer = reader.readFile(); connect(sef, SIGNAL(modified()), this, SLOT(onModified())); sef->setSpriteContainer(m_spriteContainer); } catch(...) { return false; } } else { m_spriteContainer = new Athena::Sakura::SpriteFile; if (!m_spriteContainer) return false; } return true; }
void OktetaPart::onDocumentLoaded( Kasten2::AbstractDocument* document ) { if( document ) { delete mByteArrayView; delete mDocument; mDocument = static_cast<Kasten2::ByteArrayDocument*>( document ); mDocument->setReadOnly( mModus != ReadWriteModus ); connect( mDocument->synchronizer(), SIGNAL(localSyncStateChanged(Kasten2::LocalSyncState)), SLOT(onModified(Kasten2::LocalSyncState)) ); mByteArrayView = new Kasten2::ByteArrayView( mDocument ); // mByteArrayView->setNoOfBytesPerLine( 16 ); mByteArrayView->setShowsNonprinting( false ); connect( mByteArrayView, SIGNAL(hasSelectedDataChanged(bool)), SIGNAL(hasSelectedDataChanged(bool)) ); QWidget* displayWidget = mByteArrayView->widget(); mLayout->addWidget( displayWidget ); mLayout->parentWidget()->setFocusProxy( displayWidget ); foreach( Kasten2::AbstractXmlGuiController* controller, mControllers ) controller->setTargetModel( mByteArrayView ); setModified( false ); } }
void FolderMonitor::_update() { { Lock lock(m->mainMutex); std::swap(m->fileActions, m->activeFileActions); } for(auto& action : m->activeFileActions) { switch (action->type) { case FileActionType::Added: if (!onAdded.empty()) onAdded(Path(action->newName)); break; case FileActionType::Removed: if (!onRemoved.empty()) onRemoved(Path(action->newName)); break; case FileActionType::Modified: if (!onModified.empty()) onModified(Path(action->newName)); break; case FileActionType::Renamed: if (!onRenamed.empty()) onRenamed(Path(action->oldName), Path(action->newName)); break; } FileAction::destroy(action); } m->activeFileActions.clear(); }
//---------------------------------------------- DesignNetDocument::DesignNetDocument(DesignNetEditor *parent) : IDocument(parent), d(new DesignNetDocumentPrivate()) { d->editor = parent; d->suffexType = DesignNet::Constants::NETEDITOR_FILETYPE; d->bModified = false; d->space = new DesignNetSpace(0, this); connect(d->space, SIGNAL(modified()), this, SLOT(onModified())); }
BrowserCtrl::BrowserCtrl( QtTreePropertyBrowser *browser ) : QObject( browser ) { m_pvt = new BrowserCtrlPvt(); m_pvt->setBrowser( browser ); connect( m_pvt, SIGNAL( arrayResized( const QString&, int ) ), this, SLOT( onArrayResized( const QString&, int ) ) ); connect( m_pvt, SIGNAL( modified() ), this, SLOT( onModified() ) ); connect( m_pvt, SIGNAL( valueChanged( const QString&, const QString& ) ), this, SLOT( onValueChanged( const QString&, const QString& ) ) ); connect( m_pvt, SIGNAL( vstructChanged( const QString& ) ), this, SLOT( onVStructChanged( const QString& ) ) ); }
NotifyKindsWidget::NotifyKindsWidget(INotifications *ANotifications, const QString &ATypeId, const QString &ATitle, ushort AKindMask, ushort AKindDefs, QWidget *AParent) : QWidget(AParent) { ui.setupUi(this); ui.lblTitle->setText(ATitle); ui.lblTest->setVisible(false); FNotifications = ANotifications; FTypeId = ATypeId; FKindMask = AKindMask; FKindDefs = AKindDefs; ui.chbPopup->setEnabled(AKindMask & INotification::PopupWindow); ui.chbSound->setEnabled(AKindMask & INotification::SoundPlay); connect(this, SIGNAL(modified()), SLOT(onModified())); connect(this, SIGNAL(childReset()), SLOT(onModified())); connect(ui.chbPopup,SIGNAL(stateChanged(int)),SIGNAL(modified())); connect(ui.chbSound,SIGNAL(stateChanged(int)),SIGNAL(modified())); connect(ui.lblTest,SIGNAL(linkActivated(const QString &)),SLOT(onTestLinkActivated(const QString &))); connect(ui.pbtTest, SIGNAL(clicked()), SLOT(onTestButtonClicked())); reset(); }
void SettingsWidget::addAnswer(const QString &text) { AnswerLine *line = new AnswerLine(text, ui->answersList); connect(line, SIGNAL(modified()), SLOT(onModified())); }