void Document::setModified( bool modified ) { if ( b_modified == modified ) return; b_modified = modified; if (!m_bDeleted) emit modifiedStateChanged(); }
void ItemDocument::fileSaveAs() { if (!getURL(m_fileExtensionInfo)) return; writeFile(); // Our modified state may not have changed, but we emit this to force the // main window to update our caption. emit modifiedStateChanged(); }
void DocManager::handleNewDocument( Document *document, ViewArea *viewArea ) { if ( !document || m_documentList.contains(document) ) return; m_documentList.append(document); document->setDCOPID(m_nextDocumentID++); connect( document, SIGNAL(modifiedStateChanged()), KTechlab::self(), SLOT(slotDocModifiedChanged()) ); connect( document, SIGNAL(fileNameChanged(const KURL&)), KTechlab::self(), SLOT(slotDocModifiedChanged()) ); connect( document, SIGNAL(fileNameChanged(const KURL&)), KTechlab::self(), SLOT(addRecentFile(const KURL&)) ); connect( document, SIGNAL(destroyed(QObject* )), this, SLOT(documentDestroyed(QObject* )) ); connect( document, SIGNAL(viewFocused(View* )), this, SLOT(slotViewFocused(View* )) ); connect( document, SIGNAL(viewUnfocused()), this, SLOT(slotViewUnfocused()) ); createNewView( document, viewArea ); }
//BEGIN class ViewStatusBar ViewStatusBar::ViewStatusBar( View *view ) : KStatusBar(view) { p_view = view; m_modifiedLabel = new QLabel(this); addWidget( m_modifiedLabel, 0, false ); m_fileNameLabel = new KSqueezedTextLabel(this); addWidget( m_fileNameLabel, 1, false ); m_modifiedPixmap = KIconLoader::global()->loadIcon( "filesave", KIconLoader::Small ); m_unmodifiedPixmap = KIconLoader::global()->loadIcon( "null", KIconLoader::Small ); connect( view->document(), SIGNAL(modifiedStateChanged()), this, SLOT(slotModifiedStateChanged()) ); connect( view->document(), SIGNAL(fileNameChanged(const KUrl& )), this, SLOT(slotFileNameChanged(const KUrl& )) ); connect( view, SIGNAL(focused(View* )), this, SLOT(slotViewFocused(View* )) ); connect( view, SIGNAL(unfocused()), this, SLOT(slotViewUnfocused()) ); slotModifiedStateChanged(); slotFileNameChanged( view->document()->url() ); slotViewUnfocused(); }