author | llornkcor <llornkcor> | 2002-11-29 00:54:12 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-29 00:54:12 (UTC) |
commit | 70c8fe38d9d65b75912c8b473c3940d2160cdde6 (patch) (side-by-side diff) | |
tree | 8e307e814fa5960007f21afc27ad5da4a9493454 | |
parent | 54b1bd8e8eaf5764b465f169d4ee1b9261659a11 (diff) | |
download | opie-70c8fe38d9d65b75912c8b473c3940d2160cdde6.zip opie-70c8fe38d9d65b75912c8b473c3940d2160cdde6.tar.gz opie-70c8fe38d9d65b75912c8b473c3940d2160cdde6.tar.bz2 |
removed open with fileselector, cause I hate it. Fixes opening through docs tab, and other annoyances
-rw-r--r-- | core/apps/textedit/textedit.cpp | 39 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 1 |
2 files changed, 28 insertions, 12 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index e978fa4..b199c81 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -244,5 +244,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) doc = 0; edited=false; - edited1=false; + fromSetDocument=false; + setToolBarsMovable( false ); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); @@ -270,5 +271,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); - a->addTo( bar ); +// a->addTo( bar ); a->addTo( file ); @@ -281,4 +282,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); file->insertSeparator(); + a->addTo( bar ); a->addTo( file ); @@ -340,4 +342,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) nStart->setToggleAction(true); nStart->addTo( advancedMenu ); + nStart->setEnabled(false); nAdvanced = new QAction( tr("Prompt on Exit"), QString::null, 0, this, 0 ); @@ -437,5 +440,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) if( qApp->argc() > 1) { currentFileName=qApp->argv()[1]; -// qDebug("<<<<<<<<<<<<<<<<<<<<<<<< "+currentFileName+" %d",qApp->argc()); + QFileInfo fi(currentFileName); @@ -446,14 +449,17 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) } } else { -// qDebug("Do other thing"); - if(startWithNew) { + edited1=false; + +// if(startWithNew ) { openDotFile(""); // fileNew(); - } else { - fileOpen(); - } +// } +// else { +// fileOpen(); +// } } viewSelection = cfg.readNumEntry( "FileView", 0 ); +// setCaption(tr("Text Editor")); } @@ -827,4 +833,6 @@ bool TextEdit::save() { prompted save */ bool TextEdit::saveAs() { + if(caption() == tr("Text Editor")) + return false; qDebug("saveAsFile " + currentFileName); // case of nothing to save... @@ -975,5 +983,5 @@ void TextEdit::setDocument(const QString& fileref) { edited1=false; edited=true; - + // fromSetDocument=false; // doSearchBar(); } @@ -998,5 +1006,9 @@ void TextEdit::changeFont() { void TextEdit::editDelete() { - switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want<BR>to <B>delete</B> the current file\nfrom the disk?<BR>This is <B>irreversable!!</B>"),tr("Yes"),tr("No"),0,0,1) ) { + switch ( QMessageBox::warning(this,tr("Text Editor"), + tr("Do you really want<BR>to <B>delete</B> " + "the current file\nfrom the disk?<BR>This is " + "<B>irreversable!!</B>"), + tr("Yes"),tr("No"),0,0,1) ) { case 0: if(doc) { @@ -1021,5 +1033,6 @@ void TextEdit::changeStartConfig( bool b ) { void TextEdit::editorChanged() { - if(editor->edited() && edited && !edited1) { +// qDebug("editor changed"); + if( /*editor->edited() &&*/ /*edited && */!edited1) { setCaption( "*"+caption()); edited1=true; @@ -1028,11 +1041,13 @@ void TextEdit::editorChanged() { } -void TextEdit::receive(const QCString&msg, const QByteArray&) { +void TextEdit::receive(const QCString&msg, const QByteArray &data) { qDebug("QCop "+msg); if ( msg == "setDocument(QString)" ) { qDebug("bugger all"); + } } + void TextEdit::doAbout() { QMessageBox::about(0,tr("Text Edit"),tr("Text Edit is copyright<BR>" diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index bb7d693..9f16ebf 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h @@ -117,4 +117,5 @@ private: // fileSaver *fileSaveDlg; // fileBrowser *browseForFiles; + bool fromSetDocument; QpeEditor* editor; QToolBar *menu, *editBar, *searchBar; |