diff --git a/ChangeLog b/ChangeLog index a83b2c5c..22b9ae50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,689 +1,690 @@ ADDED: some nice sample useractions ADDED: PopularUrls was rewritten for a nice-like algorithm ADDED: Useractions in the menubar (need an update of krusaderui.rc) --architecture-- KChooseDir was rewritten. plz have a look at the code/email --architecture-- move listpanel from qstring to kurl. plz read email before continuing! -- ADDED: searcher: ask for a collection-name on feed to listbox ADDED: popular urls is now persistent ADDED: popular-urls - krusader's answer to google-ranking ;-) ADDED: better completion in the origin box: constructs such as ~/src and $QTDIR/bin should work now. ADDED: Slovenian translation (thanks Matej Urbancic) ADDED: bookmarks can now be placed into toolbars ADDED: searcher, feed to listbox (with virtual folders) ADDED: Primitive scripting support; Warning: very alpha!! ADDED: new toolbar for actions. use view->show actions toolbar. you'll need to remove ~/.kde/share/apps/krusaderui.rc to see it ADDED: refresh-in-the-background for remote urls and for archives ADDED: changing the coloumns by right clicking on the panel's header ADDED: color scheme export/import ADDED: an other .desktop-file with the red icon that starts krusader as root ADDED: useraction: now every placeholder can cancel the execution. (-> %_ask(..)%) ADDED: useraction: new placeholder: %_PanelSize(percent)% ADDED: Synchronizer, pause/resume button for synchronize with kget ADDED: disk usage (tools menu + 3rd panel) ADDED: useraction: new placeholder: %_Move(src, dest)% ADDED: useraction: new placeholder: %_Each% ADDED: full viewer in the 3rd hand ADDED: shift-del deletes and doesn't move to trash ADDED: splitter: pre-defined 650MB and 700MB CD-R ADDED: more Konfigurator Tooltips ADDED: usermenu: entry to open konfigurator with the useraction-page directly ADDED: import/export of keyboard shortcuts ADDED: mouse selection modes are back! thanks to heiner for doing the work ADDED: virtual VFS (try virt:/somthing/) + FIXED: [ 1120827 ] dir copy / move with F5 / F6 doesn't work FIXED: [ 1064578 ] remote URL-s are saved in panel profiles FIXED: Creatring dir-trees on the fly (mkdir /foo/bar/test) is working again FIXED: Syncbrowse is working again and is deactivated automaticly if no longer possible FIXED: [ 1107141 ] view throws error at editing new files on remote fs FIXED: [ 1110507 ] cannot open rpm package if path contains space FIXED: command line alters its height at opening/closing the popup panel FIXED: [ 1037003 ] konqueror style drag and drop FIXED: [ 1076865 ] the default search text is '*' FIXED: [ 976598 ] krusader occasionally crashes at closing the viewer FIXED: [ 1033319 ] Relative paths dont get auto-completed FIXED: [ 971831 ] space calculation failure if the file is bigger than 4 GByte FIXED: [ 1089450 ] synchronizer copies the date information for local files FIXED: [ 1109249 ] drag and drop doesn't work with international characters FIXED: viewer cannot open 600 files, when the owner column is enabled FIXED: ftp_vfs overloads the CPU at stepping into a slow server on the network FIXED: krusader's detection of old or incompatible versions FIXED: dirk's patch for better looking icons FIXED: cannot open FTP proxy bookmarks FIXED: [ 1101237 ] the reload shortcut is always set to Ctrl+R at startup FIXED: rename extension bug in kde 3.3 FIXED: crash on startup due to restoring of last size and position FIXED: couldn't sort case sensative on some systems (see KDE bug #40131) FIXED: resizing of the main window produces strange effencts FIXED: double dragging in Krusader and Konqueror selection modes FIXED: right click menu and user action ID turmoil FIXED: [ 1074393 ] Crashes sometimes on startup (thanks Heiner) FIXED: custom icons in bookmarks weren't shown FIXED: All openUrl() calls are now delayed to avoid deadlocks... UPDATED: remoteman was disabled. from now on, bookmark manager only UPDATED: Russian translation UPDATED: German translation 1.51 ====================== ADDED: Portuguese translation (thanks Bruno Queiros) ADDED: Fn keys can have custom shortcuts ADDED: krusader can be resized to a small size even with Fn keys showing ADDED: Total-commander style refresh (at last) ADDED: ctrl-up arrow (from the panel) goes up to the origin bar ADDED: New commandline option: --profile ADDED: Heiner's selection mode patch. Still alpha. ADDED: Ukrainian translation (thanks Ivan Petrouchtchak) ADDED: disk usage tool (alpha version) ADDED: vertical krusader: hit alt+ctrl+v to test ADDED: extra information in the totals bar FIXED: separators were not displayed in the bookmarks list FIXED: deleting a folder didn't update the bottom stats correctly FIXED: useraction: parse the default-value "__goto" again FIXED: useraction: Crash when filename contained brackets '(...)' FIXED: world-class-annoying-bug when sometimes while using quicksearch, the file that was selected by quicksearch got hidden beneath the bar FIXED: mime types are shown only in english FIXED: when using quicksearch, current item wasn't visible FIXED: a crash when packing/unpacking to partial URL UPDATED: Dutch translation (thanks Frank Schoolmeesters) UPDATED: Hungarian translation (thanks Arpad Biro) UPDATED: German translation 1.50 ====================== FIXED: mountman now blocks and wait for mount/umount to complete FIXED: sorting got borked because locale-aware-compare isn't handling files that start with '.' well FIXED: possible opendir leakage, fish works only when moving the mouse FIXED: taken KDE's KDiskFreeSp class to optimize DF handling FIXED: Krusader overloads the CPU with panel refreshing FIXED: Wrong Danish language code (dk.po->da.po) UPDATED: Catalan translation (thanks Quim Perez) UPDATED: Italian translation (thanks Giuseppe Bordoni) UPDATED: Bulgarian translation (thanks Milen Ivanov) UPDATED: Slovak translation (thanks Zdenko Podobny) UPDATED: Hungarian translation (thanks Arpad Biro) UPDATED: German translation UPDATED: Dutch translation (thanks Frank Schoolmeesters) 1.50-beta1 ====================== ADDED: if view is human-readable, status bar is normal (bytes) and vice versa ADDED: Human-readable file sizes is implemented (located in look&feel->panel) ADDED: useraction: available via rightclick-menu ADDED: importing the right click menu of konqueror ADDED: cut(CTRL+X), copy(CTRL+C), paste(CTRL+V) ADDED: useraction: new Placeholder %_Profile("panel-profile")% ADDED: useraction: new Placeholder %_NewSearch("search-profile")% ADDED: useraction: run as different user ADDED: alt-O now sync the panels (like ctrl-left/right arrows) ADDED: new shortcut (ctrl-d) to open bookmarks on current panel ADDED: panel costum colors: new Current Marked Foreground ADDED: compare by content: the action is now smarter in finding the right files ADDED: profiles for the panels ADDED: mkdir (F7) can now create whole trees on the fly ("foo/bar/test") ADDED: synchronizer uses the search filters ADDED: search profiles ADDED: searcher: TC like search ( 'text' == '*text*' ) excluding files with '|' (ex. '*.cpp *.h | *.moc.cpp' ) ADDED: search on remote file systems ADDED: konfigurator|advanced has a new entry: just enter mountpoints there, and mountman won't try to mount/unmount them. ADDED: mountman got a big nose-job ;-) plz test ADDED: dropping on the tree panel (copy,move,link) ADDED: packing / unpacking to/from remote URL-s ADDED: short tab names ADDED: compare directories (mark menu) ADDED: shift+left/right changes tabs (thanks to Dmitry Suzdalev) ADDED: linking mimes and protocols ADDED: new delete dialog box: lists the file names to be deleted (thanks to dirk for the idea) ADDED: iso protocol for viewing .iso cd/dvd images (thanks to Szombathelyi Gyorgy) ADDED: full handling of arj, ace and lha packers ADDED: useraction: new Placeholder %_Sync("synchronizer-profile")% ADDED: synchronizer: profile handling ADDED: synchronizer: swap sides ADDED: useraction: new Placeholder %_Copy("from", "to")% ADDED: 3rd hand: new panel that does quick selection ADDED: 3rd hand: look n feel changed to fit krusader ADDED: credit for jonas in the about box ADDED: panels now save the tabs at shutdown (thanks to Donat Martin) ADDED: dropping URL-s onto the status / totals line ADDED: Bosnian translation ADDED: synchronizer: excluding files with '|' in the file filter (ex. '*.cpp *.h | *.moc.cpp' ) ADDED: tooltips for squeezed tabs ADDED: sync-browse mode (if on, a directory-change in the active is also performed in the inactive panel) ADDED: beta-state incremental refresh. test it with fam enabled! ADDED: synchronizer: ability to give more files in the file filter (ex. '*.cpp *.h') ADDED: Two single click rename (Total Commander rename) ADDED: The 3rd hand of krusader. click the litle arrow below the panel's scrollbar to see.. ADDED: showing suid, sgid and sticky bits in the permissions column ADDED: New useraction-system (partly based on Shies usermenu-prototype) REACTIVATED: usermenu (now using the new useraction-system) FIXED: synchronizer fails at case insensitive (Windows) file systems FIXED: crash when deleting an useraction created in the same session FIXED: locale aware ABC sorting (for non-english languages) FIXED: useraction: startpath is now working FIXED: useraction: i18n is now working in the add-placeholder-menu FIXED: searcher corrupts international characters FIXED: searcher cannot open remote URL-s for editing/viewing (archives) FIXED: the File/Properties function writes incorrect group name FIXED: krarc doesn't keep the date/time information at extracting to local fs FIXED: jar files aren't handled + problems with dirs in windows zips FIXED: problem with the windows created rar permissions FIXED: performance increasing: faster sorting, directory leaving FIXED: compare content error at remote urls (problem with sleep 2) FIXED: totals bar didn't update when an incremental refresh happened FIXED: locate doesn't report the errors occured during the search FIXED: the viewer size is forgotten in maximized mode (KDE hack) FIXED: internationalization bugs, illegal usage of QString::latin1() FIXED: krarc, ignores the packer dependencies FIXED: krarc, rar: mkdir does not work, illegal time and permission info FIXED: krarc, problem with copying / moving inside the archive FIXED: krarc, problem with international characters in put/mkdir FIXED: krarc, problems at copying subdirectories from the archive FIXED: [ 1005533 ] stepping onto a subfs device crashes krusader FIXED: [ 988835 ] window size of synchronize dirs is not stored FIXED: [ 946567 ] krusader minimizes to tray on desktop change FIXED: mountman changes... read the email ;-) REMOVED: Dupe Japanese translation (ja.po is used nowadays) UPDATED: Bosnian translation (thanks Asim Husanovic) UPDATED: Chinese Simplified translation (thanks Jinghua Luo) UPDATED: Hungarian translation (thanks Kukk Zolt�) UPDATED: German translation 1.40 ====================== ADDED: when searching in files (grep), push the string we're searching for into the clipboard when pressing F3 or F4. this saves an extra copy when searching inside the file ADDED: Catalan translation DISABLED: usermenu for 1.40 FIXED: [ 962340 ] Alt-T broken to call Tools menu FIXED: [ 980252 ] Compare by Content: right/left position swapped FIXED: [ 990141 ] F3/F4 in root mode trouble with permissions FIXED: [ 959916 ] Krusader window too large on startup FIXED: username and group information are wrong for ftp_vfs FIXED: UMR (uninitialized memory read) in vfs::fromPathOrURL UPDATED: Polish translation 1.40-beta2 ====================== ADDED: Chinese Simplified translation FIXED: the new ftp dialog URLs are saved into a stochastic configuration group FIXED: [ 960003 ] Swapped letters in quick-search FIXED: KIO::Slave url redirection handling (e.g. now devices:/ and settings:/ works !) FIXED: [ 962598 ] viewer didn't display XML files FIXED: [ 960595 ] problem with paths containing more '@' characters (FTP proxy hack) FIXED: [ 957145 ] krusader closes editor without asking FIXED: ports cannot be added for fish, sftp in the new connection GUI FIXED: [ 943962 ] the summary status is not updated after calc space FIXED: [ 950762 ] missing pemission check on entering a folder FIXED: setting "xterm -e vim" as editor didn't work... FIXED: [ 953874 ] allowing editors which are not url-aware to be used as default editor FIXED: [ 948315 ] security hole, krusader changes its temp directory's rights to 0777 FIXED: the UI settings are not saved at exit FIXED: [ 951274 ] shift+home and shift+end does not work FIXED: [ 948726 ] problem with ctrl+left from the left panel and ctrl+right from the right panel FIXED: extension is separated from the dirname after renaming directories containing '.' FIXED: locate does not call kdesu any more FIXED: [ 950052 ] synchronizer: the left and right side depends of the active panel FIXED: [ 770676 ] krarc does not handle password zips FIXED: [ 928746 ] symlinks pointing to directories using fish protocol fail FIXED: [ 939214 ] synchronizer, wrong behaviour of compare by content FIXED: moving into archives is dangerous. it is disabled (for now at least) FIXED: synchronizer gui size policy bugs FIXED: [ 934498 ] problem at dropping files into the '..' directory FIXED: [ 939612 ] F9 moves file, if new name already exists as directory FIXED: krusader does not handle filenames containing '#' character FIXED: krusader exits at viewing dvi files (missing arguments from KPart). FIXED: drag line remains visible after dropping an URL FIXED: panel swapping corrupts ctrl+arrow and alt+arrow FIXED: error at dropping URLs containing non-english characters from konqueror FIXED: KDE 3.2, right justified tabs bug FIXED: dragging over a new tab changes active tab FIXED: crash at pressing space on the '..' directory UPDATED: Bulgarian translation UPDATED: Czech translation UPDATED: Danish translation UPDATED: Dutch translation UPDATED: French translation UPDATED: German translation UPDATED: Hungarian translation UPDATED: Italian translation UPDATED: Slovak translation 1.40-beta1 ====================== ADDED: configuring the colors of the panel ADDED: (a bug fix really) ability to "not test archives before unpacking" ADDED: new icons (thanks to adios for providing them) ADDED: quickmode for mountman. press and HOLD the mountman icon for new functionality ADDED: Bulgarian translation (thanks to Milen Ivanov) ADDED: krusader restart is not necessary from now after changing the configuration ADDED: ability to give arguments for the terminal ADDED: enable/disable icons in the filenames ADDED: ability to configure the fields of the panel (Ext, Size, Perm, ...) ADDED: single click selects / executes ADDED: panel level toolbar ('..', '/', '~', '=' buttons), thanks to David Harel ADDED: Locate (integrating the findutils-locate package of GNU into Krusader). TEST IT ADDED: Heiner's patch for 'logical selection mode' is applied and used as default. TEST IT ADDED: application dependency setting in konfigurator ADDED: Csaba's new konfigurator is here, boys and girls! ADDED: heiner's quicksearch patch ADDED: calculate occupied space prints the directory's size (wincmd-style) - thanks heiner! ADDED: current directory in history menu is checked ADDED: a working user menu (try alt+~), but a bit rough on the edges ADDED: KrSearch edit/view file in the result list window (F3, F4, right click) ADDED: a folder-history button, a-la-total commander. thanks to Hans Loffler! ADDED: selectall at rename ADDED: new shortcuts to search dialog (heiner) ADDED: directory synchronizer ADDED: file splitter ADDED: a missing credit for Frank in the about box FIXED: krusader exits at closing the viewer when minimized to tray FIXED: KDE 3.2 terminal exit at Ctrl+C FIXED: bug [ 906386 ] regarding refreshes of dirwatch with fam enabled FIXED: bug [ 906538 ] which now makes a faster unpacking process FIXED: bug [ 894771 ] regarding over-expanding window due to long command line FIXED: edit new file on KDE 3.2 FIXED: permission handling for FTP URL-s FIXED: calc space crash at vfs refresh (thanks to Heiner) FIXED: krarc created non-executable directories (0666) FIXED: reimplementing the 'allow move into archive' setting FIXED: no restart at changing the icon tray's state in konfigurator FIXED: krusader freezes if the `df` process does not terminate (at network errors, IO wait) FIXED: krusaderui.rc bug, new menuitems does not appear after a krusader update FIXED: sort by EXT did not obey the 'case sensative sort' flag FIXED: 2 items on the view menu had the same shortcuts FIXED: increased speed of search, by emitting lesssignals (thanks to Lars) FIXED: statusbar updated only on mouse clicks, not on keyboard FIXED: translation: forcing non-english languages with a strange structure FIXED: freeze at modal dialogs and icon tray FIXED: crash at rename if the directory is refreshed by the watcher FIXED: stepping to the file below after delete (heiner) FIXED: window size and position saving at maximized mode FIXED: more freedom to give FTP proxy URL-s in "New FTP Connection" menu FIXED: crash at ftp://user@server@proxy:port FTP URL-s FIXED: no parent directory at tar://... and zip://... URL-s FIXED: font size problems in KCmdLine and KrMaskChoice FIXED: internal editor quits without notification even if the edited file was not saved FIXED: no i18n for Name, Ext, Size, Modified FIXED: obsolete QT header files FIXED: crash at closing the progressbar window at packing FIXED: no or uninformative error message at packing to a readonly directory FIXED: crash at middle clicking on the last tab FIXED: KrSearch permissions panel placing bug FIXED: ftp port limit changed from 999 to 65535 REMOVED: arc_vfs support completly replaced with KIO:Slave technolegy. UPDATED: new package description - Thanks to Jonas B�r UPDATED: Krusader Handbook (read ./doc/ChangeLog for more info) UPDATED: Japanese translation UPDATED: Dutch translation UPDATED: Czech translation (thanks to Martin Sixta) UPDATED: Spanish translation UPDATED: Krename url http://www.krename.net 1.30 ====================== ADDED: middle mouse button: click on a folder, and create a new tab. ADDED: middle mouse button: click on a tab, and close it FIXED: krarc QByteArray buffer freeing bug FIXED: mountman watches 'mount' instead of the directories FIXED: keyboard-shortcuts issues for new-tab(alt+ctrl+n), close-tab(alt+ctrl+c) and duplicate-tab(alt+ctrl+shift+n) FIXED: mountman FreeBSD bug (/etc/mtab does not exist in FreeBSD) FIXED: All files / Custom files. Executable was removed. FIXED: when selecting something from the combobox in "mark files" dialog, combo doesn't close immediatly FIXED: mark files dialog added the same selection more than once FIXED: disabled panel-types in konfigurator FIXED: font size problems with the Select dialog, and New Net Connection FIXED: mountman detects those devices as supermount, which are mounted and missing from fstab FIXED: mountman inserts '/dev/' before NFS shares and mounted devices which are missing from fstab FIXED: mountman does not watch readonly directories (mount can change its permissions!) FIXED: mountman does not stop dirwatch after close + memory leak FIXED: compare fix at directories with escape characters FIXED: Sorry - Archive test passed FIXED: FTP proxy bug (more than one @ characters in the URL) REMOVED: SortByExtention menu item (which did nothing) REMOVED: KrSearch-Help + Pack-Move into archive (did nothing) UPDATED: Dutch translation UPDATED: Danish translation UPDATED: Hungarian translation UPDATED: Italian translation UPDATED: Slovak translation 1.29-beta ====================== ADDED: KrSearch Match whole word only feature ADDED: Tab-browsing shortens tabs when more tabs are created ADDED: Starting Krusader with root privileges by pressing Alt+K ADDED: Open-in-a-new-tab available in right-click menu ADDED: Creating new files with SHIFT+F4 ADDED: Russian translation (thanks to Dmitry Chernyak) ADDED: Ctrl+Enter and Ctrl+Shift+Enter keyboard shortcuts ADDED: default shortcut for refreshing the panel is Ctrl+R ADDED: ctrl-left/right arrow checks if we're on a folder, if so it refreshes the other panel with the contents of the folder, otherwise to the same path as current one (Wincmd style) ADDED: tabbed-browsing beta ADDED: SHIFT-F3 view dialog. ADDED: The internal viewer follow links on HTML pages. ADDED: panel swapping by Ctrl+U ADDED: command line improvments: ctrl+/ opens history list, up&down keys work again, and general usability ADDED: krusader can now be started from commandline with new options: try: krusader --left=/mnt/cdrom --right=ftp://downloads@myserver.net! ADDED: new command line widget. should fix some issues and requests ADDED: Missing WhatsThis information (thanks to Mikolaj!) ADDED: a new shortcut for 'show hidden files' - ctrl+. (ctrl plus dot) ADDED: rar support to krArc KIO slave. ADDED: open with in the right click menu for multiple files with the same mimetype. ADDED: Patch by Heiner which adds a cancel button to the calculate space action. FIXED: KrSearch does not find texts at the last row FIXED: Strange KrSearch GUI (SearchIn and DontSearchIn adding) FIXED: KrSearch crash at pressing Escape or Closing the window during search FIXED: cmdline would start-up focused on the wrong panel FIXED: when pressing ctrl-enter (or ctrl-shift-enter), focus goes to command line FIXED: Terminal Emulator bug at ` and Backspace keys FIXED: internal editor / viewer crash at invalid symlinks FIXED: run-in-terminal would cause the terminal to close prematuraly and results would be lost. FIXED: free disk capacity miscalculation for Ext2 and Ext3 file systems. FIXED: crash when editing a file with # in the filename FIXED: inplace renaming bug with extention when pressing ctrl+click FIXED: whenever the folder gets refreshed, the current file would be lost FIXED: problematic behavior when trying to SPACE a folder without permissions FIXED: Ctrl-A didn't work properly FIXED: crash when unmounting a busy mountpoint FIXED: date-time sorting bug FIXED: changed pop-up delay of the history button on the command line to zero FIXED: right-click menu via keyboard appeared in the wrong place FIXED: crash when using spacebar on the ".." (thanks to heiner) FIXED: automark directories didn't work (thanks to Anarky) FIXED: bug when using space to calculate space of directory FIXED: crash when viewing files with # in their name. FIXED: compilation problem with GCC >= 3.3 (thanks to Adios) FIXED: Force refresh when creating a new directory. FIXED: a crash when trying to repaint when the VFS was deleted. REMOVED: Device Manager action UPDATED: many usability issues (thanks to Mikolaj) UPDATED: German translation UPDATED: Hungarian translation UPDATED: Dutch translation UPDATED: Spanish translation 1.25-beta1 ====================== ADDED: Finally, the new bookmark system is here! courtasy of Jan Halasa ADDED: new Hungarian translation, thanks to Kukk Zolt� FIXED: mountMan bug - didn't allow to umount/mount filesystem with trailing / FIXED: width of modified column for i18n (thanks to heiner) FIXED: dirUp() bug - selection goes to top. FIXED: the @ in ftp passwords bug. UPDATED: Slovak translation UPDATED: Dutch translation 1.21-beta1 ====================== ADDED: Opening left/right bookmarks (alt+left/right arrow) is now an action, and can be remapped. ADDED: In-place renaming (thanks to Heiner Eichmann) ADDED: New KIO slaves to handle archives. ADDED: multi-file properties. ADDED: Krusader now obeys KDE's date time format ADDED: Total-Commander style directory selection. Press SPACE to check it out! Thanks goes (again) to Heiner Eichmann! FIXED: column sizes are saved when doing 'save postion', or if 'save settings' is set in konfigurator. FIXED: double-catching of the ~ (tilda) key FIXED: double-catching of the backspace key FIXED: closing krusader using Alt-F4 or clicking X didn't save settings FIXED: Wrong focus after renaming FIXED: Error using KRename with filenames containing spaces (thanks to Tobias Vogele) FIXED: FreeBSD compatability in KrARC (thanks to Heiner Eichmann) FIXED: a crash in the dirUp() function. FIXED: when opening bookmarks using keyboard, active panel didn't change properly FIXED: in search dialog - you can now simply click text, and press ENTER. no need to click Search FIXED: a lot of usability issues (thanks to Mikolaj Machowski) FIXED: double-click in search dialog bug (thanks to heiner eichmann for the patch) FIXED: i18n issues - thanks to Frank Schoolmeesters FIXED: Panel flicker patch (thanks to Gabor Takacs for the patch) FIXED: Krusader failed to report permission errors while deleting files FIXED: issue with Japanesse translation FIXED: ctrl+arrows is caught by panel and not the view FIXED: removed unsafe debug messages FIXED: proper properties and owner/group for non-local files UPDATED: Dutch translation UPDATED: German translation BUG: krArc slow when unpacking large files 1.20 - KDE 3 ====================== ADDED: Clicking on the status or totals bars (above and below file list) changes focus ADDED: Each panel remembers the way it was sorted (might be different for each) ADDED: Each panel remembers the column width (might be different for each) ADDED: Dutch translation, thanks to Frank Schoolmeesters FIXED: Crash when saying NO to "really exit krusader?" UPDATED: German translation UPDATED: Polish translation 1.20 ====================== ADDED: Japanese translation, thanks to UTUMI Hirosi ADDED: error window when attempting to drag-n-drop to a target without enough permissions FIXED: crash when viewing/editing a file without permissions to read FIXED: icon touchup - to make the thing look more consistent FIXED: removed the ftp disconnect and root actions from the toolbar FIXED: updated polish translation FIXED: date sorting with files older than the year 2000 FIXED: crash on remote connections if there is a @ in the password FIXED: the remote connections rename function FIXED: blank hex viewer with short text files FIXED: anonymous checkbox in remote-man not respected 1.12 beta2 ====================== ADDED: Introducing extention column ADDED: Italian translation (thanks to Giuseppe Bordoni) ADDED: Preview to the right-click menu. FIXED: minimize to tray didn't behave correctly FIXED: crash when mounting failed (no cdrom in drive) FIXED: icon too big when minimized to tray FIXED: origin bar now accepts local urls (file:/) gracefully FIXED: origin bug, which caused the focus to go to the panel too soon. FIXED: right click menu in mountman (thanx to Heiner). FIXED: new 'admin' folder (support automake 1.7). FIXED: ESC key close the viewer. FIXED: crash when trying to open non-existing directory. FIXED: directory sorting. TODO: automark directories won't work in 1.12!!! TODO: can we add a krProgress to normal-vfs refreshes ? TODO: dragn'drop quirky. TODO: add progressbar to totals (?) TODO: COMPAREMODE 1.12 beta1 ====================== ADDED: some GUI touch-ups: make buttons smaller, and bars leaner. all in all, the thing should look better. ADDED: FreeBSD compatability issues - patchs by Heiner, thanks man! ADDED: move to next-gen view (at last) FIXED: popup-menu poping out of place. FIXED: Panel & PanelFunc permission clean up. FIXED: krBack() clean up. FIXED: moved all the logic from ListPanel to ListPanelFunc FIXED: integrated the openUrl() API. FIXED: minor bug in mountman FIXED: bug in arc_vfs, concerning full-paths in tars (thanks Heiner) FIXED: right align size column REMOVED: Tree & Quickview panels. 1.11 KDE 3 ====================== ADDED: updated Swedish translation, thanks to Anders Linden. ADDED: new Spanish translation, thanks to Rafa Munoz. ADDED: new Polish translation, thanks to Lukasz Janyst. FIXED: Changed the internal viewer default from Hex to Text. FIXED: Crash when Krusader is called with open viewer/internal editor. FIXED: Keyboard shortcuts not saved in Konfigurator. 1.10 - KDE 3 ====================== ADDED: new and improved viewer. ADDED: Krename support ! (more info at: http://krename.sf.net ) ADDED: you can now use the command line to "cd" into konqi-supported urls. ( try: cd audiocd:/?dev=/dev/cdrom ) ADDED: you can try to execute files in remote filesystem. ADDED: new command detection function instead of using 'which' FIXED: rewritten the panel sorting function, it should be better and faster now. FIXED: back to KRDirWatch, since KDirWatch crashed us on systems with FAM enabled. FIXED: removed the "panel start path is invalid" error message. if the start path is invalid try to find the closest path (the previous solution was '/'); FIXED: don't watch read-only/not-readable directories - this should improve performance and avoid a loooong wait time on super-mounted cdroms. FIXED: multiple selctions modes are no-more. default mode is Konqueror. the multi-mode become unstable after the kde3 porting and we had to disable it. FIXED: memory leak when starting konfigurator. 1.0.2 - KDE 3 ====================== ADDED: new icon. ADDED: sftp & scp support. ADDED: multi-protocol and history to the new connection dialog. FIXED: normal_vfs now uses the KDE dir watch, in other words: better directory refresh. FIXED: new 'admin' folder. 1.0.1 - KDE 3 ====================== ADDED: Krusader now compiles on KDE 3 (tested with RC3). ADDED: New ftp/smb vfs due to KDE 3 API changes. 1.0.1 ====================== ADDED: When compare-mode is active, pressing the 'Select Files' icon (or the equivelent keyboard short-cut), will open the usual dialog with 4 new options in the predefined selections. This allows automatic selection of files according to their compare-mode status - newer, older, etc. ADDED: Terminal emulator now "follows mouse" - konqueror style. ADDED: French translation. ADDED: A new icon for Krusader. new we've got krusader.png and krusader2.png! FIXED: errors compiling on kde 2.1 - convertSizeFromKB FIXED: compatability issue with installing to debian FIXED: compatability issue with Solaris FIXED: keyboard settings are not saved. FIXED: a small bug causing 'rrr' to show instead of 'rwx'. 1/1/02 - 1.00 ===================== diff --git a/krusader/Panel/panelfunc.cpp b/krusader/Panel/panelfunc.cpp index 6941e225..60509b38 100755 --- a/krusader/Panel/panelfunc.cpp +++ b/krusader/Panel/panelfunc.cpp @@ -1,1004 +1,1004 @@ /*************************************************************************** panelfunc.cpp ------------------- copyright : (C) 2000 by Shie Erlich & Rafi Yanai e-mail : krusader@users.sourceforge.net web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- Description *************************************************************************** A db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD S o u r c e F i l e *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include // Qt Includes #include #include #include #include // KDE Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Krusader Includes #include "panelfunc.h" #include "krcalcspacedialog.h" #include "krdetailedview.h" #include "../krusader.h" #include "../krslots.h" #include "../defaults.h" #include "../VFS/vfile.h" #include "../VFS/vfs.h" #include "../VFS/virt_vfs.h" #include "../VFS/krarchandler.h" #include "../VFS/krpermhandler.h" #include "../VFS/krvfshandler.h" #include "../Dialogs/packgui.h" #include "../Dialogs/krdialogs.h" #include "../Dialogs/krpleasewait.h" #include "../Dialogs/krspwidgets.h" #include "../KViewer/krviewer.h" #include "../resources.h" #include "../krservices.h" #include "../GUI/syncbrowsebutton.h" #include "krdrag.h" #include ////////////////////////////////////////////////////////// ////// ---------- List Panel ------------- //////// ////////////////////////////////////////////////////////// ListPanelFunc::ListPanelFunc( ListPanel *parent ) : panel( parent ), inRefresh( false ), vfsP( 0 ) { urlStack.push( "file:/" ); connect( &delayTimer, SIGNAL( timeout() ), this, SLOT( doOpenUrl() ) ); } void ListPanelFunc::openUrl( const QString& url, const QString& nameToMakeCurrent ) { openUrl( vfs::fromPathOrURL( // KURLRequester is buggy: it should return a string containing "/home/shie/downloads" // but it returns "~/downloads" which is parsed incorrectly by vfs::fromPathOrURL. // replacedPath should replace ONLY $HOME and environment variables panel->origin->completionObject()->replacedPath(url) ) , nameToMakeCurrent ); } void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) { KURL url = urlIn; url.cleanPath(); // check for special cases first - don't refresh here ! // you may call openUrl or vfs_refresh() if ( !url.isValid() ) { if ( url.url() == "~" ) { return openUrl( QDir::homeDirPath() ); } else if ( !url.url().startsWith( "/" ) ) { // possible relative URL - translate to full URL url = files() ->vfs_getOrigin(); url.addPath( urlIn.url() ); kdDebug()<< urlIn.url() << "," << url.url() <slotStartUpdate(); // refresh the panel return ; } } panel->slotFocusOnMe(); // if we are not refreshing to current URL if ( !files() ->vfs_getOrigin().equals( url, true ) ) { // change the cursor to busy panel->setCursor( KCursor::waitCursor() ); // clear the view - to avoid a repaint crash panel->view->clear(); } if ( !nameToMakeCurrent.isEmpty() ) { panel->view->setNameToMakeCurrent( nameToMakeCurrent ); } vfs* v = 0; if ( !urlStack.top().equals( url ) ) urlStack.push( url ); while ( true ) { KURL u = urlStack.pop(); //u.adjustPath(-1); // remove trailing "/" u.cleanPath(); // Resolves "." and ".." components in path. v = KrVfsHandler::getVfs( u, panel, files() ); if ( !v ) continue; //this should not happen ! if ( v != vfsP ) { vfsP->deleteLater(); vfsP = v; // v != 0 so this is safe } connect( files(), SIGNAL(startJob(KIO::Job* )), panel, SLOT(slotJobStarted(KIO::Job* ))); if ( vfsP->vfs_refresh( u ) ) break; // we have a valid refreshed URL now // prevent repeated error messages vfsP->vfs_setQuiet( true ); } vfsP->vfs_setQuiet( false ); // update the urls stack if ( !files() ->vfs_getOrigin().equals( urlStack.top() ) ) { urlStack.push( files() ->vfs_getOrigin() ); } // disconnect older signals disconnect( files(), SIGNAL( addedVfile( vfile* ) ), 0, 0 ); disconnect( files(), SIGNAL( updatedVfile( vfile* ) ), 0, 0 ); disconnect( files(), SIGNAL( deletedVfile( const QString& ) ), 0, 0 ); // connect to the vfs's dirwatch signals connect( files(), SIGNAL( addedVfile( vfile* ) ), panel, SLOT( slotItemAdded( vfile* ) ) ); connect( files(), SIGNAL( updatedVfile( vfile* ) ), panel, SLOT( slotItemUpdated( vfile* ) ) ); connect( files(), SIGNAL( deletedVfile( const QString& ) ), panel, SLOT( slotItemDeleted( const QString& ) ) ); // on local file system change the working directory if ( files() ->vfs_getType() == vfs::NORMAL ) chdir( files() ->vfs_getOrigin().path().local8Bit() ); } void ListPanelFunc::openUrl( const KURL& url, const QString& nameToMakeCurrent ) { panel->inlineRefreshCancel(); // first the other dir, then the active! Else the focus changes and the other becomes active if ( panel->syncBrowseButton->state() == SYNCBROWSE_CD ) { - // prevents that the sync-browsing circles itself to death       + // prevents that the sync-browsing circles itself to death static bool inSync = false; if( ! inSync ){ inSync = true; //do sync-browse stuff.... KURL otherDir = OTHER_PANEL->virtualPath(); OTHER_FUNC->files() ->vfs_setQuiet( true ); // the trailing slash is nessesary because krusader provides Dir's without it // we can't use openUrl because the delay don't allow a check if the panel has realy changed! OTHER_FUNC->immediateOpenUrl( KURL::relativeURL( panel->virtualPath().url() + "/", url.url() ) ); OTHER_FUNC->files() ->vfs_setQuiet( false ); // now we need to test ACTIVE_PANEL because the openURL has changed the active panel!! if ( ACTIVE_PANEL->virtualPath().equals( otherDir ) ) { // deactivating the sync-browse if syncbrowse not possible panel->syncBrowseButton->setOn( false ); } inSync = false; } } this->nameToMakeCurrent = nameToMakeCurrent; delayURL = url; /* this function is useful for FTP url-s and bookmarks */ delayTimer.start( 0, true ); /* to avoid qApp->processEvents() deadlock situaltion */ } void ListPanelFunc::refresh() { openUrl(panel->virtualPath()); // re-read the files } void ListPanelFunc::doOpenUrl() { immediateOpenUrl( delayURL ); } void ListPanelFunc::goBack() { if ( urlStack.isEmpty() ) return ; if ( urlStack.top().equals( files() ->vfs_getOrigin() ) ) urlStack.pop(); openUrl( urlStack.top(), files() ->vfs_getOrigin().fileName() ); if ( urlStack.isEmpty() ) krBack->setEnabled( false ); } void ListPanelFunc::redirectLink() { if ( files() ->vfs_getType() != vfs::NORMAL ) { KMessageBox::sorry( krApp, i18n( "You can edit links only on local file systems" ) ); return ; } vfile *vf = files() ->vfs_search( panel->getCurrentName() ); if ( !vf ) return ; QString file = files() ->vfs_getFile( vf->vfile_getName() ).path( -1 ); QString currentLink = vf->vfile_getSymDest(); if ( currentLink.isEmpty() ) { KMessageBox::sorry( krApp, i18n( "The current file is not a link, so I can't redirect it." ) ); return ; } // ask the user for a new destination bool ok = false; QString newLink = KInputDialog::getText( i18n( "Link Redirection" ), i18n( "Please enter the new link destination:" ), currentLink, &ok, krApp ); // if the user canceled - quit if ( !ok || newLink == currentLink ) return ; // delete the current link if ( unlink( file.local8Bit() ) == -1 ) { KMessageBox::sorry( krApp, i18n( "Can't remove old link: " ) + file ); return ; } // try to create a new symlink if ( symlink( newLink.local8Bit(), file.local8Bit() ) == -1 ) { KMessageBox:: /* --=={ Patch by Heiner }==-- */sorry( krApp, i18n( "Failed to create a new link: " ) + file ); return ; } } void ListPanelFunc::krlink( bool sym ) { if ( files() ->vfs_getType() != vfs::NORMAL ) { KMessageBox::sorry( krApp, i18n( "You can create links only on local file systems" ) ); return ; } QString name = panel->getCurrentName(); // ask the new link name.. bool ok = false; QString linkName = KInputDialog::getText( i18n( "New link" ), i18n( "Create a new link to: " ) + name, name, &ok, krApp ); // if the user canceled - quit if ( !ok || linkName == name ) return ; // if the name is already taken - quit if ( files() ->vfs_search( linkName ) != 0 ) { KMessageBox::sorry( krApp, i18n( "A directory or a file with this name already exists." ) ); return ; } if ( linkName.left( 1 ) != "/" ) linkName = files() ->vfs_workingDir() + "/" + linkName; if ( linkName.contains( "/" ) ) name = files() ->vfs_getFile( name ).path( -1 ); if ( sym ) { if ( symlink( name.local8Bit(), linkName.local8Bit() ) == -1 ) KMessageBox::sorry( krApp, i18n( "Failed to create a new symlink: " ) + linkName + i18n( " To: " ) + name ); } else { if ( link( name.local8Bit(), linkName.local8Bit() ) == -1 ) KMessageBox::sorry( krApp, i18n( "Failed to create a new link: " ) + linkName + i18n( " To: " ) + name ); } } void ListPanelFunc::view() { QString fileName = panel->getCurrentName(); if ( fileName.isNull() ) return ; // if we're trying to view a directory, just exit vfile * vf = files() ->vfs_search( fileName ); if ( !vf || vf->vfile_isDir() ) return ; if ( !vf->vfile_isReadable() ) { KMessageBox::sorry( 0, i18n( "No permissions to view this file." ) ); return ; } // call KViewer. KrViewer::view( files() ->vfs_getFile( fileName ) ); // nothing more to it! } void ListPanelFunc::terminal() { QString save = getcwd( 0, 0 ); chdir( panel->realPath().local8Bit() ); KProcess proc; krConfig->setGroup( "General" ); QString term = krConfig->readEntry( "Terminal", _Terminal ); proc << KrServices::separateArgs( term ); if ( term.contains( "konsole" ) ) /* KDE 3.2 bug (konsole is killed by pressing Ctrl+C) */ { /* Please remove the patch if the bug is corrected */ proc << "&"; proc.setUseShell( true ); } if ( !proc.start( KProcess::DontCare ) ) KMessageBox::sorry( krApp, i18n( "Can't open " ) + "\"" + term + "\"" ); chdir( save.local8Bit() ); } void ListPanelFunc::editFile() { QString name = panel->getCurrentName(); if ( name.isNull() ) return ; if ( files() ->vfs_search( name ) ->vfile_isDir() ) { KMessageBox::sorry( krApp, i18n( "You can't edit a directory" ) ); return ; } if ( !files() ->vfs_search( name ) ->vfile_isReadable() ) { KMessageBox::sorry( 0, i18n( "No permissions to edit this file." ) ); return ; } KrViewer::edit( files() ->vfs_getFile( name ) ); } void ListPanelFunc::moveFiles() { QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; // safety KURL dest = panel->otherPanel->virtualPath(); QString destProtocol = dest.protocol(); if ( destProtocol == "krarc" || destProtocol == "tar" || destProtocol == "zip" ) { KMessageBox::sorry( krApp, i18n( "Moving into archive is disabled" ) ); return ; } krConfig->setGroup( "Advanced" ); if ( krConfig->readBoolEntry( "Confirm Move", _ConfirmMove ) ) { QString s; if ( fileNames.count() == 1 ) s = i18n( "Move " ) + fileNames.first() + " " + i18n( "to" ) + ":"; else s.sprintf( i18n( "Move %d files to:" ).local8Bit(), fileNames.count() ); // ask the user for the copy dest dest = KChooseDir::getDir(s, dest, panel->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled } if ( fileNames.isEmpty() ) return ; // nothing to copy KURL::List* fileUrls = files() ->vfs_getFiles( &fileNames ); // after the delete return the cursor to the first unmarked // file above the current item; panel->prepareToDelete(); // if we are not moving to the other panel : - if ( panel->otherPanel->virtualPath() != dest ) { + if ( !dest.equals( panel->otherPanel->virtualPath(), true ) ) { // you can rename only *one* file not a batch, // so a batch dest must alwayes be a directory if ( fileNames.count() > 1 ) dest.adjustPath(1); KIO::Job* job = new KIO::CopyJob( *fileUrls, dest, KIO::CopyJob::Move, false, true ); // refresh our panel when done connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( refresh() ) ); // and if needed the other panel as well - if ( dest == panel->otherPanel->virtualPath() ) + if ( dest.equals( panel->otherPanel->virtualPath(), true ) ) connect( job, SIGNAL( result( KIO::Job* ) ), panel->otherPanel->func, SLOT( refresh() ) ); } else { // let the other panel do the dirty job //check if copy is supported if ( !otherFunc() ->files() ->vfs_isWritable() ) { KMessageBox::sorry( krApp, i18n( "You can't move files to this file system" ) ); return ; } // finally.. otherFunc() ->files() ->vfs_addFiles( fileUrls, KIO::CopyJob::Move, files() ); } } // called from SLOTS to begin the renaming process void ListPanelFunc::rename() { panel->view->renameCurrentItem(); } // called by signal itemRenamed() from the view to complete the renaming process void ListPanelFunc::rename( const QString &oldname, const QString &newname ) { if ( oldname == newname ) return ; // do nothing panel->view->setNameToMakeCurrent( newname ); // as always - the vfs do the job files() ->vfs_rename( oldname, newname ); } void ListPanelFunc::mkdir() { // ask the new dir name.. bool ok = false; QString dirName = KInputDialog::getText( i18n( "New directory" ), i18n( "Directory's name:" ), "", &ok, krApp ); // if the user canceled - quit if ( !ok || dirName.isEmpty() ) return ; QStringList dirTree = QStringList::split( "/", dirName ); for ( QStringList::Iterator it = dirTree.begin(); it != dirTree.end(); ++it ) { // check if the name is already taken if ( files() ->vfs_search( *it ) ) { // if it is the last dir to be created - quit if ( *it == dirTree.last() ) { KMessageBox::sorry( krApp, i18n( "A directory or a file with this name already exists." ) ); return ; } // else go into this dir else { immediateOpenUrl( *it ); continue; } } panel->view->setNameToMakeCurrent( *it ); // as always - the vfs do the job files() ->vfs_mkdir( *it ); if ( dirTree.count() > 1 ) immediateOpenUrl( *it ); } // for } void ListPanelFunc::copyFiles() { QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; // safety KURL dest = panel->otherPanel->virtualPath(); // confirm copy krConfig->setGroup( "Advanced" ); if ( krConfig->readBoolEntry( "Confirm Copy", _ConfirmCopy ) ) { QString s; if ( fileNames.count() == 1 ) s = i18n( "Copy " ) + fileNames.first() + " " + i18n( "to" ) + ":"; else s.sprintf( i18n( "Copy %d files to:" ).local8Bit(), fileNames.count() ); // ask the user for the copy dest dest = KChooseDir::getDir(s, dest, panel->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled } KURL::List* fileUrls = files() ->vfs_getFiles( &fileNames ); // if we are not copying to the other panel : - if ( panel->otherPanel->virtualPath() != dest ) { + if ( !dest.equals( panel->otherPanel->virtualPath(), true ) ) { // you can rename only *one* file not a batch, // so a batch dest must alwayes be a directory if ( fileNames.count() > 1 ) dest.adjustPath(1); KIO::Job* job = new KIO::CopyJob( *fileUrls, dest, KIO::CopyJob::Copy, false, true ); - if ( dest.path() == panel->virtualPath().path() ) - // refresh our panel when done - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( refresh() ) ); + if ( dest.equals( panel->virtualPath(), true ) ) + // refresh our panel when done + connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( refresh() ) ); // let the other panel do the dirty job } else { //check if copy is supported if ( !otherFunc() ->files() ->vfs_isWritable() ) { KMessageBox::sorry( krApp, i18n( "You can't copy files to this file system" ) ); return ; } // finally.. otherFunc() ->files() ->vfs_addFiles( fileUrls, KIO::CopyJob::Copy, 0 ); } } void ListPanelFunc::deleteFiles(bool reallyDelete) { // check that the you have write perm if ( !files() ->vfs_isWritable() ) { KMessageBox::sorry( krApp, i18n( "You do not have write permission to this directory" ) ); return ; } // first get the selected file names list QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; krConfig->setGroup( "General" ); bool trash = krConfig->readBoolEntry( "Move To Trash", _MoveToTrash ); // now ask the user if he want to delete: krConfig->setGroup( "Advanced" ); if ( krConfig->readBoolEntry( "Confirm Delete", _ConfirmDelete ) ) { QString s, b; if ( fileNames.count() == 1 ) s = i18n( " this item?" ); else s.sprintf( i18n( " these %d items?" ).local8Bit(), fileNames.count() ); if ( !reallyDelete && trash && files() ->vfs_getType() == vfs::NORMAL ) { s = i18n( "trash" ) + s; b = i18n( "&Trash" ); } else { s = i18n( "delete" ) + s; b = i18n( "&Delete" ); } // show message // note: i'm using continue and not yes/no because the yes/no has cancel as default button if ( KMessageBox::warningContinueCancelList( krApp, i18n( "Are you sure you want to " ) + s , fileNames, i18n( "Warning" ), b ) != KMessageBox::Continue ) return ; } //we want to warn the user about non empty dir // and files he don't have permission to delete krConfig->setGroup( "Advanced" ); bool emptyDirVerify = krConfig->readBoolEntry( "Confirm Unempty Dir", _ConfirmUnemptyDir ); emptyDirVerify = ( ( emptyDirVerify ) && ( files() ->vfs_getType() == vfs::NORMAL ) ); QDir dir; for ( QStringList::Iterator name = fileNames.begin(); name != fileNames.end(); ) { vfile * vf = files() ->vfs_search( *name ); // verify non-empty dirs delete... (only for normal vfs) if ( emptyDirVerify && vf->vfile_isDir() && !vf->vfile_isSymLink() ) { dir.setPath( panel->virtualPath().path() + "/" + ( *name ) ); if ( dir.count() > 2 ) { switch ( KMessageBox::warningYesNoCancel( krApp, i18n( "Directory " ) + ( *name ) + i18n( " is not empty!\nSkip this one or Delete All?" ), QString::null, i18n( "&Skip" ), i18n( "&Delete All" ) ) ) { case KMessageBox::Cancel : return ; case KMessageBox::No : emptyDirVerify = false; break; case KMessageBox::Yes : name = fileNames.remove( name ); continue; } } } ++name; } if ( fileNames.count() == 0 ) return ; // nothing to delete // after the delete return the cursor to the first unmarked // file above the current item; panel->prepareToDelete(); // let the vfs do the job... if (reallyDelete) { // if reallyDelete, then make sure nothing gets moved to trash krConfig->setGroup("General"); krConfig->writeEntry( "Move To Trash", false ); } files() ->vfs_delFiles( &fileNames ); if (reallyDelete) { krConfig->setGroup("General"); krConfig->writeEntry( "Move To Trash", trash); } } // this is done when you double click on a file void ListPanelFunc::execute( QString& name ) { if ( name == ".." ) { dirUp(); return ; } vfile *vf = files() ->vfs_search( name ); if ( vf == 0 ) return ; KURL origin = files() ->vfs_getOrigin(); QString protocol = origin.isLocalFile() ? KrServices::registerdProtocol( vf->vfile_getMime() ) : ""; if ( protocol == "tar" || protocol == "krarc" ) { QString type = vf->vfile_getMime().right( 4 ); if ( vf->vfile_getMime().contains( "-rar" ) ) type = "-rar"; if ( !KRarcHandler::arcHandled( type ) ) // if the specified archive is disabled delete the protocol protocol = ""; } if ( vf->vfile_isDir() ) { origin = files() ->vfs_getFile( name ); panel->view->setNameToMakeCurrent( QString::null ); openUrl( origin ); } else if ( !protocol.isEmpty() ) { KURL path = files() ->vfs_getFile( vf->vfile_getName() ); path.setProtocol( protocol ); openUrl( path ); } else { KURL url = files() ->vfs_getFile( name ); KRun::runURL( url, vf->vfile_getMime() ); } } void ListPanelFunc::dirUp() { openUrl( files() ->vfs_getOrigin().upURL(), files() ->vfs_getOrigin().fileName() ); } void ListPanelFunc::pack() { QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; // safety if ( fileNames.count() == 0 ) return ; // nothing to pack // choose the default name QString defaultName = panel->virtualPath().fileName(); if ( defaultName == "" ) defaultName = "pack"; if ( fileNames.count() == 1 ) defaultName = fileNames.first(); // ask the user for archive name and packer new PackGUI( defaultName, panel->otherPanel->virtualPath().prettyURL(), fileNames.count(), fileNames.first() ); if ( PackGUI::type == QString::null ) return ; // the user canceled // check for partial URLs if( !PackGUI::destination.contains(":/") && !PackGUI::destination.startsWith("/") ){ PackGUI::destination = panel->virtualPath().prettyURL()+"/"+PackGUI::destination; } bool packToOtherPanel = ( PackGUI::destination == panel->otherPanel->virtualPath().prettyURL() ); // on remote URL-s first pack into a temp file then copy to its right place KURL destURL = vfs::fromPathOrURL( PackGUI::destination + "/" + PackGUI::filename + "." + PackGUI::type ); KTempFile *tempDestFile = 0; QString arcFile; if ( destURL.isLocalFile() ) arcFile = destURL.path(); else { tempDestFile = new KTempFile( QString::null, "." + PackGUI::type ); tempDestFile->setAutoDelete( true ); arcFile = tempDestFile->name(); QFile::remove ( arcFile ); } if ( QFileInfo( arcFile ).exists() ) { QString msg = i18n( "The Archive " ) + PackGUI::filename + "." + PackGUI::type+ i18n(" already exists. Do you want to overwrite the archive ?\n"); if( PackGUI::type == "zip" ){ msg = msg + i18n("(ZIP will replace identically named entries in the zip archive or add entries for new names)"); } else { msg = msg+ ("(all data in previous archive will be lost)"); } if ( KMessageBox::warningContinueCancel( krApp,msg,QString::null,i18n( "&Overwrite" )) == KMessageBox::Cancel ) return ; // stop operation } // tell the user to wait krApp->startWaiting( i18n( "Counting files to pack" ), 0 ); // get the files to be packed: files() ->vfs_getFiles( &fileNames ); KIO::filesize_t totalSize = 0; unsigned long totalDirs = 0, totalFiles = 0; for ( QStringList::Iterator file = fileNames.begin(); file != fileNames.end(); ++file ) { files() ->vfs_calcSpace( ( *file ), &totalSize, &totalFiles, &totalDirs ); } // download remote URL-s if necessary QString arcDir; KTempDir *tempDir = 0; if ( files() ->vfs_getOrigin().isLocalFile() ) arcDir = files() ->vfs_workingDir(); else { tempDir = new KTempDir(); tempDir->setAutoDelete( true ); arcDir = tempDir->name(); KURL::List *urlList = files() ->vfs_getFiles( &fileNames ); KIO::NetAccess::dircopy( *urlList, vfs::fromPathOrURL( arcDir ), 0 ); delete urlList; } // pack the files // we must chdir() first because we supply *names* not URL's QString save = getcwd( 0, 0 ); chdir( arcDir.local8Bit() ); KRarcHandler::pack( fileNames, PackGUI::type, arcFile, totalFiles + totalDirs ); chdir( save.local8Bit() ); // delete the temporary directory if created if ( tempDir ) delete tempDir; // copy from the temp file to it's right place if ( tempDestFile ) { KIO::NetAccess::file_move( vfs::fromPathOrURL( arcFile ), destURL ); delete tempDestFile; } if ( packToOtherPanel ) panel->otherPanel->func->refresh(); } void ListPanelFunc::testArchive() { QString arcName = panel->getCurrentName(); if ( arcName.isNull() ) return ; if ( arcName == ".." ) return ; // safety KURL arcURL = files() ->vfs_getFile( arcName ); QString type = files() ->vfs_search( arcName ) ->vfile_getMime().right( 4 ); QString url = QString::null; // download the file if it's on a remote filesystem if ( !arcURL.isLocalFile() ) { url = locateLocal( "tmp", QString( arcName ) ); if ( !KIO::NetAccess::download( arcURL, url, 0 ) ) { KMessageBox::sorry( krApp, i18n( "Krusader is unable to download: " ) + arcURL.fileName() ); return ; } } else url = arcURL.path( -1 ); // check we that archive is supported if ( !KRarcHandler::arcSupported( type ) ) { KMessageBox::sorry( krApp, i18n( "%1, unknown archive type." ).arg( arcName ) ); return ; } // test the archive if ( KRarcHandler::test( url, type ) ) KMessageBox::information( krApp, i18n( "%1, test passed." ).arg( arcName ) ); else KMessageBox::error( krApp, i18n( "%1, test failed!" ).arg( arcName ) ); // remove the downloaded file if necessary if ( url != arcURL.path( -1 ) ) QFile( url ).remove(); } void ListPanelFunc::unpack() { QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; // safety QString s; if ( fileNames.count() == 1 ) s = i18n( "Unpack " ) + fileNames[ 0 ] + " " + i18n( "to" ) + ":"; else s = i18n( "Unpack " ) + i18n( "%1 files" ).arg( fileNames.count() ) + i18n( "to" ) + ":"; // ask the user for the copy dest KURL dest = KChooseDir::getDir(s, panel->otherPanel->virtualPath(), panel->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled - bool packToOtherPanel = ( dest == panel->otherPanel->virtualPath() ); + bool packToOtherPanel = ( dest.equals( panel->otherPanel->virtualPath(), true ) ); for ( unsigned int i = 0; i < fileNames.count(); ++i ) { QString arcName = fileNames[ i ]; if ( arcName.isNull() ) return ; if ( arcName == ".." ) return ; // safety // download the file if it's on a remote filesystem KURL arcURL = files() ->vfs_getFile( arcName ); QString url = QString::null; if ( !arcURL.isLocalFile() ) { url = locateLocal( "tmp", QString( arcName ) ); if ( !KIO::NetAccess::download( arcURL, url, 0 ) ) { KMessageBox::sorry( krApp, i18n( "Krusader is unable to download: " ) + arcURL.fileName() ); continue; } } else url = arcURL.path( -1 ); // if the destination is in remote directory use temporary one instead dest.adjustPath(1); KURL originalDestURL; KTempDir *tempDir = 0; if ( !dest.isLocalFile() ) { originalDestURL = dest; tempDir = new KTempDir(); tempDir->setAutoDelete( true ); dest = tempDir->name(); } // determining the type QString mime = files() ->vfs_search( arcName ) ->vfile_getMime(); QString type = mime.right( 4 ); if ( mime.contains( "-rar" ) ) type = "-rar"; // check we that archive is supported if ( !KRarcHandler::arcSupported( type ) ) { KMessageBox::sorry( krApp, i18n( "%1, unknown archive type" ).arg( arcName ) ); continue; } // unpack the files KRarcHandler::unpack( url, type, dest.path( -1 ) ); // remove the downloaded file if necessary if ( url != arcURL.path( -1 ) ) QFile( url ).remove(); // copy files to the destination directory at remote files if ( tempDir ) { QStringList nameList = QDir( dest.path( -1 ) ).entryList(); KURL::List urlList; for ( unsigned int i = 0; i != nameList.count(); i++ ) if ( nameList[ i ] != "." && nameList[ i ] != ".." ) urlList.append( vfs::fromPathOrURL( dest.path( 1 ) + nameList[ i ] ) ); if ( urlList.count() > 0 ) KIO::NetAccess::dircopy( urlList, originalDestURL, 0 ); delete tempDir; } } if ( packToOtherPanel ) panel->otherPanel->func->refresh(); } void ListPanelFunc::calcSpace() { QStringList items; panel->view->getSelectedItems( &items ); if ( items.isEmpty() ) { panel->view->selectAllIncludingDirs(); panel->view->getSelectedItems( &items ); if ( items.isEmpty() ) return ; // nothing to do } KrCalcSpaceDialog calc( krApp, panel, items, false ); calc.exec(); KrDetailedView * view = dynamic_cast ( panel->view ); if ( !view ) return ; for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it ) { KrDetailedViewItem * viewItem = dynamic_cast ( view->findItemByName( *it ) ); if ( viewItem ) viewItem->repaintItem(); } panel->slotUpdateTotals(); } bool ListPanelFunc::calcSpace( const QStringList & items, KIO::filesize_t & totalSize, unsigned long & totalFiles, unsigned long & totalDirs ) { KrCalcSpaceDialog calc( krApp, panel, items, true ); calc.exec(); totalSize = calc.getTotalSize(); totalFiles = calc.getTotalFiles(); totalDirs = calc.getTotalDirs(); return !calc.wasCanceled(); } void ListPanelFunc::FTPDisconnect() { // you can disconnect only if connected ! if ( files() ->vfs_getType() == vfs::FTP ) { krFTPDiss->setEnabled( false ); panel->view->setNameToMakeCurrent( QString::null ); openUrl( panel->realPath() ); // open the last local URL } } void ListPanelFunc::newFTPconnection() { QString url; url = KRSpWidgets::newFTP(); // if the user canceled - quit if ( url.isEmpty() ) return ; krFTPDiss->setEnabled( true ); openUrl( url ); } void ListPanelFunc::properties() { QStringList names; panel->getSelectedNames( &names ); if ( names.isEmpty() ) return ; // no names... KFileItemList fi; fi.setAutoDelete( true ); for ( unsigned int i = 0 ; i < names.count() ; ++i ) { vfile* vf = files() ->vfs_search( names[ i ] ); if ( !vf ) continue; KURL url = files()->vfs_getFile( names[i] ); fi.append( new KFileItem( vf->vfile_getEntry(), url ) ); } if ( fi.isEmpty() ) return ; // Show the properties dialog KPropertiesDialog *dlg = new KPropertiesDialog( fi ); connect( dlg, SIGNAL( applied() ), SLOTS, SLOT( refresh() ) ); } void ListPanelFunc::refreshActions() { vfs::VFS_TYPE vfsType = files() ->vfs_getType(); // set up actions krMultiRename->setEnabled( vfsType == vfs::NORMAL ); // batch rename //krProperties ->setEnabled( vfsType == vfs::NORMAL || vfsType == vfs::FTP ); // file properties krFTPDiss ->setEnabled( vfsType == vfs::FTP ); // disconnect an FTP session /* krUnpack->setEnabled(true); // unpack archive krTest->setEnabled(true); // test archive krSelect->setEnabled(true); // select a group by filter krSelectAll->setEnabled(true); // select all files krUnselect->setEnabled(true); // unselect by filter krUnselectAll->setEnabled( true); // remove all selections krInvert->setEnabled(true); // invert the selection krFTPConnect->setEnabled(true); // connect to an ftp krFTPNew->setEnabled(true); // create a new connection krAllFiles->setEnabled(true); // show all files in list krCustomFiles->setEnabled(true); // show a custom set of files krBack->setEnabled(func->canGoBack()); // go back krRoot->setEnabled(true); // go all the way up krExecFiles->setEnabled(true); // show only executables */ } ListPanelFunc::~ListPanelFunc() { // clear the view - to avoid a repaint crash panel->view->clear(); delete files(); // delete all vfs objects } vfs* ListPanelFunc::files() { if ( !vfsP ) vfsP = KrVfsHandler::getVfs( "/", panel, 0 ); return vfsP; } void ListPanelFunc::copyToClipboard( bool move ) { QStringList fileNames; panel->getSelectedNames( &fileNames ); if ( fileNames.isEmpty() ) return ; // safety KURL::List* fileUrls = files() ->vfs_getFiles( &fileNames ); if ( fileUrls ) { KRDrag * urlData = KRDrag::newDrag( *fileUrls, move, krApp->mainView, "krusader" ); QApplication::clipboard() ->setData( urlData ); delete fileUrls; } } void ListPanelFunc::pasteFromClipboard() { QClipboard * cb = QApplication::clipboard(); QMimeSource * data = cb->data(); KURL::List urls; if ( KURLDrag::canDecode( data ) ) { KURLDrag::decode( data, urls ); bool cutSelection = KRDrag::decodeIsCutSelection( data ); KURL destUrl = panel->virtualPath(); KIO::Job* job = new KIO::CopyJob( urls, destUrl, cutSelection ? KIO::CopyJob::Move : KIO::CopyJob::Copy, false, true ); connect( job, SIGNAL( result( KIO::Job* ) ), SLOTS, SLOT( refresh() ) ); } } #include "panelfunc.moc" diff --git a/krusader/krslots.cpp b/krusader/krslots.cpp index d954e48d..ef8fd2a3 100644 --- a/krusader/krslots.cpp +++ b/krusader/krslots.cpp @@ -1,838 +1,838 @@ /*************************************************************************** krslots.cpp ------------------- copyright : (C) 2001 by Shie Erlich & Rafi Yanai email : krusader@users.sourceforge.net web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- Description *************************************************************************** A db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD S o u r c e F i l e *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include #include // KDE includes #include #include #include #include #include #include #include #include #include #include #include #ifdef __KJSEMBED__ #include #endif // Krusader includes #include "krslots.h" #include "krusader.h" #include "krusaderview.h" #include "Panel/listpanel.h" #include "Panel/krselectionmode.h" #include "Dialogs/krdialogs.h" #include "Dialogs/krspwidgets.h" #include "GUI/krusaderstatus.h" #include "RemoteMan/remoteman.h" #include "Panel/panelfunc.h" #include "Konfigurator/konfigurator.h" #include "MountMan/kmountman.h" #include "defaults.h" #include "resources.h" #include "GUI/kfnkeys.h" #include "GUI/kcmdline.h" #include "GUI/syncbrowsebutton.h" #include "VFS/krquery.h" #include "Search/krsearchmod.h" #include "Search/krsearchdialog.h" #include "Locate/locate.h" #include "VFS/vfs.h" #include "panelmanager.h" #include "Splitter/splittergui.h" #include "Splitter/splitter.h" #include "Splitter/combiner.h" #include "UserMenu/usermenu.h" #include "Panel/panelpopup.h" #include "Synchronizer/synchronizergui.h" #include "DiskUsage/diskusagegui.h" #include "krservices.h" #include "Panel/krviewitem.h" #define REFRESH_BOTH_PANELS { ListPanel *p=ACTIVE_PANEL; \ MAIN_VIEW->left->func->refresh(); \ MAIN_VIEW->right->func->refresh();\ p->slotFocusOnMe(); } #define ACTIVE_PANEL_MANAGER (ACTIVE_PANEL == krApp->mainView->left ? krApp->mainView->leftMng : \ krApp->mainView->rightMng) void KRslots::sendFileByEmail(QString filename) { QString mailProg; QStringList lst = Krusader::supportedTools(); if (lst.contains("MAIL")) mailProg=lst[lst.findIndex("MAIL") + 1]; else { KMessageBox::error(0,i18n("Krusader can't find a supported mail client. Please install one to your path. Hint: Krusader supports Kmail.")); return; } KShellProcess proc; if ( vfs::fromPathOrURL( mailProg ).fileName() == "kmail") { proc << "kmail" << "--subject \""+i18n("Sending file: ")+ filename.mid(filename.findRev('/')+1)+"\"" << QString::null + "--attach "+"\"" + filename + "\""; } if (!proc.start(KProcess::DontCare)) KMessageBox::error(0,i18n("Error executing ")+mailProg+" !"); else proc.detach(); } void KRslots::compareContent() { QStringList lstLeft, lstRight; QStringList* lstActive; KURL name1, name2; MAIN_VIEW->left->getSelectedNames( &lstLeft ); MAIN_VIEW->right->getSelectedNames( &lstRight ); lstActive = ( ACTIVE_PANEL->isLeft() ? &lstLeft : &lstRight ); if ( lstLeft.count() == 1 && lstRight.count() == 1 ) { // first, see if we've got exactly 1 selected file in each panel: name1 = MAIN_VIEW->left->func->files()->vfs_getFile( lstLeft[0] ); name2 = MAIN_VIEW->right->func->files()->vfs_getFile( lstRight[0] ); } else if ( lstActive->count() == 2 ) { // next try: are in the current panel exacty 2 files selected? name1 = ACTIVE_PANEL->func->files()->vfs_getFile( (*lstActive)[0] ); name2 = ACTIVE_PANEL->func->files()->vfs_getFile( (*lstActive)[1] ); } else if ( ACTIVE_PANEL->otherPanel->func->files()->vfs_search( ACTIVE_PANEL->view->getCurrentItem() ) ) { // next try: is in the other panel a file with the same name? name1 = ACTIVE_PANEL->func->files()->vfs_getFile( ACTIVE_PANEL->view->getCurrentItem() ); name2 = ACTIVE_PANEL->otherPanel->func->files()->vfs_getFile( ACTIVE_PANEL->view->getCurrentItem() ); } else { // if we got here, then we can't be sure what file to diff KMessageBox::detailedError(0,i18n("Don't know which files to compare."), i18n("To compare 2 files by content, you can either\n" "- select (mark) one file in the left panel, and one in the right panel\n" "- select exactly two files in the active panel\n" "- make sure there is a file in the other panel, with the same name as the current file in the active panel")); return; } // else implied: all ok, let's call kdiff // but if one of the files isn't local, download them first compareContent( name1, name2 ); } class KrProcess: public KProcess { QString tmp1, tmp2; public: KrProcess( QString in1, QString in2 ) { tmp1 = in1; tmp2 = in2; } virtual void processHasExited (int ) { if( !tmp1.isEmpty() ) KIO::NetAccess::removeTempFile( tmp1 ); if( !tmp2.isEmpty() ) KIO::NetAccess::removeTempFile( tmp2 ); delete this; } }; void KRslots::compareContent( KURL url1, KURL url2 ) { QString diffProg; QStringList lst = Krusader::supportedTools(); if (lst.contains("DIFF")) diffProg=lst[lst.findIndex("DIFF") + 1]; else { KMessageBox::error(0,i18n("Krusader can't find any of the supported diff-frontends. Please install one to your path. Hint: Krusader supports Kompare, Kdiff3 and Xxdiff.")); return; } QString tmp1 = QString::null, tmp2 = QString::null; if (!url1.isLocalFile()) { if( !KIO::NetAccess::download( url1, tmp1, 0 ) ){ KMessageBox::sorry(krApp,i18n("Krusader is unable to download: ")+url1.fileName()); return; } } else tmp1 = url1.path(); if (!url2.isLocalFile()) { if( !KIO::NetAccess::download( url2, tmp2, 0 ) ){ KMessageBox::sorry(krApp,i18n("Krusader is unable to download: ")+url2.fileName()); if( tmp1 != url1.path() ) KIO::NetAccess::removeTempFile( tmp1 ); return; } } else tmp2 = url2.path(); KrProcess *p = new KrProcess( tmp1 != url1.path() ? tmp1 : QString::null, tmp2 != url2.path() ? tmp2 : QString::null ); *p << diffProg << tmp1 << tmp2; if (!p->start(KProcess::DontCare)) KMessageBox::error(0,i18n("Error executing ")+diffProg+" !"); } void KRslots::rightclickMenu() { ACTIVE_PANEL->popRightClickMenu( ACTIVE_PANEL->mapToGlobal( dynamic_cast(ACTIVE_PANEL->view)->itemRect(dynamic_cast (ACTIVE_PANEL->view->getCurrentKrViewItem())).topLeft() ) ); } void KRslots::addBookmark(){ // TODO: this no longer works! } // GUI toggle slots void KRslots::toggleFnkeys(){ if( MAIN_VIEW->fnKeys->isVisible() ) MAIN_VIEW->fnKeys->hide(); else MAIN_VIEW->fnKeys->show(); } void KRslots::toggleCmdline(){ if( MAIN_VIEW->cmdLine->isVisible() ) MAIN_VIEW->cmdLine->hide(); else MAIN_VIEW->cmdLine->show(); } void KRslots::toggleToolbar() { if (krApp->toolBar()->isVisible()) krApp->toolBar()->hide(); else krApp->toolBar()->show(); } void KRslots::toggleActionsToolbar() { if (krApp->toolBar("actionsToolBar")->isVisible()) krApp->toolBar("actionsToolBar")->hide(); else krApp->toolBar("actionsToolBar")->show(); } void KRslots::toggleStatusbar() { if (krApp->statusBar()->isVisible()) krApp->statusBar()->hide(); else krApp->statusBar()->show(); } void KRslots::toggleTerminal() { if( MAIN_VIEW->terminal_dock->isVisible() ) MAIN_VIEW->slotTerminalEmulator(false); else MAIN_VIEW->slotTerminalEmulator(true); } void KRslots::showAboutApplication() { KRAbout *q=new KRAbout(); q->exec(); } void KRslots::insertFileName(bool full_path) { QString filename = ACTIVE_PANEL->view->getCurrentItem(); if( filename == QString::null ) return; if( full_path ){ QString path=ACTIVE_FUNC->files()->vfs_getOrigin().prettyURL(1,KURL::StripFileProtocol); filename = path+filename; } QString current = MAIN_VIEW->cmdLine->text(); if( current.length() != 0 && !current.endsWith( " " ) ) current += " "; MAIN_VIEW->cmdLine->setText( current + filename ); } // directory list functions void KRslots::allFilter() { ACTIVE_PANEL->setFilter(KrViewProperties::All); } void KRslots::execFilter() { ACTIVE_PANEL->setFilter(KrViewProperties::All); } void KRslots::customFilter() { ACTIVE_PANEL->setFilter(KrViewProperties::Custom); } void KRslots::markAll() { ACTIVE_PANEL->select(true,true); } void KRslots::unmarkAll() { ACTIVE_PANEL->select(false,true); } void KRslots::markGroup() { ACTIVE_PANEL->select(true,false); } void KRslots::markGroup(const QString& mask, bool select) { ACTIVE_PANEL->select(mask, select); } void KRslots::unmarkGroup() { ACTIVE_PANEL->select(false,false); } void KRslots::invert() { ACTIVE_PANEL->invertSelection(); } void KRslots::root() { ACTIVE_FUNC->openUrl(vfs::fromPathOrURL("/"));} void KRslots::refresh(const KURL& u){ ACTIVE_FUNC->openUrl(u); } void KRslots::home() { ACTIVE_FUNC->openUrl(QDir::homeDirPath()); } void KRslots::refresh() { ACTIVE_FUNC->refresh(); } void KRslots::properties() { ACTIVE_FUNC->properties(); } void KRslots::dirUp() { ACTIVE_FUNC->dirUp(); } void KRslots::back() { ACTIVE_FUNC->goBack(); } void KRslots::slotPack() { ACTIVE_FUNC->pack(); } void KRslots::slotUnpack() { ACTIVE_FUNC->unpack(); } void KRslots::testArchive() { ACTIVE_FUNC->testArchive(); } void KRslots::calcSpace() { ACTIVE_FUNC->calcSpace(); } void KRslots::FTPDisconnect() { ACTIVE_FUNC->FTPDisconnect(); } void KRslots::newFTPconnection(){ ACTIVE_FUNC->newFTPconnection(); } void KRslots::cut() { ACTIVE_FUNC->copyToClipboard( true ); } void KRslots::copy() { ACTIVE_FUNC->copyToClipboard( false ); } void KRslots::paste() { ACTIVE_FUNC->pasteFromClipboard(); } // run external modules / programs void KRslots::runKonfigurator(bool firstTime) { krConfig->setGroup( "Look&Feel" ); int size = (krConfig->readEntry("Filelist Icon Size",_FilelistIconSize)).toInt(); Konfigurator *konfigurator = new Konfigurator(firstTime); if( konfigurator->isGUIRestartNeeded() ) { krConfig->setGroup( "Look&Feel" ); if((krConfig->readEntry("Filelist Icon Size",_FilelistIconSize)).toInt() != size ) QPixmapCache::clear(); MAIN_VIEW->leftMng->slotRecreatePanels(); MAIN_VIEW->rightMng->slotRecreatePanels(); MAIN_VIEW->fnKeys->updateShortcuts(); KrSelectionMode::resetSelectionHandler(); } delete konfigurator; } void KRslots::toggleHidden(){ krConfig->setGroup("Look&Feel"); bool show = !krConfig->readBoolEntry("Show Hidden",_ShowHidden); krApp->actToggleHidden->setChecked(show); krConfig->writeEntry("Show Hidden",show); REFRESH_BOTH_PANELS; } void KRslots::toggleSwapPanels(){ QValueList lst = MAIN_VIEW->horiz_splitter->sizes(); MAIN_VIEW->horiz_splitter->moveToLast( MAIN_VIEW->leftMng ); int old = lst[ 0 ]; lst[ 0 ] = lst [ 1 ]; lst[ 1 ] = old; MAIN_VIEW->horiz_splitter->setSizes( lst ); ListPanel *tmpPanel; // temporary variables for swapping PanelManager *tmpMng; tmpMng = MAIN_VIEW->leftMng; MAIN_VIEW->leftMng = MAIN_VIEW->rightMng; MAIN_VIEW->rightMng = tmpMng; tmpPanel = MAIN_VIEW->left; MAIN_VIEW->left = MAIN_VIEW->right; MAIN_VIEW->right = tmpPanel; MAIN_VIEW->leftMng->swapPanels(); MAIN_VIEW->rightMng->swapPanels(); MAIN_VIEW->left->updateGeometry(); MAIN_VIEW->right->updateGeometry(); } void KRslots::search() { new KrSearchDialog(); } void KRslots::locate() { if( !KrServices::cmdExist( "locate" ) ) { KMessageBox::error(krApp, i18n( "Can't find the 'locate' command. Please install the " "findutils-locate package of GNU, or set its dependencies in " "Konfigurator" )); return; } LocateDlg *loc = new LocateDlg(); delete loc; } void KRslots::runRemoteMan() { // display outage information KMessageBox::information(krApp, i18n( "Important: RemoteMan has been replaced by our new bookmark manager. " "The new manager handles local files and remote URLs the same way. " "RemoteMan is being left around to allow an easier transition and " "give you a chance to move your bookmarks. IT WILL BE REMOVED SOON!" "\n" "Try the new bookmark-manager: open a new remote connection, once " "done, press the bookmark button, select 'Add bookmark' and that's it!")); QString host=remoteMan::getHost(); if (host==QString::null) return; // otherwise, attempt a connection ACTIVE_FUNC->openUrl(vfs::fromPathOrURL(host)); } void KRslots::runMountMan() { // left as a precaution, although we use kde's services now if( !KrServices::cmdExist( "df" ) || !KrServices::cmdExist( "mount" ) ) { KMessageBox::error(0, i18n("Can't start 'mount'! Check the 'Dependencies' page in konfigurator.")); return; } krApp->mountMan->mainWindow(); } void KRslots::homeTerminal(){ QString save = getcwd(0,0); chdir (QDir::homeDirPath().local8Bit()); KProcess proc; krConfig->setGroup("General"); QString term = krConfig->readEntry("Terminal",_Terminal); proc << KrServices::separateArgs( term ); if( term.contains( "konsole" ) ) /* KDE 3.2 bug (konsole is killed by pressing Ctrl+C) */ { /* Please remove the patch if the bug is corrected */ proc << "&"; proc.setUseShell( true ); } if(!proc.start(KProcess::DontCare)) KMessageBox::sorry(krApp,i18n("Can't open ")+"\""+term+"\""); chdir(save.local8Bit()); } void KRslots::sysInfo(){ KProcess proc; proc << "kcmshell" << "System/ksysctrl"; if (!proc.start(KProcess::DontCare)){ KMessageBox::sorry(krApp,i18n("Can't find \"KsysCtrl\". Please install KDE admin package")); } } void KRslots::multiRename(){ QStringList lst = Krusader::supportedTools(); int i = lst.findIndex("RENAME"); if (i == -1){ KMessageBox::sorry(krApp,i18n("Can't find a batch rename tool.\nYou can get Krename at http://www.krename.net")); return; } QString pathToRename = lst[i+1]; QStringList names; ((ListPanel*)ACTIVE_PANEL)->getSelectedNames(&names); KURL::List* urls = ACTIVE_FUNC->files()->vfs_getFiles(&names); if( urls->isEmpty() ){ delete urls; return; } KShellProcess proc; proc << pathToRename; for( KURL::List::iterator u=urls->begin(); u != urls->end(); ++u){ if( QFileInfo((*u).path()).isDir() ) proc << "-r"; proc << "\"" + (*u).path() + "\""; // patch thanks to Tobias Vogele } proc.start(KProcess::DontCare); delete urls; } void KRslots::rootKrusader() { if( !KrServices::cmdExist( "krusader" ) || !KrServices::cmdExist( "kdesu" ) ) { KMessageBox::sorry( krApp, i18n( "Can't start root mode krusader, because krusader or kdesu is missing from the path. Please configure the dependencies in Konfigurator!" ) ); return; } KShellProcess proc; proc << KrServices::fullPathName( "kdesu" ) << QString("'") + KrServices::fullPathName( "krusader" ) + " --left=\"" +MAIN_VIEW->left->func->files()->vfs_getOrigin().url() + "\" --right=\""+MAIN_VIEW->right->func->files()->vfs_getOrigin().url() + "\"'"; proc.start(KProcess::DontCare); } // settings slots void KRslots::configToolbar(){ KEditToolbar dlg(krApp->factory()); if (dlg.exec()) krApp->updateGUI(); } void KRslots::configKeys(){ KKeyDialog::configure(krApp->actionCollection(), 0, true); } // misc void KRslots::changeTrashIcon(){ // update trash bin icon - this is "stolen" konqi code // Copyright (C) 2000 David Faure KURL trash; trash.setPath(KGlobalSettings::trashPath()); KURL::List lst; lst.append(trash); KDirNotify_stub allDirNotify("*","KDirNotify*"); allDirNotify.FilesChanged( lst ); // end of konqi code } // F2 void KRslots::terminal() { ACTIVE_FUNC->terminal(); } // F3 void KRslots::view() { ACTIVE_FUNC->view(); } // F4 void KRslots::edit() { ACTIVE_FUNC->editFile(); } // F5 void KRslots::copyFiles() { ACTIVE_FUNC->copyFiles(); } // F6 void KRslots::moveFiles() { ACTIVE_FUNC->moveFiles(); } // F7 void KRslots::mkdir() { ACTIVE_FUNC->mkdir(); } // F8 void KRslots::deleteFiles(bool reallyDelete) { ACTIVE_FUNC->deleteFiles(reallyDelete);} // F9 void KRslots::rename() { ACTIVE_FUNC->rename(); } // Shift F3 void KRslots::viewDlg(){ // ask the user for a url to view KURL dest = KChooseDir::getDir(i18n("Enter a URL to view:"), ACTIVE_PANEL->virtualPath(), ACTIVE_PANEL->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled KrViewer::view( dest ); // view the file // } // nothing more to it! } // Shift F4 void KRslots::editDlg(){ // ask the user for the filename to edit KURL dest = KChooseDir::getDir(i18n("Enter the filename to edit:"), ACTIVE_PANEL->virtualPath(), ACTIVE_PANEL->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled KrViewer::edit( dest, true ); } void KRslots::duplicateTab() { ACTIVE_PANEL_MANAGER->slotNewTab(ACTIVE_PANEL->virtualPath()); } // ugly: do this right before release! void KRslots::newTab(const KURL& url) { if (url.isValid()) ACTIVE_PANEL_MANAGER->slotNewTab(url); else ACTIVE_PANEL_MANAGER->slotNewTab(); } void KRslots::nextTab() { ACTIVE_PANEL_MANAGER->slotNextTab(); } void KRslots::previousTab() { ACTIVE_PANEL_MANAGER->slotPreviousTab(); } void KRslots::newTab(QListViewItem *item) { if (!item) return; KrViewItem *it = dynamic_cast(item); if (it->isDir()) { KURL url = ACTIVE_PANEL->virtualPath(); url.addPath( it->name() ); ACTIVE_PANEL_MANAGER->slotNewTab( url ); } } void KRslots::closeTab() { ACTIVE_PANEL_MANAGER->slotCloseTab(); } void KRslots::slotSplit() { QStringList list; QString name; ((ListPanel*)ACTIVE_PANEL)->getSelectedNames(&list); // first, see if we've got exactly 1 selected file, if not, try the current one if (list.count() == 1) name = list[0]; if ( name.isEmpty() ) { // if we got here, then one of the panel can't be sure what file to diff KMessageBox::error(0,i18n("Don't know which file to split.")); return; } QString fileName = ACTIVE_FUNC->files()->vfs_getFile(name).prettyURL(-1,KURL::StripFileProtocol); if( fileName == QString::null ) return; if ( ACTIVE_FUNC->files()->vfs_search( name )->vfile_isDir() ) { KMessageBox::sorry( krApp, i18n( "You can't split a directory!" ) ); return ; } QString destDir = ACTIVE_PANEL->otherPanel->func->files()->vfs_getOrigin().prettyURL(-1,KURL::StripFileProtocol); SplitterGUI splitterGUI( MAIN_VIEW, fileName, destDir ); if( splitterGUI.result() == QDialog::Accepted ) { bool splitToOtherPanel = ( splitterGUI.getDestinationDir() == ACTIVE_PANEL->otherPanel->virtualPath().prettyURL() ); Splitter split( MAIN_VIEW, fileName, splitterGUI.getDestinationDir() ); split.split( splitterGUI.getSplitSize() ); if ( splitToOtherPanel ) ACTIVE_PANEL->otherPanel->func->refresh(); } } void KRslots::slotCombine(){ QStringList list; KURL baseURL; bool unixStyle = false; bool windowsStyle = false; QString commonName = QString::null; unsigned int commonLength = 0; ((ListPanel*)ACTIVE_PANEL)->getSelectedNames(&list); if ( list.isEmpty() ) { KMessageBox::error(0,i18n("Don't know which files to combine.")); return; } /* checking splitter names */ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { KURL url = ACTIVE_FUNC->files()->vfs_getFile(*it); if( url.isEmpty() ) return; if ( ACTIVE_FUNC->files()->vfs_search( *it )->vfile_isDir() ) { KMessageBox::sorry( krApp, i18n( "You can't combine a directory!" ) ); return ; } if( !unixStyle ) { QString name = url.fileName(); int extPos = name.findRev( '.' ); QString ext = name.mid( extPos + 1 ); name.truncate( extPos ); url.setFileName( name ); bool isExtInt; ext.toInt( &isExtInt, 10 ); if( extPos < 1 || ext.isEmpty() || ( ext != "crc" && !isExtInt ) ) { if( windowsStyle ) { KMessageBox::error(0,i18n("Not a split file %1!").arg( url.prettyURL(0, KURL::StripFileProtocol ) )); return; } unixStyle = true; } else { if( ext != "crc" ) windowsStyle = true; if( baseURL.isEmpty() ) baseURL = url; else if( baseURL != url ) { KMessageBox::error(0,i18n("Select only one split file!")); return; } } } if( unixStyle ) { bool error = true; do { QString shortName = *it; QChar lastChar = shortName.at( shortName.length()-1 ); if( lastChar.isLetter() ) { char fillLetter = ( lastChar.upper() == lastChar ) ? 'A' : 'a'; if( commonName.isNull() ) { commonLength = shortName.length(); commonName = shortName; while ( commonName.length() ) { QString shorter = commonName.left( commonName.length() - 1 ); QString testFile = shorter.leftJustify( commonLength, fillLetter ); if( ACTIVE_FUNC->files()->vfs_search( testFile ) == 0 ) break; else { commonName = shorter; baseURL = ACTIVE_FUNC->files()->vfs_getOrigin(); baseURL.addPath( testFile ); } } error = ( commonName == shortName ); } else if( commonLength == shortName.length() && shortName.startsWith( commonName ) ) error = false; } }while ( false ); if( error ) { KMessageBox::error(0,i18n("Not a splitted file %1!").arg( url.prettyURL(0, KURL::StripFileProtocol ) )); return; } } } // ask the user for the copy dest KURL dest = KChooseDir::getDir(i18n("Combining %1.* to directory:" ).arg( baseURL.prettyURL( 0, KURL::StripFileProtocol ) ), ACTIVE_PANEL->otherPanel->virtualPath(), ACTIVE_PANEL->virtualPath()); if ( dest.isEmpty() ) return ; // the user canceled - bool combineToOtherPanel = ( dest == ACTIVE_PANEL->otherPanel->virtualPath() ); + bool combineToOtherPanel = ( dest.equals( ACTIVE_PANEL->otherPanel->virtualPath(), true ) ); Combiner combine( MAIN_VIEW, baseURL, dest, unixStyle ); combine.combine(); if ( combineToOtherPanel ) ACTIVE_PANEL->otherPanel->func->refresh(); } void KRslots::userMenu() { //UserMenu um; //um.exec(); krApp->userMenu->exec(); } void KRslots::manageUseractions() { Konfigurator konfigurator( false, 7 ); // page 7 are the UserActions } void KRslots::slotSynchronizeDirs() { SynchronizerGUI *sync = new SynchronizerGUI( MAIN_VIEW, MAIN_VIEW->left->func->files()->vfs_getOrigin().prettyURL(0,KURL::StripFileProtocol), MAIN_VIEW->right->func->files()->vfs_getOrigin().prettyURL(0,KURL::StripFileProtocol) ); bool refresh = sync->wasSynchronization(); delete sync; if( refresh ) REFRESH_BOTH_PANELS; } void KRslots::slotSyncBrowse() { ACTIVE_PANEL->syncBrowseButton->toggle(); } void KRslots::updatePopupPanel(QListViewItem *it) { // which panel to display on? ListPanel *lp = 0; if (ACTIVE_PANEL->popup->isHidden() && ACTIVE_PANEL->otherPanel->popup->isHidden()) return; if (ACTIVE_PANEL->popup->isShown()) lp = ACTIVE_PANEL; else if (ACTIVE_PANEL->otherPanel->popup->isShown()) lp = ACTIVE_PANEL->otherPanel; KrViewItem *item = dynamic_cast(it); KURL url; if (item->name()!="..") // updir url = ACTIVE_FUNC->files()->vfs_getFile(item->name()); lp->popup->update(url); } void KRslots::compareDirs() { ACTIVE_PANEL->compareDirs(); ACTIVE_PANEL->otherPanel->compareDirs(); } void KRslots::compareSetup() { for( int i=0; Krusader::compareArray[i] != 0; i++ ) if( (*Krusader::compareArray[i])->isChecked() ) { krConfig->setGroup( "Private" ); krConfig->writeEntry( "Compare Mode", i ); break; } } void KRslots::togglePopupPanel() { ACTIVE_PANEL->togglePanelPopup(); } void KRslots::slotDiskUsage() { DiskUsageGUI du( ACTIVE_FUNC->files()->vfs_getOrigin().prettyURL(1,KURL::StripFileProtocol), MAIN_VIEW, "DiskUsage" ); } // when window becomes focused, enable the refresh in the visible panels void KRslots::windowActive() { MAIN_VIEW->left->panelActive(); MAIN_VIEW->right->panelActive(); } // when another application becomes focused, do a windows-commander style refresh: don't // refresh at all until krusader becomes focused again void KRslots::windowInactive() { MAIN_VIEW->left->panelInactive(); MAIN_VIEW->right->panelInactive(); } //shows the JavaScript-Console void KRslots::jsConsole() { #ifdef __KJSEMBED__ krJS->view()->show(); #endif } #include "krslots.moc"