• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
knewmenu.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 David Faure <faure@kde.org>
3  2003 Sven Leiber <s.leiber@web.de>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include <tqdir.h>
21 
22 #include <kdebug.h>
23 #include <kdesktopfile.h>
24 #include <kdirwatch.h>
25 #include <kinstance.h>
26 #include <kinputdialog.h>
27 #include <tdelocale.h>
28 #include <tdemessagebox.h>
29 #include <tdestandarddirs.h>
30 #include <kprotocolinfo.h>
31 #include <tdepopupmenu.h>
32 #include <krun.h>
33 
34 #include <tdeio/job.h>
35 #include <tdeio/renamedlg.h>
36 
37 #include <kpropertiesdialog.h>
38 #include "konq_operations.h"
39 #include "konq_undo.h"
40 #include "knewmenu.h"
41 #include <utime.h>
42 
43 // For KURLDesktopFileDlg
44 #include <tqlayout.h>
45 #include <tqhbox.h>
46 #include <klineedit.h>
47 #include <kurlrequester.h>
48 #include <tqlabel.h>
49 #include <tqpopupmenu.h>
50 
51 TQValueList<KNewMenu::Entry> * KNewMenu::s_templatesList = 0L;
52 int KNewMenu::s_templatesVersion = 0;
53 bool KNewMenu::s_filesParsed = false;
54 KDirWatch * KNewMenu::s_pDirWatch = 0L;
55 
56 class KNewMenu::KNewMenuPrivate
57 {
58 public:
59  KNewMenuPrivate() : m_parentWidget(0) {}
60  TDEActionCollection * m_actionCollection;
61  TQString m_destPath;
62  TQWidget *m_parentWidget;
63  TDEActionMenu *m_menuDev;
64 };
65 
66 KNewMenu::KNewMenu( TDEActionCollection * _collec, const char *name ) :
67  TDEActionMenu( i18n( "Create New" ), "document-new", _collec, name ),
68  menuItemsVersion( 0 )
69 {
70  //kdDebug(1203) << "KNewMenu::KNewMenu " << this << endl;
71  // Don't fill the menu yet
72  // We'll do that in slotCheckUpToDate (should be connected to abouttoshow)
73  d = new KNewMenuPrivate;
74  d->m_actionCollection = _collec;
75  makeMenus();
76 }
77 
78 KNewMenu::KNewMenu( TDEActionCollection * _collec, TQWidget *parentWidget, const char *name ) :
79  TDEActionMenu( i18n( "Create New" ), "document-new", _collec, name ),
80  menuItemsVersion( 0 )
81 {
82  d = new KNewMenuPrivate;
83  d->m_actionCollection = _collec;
84  d->m_parentWidget = parentWidget;
85  makeMenus();
86 }
87 
88 KNewMenu::~KNewMenu()
89 {
90  //kdDebug(1203) << "KNewMenu::~KNewMenu " << this << endl;
91  delete d;
92 }
93 
94 void KNewMenu::makeMenus()
95 {
96  d->m_menuDev = new TDEActionMenu( i18n( "Link to Device" ), "kcmdevices", d->m_actionCollection, "devnew" );
97 }
98 
99 void KNewMenu::slotCheckUpToDate( )
100 {
101  //kdDebug(1203) << "KNewMenu::slotCheckUpToDate() " << this
102  // << " : menuItemsVersion=" << menuItemsVersion
103  // << " s_templatesVersion=" << s_templatesVersion << endl;
104  if (menuItemsVersion < s_templatesVersion || s_templatesVersion == 0)
105  {
106  //kdDebug(1203) << "KNewMenu::slotCheckUpToDate() : recreating actions" << endl;
107  // We need to clean up the action collection
108  // We look for our actions using the group
109  TQValueList<TDEAction*> actions = d->m_actionCollection->actions( "KNewMenu" );
110  for( TQValueListIterator<TDEAction*> it = actions.begin(); it != actions.end(); ++it )
111  {
112  remove( *it );
113  d->m_actionCollection->remove( *it );
114  }
115 
116  if (!s_templatesList) { // No templates list up to now
117  s_templatesList = new TQValueList<Entry>();
118  slotFillTemplates();
119  parseFiles();
120  }
121 
122  // This might have been already done for other popupmenus,
123  // that's the point in s_filesParsed.
124  if ( !s_filesParsed )
125  parseFiles();
126 
127  fillMenu();
128 
129  menuItemsVersion = s_templatesVersion;
130  }
131 }
132 
133 void KNewMenu::parseFiles()
134 {
135  //kdDebug(1203) << "KNewMenu::parseFiles()" << endl;
136  s_filesParsed = true;
137  TQValueList<Entry>::Iterator templ = s_templatesList->begin();
138  for ( /*++templ*/; templ != s_templatesList->end(); ++templ)
139  {
140  TQString iconname;
141  TQString filePath = (*templ).filePath;
142  if ( !filePath.isEmpty() )
143  {
144  TQString text;
145  TQString templatePath;
146  // If a desktop file, then read the name from it.
147  // Otherwise (or if no name in it?) use file name
148  if ( KDesktopFile::isDesktopFile( filePath ) ) {
149  KSimpleConfig config( filePath, true );
150  config.setDesktopGroup();
151  text = config.readEntry("Name");
152  (*templ).icon = config.readEntry("Icon");
153  (*templ).comment = config.readEntry("Comment");
154  TQString type = config.readEntry( "Type" );
155  if ( type == "Link" )
156  {
157  templatePath = config.readPathEntry("URL");
158  if ( templatePath[0] != '/' )
159  {
160  if ( templatePath.startsWith("file:/") )
161  templatePath = KURL(templatePath).path();
162  else
163  {
164  // A relative path, then (that's the default in the files we ship)
165  TQString linkDir = filePath.left( filePath.findRev( '/' ) + 1 /*keep / */ );
166  //kdDebug(1203) << "linkDir=" << linkDir << endl;
167  templatePath = linkDir + templatePath;
168  }
169  }
170  }
171  if ( templatePath.isEmpty() )
172  {
173  // No dest, this is an old-style template
174  (*templ).entryType = TEMPLATE;
175  (*templ).templatePath = (*templ).filePath; // we'll copy the file
176  } else {
177  (*templ).entryType = LINKTOTEMPLATE;
178  (*templ).templatePath = templatePath;
179  }
180 
181  }
182  if (text.isEmpty())
183  {
184  text = KURL(filePath).fileName();
185  if ( text.endsWith(".desktop") )
186  text.truncate( text.length() - 8 );
187  else if ( text.endsWith(".kdelnk") )
188  text.truncate( text.length() - 7 );
189  }
190  (*templ).text = text;
191  /*kdDebug(1203) << "Updating entry with text=" << text
192  << " entryType=" << (*templ).entryType
193  << " templatePath=" << (*templ).templatePath << endl;*/
194  }
195  else {
196  (*templ).entryType = SEPARATOR;
197  }
198  }
199 }
200 
201 void KNewMenu::fillMenu()
202 {
203  //kdDebug(1203) << "KNewMenu::fillMenu()" << endl;
204  popupMenu()->clear();
205  d->m_menuDev->popupMenu()->clear();
206 
207  TDEAction *linkURL = 0, *linkApp = 0; // these shall be put at special positions
208 
209  int i = 1; // was 2 when there was Folder
210  TQValueList<Entry>::Iterator templ = s_templatesList->begin();
211  for ( ; templ != s_templatesList->end(); ++templ, ++i)
212  {
213  if ( (*templ).entryType != SEPARATOR )
214  {
215  // There might be a .desktop for that one already, if it's a kdelnk
216  // This assumes we read .desktop files before .kdelnk files ...
217 
218  // In fact, we skip any second item that has the same text as another one.
219  // Duplicates in a menu look bad in any case.
220 
221  bool bSkip = false;
222 
223  TQValueList<TDEAction*> actions = d->m_actionCollection->actions();
224  TQValueListIterator<TDEAction*> it = actions.begin();
225  for( ; it != actions.end() && !bSkip; ++it )
226  {
227  if ( (*it)->text() == (*templ).text )
228  {
229  kdDebug(1203) << "KNewMenu: skipping " << (*templ).filePath << endl;
230  bSkip = true;
231  }
232  }
233 
234  if ( !bSkip )
235  {
236  Entry entry = *(s_templatesList->at( i-1 ));
237 
238  // The best way to identify the "Create Directory", "Link to Location", "Link to Application" was the template
239  if ( (*templ).templatePath.endsWith( "emptydir" ) )
240  {
241  TDEAction * act = new TDEAction( (*templ).text, (*templ).icon, 0, this, TQ_SLOT( slotNewDir() ),
242  d->m_actionCollection, TQCString().sprintf("newmenu%d", i ) );
243  act->setGroup( "KNewMenu" );
244  act->plug( popupMenu() );
245 
246  TDEActionSeparator *sep = new TDEActionSeparator();
247  sep->plug( popupMenu() );
248  }
249  else
250  {
251  TDEAction * act = new TDEAction( (*templ).text, (*templ).icon, 0, this, TQ_SLOT( slotNewFile() ),
252  d->m_actionCollection, TQCString().sprintf("newmenu%d", i ) );
253  act->setGroup( "KNewMenu" );
254 
255  if ( (*templ).templatePath.endsWith( "URL.desktop" ) )
256  {
257  linkURL = act;
258  }
259  else if ( (*templ).templatePath.endsWith( "Program.desktop" ) )
260  {
261  linkApp = act;
262  }
263  else if ( KDesktopFile::isDesktopFile( entry.templatePath ) )
264  {
265  KDesktopFile df( entry.templatePath );
266  if(df.readType() == "FSDevice")
267  act->plug( d->m_menuDev->popupMenu() );
268  else
269  act->plug( popupMenu() );
270  }
271  else
272  {
273  act->plug( popupMenu() );
274  }
275  }
276  }
277  } else { // Separate system from personal templates
278  Q_ASSERT( (*templ).entryType != 0 );
279 
280  TDEActionSeparator * act = new TDEActionSeparator();
281  act->plug( popupMenu() );
282  }
283  }
284 
285  TDEActionSeparator * act = new TDEActionSeparator();
286  act->plug( popupMenu() );
287  if ( linkURL ) linkURL->plug( popupMenu() );
288  if ( linkApp ) linkApp->plug( popupMenu() );
289  d->m_menuDev->plug( popupMenu() );
290 }
291 
292 void KNewMenu::slotFillTemplates()
293 {
294  //kdDebug(1203) << "KNewMenu::slotFillTemplates()" << endl;
295  // Ensure any changes in the templates dir will call this
296  if ( ! s_pDirWatch )
297  {
298  s_pDirWatch = new KDirWatch;
299  TQStringList dirs = d->m_actionCollection->instance()->dirs()->resourceDirs("templates");
300  for ( TQStringList::Iterator it = dirs.begin() ; it != dirs.end() ; ++it )
301  {
302  //kdDebug(1203) << "Templates resource dir: " << *it << endl;
303  s_pDirWatch->addDir( *it );
304  }
305  connect ( s_pDirWatch, TQ_SIGNAL( dirty( const TQString & ) ),
306  this, TQ_SLOT ( slotFillTemplates() ) );
307  connect ( s_pDirWatch, TQ_SIGNAL( created( const TQString & ) ),
308  this, TQ_SLOT ( slotFillTemplates() ) );
309  connect ( s_pDirWatch, TQ_SIGNAL( deleted( const TQString & ) ),
310  this, TQ_SLOT ( slotFillTemplates() ) );
311  // Ok, this doesn't cope with new dirs in TDEDIRS, but that's another story
312  }
313  s_templatesVersion++;
314  s_filesParsed = false;
315 
316  s_templatesList->clear();
317 
318  // Look into "templates" dirs.
319  TQStringList files = d->m_actionCollection->instance()->dirs()->findAllResources("templates");
320  KSortableValueList<Entry,TQString> slist;
321  for ( TQStringList::Iterator it = files.begin() ; it != files.end() ; ++it )
322  {
323  //kdDebug(1203) << *it << endl;
324  if ( (*it)[0] != '.' )
325  {
326  Entry e;
327  e.filePath = *it;
328  e.entryType = 0; // not parsed yet
329  // put Directory etc. with special order (see fillMenu()) first in the list (a bit hacky)
330  if ( (*it).endsWith( "Directory.desktop" ) ||
331  (*it).endsWith( "linkProgram.desktop" ) ||
332  (*it).endsWith( "linkURL.desktop" ) )
333  s_templatesList->prepend( e );
334  else
335  {
336  KSimpleConfig config( *it, true );
337  config.setDesktopGroup();
338 
339  // tricky solution to ensure that TextFile is at the beginning
340  // because this filetype is the most used (according kde-core discussion)
341  TQString key = config.readEntry("Name");
342  if ( (*it).endsWith( "TextFile.desktop" ) )
343  key = "1_" + key;
344  else
345  key = "2_" + key;
346 
347  slist.insert( key, e );
348  }
349  }
350  }
351  slist.sort();
352  for(KSortableValueList<Entry, TQString>::ConstIterator it = slist.begin(); it != slist.end(); ++it)
353  {
354  s_templatesList->append( (*it).value() );
355  }
356 
357 }
358 
359 void KNewMenu::slotNewDir()
360 {
361  emit activated(); // for KDIconView::slotNewMenuActivated()
362 
363  if (popupFiles.isEmpty())
364  return;
365 
366  KonqOperations::newDir(d->m_parentWidget, popupFiles.first());
367 }
368 
369 void KNewMenu::slotNewFile()
370 {
371  int id = TQString( sender()->name() + 7 ).toInt(); // skip "newmenu"
372  if (id == 0)
373  {
374  // run the command for the templates
375  KRun::runCommand(TQString(sender()->name()));
376  return;
377  }
378 
379  emit activated(); // for KDIconView::slotNewMenuActivated()
380 
381  Entry entry = *(s_templatesList->at( id - 1 ));
382  //kdDebug(1203) << TQString("sFile = %1").arg(sFile) << endl;
383 
384  if ( !TQFile::exists( entry.templatePath ) ) {
385  kdWarning(1203) << entry.templatePath << " doesn't exist" << endl;
386  KMessageBox::sorry( 0L, i18n("<qt>The template file <b>%1</b> does not exist.</qt>").arg(entry.templatePath));
387  return;
388  }
389  m_isURLDesktopFile = false;
390  TQString name;
391  if ( KDesktopFile::isDesktopFile( entry.templatePath ) )
392  {
393  KDesktopFile df( entry.templatePath );
394  //kdDebug(1203) << df.readType() << endl;
395  if ( df.readType() == "Link" )
396  {
397  m_isURLDesktopFile = true;
398  // entry.comment contains i18n("Enter link to location (URL):"). JFYI :)
399  KURLDesktopFileDlg dlg( i18n("File name:"), entry.comment, d->m_parentWidget );
400  // TODO dlg.setCaption( i18n( ... ) );
401  if ( dlg.exec() )
402  {
403  name = dlg.fileName();
404  m_linkURL = dlg.url();
405  if ( name.isEmpty() || m_linkURL.isEmpty() )
406  return;
407  if ( !name.endsWith( ".desktop" ) )
408  name += ".desktop";
409  }
410  else
411  return;
412  }
413  else // any other desktop file (Device, App, etc.)
414  {
415  KURL::List::Iterator it = popupFiles.begin();
416  for ( ; it != popupFiles.end(); ++it )
417  {
418  //kdDebug(1203) << "first arg=" << entry.templatePath << endl;
419  //kdDebug(1203) << "second arg=" << (*it).url() << endl;
420  //kdDebug(1203) << "third arg=" << entry.text << endl;
421  TQString text = entry.text;
422  text.replace( "...", TQString() ); // the ... is fine for the menu item but not for the default filename
423 
424  KURL defaultFile( *it );
425  defaultFile.addPath( TDEIO::encodeFileName( text ) );
426  if ( defaultFile.isLocalFile() && TQFile::exists( defaultFile.path() ) )
427  text = TDEIO::RenameDlg::suggestName( *it, text);
428 
429  KURL templateURL;
430  templateURL.setPath( entry.templatePath );
431  (void) new KPropertiesDialog( templateURL, *it, text, d->m_parentWidget );
432  }
433  return; // done, exit.
434  }
435  }
436  else
437  {
438  // The template is not a desktop file
439  // Show the small dialog for getting the destination filename
440  bool ok;
441  TQString text = entry.text;
442  text.replace( "...", TQString() ); // the ... is fine for the menu item but not for the default filename
443 
444  KURL defaultFile( *(popupFiles.begin()) );
445  defaultFile.addPath( TDEIO::encodeFileName( text ) );
446  if ( defaultFile.isLocalFile() && TQFile::exists( defaultFile.path() ) )
447  text = TDEIO::RenameDlg::suggestName( *(popupFiles.begin()), text);
448 
449  name = KInputDialog::getText( TQString::null, entry.comment,
450  text, &ok, d->m_parentWidget );
451  if ( !ok )
452  return;
453  }
454 
455  // The template is not a desktop file [or it's a URL one]
456  // Copy it.
457  KURL::List::Iterator it = popupFiles.begin();
458 
459  TQString src = entry.templatePath;
460  for ( ; it != popupFiles.end(); ++it )
461  {
462  KURL dest( *it );
463  dest.addPath( TDEIO::encodeFileName(name) ); // Chosen destination file name
464  d->m_destPath = dest.path(); // will only be used if m_isURLDesktopFile and dest is local
465 
466  KURL uSrc;
467  uSrc.setPath( src );
468  //kdDebug(1203) << "KNewMenu : TDEIO::copyAs( " << uSrc.url() << ", " << dest.url() << ")" << endl;
469  TDEIO::CopyJob * job = TDEIO::copyAs( uSrc, dest );
470  job->setDefaultPermissions( true );
471  connect( job, TQ_SIGNAL( result( TDEIO::Job * ) ),
472  TQ_SLOT( slotResult( TDEIO::Job * ) ) );
473  if ( m_isURLDesktopFile )
474  connect( job, TQ_SIGNAL( renamed( TDEIO::Job *, const KURL&, const KURL& ) ),
475  TQ_SLOT( slotRenamed( TDEIO::Job *, const KURL&, const KURL& ) ) );
476  KURL::List lst;
477  lst.append( uSrc );
478  (void)new KonqCommandRecorder( KonqCommand::COPY, lst, dest, job );
479  }
480 }
481 
482 // Special case (filename conflict when creating a link=url file)
483 // We need to update m_destURL
484 void KNewMenu::slotRenamed( TDEIO::Job *, const KURL& from , const KURL& to )
485 {
486  if ( from.isLocalFile() )
487  {
488  kdDebug() << k_funcinfo << from.prettyURL() << " -> " << to.prettyURL() << " ( m_destPath=" << d->m_destPath << ")" << endl;
489  Q_ASSERT( from.path() == d->m_destPath );
490  d->m_destPath = to.path();
491  }
492 }
493 
494 void KNewMenu::slotResult( TDEIO::Job * job )
495 {
496  if (job->error())
497  job->showErrorDialog();
498  else
499  {
500  KURL destURL = static_cast<TDEIO::CopyJob*>(job)->destURL();
501  if ( destURL.isLocalFile() )
502  {
503  if ( m_isURLDesktopFile )
504  {
505  // destURL is the original destination for the new file.
506  // But in case of a renaming (due to a conflict), the real path is in m_destPath
507  kdDebug(1203) << " destURL=" << destURL.path() << " " << " d->m_destPath=" << d->m_destPath << endl;
508  KDesktopFile df( d->m_destPath );
509  df.writeEntry( "Icon", KProtocolInfo::icon( KURL(m_linkURL).protocol() ) );
510  df.writePathEntry( "URL", m_linkURL );
511  df.sync();
512  }
513  else
514  {
515  // Normal (local) file. Need to "touch" it, tdeio_file copied the mtime.
516  (void) ::utime( TQFile::encodeName( destURL.path() ), 0 );
517  }
518  }
519  }
520 }
521 
523 
524 KURLDesktopFileDlg::KURLDesktopFileDlg( const TQString& textFileName, const TQString& textUrl )
525  : KDialogBase( Plain, TQString::null, Ok|Cancel|User1, Ok, 0L /*parent*/, 0L, true,
526  true, KStdGuiItem::clear() )
527 {
528  initDialog( textFileName, TQString::null, textUrl, TQString::null );
529 }
530 
531 KURLDesktopFileDlg::KURLDesktopFileDlg( const TQString& textFileName, const TQString& textUrl, TQWidget *parent )
532  : KDialogBase( Plain, TQString::null, Ok|Cancel|User1, Ok, parent, 0L, true,
533  true, KStdGuiItem::clear() )
534 {
535  initDialog( textFileName, TQString::null, textUrl, TQString::null );
536 }
537 
538 void KURLDesktopFileDlg::initDialog( const TQString& textFileName, const TQString& defaultName, const TQString& textUrl, const TQString& defaultUrl )
539 {
540  TQVBoxLayout * topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() );
541 
542  // First line: filename
543  TQHBox * fileNameBox = new TQHBox( plainPage() );
544  topLayout->addWidget( fileNameBox );
545 
546  TQLabel * label = new TQLabel( textFileName, fileNameBox );
547  m_leFileName = new KLineEdit( fileNameBox, 0L );
548  m_leFileName->setMinimumWidth(m_leFileName->sizeHint().width() * 3);
549  label->setBuddy(m_leFileName); // please "scheck" style
550  m_leFileName->setText( defaultName );
551  m_leFileName->setSelection(0, m_leFileName->text().length()); // autoselect
552  connect( m_leFileName, TQ_SIGNAL(textChanged(const TQString&)),
553  TQ_SLOT(slotNameTextChanged(const TQString&)) );
554 
555  // Second line: url
556  TQHBox * urlBox = new TQHBox( plainPage() );
557  topLayout->addWidget( urlBox );
558  label = new TQLabel( textUrl, urlBox );
559  m_urlRequester = new KURLRequester( defaultUrl, urlBox, "urlRequester" );
560  m_urlRequester->setMode( KFile::File | KFile::Directory );
561 
562  m_urlRequester->setMinimumWidth( m_urlRequester->sizeHint().width() * 3 );
563  connect( m_urlRequester->lineEdit(), TQ_SIGNAL(textChanged(const TQString&)),
564  TQ_SLOT(slotURLTextChanged(const TQString&)) );
565  label->setBuddy(m_urlRequester); // please "scheck" style
566 
567  m_urlRequester->setFocus();
568  enableButtonOK( !defaultName.isEmpty() && !defaultUrl.isEmpty() );
569  connect( this, TQ_SIGNAL(user1Clicked()), this, TQ_SLOT(slotClear()) );
570  m_fileNameEdited = false;
571 }
572 
573 TQString KURLDesktopFileDlg::url() const
574 {
575  if ( result() == TQDialog::Accepted )
576  return m_urlRequester->url();
577  else
578  return TQString::null;
579 }
580 
581 TQString KURLDesktopFileDlg::fileName() const
582 {
583  if ( result() == TQDialog::Accepted )
584  return m_leFileName->text();
585  else
586  return TQString::null;
587 }
588 
589 void KURLDesktopFileDlg::slotClear()
590 {
591  m_leFileName->setText( TQString::null );
592  m_urlRequester->clear();
593  m_fileNameEdited = false;
594 }
595 
596 void KURLDesktopFileDlg::slotNameTextChanged( const TQString& )
597 {
598  kdDebug() << k_funcinfo << endl;
599  m_fileNameEdited = true;
600  enableButtonOK( !m_leFileName->text().isEmpty() && !m_urlRequester->url().isEmpty() );
601 }
602 
603 void KURLDesktopFileDlg::slotURLTextChanged( const TQString& )
604 {
605  if ( !m_fileNameEdited )
606  {
607  // use URL as default value for the filename
608  // (we copy only its filename if protocol supports listing,
609  // but for HTTP we don't want tons of index.html links)
610  KURL url( m_urlRequester->url() );
611  if ( KProtocolInfo::supportsListing( url ) )
612  m_leFileName->setText( url.fileName() );
613  else
614  m_leFileName->setText( url.url() );
615  m_fileNameEdited = false; // slotNameTextChanged set it to true erroneously
616  }
617  enableButtonOK( !m_leFileName->text().isEmpty() && !m_urlRequester->url().isEmpty() );
618 }
619 
620 
621 #include "knewmenu.moc"
KNewMenu::slotNewFile
void slotNewFile()
Called when New->* is clicked.
Definition: knewmenu.cpp:369
KNewMenu::slotNewDir
void slotNewDir()
Called when New->Directory...
Definition: knewmenu.cpp:359
KNewMenu::KNewMenu
KNewMenu(TDEActionCollection *_collec, const char *name=0L)
Constructor.
Definition: knewmenu.cpp:66
KNewMenu::slotFillTemplates
void slotFillTemplates()
Fills the templates list.
Definition: knewmenu.cpp:292
KNewMenu::slotCheckUpToDate
void slotCheckUpToDate()
Checks if updating the list is necessary IMPORTANT : Call this in the slot for aboutToShow.
Definition: knewmenu.cpp:99
KonqOperations::newDir
static void newDir(TQWidget *parent, const KURL &baseURL)
Ask for the name of a new directory and create it.
Definition: konq_operations.cpp:733

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.8.13
This website is maintained by Timothy Pearson.