[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdegraphics/kpdf/kpdf
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2004-09-18 16:41:24
Message-ID: 20040918164124.51CAB126CA () office ! kde ! org
[Download RAW message or body]
CVS commit by aacid:
Give a warning when the opened file does not exist
Remove the recent file if the user opens it and it does not exists
M +11 -0 kpdf_part.cpp 1.82
M +2 -0 kpdf_part.h 1.37
M +5 -4 kpdf_shell.cpp 1.35
M +1 -1 kpdf_shell.h 1.15
--- kdegraphics/kpdf/kpdf/kpdf_part.cpp #1.81:1.82
@@ -415,4 +415,15 @@ Part::openFile()
}
+bool Part::openURL(const KURL &url)
+{
+ bool b;
+ b = KParts::ReadOnlyPart::openURL(url);
+ if (!b)
+ {
+ KMessageBox::error(widget(), i18n("Could not open %1").arg(url.prettyURL()));
+ }
+ return b;
+}
+
void
Part::fileSaveAs()
--- kdegraphics/kpdf/kpdf/kpdf_part.h #1.36:1.37
@@ -92,4 +92,6 @@ namespace KPDF
virtual bool openFile();
+ virtual bool openURL(const KURL &url);
+
void update();
void readSettings();
--- kdegraphics/kpdf/kpdf/kpdf_shell.cpp #1.34:1.35
@@ -93,5 +93,6 @@ Shell::~Shell()
void Shell::openURL( const KURL & url )
{
- if ( m_part && m_part->openURL( url ) ) recent->addURL (url);
+ if ( m_part && m_part->openURL( url ) ) m_recent->addURL (url);
+ else m_recent->removeURL(url);
}
@@ -99,5 +100,5 @@ void Shell::openURL( const KURL & url )
void Shell::readSettings()
{
- recent->loadEntries( KGlobal::config() );
+ m_recent->loadEntries( KGlobal::config() );
KGlobal::config()->setDesktopGroup();
bool fullScreen = KGlobal::config()->readBoolEntry( "FullScreen", false );
@@ -108,5 +109,5 @@ void Shell::writeSettings()
{
saveMainWindowSettings(KGlobal::config(), "MainWindow");
- recent->saveEntries( KGlobal::config() );
+ m_recent->saveEntries( KGlobal::config() );
KGlobal::config()->setDesktopGroup();
KGlobal::config()->writeEntry( "FullScreen", m_fullScreenAction->isChecked());
@@ -118,5 +119,5 @@ Shell::setupActions()
{
KStdAction::open(this, SLOT(fileOpen()), actionCollection());
- recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ),
+ m_recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ),
actionCollection() );
KStdAction::print(m_part, SLOT(print()), actionCollection());
--- kdegraphics/kpdf/kpdf/kpdf_shell.h #1.14:1.15
@@ -86,5 +86,5 @@ namespace KPDF
private:
KParts::ReadOnlyPart* m_part;
- KRecentFilesAction* recent;
+ KRecentFilesAction* m_recent;
KToggleAction* m_fullScreenAction;
bool m_isFullScreen;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic