Beispiel #1
0
void Document::setModified( bool modified )
{
	if ( b_modified == modified ) return;
	
	b_modified = modified;
	
	if (!m_bDeleted) emit modifiedStateChanged();
}
Beispiel #2
0
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();
}
Beispiel #3
0
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 );
}
Beispiel #4
0
//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();
}